Re: [PATCH v3 6/7] powerpc/mm: implement set_memory_attr()

2020-02-10 Thread kbuild test robot
Hi Christophe, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.6-rc1 next-20200211] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base'

Re: Problem booting a PowerBook G4 Aluminum after commit cd08f109 with CONFIG_VMAP_STACK=y

2020-02-10 Thread Christophe Leroy
Le 10/02/2020 à 13:55, Larry Finger a écrit : On 2/9/20 12:19 PM, Christophe Leroy wrote: Do you have CONFIG_TRACE_IRQFLAGS in your config ? If so, can you try the patch below ? https://patchwork.ozlabs.org/patch/1235081/ Otherwise, can you send me your .config and tell me exactly where it

Re: [PATCH v2 10/13] powerpc/kprobes: Support kprobes on prefixed instructions

2020-02-10 Thread Christophe Leroy
Le 11/02/2020 à 06:33, Jordan Niethe a écrit : A prefixed instruction is composed of a word prefix followed by a word suffix. It does not make sense to be able to have a kprobe on the suffix of a prefixed instruction, so make this impossible. Kprobes work by replacing an instruction with a

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

2020-02-10 Thread Christophe Leroy
Le 11/02/2020 à 03:25, Anshuman Khandual a écrit : On 02/10/2020 04:36 PM, Russell King - ARM Linux admin wrote: There are good reasons for the way ARM does stuff. The generic crap was written without regard for the circumstances that ARM has, and thus is entirely unsuitable for 32-bit

Re: [PATCH v2 09/13] powerpc/xmon: Dump prefixed instructions

2020-02-10 Thread Christophe Leroy
Le 11/02/2020 à 06:33, Jordan Niethe a écrit : Currently when xmon is dumping instructions it reads a word at a time and then prints that instruction (either as a hex number or by disassembling it). For prefixed instructions it would be nice to show its prefix and suffix as together. Use

Re: [PATCH v2 08/13] powerpc/xmon: Add initial support for prefixed instructions

2020-02-10 Thread Christophe Leroy
Le 11/02/2020 à 06:33, Jordan Niethe a écrit : A prefixed instruction is composed of a word prefix and a word suffix. It does not make sense to be able to have a breakpoint on the suffix of a prefixed instruction, so make this impossible. When leaving xmon_core() we check to see if we are

Re: [PATCH v2 06/13] powerpc: Support prefixed instructions in alignment handler

2020-02-10 Thread Christophe Leroy
Le 11/02/2020 à 06:33, Jordan Niethe a écrit : Alignment interrupts can be caused by prefixed instructions accessing memory. In the alignment handler the instruction that caused the exception is loaded and attempted emulate. If the instruction is a prefixed instruction load the prefix and

Re: [PATCH v2 04/13] powerpc sstep: Add support for prefixed load/stores

2020-02-10 Thread Christophe Leroy
Le 11/02/2020 à 06:33, Jordan Niethe a écrit : This adds emulation support for the following prefixed integer load/stores: * Prefixed Load Byte and Zero (plbz) * Prefixed Load Halfword and Zero (plhz) * Prefixed Load Halfword Algebraic (plha) * Prefixed Load Word and Zero (plwz)

Re: [PATCH v2 03/13] powerpc sstep: Prepare to support prefixed instructions

2020-02-10 Thread Christophe Leroy
Le 11/02/2020 à 06:33, Jordan Niethe a écrit : Currently all instructions are a single word long. A future ISA version will include prefixed instructions which have a double word length. The functions used for analysing and emulating instructions need to be modified so that they can handle

[PATCH v2 13/13] powerpc: Add prefix support to mce_find_instr_ea_and_pfn()

2020-02-10 Thread Jordan Niethe
mce_find_instr_ea_and_pfn analyses an instruction to determine the effective address that caused the machine check. Update this to load and pass the suffix to analyse_instr for prefixed instructions. Signed-off-by: Jordan Niethe --- v2: - Rename sufx to suffix ---

[PATCH v2 12/13] powerpc/hw_breakpoints: Initial support for prefixed instructions

2020-02-10 Thread Jordan Niethe
Currently when getting an instruction to emulate in hw_breakpoint_handler() we do not load the suffix of a prefixed instruction. Ensure we load the suffix if the instruction we need to emulate is a prefixed instruction. Signed-off-by: Jordan Niethe --- v2: Rename sufx to suffix ---

[PATCH v2 11/13] powerpc/uprobes: Add support for prefixed instructions

2020-02-10 Thread Jordan Niethe
Uprobes can execute instructions out of line. Increase the size of the buffer used for this so that this works for prefixed instructions. Take into account the length of prefixed instructions when fixing up the nip. Signed-off-by: Jordan Niethe --- v2: - Fix typo - Use macro for instruction

[PATCH v2 10/13] powerpc/kprobes: Support kprobes on prefixed instructions

2020-02-10 Thread Jordan Niethe
A prefixed instruction is composed of a word prefix followed by a word suffix. It does not make sense to be able to have a kprobe on the suffix of a prefixed instruction, so make this impossible. Kprobes work by replacing an instruction with a trap and saving that instruction to be single stepped

[PATCH v2 09/13] powerpc/xmon: Dump prefixed instructions

2020-02-10 Thread Jordan Niethe
Currently when xmon is dumping instructions it reads a word at a time and then prints that instruction (either as a hex number or by disassembling it). For prefixed instructions it would be nice to show its prefix and suffix as together. Use read_instr() so that if a prefix is encountered its

[PATCH v2 08/13] powerpc/xmon: Add initial support for prefixed instructions

2020-02-10 Thread Jordan Niethe
A prefixed instruction is composed of a word prefix and a word suffix. It does not make sense to be able to have a breakpoint on the suffix of a prefixed instruction, so make this impossible. When leaving xmon_core() we check to see if we are currently at a breakpoint. If this is the case, the

[PATCH v2 07/13] powerpc/traps: Check for prefixed instructions in facility_unavailable_exception()

2020-02-10 Thread Jordan Niethe
If prefixed instructions are made unavailable by the [H]FSCR, attempting to use them will cause a facility unavailable exception. Add "PREFIX" to the facility_strings[]. Currently there are no prefixed instructions that are actually emulated by emulate_instruction() within

[PATCH v2 06/13] powerpc: Support prefixed instructions in alignment handler

2020-02-10 Thread Jordan Niethe
Alignment interrupts can be caused by prefixed instructions accessing memory. In the alignment handler the instruction that caused the exception is loaded and attempted emulate. If the instruction is a prefixed instruction load the prefix and suffix to emulate. After emulating increment the NIP by

[PATCH v2 05/13] powerpc sstep: Add support for prefixed fixed-point arithmetic

2020-02-10 Thread Jordan Niethe
This adds emulation support for the following prefixed Fixed-Point Arithmetic instructions: * Prefixed Add Immediate (paddi) Signed-off-by: Jordan Niethe --- arch/powerpc/lib/sstep.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c

[PATCH v2 04/13] powerpc sstep: Add support for prefixed load/stores

2020-02-10 Thread Jordan Niethe
This adds emulation support for the following prefixed integer load/stores: * Prefixed Load Byte and Zero (plbz) * Prefixed Load Halfword and Zero (plhz) * Prefixed Load Halfword Algebraic (plha) * Prefixed Load Word and Zero (plwz) * Prefixed Load Word Algebraic (plwa) * Prefixed Load

[PATCH v2 03/13] powerpc sstep: Prepare to support prefixed instructions

2020-02-10 Thread Jordan Niethe
Currently all instructions are a single word long. A future ISA version will include prefixed instructions which have a double word length. The functions used for analysing and emulating instructions need to be modified so that they can handle these new instruction types. A prefixed instruction

[PATCH v2 02/13] powerpc: Define new SRR1 bits for a future ISA version

2020-02-10 Thread Jordan Niethe
Add the BOUNDARY SRR1 bit definition for when the cause of an alignment exception is a prefixed instruction that crosses a 64-byte boundary. Add the PREFIXED SRR1 bit definition for exceptions caused by prefixed instructions. Bit 35 of SRR1 is called SRR1_ISI_N_OR_G. This name comes from it being

[PATCH v2 01/13] powerpc: Enable Prefixed Instructions

2020-02-10 Thread Jordan Niethe
From: Alistair Popple Prefix instructions have their own FSCR bit which needs to enabled via a CPU feature. The kernel will save the FSCR for problem state but it needs to be enabled initially. Signed-off-by: Alistair Popple --- arch/powerpc/include/asm/reg.h| 3 +++

[PATCH v2 00/13] Initial Prefixed Instruction support

2020-02-10 Thread Jordan Niethe
A future revision of the ISA will introduce prefixed instructions. A prefixed instruction is composed of a 4-byte prefix followed by a 4-byte suffix. All prefixes have the major opcode 1. A prefix will never be a valid word instruction. A suffix may be an existing word instruction or a new

Re: [PATCH] powerpc/8xx: Fix clearing of bits 20-23 in ITLB miss

2020-02-10 Thread Leonardo Bras
Christophe Leroy writes: > In ITLB miss handled the line supposed to clear bits 20-23 on the > L2 ITLB entry is buggy and does indeed nothing, leading to undefined > value which could allow execution when it shouldn't. > > Properly do the clearing with the relevant instruction. > > Fixes:

QEMU/KVM snapshot restore bug

2020-02-10 Thread dftxbs3e
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 --snapshotname error: internal error: process exited while

Re: [PATCH V5 06/14] powerpc/vas: Setup thread IRQ handler per VAS instance

2020-02-10 Thread Michael Neuling
On Sun, 2020-02-09 at 21:17 -0800, Haren Myneni wrote: > On Fri, 2020-02-07 at 16:57 +1100, Michael Neuling wrote: > > > /* > > > + * Process CRBs that we receive on the fault window. > > > + */ > > > +irqreturn_t vas_fault_handler(int irq, void *data) > > > +{ > > > + struct vas_instance *vinst

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

2020-02-10 Thread Anshuman Khandual
On 02/10/2020 04:36 PM, Russell King - ARM Linux admin wrote: > On Mon, Feb 10, 2020 at 11:46:23AM +0100, Christophe Leroy wrote: >> >> >> Le 10/02/2020 à 11:02, Russell King - ARM Linux admin a écrit : >>> On Mon, Feb 10, 2020 at 07:38:38AM +0100, Christophe Leroy wrote: Le

[PATCH v3 3/3] selftests/powerpc: Don't rely on segfault to rerun the test

2020-02-10 Thread Gustavo Luiz Duarte
The test case tm-signal-context-force-tm expects a segfault to happen on returning from signal handler, and then does a setcontext() to run the test again. However, the test doesn't always segfault, causing the test to run a single time. This patch fixes the test by putting it within a loop and

[PATCH v3 2/3] selftests/powerpc: Add tm-signal-pagefault test

2020-02-10 Thread Gustavo Luiz Duarte
This test triggers a TM Bad Thing by raising a signal in transactional state and forcing a pagefault to happen in kernelspace when the kernel signal handling code first touches the user signal stack. This is inspired by the test tm-signal-context-force-tm but uses userfaultfd to make the test

[PATCH v3 1/3] powerpc/tm: Fix clearing MSR[TS] in current when reclaiming on signal delivery

2020-02-10 Thread Gustavo Luiz Duarte
After a treclaim, we expect to be in non-transactional state. If we don't clear the current thread's MSR[TS] before we get preempted, then tm_recheckpoint_new_task() will recheckpoint and we get rescheduled in suspended transaction state. When handling a signal caught in transactional state,

[PATCH 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents

2020-02-10 Thread Pingfan Liu
A bug is observed on pseries by taking the following steps on rhel: -1. drmgr -c mem -r -q 5 -2. echo c > /proc/sysrq-trigger And then, the failure looks like: kdump: saving to /sysroot//var/crash/127.0.0.1-2020-01-16-02:06:14/ kdump: saving vmcore-dmesg.txt kdump: saving vmcore-dmesg.txt

[PATCH 1/2] powerpc/pseries: group lmb operation and memblock's

2020-02-10 Thread Pingfan Liu
This patch prepares for the incoming patch which swaps the order of KOBJ_ uevent and dt's updating. It has no functional effect, just groups lmb operation and memblock's in order to insert dt updating operation easily, and makes it easier to review. Signed-off-by: Pingfan Liu Cc: Michael

Re: [PATCH 2/2] selftests: vm: Fix 64-bit test builds for powerpc64le

2020-02-10 Thread Michael Ellerman
Sandipan Das writes: > Some tests are built only for 64-bit systems. This makes > sure that these tests are built for both big and little > endian variants of powerpc64. > > Fixes: 7549b3364201 ("selftests: vm: Build/Run 64bit tests only on 64bit > arch") > Reviewed-by: Kamalesh Babulal >

Re: [PATCH 1/2] selftests: vm: Do not override definition of ARCH

2020-02-10 Thread Michael Ellerman
Sandipan Das writes: > Independent builds of the vm selftests is currently broken > because commit 7549b3364201 overrides the value of ARCH with > the machine name from uname. This does not always match the > architecture names used for tasks like header installation. > > E.g. for building tests

Re: linux-next: DTS build warnings

2020-02-10 Thread Stephen Rothwell
Hi all, On Wed, 31 Jul 2019 15:39:36 +1000 Stephen Rothwell wrote: > > I have been getting the following warnings from a couple of powerpc > builds for quite a while now. I was hoping someone might have time to > look at them and maybe even fix them up :-) Today's list (from an allyesconfig

Re: [PATCH v2] libnvdimm: Update persistence domain value for of_pmem and papr_scm device

2020-02-10 Thread Dan Williams
On Mon, Feb 10, 2020 at 6:20 AM Aneesh Kumar K.V wrote: > > Dan Williams writes: > > > On Tue, Feb 4, 2020 at 9:21 PM Aneesh Kumar K.V > > wrote: > >> > >> Currently, kernel shows the below values > >> "persistence_domain":"cpu_cache" > >>

[PATCH RESEND] macintosh: convert to i2c_new_scanned_device

2020-02-10 Thread Wolfram Sang
Move from the deprecated i2c_new_probed_device() to the new i2c_new_scanned_device(). No functional change for this driver because it doesn't check the return code anyhow. Signed-off-by: Wolfram Sang --- I can take this via I2C tree if this makes things easier...

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

2020-02-10 Thread Catalin Marinas
On Tue, Jan 28, 2020 at 06:57:53AM +0530, Anshuman Khandual wrote: > This gets build and run when CONFIG_DEBUG_VM_PGTABLE is selected along with > CONFIG_VM_DEBUG. Architectures willing to subscribe this test also need to > select CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE which for now is limited to x86

Re: [PATCH 6/6] powerpc: powernv: no need to check return value of debugfs_create functions

2020-02-10 Thread Greg Kroah-Hartman
On Tue, Feb 11, 2020 at 02:01:53AM +1100, Oliver O'Halloran wrote: > On Mon, Feb 10, 2020 at 12:12 AM Greg Kroah-Hartman > wrote: > > > > When calling debugfs functions, there is no need to ever check the > > return value. The function can work or not, but the code logic should > > never do

Re: [PATCH 6/6] powerpc: powernv: no need to check return value of debugfs_create functions

2020-02-10 Thread Oliver O'Halloran
On Mon, Feb 10, 2020 at 12:12 AM Greg Kroah-Hartman wrote: > > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. For memtrace debugfs is the only way to

Re: [PATCH v2] libnvdimm: Update persistence domain value for of_pmem and papr_scm device

2020-02-10 Thread Aneesh Kumar K.V
Dan Williams writes: > On Tue, Feb 4, 2020 at 9:21 PM Aneesh Kumar K.V > wrote: >> >> Currently, kernel shows the below values >> "persistence_domain":"cpu_cache" >> "persistence_domain":"memory_controller" >> "persistence_domain":"unknown" >> >> "cpu_cache" indicates no

[powerpc:merge] BUILD SUCCESS a5bc6e124219546a81ce334dc9b16483d55e9abf

2020-02-10 Thread kbuild test robot
c3000_defconfig parisc defconfig x86_64 randconfig-a001-20200210 x86_64 randconfig-a002-20200210 x86_64 randconfig-a003-20200210 i386 randconfig-a001-20200210 i386 randconfig-a002-20200210 i386

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

2020-02-10 Thread Russell King - ARM Linux admin
On Mon, Feb 10, 2020 at 11:46:23AM +0100, Christophe Leroy wrote: > > > Le 10/02/2020 à 11:02, Russell King - ARM Linux admin a écrit : > > On Mon, Feb 10, 2020 at 07:38:38AM +0100, Christophe Leroy wrote: > > > > > > > > > Le 10/02/2020 à 06:35, Anshuman Khandual a écrit : > > > > > > > > >

Re: [PATCH] powerpc/vdso32: mark __kernel_datapage_offset as STV_PROTECTED

2020-02-10 Thread Michael Ellerman
Fangrui Song writes: > A PC-relative relocation (R_PPC_REL16_LO in this case) referencing a > preemptible symbol in a -shared link is not allowed. GNU ld's powerpc > port is permissive and allows it [1], but lld will report an error after >

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

2020-02-10 Thread Christophe Leroy
Le 10/02/2020 à 11:02, Russell King - ARM Linux admin a écrit : On Mon, Feb 10, 2020 at 07:38:38AM +0100, Christophe Leroy wrote: Le 10/02/2020 à 06:35, Anshuman Khandual a écrit : On 02/10/2020 10:22 AM, Andrew Morton wrote: On Thu, 6 Feb 2020 13:49:35 +0530 Anshuman Khandual wrote:

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

2020-02-10 Thread Russell King - ARM Linux admin
On Mon, Feb 10, 2020 at 07:38:38AM +0100, Christophe Leroy wrote: > > > Le 10/02/2020 à 06:35, Anshuman Khandual a écrit : > > > > > > On 02/10/2020 10:22 AM, Andrew Morton wrote: > > > On Thu, 6 Feb 2020 13:49:35 +0530 Anshuman Khandual > > > wrote: > > > > > > > > > > > On 02/06/2020

Re: [RESEND][PATCH] selftests/vm: Fix vm tests build and run

2020-02-10 Thread Michael Ellerman
Harish writes: > A recent change overrides the ARCH env variable and hence runs > using make fails with the following. > > $ make -C vm/ > make: Entering directory '/home/harish/linux/tools/testing/selftests/vm' > make --no-builtin-rules ARCH=ppc64le -C ../../../.. headers_install > make[1]:

Re: [PATCH V5 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2020-02-10 Thread Michael Neuling
> > > + > > > + csb.cc = CSB_CC_TRANSLATION; > > > + csb.ce = CSB_CE_TERMINATION; > > > + csb.cs = 0; > > > + csb.count = 0; > > > + > > > + /* > > > + * Returns the fault address in CPU format since it is passed with > > > + * signal. But if the user space expects BE format, need changes. > >

Re: [RESEND][PATCH] selftests/vm: Fix vm tests build and run

2020-02-10 Thread Christophe Leroy
Le 10/02/2020 à 08:35, Harish a écrit : A recent change overrides the ARCH env variable and hence runs using make fails with the following. $ make -C vm/ make: Entering directory '/home/harish/linux/tools/testing/selftests/vm' make --no-builtin-rules ARCH=ppc64le -C ../../../..