Re: [PATCH v2] powerpc/tm: Save and restore AMR on treclaim and trechkpt

2020-09-19 Thread Aneesh Kumar K.V
Gustavo Romero writes: > Althought AMR is stashed in the checkpoint area, currently we don't save > it to the per thread checkpoint struct after a treclaim and so we don't > restore it either from that struct when we trechkpt. As a consequence when > the transaction is later rolled back the

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Al Viro
On Sat, Sep 19, 2020 at 05:14:41PM -0700, Andy Lutomirski wrote: > > 2) have you counted the syscalls that do and do not need that? > > No. Might be illuminating... > > 3) how many of those realistically *can* be unified with their > > compat counterparts? [hint: ioctl(2) cannot] > > There

[PATCH v1 2/2] usb: dwc2: add support for APM82181 USB OTG

2020-09-19 Thread Christian Lamparter
adds the specific compatible string for the DWC2 IP found in the APM82181 SoCs. The IP is setup correctly through the auto detection... With the exception of the AHB Burst Size. The default of GAHBCFG_HBSTLEN_INCR4 of the "snps,dwc2" can cause a system hang when the USB and SATA is used

[PATCH v1 1/2] dt-bindings: usb: dwc2: add support for APM82181 SoCs USB OTG HS and FS

2020-09-19 Thread Christian Lamparter
adds the specific compatible string for the DWC2 IP found in the APM82181 SoCs. The APM82181's USB-OTG seems like it was taken from its direct predecessor: the PPC460EX (canyonlands). Signed-off-by: Christian Lamparter --- Documentation/devicetree/bindings/usb/dwc2.yaml | 1 + 1 file changed, 1

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Andy Lutomirski
On Sat, Sep 19, 2020 at 4:24 PM Al Viro wrote: > > On Sat, Sep 19, 2020 at 03:53:40PM -0700, Andy Lutomirski wrote: > > > > It would not be a win - most of the syscalls don't give a damn > > > about 32bit vs. 64bit... > > > > Any reasonable implementation would optimize it out for syscalls that

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Al Viro
On Sat, Sep 19, 2020 at 03:53:40PM -0700, Andy Lutomirski wrote: > > It would not be a win - most of the syscalls don't give a damn > > about 32bit vs. 64bit... > > Any reasonable implementation would optimize it out for syscalls that don’t > care. Or it could be explicit: > >

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Andy Lutomirski
> On Sep 19, 2020, at 3:41 PM, Al Viro wrote: > > On Sat, Sep 19, 2020 at 03:23:54PM -0700, Andy Lutomirski wrote: >> On Sep 19, 2020, at 3:09 PM, Al Viro wrote: >>> >>> On Fri, Sep 18, 2020 at 05:16:15PM +0200, Christoph Hellwig wrote: > On Fri, Sep 18, 2020 at 02:58:22PM

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Al Viro
On Sat, Sep 19, 2020 at 03:23:54PM -0700, Andy Lutomirski wrote: > > > On Sep 19, 2020, at 3:09 PM, Al Viro wrote: > > > > On Fri, Sep 18, 2020 at 05:16:15PM +0200, Christoph Hellwig wrote: > >>> On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: > >>> Said that, why not provide a

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Andy Lutomirski
> On Sep 19, 2020, at 3:09 PM, Al Viro wrote: > > On Fri, Sep 18, 2020 at 05:16:15PM +0200, Christoph Hellwig wrote: >>> On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: >>> Said that, why not provide a variant that would take an explicit >>> "is it compat" argument and use it there?

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Andy Lutomirski
> On Sep 19, 2020, at 2:16 PM, Arnd Bergmann wrote: > > On Sat, Sep 19, 2020 at 6:21 PM Andy Lutomirski wrote: >>> On Fri, Sep 18, 2020 at 8:16 AM Christoph Hellwig wrote: >>> On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: Said that, why not provide a variant that would take

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Al Viro
On Fri, Sep 18, 2020 at 05:16:15PM +0200, Christoph Hellwig wrote: > On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: > > Said that, why not provide a variant that would take an explicit > > "is it compat" argument and use it there? And have the normal > > one pass in_compat_syscall() to

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Finn Thain
On Sat, 19 Sep 2020, Arnd Bergmann wrote: > On Sat, Sep 19, 2020 at 6:21 PM Andy Lutomirski wrote: > > On Fri, Sep 18, 2020 at 8:16 AM Christoph Hellwig wrote: > > > On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: > > > > Said that, why not provide a variant that would take an explicit

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Arnd Bergmann
On Sat, Sep 19, 2020 at 6:21 PM Andy Lutomirski wrote: > On Fri, Sep 18, 2020 at 8:16 AM Christoph Hellwig wrote: > > On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: > > > Said that, why not provide a variant that would take an explicit > > > "is it compat" argument and use it there?

Re: [PATCH v3 2/5] powerpc: apm82181: create shared dtsi for APM bluestone

2020-09-19 Thread Christian Lamparter
On 2020-09-15 03:05, Rob Herring wrote: On Sun, Sep 06, 2020 at 12:06:12AM +0200, Christian Lamparter wrote: This patch adds an DTSI-File that can be used by various device-tree files for APM82181-based devices. Some of the nodes (like UART, PCIE, SATA) are used by the uboot and need to stick

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Linus Torvalds
On Sat, Sep 19, 2020 at 10:39 AM Matthew Wilcox wrote: > > My concern with that is people might use kmap() and then pass the address > to a different task. So we need to audit the current users of kmap() > and convert any that do that into using vmap() instead. Ahh. Yes, I guess they might do

Re: [PATCH AUTOSEL 5.4 101/330] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-09-19 Thread Sasha Levin
On Fri, Sep 18, 2020 at 08:35:06AM +0200, Frederic Barrat wrote: Le 18/09/2020 à 03:57, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] This patch is not desirable for stable, for 5.4 and 4.19 (it was already flagged by autosel

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Matthew Wilcox
On Sat, Sep 19, 2020 at 10:18:54AM -0700, Linus Torvalds wrote: > On Sat, Sep 19, 2020 at 2:50 AM Thomas Gleixner wrote: > > > > this provides a preemptible variant of kmap_atomic & related > > interfaces. This is achieved by: > > Ack. This looks really nice, even apart from the new capability.

[PATCH] PCI: Convert enum pci_bus_flags to bit fields in struct pci_bus

2020-09-19 Thread Krzysztof Wilczyński
All the flags defined in the enum pci_bus_flags are used to determine whether a particular feature of a PCI bus is available or not - features are also often disabled via architecture or device-specific quirk. These flags are tightly coupled with a PCI buses and PCI bridges and primarily used in

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Linus Torvalds
On Sat, Sep 19, 2020 at 2:50 AM Thomas Gleixner wrote: > > this provides a preemptible variant of kmap_atomic & related > interfaces. This is achieved by: Ack. This looks really nice, even apart from the new capability. The only thing I really reacted to is that the name doesn't make sense to

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread Andy Lutomirski
On Fri, Sep 18, 2020 at 8:16 AM Christoph Hellwig wrote: > > On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: > > Said that, why not provide a variant that would take an explicit > > "is it compat" argument and use it there? And have the normal > > one pass in_compat_syscall() to that...

[PATCH v2] powerpc/tm: Save and restore AMR on treclaim and trechkpt

2020-09-19 Thread Gustavo Romero
Althought AMR is stashed in the checkpoint area, currently we don't save it to the per thread checkpoint struct after a treclaim and so we don't restore it either from that struct when we trechkpt. As a consequence when the transaction is later rolled back the kernel space AMR value when the

RE: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-19 Thread David Laight
From: Al Viro > Sent: 18 September 2020 14:58 > > On Fri, Sep 18, 2020 at 03:44:06PM +0200, Christoph Hellwig wrote: > > On Fri, Sep 18, 2020 at 02:40:12PM +0100, Al Viro wrote: > > > > /* Vector 0x110 is LINUX_32BIT_SYSCALL_TRAP */ > > > > - return

RE: let import_iovec deal with compat_iovecs as well

2020-09-19 Thread David Laight
From: Christoph Hellwig > Sent: 18 September 2020 13:45 > > this series changes import_iovec to transparently deal with comat iovec > structures, and then cleanups up a lot of code dupliation. But to get > there it first has to fix the pre-existing bug that io_uring compat > contexts don't

RE: [PATCH] powerpc: Select HAVE_FUTEX_CMPXCHG

2020-09-19 Thread David Laight
From: Samuel Holland > Sent: 19 September 2020 04:20 > > On powerpc, access_ok() succeeds for the NULL pointer. This breaks the > dynamic check in futex_detect_cmpxchg(), which expects -EFAULT. As a > result, robust futex operations are not functional on powerpc. access_ok(NULL, sane_count) will

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Daniel Vetter
On Sat, Sep 19, 2020 at 12:35 PM Daniel Vetter wrote: > > On Sat, Sep 19, 2020 at 11:50 AM Thomas Gleixner wrote: > > > > First of all, sorry for the horribly big Cc list! > > > > Following up to the discussion in: > > > > https://lore.kernel.org/r/20200914204209.256266...@linutronix.de > > >

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Daniel Vetter
On Sat, Sep 19, 2020 at 11:50 AM Thomas Gleixner wrote: > > First of all, sorry for the horribly big Cc list! > > Following up to the discussion in: > > https://lore.kernel.org/r/20200914204209.256266...@linutronix.de > > this provides a preemptible variant of kmap_atomic & related >

Re: [PATCH v2] kbuild: preprocess module linker script

2020-09-19 Thread Jessica Yu
+++ Masahiro Yamada [08/09/20 13:27 +0900]: There was a request to preprocess the module linker script like we do for the vmlinux one. (https://lkml.org/lkml/2020/8/21/512) The difference between vmlinux.lds and module.lds is that the latter is needed for external module builds, thus must be

[patch RFC 15/15] mm/highmem: Provide kmap_temporary*

2020-09-19 Thread Thomas Gleixner
Now that the kmap atomic index is stored in task struct provide a preemptible variant. On context switch the maps of an outgoing task are removed and the map of the incoming task are restored. That's obviously slow, but highmem is slow anyway. The kmap_temporary and iomap_temporary interfaces can

[patch RFC 14/15] sched: highmem: Store temporary kmaps in task struct

2020-09-19 Thread Thomas Gleixner
Instead of storing the map per CPU provide and use per task storage. That prepares for temporary kmaps which are preemptible. The context switch code is preparatory and not yet in use because kmap_atomic() runs with preemption disabled. Will be made usable in the next step. Signed-off-by: Thomas

[patch RFC 13/15] mm/highmem: Remove the old kmap_atomic cruft

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner --- include/linux/highmem.h | 65 ++-- mm/highmem.c| 28 +--- 2 files changed, 28 insertions(+), 65 deletions(-) --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -94,27 +94,6

[patch RFC 11/15] sparc/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org --- Note: Completely untested --- arch/sparc/Kconfig |1 arch/sparc/include/asm/highmem.h |7 +- arch/sparc/mm/Makefile |3 - arch/sparc/mm/highmem.c | 115

[patch RFC 10/15] powerpc/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- Note: Completely untested --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/highmem.h |6 ++- arch/powerpc/mm/Makefile |

[patch RFC 09/15] nds32/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
The mapping code is odd and looks broken. See FIXME in the comment. Signed-off-by: Thomas Gleixner Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen --- Note: Completely untested --- arch/nds32/Kconfig.cpu |1 arch/nds32/include/asm/highmem.h | 21 +

[patch RFC 12/15] xtensa/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Chris Zankel Cc: Max Filippov Cc: linux-xte...@linux-xtensa.org --- Note: Completely untested --- arch/xtensa/Kconfig |1 arch/xtensa/include/asm/highmem.h |9 +++ arch/xtensa/mm/highmem.c | 44

[patch RFC 07/15] microblaze/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Michal Simek --- Note: Completely untested --- arch/microblaze/Kconfig |1 arch/microblaze/include/asm/highmem.h |6 ++ arch/microblaze/mm/Makefile |1 arch/microblaze/mm/highmem.c | 78

[patch RFC 05/15] ARM: highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Russell King Cc: Arnd Bergmann Cc: linux-arm-ker...@lists.infradead.org --- Note: Completely untested --- arch/arm/Kconfig |1 arch/arm/include/asm/highmem.h | 30 +++--- arch/arm/mm/Makefile |1 arch/arm/mm/highmem.c

[patch RFC 08/15] mips/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Thomas Bogendoerfer Cc: linux-m...@vger.kernel.org --- Note: Completely untested --- arch/mips/Kconfig |1 arch/mips/include/asm/highmem.h |4 +- arch/mips/mm/highmem.c | 77

[patch RFC 06/15] csky/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Guo Ren Cc: linux-c...@vger.kernel.org --- Note: Completely untested --- arch/csky/Kconfig |1 arch/csky/include/asm/highmem.h |4 +- arch/csky/mm/highmem.c | 75 3 files changed, 5

[patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Thomas Gleixner
First of all, sorry for the horribly big Cc list! Following up to the discussion in: https://lore.kernel.org/r/20200914204209.256266...@linutronix.de this provides a preemptible variant of kmap_atomic & related interfaces. This is achieved by: - Consolidating all kmap atomic implementations

[patch RFC 03/15] x86/mm/highmem: Use generic kmap atomic implementation

2020-09-19 Thread Thomas Gleixner
Convert X86 to the generic kmap atomic implementation. Make the iomap_atomic() naming convention consistent while at it. Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig |3 +- arch/x86/include/asm/fixmap.h |1 arch/x86/include/asm/highmem.h | 12 ++--

[patch RFC 01/15] mm/highmem: Un-EXPORT __kmap_atomic_idx()

2020-09-19 Thread Thomas Gleixner
Nothing in modules can use that. Signed-off-by: Thomas Gleixner --- mm/highmem.c |2 -- 1 file changed, 2 deletions(-) --- a/mm/highmem.c +++ b/mm/highmem.c @@ -108,8 +108,6 @@ static inline wait_queue_head_t *get_pkm atomic_long_t _totalhigh_pages __read_mostly;

[patch RFC 04/15] arc/mm/highmem: Use generic kmap atomic implementation

2020-09-19 Thread Thomas Gleixner
Adopt the map ordering to match the other architectures and the generic code. Signed-off-by: Thomas Gleixner Cc: Vineet Gupta Cc: linux-snps-...@lists.infradead.org --- Note: Completely untested --- arch/arc/Kconfig |1 arch/arc/include/asm/highmem.h |8 ++-

[patch RFC 02/15] highmem: Provide generic variant of kmap_atomic*

2020-09-19 Thread Thomas Gleixner
The kmap_atomic* interfaces in all architectures are pretty much the same except for post map operations (flush) and pre- and post unmap operations. Provide a generic variant for that. Signed-off-by: Thomas Gleixner --- include/linux/highmem.h | 87 ---

[PATCH v2 1/4] selftests/seccomp: Record syscall during ptrace entry

2020-09-19 Thread Kees Cook
In preparation for performing actions during ptrace syscall exit, save the syscall number during ptrace syscall entry. Some architectures do no have the syscall number available during ptrace syscall exit. Suggested-by: Thadeu Lima de Souza Cascardo Link:

[PATCH v2 4/4] selftests/clone3: Avoid OS-defined clone_args

2020-09-19 Thread Kees Cook
As the UAPI headers start to appear in distros, we need to avoid outdated versions of struct clone_args to be able to test modern features; rename to "struct __clone_args". Additionally update the struct size macro names to match UAPI names. Signed-off-by: Kees Cook ---

[PATCH v2 0/4] selftests/seccomp: Refactor change_syscall()

2020-09-19 Thread Kees Cook
v1: https://lore.kernel.org/lkml/20200912110820.597135-1-keesc...@chromium.org v2: - Took Acked patches into -next - refactored powerpc syscall setting implementation - refactored clone3 args implementation Hi, This finishes the refactoring of the seccomp selftest logic used in for ptrace

[PATCH v2 2/4] selftests/seccomp: Allow syscall nr and ret value to be set separately

2020-09-19 Thread Kees Cook
In preparation for setting syscall nr and ret values separately, refactor the helpers to take a pointer to a value, so that a NULL can indicate "do not change this respective value". This is done to keep the regset read/write happening once and in one code path. Signed-off-by: Kees Cook ---

[PATCH v2 3/4] selftests/seccomp: powerpc: Set syscall return during ptrace syscall exit

2020-09-19 Thread Kees Cook
Some archs (like powerpc) only support changing the return code during syscall exit when ptrace is used. Test entry vs exit phases for which portions of the syscall number and return values need to be set at which different phases. For non-powerpc, all changes are made during ptrace syscall entry,

[PATCH] KVM: PPC: Book3S: Remove redundant initialization of variable ret

2020-09-19 Thread Jing Xiangfeng
The variable ret is being initialized with '-ENOMEM' that is meaningless. So remove it. Signed-off-by: Jing Xiangfeng --- arch/powerpc/kvm/book3s_64_vio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c

[PATCH -next v2] tty: hvc: fix link error with CONFIG_SERIAL_CORE_CONSOLE=n

2020-09-19 Thread Yang Yingliang
aarch64-linux-gnu-ld: drivers/tty/hvc/hvc_dcc.o: in function `dcc_early_write': hvc_dcc.c:(.text+0x164): undefined reference to `uart_console_write' The driver uses the uart_console_write(), but SERIAL_CORE_CONSOLE is not selected, so uart_console_write is not defined, then we get the error. Fix