Re: [RFC PATCH 0/5] powerpc: make iowrite32be etc. inline

2019-10-31 Thread Rasmus Villemoes
On 31/10/2019 01.31, Rasmus Villemoes wrote: > At first I tried something that wouldn't need to touch anything > outside arch/powerpc/, but I ended up with conditional inclusion of > asm-generic headers and/or duplicating a lot of their contents. Urrgh, this is much worse than I feared. Already 1

[PATCH] powerpc/xive: Prevent page fault issues in the machine crash handler

2019-10-31 Thread Cédric Le Goater
When the machine crash handler is invoked, all interrupts are masked but interrupts which have not been started yet do not have an ESB page mapped in the Linux address space. This crashes the 'crash kexec' sequence on sPAPR guests. To fix, force the mapping of the ESB page when an interrupt is bei

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-31 Thread Aneesh Kumar K.V
On 10/31/19 12:00 PM, Dan Williams wrote: On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V wrote: [..] All that said, the x86 vmemmap_populate() falls back to use small pages in some case to get around this constraint. Can't powerpc do the same? It would seem to be less work than the above

Re: [PATCH v3] cpufreq: powernv: fix stack bloat and hard limit on num cpus

2019-10-31 Thread Viresh Kumar
On Thu, 31 Oct 2019 at 10:52, John Hubbard wrote: > > The following build warning occurred on powerpc 64-bit builds: > > drivers/cpufreq/powernv-cpufreq.c: In function 'init_chip_info': > drivers/cpufreq/powernv-cpufreq.c:1070:1: warning: the frame size of > 1040 bytes is larger than 1024 bytes [-

Re: [PATCH v10 1/5] kasan: support backing vmalloc space with real shadow memory

2019-10-31 Thread Daniel Axtens
Uladzislau Rezki writes: > Hello, Daniel > >> >> @@ -1294,14 +1299,19 @@ static bool __purge_vmap_area_lazy(unsigned long >> start, unsigned long end) >> spin_lock(&free_vmap_area_lock); >> llist_for_each_entry_safe(va, n_va, valist, purge_list) { >> unsigned long nr = (

[PATCH v11 0/4] kasan: support backing vmalloc space with real shadow memory

2019-10-31 Thread Daniel Axtens
Currently, vmalloc space is backed by the early shadow page. This means that kasan is incompatible with VMAP_STACK. This series provides a mechanism to back vmalloc space with real, dynamically allocated memory. I have only wired up x86, because that's the only currently supported arch I can work

[PATCH v11 1/4] kasan: support backing vmalloc space with real shadow memory

2019-10-31 Thread Daniel Axtens
Hook into vmalloc and vmap, and dynamically allocate real shadow memory to back the mappings. Most mappings in vmalloc space are small, requiring less than a full page of shadow space. Allocating a full shadow page per mapping would therefore be wasteful. Furthermore, to ensure that different mapp

[PATCH v11 2/4] kasan: add test for vmalloc

2019-10-31 Thread Daniel Axtens
Test kasan vmalloc support by adding a new test to the module. Reviewed-by: Andrey Ryabinin Signed-off-by: Daniel Axtens -- v5: split out per Christophe Leroy --- lib/test_kasan.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/lib/test_kasan.c b/lib/test_kasan

[PATCH v11 3/4] fork: support VMAP_STACK with KASAN_VMALLOC

2019-10-31 Thread Daniel Axtens
Supporting VMAP_STACK with KASAN_VMALLOC is straightforward: - clear the shadow region of vmapped stacks when swapping them in - tweak Kconfig to allow VMAP_STACK to be turned on with KASAN Reviewed-by: Dmitry Vyukov Reviewed-by: Andrey Ryabinin Signed-off-by: Daniel Axtens --- arch/Kconfig

[PATCH v11 4/4] x86/kasan: support KASAN_VMALLOC

2019-10-31 Thread Daniel Axtens
In the case where KASAN directly allocates memory to back vmalloc space, don't map the early shadow page over it. We prepopulate pgds/p4ds for the range that would otherwise be empty. This is required to get it synced to hardware on boot, allowing the lower levels of the page tables to be filled d

Re: [PATCH RFC 1/5] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Nicolas Saenz Julienne
On Wed, 2019-10-30 at 14:49 -0700, Christoph Hellwig wrote: > On Mon, Oct 14, 2019 at 08:31:03PM +0200, Nicolas Saenz Julienne wrote: > > Some architectures, notably ARM, are interested in tweaking this > > depending on their runtime DMA addressing limitations. > > > > Signed-off-by: Nicolas Saenz

Re: [PATCH] powerpc/xive: Prevent page fault issues in the machine crash handler

2019-10-31 Thread Greg Kurz
On Thu, 31 Oct 2019 07:31:00 +0100 Cédric Le Goater wrote: > When the machine crash handler is invoked, all interrupts are masked > but interrupts which have not been started yet do not have an ESB page > mapped in the Linux address space. This crashes the 'crash kexec' > sequence on sPAPR guests

Re: [PATCH RFC 1/5] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Christoph Hellwig
On Thu, Oct 31, 2019 at 11:30:36AM +0100, Nicolas Saenz Julienne wrote: > On Wed, 2019-10-30 at 14:49 -0700, Christoph Hellwig wrote: > > On Mon, Oct 14, 2019 at 08:31:03PM +0200, Nicolas Saenz Julienne wrote: > > > Some architectures, notably ARM, are interested in tweaking this > > > depending on

[PATCH] powerpc/sysdev: drop simple gpio

2019-10-31 Thread Christophe Leroy
There is a config item CONFIG_SIMPLE_GPIO which provides simple memory mapped GPIOs specific to powerpc. However, the only platform which selects this option is mpc5200, and this platform doesn't use it. There are three boards calling simple_gpiochip_init(), but as they don't select CONFIG_SIMPLE

Re: [RFC PATCH 0/5] powerpc: make iowrite32be etc. inline

2019-10-31 Thread Arnd Bergmann
On Thu, Oct 31, 2019 at 8:39 AM Rasmus Villemoes wrote: > On 31/10/2019 01.31, Rasmus Villemoes wrote: > > So sorry for the noise. Maybe I'll just have to bite the bullet and > introduce private qe_iowrite32be etc. and define them based on $ARCH. > Any better ideas would be much appreciated. We u

[PATCH v1 01/12] powerpc/pseries: CMM: Implement release() function for sysfs device

2019-10-31 Thread David Hildenbrand
When unloading the module, one gets [ 548.188594] [ cut here ] [ 548.188596] Device 'cmm0' does not have a release() function, it is broken and must be fixed. See Documentation/kobject.txt. [ 548.188622] WARNING: CPU: 0 PID: 19308 at drivers/base/core.c:1244 .device_rel

[PATCH v1 02/12] powerpc/pseries: CMM: Report errors when registering notifiers fails

2019-10-31 Thread David Hildenbrand
If we don't set the rc, we will return "0", making it look like we succeeded. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andrew Morton Cc: Pavel Tatashin Cc: Richard Fontana Cc: Allison Randal Cc: Thomas Gleixner Cc: Arun KS Signed-off-by: David Hildenbrand --

[PATCH v1 00/12] powerpc/pseries: CMM: Implement balloon compaction and remove isolate notifier

2019-10-31 Thread David Hildenbrand
This is the follow-up of: https://lkml.org/lkml/2019/9/10/711 We can get rid of the memory isolate notifier by switching to balloon compaction in powerpc's CMM (Collaborative Memory Management). The memory isolate notifier was only necessary to allow to offline memory blocks that contain i

[PATCH v1 03/12] powerpc/pseries: CMM: Cleanup rc handling in cmm_init()

2019-10-31 Thread David Hildenbrand
No need to initialize rc. Also, let's return 0 directly when succeeding. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Greg Kroah-Hartman Cc: Michal Hocko Cc: Konstantin Khlebnikov Cc: Andrew Morton Cc: Arun KS Cc: Thomas Gleixner Signed-off-by: David Hildenbrand

[PATCH v1 04/12] powerpc/pseries: CMM: Drop page array

2019-10-31 Thread David Hildenbrand
We can simply store the pages in a list (page->lru), no need for a separate data structure (+ complicated handling). This is how most other balloon drivers store allocated pages without additional tracking data. For the notifiers, use page_to_pfn() to check if a page is in the applicable range. Us

[PATCH v1 05/12] powerpc/pseries: CMM: Use adjust_managed_page_count() insted of totalram_pages_*

2019-10-31 Thread David Hildenbrand
adjust_managed_page_count() performs a totalram_pages_add(), but also adjust the managed pages of the zone. Let's use that instead, similar to virtio-balloon. Use it before freeing a page. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andrew Morton Cc: Pavel Tatashin

[PATCH v1 06/12] powerpc/pseries: CMM: Rip out memory isolate notifier

2019-10-31 Thread David Hildenbrand
The memory isolate notifier was added to allow to offline memory blocks that contain inflated/"loaned" pages. We can achieve the same using the balloon compaction framework. Get rid of the memory isolate notifier. Also, we can get rid of cmm_mem_going_offline(), as we will never reach that code pa

[PATCH v1 07/12] powerpc/pseries: CMM: Convert loaned_pages to an atomic_long_t

2019-10-31 Thread David Hildenbrand
When switching to balloon compaction, we want to drop the cmm_lock and completely rely on the balloon compaction list lock internally. loaned_pages is currently protected under the cmm_lock. Note: Right now cmm_alloc_pages() and cmm_free_pages() can be called at the same time, e.g., via the thread

[PATCH v1 08/12] powerpc/pseries: CMM: Implement balloon compaction

2019-10-31 Thread David Hildenbrand
We can now get rid of the cmm_lock and completely rely on the balloon compaction internals, which now also manage the page list and the lock. Inflated/"loaned" pages are now movable. Memory blocks that contain such apges can get offlined. Also, all such pages will be marked PageOffline() and can t

[PATCH v1 09/12] powerpc/pseries: CMM: Switch to balloon_page_alloc()

2019-10-31 Thread David Hildenbrand
balloon_page_alloc() will use GFP_HIGHUSER_MOVABLE in case we have CONFIG_BALLOON_COMPACTION. This is now possible, as balloon pages are movable with CONFIG_BALLOON_COMPACTION. Without CONFIG_BALLOON_COMPACTION, GFP_HIGHUSER is used. Note that apart from that, balloon_page_alloc() uses the followi

[PATCH v1 11/12] mm: remove the memory isolate notifier

2019-10-31 Thread David Hildenbrand
Luckily, we have no users left, so we can get rid of it. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Andrew Morton Cc: Pavel Tatashin Cc: Michal Hocko Cc: Dan Williams Cc: Oscar Salvador Cc: Qian Cai Cc: Anshuman Khandual Cc: Pingfan Liu Signed-off-by: David Hildenbrand --- driv

[PATCH v1 12/12] mm: remove "count" parameter from has_unmovable_pages()

2019-10-31 Thread David Hildenbrand
Now that the memory isolate notifier is gone, the parameter is always 0. Drop it and cleanup has_unmovable_pages(). Cc: Michal Hocko Cc: Andrew Morton Cc: Oscar Salvador Cc: Anshuman Khandual Cc: Qian Cai Cc: Pingfan Liu Cc: Stephen Rothwell Cc: Dan Williams Cc: Pavel Tatashin Cc: Vlastim

[PATCH v1 10/12] powerpc/pseries: CMM: Simulation mode

2019-10-31 Thread David Hildenbrand
Let's allow to test the implementation without needing HW support. When "simulate=1" is specified when loading the module, we bypass all HW checks and HW calls. The sysfs file "simulate_loan_target_kb" can be used to simulate HW requests. The simualtion mode can be activated using modprobe

Re: [PATCH v1 08/12] powerpc/pseries: CMM: Implement balloon compaction

2019-10-31 Thread David Hildenbrand
On 31.10.19 15:29, David Hildenbrand wrote: We can now get rid of the cmm_lock and completely rely on the balloon compaction internals, which now also manage the page list and the lock. Inflated/"loaned" pages are now movable. Memory blocks that contain such apges can get offlined. Also, all suc

[PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Nicolas Saenz Julienne
Some architectures, notably ARM, are interested in tweaking this depending on their runtime DMA addressing limitations. Signed-off-by: Nicolas Saenz Julienne --- Changes since RFC: - Rebased to v5.4-rc6, fixed arm64 code. NOTE: This will only apply to linux-next, where arch/arm64/mm/init.c

Re: [PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Christoph Hellwig
On Thu, Oct 31, 2019 at 04:28:37PM +0100, Nicolas Saenz Julienne wrote: > Some architectures, notably ARM, are interested in tweaking this > depending on their runtime DMA addressing limitations. > > Signed-off-by: Nicolas Saenz Julienne > --- > > Changes since RFC: > - Rebased to v5.4-rc6, fix

Re: [PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Nicolas Saenz Julienne
On Thu, 2019-10-31 at 16:47 +0100, Christoph Hellwig wrote: > On Thu, Oct 31, 2019 at 04:28:37PM +0100, Nicolas Saenz Julienne wrote: > > Some architectures, notably ARM, are interested in tweaking this > > depending on their runtime DMA addressing limitations. > > > > Signed-off-by: Nicolas Saenz

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-31 Thread Dan Williams
On Thu, Oct 31, 2019 at 1:38 AM Aneesh Kumar K.V wrote: > > On 10/31/19 12:00 PM, Dan Williams wrote: > > On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V > > wrote: > > [..] > > > > > > > All that said, the x86 vmemmap_populate() falls back to use small > > pages in some case to get around this

Re: [PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Christoph Hellwig
On Thu, Oct 31, 2019 at 04:53:13PM +0100, Nicolas Saenz Julienne wrote: > > > +#define ARM64_ZONE_DMA_BITS 30 > > > + > > > /* > > > * We need to be able to catch inadvertent references to memstart_addr > > > * that occur (potentially in generic code) before arm64_memblock_init() > > > @@

Re: [PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Nicolas Saenz Julienne
On Thu, 2019-10-31 at 16:57 +0100, Christoph Hellwig wrote: > On Thu, Oct 31, 2019 at 04:53:13PM +0100, Nicolas Saenz Julienne wrote: > > > > +#define ARM64_ZONE_DMA_BITS30 > > > > + > > > > /* > > > > * We need to be able to catch inadvertent references to memstart_addr > > > > * that occ

Re: [PATCH v2 1/1] pseries/hotplug-cpu: Change default behaviour of cede_offline to "off"

2019-10-31 Thread Nathan Lynch
"Gautham R. Shenoy" writes: > From: "Gautham R. Shenoy" > > Currently on PSeries Linux guests, the offlined CPU can be put to one > of the following two states: >- Long term processor cede (also called extended cede) >- Returned to the hypervisor via RTAS "stop-self" call. > > This is con

Re: [PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Christoph Hellwig
On Thu, Oct 31, 2019 at 05:22:59PM +0100, Nicolas Saenz Julienne wrote: > OK, I see what you mean now. It's wrong indeed. > > The trouble is the ZONE_DMA series[1] in arm64, also due for v5.5, will be > affected by this patch. I don't know the right way to approach this problem > since depending o

Re: [PATCH v10 5/9] ima: make process_buffer_measurement() generic

2019-10-31 Thread Lakshmi Ramasubramanian
On 10/30/19 8:31 PM, Mimi Zohar wrote: void ima_kexec_cmdline(const void *buf, int size) { - u32 secid; - - if (buf && size != 0) { - security_task_getsecid(current, &secid); + if (buf && size != 0) Open brace { is missing in the above if statement.

Re: [RFC PATCH 1/9] powerpc/pseries: add cpu DLPAR support for drc-info property

2019-10-31 Thread Nathan Lynch
Tyrel Datwyler writes: > On 10/10/19 11:56 AM, Nathan Lynch wrote: >> As an aside I don't understand how the add_by_count()/dlpar_cpu_exists() >> algorithm could be correct as it currently stands. It seems to pick the >> first X indexes for which a corresponding cpu node is absent, but that >> set

Re: [PATCH v10 5/9] ima: make process_buffer_measurement() generic

2019-10-31 Thread Lakshmi Ramasubramanian
On 10/31/19 10:02 AM, Lakshmi Ramasubramanian wrote: On 10/30/19 8:31 PM, Mimi Zohar wrote:   void ima_kexec_cmdline(const void *buf, int size)   { -    u32 secid; - -    if (buf && size != 0) { -    security_task_getsecid(current, &secid); +    if (buf && size != 0) Open brace { is miss

Re: [PATCH RFC 1/5] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Nicolas Saenz Julienne
On Thu, 2019-10-31 at 06:38 -0700, Christoph Hellwig wrote: > On Thu, Oct 31, 2019 at 11:30:36AM +0100, Nicolas Saenz Julienne wrote: > > On Wed, 2019-10-30 at 14:49 -0700, Christoph Hellwig wrote: > > > On Mon, Oct 14, 2019 at 08:31:03PM +0200, Nicolas Saenz Julienne wrote: > > > > Some architectu

Re: [PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Catalin Marinas
On Thu, Oct 31, 2019 at 05:58:53PM +0100, Christoph Hellwig wrote: > On Thu, Oct 31, 2019 at 05:22:59PM +0100, Nicolas Saenz Julienne wrote: > > OK, I see what you mean now. It's wrong indeed. > > > > The trouble is the ZONE_DMA series[1] in arm64, also due for v5.5, will be > > affected by this p

Re: [PATCH 01/19] mm/gup: pass flags arg to __gup_device_* functions

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:12PM -0700, John Hubbard wrote: > A subsequent patch requires access to gup flags, so > pass the flags argument through to the __gup_device_* > functions. > > Also placate checkpatch.pl by shortening a nearby line. > Reviewed-by: Ira Weiny > Cc: Kirill A. Shutemov

Re: [PATCH] dma/direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-10-31 Thread Christoph Hellwig
On Thu, Oct 31, 2019 at 06:06:19PM +, Catalin Marinas wrote: > On Thu, Oct 31, 2019 at 05:58:53PM +0100, Christoph Hellwig wrote: > > On Thu, Oct 31, 2019 at 05:22:59PM +0100, Nicolas Saenz Julienne wrote: > > > OK, I see what you mean now. It's wrong indeed. > > > > > > The trouble is the ZON

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: > There are four locations in gup.c that have a fair amount of code > duplication. This means that changing one requires making the same > changes in four places, not to mention reading the same code four > times, and wondering if there

Re: [PATCH 03/19] goldish_pipe: rename local pin_user_pages() routine

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:14PM -0700, John Hubbard wrote: > 1. Avoid naming conflicts: rename local static function from > "pin_user_pages()" to "pin_goldfish_pages()". > > An upcoming patch will introduce a global pin_user_pages() > function. > Reviewed-by: Ira Weiny > Signed-off-by: John

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread John Hubbard
On 10/31/19 11:35 AM, Ira Weiny wrote: > On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: ... >> + >> +static void __remove_refs_from_head(struct page *page, int refs) >> +{ >> +/* Do a get_page() first, in case refs == page->_refcount */ >> +get_page(page); >> +page_ref_su

Re: [PATCH v3] drm/radeon: Fix EEH during kexec

2019-10-31 Thread Kyle Mahlkuch
On 10/30/19 5:35 AM, Michael Ellerman wrote: Hi Kyle, KyleMahlkuch writes: From: Kyle Mahlkuch During kexec some adapters hit an EEH since they are not properly shut down in the radeon_pci_shutdown() function. Adding radeon_suspend_kms() fixes this issue. Enabled only on PPC because this pa

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread Ira Weiny
On Thu, Oct 31, 2019 at 11:43:37AM -0700, John Hubbard wrote: > On 10/31/19 11:35 AM, Ira Weiny wrote: > > On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: > ... > >> + > >> +static void __remove_refs_from_head(struct page *page, int refs) > >> +{ > >> + /* Do a get_page() first, in c

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread John Hubbard
On 10/31/19 2:09 PM, Ira Weiny wrote: > On Thu, Oct 31, 2019 at 11:43:37AM -0700, John Hubbard wrote: >> On 10/31/19 11:35 AM, Ira Weiny wrote: >>> On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: >> ... + +static int __huge_pt_done(struct page *head, int nr_recorded_pages, i

Re: [PATCH 05/19] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:16PM -0700, John Hubbard wrote: > Introduce pin_user_pages*() variations of get_user_pages*() calls, > and also pin_longterm_pages*() variations. > > These variants all set FOLL_PIN, which is also introduced, and > basically documented. (An upcoming patch provides mor

Re: [PATCH 07/19] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:18PM -0700, John Hubbard wrote: > Convert infiniband to use the new wrapper calls, and stop > explicitly setting FOLL_LONGTERM at the call sites. > > The new pin_longterm_*() calls replace get_user_pages*() > calls, and set both FOLL_LONGTERM and a new FOLL_PIN > flag

Re: [PATCH 08/19] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:19PM -0700, John Hubbard wrote: > Convert process_vm_access to use the new pin_user_pages_remote() > call, which sets FOLL_PIN. Setting FOLL_PIN is now required for > code that requires tracking of pinned pages. > > Also, release the pages via put_user_page*(). > > A

Re: [PATCH 09/19] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:20PM -0700, John Hubbard wrote: > Convert drm/via to use the new pin_user_pages_fast() call, which sets > FOLL_PIN. Setting FOLL_PIN is now required for code that requires > tracking of pinned pages, and therefore for any code that calls > put_user_page(). > Reviewed

Re: [PATCH 10/19] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:21PM -0700, John Hubbard wrote: > Convert fs/io_uring to use the new pin_user_pages() call, which sets > FOLL_PIN. Setting FOLL_PIN is now required for code that requires > tracking of pinned pages, and therefore for any code that calls > put_user_page(). > Reviewed-

Re: [PATCH 11/19] net/xdp: set FOLL_PIN via pin_user_pages()

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:22PM -0700, John Hubbard wrote: > Convert net/xdp to use the new pin_longterm_pages() call, which sets > FOLL_PIN. Setting FOLL_PIN is now required for code that requires > tracking of pinned pages. > Reviewed-by: Ira Weiny > Signed-off-by: John Hubbard > --- > n

Re: [PATCH 13/19] media/v4l2-core: pin_longterm_pages (FOLL_PIN) and put_user_page() conversion

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:24PM -0700, John Hubbard wrote: > 1. Change v4l2 from get_user_pages(FOLL_LONGTERM), to > pin_longterm_pages(), which sets both FOLL_LONGTERM and FOLL_PIN. > > 2. Because all FOLL_PIN-acquired pages must be released via > put_user_page(), also convert the put_page() c

Re: [PATCH 05/19] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-10-31 Thread John Hubbard
On 10/31/19 4:15 PM, Ira Weiny wrote: > On Wed, Oct 30, 2019 at 03:49:16PM -0700, John Hubbard wrote: ... >> + * FOLL_PIN indicates that a special kind of tracking (not just >> page->_refcount, >> + * but an additional pin counting system) will be invoked. This is intended >> for >> + * anything

Re: [PATCH 08/19] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-10-31 Thread John Hubbard
On 10/31/19 4:35 PM, Ira Weiny wrote: > On Wed, Oct 30, 2019 at 03:49:19PM -0700, John Hubbard wrote: >> Convert process_vm_access to use the new pin_user_pages_remote() >> call, which sets FOLL_PIN. Setting FOLL_PIN is now required for >> code that requires tracking of pinned pages. >> >> Also, re

Re: [PATCH 07/19] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-10-31 Thread John Hubbard
On 10/31/19 4:25 PM, Ira Weiny wrote: > On Wed, Oct 30, 2019 at 03:49:18PM -0700, John Hubbard wrote: >> Convert infiniband to use the new wrapper calls, and stop >> explicitly setting FOLL_LONGTERM at the call sites. >> >> The new pin_longterm_*() calls replace get_user_pages*() >> calls, and set

Re: [PATCH 19/19] Documentation/vm: add pin_user_pages.rst

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:30PM -0700, John Hubbard wrote: > Document the new pin_user_pages() and related calls > and behavior. > > Thanks to Jan Kara and Vlastimil Babka for explaining the 4 cases > in this documentation. (I've reworded it and expanded on it slightly.) As I said before I thi

Re: [PATCH 19/19] Documentation/vm: add pin_user_pages.rst

2019-10-31 Thread John Hubbard
On 10/31/19 4:49 PM, Ira Weiny wrote: > On Wed, Oct 30, 2019 at 03:49:30PM -0700, John Hubbard wrote: >> Document the new pin_user_pages() and related calls >> and behavior. >> >> Thanks to Jan Kara and Vlastimil Babka for explaining the 4 cases >> in this documentation. (I've reworded it and expan

Re: [PATCH 19/19] Documentation/vm: add pin_user_pages.rst

2019-10-31 Thread John Hubbard
On 10/31/19 4:49 PM, Ira Weiny wrote: > On Wed, Oct 30, 2019 at 03:49:30PM -0700, John Hubbard wrote: ... >> +TODO: There is also a special case when the pages are DAX pages: in >> addition to >> +the above flags, the caller needs something like a layout lease on the >> +associated file. This is y

答复: 答复: loop nesting in alignment exception and machine check

2019-10-31 Thread Wangshaobo (bobo)
Hi, Christophe I am sorry that we are in some troubles for some unpredictable problems when we replay and haven't given you a quick reply. I also want to ask does the phenomeon(use memcpy_toio when copy ioremap_address) only occurs in powerpc ? does any other arch also

[PATCH 3/3] libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h

2019-10-31 Thread Masahiro Yamada
The libfdt in the upstream DTC project added references to (U)INT32_MAX by the following commits: Commit 812b1956a076 ("libfdt: Tweak data handling to satisfy Coverity") Commit 7fcf8208b8a9 ("libfdt: add fdt_append_addrrange()") The kernel needs to adjust libfdt_env.h before pulling in the ch

[PATCH 1/3] libfdt: add SPDX-License-Identifier to libfdt wrappers

2019-10-31 Thread Masahiro Yamada
These are kernel source code even though they are just two-line wrappers. Files without explicit license information fall back to GPL-2.0-only, which is the project default. Signed-off-by: Masahiro Yamada --- lib/fdt.c| 1 + lib/fdt_empty_tree.c | 1 + lib/fdt_ro.c | 1 + l

[PATCH 2/3] ARM: decompressor: simplify libfdt builds

2019-10-31 Thread Masahiro Yamada
Copying source files during the build time may not end up with as clean code as you expect. lib/fdt*.c simply wrap scripts/dtc/libfdt/fdt*.c, and it works nicely. Let's follow that approach for the arm decompressor, too. Add four wrappers, arch/arm/boot/compressed/fdt*.c and remove the Makefile m

[PATCH 0/3] libfdt: prepare for (U)INT32_MAX addition

2019-10-31 Thread Masahiro Yamada
As you may know, libfdt in the upstream DTC project added referenced to (U)INT32_MAX. The kernel code has three files to adjust: include/linux/libfdt_env.h arch/powerpc/boot/libfdt_env.h arch/arm/boot/compressed/libfdt_env.h Instead of fixing arch/arm/boot/compressed/libfdt_env.h, it is pretty

[PATCH v2 2/2] powerpc/powernv: Use common code for the symbol_map export

2019-10-31 Thread Oliver O'Halloran
Long before we had a generic way for firmware to export memory ranges of interest we added a special case for the skiboot symbol map. The code is pretty much identical to the generic export so re-use the code. Signed-off-by: Oliver O'Halloran --- v2: Actually compile. --- arch/powerpc/platforms/

[PATCH v2 1/2] powerpc/powernv: Rework exports to support subnodes

2019-10-31 Thread Oliver O'Halloran
Originally we only had a handful of exported memory ranges, but we'd to export the per-core trace buffers. This results in a lot of files in the exports directory which is a but unfortunate. We can clean things up a bit by turning subnodes into subdirectories of the exports directory. Signed-off-b