[PATCH v2] powerpc/64s: Make boot look nicer

2019-07-01 Thread Nicholas Piggin
Radix boot looks like this: - phys_mem_size = 0x2 dcache_bsize = 0x80 icache_bsize = 0x80 cpu_features = 0xc06f8f5fb1a7 possible= 0xfbffcf5fb1a7 always = 0x0003800081a1

[PATCH v2 2/2] Powerpc/Watchpoint: Rewrite ptrace-hwbreak.c selftest

2019-07-01 Thread Ravi Bangoria
ptrace-hwbreak.c selftest is logically broken. On powerpc, when watchpoint is created with ptrace, signals are generated before executing the instruction and user has to manually singlestep the instruction with watchpoint disabled, which selftest never does and thus it keeps on getting the signal

[PATCH v2 1/2] Powerpc/Watchpoint: Fix length calculation for unaligned target

2019-07-01 Thread Ravi Bangoria
Watchpoint match range is always doubleword(8 bytes) aligned on powerpc. If the given range is crossing doubleword boundary, we need to increase the length such that next doubleword also get covered. Ex, address len = 6 bytes |=.

[v2 12/12] powerpc/64s: Save r13 in machine_check_common_early

2019-07-01 Thread Santosh Sivaraj
From: Reza Arbab Testing my memcpy_mcsafe() work in progress with an injected UE, I get an error like this immediately after the function returns: BUG: Unable to handle kernel data access at 0x7fff84dec8f8 Faulting instruction address: 0xc008009c00b0 Oops: Kernel access of bad area, sig: 11

[v2 11/12] powerpc: add machine check safe copy_to_user

2019-07-01 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 12 2 files changed, 13 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

[v2 10/12] powerpc/memcpy_mcsafe: return remaining bytes

2019-07-01 Thread Santosh Sivaraj
memcpy_mcsafe currently return -EFAULT on a machine check exception, change it to return the remaining bytes that needs to be copied, so that machine check safe copy_to_user can maintain the same behavior as copy_to_user. Signed-off-by: Santosh Sivaraj --- arch/powerpc/lib/memcpy_mcsafe_64.S |

[v2 09/12] powerpc/mce: Enable MCE notifiers in external modules

2019-07-01 Thread Santosh Sivaraj
From: Reza Arbab Signed-off-by: Reza Arbab --- arch/powerpc/kernel/exceptions-64s.S | 6 ++ arch/powerpc/kernel/mce.c| 2 ++ 2 files changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[v2 08/12] powerpc/mce: Handle memcpy_mcsafe()

2019-07-01 Thread Santosh Sivaraj
From: Reza Arbab Add an mce notifier intended to service memcpy_mcsafe(). The notifier uses this heuristic; if a UE occurs when accessing device memory, and the faulting instruction had a fixup entry, the callback will return NOTIFY_STOP. This causes the notification mechanism to consider the

[v2 07/12] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-07-01 Thread Santosh Sivaraj
From: Balbir Singh The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check exceptions into a return value on failure in case a machine check exception is encountered during the memcpy. This patch largely borrows from the copyuser_power7 logic and does not add

[v2 06/12] powerpc/mce: Add fixup address to UE events

2019-07-01 Thread Santosh Sivaraj
From: Reza Arbab If the instruction causing a UE has an exception table entry with fixup address, save it in the machine_check_event struct. If a machine check notifier callback returns NOTIFY_STOP to indicate it has handled the error, set nip to continue execution from the fixup address.

[v2 05/12] powerpc/mce: Allow notifier callback to handle MCE

2019-07-01 Thread Santosh Sivaraj
From: Reza Arbab If a notifier returns NOTIFY_STOP, consider the MCE handled, just as we do when machine_check_early() returns 1. Signed-off-by: Reza Arbab --- arch/powerpc/include/asm/asm-prototypes.h | 2 +- arch/powerpc/include/asm/mce.h| 3 +-

[v2 01/12] powerpc/mce: Make machine_check_ue_event() static

2019-07-01 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c index

Re: [PATCH] mm/nvdimm: Add is_ioremap_addr and use that to check ioremap address

2019-07-01 Thread Aneesh Kumar K.V
Andrew Morton writes: > On Mon, 1 Jul 2019 19:10:38 +0530 "Aneesh Kumar K.V" > wrote: > >> Architectures like powerpc use different address range to map ioremap >> and vmalloc range. The memunmap() check used by the nvdimm layer was >> wrongly using is_vmalloc_addr() to check for ioremap

Re: Re: [PATCH 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Nicholas Piggin
Will Deacon's on July 1, 2019 8:15 pm: > On Mon, Jul 01, 2019 at 11:03:51AM +0100, Steven Price wrote: >> On 01/07/2019 10:27, Will Deacon wrote: >> > On Sun, Jun 23, 2019 at 07:44:44PM +1000, Nicholas Piggin wrote: >> >> walk_page_range() is going to be allowed to walk page tables other than >>

Re: [PATCH v2 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Nicholas Piggin
Steven Price's on July 1, 2019 7:57 pm: > On 01/07/2019 07:40, Nicholas Piggin wrote: >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'leaf' entry in the page tables. This information will be

Re: ["RFC PATCH" 1/2] powerpc/mm: Fix node look up with numa=off boot

2019-07-01 Thread Aneesh Kumar K.V
On 7/1/19 10:12 PM, Nathan Lynch wrote: "Aneesh Kumar K.V" writes: I guess we should have here. modified arch/powerpc/mm/numa.c @@ -416,12 +416,11 @@ static int of_get_assoc_arrays(struct assoc_arrays *aa) static int of_drconf_to_nid_single(struct drmem_lmb *lmb) { struct

Re: Can I compile Linux Kernel 5.2-rc7 for PowerPC on Intel/AMD x86 hardware?

2019-07-01 Thread Michael Ellerman
Christophe Leroy writes: > Le 01/07/2019 à 15:39, Turritopsis Dohrnii Teo En Ming a écrit : >> Good evening from Singapore, > > Good evening afternoon from Paris, > >> >> Can I compile Linux Kernel 5.2-rc7 for PowerPC on Intel/AMD x86 hardware, >> for example, AMD Ryzen 9 3950X, with 16 CPU

Re: [PATCH] powerpc/rtas: retry when cpu offline races with suspend/migration

2019-07-01 Thread Michael Ellerman
Nathan Lynch writes: > Hi Michael, > > Nathan Lynch writes: >> The protocol for suspending or migrating an LPAR requires all present >> processor threads to enter H_JOIN. So if we have threads offline, we >> have to temporarily bring them up. This can race with administrator >> actions such as

Re: [PATCH] mm/nvdimm: Add is_ioremap_addr and use that to check ioremap address

2019-07-01 Thread Andrew Morton
On Mon, 1 Jul 2019 19:10:38 +0530 "Aneesh Kumar K.V" wrote: > Architectures like powerpc use different address range to map ioremap > and vmalloc range. The memunmap() check used by the nvdimm layer was > wrongly using is_vmalloc_addr() to check for ioremap range which fails for > ppc64. This

Re: [PATCH] powerpc/rtas: retry when cpu offline races with suspend/migration

2019-07-01 Thread Nathan Lynch
Hi Michael, Nathan Lynch writes: > The protocol for suspending or migrating an LPAR requires all present > processor threads to enter H_JOIN. So if we have threads offline, we > have to temporarily bring them up. This can race with administrator > actions such as SMT state changes. As of

Re: [PATCH RFC] generic ELF support for kexec

2019-07-01 Thread Sven Schnelle
Hi Philipp, On Mon, Jul 01, 2019 at 02:31:20PM +0200, Philipp Rudo wrote: > Sven Schnelle wrote: > > > I'm attaching the patch to this Mail. What do you think about that change? > > s390 also uses ELF files, and (maybe?) could also switch to this > > implementation. > > But i don't know

Re: [PATCH RFC] generic ELF support for kexec

2019-07-01 Thread Sven Schnelle
Hi Michael, On Fri, Jun 28, 2019 at 12:04:11PM +1000, Michael Ellerman wrote: > Sven Schnelle writes: > https://github.com/linuxppc/wiki/wiki/Booting-with-Qemu > > But I'm not sure where you get a version of kexec that uses kexec_file(). kexec-tools HEAD supports it, so that's not a problem.

Re: ["RFC PATCH" 1/2] powerpc/mm: Fix node look up with numa=off boot

2019-07-01 Thread Nathan Lynch
"Aneesh Kumar K.V" writes: > I guess we should have here. > > modified arch/powerpc/mm/numa.c > @@ -416,12 +416,11 @@ static int of_get_assoc_arrays(struct assoc_arrays > *aa) > static int of_drconf_to_nid_single(struct drmem_lmb *lmb) > { > struct assoc_arrays aa = { .arrays = NULL

Re: Can I compile Linux Kernel 5.2-rc7 for PowerPC on Intel/AMD x86 hardware?

2019-07-01 Thread Christophe Leroy
Le 01/07/2019 à 15:39, Turritopsis Dohrnii Teo En Ming a écrit : Good evening from Singapore, Good evening afternoon from Paris, Can I compile Linux Kernel 5.2-rc7 for PowerPC on Intel/AMD x86 hardware, for example, AMD Ryzen 9 3950X, with 16 CPU cores and 32 threads? Yes you can

Re: remove asm-generic/ptrace.h v3

2019-07-01 Thread Arnd Bergmann
On Mon, Jun 24, 2019 at 9:23 AM Thomas Gleixner wrote: > > On Mon, 24 Jun 2019, Christoph Hellwig wrote: > > > > asm-generic/ptrace.h is a little weird in that it doesn't actually > > implement any functionality, but it provided multiple layers of macros > > that just implement trivial inline

Re: [PATCH v12 01/11] MODSIGN: Export module signature definitions

2019-07-01 Thread Jessica Yu
+++ Thiago Jung Bauermann [27/06/19 23:19 -0300]: IMA will use the module_signature format for append signatures, so export the relevant definitions and factor out the code which verifies that the appended signature trailer is valid. Also, create a CONFIG_MODULE_SIG_FORMAT option so that IMA

Re: [PATCH v12 00/11] Appended signatures support for IMA appraisal

2019-07-01 Thread Mimi Zohar
On Thu, 2019-06-27 at 23:19 -0300, Thiago Jung Bauermann wrote: > Hello, > > This version is essentially identical to the last one. > > It is only a rebase on top of today's linux-integrity/next-queued-testing, > prompted by conflicts with Prakhar Srivastava's patches to measure the > kernel

[PATCH] powerpc: Remove unused variable declaration

2019-07-01 Thread Aneesh Kumar K.V
__kernel_virt_size is not used anymore. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index

[PATCH v2 3/3] powerpc/mm: Consolidate numa_enable check and min_common_depth check

2019-07-01 Thread Aneesh Kumar K.V
If we fail to parse min_common_depth from device tree we boot with numa disabled. Reflect the same by updating numa_enabled variable to false. Also, switch all min_common_depth failure check to if (!numa_enabled) check. This helps us to avoid checking for both in different code paths.

[PATCH v2 2/3] powerpc/mm: Fix node look up with numa=off boot

2019-07-01 Thread Aneesh Kumar K.V
If we boot with numa=off, we need to make sure we return NUMA_NO_NODE when looking up associativity details of resources. Without this, we hit crash like below BUG: Unable to handle kernel data access at 0x408 Faulting instruction address: 0xc8f31704 cpu 0x1b: Vector: 380 (Data

[PATCH v2 1/3] powerpc/mm/drconf: Use NUMA_NO_NODE on failures instead of node 0

2019-07-01 Thread Aneesh Kumar K.V
If we fail to parse the associativity array we should default to NUMA_NO_NODE instead of NODE 0. Rest of the code fallback to the right default if we find the numa node value NUMA_NO_NODE. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 10 ++ 1 file changed, 6

[PATCH v2 2/2] powerpc/mm/radix: Use the right page size for vmemmap mapping

2019-07-01 Thread Aneesh Kumar K.V
We use mmu_vmemmap_psize to find the page size for mapping the vmmemap area. With radix translation, we are suboptimally setting this value to PAGE_SIZE. We do check for 2M page size support and update mmu_vmemap_psize to use hugepage size but we suboptimally reset the value to PAGE_SIZE in

[PATCH v2 1/2] powerpc/mm/hash/4k: Don't use 64K page size for vmemmap with 4K pagesize

2019-07-01 Thread Aneesh Kumar K.V
With hash translation and 4K PAGE_SIZE config, we need to make sure we don't use 64K page size for vmemmap. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/hash_utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/mm/book3s64/hash_utils.c

[PATCH v2] powerpc/mm/nvdimm: Add an informative message if we fail to allocate altmap block

2019-07-01 Thread Aneesh Kumar K.V
Allocation from altmap area can fail based on vmemmap page size used. Add kernel info message to indicate the failure. That allows the user to identify whether they are really using persistent memory reserved space for per-page metadata. The message looks like: [ 136.587212] altmap block

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-07-01 Thread Michael S. Tsirkin
On Thu, Jun 27, 2019 at 10:58:40PM -0300, Thiago Jung Bauermann wrote: > > Michael S. Tsirkin writes: > > > On Mon, Jun 03, 2019 at 10:13:59PM -0300, Thiago Jung Bauermann wrote: > >> > >> > >> Michael S. Tsirkin writes: > >> > >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung

Re: [PATCH v3 3/9] powerpc: Introduce FW_FEATURE_ULTRAVISOR

2019-07-01 Thread Claudio Carvalho
On 6/15/19 4:36 AM, Paul Mackerras wrote: > On Thu, Jun 06, 2019 at 02:36:08PM -0300, Claudio Carvalho wrote: >> This feature tells if the ultravisor firmware is available to handle >> ucalls. > Everything in this patch that depends on CONFIG_PPC_UV should just > depend on CONFIG_PPC_POWERNV

[RFC PATCH] powerpc: Add the ppc_capabilities ELF note

2019-07-01 Thread Claudio Carvalho
Add the ppc_capabilities ELF note to the powerpc kernel binary. It is a bitmap that can be used to advertise kernel capabilities to userland. This patch also defines PPCCAP_ULTRAVISOR_BIT as being the bit zero. Suggested-by: Paul Mackerras Signed-off-by: Claudio Carvalho ---

[PATCH] mm/nvdimm: Add is_ioremap_addr and use that to check ioremap address

2019-07-01 Thread Aneesh Kumar K.V
Architectures like powerpc use different address range to map ioremap and vmalloc range. The memunmap() check used by the nvdimm layer was wrongly using is_vmalloc_addr() to check for ioremap range which fails for ppc64. This result in ppc64 not freeing the ioremap mapping. The side effect of this

Can I compile Linux Kernel 5.2-rc7 for PowerPC on Intel/AMD x86 hardware?

2019-07-01 Thread Turritopsis Dohrnii Teo En Ming
Good evening from Singapore, Can I compile Linux Kernel 5.2-rc7 for PowerPC on Intel/AMD x86 hardware, for example, AMD Ryzen 9 3950X, with 16 CPU cores and 32 threads? Is it called cross-compiling? Thank you. -BEGIN EMAIL SIGNATURE- The Gospel for all Targeted Individuals (TIs):

Re: [PATCH RFC] generic ELF support for kexec

2019-07-01 Thread Philipp Rudo
Hi Sven, On Tue, 25 Jun 2019 20:54:34 +0200 Sven Schnelle wrote: > Hi List, > > i recently started working on kexec for PA-RISC. While doing so, i figured > that powerpc already has support for reading ELF images inside of the Kernel. > My first attempt was to steal the source code and modify

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

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 10:01:41, Michal Hocko wrote: > On Mon 27-05-19 13:11:47, David Hildenbrand wrote: > > 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

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:45, David Hildenbrand wrote: > 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

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

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 09:45:03, Michal Hocko wrote: > On Mon 27-05-19 13:11:44, David Hildenbrand wrote: > > Will come in handy when wanting to handle errors after > > arch_add_memory(). > > I do not understand this. Why do you add a code for something that is > not possible on this HW (based on the

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

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 09:43:06, Michal Hocko wrote: > On Mon 27-05-19 13:11:43, David Hildenbrand wrote: > > 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. > > Why do we need this? Sure ZONE_DEVICE

Re: [PATCH] powerpc/mm/nvdimm: Add an informative message if we fail to allocate altmap block

2019-07-01 Thread Aneesh Kumar K.V
"Oliver O'Halloran" writes: > On Sat, Jun 29, 2019 at 5:39 PM Aneesh Kumar K.V > wrote: >> >> Allocation from altmap area can fail based on vmemmap page size used. Add >> kernel >> info message to indicate the failure. That allows the user to identify >> whether they >> are really using

Re: Re: [PATCH 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Will Deacon
On Mon, Jul 01, 2019 at 11:03:51AM +0100, Steven Price wrote: > On 01/07/2019 10:27, Will Deacon wrote: > > On Sun, Jun 23, 2019 at 07:44:44PM +1000, Nicholas Piggin wrote: > >> walk_page_range() is going to be allowed to walk page tables other than > >> those of user space. For this it needs to

Re: [PATCH 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Will Deacon
Hi Nick, On Sun, Jun 23, 2019 at 07:44:44PM +1000, Nicholas Piggin wrote: > walk_page_range() is going to be allowed to walk page tables other than > those of user space. For this it needs to know when it has reached a > 'leaf' entry in the page tables. This information will be provided by the >

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

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 11:36:44, Oscar Salvador wrote: > On Mon, Jul 01, 2019 at 10:51:44AM +0200, Michal Hocko wrote: > > Yeah, we do not allow to offline multi zone (node) ranges so the current > > code seems to be over engineered. > > > > Anyway, I am wondering why do we have to strictly check for

Re: Re: [PATCH 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Steven Price
On 01/07/2019 10:27, Will Deacon wrote: > Hi Nick, > > On Sun, Jun 23, 2019 at 07:44:44PM +1000, Nicholas Piggin wrote: >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'leaf' entry in the page

Re: [PATCH v2 3/3] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2019-07-01 Thread Anshuman Khandual
On 07/01/2019 12:10 PM, Nicholas Piggin wrote: > vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. > Whether or not a vmap is huge depends on the architecture details, > alignments, boot options, etc., which the caller can not be expected > to know. Therefore HUGE_VMAP is a

Re: [PATCH v2 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Steven Price
On 01/07/2019 07:40, Nicholas Piggin wrote: > walk_page_range() is going to be allowed to walk page tables other than > those of user space. For this it needs to know when it has reached a > 'leaf' entry in the page tables. This information will be provided by the > p?d_large() functions/macros. >

Re: [PATCH v2 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Catalin Marinas
On Mon, Jul 01, 2019 at 04:40:24PM +1000, Nicholas Piggin wrote: > walk_page_range() is going to be allowed to walk page tables other than > those of user space. For this it needs to know when it has reached a > 'leaf' entry in the page tables. This information will be provided by the >

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

2019-07-01 Thread Oscar Salvador
On Mon, Jul 01, 2019 at 10:51:44AM +0200, Michal Hocko wrote: > Yeah, we do not allow to offline multi zone (node) ranges so the current > code seems to be over engineered. > > Anyway, I am wondering why do we have to strictly check for already > removed nodes links. Is the sysfs code going to

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:52, David Hildenbrand wrote: > 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

Re: [PATCH] powerpc: remove device_to_mask

2019-07-01 Thread Michael Ellerman
Alexey Kardashevskiy writes: > On 29/06/2019 18:03, Christoph Hellwig wrote: >> Use the dma_get_mask helper from dma-mapping.h instead. >> >> Signed-off-by: Christoph Hellwig > > Reviewed-by: Alexey Kardashevskiy I'll add to the change log "because they are functionally identical." cheers

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:51, David Hildenbrand wrote: > 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

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-07-01 Thread Naveen N. Rao
Steven Rostedt wrote: On Thu, 27 Jun 2019 20:58:20 +0530 "Naveen N. Rao" wrote: > But interesting, I don't see a synchronize_rcu_tasks() call > there. We felt we don't need it in this case. We patch the branch to ftrace with a nop first. Other cpus should see that first. But, now that I

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:50, David Hildenbrand wrote: > 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

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:49, David Hildenbrand wrote: > 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 >

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:48, David Hildenbrand wrote: > 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 >

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:47, David Hildenbrand wrote: > 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 =

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:46, David Hildenbrand wrote: > 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 Acked-by: Michal Hocko > --- > drivers/base/memory.c | 15

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:44, David Hildenbrand wrote: > Will come in handy when wanting to handle errors after > arch_add_memory(). I do not understand this. Why do you add a code for something that is not possible on this HW (based on the comment - is it still valid btw?) > Cc: Martin Schwidefsky

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

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:43, David Hildenbrand wrote: > 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. Why do we need this? Sure ZONE_DEVICE is not supported for s390 and so might be the case for

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

2019-07-01 Thread Michal Hocko
[Sorry for a really late response] On Mon 27-05-19 13:11:42, David Hildenbrand wrote: > By converting start and size to page granularity, we actually ignore > unaligned parts within a page instead of properly bailing out with an > error. I do not expect any code path would ever provide an

Re: Re: [PATCH v4 6/8] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-07-01 Thread Ram Pai
On Mon, Jul 01, 2019 at 04:30:55PM +1000, Alexey Kardashevskiy wrote: > > > On 01/07/2019 16:17, maddy wrote: > > > > On 01/07/19 11:24 AM, Alexey Kardashevskiy wrote: > >> > >> On 29/06/2019 06:08, Claudio Carvalho wrote: > >>> When the ultravisor firmware is available, it takes control over

[PATCH v2 3/3] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2019-07-01 Thread Nicholas Piggin
vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. Whether or not a vmap is huge depends on the architecture details, alignments, boot options, etc., which the caller can not be expected to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. This change teaches

[PATCH v2 2/3] powerpc/64s: Add p?d_large definitions

2019-07-01 Thread Nicholas Piggin
The subsequent patch to fix vmalloc_to_page with huge vmap requires HUGE_VMAP archs to provide p?d_large definitions for the non-pgd page table levels they support. Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/book3s/64/pgtable.h | 24

[PATCH v2 1/3] arm64: mm: Add p?d_large() definitions

2019-07-01 Thread Nicholas Piggin
walk_page_range() is going to be allowed to walk page tables other than those of user space. For this it needs to know when it has reached a 'leaf' entry in the page tables. This information will be provided by the p?d_large() functions/macros. For arm64, we already have p?d_sect() macros which

[PATCH v2 0/3] fix vmalloc_to_page for huge vmap mappings

2019-07-01 Thread Nicholas Piggin
This is a change broken out from the huge vmap vmalloc series as requested. There is a little bit of dependency juggling across trees, but patches are pretty trivial. Ideally if Andrew accepts this patch and queues it up for next, then the arch patches would be merged through those trees then

Re: [PATCH v4 6/8] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-07-01 Thread Alexey Kardashevskiy
On 01/07/2019 16:17, maddy wrote: > > On 01/07/19 11:24 AM, Alexey Kardashevskiy wrote: >> >> On 29/06/2019 06:08, Claudio Carvalho wrote: >>> When the ultravisor firmware is available, it takes control over the >>> LDBAR register. In this case, thread-imc updates and save/restore >>>

Re: [PATCH v4 6/8] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-07-01 Thread maddy
On 01/07/19 11:24 AM, Alexey Kardashevskiy wrote: On 29/06/2019 06:08, Claudio Carvalho wrote: When the ultravisor firmware is available, it takes control over the LDBAR register. In this case, thread-imc updates and save/restore operations on the LDBAR register are handled by ultravisor.