Re: [PATCH V5 09/21] riscv: compat: Add basic compat data type implementation

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:33 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > Implement riscv asm/compat.h for struct compat_xxx, > > is_compat_task, compat_user_regset, regset convert. > > > > The rv64 compat.h has

Re: [PATCH v3 0/4] powerpc/pseries/vas: VAS/NXGZIP support with LPM

2022-02-23 Thread Haren Myneni
On Wed, 2022-02-23 at 19:38 +1000, Nicholas Piggin wrote: > Excerpts from Haren Myneni's message of February 20, 2022 6:04 am: > > Virtual Accelerator Switchboard (VAS) is an engine stays on the > > chip. So all windows opened on a specific engine belongs to VAS > > the chip. > > The problem is

Re: [PATCH v4 9/9] powerpc/pseries/vas: Write 'nr_total_credits' for QoS credits change

2022-02-23 Thread Haren Myneni
On Wed, 2022-02-23 at 17:33 +1000, Nicholas Piggin wrote: > Excerpts from Haren Myneni's message of February 20, 2022 6:03 am: > > pseries supports two types of credits - Default (uses normal > > priority > > FIFO) and Qality of service (QoS uses high priority FIFO). The user > > decides the

Re: [PATCH V5 13/21] riscv: compat: process: Add UXL_32 support in start_thread

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:37 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > If the current task is in COMPAT mode, set SR_UXL_32 in status for > > returning userspace. We need CONFIG _COMPAT to prevent compiling > >

Re: [PATCH v3 4/4] powerpc/pseries/vas: Disable window open during migration

2022-02-23 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:08 am: > > The current partition migration implementation does not freeze the > user space and the user space can continue open VAS windows. So > when migration_in_progress flag is enabled, VAS open window > API returns -EBUSY. Seems

Re: [PATCH v4 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal

2022-02-23 Thread Haren Myneni
On Wed, 2022-02-23 at 17:23 +1000, Nicholas Piggin wrote: > Excerpts from Haren Myneni's message of February 20, 2022 6:00 am: > > The hypervisor assigns vas credits (windows) for each LPAR based > > on the number of cores configured in that system. The OS is > > expected to release credits when

Re: [PATCH v2 09/18] mips: use simpler access_ok()

2022-02-23 Thread Arnd Bergmann
On Wed, Feb 23, 2022 at 8:41 AM Thomas Bogendoerfer wrote: > > On Wed, Feb 16, 2022 at 02:13:23PM +0100, Arnd Bergmann wrote: > > diff --git a/arch/mips/include/asm/uaccess.h > > b/arch/mips/include/asm/uaccess.h > > index db9a8e002b62..d7c89dc3426c 100644 > > ---

Re: [PATCH v3 0/4] powerpc/pseries/vas: VAS/NXGZIP support with LPM

2022-02-23 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:04 am: > > Virtual Accelerator Switchboard (VAS) is an engine stays on the > chip. So all windows opened on a specific engine belongs to VAS > the chip. The problem is more that PAPR does not virtualise the VAS windows, right? That's a

Re: [PATCH v3 1/4] powerpc/pseries/vas: Define global hv_cop_caps struct

2022-02-23 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:05 am: > > The coprocessor capabilities struct is used to get default and > QoS capabilities from the hypervisor during init, DLPAR event and > migration. So instead of allocating this struct for each event, > define global struct and

Re: [PATCH v4 5/9] powerpc/vas: Map paste address only if window is active

2022-02-23 Thread Haren Myneni
On Wed, 2022-02-23 at 17:11 +1000, Nicholas Piggin wrote: > Excerpts from Haren Myneni's message of February 20, 2022 5:59 am: > > The paste address mapping is done with mmap() after the window is > > opened with ioctl. If the window is closed by OS in the hypervisor > > due to DLPAR after this

Re: [PATCH v4 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-23 Thread Haren Myneni
On Wed, 2022-02-23 at 17:28 +1000, Nicholas Piggin wrote: > Excerpts from Haren Myneni's message of February 20, 2022 6:01 am: > > VAS windows can be closed in the hypervisor due to lost credits > > when the core is removed and the kernel gets fault for NX > > requests on these in-active windows.

Re: [PATCH V5 16/21] riscv: compat: vdso: Add rv32 VDSO base code implementation

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:40 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > There is no vgettimeofday supported in rv32 that makes simple to > > generate rv32 vdso code which only needs riscv64 compiler. Other > >

Re: [PATCH v3 2/4] powerpc/pseries/vas: Modify reconfig open/close functions for migration

2022-02-23 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:05 am: > > VAS is a hardware engine stays on the chip. So when the partition > migrates, all VAS windows on the source system have to be closed > and reopen them on the destination after migration. > > This patch make changes to the

Re: [PATCH v3 3/4] powerpc/pseries/vas: Add VAS migration handler

2022-02-23 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:06 am: > > Since the VAS windows belong to the VAS hardware resource, the > hypervisor expects the partition to close them on source partition > and reopen them after the partition migrated on the destination > machine. > > This handler

[PATCH 3/3] powerpc: lib: sstep: fix build errors

2022-02-23 Thread Anders Roxell
Building tinyconfig with gcc (Debian 11.2.0-16) and assembler (Debian 2.37.90.20220207) the following build error shows up: {standard input}: Assembler messages: {standard input}:10576: Error: unrecognized opcode: `stbcx.' {standard input}:10680: Error: unrecognized opcode: `lharx' {standard

Re: [PATCH] powerpc/security: Provide stubs for when PPC_BARRIER_NOSPEC isn't enabled

2022-02-23 Thread Christophe Leroy
Le 10/01/2022 à 11:07, Naveen N. Rao a écrit : > kernel test robot reported the below build error with a randconfig: >powerpc64-linux-ld: arch/powerpc/net/bpf_jit_comp64.o:(.toc+0x0): >undefined reference to `powerpc_security_features' > > This can happen if CONFIG_PPC_BARRIER_NOSPEC is

[PATCH] powerpc: 8xx: fix a return value error in mpc8xx_pic_init

2022-02-23 Thread Hangyu Hua
mpc8xx_pic_init() should return -ENOMEM instead of 0 when irq_domain_add_linear() return NULL. This cause mpc8xx_pics_init to continue executing even if mpc8xx_pic_host is NULL. Fixes: cc76404feaed ("powerpc/8xx: Fix possible device node reference leak") Signed-off-by: Hangyu Hua ---

[PATCH v6 1/6] module: Always have struct mod_tree_root

2022-02-23 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. This means that struct mod_tree_root is required even without MODULES_TREE_LOOKUP. Signed-off-by: Christophe Leroy Reviewed-by: Aaron Tomlin --- kernel/module/internal.h | 4 +++- kernel/module/main.c | 5 - 2 files

Re: [PATCH v2 1/7] ftrace: Expose flags used for ftrace_replace_code()

2022-02-23 Thread Christophe Leroy
Le 27/06/2019 à 13:23, Naveen N. Rao a écrit : Since ftrace_replace_code() is a __weak function and can be overridden, we need to expose the flags that can be set. So, move the flags enum to the header file. Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Naveen N. Rao This series

[PATCH v6 4/6] module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC

2022-02-23 Thread Christophe Leroy
Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC to allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability on page basis, this is done per

[PATCH] powerpc/module_64: fix array_size.cocci warning

2022-02-23 Thread Guo Zhengkui
Fix following coccicheck warning: ./arch/powerpc/kernel/module_64.c:432:40-41: WARNING: Use ARRAY_SIZE. ARRAY_SIZE(arr) is a macro provided by the kernel. It makes sure that arr is an array, so it's safer than sizeof(arr) / sizeof(arr[0]) and more standard. Signed-off-by: Guo Zhengkui ---

Re: [PATCH v4 0/3] KVM: PPC: Book3S PR: Fixes for AIL and SCV

2022-02-23 Thread Christian Borntraeger
Am 22.02.22 um 15:11 schrieb Paolo Bonzini: On 2/22/22 07:47, Nicholas Piggin wrote: Patch 3 requires a KVM_CAP_PPC number allocated. QEMU maintainers are happy with it (link in changelog) just waiting on KVM upstreaming. Do you have objections to the series going to ppc/kvm tree first, or

[PATCH v6 6/6] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx

2022-02-23 Thread Christophe Leroy
book3s/32 and 8xx have a separate area for allocating modules, defined by MODULES_VADDR / MODULES_END. On book3s/32, it is not possible to protect against execution on a page basis. A full 256M segment is either Exec or NoExec. The module area is in an Exec segment while vmalloc area is in a

[PATCH v6 2/6] module: Prepare for handling several RB trees

2022-02-23 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. Modify functions to give the tree as a parameter. Signed-off-by: Christophe Leroy --- kernel/module/internal.h| 4 ++-- kernel/module/main.c| 16 kernel/module/tree_lookup.c | 20

Re: [PATCH V5 17/21] riscv: compat: vdso: Add setup additional pages implementation

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 8:19 PM Rolf Eike Beer wrote: > > > @@ -66,35 +68,35 @@ static int vdso_mremap(const struct vm_special_mapping > > *sm, return 0; > > } > > > > -static int __init __vdso_init(void) > > +static int __init __vdso_init(struct __vdso_info *vdso_info) > > { > > unsigned

Re: [PATCH v4 0/3] KVM: PPC: Book3S PR: Fixes for AIL and SCV

2022-02-23 Thread Nicholas Piggin
Excerpts from Christian Borntraeger's message of February 23, 2022 7:14 pm: > > > Am 22.02.22 um 15:11 schrieb Paolo Bonzini: >> On 2/22/22 07:47, Nicholas Piggin wrote: >>> Patch 3 requires a KVM_CAP_PPC number allocated. QEMU maintainers are >>> happy with it (link in changelog) just waiting

Re: [PATCH V5 00/21] riscv: compat: Add COMPAT mode support for rv64

2022-02-23 Thread Arnd Bergmann
On Wed, Feb 23, 2022 at 2:43 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:24 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > > s390, mips, sparc) have supported COMPAT mode. But they all have > >

Re: [PATCH V5 17/21] riscv: compat: vdso: Add setup additional pages implementation

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:41 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > Reconstruct __setup_additional_pages() by appending vdso info > > pointer argument to meet compat_vdso_info requirement. And change > >

[PATCH v6 3/6] module: Introduce data_layout

2022-02-23 Thread Christophe Leroy
In order to allow separation of data from text, add another layout, called data_layout. For architectures requesting separation of text and data, only text will go in core_layout and data will go in data_layout. For architectures which keep text and data together, make data_layout an alias of

[PATCH v6 0/6] Allocate module text and data separately

2022-02-23 Thread Christophe Leroy
This series applies on top of my series "miscellanuous cleanups" v4. This series allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability

[PATCH v6 5/6] module: Remove module_addr_min and module_addr_max

2022-02-23 Thread Christophe Leroy
Replace module_addr_min and module_addr_max by mod_tree.addr_min and mod_tree.addr_max Signed-off-by: Christophe Leroy --- kernel/module/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index cf236e964cf6..ce0ef17662c9

[PATCH 1/3] powerpc: lib: sstep: fix 'sthcx' instruction

2022-02-23 Thread Anders Roxell
Looks like there been a copy paste mistake when added the instruction 'stbcx' twice and one was probably meant to be 'sthcx'. Changing to 'sthcx' from 'stbcx'. Cc: # v4.13+ Fixes: 350779a29f11 ("powerpc: Handle most loads and stores in instruction emulation code") Reported-by: Arnd Bergmann

[PATCH 2/3] powerpc: fix build errors

2022-02-23 Thread Anders Roxell
Building tinyconfig with gcc (Debian 11.2.0-16) and assembler (Debian 2.37.90.20220207) the following build error shows up: {standard input}: Assembler messages: {standard input}:1190: Error: unrecognized opcode: `stbcix' {standard input}:1433: Error: unrecognized opcode: `lwzcix' {standard

[RFC PATCH] KVM: PPC: Book3S HV: Update guest state entry/exit accounting to new API

2022-02-23 Thread Nicholas Piggin
Update the guest state and timing entry/exit accounting to use the new API, which was introduced following issues found[1]. KVM HV does not seem to suffer from those issues listed, but it does call srcu inside the guest context which is fragile at best. The new API allows guest entry timing to be

Re: [PATCH 3/3] powerpc: lib: sstep: fix build errors

2022-02-23 Thread Segher Boessenkool
On Wed, Feb 23, 2022 at 02:58:20PM +0100, Anders Roxell wrote: > Building tinyconfig with gcc (Debian 11.2.0-16) and assembler (Debian > 2.37.90.20220207) the following build error shows up: > > {standard input}: Assembler messages: > {standard input}:10576: Error: unrecognized opcode: `stbcx.' >

[PATCH v4 1/1] crypto: vmx - add missing dependencies

2022-02-23 Thread Petr Vorel
vmx-crypto module depends on CRYPTO_AES, CRYPTO_CBC, CRYPTO_CTR or CRYPTO_XTS, thus add them. These dependencies are likely to be enabled, but if CRYPTO_DEV_VMX=y && !CRYPTO_MANAGER_DISABLE_TESTS and either of CRYPTO_AES, CRYPTO_CBC, CRYPTO_CTR or CRYPTO_XTS is built as module or disabled,

[PATCH] powerpc/32: Clear volatile regs on syscall exit

2022-02-23 Thread Christophe Leroy
Commit a82adfd5c7cb ("hardening: Introduce CONFIG_ZERO_CALL_USED_REGS") added zeroing of used registers at function exit. At the time being, PPC64 clears volatile registers on syscall exit but PPC32 doesn't do it for performance reason. Add that clearing in PPC32 syscall exit as well, but only

Re: [RFC PATCH] lkdtm: Replace lkdtm_rodata_do_nothing() by do_nothing()

2022-02-23 Thread Christophe Leroy
Hi Kees, Le 17/10/2021 à 19:19, Christophe Leroy a écrit : > All EXEC tests are based on running a copy of do_nothing() > except lkdtm_EXEC_RODATA which uses a different function > called lkdtm_rodata_do_nothing(). > > On architectures using function descriptors, EXEC tests are > performed using

Re: [PATCH] powerpc/32: Clear volatile regs on syscall exit

2022-02-23 Thread Kees Cook
On Wed, Feb 23, 2022 at 06:11:36PM +0100, Christophe Leroy wrote: > Commit a82adfd5c7cb ("hardening: Introduce CONFIG_ZERO_CALL_USED_REGS") > added zeroing of used registers at function exit. > > At the time being, PPC64 clears volatile registers on syscall exit but > PPC32 doesn't do it for

Re: [PATCH 00/16] Remove usage of the deprecated "pci-dma-compat.h" API

2022-02-23 Thread Christophe JAILLET
Le 23/02/2022 à 08:46, Christoph Hellwig a écrit : Hi Christophe, do you know what the state is in current linux-next? I think we'll just want to queue up anything left at this point in the dma-mapping or PCI tree and get it done. Hi, Patch 01, 04, 05, 06, 08, 09 have not reached -next

Re: [PATCH 00/16] Remove usage of the deprecated "pci-dma-compat.h" API

2022-02-23 Thread Arnd Bergmann
On Wed, Feb 23, 2022 at 9:26 PM Christophe JAILLET wrote: > > Le 23/02/2022 à 08:46, Christoph Hellwig a écrit : > > Hi Christophe, > > > > do you know what the state is in current linux-next? > > > > I think we'll just want to queue up anything left at this point in the > > dma-mapping or PCI

Re: [PATCH v6 0/4] Add perf interface to expose nvdimm

2022-02-23 Thread Dan Williams
On Wed, Feb 23, 2022 at 11:07 AM Dan Williams wrote: > > On Fri, Feb 18, 2022 at 10:06 AM Dan Williams > wrote: > > > > On Thu, Feb 17, 2022 at 8:34 AM Kajol Jain wrote: > > > > > > Patchset adds performance stats reporting support for nvdimm. > > > Added interface includes support for pmu

Re: [PATCH v3 1/2] crypto: vmx - merge CRYPTO_DEV_VMX_ENCRYPT into CRYPTO_DEV_VMX

2022-02-23 Thread Petr Vorel
> On Thu, Feb 17, 2022 at 11:57:50AM +0100, Petr Vorel wrote: > > CRYPTO_DEV_VMX_ENCRYPT is redundant with CRYPTO_DEV_VMX. > > And it also forces CRYPTO_GHASH to be builtin even > > CRYPTO_DEV_VMX_ENCRYPT was configured as module. > Just because a tristate sits under a bool, it does not force >

Re: [PATCH 2/3] powerpc: fix build errors

2022-02-23 Thread Segher Boessenkool
Hi! On Wed, Feb 23, 2022 at 02:58:19PM +0100, Anders Roxell wrote: > Building tinyconfig with gcc (Debian 11.2.0-16) and assembler (Debian > 2.37.90.20220207) the following build error shows up: > > {standard input}: Assembler messages: > {standard input}:1190: Error: unrecognized opcode:

Re: [PATCH v2 09/18] mips: use simpler access_ok()

2022-02-23 Thread Linus Torvalds
On Mon, Feb 21, 2022 at 5:25 AM Thomas Bogendoerfer wrote: > > With this patch [ .. snip snip ..] > I at least get my simple test cases fixed, but I'm not sure this is > correct. I think you really want to do that anyway, just to get things like wild kernel pointers right (ie think

Re: [PATCH] powerpc/32: Clear volatile regs on syscall exit

2022-02-23 Thread Gabriel Paubert
On Wed, Feb 23, 2022 at 06:11:36PM +0100, Christophe Leroy wrote: > Commit a82adfd5c7cb ("hardening: Introduce CONFIG_ZERO_CALL_USED_REGS") > added zeroing of used registers at function exit. > > At the time being, PPC64 clears volatile registers on syscall exit but > PPC32 doesn't do it for

Re: [PATCH v6 0/4] Add perf interface to expose nvdimm

2022-02-23 Thread Dan Williams
On Fri, Feb 18, 2022 at 10:06 AM Dan Williams wrote: > > On Thu, Feb 17, 2022 at 8:34 AM Kajol Jain wrote: > > > > Patchset adds performance stats reporting support for nvdimm. > > Added interface includes support for pmu register/unregister > > functions. A structure is added called nvdimm_pmu