[PATCH v3 09/11] mm/memory_hotplug: Remove memory block devices before arch_remove_memory()

2019-05-27 Thread David Hildenbrand
Let's factor out removing of memory block devices, which is only necessary for memory added via add_memory() and friends that created memory block devices. Remove the devices before calling arch_remove_memory(). This finishes factoring out memory block device handling from arch_add_memory() and

[PATCH v3 04/11] arm64/mm: Add temporary arch_remove_memory() implementation

2019-05-27 Thread David Hildenbrand
A proper arch_remove_memory() implementation is on its way, which also cleanly removes page tables in arch_add_memory() in case something goes wrong. As we want to use arch_remove_memory() in case something goes wrong during memory hotplug after arch_add_memory() finished, let's add a temporary

[PATCH v3 05/11] drivers/base/memory: Pass a block_id to init_memory_block()

2019-05-27 Thread David Hildenbrand
We'll rework hotplug_memory_register() shortly, so it no longer consumes pass a section. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git

Re: [PATCH v7 1/1] iommu: enhance IOMMU dma mode build options

2019-05-27 Thread Joerg Roedel
Hi Zhen Lei, On Mon, May 20, 2019 at 09:59:47PM +0800, Zhen Lei wrote: > arch/ia64/kernel/pci-dma.c| 2 +- > arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- > arch/s390/pci/pci_dma.c | 2 +- > arch/x86/kernel/pci-dma.c | 7 ++--- >

[PATCH v3 06/11] mm/memory_hotplug: Allow arch_remove_pages() without CONFIG_MEMORY_HOTREMOVE

2019-05-27 Thread David Hildenbrand
We want to improve error handling while adding memory by allowing to use arch_remove_memory() and __remove_pages() even if CONFIG_MEMORY_HOTREMOVE is not set to e.g., implement something like: arch_add_memory() rc = do_something(); if (rc) {

[Bug 203725] New: Build error: 'init_module' specifies less restrictive attribute than its target 'rtas_flash_init': 'cold'

2019-05-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203725 Bug ID: 203725 Summary: Build error: 'init_module' specifies less restrictive attribute than its target 'rtas_flash_init': 'cold' Product: Platform Specific/Hardware Version: 2.5

Re: [PATCH v2] powerpc/power: Expose pfn_is_nosave prototype

2019-05-27 Thread Rafael J. Wysocki
On Friday, May 24, 2019 12:44:18 PM CEST Mathieu Malaterre wrote: > The declaration for pfn_is_nosave is only available in > kernel/power/power.h. Since this function can be override in arch, > expose it globally. Having a prototype will make sure to avoid warning > (sometime treated as error with

[PATCH v3 10/11] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail

2019-05-27 Thread David Hildenbrand
We really don't want anything during memory hotunplug to fail. We always pass a valid memory block device, that check can go. Avoid allocating memory and eventually failing. As we are always called under lock, we can use a static piece of memory. This avoids having to put the structure onto the

[PATCH v3 11/11] mm/memory_hotplug: Remove "zone" parameter from sparse_remove_one_section

2019-05-27 Thread David Hildenbrand
The parameter is unused, so let's drop it. Memory removal paths should never care about zones. This is the job of memory offlining and will require more refactorings. Reviewed-by: Dan Williams Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 2 +- mm/memory_hotplug.c

[PATCH v3 01/11] mm/memory_hotplug: Simplify and fix check_hotplug_memory_range()

2019-05-27 Thread David Hildenbrand
By converting start and size to page granularity, we actually ignore unaligned parts within a page instead of properly bailing out with an error. Cc: Andrew Morton Cc: Oscar Salvador Cc: Michal Hocko Cc: David Hildenbrand Cc: Pavel Tatashin Cc: Qian Cai Cc: Wei Yang Cc: Arun KS Cc:

[PATCH v3 07/11] mm/memory_hotplug: Create memory block devices after arch_add_memory()

2019-05-27 Thread David Hildenbrand
Only memory to be added to the buddy and to be onlined/offlined by user space using /sys/devices/system/memory/... needs (and should have!) memory block devices. Factor out creation of memory block devices. Create all devices after arch_add_memory() succeeded. We can later drop the want_memblock

[PATCH v3 08/11] mm/memory_hotplug: Drop MHP_MEMBLOCK_API

2019-05-27 Thread David Hildenbrand
No longer needed, the callers of arch_add_memory() can handle this manually. Cc: Andrew Morton Cc: David Hildenbrand Cc: Michal Hocko Cc: Oscar Salvador Cc: Pavel Tatashin Cc: Wei Yang Cc: Joonsoo Kim Cc: Qian Cai Cc: Arun KS Cc: Mathieu Malaterre Signed-off-by: David Hildenbrand ---

[PATCH v3 02/11] s390x/mm: Fail when an altmap is used for arch_add_memory()

2019-05-27 Thread David Hildenbrand
ZONE_DEVICE is not yet supported, fail if an altmap is passed, so we don't forget arch_add_memory()/arch_remove_memory() when unlocking support. Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Andrew Morton Cc: Michal Hocko Cc: Mike Rapoport Cc: David Hildenbrand Cc: Vasily Gorbik Cc: Oscar

[PATCH v3 03/11] s390x/mm: Implement arch_remove_memory()

2019-05-27 Thread David Hildenbrand
Will come in handy when wanting to handle errors after arch_add_memory(). Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Andrew Morton Cc: Michal Hocko Cc: Mike Rapoport Cc: David Hildenbrand Cc: Vasily Gorbik Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- arch/s390/mm/init.c |

[Bug 203723] New: Build error: taking address of packed member of 'struct ftrace_graph_ent' may result in an unaligned pointer value

2019-05-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203723 Bug ID: 203723 Summary: Build error: taking address of packed member of 'struct ftrace_graph_ent' may result in an unaligned pointer value Product: Platform

Re: [PATCH] powerpc: Fix loading of kernel + initramfs with kexec_file_load()

2019-05-27 Thread Thiago Jung Bauermann
Michael Ellerman writes: > On Wed, 2019-05-22 at 22:01:58 UTC, Thiago Jung Bauermann wrote: >> Commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()") >> changed kexec_add_buffer() to skip searching for a memory location if >> kexec_buf.mem is already set, and use the address that

[RESEND PATCH 0/3] Allow custom PCI resource alignment on pseries

2019-05-27 Thread Shawn Anastasio
Hello all, This patch set implements support for user-specified PCI resource alignment on the pseries platform for hotplugged PCI devices. Currently on pseries, PCI resource alignments specified with the pci=resource_alignment commandline argument are ignored, since the firmware is in charge of

[RESEND PATCH 3/3] powerpc/pseries: Allow user-specified PCI resource alignment after init

2019-05-27 Thread Shawn Anastasio
On pseries, custom PCI resource alignment specified with the commandline argument pci=resource_alignment is disabled due to PCI resources being managed by the firmware. However, in the case of PCI hotplug the resources are managed by the kernel, so custom alignments should be honored in these

[RESEND PATCH 2/3] powerpc/64: Enable pcibios_after_init hook on ppc64

2019-05-27 Thread Shawn Anastasio
Enable the pcibios_after_init hook on all powerpc platforms. This hook is executed at the end of pcibios_init and was previously only available on CONFIG_PPC32. Since it is useful and not inherently limited to 32-bit mode, remove the limitation and allow it on all powerpc platforms.

[RESEND PATCH 1/3] PCI: Introduce pcibios_ignore_alignment_request

2019-05-27 Thread Shawn Anastasio
Introduce a new pcibios function pcibios_ignore_alignment_request which allows the PCI core to defer to platform-specific code to determine whether or not to ignore alignment requests for PCI resources. The existing behavior is to simply ignore alignment requests when PCI_PROBE_ONLY is set. This

[PATCH v2 2/3] powerpc/64: Enable pcibios_after_init hook on ppc64

2019-05-27 Thread Shawn Anastasio
Enable the pcibios_after_init hook on all powerpc platforms. This hook is executed at the end of pcibios_init and was previously only available on CONFIG_PPC32. Since it is useful and not inherently limited to 32-bit mode, remove the limitation and allow it on all powerpc platforms.

[PATCH v2 0/3] Allow custom PCI resource alignment on pseries

2019-05-27 Thread Shawn Anastasio
Changes from v1 to v2: - Fix function declaration warnings caught by sparse Hello all, This patch set implements support for user-specified PCI resource alignment on the pseries platform for hotplugged PCI devices. Currently on pseries, PCI resource alignments specified with the

[PATCH v3 0/3] Allow custom PCI resource alignment on pseries

2019-05-27 Thread Shawn Anastasio
Changes from v2 to v3: - Fix wrong return type of ppc pcibios_ignore_alignment_request (Not sure how my local compile didn't catch that!) Hello all, This patch set implements support for user-specified PCI resource alignment on the pseries platform for hotplugged PCI devices. Currently on

Re: [RESEND PATCH 0/3] Allow custom PCI resource alignment on pseries

2019-05-27 Thread Oliver
On Tue, May 28, 2019 at 2:09 PM Shawn Anastasio wrote: > > > > On 5/27/19 11:01 PM, Oliver wrote: > > On Tue, May 28, 2019 at 8:56 AM Shawn Anastasio wrote: > >> > >> Hello all, > >> > >> This patch set implements support for user-specified PCI resource > >> alignment on the pseries platform for

[PATCH v2 3/3] powerpc/mm/hugetlb: Don't enable HugeTLB if we don't have a page table cache

2019-05-27 Thread Aneesh Kumar K.V
This makes sure we don't enable HugeTLB if the cache is not configured. I am still not sure about this. IMHO hugetlb support should be a hardware support derivative and any cache allocation failure should be handled as I did in the earlier patch. But then if we were not able to create hugetlb page

[PATCH v2 2/3] powerpc/mm/hugetlb: Fix kernel crash if we fail to allocate page table caches

2019-05-27 Thread Aneesh Kumar K.V
We only check for hugetlb allocations, because with hugetlb we do conditional registration. For PGD/PUD/PMD levels we register them always in pgtable_cache_init. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hugetlbpage.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[PATCH] powerpc/mm: Move some of the boot time info print to generic file

2019-05-27 Thread Aneesh Kumar K.V
With radix translation enabled we find in dmesg hash-mmu: ppc64_pft_size= 0x0 hash-mmu: kernel vmalloc start = 0xc008 hash-mmu: kernel IO start= 0xc00a hash-mmu: kernel vmemmap start = 0xc00c This is because these pr_info calls are in

[PATCH v2 1/3] powerpc/mm: Handle page table allocation failures

2019-05-27 Thread Aneesh Kumar K.V
This fixes kernel crash that arises due to not handling page table allocation failures while allocating hugetlb page table. Fixes: e2b3d202d1db ("powerpc: Switch 16GB and 16MB explicit hugepages to a different page table format") Signed-off-by: Aneesh Kumar K.V ---

[PATCH v2 3/3] powerpc/pseries: Allow user-specified PCI resource alignment after init

2019-05-27 Thread Shawn Anastasio
On pseries, custom PCI resource alignment specified with the commandline argument pci=resource_alignment is disabled due to PCI resources being managed by the firmware. However, in the case of PCI hotplug the resources are managed by the kernel, so custom alignments should be honored in these

[PATCH v2 1/3] PCI: Introduce pcibios_ignore_alignment_request

2019-05-27 Thread Shawn Anastasio
Introduce a new pcibios function pcibios_ignore_alignment_request which allows the PCI core to defer to platform-specific code to determine whether or not to ignore alignment requests for PCI resources. The existing behavior is to simply ignore alignment requests when PCI_PROBE_ONLY is set. This

[TRIVIAL] [PATCH] powerpc/powernv-eeh: Consisely desribe what this file does

2019-05-27 Thread Stewart Smith
If the previous comment made sense, continue debugging or call your doctor immediately. Signed-off-by: Stewart Smith --- arch/powerpc/platforms/powernv/eeh-powernv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c

Re: [RESEND PATCH 0/3] Allow custom PCI resource alignment on pseries

2019-05-27 Thread Shawn Anastasio
On 5/27/19 11:01 PM, Oliver wrote: On Tue, May 28, 2019 at 8:56 AM Shawn Anastasio wrote: Hello all, This patch set implements support for user-specified PCI resource alignment on the pseries platform for hotplugged PCI devices. Currently on pseries, PCI resource alignments specified with

[PATCH v3 2/3] powerpc/64: Enable pcibios_after_init hook on ppc64

2019-05-27 Thread Shawn Anastasio
Enable the pcibios_after_init hook on all powerpc platforms. This hook is executed at the end of pcibios_init and was previously only available on CONFIG_PPC32. Since it is useful and not inherently limited to 32-bit mode, remove the limitation and allow it on all powerpc platforms.

Re: [TRIVIAL] [PATCH] powerpc/powernv-eeh: Consisely desribe what this file does

2019-05-27 Thread Stewart Smith
Oliver writes: > On Tue, May 28, 2019 at 1:29 PM Stewart Smith wrote: >> >> If the previous comment made sense, continue debugging or call your >> doctor immediately. >> >> Signed-off-by: Stewart Smith >> --- >> arch/powerpc/platforms/powernv/eeh-powernv.c | 4 +--- >> 1 file changed, 1

Re: [PATCH v2] powerpc/power: Expose pfn_is_nosave prototype

2019-05-27 Thread Michael Ellerman
Mathieu Malaterre writes: > The declaration for pfn_is_nosave is only available in > kernel/power/power.h. Since this function can be override in arch, > expose it globally. Having a prototype will make sure to avoid warning > (sometime treated as error with W=1) such as: > >

[PATCH v3 3/3] powerpc/pseries: Allow user-specified PCI resource alignment after init

2019-05-27 Thread Shawn Anastasio
On pseries, custom PCI resource alignment specified with the commandline argument pci=resource_alignment is disabled due to PCI resources being managed by the firmware. However, in the case of PCI hotplug the resources are managed by the kernel, so custom alignments should be honored in these

Re: [TRIVIAL] [PATCH] powerpc/powernv-eeh: Consisely desribe what this file does

2019-05-27 Thread Oliver
On Tue, May 28, 2019 at 1:29 PM Stewart Smith wrote: > > If the previous comment made sense, continue debugging or call your > doctor immediately. > > Signed-off-by: Stewart Smith > --- > arch/powerpc/platforms/powernv/eeh-powernv.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >

[PATCH v3 00/11] mm/memory_hotplug: Factor out memory block devicehandling

2019-05-27 Thread David Hildenbrand
We only want memory block devices for memory to be onlined/offlined (add/remove from the buddy). This is required so user space can online/offline memory and kdump gets notified about newly onlined memory. Let's factor out creation/removal of memory block devices. This helps to further cleanup

Re: [RESEND PATCH 0/3] Allow custom PCI resource alignment on pseries

2019-05-27 Thread Oliver
On Tue, May 28, 2019 at 8:56 AM Shawn Anastasio wrote: > > Hello all, > > This patch set implements support for user-specified PCI resource > alignment on the pseries platform for hotplugged PCI devices. > Currently on pseries, PCI resource alignments specified with the > pci=resource_alignment

Re: [PATCH v2] powerpc/power: Expose pfn_is_nosave prototype

2019-05-27 Thread Michael Ellerman
"Rafael J. Wysocki" writes: > On Friday, May 24, 2019 12:44:18 PM CEST Mathieu Malaterre wrote: >> The declaration for pfn_is_nosave is only available in >> kernel/power/power.h. Since this function can be override in arch, >> expose it globally. Having a prototype will make sure to avoid warning

Re: [PATCH v2 2/2] tests: add close_range() tests

2019-05-27 Thread Michael Ellerman
Christian Brauner writes: > This adds basic tests for the new close_range() syscall. > - test that no invalid flags can be passed > - test that a range of file descriptors is correctly closed > - test that a range of file descriptors is correctly closed if there there > are already closed file

Re: [PATCH v3 2/3] arch: wire-up close_range()

2019-05-27 Thread Michael Ellerman
Christian Brauner writes: > diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl > b/arch/powerpc/kernel/syscalls/syscall.tbl > index 103655d84b4b..ba2c1f078cbd 100644 > --- a/arch/powerpc/kernel/syscalls/syscall.tbl > +++ b/arch/powerpc/kernel/syscalls/syscall.tbl > @@ -515,3 +515,4 @@ > 431

[PATCH v3 1/3] PCI: Introduce pcibios_ignore_alignment_request

2019-05-27 Thread Shawn Anastasio
Introduce a new pcibios function pcibios_ignore_alignment_request which allows the PCI core to defer to platform-specific code to determine whether or not to ignore alignment requests for PCI resources. The existing behavior is to simply ignore alignment requests when PCI_PROBE_ONLY is set. This

Re: [TRIVIAL] [PATCH] powerpc/powernv-eeh: Consisely desribe what this file does

2019-05-27 Thread Russell Currey
On Tue, 2019-05-28 at 13:29 +1000, Stewart Smith wrote: > If the previous comment made sense, continue debugging or call your > doctor immediately. > > Signed-off-by: Stewart Smith This reply intends to implement the ack dependent EEH patch on powernv platform. Actually, the reply was created

Re: kmemleak: 1157 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

2019-05-27 Thread Michael Ellerman
Mathieu Malaterre writes: > Hi there, > > Is there a way to dump more context (somewhere in of tree > flattening?). I cannot make sense of the following: Hmm. Not that I know of. Those don't look related to OF flattening/unflattening. That's just sysfs setup based on the unflattened device

Re: [PATCH v3 1/3] PCI: Introduce pcibios_ignore_alignment_request

2019-05-27 Thread Oliver
On Tue, May 28, 2019 at 2:03 PM Shawn Anastasio wrote: > > Introduce a new pcibios function pcibios_ignore_alignment_request > which allows the PCI core to defer to platform-specific code to > determine whether or not to ignore alignment requests for PCI resources. > > The existing behavior is to

Re: [PATCH v3 14/16] powerpc/32: implement fast entry for syscalls on BOOKE

2019-05-27 Thread Michael Ellerman
Christophe Leroy writes: > Le 23/05/2019 à 09:00, Christophe Leroy a écrit : > > [...] > >>> arch/powerpc/kernel/head_fsl_booke.o: In function `SystemCall': >>> arch/powerpc/kernel/head_fsl_booke.S:416: undefined reference to >>> `kvmppc_handler_BOOKE_INTERRUPT_SYSCALL_SPRN_SRR1' >>>

Re: [PATCH v3 1/3] PCI: Introduce pcibios_ignore_alignment_request

2019-05-27 Thread Shawn Anastasio
On 5/28/19 12:36 AM, Oliver wrote: On Tue, May 28, 2019 at 2:03 PM Shawn Anastasio wrote: Introduce a new pcibios function pcibios_ignore_alignment_request which allows the PCI core to defer to platform-specific code to determine whether or not to ignore alignment requests for PCI

Re: [PATCH 10/10] docs: fix broken documentation links

2019-05-27 Thread Rafael J. Wysocki
On Mon, May 20, 2019 at 4:48 PM Mauro Carvalho Chehab wrote: > > Mostly due to x86 and acpi conversion, several documentation > links are still pointing to the old file. Fix them. > > Signed-off-by: Mauro Carvalho Chehab For the ACPI part: Acked-by: Rafael J. Wysocki

Re: [PATCH] mm/nvdimm: Use correct alignment when looking at first pfn from a region

2019-05-27 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > On 5/14/19 9:59 AM, Dan Williams wrote: >> On Mon, May 13, 2019 at 7:55 PM Aneesh Kumar K.V >> wrote: >>> >>> We already add the start_pad to the resource->start but fails to section >>> align the start. This make sure with altmap we compute the right first >>> pfn