Re: [PATCH v3 1/8] powerpc/uaccess: Add unsafe_copy_from_user

2021-01-19 Thread Christophe Leroy
Le 17/01/2021 à 18:19, Christopher M. Riedl a écrit : On Mon Jan 11, 2021 at 7:22 AM CST, Christophe Leroy wrote: Le 09/01/2021 à 04:25, Christopher M. Riedl a écrit : Implement raw_copy_from_user_allowed() which assumes that userspace read access is open. Use this new function to implemen

Re: [PATCH 6/6] powerpc/rtas: constrain user region allocation to RMA

2021-01-19 Thread Michael Ellerman
Nathan Lynch writes: > Memory locations passed as arguments from the OS to RTAS usually need > to be addressable in 32-bit mode and must reside in the Real Mode > Area. On PAPR guests, the RMA starts at logical address 0 and is the > first logical memory block reported in the LPAR’s device tree. >

[PATCH] powerpc/kvm: Force selection of CONFIG_PPC_FPU

2021-01-19 Thread Christophe Leroy
book3s/32 kvm is designed with the assumption that an FPU is always present. Force selection of FPU support in the kernel when build KVM. Reported-by: kernel test robot Fixes: 7d68c8916950 ("powerpc/32s: Allow deselecting CONFIG_PPC_FPU on mpc832x") Signed-off-by: Christophe Leroy --- arch/pow

[PATCH] powerpc/uprobes: Don't allow probe on suffix of prefixed instruction

2021-01-19 Thread Ravi Bangoria
Probe on 2nd word of a prefixed instruction is invalid scenario and should be restricted. There are two ways probed instruction is changed in mapped pages. First, when Uprobe is activated, it searches for all the relevant pages and replace instruction in them. In this case, if we notice that probe

[PATCH] powerpc/47x: Disable 256k page size

2021-01-19 Thread Christophe Leroy
PPC47x_TLBE_SIZE isn't defined for 256k pages, so this size of page shall not be selected for 47x. Reported-by: kernel test robot Fixes: e7f75ad01d59 ("powerpc/47x: Base ppc476 support") Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

Re: [PATCH v6 14/39] powerpc/perf: move perf irq/nmi handling details into traps.c

2021-01-19 Thread Athira Rajeev
> On 15-Jan-2021, at 10:19 PM, Nicholas Piggin wrote: > > This is required in order to allow more significant differences between > NMI type interrupt handlers and regular asynchronous handlers. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/kernel/traps.c | 31

Re: [PATCH v3 1/8] powerpc/uaccess: Add unsafe_copy_from_user

2021-01-19 Thread Christophe Leroy
Le 19/01/2021 à 03:11, Michael Ellerman a écrit : "Christopher M. Riedl" writes: On Mon Jan 11, 2021 at 7:22 AM CST, Christophe Leroy wrote: Le 09/01/2021 à 04:25, Christopher M. Riedl a écrit : Implement raw_copy_from_user_allowed() which assumes that userspace read access is open. Use th

Re: [PATCH v3 1/8] powerpc/uaccess: Add unsafe_copy_from_user

2021-01-19 Thread Christopher M. Riedl
On Tue Jan 19, 2021 at 6:33 AM CST, Christophe Leroy wrote: > > > Le 19/01/2021 à 03:11, Michael Ellerman a écrit : > > "Christopher M. Riedl" writes: > >> On Mon Jan 11, 2021 at 7:22 AM CST, Christophe Leroy wrote: > >>> Le 09/01/2021 à 04:25, Christopher M. Riedl a écrit : > Implement raw_c

Re: [PATCH] powerpc/uprobes: Don't allow probe on suffix of prefixed instruction

2021-01-19 Thread Oleg Nesterov
On 01/19, Ravi Bangoria wrote: > > Probe on 2nd word of a prefixed instruction is invalid scenario and > should be restricted. I don't understand this ppc-specific problem, but... > +#ifdef CONFIG_PPC64 > +int arch_uprobe_verify_opcode(struct page *page, unsigned long vaddr, > +

Re: [PATCH v3 1/8] powerpc/uaccess: Add unsafe_copy_from_user

2021-01-19 Thread Christophe Leroy
Le 19/01/2021 à 18:02, Christopher M. Riedl a écrit : On Tue Jan 19, 2021 at 6:33 AM CST, Christophe Leroy wrote: Le 19/01/2021 à 03:11, Michael Ellerman a écrit : "Christopher M. Riedl" writes: On Mon Jan 11, 2021 at 7:22 AM CST, Christophe Leroy wrote: Le 09/01/2021 à 04:25, Christoph

Re: [PATCH v6 04/49] soc: fsl: qe: introduce qe_io{read,write}* wrappers

2021-01-19 Thread Christophe Leroy
Hi Rasmus, Le 28/11/2019 à 15:55, Rasmus Villemoes a écrit : The QUICC engine drivers use the powerpc-specific out_be32() etc. In order to allow those drivers to build for other architectures, those must be replaced by iowrite32be(). However, on powerpc, out_be32() is a simple inline function wh

Re: [PATCH v6 04/49] soc: fsl: qe: introduce qe_io{read, write}* wrappers

2021-01-19 Thread Li Yang
On Tue, Jan 19, 2021 at 11:35 AM Christophe Leroy wrote: > > Hi Rasmus, > > Le 28/11/2019 à 15:55, Rasmus Villemoes a écrit : > > The QUICC engine drivers use the powerpc-specific out_be32() etc. In > > order to allow those drivers to build for other architectures, those > > must be replaced by io

Re: ibmvnic: Race condition in remove callback

2021-01-19 Thread Dany Madden
On 2021-01-17 02:12, Uwe Kleine-König wrote: Hello, while working on some cleanup I stumbled over a problem in the ibmvnic's remove callback. Since commit 7d7195a026ba ("ibmvnic: Do not process device remove during device reset") there is the following code in the remove callback:

Re: ibmvnic: Race condition in remove callback

2021-01-19 Thread Uwe Kleine-König
Hello Dany, On Tue, Jan 19, 2021 at 10:14:25AM -0800, Dany Madden wrote: > On 2021-01-17 02:12, Uwe Kleine-König wrote: > > while working on some cleanup I stumbled over a problem in the ibmvnic's > > remove callback. Since commit > > > > 7d7195a026ba ("ibmvnic: Do not process device remo

[PATCH net RFC] ibmvnic: device remove has higher precedence over reset

2021-01-19 Thread Lijun Pan
Returning -EBUSY in ibmvnic_remove() does not actually hold the removal procedure since driver core doesn't care for the return value (see __device_release_driver() in drivers/base/dd.c calling dev->bus->remove()) though vio_bus_remove (in arch/powerpc/platforms/pseries/vio.c) records the return va

Re: [PATCH net RFC] ibmvnic: device remove has higher precedence over reset

2021-01-19 Thread Uwe Kleine-König
On Tue, Jan 19, 2021 at 01:33:13PM -0600, Lijun Pan wrote: > Returning -EBUSY in ibmvnic_remove() does not actually hold the > removal procedure since driver core doesn't care for the return > value (see __device_release_driver() in drivers/base/dd.c > calling dev->bus->remove()) though vio_bus_rem

Re: [PATCH net RFC] ibmvnic: device remove has higher precedence over reset

2021-01-19 Thread Lijun Pan
On Tue, Jan 19, 2021 at 1:56 PM Uwe Kleine-König wrote: > > On Tue, Jan 19, 2021 at 01:33:13PM -0600, Lijun Pan wrote: > > Returning -EBUSY in ibmvnic_remove() does not actually hold the > > removal procedure since driver core doesn't care for the return > > value (see __device_release_driver() in

Re: [PATCH] selftests/powerpc: Only test lwm/stmw on big endian

2021-01-19 Thread Libor Pechacek
On Út 19-01-21 15:18:00, Michael Ellerman wrote: > Newer binutils (>= 2.36) refuse to assemble lmw/stmw when building in > little endian mode. That breaks compilation of our alignment handler > test: > > /tmp/cco4l14N.s: Assembler messages: > /tmp/cco4l14N.s:1440: Error: `lmw' invalid when lit

Re: [PATCH 6/6] powerpc/rtas: constrain user region allocation to RMA

2021-01-19 Thread Nathan Lynch
Michael Ellerman writes: > Nathan Lynch writes: >> Memory locations passed as arguments from the OS to RTAS usually need >> to be addressable in 32-bit mode and must reside in the Real Mode >> Area. On PAPR guests, the RMA starts at logical address 0 and is the >> first logical memory block repor

Re: [PATCH 1/4] KVM: PPC: Book3S HV: Remove support for running HPT guest on RPT host without mixed mode support

2021-01-19 Thread Fabiano Rosas
Nicholas Piggin writes: > Excerpts from Fabiano Rosas's message of January 19, 2021 11:46 am: >> Resending because the previous got spam-filtered: >> >> Nicholas Piggin writes: >> >>> This reverts much of commit c01015091a770 ("KVM: PPC: Book3S HV: Run HPT >>> guests on POWER9 radix hosts"), w

Re: [PATCH 1/4] KVM: PPC: Book3S HV: Remove support for running HPT guest on RPT host without mixed mode support

2021-01-19 Thread Nicholas Piggin
Excerpts from Fabiano Rosas's message of January 20, 2021 7:07 am: > Nicholas Piggin writes: > >> Excerpts from Fabiano Rosas's message of January 19, 2021 11:46 am: >>> Resending because the previous got spam-filtered: >>> >>> Nicholas Piggin writes: >>> This reverts much of commit c0101

Re: [PATCH 6/6] powerpc/rtas: constrain user region allocation to RMA

2021-01-19 Thread Nathan Lynch
Alexey Kardashevskiy writes: > On 16/01/2021 02:38, Nathan Lynch wrote: >> Alexey Kardashevskiy writes: >>> On 15/01/2021 09:00, Nathan Lynch wrote: Memory locations passed as arguments from the OS to RTAS usually need to be addressable in 32-bit mode and must reside in the Real Mode >>

Re: [PATCH] selftests/powerpc: Only test lwm/stmw on big endian

2021-01-19 Thread Segher Boessenkool
Hi! On Tue, Jan 19, 2021 at 03:18:00PM +1100, Michael Ellerman wrote: > Newer binutils (>= 2.36) refuse to assemble lmw/stmw when building in > little endian mode. That breaks compilation of our alignment handler > test: > > /tmp/cco4l14N.s: Assembler messages: > /tmp/cco4l14N.s:1440: Error:

Re: [PATCH 5/6] powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE

2021-01-19 Thread Nathan Lynch
Alexey Kardashevskiy writes: > On 16/01/2021 02:56, Nathan Lynch wrote: >> Alexey Kardashevskiy writes: >>> On 15/01/2021 09:00, Nathan Lynch wrote: diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index 332e1000ca0f..1aa7ab1cbc84 100644 --- a/ar

Re: [PATCH 1/2] dt-bindings: powerpc: Add a schema for the 'sleep' property

2021-01-19 Thread Rob Herring
On Sun, Jan 17, 2021 at 05:10:03PM +0100, Johan Jonker wrote: > Hi Rob, > > This patch generates notifications in the Rockchip ARM and arm64 tree. > Could you limit the scope to PowerPC only. > > Kind regards, > > Johan Jonker > > make ARCH=arm dtbs_check > DT_SCHEMA_FILES=Documentation/devicet

Re: [PATCH v6 14/39] powerpc/perf: move perf irq/nmi handling details into traps.c

2021-01-19 Thread Nicholas Piggin
Excerpts from Athira Rajeev's message of January 19, 2021 8:24 pm: > > >> On 15-Jan-2021, at 10:19 PM, Nicholas Piggin wrote: >> >> This is required in order to allow more significant differences between >> NMI type interrupt handlers and regular asynchronous handlers. >> >> Signed-off-by: Nic

Re: [PATCH v6 14/39] powerpc/perf: move perf irq/nmi handling details into traps.c

2021-01-19 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of January 20, 2021 1:09 pm: > Excerpts from Athira Rajeev's message of January 19, 2021 8:24 pm: >> >> [ 883.900762] watchdog: BUG: soft lockup - CPU#0 stuck for 23s! >> [swapper/0:0] >> [ 883.901381] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G OE

Re: [PATCH] selftests/powerpc: Only test lwm/stmw on big endian

2021-01-19 Thread Michael Ellerman
On Tue, 19 Jan 2021 15:18:00 +1100, Michael Ellerman wrote: > Newer binutils (>= 2.36) refuse to assemble lmw/stmw when building in > little endian mode. That breaks compilation of our alignment handler > test: > > /tmp/cco4l14N.s: Assembler messages: > /tmp/cco4l14N.s:1440: Error: `lmw' inval

Re: [PATCH] selftests/powerpc: Fix exit status of pkey tests

2021-01-19 Thread Michael Ellerman
On Mon, 18 Jan 2021 15:01:45 +0530, Sandipan Das wrote: > Since main() does not return a value explicitly, the > return values from FAIL_IF() conditions are ignored > and the tests can still pass irrespective of failures. > This makes sure that we always explicitly return the > correct test exit st

Re: [PATCH 6/6] powerpc/rtas: constrain user region allocation to RMA

2021-01-19 Thread Alexey Kardashevskiy
On 20/01/2021 11:39, Nathan Lynch wrote: Alexey Kardashevskiy writes: On 16/01/2021 02:38, Nathan Lynch wrote: Alexey Kardashevskiy writes: On 15/01/2021 09:00, Nathan Lynch wrote: Memory locations passed as arguments from the OS to RTAS usually need to be addressable in 32-bit mode and

Re: [PATCH 5/6] powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE

2021-01-19 Thread Alexey Kardashevskiy
On 20/01/2021 12:17, Nathan Lynch wrote: Alexey Kardashevskiy writes: On 16/01/2021 02:56, Nathan Lynch wrote: Alexey Kardashevskiy writes: On 15/01/2021 09:00, Nathan Lynch wrote: diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index 332e1000ca0f..1aa7ab1c

Re: [PATCH v3 1/8] powerpc/uaccess: Add unsafe_copy_from_user

2021-01-19 Thread Christopher M. Riedl
On Tue Jan 19, 2021 at 11:27 AM CST, Christophe Leroy wrote: > > > Le 19/01/2021 à 18:02, Christopher M. Riedl a écrit : > > On Tue Jan 19, 2021 at 6:33 AM CST, Christophe Leroy wrote: > >> > >> > >> Le 19/01/2021 à 03:11, Michael Ellerman a écrit : > >>> "Christopher M. Riedl" writes: > On M

Re: [PATCH] powerpc/47x: Disable 256k page size

2021-01-19 Thread Michael Ellerman
Christophe Leroy writes: > PPC47x_TLBE_SIZE isn't defined for 256k pages, so > this size of page shall not be selected for 47x. > > Reported-by: kernel test robot > Fixes: e7f75ad01d59 ("powerpc/47x: Base ppc476 support") > Signed-off-by: Christophe Leroy > --- > arch/powerpc/Kconfig | 2 +- >

Re: [PATCH] powerpc/47x: Disable 256k page size

2021-01-19 Thread Christophe Leroy
Le 20/01/2021 à 06:45, Michael Ellerman a écrit : Christophe Leroy writes: PPC47x_TLBE_SIZE isn't defined for 256k pages, so this size of page shall not be selected for 47x. Reported-by: kernel test robot Fixes: e7f75ad01d59 ("powerpc/47x: Base ppc476 support") Signed-off-by: Christophe Le

[PATCH 1/2] powerpc/32s: Add missing call to kuep_lock on syscall entry

2021-01-19 Thread Christophe Leroy
Userspace Execution protection and fast syscall entry were implemented independently from each other and were both merged in kernel 5.2, leading to syscall entry missing userspace execution protection. On syscall entry, execution of user space memory must be locked in the same way as on exception

[PATCH 2/2] powerpc/32s: Unroll kuep_lock and kuep_unlock macros

2021-01-19 Thread Christophe Leroy
Unroll the loops in kuep_lock and kuep_unlock. Benchmarked on an mpc 8321 with a standard kernel having a 3M/1M user/kernel memory split, i.e. 12 segments for user. Without KUEP, null_syscall benchmark is 220 cycles. With KUEP, null_syscall benchmark is 439 cycles. Once loops are unrolled, null_

[PATCH 1/2] powerpc/47x: Disable 256k page size

2021-01-19 Thread Christophe Leroy
PPC47x_TLBE_SIZE isn't defined for 256k pages, so this size of page shall not be selected for 47x. Reported-by: kernel test robot Fixes: e7f75ad01d59 ("powerpc/47x: Base ppc476 support") Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[PATCH 2/2] powerpc/44x: Remove STDBINUTILS kconfig option

2021-01-19 Thread Christophe Leroy
STDBINUTILS is just a toggle to allow 256k page size to appear in the possible page sizes list for the 44x. Make 256k page size appear all the time with an explicit warning on binutils, and remove this unneccessary STDBINUTILS config option. Signed-off-by: Christophe Leroy --- arch/powerpc/Kcon

[PATCH] powerpc/64: prevent replayed interrupt handlers from running softirqs

2021-01-19 Thread Nicholas Piggin
Running softirqs enables interrupts, which can then end up recursing into the irq soft-mask code we're adjusting, including replaying interrupts itself, which might be theoretically unbounded. This abridged trace shows how this can occur: ! NIP replay_soft_interrupts LR interrupt_exit_kernel_p