Possible regression by ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)

2021-07-27 Thread Paul Menzel
Dear Christophe, On ppc64le Go 1.16.2 from Ubuntu 21.04 terminates with a segmentation fault [1], and it might be related to *[release-branch.go1.16] runtime: fix crash during VDSO calls on PowerPC* [2], conjecturing that commit ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementat

[PATCH v6 1/6] powerpc/pseries: rename min_common_depth to primary_domain_index

2021-07-27 Thread Aneesh Kumar K.V
No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index f2bf98bdcea

[PATCH v6 0/6] Add support for FORM2 associativity

2021-07-27 Thread Aneesh Kumar K.V
Form2 associativity adds a much more flexible NUMA topology layout than what is provided by Form1. More details can be found in patch 7. $ numactl -H ... node distances: node 0 1 2 3 0: 10 11 222 33 1: 44 10 55 66 2: 77 88 10 99 3: 101 121 132 10 $ After DAX k

[PATCH v6 3/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-07-27 Thread Aneesh Kumar K.V
The associativity details of the newly added resourced are collected from the hypervisor via "ibm,configure-connector" rtas call. Update the numa distance details of the newly added numa node after the above call. Instead of updating NUMA distance every time we lookup a node id from the associativ

[PATCH v6 6/6] powerpc/pseries: Consolidate form1 distance initialization into a helper

2021-07-27 Thread Aneesh Kumar K.V
Currently, we duplicate parsing code for ibm,associativity and ibm,associativity-lookup-arrays in the kernel. The associativity array provided by these device tree properties are very similar and hence can use a helper to parse the node id and numa distance details. Signed-off-by: Aneesh Kumar K.V

[PATCH v6 2/6] powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY

2021-07-27 Thread Aneesh Kumar K.V
Also make related code cleanup that will allow adding FORM2_AFFINITY in later patches. No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/firmware.h | 4 +-- arch/powerpc/include/asm/prom.h | 2 +- arch/po

[PATCH v6 5/6] powerpc/pseries: Add support for FORM2 associativity

2021-07-27 Thread Aneesh Kumar K.V
PAPR interface currently supports two different ways of communicating resource grouping details to the OS. These are referred to as Form 0 and Form 1 associativity grouping. Form 0 is the older format and is now considered deprecated. This patch adds another resource grouping named FORM2. Signed-o

[PATCH v6 4/6] powerpc/pseries: Add a helper for form1 cpu distance

2021-07-27 Thread Aneesh Kumar K.V
This helper is only used with the dispatch trace log collection. A later patch will add Form2 affinity support and this change helps in keeping that simpler. Also add a comment explaining we don't expect the code to be called with FORM0 Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V -

Re: [PATCH printk v4 0/6] printk: remove safe buffers

2021-07-27 Thread Petr Mladek
On Thu 2021-07-15 21:39:53, John Ogness wrote: > Hi, > > Here is v4 of a series to remove the safe buffers. v3 can be > found here [0]. The safe buffers are no longer needed because > messages can be stored directly into the log buffer from any > context. > > However, the safe buffers also provid

Re: [PATCH v5 2/2] KVM: PPC: Book3S HV: Stop forwarding all HFUs to L1

2021-07-27 Thread Fabiano Rosas
Nicholas Piggin writes: > Excerpts from Fabiano Rosas's message of July 27, 2021 6:17 am: >> If the nested hypervisor has no access to a facility because it has >> been disabled by the host, it should also not be able to see the >> Hypervisor Facility Unavailable that arises from one of its guest

[PATCH v5 0/6] compat: remove compat_alloc_user_space

2021-07-27 Thread Arnd Bergmann
From: Arnd Bergmann Going through compat_alloc_user_space() to convert indirect system call arguments tends to add complexity compared to handling the native and compat logic in the same code. Out of the other remaining callers, the linux-media series went into v5.14, and the network ioctl handl

[PATCH v5 1/6] kexec: move locking into do_kexec_load

2021-07-27 Thread Arnd Bergmann
From: Arnd Bergmann The locking is the same between the native and compat version of sys_kexec_load(), so it can be done in the common implementation to reduce duplication. Co-developed-by: Eric Biederman Co-developed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann --- kernel/kexec.c | 44

[PATCH v5 2/6] kexec: avoid compat_alloc_user_space

2021-07-27 Thread Arnd Bergmann
From: Arnd Bergmann kimage_alloc_init() expects a __user pointer, so compat_sys_kexec_load() uses compat_alloc_user_space() to convert the layout and put it back onto the user space caller stack. Moving the user space access into the syscall handler directly actually makes the code simpler, as t

[PATCH v5 3/6] mm: simplify compat_sys_move_pages

2021-07-27 Thread Arnd Bergmann
From: Arnd Bergmann The compat move_pages() implementation uses compat_alloc_user_space() for converting the pointer array. Moving the compat handling into the function itself is a bit simpler and lets us avoid the compat_alloc_user_space() call. Reviewed-by: Christoph Hellwig Signed-off-by: Ar

[PATCH v5 4/6] mm: simplify compat numa syscalls

2021-07-27 Thread Arnd Bergmann
From: Arnd Bergmann The compat implementations for mbind, get_mempolicy, set_mempolicy and migrate_pages are just there to handle the subtly different layout of bitmaps on 32-bit hosts. The compat implementation however lacks some of the checks that are present in the native one, in particular f

[PATCH v5 5/6] compat: remove some compat entry points

2021-07-27 Thread Arnd Bergmann
From: Arnd Bergmann These are all handled correctly when calling the native system call entry point, so remove the special cases. Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/unistd32.h | 10 +++--- arch/mips/kernel/syscalls/syscall_n32.tbl |

[PATCH v5 6/6] arch: remove compat_alloc_user_space

2021-07-27 Thread Arnd Bergmann
From: Arnd Bergmann All users of compat_alloc_user_space() and copy_in_user() have been removed from the kernel, only a few functions in sparc remain that can be changed to calling arch_copy_in_user() instead. Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/compat.h | 5 -- ar

Re: [PATCH v5 0/6] compat: remove compat_alloc_user_space

2021-07-27 Thread Christoph Hellwig
On Tue, Jul 27, 2021 at 04:48:53PM +0200, Arnd Bergmann wrote: > Since these patches are now all that remains, it would be nice to > merge it all through Andrew's Linux-mm tree, which is already based > on top of linux-next. Is it?

Re: [PATCH v5 6/6] arch: remove compat_alloc_user_space

2021-07-27 Thread Christoph Hellwig
finally! Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v5 4/6] mm: simplify compat numa syscalls

2021-07-27 Thread Heiko Carstens
On Tue, Jul 27, 2021 at 04:48:57PM +0200, Arnd Bergmann wrote: > --- > include/linux/compat.h | 17 ++-- > mm/mempolicy.c | 175 + > 2 files changed, 63 insertions(+), 129 deletions(-) ... > +static int get_bitmap(unsigned long *mask, const unsigned

Re: [PATCH v5 4/6] mm: simplify compat numa syscalls

2021-07-27 Thread Arnd Bergmann
On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens wrote: > > On Tue, Jul 27, 2021 at 04:48:57PM +0200, Arnd Bergmann wrote: > > --- > > include/linux/compat.h | 17 ++-- > > mm/mempolicy.c | 175 + > > 2 files changed, 63 insertions(+), 129 deletions(

Re: [PATCH v5 4/6] mm: simplify compat numa syscalls

2021-07-27 Thread Heiko Carstens
On Tue, Jul 27, 2021 at 07:40:05PM +0200, Arnd Bergmann wrote: > On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens wrote: > > > +static int get_bitmap(unsigned long *mask, const unsigned long __user > > > *nmask, > > > + unsigned long maxnode) > > > +{ > > > + unsigned long nlo

Re: [PATCH v5 4/6] mm: simplify compat numa syscalls

2021-07-27 Thread Arnd Bergmann
On Tue, Jul 27, 2021 at 8:38 PM Heiko Carstens wrote: > > -268 commonmbind sys_mbind > compat_sys_mbind > -269 commonget_mempolicy sys_get_mempolicy > compat_sys_get_mempolicy > -270 commonset_mempolicy sys_

Re: [PATCH v5 4/6] mm: simplify compat numa syscalls

2021-07-27 Thread Heiko Carstens
On Tue, Jul 27, 2021 at 08:49:40PM +0200, Arnd Bergmann wrote: > On Tue, Jul 27, 2021 at 8:38 PM Heiko Carstens wrote: > > > > -268 commonmbind sys_mbind > > compat_sys_mbind > > -269 commonget_mempolicy sys_get_mempolicy

Re: [PATCH v5 0/6] compat: remove compat_alloc_user_space

2021-07-27 Thread Andrew Morton
On Tue, 27 Jul 2021 15:59:55 +0100 Christoph Hellwig wrote: > On Tue, Jul 27, 2021 at 04:48:53PM +0200, Arnd Bergmann wrote: > > Since these patches are now all that remains, it would be nice to > > merge it all through Andrew's Linux-mm tree, which is already based > > on top of linux-next. > >

Re: [PATCH v5 0/6] compat: remove compat_alloc_user_space

2021-07-27 Thread Arnd Bergmann
On Tue, Jul 27, 2021 at 10:11 PM Andrew Morton wrote: > > On Tue, 27 Jul 2021 15:59:55 +0100 Christoph Hellwig > wrote: > > > On Tue, Jul 27, 2021 at 04:48:53PM +0200, Arnd Bergmann wrote: > > > Since these patches are now all that remains, it would be nice to > > > merge it all through Andrew's

[PATCH 00/11] Implement generic prot_guest_has() helper function

2021-07-27 Thread Tom Lendacky
This patch series provides a generic helper function, prot_guest_has(), to replace the sme_active(), sev_active(), sev_es_active() and mem_encrypt_active() functions. It is expected that as new protected virtualization technologies are added to the kernel, they can all be covered by a single funct

[PATCH 02/11] x86/sev: Add an x86 version of prot_guest_has()

2021-07-27 Thread Tom Lendacky
Introduce an x86 version of the prot_guest_has() function. This will be used in the more generic x86 code to replace vendor specific calls like sev_active(), etc. While the name suggests this is intended mainly for guests, it will also be used for host memory encryption checks in place of sme_acti

[PATCH 01/11] mm: Introduce a function to check for virtualization protection features

2021-07-27 Thread Tom Lendacky
In prep for other protected virtualization technologies, introduce a generic helper function, prot_guest_has(), that can be used to check for specific protection attributes, like memory encryption. This is intended to eliminate having to add multiple technology-specific checks to the code (e.g. if

[PATCH 03/11] powerpc/pseries/svm: Add a powerpc version of prot_guest_has()

2021-07-27 Thread Tom Lendacky
Introduce a powerpc version of the prot_guest_has() function. This will be used to replace the powerpc mem_encrypt_active() implementation, so the implementation will initially only support the PATTR_MEM_ENCRYPT attribute. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signe

[PATCH 04/11] x86/sme: Replace occurrences of sme_active() with prot_guest_has()

2021-07-27 Thread Tom Lendacky
Replace occurrences of sme_active() with the more generic prot_guest_has() using PATTR_HOST_MEM_ENCRYPT, except for in arch/x86/mm/mem_encrypt*.c where PATTR_SME will be used. If future support is added for other memory encryption technologies, the use of PATTR_HOST_MEM_ENCRYPT can be updated, as r

[PATCH 05/11] x86/sev: Replace occurrences of sev_active() with prot_guest_has()

2021-07-27 Thread Tom Lendacky
Replace occurrences of sev_active() with the more generic prot_guest_has() using PATTR_GUEST_MEM_ENCRYPT, except for in arch/x86/mm/mem_encrypt*.c where PATTR_SEV will be used. If future support is added for other memory encryption technologies, the use of PATTR_GUEST_MEM_ENCRYPT can be updated, as

[PATCH 06/11] x86/sev: Replace occurrences of sev_es_active() with prot_guest_has()

2021-07-27 Thread Tom Lendacky
Replace occurrences of sev_es_active() with the more generic prot_guest_has() using PATTR_GUEST_PROT_STATE, except for in arch/x86/kernel/sev*.c and arch/x86/mm/mem_encrypt*.c where PATTR_SEV_ES will be used. If future support is added for other memory encyrption techonologies, the use of PATTR_GUE

[PATCH 07/11] treewide: Replace the use of mem_encrypt_active() with prot_guest_has()

2021-07-27 Thread Tom Lendacky
Replace occurrences of mem_encrypt_active() with calls to prot_guest_has() with the PATTR_MEM_ENCRYPT attribute. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: David Airlie Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxi

[PATCH 08/11] mm: Remove the now unused mem_encrypt_active() function

2021-07-27 Thread Tom Lendacky
The mem_encrypt_active() function has been replaced by prot_guest_has(), so remove the implementation. Signed-off-by: Tom Lendacky --- include/linux/mem_encrypt.h | 4 1 file changed, 4 deletions(-) diff --git a/include/linux/mem_encrypt.h b/include/linux/mem_encrypt.h index 5c4a18a91f89..

[PATCH 09/11] x86/sev: Remove the now unused mem_encrypt_active() function

2021-07-27 Thread Tom Lendacky
The mem_encrypt_active() function has been replaced by prot_guest_has(), so remove the implementation. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/include/asm/mem_encrypt.h | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/x86/in

[PATCH 10/11] powerpc/pseries/svm: Remove the now unused mem_encrypt_active() function

2021-07-27 Thread Tom Lendacky
The mem_encrypt_active() function has been replaced by prot_guest_has(), so remove the implementation. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Tom Lendacky --- arch/powerpc/include/asm/mem_encrypt.h | 5 - 1 file changed, 5 deletions(-) diff --gi

[PATCH 11/11] s390/mm: Remove the now unused mem_encrypt_active() function

2021-07-27 Thread Tom Lendacky
The mem_encrypt_active() function has been replaced by prot_guest_has(), so remove the implementation. Since the default implementation of the prot_guest_has() matches the s390 implementation of mem_encrypt_active(), prot_guest_has() does not need to be implemented in s390 (the config option ARCH_H

Re: [PATCH 00/11] Implement generic prot_guest_has() helper function

2021-07-27 Thread Tom Lendacky
On 7/27/21 5:26 PM, Tom Lendacky wrote: > This patch series provides a generic helper function, prot_guest_has(), > to replace the sme_active(), sev_active(), sev_es_active() and > mem_encrypt_active() functions. > > It is expected that as new protected virtualization technologies are > added to t

Re: Possible regression by ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)

2021-07-27 Thread Benjamin Herrenschmidt
On Tue, 2021-07-27 at 10:45 +0200, Paul Menzel wrote: > Dear Christophe, > > > On ppc64le Go 1.16.2 from Ubuntu 21.04 terminates with a segmentation > fault [1], and it might be related to *[release-branch.go1.16] runtime: > fix crash during VDSO calls on PowerPC* [2], conjecturing that commit

Re: switch the block layer to use kmap_local_page v3

2021-07-27 Thread Jens Axboe
On 7/26/21 11:56 PM, Christoph Hellwig wrote: > Hi all, > > this series switches the core block layer code and all users of the > existing bvec kmap helpers to use kmap_local_page. Drivers that > currently use open coded kmap_atomic calls will converted in a follow > on series. > > To do so a ne

Re: [PATCH] powerpc/xmon: use ARRAY_SIZE

2021-07-27 Thread Michael Ellerman
Jason Wang writes: > The ARRAY_SIZE is the macro definition of sizeof(a)/sizeof(a[0]) and > it is more compact and formal to get a array size. > > Signed-off-by: Jason Wang > --- > arch/powerpc/xmon/ppc-opc.c | 12 > 1 file changed, 4 insertions(+), 8 deletions(-) This code is copi