[for-stable-4.19 PATCH v2 1/2] vmlinux.lds.h: Create section for protection against instrumentation

2021-03-19 Thread Nicolas Boichat
From: Thomas Gleixner commit 655389433e7efec589838b400a2a652b3ffa upstream. Some code pathes, especially the low level entry code, must be protected against instrumentation for various reasons: - Low level entry code can be a fragile beast, especially on x86. - With NO_HZ_FULL RCU state

[for-stable-4.19 PATCH v2 0/2] Backport patches to fix KASAN+LKDTM with recent clang on ARM64

2021-03-19 Thread Nicolas Boichat
Backport 2 patches that are required to make KASAN+LKDTM work with recent clang (patch 2/2 has a complete description). Tested on our chromeos-4.19 branch. Also compile tested on x86-64 and arm64 with gcc this time around. Patch 1/2 adds a guard around noinstr that matches upstream, to prevent a

Re: [PATCH 10/10] ide: remove the legacy ide driver

2021-03-19 Thread Maciej W. Rozycki
On Sat, 20 Mar 2021, Maciej W. Rozycki wrote: > > been scheduled for removal for a while. Finally kill it off so that we > > can start cleaning up various bits of cruft it forced on the block layer. > > You need to adjust Documentation/admin-guide/kernel-parameters.txt too, > i.e. remove all

Re: [PATCH 10/10] ide: remove the legacy ide driver

2021-03-19 Thread Maciej W. Rozycki
On Thu, 18 Mar 2021, Christoph Hellwig wrote: > The legay ide driver has been replace with libata startin in 2003 and has s/legay/legacy/;s/replace/replaced/;s/startin/startin/ (though I'd say "back in" instead in the latter case). > been scheduled for removal for a while. Finally kill it

Re: [PATCH v11 1/6] kasan: allow an architecture to disable inline instrumentation

2021-03-19 Thread Balbir Singh
On Sat, Mar 20, 2021 at 01:40:53AM +1100, Daniel Axtens wrote: > For annoying architectural reasons, it's very difficult to support inline > instrumentation on powerpc64. I think we can expand here and talk about how in hash mode, the vmalloc address space is in a region of memory different than

Re: [PATCH v11 0/6] KASAN for powerpc64 radix

2021-03-19 Thread Balbir Singh
On Sat, Mar 20, 2021 at 01:40:52AM +1100, Daniel Axtens wrote: > Building on the work of Christophe, Aneesh and Balbir, I've ported > KASAN to 64-bit Book3S kernels running on the Radix MMU. > > v11 applies to next-20210317. I had hoped to have it apply to > powerpc/next but once again there are

Re: [for-stable-4.19 PATCH 1/2] vmlinux.lds.h: Create section for protection against instrumentation

2021-03-19 Thread Nicolas Boichat
On Fri, Mar 19, 2021 at 7:55 PM Greg Kroah-Hartman wrote: > > On Fri, Mar 19, 2021 at 12:20:22PM +0100, Alexandre Chartre wrote: > > > > On 3/19/21 11:39 AM, Greg Kroah-Hartman wrote: > > > On Fri, Mar 19, 2021 at 07:54:15AM +0800, Nicolas Boichat wrote: > > > > From: Thomas Gleixner > > > > > >

Re: [PATCH 2/2] ibmvfc: make ibmvfc_wait_for_ops MQ aware

2021-03-19 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center

Re: [PATCH 1/2] ibmvfc: fix potential race in ibmvfc_wait_for_ops

2021-03-19 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center

[PATCH 1/2] ibmvfc: fix potential race in ibmvfc_wait_for_ops

2021-03-19 Thread Tyrel Datwyler
For various EH activities the ibmvfc driver uses ibmvfc_wait_for_ops() to wait for the completion of commands that match a given criteria be it cancel key, or specific LUN. With recent changes commands are completed outside the lock in bulk by removing them from the sent list and adding them to a

[PATCH 2/2] ibmvfc: make ibmvfc_wait_for_ops MQ aware

2021-03-19 Thread Tyrel Datwyler
During MQ enablement of the ibmvfc driver ibmvfc_wait_for_ops() was missed. This function is responsible for waiting on commands to complete that match a certain criteria such as LUN or cancel key. The implementation as is only scans the CRQ for events ignoring any sub-queues and as a result will

[PATCH 0/2] Fix EH race and MQ support

2021-03-19 Thread Tyrel Datwyler
Changes to the locking pattern protecting the event lists and handling of scsi command completion introduced a race where an ouststanding command that EH is waiting ifor to complete is no longer identifiable by being on the sent list, but instead as a command that is not on the free list. This is

Re: [PATCH 0/6] mm: some config cleanups

2021-03-19 Thread Catalin Marinas
On Tue, Mar 09, 2021 at 02:03:04PM +0530, Anshuman Khandual wrote: > This series contains config cleanup patches which reduces code duplication > across platforms and also improves maintainability. There is no functional > change intended with this series. This has been boot tested on arm64 but >

Re: [PATCH 02/10] ARM: disable CONFIG_IDE in footbridge_defconfig

2021-03-19 Thread Russell King - ARM Linux admin
On Fri, Mar 19, 2021 at 05:07:53PM +, Russell King - ARM Linux admin wrote: > On Thu, Mar 18, 2021 at 05:56:58AM +0100, Christoph Hellwig wrote: > > footbridge_defconfig enables CONFIG_IDE but no actual host controller > > driver, so just drop it. > > I have been using the Cypress 82C693 IDE

Re: [PATCH 02/10] ARM: disable CONFIG_IDE in footbridge_defconfig

2021-03-19 Thread Russell King - ARM Linux admin
On Thu, Mar 18, 2021 at 05:56:58AM +0100, Christoph Hellwig wrote: > footbridge_defconfig enables CONFIG_IDE but no actual host controller > driver, so just drop it. I have been using the Cypress 82C693 IDE driver on Footbridge for a CD ROM drive, and I know it doesn't work with the PATA driver -

Re: Clang: powerpc: kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2480 bytes in function 'kvmhv_enter_nested_guest'

2021-03-19 Thread Nathan Chancellor
Hi Naresh, Thank you for the testing and report. On Fri, Mar 19, 2021 at 12:50:42PM +0530, Naresh Kamboju wrote: > Linux mainline master build breaks for powerpc defconfig. > There are multiple errors / warnings with clang-12 and clang-11 and 10. > - powerpc (defconfig) with clang-12 > -

Re: remove the legacy ide driver

2021-03-19 Thread Maciej W. Rozycki
On Thu, 18 Mar 2021, Christoph Hellwig wrote: > we've been trying to get rid of the legacy ide driver for a while now, > and finally scheduled a removal for 2021, which is three month old now. Hmm, there's still a regression in that pata_legacy unconditionally pokes at random I/O port

Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-19 Thread Serge Belyshev
Al Viro writes: > ... > > Do you have reports of libata variants of drivers actually tested on > those? PATA_CMD64X works fine on my 164LX for many years, last tested with 5.12-rc3. (with a caveat: in my setup with CF card DMA is broken, but it is broken with BLK_DEV_CMD64X as well).

Re: [PATCH RFC 2/3] mm: remove xlate_dev_kmem_ptr()

2021-03-19 Thread Geert Uytterhoeven
On Fri, Mar 19, 2021 at 3:36 PM David Hildenbrand wrote: > Since /dev/kmem has been removed, let's remove the xlate_dev_kmem_ptr() > leftovers. > Signed-off-by: David Hildenbrand > arch/m68k/include/asm/io_mm.h | 5 - Acked-by: Geert Uytterhoeven Gr{oetje,eeting}s,

[PATCH v11 6/6] powerpc: Book3S 64-bit outline-only KASAN support

2021-03-19 Thread Daniel Axtens
Implement a limited form of KASAN for Book3S 64-bit machines running under the Radix MMU, supporting only outline mode. - Enable the compiler instrumentation to check addresses and maintain the shadow region. (This is the guts of KASAN which we can easily reuse.) - Require kasan-vmalloc

[PATCH v11 5/6] powerpc/mm/kasan: rename kasan_init_32.c to init_32.c

2021-03-19 Thread Daniel Axtens
kasan is already implied by the directory name, we don't need to repeat it. Suggested-by: Christophe Leroy Signed-off-by: Daniel Axtens --- arch/powerpc/mm/kasan/Makefile | 2 +- arch/powerpc/mm/kasan/{kasan_init_32.c => init_32.c} | 0 2 files changed, 1 insertion(+), 1

[PATCH v11 4/6] kasan: Document support on 32-bit powerpc

2021-03-19 Thread Daniel Axtens
KASAN is supported on 32-bit powerpc and the docs should reflect this. Suggested-by: Christophe Leroy Reviewed-by: Christophe Leroy Signed-off-by: Daniel Axtens --- Documentation/dev-tools/kasan.rst | 8 ++-- Documentation/powerpc/kasan.txt | 12 2 files changed, 18

[PATCH v11 3/6] kasan: define and use MAX_PTRS_PER_* for early shadow tables

2021-03-19 Thread Daniel Axtens
powerpc has a variable number of PTRS_PER_*, set at runtime based on the MMU that the kernel is booted under. This means the PTRS_PER_* are no longer constants, and therefore breaks the build. Define default MAX_PTRS_PER_*s in the same style as MAX_PTRS_PER_P4D. As KASAN is the only user at the

[PATCH v11 2/6] kasan: allow architectures to provide an outline readiness check

2021-03-19 Thread Daniel Axtens
Allow architectures to define a kasan_arch_is_ready() hook that bails out of any function that's about to touch the shadow unless the arch says that it is ready for the memory to be accessed. This is fairly uninvasive and should have a negligible performance penalty. This will only work in

[PATCH v11 1/6] kasan: allow an architecture to disable inline instrumentation

2021-03-19 Thread Daniel Axtens
For annoying architectural reasons, it's very difficult to support inline instrumentation on powerpc64. Add a Kconfig flag to allow an arch to disable inline. (It's a bit annoying to be 'backwards', but I'm not aware of any way to have an arch force a symbol to be 'n', rather than 'y'.) We also

[PATCH v11 0/6] KASAN for powerpc64 radix

2021-03-19 Thread Daniel Axtens
Building on the work of Christophe, Aneesh and Balbir, I've ported KASAN to 64-bit Book3S kernels running on the Radix MMU. v11 applies to next-20210317. I had hoped to have it apply to powerpc/next but once again there are changes in the kasan core that clash. Also, thanks to mpe for fixing a

[PATCH RFC 2/3] mm: remove xlate_dev_kmem_ptr()

2021-03-19 Thread David Hildenbrand
Since /dev/kmem has been removed, let's remove the xlate_dev_kmem_ptr() leftovers. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Russell King Cc: Brian Cain Cc: Geert Uytterhoeven Cc: Thomas Bogendoerfer Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Michael Ellerman

Re: [PATCH 08/10] MIPS: disable CONFIG_IDE in malta*_defconfig

2021-03-19 Thread Christoph Hellwig
On Thu, Mar 18, 2021 at 03:19:00PM +0100, Thomas Bogendoerfer wrote: > On Thu, Mar 18, 2021 at 05:57:04AM +0100, Christoph Hellwig wrote: > > arch/mips/configs/malta_kvm_guest_defconfig | 3 --- > > that file is gone in mips-next. > > I could take all MIPS patches into mips-next, if you want...

Re: [PATCH V2] mm/memtest: Add ARCH_USE_MEMTEST

2021-03-19 Thread Catalin Marinas
On Mon, Mar 01, 2021 at 10:02:06AM +0530, Anshuman Khandual wrote: > early_memtest() does not get called from all architectures. Hence enabling > CONFIG_MEMTEST and providing a valid memtest=[1..N] kernel command line > option might not trigger the memory pattern tests as would be expected in >

Re: [PATCH 5/6] powerpc/mm/64s/hash: Add real-mode change_memory_range() for hash LPAR

2021-03-19 Thread Michael Ellerman
Daniel Axtens writes: > Michael Ellerman writes: > >> When we enabled STRICT_KERNEL_RWX we received some reports of boot >> failures when using the Hash MMU and running under phyp. The crashes >> are intermittent, and often exhibit as a completely unresponsive >> system, or possibly an oops. >>

Re: [for-stable-4.19 PATCH 1/2] vmlinux.lds.h: Create section for protection against instrumentation

2021-03-19 Thread Greg Kroah-Hartman
On Fri, Mar 19, 2021 at 12:20:22PM +0100, Alexandre Chartre wrote: > > On 3/19/21 11:39 AM, Greg Kroah-Hartman wrote: > > On Fri, Mar 19, 2021 at 07:54:15AM +0800, Nicolas Boichat wrote: > > > From: Thomas Gleixner > > > > > > commit 655389433e7efec589838b400a2a652b3ffa upstream. > > > > >

Re: [PATCH v3 28/32] powerpc/64s: interrupt implement exit logic in C

2021-03-19 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from Christophe Leroy's message of March 15, 2021 11:41 pm: >> >> Le 25/02/2020 à 18:35, Nicholas Piggin a écrit : >>> Implement the bulk of interrupt return logic in C. The asm return code >>> must handle a few cases: restoring full GPRs, and emulating stack

Re: [PATCH 12/14] powerpc/64s: system call avoid setting MSR[RI] until we set MSR[EE]

2021-03-19 Thread Michael Ellerman
Christophe Leroy writes: > Le 15/03/2021 à 23:04, Nicholas Piggin a écrit : >> This extends the MSR[RI]=0 window a little further into the system >> call in order to pair RI and EE enabling with a single mtmsrd. > > Time ago, I proposed to delay that on PPC32 and Michael objected, see >

Re: [PATCH 1/1] hotplug-cpu.c: show 'last online CPU' error in dlpar_cpu_remove()

2021-03-19 Thread Michael Ellerman
Daniel Henrique Barboza writes: > Ping > > On 3/5/21 2:38 PM, Daniel Henrique Barboza wrote: >> Of all the reasons that dlpar_cpu_remove() can fail, the 'last online >> CPU' is one that can be caused directly by the user offlining CPUs >> in a partition/virtual machine that has hotplugged CPUs.

[PATCH 09/10] powerpc/signal32: Convert do_setcontext[_tm]() to user access block

2021-03-19 Thread Christophe Leroy
Add unsafe_get_user_sigset() and transform PPC32 get_sigset_t() into an unsafe version unsafe_get_sigset_t(). Then convert do_setcontext() and do_setcontext_tm() to use user_read_access_begin/end. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal.h| 2 ++

[PATCH 10/10] powerpc/signal32: Simplify logging in sigreturn()

2021-03-19 Thread Christophe Leroy
Same spirit as commit debf122c777f ("powerpc/signal32: Simplify logging in handle_rt_signal32()"), remove this intermediate 'addr' local var. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git

[PATCH 08/10] powerpc/signal32: Convert restore_[tm]_user_regs() to user access block

2021-03-19 Thread Christophe Leroy
Convert restore_user_regs() and restore_tm_user_regs() to use user_access_read_begin/end blocks. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 2 +- arch/powerpc/kernel/signal_32.c | 141 +++--- 2 files changed, 72 insertions(+), 71

[PATCH 07/10] powerpc/signal32: Reorder user reads in restore_tm_user_regs()

2021-03-19 Thread Christophe Leroy
In restore_tm_user_regs(), regroup the reads from 'sr' and the ones from 'tm_sr' together in order to allow two block user accesses in following patch. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 49 + 1 file changed, 37 insertions(+),

[PATCH 05/10] powerpc/signal32: Remove ifdefery in middle of if/else in sigreturn()

2021-03-19 Thread Christophe Leroy
In the same spirit as commit f1cf4f93de2f ("powerpc/signal32: Remove ifdefery in middle of if/else") MSR_TM_ACTIVE() is always defined and returns always 0 when CONFIG_PPC_TRANSACTIONAL_MEM is not selected, so the awful ifdefery in the middle of an if/else can be removed. Make 'msr_hi' a 'long

[PATCH 06/10] powerpc/signal32: Perform access_ok() inside restore_user_regs()

2021-03-19 Thread Christophe Leroy
In preparation of using user_access_begin/end in restore_user_regs(), move the access_ok() inside the function. It makes no difference as the behaviour on a failed access_ok() is the same as on failed restore_user_regs(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 8

[PATCH 04/10] powerpc/signal32: Rename save_user_regs_unsafe() and save_general_regs_unsafe()

2021-03-19 Thread Christophe Leroy
Convention is to prefix functions with __unsafe_ instead of suffixing it with _unsafe. Rename save_user_regs_unsafe() and save_general_regs_unsafe() accordingly, that is respectively __unsafe_save_general_regs() and __unsafe_save_user_regs(). Suggested-by: Christopher M. Riedl Signed-off-by:

[PATCH 01/10] signal: Add unsafe_get_compat_sigset()

2021-03-19 Thread Christophe Leroy
In the same way as commit 14026b94ccfe ("signal: Add unsafe_put_compat_sigset()"), this time add unsafe_get_compat_sigset() macro which is the 'unsafe' version of get_compat_sigset() For the bigendian, use unsafe_get_user() directly to avoid intermediate copy through the stack. For the

[PATCH 03/10] powerpc/signal: Add unsafe_copy_ck{fpr/vsx}_from_user

2021-03-19 Thread Christophe Leroy
Add unsafe_copy_ckfpr_from_user() and unsafe_copy_ckvsx_from_user() Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal.h | 20 1 file changed, 20 insertions(+) diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h index

[PATCH 02/10] powerpc/uaccess: Also perform 64 bits copies in unsafe_copy_from_user() on ppc32

2021-03-19 Thread Christophe Leroy
Similarly to commit 5cf773fc8f37 ("powerpc/uaccess: Also perform 64 bits copies in unsafe_copy_to_user() on ppc32") ppc32 has an efficiant 64 bits unsafe_get_user(), so also use it in order to unroll loops more. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/uaccess.h | 6 +++---

[PATCH 00/10] Convert signal32 to user read access by block

2021-03-19 Thread Christophe Leroy
Similarly to the work done earlier with writes, this series converts signal32 to using user_read_access_begin/end and unsafe_get_user() and friends. Applies on to of the signal64 series, ie on merge-test (ca6e327fefb2) Christophe Leroy (10): signal: Add unsafe_get_compat_sigset()

Re: [RFC PATCH 7/8] powerpc/purgatory: drop .machine specifier

2021-03-19 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from Segher Boessenkool's message of February 26, 2021 1:58 am: >> On Thu, Feb 25, 2021 at 02:10:05PM +1100, Daniel Axtens wrote: >>> It's ignored by future versions of llvm's integrated assembler (by not -11). >>> I'm not sure what it does for us in gas. >> >>

Re: [RFC PATCH 2/8] powerpc: check for support for -Wa, -m{power4, any}

2021-03-19 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from Daniel Axtens's message of February 25, 2021 1:10 pm: >> LLVM's integrated assembler does not like either -Wa,-mpower4 >> or -Wa,-many. So just don't pass them if they're not supported. >> >> Signed-off-by: Daniel Axtens >> --- >> arch/powerpc/Makefile |

Re: [for-stable-4.19 PATCH 1/2] vmlinux.lds.h: Create section for protection against instrumentation

2021-03-19 Thread Greg Kroah-Hartman
On Fri, Mar 19, 2021 at 07:54:15AM +0800, Nicolas Boichat wrote: > From: Thomas Gleixner > > commit 655389433e7efec589838b400a2a652b3ffa upstream. > > Some code pathes, especially the low level entry code, must be protected > against instrumentation for various reasons: > > - Low level

Re: [for-stable-4.19 PATCH 0/2] Backport patches to fix KASAN+LKDTM with recent clang on ARM64

2021-03-19 Thread Greg Kroah-Hartman
On Fri, Mar 19, 2021 at 07:54:14AM +0800, Nicolas Boichat wrote: > > Backport 2 patches that are required to make KASAN+LKDTM work > with recent clang (patch 2/2 has a complete description). > Tested on our chromeos-4.19 branch. > > Patch 1/2 is context conflict only, and 2/2 is a clean

Clang: powerpc: kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2480 bytes in function 'kvmhv_enter_nested_guest'

2021-03-19 Thread Naresh Kamboju
Linux mainline master build breaks for powerpc defconfig. There are multiple errors / warnings with clang-12 and clang-11 and 10. - powerpc (defconfig) with clang-12 - powerpc (defconfig) with clang-11 - powerpc (defconfig) with clang-10 The following build errors / warnings triggered with

[PATCH v6] powerpc/irq: inline call_do_irq() and call_do_softirq() on PPC32

2021-03-19 Thread Christophe Leroy
call_do_irq() and call_do_softirq() are simple enough to be worth inlining. Inlining them avoids an mflr/mtlr pair plus a save/reload on stack. It also allows GCC to keep the saved ksp_limit in an nonvolatile reg. This is inspired from S390 arch. Several other arches do more or less the same.

Re: [PATCH] powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S

2021-03-19 Thread Michael Ellerman
Segher Boessenkool writes: > Hi! > > On Mon, Mar 15, 2021 at 02:41:59PM +1100, Michael Ellerman wrote: >> The ".machine" directive allows changing the machine for which code is >> being generated. It's equivalent to passing an -mcpu option on the >> command line. >> >> Although it can be useful,