[PATCH v2] powerpc: Ignore DSI error caused by the copy/paste instruction

2022-09-25 Thread Haren Myneni
DSI error will be generated when the paste operation is issued on the suspended NX window due to NX state changes. The hypervisor expects the partition to ignore this error during page pault handling. To differentiate DSI caused by an actual HW configuration or by the NX window, a new

[PATCH v2 2/5] powerpc/64: asm use consistent global variable declaration and access

2022-09-25 Thread Nicholas Piggin
Use helper macros to access global variables, and place them in .data sections rather than in .toc. Putting addresses in TOC is not required because the kernel is linked with a single TOC. Signed-off-by: Nicholas Piggin --- arch/powerpc/boot/opal-calls.S | 6 +++---

[PATCH v2 1/5] powerpc/64: use 32-bit immediate for STACK_FRAME_REGS_MARKER

2022-09-25 Thread Nicholas Piggin
Using a 32-bit constant for this marker allows it to be loaded with two ALU instructions, like 32-bit. This avoids a TOC entry and a TOC load that depends on the r2 value that has just been loaded from the PACA. This changes the value for 32-bit as well, so both have the same value in the low 4

[PATCH v2 0/5] powerpc/64: avoid GOT addressing, don't put data in TOC

2022-09-25 Thread Nicholas Piggin
This is a cleaned up set of the initial prep patches from the pcrel series, dealing with regularising addressing variables from asm and using helper macros more consistently. Changes since v1: - Use "REGS" stack frame marker for 64-bit, leaving 32-bit unchanged. - Fix PPC64 32-bit boot wrapper

[PATCH v2 4/5] powerpc/64: provide a helper macro to load r2 with the kernel TOC

2022-09-25 Thread Nicholas Piggin
A later change stops the kernel using r2 and loads it with a poison value. Provide a PACATOC loading abstraction which can hide this detail. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ppc_asm.h | 6 ++ arch/powerpc/kernel/exceptions-64e.S | 12

[PATCH v2 5/5] powerpc/64e: provide an addressing macro for use with TOC in alternate register

2022-09-25 Thread Nicholas Piggin
The interrupt entry code carefully saves a minimal number of registers, so in some places the TOC is required, it is loaded into a different register, so provide a macro that can supply an alternate TOC register. This continues to use got addressing because TOC-relative results in "got/toc

[PATCH v2 3/5] powerpc/64: switch asm helpers from GOT to TOC relative addressing

2022-09-25 Thread Nicholas Piggin
There is no need to use GOT addressing within the kernel. Signed-off-by: Nicholas Piggin --- arch/powerpc/boot/ppc_asm.h| 3 ++- arch/powerpc/include/asm/ppc_asm.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/boot/ppc_asm.h

[PATCH] powerpc/pseries: move hcall_tracepoint_refcount out of .toc

2022-09-25 Thread Nicholas Piggin
The .toc section is not really intended for arbitrary data. Writable data in particular prevents making the TOC read-only after relocation. Move hcall_tracepoint_refcount into the .data section. Signed-off-by: Nicholas Piggin --- This is split out from "[v2,2/5] powerpc/64: asm use consistent

[PATCH v3 0/7] powerpc/64: interrupt soft-mask and context fixes

2022-09-25 Thread Nicholas Piggin
No real changes since last posting, I just pulled fixes from several series together and rearranged them and updated changelogs slightly. Thanks, Nick Nicholas Piggin (7): powerpc/64/interrupt: Fix false warning in context tracking due to idle state powerpc/64: mark irqs hard disabled in

[PATCH v3 1/7] powerpc/64/interrupt: Fix false warning in context tracking due to idle state

2022-09-25 Thread Nicholas Piggin
Commit 171476775d32 ("context_tracking: Convert state to atomic_t") added a CONTEXT_IDLE state which can be encountered by interrupts from kernel mode in the idle thread, causing a false positive warning. Fixes: 171476775d32 ("context_tracking: Convert state to atomic_t") Signed-off-by: Nicholas

Re: [PATCH v2] powerpc: Ignore DSI error caused by the copy/paste instruction

2022-09-25 Thread Christophe Leroy
Le 25/09/2022 à 22:26, Haren Myneni a écrit : > > DSI error will be generated when the paste operation is issued on > the suspended NX window due to NX state changes. The hypervisor > expects the partition to ignore this error during page pault > handling. To differentiate DSI caused by an

[PATCH v3 3/7] powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending

2022-09-25 Thread Nicholas Piggin
If a synchronous interrupt (e.g., hash fault) is taken inside an irqs-disabled region which has MSR[EE]=1, then an asynchronous interrupt that is PACA_IRQ_MUST_HARD_MASK (e.g., PMI) is taken inside the synchronous interrupt handler, then the synchronous interrupt will return with MSR[EE]=1 and the

[PATCH v3 4/7] powerpc/64s: Fix irq state management in runlatch functions

2022-09-25 Thread Nicholas Piggin
When irqs are soft-disabled, MSR[EE] is volatile and can change from 1 to 0 asynchronously (if a PACA_IRQ_MUST_HARD_MASK interrupt hits). So it can not be used to check hard IRQ enabled status, except to confirm it is disabled. ppc64_runlatch_on/off functions use MSR this way to decide whether to

[PATCH v3 2/7] powerpc/64: mark irqs hard disabled in boot paca

2022-09-25 Thread Nicholas Piggin
This prevents interrupts in early boot (e.g., program check) from enabling MSR[EE], potentially causing endian mismatch or other crashes when reporting early boot traps. Fixes: 4423eb5ae32ec ("powerpc/64/interrupt: make normal synchronous interrupts enable MSR[EE] if possible") Signed-off-by:

[PATCH v3 5/7] powerpc/64s/interrupt: masked handler debug check for previous hard disable

2022-09-25 Thread Nicholas Piggin
Prior changes eliminated cases of masked PACA_IRQ_MUST_HARD_MASK interrupts that re-fire due to MSR[EE] being enabled while they are pending. Add a debug check in the masked interrupt handler to catch if this occurs. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 10

[PATCH v2 2/5] powerpc/64s: early boot machine check handler

2022-09-25 Thread Nicholas Piggin
Use the early boot interrupt fixup in the machine check handler to allow the machine check handler to run before interrupt endian is set up. Branch to an early boot handler that just does a basic crash, which allows it to run before ppc_md is set up. MSR[ME] is enabled on the boot CPU earlier, and

[PATCH v2 0/5] powerpc/64s: improve boot debugging

2022-09-25 Thread Nicholas Piggin
This series provides a machine check handler to catch out of bounds memory accesses in early boot before the MMU is enabled. Since v1: - 64e compile fix Nicholas Piggin (5): powerpc/64s/interrupt: move early boot ILE fixup into a macro powerpc/64s: early boot machine check handler

[PATCH v2 1/5] powerpc/64s/interrupt: move early boot ILE fixup into a macro

2022-09-25 Thread Nicholas Piggin
In preparation for using this sequence in machine check interrupt, move it into a macro, with a small change to make it position independent. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 100 +++ 1 file changed, 55 insertions(+), 45

[PATCH v3 7/7] powerpc/64/irq: tidy soft-masked irq replay and improve documentation

2022-09-25 Thread Nicholas Piggin
irq replay is quite complicated because of softirq processing which itself enables and disables irqs. Several considerations need to be accounted for due to this, and they are not clearly documented. Refactor the irq replay code a bit to tidy and deduplicate some common functions. Add comments,

[PATCH v3 6/7] powerpc/64/interrupt: avoid BUG/WARN recursion in interrupt entry

2022-09-25 Thread Nicholas Piggin
BUG/WARN are handled with a program interrupt which can turn into an infinite recursion when there are bugs in interrupt handler entry (which can be irritated by bugs in other parts of the code). There is one feeble attempt to avoid this recursion, but it misses several cases. Make a tidier macro

[PATCH v2 3/5] powerpc/64: avoid using r13 in relocate

2022-09-25 Thread Nicholas Piggin
relocate() uses r13 in early boot before it is used for the paca. Use a different register for this so r13 is kept unchanged until it is set to the paca pointer. Avoid r14 as well while we're here, there's no reason not to use the volatile registers which is a bit less surprising, and r14 could

[PATCH v2 4/5] powerpc/64: don't set boot CPU's r13 to paca until the structure is set up

2022-09-25 Thread Nicholas Piggin
The idea is to get to the point where if r13 is non-zero, then it should contain a reasonable paca. This can be used in early boot program check and machine check handlers to avoid running off into the weeds if they hit before r13 has a paca. Signed-off-by: Nicholas Piggin ---

RE: [EXT] Re: [PATCH v2 1/7] ASoC: dt-bindings: fsl_rpmsg: Add a property to assign the rpmsg channel

2022-09-25 Thread Chancel Liu
> >>> Add a string property to assign the rpmsg channel this sound card sits > >>> on. It also represents the name of ASoC platform driver. This property > >>> can be omitted if there is only one sound card and it sits on > >>> "rpmsg-audio-channel". > >>> > >>> Signed-off-by: Chancel Liu > >>>