[PATCH] rcu: torture: ppc: Remove duplicated argument --enable-kvm

2023-03-25 Thread zhouzhouyi
From: Zhouyi Zhou The argument --enable-kvm is duplicated because qemu_args in kvm-test-1-run.sh has already give this. Signed-off-by: Zhouyi Zhou --- Dear RCU and PPC developers I discover this possible minor flaw when I am performing RCU torture test in PPC VM of of Open Source Lab

[PATCH v2 4/4] powerpc/4xx: Delete unnecessary variable initialisations in four functions

2023-03-25 Thread Markus Elfring
Date: Sat, 25 Mar 2023 16:00:36 +0100 Some local variables will be set to an appropriate value before usage. Thus omit explicit initialisations at the beginning of these functions. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/4xx/pci.c | 14 +++--- 1 file changed, 7 insertio

[PATCH v2 3/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pci_bridge()

2023-03-25 Thread Markus Elfring
Date: Sat, 25 Mar 2023 15:56:09 +0100 The label “fail” was used to jump to another pointer check despite of the detail in the implementation of the function “ppc4xx_probe_pci_bridge” that it was determined already that the corresponding variable contained a null pointer (because of a failed functi

[PATCH v2 2/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pcix_bridge()

2023-03-25 Thread Markus Elfring
Date: Thu, 16 Mar 2023 19:09:33 +0100 The label “fail” was used to jump to another pointer check despite of the detail in the implementation of the function “ppc4xx_probe_pcix_bridge” that it was determined already that the corresponding variable contained a null pointer (because of a failed funct

[PATCH v2 1/4] powerpc/4xx: Fix exception handling in ppc4xx_pciex_port_setup_hose()

2023-03-25 Thread Markus Elfring
Date: Thu, 16 Mar 2023 19:00:57 +0100 The label “fail” was used to jump to another pointer check despite of the detail in the implementation of the function “ppc4xx_pciex_port_setup_hose” that it was determined already that the corresponding variable contained a null pointer (because of a failed f

[PATCH v2 0/4] powerpc/4xx: Adjustments for four function implementations

2023-03-25 Thread Markus Elfring
Date: Sat, 25 Mar 2023 16:10:23 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (4): Fix exception handling in ppc4xx_pciex_port_setup_hose() Fix exception handling in ppc4xx_probe_pcix_bridge() Fix exception handling in ppc4xx_probe_pc

[PATCH resent v2 2/2] powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()

2023-03-25 Thread Markus Elfring
Date: Tue, 21 Mar 2023 10:50:08 +0100 The label “out_err” was used to jump to another pointer check despite of the detail in the implementation of the function “pSeries_reconfig_add_node” that it was determined already that the corresponding variable contained a null pointer (because of a failed f

[PATCH resent v2 1/2] powerpc/pseries: Do not pass an error pointer to of_node_put() in pSeries_reconfig_add_node()

2023-03-25 Thread Markus Elfring
Date: Tue, 21 Mar 2023 10:30:23 +0100 It can be determined in the implementation of the function “pSeries_reconfig_add_node” that an error code would occasionally be provided by a call of a function like pseries_of_derive_parent(). This error indication was passed to an of_node_put() call accordin

[PATCH resent v2 0/2] powerpc/pseries: Fixes for exception handling in pSeries_reconfig_add_node()

2023-03-25 Thread Markus Elfring
Date: Tue, 21 Mar 2023 11:26:32 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Do not pass an error pointer to of_node_put() Fix exception handling arch/powerpc/platforms/pseries/reconfig.c | 26 --- 1 file ch

[PATCH v2 2/2] powerpc/64s: Run at the kernel virtual address earlier in boot

2023-03-25 Thread Nicholas Piggin
This mostly consolidates the Book3E and Book3S behaviour in boot WRT executing from the physical or virtual address. Book3E sets up kernel virtual linear map in start_initialization_book3e and runs from the virtual linear alias after that. This change makes Book3S begin to execute from the virtual

[PATCH v2 1/2] powerpc/64: Move initial base and TOC pointer calculation

2023-03-25 Thread Nicholas Piggin
A later change moves the non-prom case to run at the virtual address earlier, which calls for virtual TOC and kernel base. Split these two calculations for prom and non-prom to make that change simpler. Signed: Nicholas Piggin --- arch/powerpc/kernel/head_64.S | 28 +++-

[PATCH v2 0/2] powerpc/64: More PCREL preparation

2023-03-25 Thread Nicholas Piggin
Here's a couple more PCREL prerequisites I'll see if there is any appetite to merge. These are mucking around with very early boot which is always scary. I've definitely not tested it on enough platform either... After this though, PCREL enablement only requires trivial changes to boot asm code so

[PATCH 2/2] powerpc/64: Rename entry_64.S to prom_entry.S

2023-03-25 Thread Nicholas Piggin
This file contains only the enter_prom implementation now. Trim includes and update header comment while we're here. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/Makefile | 8 +++-- .../kernel/{entry_64.S => prom_entry.S} | 30 ++- scripts/head-o

[PATCH 1/2] powerpc: merge 32-bit and 64-bit _switch implementation

2023-03-25 Thread Nicholas Piggin
The _switch stack frame setup are substantially the same, so are the comments. The difference in how the stack and current are switched, and other hardware and software housekeeping is done is moved into macros. Signed-off-by: Nicholas Piggin --- These patches are mostly just shuffling code aroun

[PATCH v2 8/8] powerpc: copy_thread don't set PPR in user interrupt frame regs

2023-03-25 Thread Nicholas Piggin
syscalls do not set the PPR field in their interrupt frame and return from syscall always sets the default PPR for userspace, so setting the value in the ret_from_fork frame is not necessary and mildly inconsistent. Remove it. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/process.c | 5

[PATCH v2 7/8] powerpc: copy_thread don't set _TIF_RESTOREALL

2023-03-25 Thread Nicholas Piggin
In the kernel user thread path, don't set _TIF_RESTOREALL because the thread is required to call kernel_execve() before it returns, which will set _TIF_RESTOREALL if necessary via start_thread(). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/interrupt_64.S | 5 + arch/powerpc/kernel

[PATCH v2 6/8] powerpc: differentiate kthread from user kernel thread start

2023-03-25 Thread Nicholas Piggin
Kernel created user threads start similarly to kernel threads in that they call a kernel function after first returning from _switch, so they share ret_from_kernel_thread for this. Kernel threads never return from that function though, whereas user threads often do (although some don't, e.g., IO th

[PATCH v2 5/8] powerpc: copy_thread differentiate kthreads and user mode threads

2023-03-25 Thread Nicholas Piggin
When copy_thread is given a kernel function to run in arg->fn, this does not necessarily mean it is a kernel thread. User threads can be created this way (e.g., kernel_init, see also x86's copy_thread()). These threads run a kernel function which may call kernel_execve() and return, which returns l

[PATCH v2 4/8] powerpc/64: ret_from_fork avoid restoring regs twice

2023-03-25 Thread Nicholas Piggin
If the system call return path always restores NVGPRs then there is no need for ret_from_fork to do it. The HANDLER_RESTORE_NVGPRS does the right thing for this. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/interrupt_64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v2 3/8] powerpc: use switch frame for ret_from_kernel_thread parameters

2023-03-25 Thread Nicholas Piggin
The kernel thread path in copy_thread creates a user interrupt frame on stack and stores the function and arg parameters there, and ret_from_kernel_thread loads them. This is a slightly confusing way to overload that frame. Non-volatile registers are loaded from the switch frame, so the parameters

[PATCH v2 2/8] powerpc: copy_thread make ret_from_fork register setup consistent

2023-03-25 Thread Nicholas Piggin
The ret_from_fork code for 64e and 32-bit set r3 for syscall_exit_prepare the same way that 64s does, so there should be no need to special-case them in copy_thread. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/entry_32.S | 2 +- arch/powerpc/kernel/process.c | 3 --- 2 files changed,

[PATCH v2 0/8] powerpc: copy_thread cleanups

2023-03-25 Thread Nicholas Piggin
This series cleans up copy_thread and hopefully makes the code easier to understand. The big changes in patch 3 and 4 which use the switch stack instead of user int stack for restoring fn and args parameters for the new thread. I don't think there's any bugs fixed here because in the case of a ker

[PATCH v2 1/8] powerpc: copy_thread remove unused pkey code

2023-03-25 Thread Nicholas Piggin
The pkey registers (AMR, IAMR) do not get loaded from the switch frame so it is pointless to save anything there. Remove the dead code. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/process.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/powerpc/k

[PATCH] driver core: class: mark the struct class for sysfs callbacks as constant

2023-03-25 Thread Greg Kroah-Hartman
struct class should never be modified in a sysfs callback as there is nothing in the structure to modify, and frankly, the structure is almost never used in a sysfs callback, so mark it as constant to allow struct class to be moved to read-only memory. While we are touching all class sysfs callbac