Re: [PATCH] KVM: PPC: Book3S HV: Treat unrecognized TM instructions as illegal

2020-02-16 Thread Segher Boessenkool
On Mon, Feb 17, 2020 at 05:23:07PM +1100, Michael Neuling wrote: > > > Hence, we should NOP this, not generate an illegal. > > > > It is not a reserved bit. > > > > The IMC entry for it matches op1=01 op2=101110 presumably, which > > catches all TM instructions and nothing else (bits

Re: [PATCH 2/5] mm/vma: Make vma_is_accessible() available for general use

2020-02-16 Thread Geert Uytterhoeven
On Mon, Feb 17, 2020 at 6:04 AM Anshuman Khandual wrote: > Lets move vma_is_accessible() helper to include/linux/mm.h which makes it > available for general use. While here, this replaces all remaining open > encodings for VMA access check with vma_is_accessible(). > > Cc: Guo Ren > Cc: Geert

Re: [RFC PATCH v2 00/12] Reduce ifdef mess in ptrace

2020-02-16 Thread Christophe Leroy
Hi Mikey, Le 28/06/2019 à 17:47, Christophe Leroy a écrit : The purpose of this series is to reduce the amount of #ifdefs in ptrace.c Any feedback on this series which aims at fixing the issue you opened at https://github.com/linuxppc/issues/issues/128 ? Thanks Christophe This is a

Re: [PATCH v7 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support

2020-02-16 Thread Christophe Leroy
Le 17/02/2020 à 00:08, Michael Neuling a écrit : Daniel. Can you start this commit message with a simple description of what you are actually doing? This reads like you've been on a long journey to Mordor and back, which as a reader of this patch in the long distant future, I don't care

Re: [PATCH] powerpc/chrp: Fix enter_rtas() with CONFIG_VMAP_STACK

2020-02-16 Thread Christophe Leroy
Le 16/02/2020 à 23:40, Michael Neuling a écrit : On Fri, 2020-02-14 at 08:33 +, Christophe Leroy wrote: With CONFIG_VMAP_STACK, data MMU has to be enabled to read data on the stack. Can you describe what goes wrong without this? Some oops message? rtas blows up? Get corrupt data?

Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type

2020-02-16 Thread Christophe Leroy
Le 15/02/2020 à 06:36, Leonardo Bras a écrit : Before checking for cpu_type == NULL, this same copy happens, so doing it here will just write the same value to the t->oprofile_type again. Remove the repeated copy, as it is unnecessary. Signed-off-by: Leonardo Bras ---

Re: [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK

2020-02-16 Thread Mike Rapoport
On Sun, Feb 16, 2020 at 08:22:30AM +, Russell King - ARM Linux admin wrote: > On Sun, Feb 16, 2020 at 10:18:30AM +0200, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Hi, > > > > These patches convert several architectures to use page table folding and > > remove

Re: [PATCH] KVM: PPC: Book3S HV: Treat unrecognized TM instructions as illegal

2020-02-16 Thread Michael Neuling
On Sun, 2020-02-16 at 23:57 -0600, Segher Boessenkool wrote: > On Mon, Feb 17, 2020 at 12:07:31PM +1100, Michael Neuling wrote: > > On Thu, 2020-02-13 at 10:15 -0500, Gustavo Romero wrote: > > > On P9 DD2.2 due to a CPU defect some TM instructions need to be emulated > > > by > > > KVM. This is

Re: [PATCH] KVM: PPC: Book3S HV: Treat unrecognized TM instructions as illegal

2020-02-16 Thread Segher Boessenkool
On Mon, Feb 17, 2020 at 12:07:31PM +1100, Michael Neuling wrote: > On Thu, 2020-02-13 at 10:15 -0500, Gustavo Romero wrote: > > On P9 DD2.2 due to a CPU defect some TM instructions need to be emulated by > > KVM. This is handled at first by the hardware raising a softpatch interrupt > > when

[PATCH 3/5] mm/vma: Replace all remaining open encodings with is_vm_hugetlb_page()

2020-02-16 Thread Anshuman Khandual
This replaces all remaining open encodings with is_vm_hugetlb_page(). Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Alexander Viro Cc: Will Deacon Cc: "Aneesh Kumar K.V" Cc: Andrew Morton Cc: Nick Piggin Cc: Peter Zijlstra Cc: Arnd Bergmann Cc: Ingo Molnar Cc:

[PATCH 2/5] mm/vma: Make vma_is_accessible() available for general use

2020-02-16 Thread Anshuman Khandual
Lets move vma_is_accessible() helper to include/linux/mm.h which makes it available for general use. While here, this replaces all remaining open encodings for VMA access check with vma_is_accessible(). Cc: Guo Ren Cc: Geert Uytterhoeven Cc: Paul Burton Cc: Benjamin Herrenschmidt Cc: Paul

[PATCH 0/5] mm/vma: Use available wrappers when possible

2020-02-16 Thread Anshuman Khandual
Apart from adding a VMA flag readable name for trace purpose, this series does some open encoding replacements with availabe VMA specific wrappers. This skips VM_HUGETLB check in vma_migratable() as its already being done with another patch (https://patchwork.kernel.org/patch/11347831/) which is

[PATCH] powerpc/xmon: Fix whitespace handling in getstring()

2020-02-16 Thread Oliver O'Halloran
The ls (lookup symbol) and zr (reboot) commands use xmon's getstring() helper to read a string argument from the xmon prompt. This function skips over leading whitespace, but doesn't check if the first "non-whitespace" character is a newline which causes some odd behaviour ( indicates a the enter

[PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-16 Thread Anshuman Khandual
This adds tests which will validate architecture page table helpers and other accessors in their compliance with expected generic MM semantics. This will help various architectures in validating changes to existing page table helpers or addition of new ones. This test covers basic page table

Re: QEMU/KVM snapshot restore bug

2020-02-16 Thread dftxbs3e
On 2/16/20 7:16 PM, Cédric Le Goater wrote: > > I think this is fixed by commit f55750e4e4fb ("spapr/xive: Mask the EAS when > allocating an IRQ") which is not in QEMU 4.1.1. The same problem should also > occur with LE guests. > > Could you possibly regenerate the QEMU rpm with this patch ? >

[PATCH 2/2] powerpc/powernv: Add explicit fast-reboot support

2020-02-16 Thread Oliver O'Halloran
Add a way to manually invoke a fast-reboot rather than setting the NVRAM flag. The idea is to allow userspace to invoke a fast-reboot using the optional string argument to the reboot() system call, or using the xmon zr command so we don't need to leave around a persistent changes on a system to

[PATCH 1/2] powerpc/powernv: Treat an empty reboot string as default

2020-02-16 Thread Oliver O'Halloran
Treat an empty reboot cmd string the same as a NULL string. This squashes a spurious unsupported reboot message that sometimes gets out when using xmon. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] KVM: PPC: Book3S HV: Treat unrecognized TM instructions as illegal

2020-02-16 Thread Michael Neuling
On Thu, 2020-02-13 at 10:15 -0500, Gustavo Romero wrote: > On P9 DD2.2 due to a CPU defect some TM instructions need to be emulated by > KVM. This is handled at first by the hardware raising a softpatch interrupt > when certain TM instructions that need KVM assistance are executed in the > guest.

Re: [PATCH v7 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support

2020-02-16 Thread Michael Neuling
Daniel. Can you start this commit message with a simple description of what you are actually doing? This reads like you've been on a long journey to Mordor and back, which as a reader of this patch in the long distant future, I don't care about. I just want to know what you're implementing.

Re: Kernel (little-endian) crashing on POWER8 on heavy PowerKVM load

2020-02-16 Thread Michael Neuling
Paulus, Something below for you I think > We have an IBM POWER server (8247-42L) running Linux kernel 5.4.13 on Debian > unstable > hosting a big-endian ppc64 virtual machine running the same kernel in > big-endian > mode. > > When building OpenJDK-11 on the big-endian VM, the testsuite

Re: [PATCH] powerpc/chrp: Fix enter_rtas() with CONFIG_VMAP_STACK

2020-02-16 Thread Michael Neuling
On Fri, 2020-02-14 at 08:33 +, Christophe Leroy wrote: > With CONFIG_VMAP_STACK, data MMU has to be enabled > to read data on the stack. Can you describe what goes wrong without this? Some oops message? rtas blows up? Get corrupt data? Also can you say what you're actually doing (ie turning

Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type

2020-02-16 Thread Michael Neuling
On Sat, 2020-02-15 at 02:36 -0300, Leonardo Bras wrote: > Before checking for cpu_type == NULL, this same copy happens, so doing > it here will just write the same value to the t->oprofile_type > again. > > Remove the repeated copy, as it is unnecessary. > > Signed-off-by: Leonardo Bras LGTM

Re: QEMU/KVM snapshot restore bug

2020-02-16 Thread Cédric Le Goater
On 2/11/20 4:57 AM, dftxbs3e wrote: > Hello, > > I took a snapshot of a ppc64 (big endian) VM from a ppc64 (little endian) > host using `virsh snapshot-create-as --domain --name ` > > Then I restarted my system and tried restoring the snapshot: > > # virsh snapshot-revert --domain

Re: Surprising code generated for vdso_read_begin()

2020-02-16 Thread Arnd Bergmann
On Sat, Jan 11, 2020 at 12:33 PM Segher Boessenkool wrote: > > On Fri, Jan 10, 2020 at 07:45:44AM +0100, Christophe Leroy wrote: > > Le 09/01/2020 à 21:07, Segher Boessenkool a écrit : > > >It looks like the compiler did loop peeling. What GCC version is this? > > >Please try current trunk (to

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-16 Thread Masami Hiramatsu
On Sat, 15 Feb 2020 11:28:49 +0100 Christophe Leroy wrote: > Hi, > > Le 14/02/2020 à 14:54, Masami Hiramatsu a écrit : > > Hi, > > > > On Fri, 14 Feb 2020 12:47:49 + (UTC) > > Christophe Leroy wrote: > > > >> When a program check exception happens while MMU translation is > >> disabled,

Re: [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK

2020-02-16 Thread Christophe Leroy
Le 16/02/2020 à 09:22, Russell King - ARM Linux admin a écrit : On Sun, Feb 16, 2020 at 10:18:30AM +0200, Mike Rapoport wrote: From: Mike Rapoport Hi, These patches convert several architectures to use page table folding and remove __ARCH_HAS_5LEVEL_HACK along with

Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables

2020-02-16 Thread Christophe Leroy
Le 16/02/2020 à 09:18, Mike Rapoport a écrit : From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h. I don't think it is worth adding all this additionnals walks of p4d, this

[Bug 206525] BUG: KASAN: stack-out-of-bounds in test_bit+0x30/0x44 (kernel 5.6-rc1)

2020-02-16 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206525 --- Comment #4 from Christophe Leroy (christophe.le...@c-s.fr) --- Feedback from Nikolay: I think we can just cap these at min(BITS_PER_TYPE(u32), nlk->ngroups) since "groups" is coming from sockaddr_nl's "nl_groups" which is a u32, for any

Re: [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK

2020-02-16 Thread Russell King - ARM Linux admin
On Sun, Feb 16, 2020 at 10:18:30AM +0200, Mike Rapoport wrote: > From: Mike Rapoport > > Hi, > > These patches convert several architectures to use page table folding and > remove __ARCH_HAS_5LEVEL_HACK along with include/asm-generic/5level-fixup.h. > > The changes are mostly about mechanical

[PATCH v2 13/13] mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport There are no architectures that use include/asm-generic/5level-fixup.h therefore it can be removed along with __ARCH_HAS_5LEVEL_HACK define and the code it surrounds Signed-off-by: Mike Rapoport --- include/asm-generic/5level-fixup.h | 58 --

[PATCH v2 12/13] asm-generic: remove pgtable-nop4d-hack.h

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport No architecture defines __ARCH_USE_5LEVEL_HACK and therefore pgtable-nop4d-hack.h will be never actually included. Remove it. Signed-off-by: Mike Rapoport --- include/asm-generic/pgtable-nop4d-hack.h | 64 include/asm-generic/pgtable-nopud.h

[PATCH v2 11/13] unicore32: remove __ARCH_USE_5LEVEL_HACK

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport The unicore32 architecture has 2 level page tables and asm-generic/pgtable-nopmd.h and explicit casts from pud_t to pgd_t for page table folding. Add p4d walk in the only place that actually unfolds the pud level and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike

[PATCH v2 10/13] sh: add support for folded p4d page tables

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/sh/include/asm/pgtable-2level.h | 1 - arch/sh/include/asm/pgtable-3level.h | 1 -

[PATCH v2 09/13] sh: drop __pXd_offset() macros that duplicate pXd_index() ones

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport The __pXd_offset() macros are identical to the pXd_index() macros and there is no point to keep both of them. All architectures define and use pXd_index() so let's keep only those to make mips consistent with the rest of the kernel. Signed-off-by: Mike Rapoport ---

[PATCH v2 08/13] sh: fault: Modernize printing of kernel messages

2020-02-16 Thread Mike Rapoport
From: Geert Uytterhoeven - Convert from printk() to pr_*(), - Add missing continuations, - Use "%llx" to format u64, - Join multiple prints in show_fault_oops() into a single print. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mike Rapoport --- arch/sh/mm/fault.c | 39

[PATCH v2 07/13] powerpc: add support for folded p4d page tables

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h. Signed-off-by: Mike Rapoport Tested-by: Christophe Leroy # 8xx and 83xx --- arch/powerpc/include/asm/book3s/32/pgtable.h |

[PATCH v2 06/13] openrisc: add support for folded p4d page tables

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/openrisc/include/asm/pgtable.h | 1 - arch/openrisc/mm/fault.c| 10 --

[PATCH v2 05/13] nios2: add support for folded p4d page tables

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/nios2/include/asm/pgtable.h | 3 +-- arch/nios2/mm/fault.c| 9 +++--

[PATCH v2 04/13] ia64: add support for folded p4d page tables

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, remove usage of __ARCH_USE_5LEVEL_HACK and replace 5level-fixup.h with pgtable-nop4d.h Signed-off-by: Mike Rapoport --- arch/ia64/include/asm/pgalloc.h | 4 ++--

[PATCH v2 03/13] hexagon: remove __ARCH_USE_5LEVEL_HACK

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport The hexagon architecture has 2 level page tables and as such most of the page table folding is already implemented in asm-generic/pgtable-nopmd.h. Fixup the only place in arch/hexagon to unfold the p4d level and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport

[PATCH v2 02/13] h8300: remove usage of __ARCH_USE_5LEVEL_HACK

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport h8300 is a nommu architecture and does not require fixup for upper layers of the page tables because it is already handled by the generic nommu implementation. Remove definition of __ARCH_USE_5LEVEL_HACK in arch/h8300/include/asm/pgtable.h Signed-off-by: Mike Rapoport ---

[PATCH v2 01/13] arm/arm64: add support for folded p4d page tables

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, replace 5level-fixup.h with pgtable-nop4d.h and remove __ARCH_USE_5LEVEL_HACK. Since arm and arm64 share kvm memory management bits, make the conversion for both variants at

[PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK

2020-02-16 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches convert several architectures to use page table folding and remove __ARCH_HAS_5LEVEL_HACK along with include/asm-generic/5level-fixup.h. The changes are mostly about mechanical replacement of pgd accessors with p4d ones and the addition of higher levels to