[PATCH v2 49/52] powerpc/64s/exceptions: machine check move unrecoverable handling out of line

2019-06-19 Thread Nicholas Piggin
Similarly to the previous patch, move unrecoverable handling out of line, which makes the regular path less cluttered and easier to follow. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 83 +--- 1 file changed, 39 insertions(+), 44 deletions(-)

[PATCH v2 48/52] powerpc/64s/exception: simplify machine check early path

2019-06-19 Thread Nicholas Piggin
machine_check_handle_early_common can reach machine_check_handle_early directly now that it runs at the relocated address. The only reason to do the rfi sequence is to enable MSR[ME]. Move that into a helper function to make the normal code path a bit easier to read. Signed-off-by: Nicholas Piggin

[PATCH v2 47/52] powerpc/64s/exception: machine check restructure handler to be more regular

2019-06-19 Thread Nicholas Piggin
Follow the pattern of sreset and HMI handlers more closely, in using EXCEPTION_PROLOG_COMMON_1 rather than open-coding it. Run the handler at the relocated location. This will help with simplification and code sharing. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 86

[PATCH v2 46/52] powerpc/64s/exception: fix machine check early should not set AMR

2019-06-19 Thread Nicholas Piggin
The early machine check runs in real mode, so locking is unnecessary. Worse, the windup does not restore AMR, so this can result in a false KUAP fault after a recoverable machine check hits inside a user copy operation. Fix this similarly to HMI by just avoiding the kuap lock in the early machine

[PATCH v2 45/52] powerpc/64s/exception: machine check windup restore cfar for host delivery

2019-06-19 Thread Nicholas Piggin
Bare metal machine checks run an "early" handler in real mode which potentially flushes faulting translation structures, among other things, before running the main handler which reports the event. The main handler runs as a normal interrupt handler, after a "windup" that sets registers back as th

[PATCH v2 44/52] powerpc/64s/exception: separate pseries and powernv mce delivery paths

2019-06-19 Thread Nicholas Piggin
This will allow standardised interrupt entry macros to be used in future. These paths may be de-duplicated again after that if code allows. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff -

[PATCH v2 43/52] powerpc/64s/exception: machine check early only runs in HV mode

2019-06-19 Thread Nicholas Piggin
machine_check_common_early and machine_check_handle_early only run in HVMODE. Remove dead code. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 38 +--- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/arch/powerpc/kernel/exceptions

[PATCH v2 42/52] powerpc/64s/exception: machine check fwnmi does not trigger when in HV mode

2019-06-19 Thread Nicholas Piggin
Remove dead code. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 286bd5670d60..b12755a4f884 100644 --- a/arch/powerpc/kernel/exception

[PATCH v2 41/52] powerpc/tm: update comment about interrupt re-entrancy

2019-06-19 Thread Nicholas Piggin
Since the system reset interrupt began to use its own stack, and machine check interrupts have done so for some time, r1 can be changed without clearing MSR[RI], provided no other interrupts (including SLB misses) are taken. MSR[RI] does have to be cleared when using SCRATCH0, however. Signed-off

[PATCH v2 40/52] powerpc/64s/exception: move SET_SCRATCH0 into EXCEPTION_PROLOG_0

2019-06-19 Thread Nicholas Piggin
No generated code change. File is change is in bug table line numbers. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel

[PATCH v2 39/52] powerpc/64s/exception: denorm handler use standard scratch save macro

2019-06-19 Thread Nicholas Piggin
Although the 0x1500 interrupt only applies to bare metal, it is better to just use the standard macro for scratch save. Runtime code path remains unchanged (due to instruction patching). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file changed, 1 insertion(

[PATCH v2 38/52] powerpc/64s/exception: machine check use standard macros to save dar/dsisr

2019-06-19 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 16d5ea1c86bb..437f91179537 100644 --- a/arch/powerpc/kernel/exception

[PATCH v2 37/52] powerpc/64s/exception: add dar and dsisr options to exception macro

2019-06-19 Thread Nicholas Piggin
Some exception entry requires DAR and/or DSISR to be saved into the paca exception save area. Add options to the standard exception macros for these. Generated code changes slightly due to code structure. - 554: a6 02 72 7d mfdsisr r11 - 558: a8 00 4d f9 std r10,168(

[PATCH v2 36/52] powerpc/64s/exception: use common macro for windup

2019-06-19 Thread Nicholas Piggin
No generated code change. File is change is in bug table line numbers. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 112 +-- 1 file changed, 36 insertions(+), 76 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/k

[PATCH v2 35/52] powerpc/64s/exception: shuffle windup code around

2019-06-19 Thread Nicholas Piggin
Restore all SPRs and CR up-front, these are longer latency instructions. Move register restore around to maximise pairs of adjacent loads (e.g., restore r0 next to r1). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 40 +++- 1 file changed, 16 i

[PATCH v2 34/52] powerpc/64s/exception: simplify hmi windup code

2019-06-19 Thread Nicholas Piggin
Duplicate the hmi windup code for both cases, rather than to put a special case branch in the middle of it. Remove unused label. This helps with later code consolidation. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 22 ++ 1 file changed, 18 inser

[PATCH v2 33/52] powerpc/64s/exception: move machine check windup in_mce handling

2019-06-19 Thread Nicholas Piggin
Move in_mce decrement earlier before registers are restored (but still after RI=0). This helps with later consolidation. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/excepti

[PATCH v2 32/52] powerpc/64s/exception: windup use r9 consistently to restore SPRs

2019-06-19 Thread Nicholas Piggin
Trivial code change, r3->r9. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 539bb1b83d90..804438669454 1006

[PATCH v2 31/52] powerpc/64s/exception: mtmsrd L=1 cleanup

2019-06-19 Thread Nicholas Piggin
All supported 64s CPUs support mtmsrd L=1 instruction, so a cleanup can be made in sreset and mce handlers. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b

[PATCH v2 30/52] powerpc/64s/exception: optimise system_reset for idle, clean up non-idle case

2019-06-19 Thread Nicholas Piggin
The idle wake up code in the system reset interrupt is not very optimal. There are two requirements: perform idle wake up quickly; and save everything including CFAR for non-idle interrupts, with no performance requirement. The problem with placing the idle test in the middle of the handler and us

[PATCH v2 29/52] powerpc/64s/exception: avoid SPR RAW scoreboard stall in real mode entry

2019-06-19 Thread Nicholas Piggin
Move SPR reads ahead of writes. Real mode entry that is not a KVM guest is rare these days, but bad practice propagates. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/

[PATCH v2 28/52] powerpc/64s/exception: clean up system call entry

2019-06-19 Thread Nicholas Piggin
syscall / hcall entry unnecessarily differs between KVM and non-KVM builds. Move the SMT priority instruction to the same location (after INTERRUPT_TO_KERNEL). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 25 +++-- 1 file changed, 7 insertions(+),

[PATCH v2 27/52] powerpc/64s/exception: move paca save area offsets into exception-64s.S

2019-06-19 Thread Nicholas Piggin
No generated code change. File is change is in bug table line numbers. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 17 +++-- arch/powerpc/kernel/exceptions-64s.S | 22 ++ 2 files changed, 25 insertions(+), 14 deletions(-) dif

[PATCH v2 26/52] powerpc/64s/exception: remove pointless EXCEPTION_PROLOG macro indirection

2019-06-19 Thread Nicholas Piggin
No generated code change. File is change is in bug table line numbers. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 97 +--- 1 file changed, 45 insertions(+), 52 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/k

[PATCH v2 25/52] powerpc/64s/exception: remove bad stack branch

2019-06-19 Thread Nicholas Piggin
The bad stack test in interrupt handlers has a few problems. For performance it is taken in the common case, which is a fetch bubble and a waste of i-cache. For code development and maintainence, it requires yet another stack frame setup routine, and that constrains all exception handlers to follo

[PATCH v2 24/52] powerpc/64s/exception: generate regs clear instructions using .rept

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 29 +++- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 02b4722b7c64..0a

[PATCH v2 23/52] powerpc/64s/exception: fix indenting irregularities

2019-06-19 Thread Nicholas Piggin
Generally, macros that result in instructions being expanded are indented by a tab, and those that don't have no indent. Fix the obvious cases that go contrary to style. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 92 ++

[PATCH v2 22/52] powerpc/64s/exception: use a gas macro for system call handler code

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 127 --- 1 file changed, 55 insertions(+), 72 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index f1f1278cb131..f7

[PATCH v2 21/52] powerpc/64s/exception: remove unused BRANCH_TO_COMMON

2019-06-19 Thread Nicholas Piggin
--- arch/powerpc/kernel/exceptions-64s.S | 8 1 file changed, 8 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 87db0f5a67c4..f1f1278cb131 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-6

[PATCH v2 20/52] powerpc/64s/exception: remove __BRANCH_TO_KVM

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 43 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 0a5a2d9dde90..87

[PATCH v2 19/52] powerpc/64s/exception: move head-64.h code to exception-64s.S where it is used

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 1 - arch/powerpc/include/asm/head-64.h | 252 --- arch/powerpc/kernel/exceptions-64s.S | 251 ++ 3 files changed, 251 insertions(+), 253 de

[PATCH v2 18/52] powerpc/64s/exception: move exception-64s.h code to exception-64s.S where it is used

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 430 -- arch/powerpc/kernel/exceptions-64s.S | 431 +++ 2 files changed, 431 insertions(+), 430 deletions(-) diff --git a/arch/powerpc/include/asm/

[PATCH v2 17/52] powerpc/64s/exception: move KVM related code together

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index 73705421

[PATCH v2 16/52] powerpc/64s/exception: remove STD_EXCEPTION_COMMON variants

2019-06-19 Thread Nicholas Piggin
These are only called in one place each. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 22 -- arch/powerpc/include/asm/head-64.h | 19 +-- 2 files changed, 17 insertions(+), 24 deletions(-) diff

[PATCH v2 15/52] powerpc/64s/exception: move EXCEPTION_PROLOG_2* to a more logical place

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 113 --- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index 0bb0310b

[PATCH v2 14/52] powerpc/64s/exception: improve 0x500 handler code

2019-06-19 Thread Nicholas Piggin
After the previous cleanup, it becomes possible to consolidate some common code outside the runtime alternate patching. Also remove unused labels. This results in some code change, but unchanged runtime instruction sequence. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.

[PATCH v2 13/52] powerpc/64s/exception: unwind exception-64s.h macros

2019-06-19 Thread Nicholas Piggin
Many of these macros just specify 1-4 lines which are only called a few times each at most, and often just once. Remove this indirection. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 101 --- arch/powerpc/include/asm

[PATCH v2 12/52] powerpc/64s/exception: Move EXCEPTION_COMMON additions into callers

2019-06-19 Thread Nicholas Piggin
More cases of code insertion via macros that does not add a great deal. All the additions have to be specified in the macro arguments, so they can just as well go after the macro. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 42 +++-

[PATCH v2 11/52] powerpc/64s/exception: Move EXCEPTION_COMMON handler and return branches into callers

2019-06-19 Thread Nicholas Piggin
The aim is to reduce the amount of indirection it takes to get through the exception handler macros, particularly where it provides little code sharing. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 26 arch/powe

[PATCH v2 10/52] powerpc/64s/exception: Make EXCEPTION_PROLOG_0 a gas macro for consistency with others

2019-06-19 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 25 arch/powerpc/kernel/exceptions-64s.S | 24 +++ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/include/asm/ex

[PATCH v2 09/52] powerpc/64s/exception: KVM handler can set the HSRR trap bit

2019-06-19 Thread Nicholas Piggin
Move the KVM trap HSRR bit into the KVM handler, which can be conditionally applied when hsrr parameter is set. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 5 + arch/powerpc/include/asm/head-64.h | 7 ++- 2 files changed,

[PATCH v2 08/52] powerpc/64s/exception: merge KVM handler and skip variants

2019-06-19 Thread Nicholas Piggin
Conditionally expand the skip case if it is specified. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 28 +--- arch/powerpc/include/asm/head-64.h | 8 +++ arch/powerpc/kernel/exceptions-64s.S | 2 +- 3

[PATCH v2 07/52] powerpc/64s/exception: consolidate maskable and non-maskable prologs

2019-06-19 Thread Nicholas Piggin
Conditionally expand the soft-masking test if a mask is passed in. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 113 +-- arch/powerpc/kernel/exceptions-64s.S | 20 ++-- 2 files changed, 55 insertions(+), 78 dele

[PATCH v2 06/52] powerpc/64s/exception: remove the "extra" macro parameter

2019-06-19 Thread Nicholas Piggin
Rather than pass in the soft-masking and KVM tests via macro that is passed to another macro to expand it, switch to usig gas macros and conditionally expand the soft-masking and KVM tests. The system reset with its idle test is open coded as it is a one-off. No generated code change. Signed-off

[PATCH v2 05/52] powerpc/64s/exception: fix sreset KVM test code

2019-06-19 Thread Nicholas Piggin
The sreset handler KVM test theoretically should not depend on P7. In practice KVM now only supports P7 and up so no real bug fix, but this change is made now so the quirk is not propagated through cleanup patches. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 +++--

[PATCH v2 04/52] powerpc/64s/exception: move and tidy EXCEPTION_PROLOG_2 variants

2019-06-19 Thread Nicholas Piggin
- Re-name the macros to _REAL and _VIRT suffixes rather than no and _RELON suffix. - Move the macro definitions together in the file. - Move RELOCATABLE ifdef inside the _VIRT macro. Further consolidation between variants does not buy much here. No generated code change. Signed-off-by: Nicho

[PATCH v2 03/52] powerpc/64s/exception: consolidate EXCEPTION_PROLOG_2 with _NORI variant

2019-06-19 Thread Nicholas Piggin
Switch to a gas macro that conditionally expands the RI clearing instruction. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 43 ++-- arch/powerpc/kernel/exceptions-64s.S | 12 +++ 2 files changed, 17 insertion

[PATCH v2 02/52] powerpc/64s/exception: remove H concatenation for EXC_HV variants

2019-06-19 Thread Nicholas Piggin
Replace all instances of this with gas macros that test the hsrr parameter and use the appropriate register names / labels. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 333 +-- arch/powerpc/include/asm/head-64.h

[PATCH v2 00/52] powerpc/64s interrupt handler cleanups, gasification

2019-06-19 Thread Nicholas Piggin
This contains the previous 28 series in front, with one small fix mentioned in the last thread, plus one extra patch to remove unused BRANCH_TO_COMMON macro, so first 29 up to SPR RAW scoreboard are all quite minimal generated code change. The next patches start to get a bit more into code change,

[PATCH v2 01/52] powerpc/64s/exception: fix line wrap and semicolon inconsistencies in macros

2019-06-19 Thread Nicholas Piggin
By convention, all lines should be separated by a semicolons. Last line should have neither semicolon or line wrap. No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/exception-64s.h | 36 ++--- arch/powerpc/include/asm/head-64.h | 68 +++

[PATCH v2] ocxl: Allow contexts to be attached with a NULL mm

2019-06-19 Thread Alastair D'Silva
From: Alastair D'Silva If an OpenCAPI context is to be used directly by a kernel driver, there may not be a suitable mm to use. The patch makes the mm parameter to ocxl_context_attach optional. Signed-off-by: Alastair D'Silva --- arch/powerpc/mm/book3s64/radix_tlb.c | 5 + drivers/misc/o

Re: [PATCH v2 3/6] powerpc/eeh: Improve debug messages around device addition

2019-06-19 Thread Oliver O'Halloran
On Thu, Jun 20, 2019 at 12:40 PM Alexey Kardashevskiy wrote: > > On 19/06/2019 14:27, Sam Bobroff wrote: > > On Tue, Jun 11, 2019 at 03:47:58PM +1000, Alexey Kardashevskiy wrote: > >> > >> On 07/05/2019 14:30, Sam Bobroff wrote: > >>> Also remove useless comment. > >>> > >>> Signed-off-by: Sam Bob

Re: [PATCH v2 3/6] powerpc/eeh: Improve debug messages around device addition

2019-06-19 Thread Alexey Kardashevskiy
On 19/06/2019 14:27, Sam Bobroff wrote: > On Tue, Jun 11, 2019 at 03:47:58PM +1000, Alexey Kardashevskiy wrote: >> >> >> On 07/05/2019 14:30, Sam Bobroff wrote: >>> Also remove useless comment. >>> >>> Signed-off-by: Sam Bobroff >>> Reviewed-by: Alexey Kardashevskiy >>> --- >>> arch/powerpc/k

Re: [PATCH v2 01/10] powerpc/8xx: move CPM1 related files from sysdev/ to platforms/8xx

2019-06-19 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.2-rc5 next-20190619] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

[PATCH 2/3] KVM: PPC: Book3S HV: Signed extend decrementer value if not using large decr

2019-06-19 Thread Suraj Jitindar Singh
On POWER9 the decrementer can operate in large decrementer mode where the decrementer is 56 bits and signed extended to 64 bits. When not operating in this mode the decrementer behaves as a 32 bit decrementer which is NOT signed extended (as on POWER8). Currently when reading a guest decrementer v

[PATCH 3/3] KVM: PPC: Book3S HV: Clear pending decr exceptions on nested guest entry

2019-06-19 Thread Suraj Jitindar Singh
If we enter an L1 guest with a pending decrementer exception then this is cleared on guest exit if the guest has writtien a positive value into the decrementer (indicating that it handled the decrementer exception) since there is no other way to detect that the guest has handled the pending excepti

[PATCH 1/3] KVM: PPC: Book3S HV: Invalidate ERAT when flushing guest TLB entries

2019-06-19 Thread Suraj Jitindar Singh
When a guest vcpu moves from one physical thread to another it is necessary for the host to perform a tlb flush on the previous core if another vcpu from the same guest is going to run there. This is because the guest may use the local form of the tlb invalidation instruction meaning stale tlb entr

Re: [PATCH 3/4] powerpc/powernv: remove dead NPU DMA code

2019-06-19 Thread Alexey Kardashevskiy
On 19/06/2019 17:28, Christoph Hellwig wrote: > On Wed, Jun 19, 2019 at 10:34:54AM +1000, Alexey Kardashevskiy wrote: >> >> >> On 23/05/2019 17:49, Christoph Hellwig wrote: >>> None of these routines were ever used since they were added to the >>> kernel. >> >> >> It is still being used exactly

Re: [PATCH 0/2] Fix handling of h_set_dawr

2019-06-19 Thread Suraj Jitindar Singh
On Mon, 2019-06-17 at 11:06 +0200, Cédric Le Goater wrote: > On 17/06/2019 09:16, Suraj Jitindar Singh wrote: > > Series contains 2 patches to fix the host in kernel handling of the > > hcall > > h_set_dawr. > > > > First patch from Michael Neuling is just a resend added here for > > clarity. > >

Re: [PATCH v5 2/2] powerpc: Fix compile issue with force DAWR

2019-06-19 Thread Christophe Leroy
Le 19/06/2019 à 03:11, Michael Neuling a écrit : On Tue, 2019-06-18 at 18:28 +0200, Christophe Leroy wrote: Le 04/06/2019 à 05:00, Michael Neuling a écrit : If you compile with KVM but without CONFIG_HAVE_HW_BREAKPOINT you fail at linking with: arch/powerpc/kvm/book3s_hv_rmhandlers.o:(.

Re: [PATCH 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-19 Thread Naveen N. Rao
Nicholas Piggin wrote: Naveen N. Rao's on June 19, 2019 7:53 pm: Nicholas Piggin wrote: Michael Ellerman's on June 19, 2019 3:14 pm: I'm also not convinced the ordering between the two patches is guaranteed by the ISA, given that there's possibly no isync on the other CPU. Will they go thro

Re: [PATCH 2/3] powerpc/64s/radix: ioremap use ioremap_page_range

2019-06-19 Thread Christophe Leroy
Le 19/06/2019 à 05:59, Nicholas Piggin a écrit : Christophe Leroy's on June 11, 2019 4:46 pm: Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : I would like to remove the early ioremap or make it into its own function. Re-implement map_kernel_page with ioremap_page_range, allow page tables

[PATCH v3] KVM: PPC: Report single stepping capability

2019-06-19 Thread Fabiano Rosas
When calling the KVM_SET_GUEST_DEBUG ioctl, userspace might request the next instruction to be single stepped via the KVM_GUESTDBG_SINGLESTEP control bit of the kvm_guest_debug structure. This patch adds the KVM_CAP_PPC_GUEST_DEBUG_SSTEP capability in order to inform userspace about the state of s

Re: [RFC PATCH v0] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-19 Thread Bharata B Rao
On Wed, Jun 19, 2019 at 02:36:54PM +0530, Aneesh Kumar K.V wrote: > Bharata B Rao writes: > > > We hit the following BUG_ON when memory hotplugged before reboot > > is unplugged after reboot: > > > > kernel BUG at arch/powerpc/mm/pgtable-frag.c:113! > > > > remove_pagetable+0x594/0x6a0 > > (unr

Re: [RFC PATCH v0] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-19 Thread Bharata B Rao
On Wed, Jun 19, 2019 at 08:17:01PM +1000, Nicholas Piggin wrote: > Bharata B Rao's on June 19, 2019 5:45 pm: > > We hit the following BUG_ON when memory hotplugged before reboot > > is unplugged after reboot: > > > > kernel BUG at arch/powerpc/mm/pgtable-frag.c:113! > > > > remove_pagetable+0x59

Re: [PATCH] ocxl: Update for AFU descriptor template version 1.1

2019-06-19 Thread christophe lombard
On 05/06/2019 13:15, Frederic Barrat wrote: From: Alastair D'Silva The OpenCAPI discovery and configuration specification has been updated and introduces version 1.1 of the AFU descriptor template, with new fields to better define the memory layout of an OpenCAPI adapter. The ocxl driver doesn

Re: [PATCH] powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

2019-06-19 Thread Mathieu Malaterre
On Wed, Jun 19, 2019 at 4:18 PM Benjamin Herrenschmidt wrote: > > On Wed, 2019-06-19 at 22:32 +1000, Michael Ellerman wrote: > > Christoph Hellwig writes: > > > Any chance this could get picked up to fix the regression? > > > > Was hoping Ben would Ack it. He's still powermac maintainer :) > > >

Re: [PATCH] powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

2019-06-19 Thread Benjamin Herrenschmidt
On Wed, 2019-06-19 at 22:32 +1000, Michael Ellerman wrote: > Christoph Hellwig writes: > > Any chance this could get picked up to fix the regression? > > Was hoping Ben would Ack it. He's still powermac maintainer :) > > I guess he OK'ed it in the other thread, will add it to my queue. Yeah ack

[RFC 00/11] opencapi: enable card reset and link retraining

2019-06-19 Thread Frederic Barrat
This is the linux part of the work to use the PCI hotplug framework to control an opencapi card so that it can be reset and re-read after flashing a new FPGA image. It needs support in skiboot: http://patchwork.ozlabs.org/project/skiboot/list/?series=114803 On an old skiboot, it will do nothing.

[RFC 07/11] pci/hotplug/pnv-php: Improve error msg on power state change failure

2019-06-19 Thread Frederic Barrat
When changing the slot state, if opal hits an error and tells as such in the asynchronous reply, the warning "Wrong msg" is logged, which is rather confusing. Instead we can reuse the better message which is already used when we couldn't submit the asynchronous opal request initially. Signed-off-b

[RFC 11/11] ocxl: Add PCI hotplug dependency to Kconfig

2019-06-19 Thread Frederic Barrat
The PCI hotplug framework is used to update the devices when a new image is written to the FPGA. Signed-off-by: Frederic Barrat --- drivers/misc/ocxl/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/ocxl/Kconfig b/drivers/misc/ocxl/Kconfig index 7fb6d39d4c5a..13a5d9f30369

[RFC 06/11] pci/hotplug/pnv-php: Remove erroneous warning

2019-06-19 Thread Frederic Barrat
On powernv, when removing a device through hotplug, the following warning is logged: Invalid refcount <.> on <...> It may be incorrect, the refcount may be set to a higher value than 1 and be valid. of_detach_node() can drop more than one reference. As it doesn't seem trivial to assert the c

[RFC 04/11] powerpc/powernv/ioda: Release opencapi device

2019-06-19 Thread Frederic Barrat
With hotplug, an opencapi device can now go away. It needs to be released, mostly to clean up its PE state. We were previously not defining any device callback. We can reuse the standard PCI release callback, it does a bit too much for an opencapi device, but it's harmless, and only needs minor tun

[RFC 08/11] pci/hotplug/pnv-php: Register opencapi slots

2019-06-19 Thread Frederic Barrat
Add the opencapi PHBs to the list of PHBs being scanned to look for slots. Signed-off-by: Frederic Barrat --- drivers/pci/hotplug/pnv_php.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 5cdd2a3a4dd9..f9

[RFC 10/11] pci/hotplug/pnv-php: Wrap warnings in macro

2019-06-19 Thread Frederic Barrat
An opencapi slot doesn't have an associated bridge device. It's not needed for operation, but any warning is displayed through pci_warn() which uses the pci_dev struct of the assocated bridge device. So wrap those warning so that a different trace mechanism can be used if it's an opencapi slot. Si

[RFC 09/11] pci/hotplug/pnv-php: Relax check when disabling slot

2019-06-19 Thread Frederic Barrat
The driver only allows to disable a slot in the POPULATED state. However, if an error occurs while enabling the slot, say because the link couldn't be trained, then the POPULATED state may not be reached, yet the power state of the slot is on. So allow to disable a slot in the REGISTERED state. Rem

[RFC 05/11] powerpc/powernv/ioda: Find opencapi slot for a device node

2019-06-19 Thread Frederic Barrat
Unlike real PCI slots, opencapi slots are directly associated to the (virtual) opencapi PHB, there's no intermediate bridge. So when looking for a slot ID, we must start the search from the device node itself and not its parent. Also, the slot ID is not attached to a specific bdfn, so let's build

[RFC 02/11] powerpc/powernv/ioda: Protect PE list

2019-06-19 Thread Frederic Barrat
Protect the PHB's list of PE. Probably not needed as long as it was populated during PHB creation, but it feels right and will become required once we can add/remove opencapi devices on hotplug. Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/powernv/pci-ioda.c | 6 +- 1 file chang

[RFC 03/11] powerpc/powernv/ioda: set up PE on opencapi device when enabling

2019-06-19 Thread Frederic Barrat
The PE for an opencapi device was set as part of a late PHB fixup operation, when creating the PHB. To use the PCI hotplug framework, this is not going to work, as the PHB stays the same, it's only the devices underneath which are updated. For regular PCI devices, it is done as part of the reconfig

[RFC 01/11] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2019-06-19 Thread Frederic Barrat
Taking a reference on the pci_dev structure was required with initial commit 184cd4a3b962 ("powerpc/powernv: PCI support for p7IOC under OPAL v2"), where we we storing the pci dev in the pci_dn structure. However, the pci_dev was later removed from the pci_dn structure, but the reference was kept.

Re: [PATCH 1/3] powerpc/64: __ioremap_at clean up in the error case

2019-06-19 Thread Christophe Leroy
Le 19/06/2019 à 06:04, Nicholas Piggin a écrit : Christophe Leroy's on June 11, 2019 4:28 pm: Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : __ioremap_at error handling is wonky, it requires caller to clean up after it. Implement a helper that does the map and error cleanup and remove th

Re: [PATCH 2/3] powerpc/64s/radix: ioremap use ioremap_page_range

2019-06-19 Thread Christophe Leroy
Le 19/06/2019 à 05:59, Nicholas Piggin a écrit : Christophe Leroy's on June 11, 2019 4:46 pm: Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : [snip] diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index c9bcf428dd2b..db993bc1aef3 100644

Re: [PATCH 1/4] mm: Move ioremap page table mapping function to mm/

2019-06-19 Thread Christophe Leroy
Le 19/06/2019 à 05:43, Nicholas Piggin a écrit : Christophe Leroy's on June 11, 2019 3:24 pm: Le 10/06/2019 à 06:38, Nicholas Piggin a écrit : [snip] diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 51e131245379..812bea5866d6 100644 --- a/include/linux/vmalloc.h +++

Re: [PATCH 0/1] PPC32: fix ptrace() access to FPU registers

2019-06-19 Thread Radu Rendec
On Wed, 2019-06-19 at 10:36 +1000, Daniel Axtens wrote: > Andreas Schwab < > sch...@linux-m68k.org > > writes: > > > On Jun 18 2019, Radu Rendec < > > radu.ren...@gmail.com > > > wrote: > > > > > Since you already have a working setup, it would be nice if you could > > > add a printk to arch_ptra

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-19 Thread Michael Ellerman
On Mon, 2019-06-17 at 07:16:18 UTC, Suraj Jitindar Singh wrote: > From: Michael Neuling > > Commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9 > option") screwed up some assembler and corrupted a pointer in > r3. This resulted in crashes like the below: > > [ 44.374746] BUG: Kerne

Re: [PATCH] powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

2019-06-19 Thread Michael Ellerman
Christoph Hellwig writes: > Any chance this could get picked up to fix the regression? Was hoping Ben would Ack it. He's still powermac maintainer :) I guess he OK'ed it in the other thread, will add it to my queue. cheers > On Thu, Jun 13, 2019 at 10:24:46AM +0200, Christoph Hellwig wrote: >>

Re: [PATCH] powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

2019-06-19 Thread Christoph Hellwig
Any chance this could get picked up to fix the regression? On Thu, Jun 13, 2019 at 10:24:46AM +0200, Christoph Hellwig wrote: > With the strict dma mask checking introduced with the switch to > the generic DMA direct code common wifi chips on 32-bit powerbooks > stopped working. Add a 30-bit ZONE

Re: [PATCH 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-19 Thread Nicholas Piggin
Naveen N. Rao's on June 19, 2019 7:53 pm: > Nicholas Piggin wrote: >> Michael Ellerman's on June 19, 2019 3:14 pm: >>> Hi Naveen, >>> >>> Sorry I meant to reply to this earlier .. :/ > > No problem. Thanks for the questions. > >>> >>> "Naveen N. Rao" writes: With -mprofile-kernel, gcc emi

Re: [PATCH] ocxl: Allow contexts to be attached with a NULL mm

2019-06-19 Thread Frederic Barrat
Le 18/06/2019 à 03:50, Andrew Donnellan a écrit : On 17/6/19 2:41 pm, Alastair D'Silva wrote: From: Alastair D'Silva If an OpenCAPI context is to be used directly by a kernel driver, there may not be a suitable mm to use. The patch makes the mm parameter to ocxl_context_attach optional. S

Re: [RFC PATCH v0] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-19 Thread Nicholas Piggin
Bharata B Rao's on June 19, 2019 5:45 pm: > We hit the following BUG_ON when memory hotplugged before reboot > is unplugged after reboot: > > kernel BUG at arch/powerpc/mm/pgtable-frag.c:113! > > remove_pagetable+0x594/0x6a0 > (unreliable) > remove_pagetable+0x94/0x6a0 > vmemmap_free+0x394/0x

Re: [PATCH v2 1/1] cpuidle-powernv : forced wakeup for stop states

2019-06-19 Thread Nicholas Piggin
Abhishek's on June 19, 2019 7:08 pm: > Hi Nick, > > Thanks for the review. Some replies below. > > On 06/19/2019 09:53 AM, Nicholas Piggin wrote: >> Abhishek Goel's on June 17, 2019 7:56 pm: >>> Currently, the cpuidle governors determine what idle state a idling CPU >>> should enter into based on

Re: [PATCH 06/28] powerpc/64s/exception: remove the "extra" macro parameter

2019-06-19 Thread Michael Ellerman
Nicholas Piggin writes: > Nicholas Piggin's on June 12, 2019 12:30 am: >> @@ -265,7 +275,7 @@ ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE) >> EXC_REAL_END(machine_check, 0x200, 0x100) >> EXC_VIRT_NONE(0x4200, 0x100) >> TRAMP_REAL_BEGIN(machine_check_common_early) >> -EXCEPTION_PROLOG_1(PACA_EX

Re: [PATCH 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-19 Thread Naveen N. Rao
Nicholas Piggin wrote: Michael Ellerman's on June 19, 2019 3:14 pm: Hi Naveen, Sorry I meant to reply to this earlier .. :/ No problem. Thanks for the questions. "Naveen N. Rao" writes: With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to enable function tracing and pr

RE: [PATCH v4 1/3] PM: wakeup: Add routine to help fetch wakeup source object.

2019-06-19 Thread Ran Wang
Hi Rafael, On Wednesday, June 19, 2019 06:45, Rafael J. Wysocki wrote: > > On Monday, May 20, 2019 11:52:36 AM CEST Ran Wang wrote: > > Some user might want to go through all registered wakeup sources and > > doing things accordingly. For example, SoC PM driver might need to do > > HW programming

Re: [PATCH 5/7] powerpc/ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-19 Thread Steven Rostedt
On Wed, 19 Jun 2019 13:26:37 +0530 "Naveen N. Rao" wrote: > > In include/ftrace.h: > > > > #ifndef FTRACE_IP_EXTENSION > > # define FTRACE_IP_EXTENSION0 > > #endif > > > > > > In arch/powerpc/include/asm/ftrace.h > > > > #define FTRACE_IP_EXTENSION MCOUNT_INSN_SIZE > > > > > > Then

Re: [PATCH v2 1/1] cpuidle-powernv : forced wakeup for stop states

2019-06-19 Thread Abhishek
Hi Nick, Thanks for the review. Some replies below. On 06/19/2019 09:53 AM, Nicholas Piggin wrote: Abhishek Goel's on June 17, 2019 7:56 pm: Currently, the cpuidle governors determine what idle state a idling CPU should enter into based on heuristics that depend on the idle history on that CPU

Re: [RFC PATCH v0] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-19 Thread Aneesh Kumar K.V
Bharata B Rao writes: > We hit the following BUG_ON when memory hotplugged before reboot > is unplugged after reboot: > > kernel BUG at arch/powerpc/mm/pgtable-frag.c:113! > > remove_pagetable+0x594/0x6a0 > (unreliable) > remove_pagetable+0x94/0x6a0 > vmemmap_free+0x394/0x410 > sparse_remove

Re: [PATCH 06/28] powerpc/64s/exception: remove the "extra" macro parameter

2019-06-19 Thread Nicholas Piggin
Nicholas Piggin's on June 12, 2019 12:30 am: > @@ -265,7 +275,7 @@ ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE) > EXC_REAL_END(machine_check, 0x200, 0x100) > EXC_VIRT_NONE(0x4200, 0x100) > TRAMP_REAL_BEGIN(machine_check_common_early) > - EXCEPTION_PROLOG_1(PACA_EXMC, NOTEST, 0x200) > + EXCE

Re: [PATCH 5/7] powerpc/ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-19 Thread Naveen N. Rao
Steven Rostedt wrote: On Tue, 18 Jun 2019 23:53:11 +0530 "Naveen N. Rao" wrote: Naveen N. Rao wrote: > Steven Rostedt wrote: >> On Tue, 18 Jun 2019 20:17:04 +0530 >> "Naveen N. Rao" wrote: >> >>> @@ -1551,7 +1551,7 @@ unsigned long ftrace_location_range(unsigned long start, unsigned lon

Re: [PATCH 0/5] Powerpc/hw-breakpoint: Fixes plus Code refactor

2019-06-19 Thread Ravi Bangoria
On 6/18/19 11:47 AM, Michael Neuling wrote: > On Tue, 2019-06-18 at 08:01 +0200, Christophe Leroy wrote: >> >> Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : >>> patch 1-3: Code refactor >>> patch 4: Speedup disabling breakpoint >>> patch 5: Fix length calculation for unaligned targets >> >> Whi

  1   2   >