Skip to content

Commit 8bf8f2e

Browse files
npigginmpe
authored andcommitted
powerpc/64s: Revert setting of LPCR[LPES] on POWER9
The XIVE enablement patches included a change to set the LPES (Logical Partitioning Environment Selector) bit (bit # 3) in LPCR (Logical Partitioning Control Register) on POWER9 hosts. This bit sets external interrupts to guest delivery mode, which uses SRR0/1. The host's EE interrupt handler is written to expect HSRR0/1 (for earlier CPUs). This should be fine because XIVE is configured not to deliver EEs to the host (Hypervisor Virtulization Interrupt is used instead) so the EE handler should never be executed. However a bug in interrupt controller code, hardware, or odd configuration of a simulator could result in the host getting an EE incorrectly. Keeping the EE delivery mode matching the host EE handler prevents strange crashes due to using the wrong exception registers. KVM will configure the LPCR to set LPES prior to running a guest so that EEs are delivered to the guest using SRR0/1. Fixes: 08a1e65 ("powerpc: Fixup LPCR:PECE and HEIC setting on POWER9") Signed-off-by: Nicholas Piggin <[email protected]> [mpe: Massage change log to avoid referring to LPES0 which is now renamed LPES] Signed-off-by: Michael Ellerman <[email protected]>
1 parent 08a1e65 commit 8bf8f2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/kernel/cpu_setup_power.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ _GLOBAL(__setup_cpu_power9)
107107
or r3, r3, r4
108108
LOAD_REG_IMMEDIATE(r4, LPCR_UPRT | LPCR_HR)
109109
andc r3, r3, r4
110-
li r4,(LPCR_LPES0 >> LPCR_LPES_SH)
110+
li r4,0 /* LPES = 0 */
111111
bl __init_LPCR
112112
bl __init_HFSCR
113113
bl __init_tlb_power9
@@ -131,7 +131,7 @@ _GLOBAL(__restore_cpu_power9)
131131
or r3, r3, r4
132132
LOAD_REG_IMMEDIATE(r4, LPCR_UPRT | LPCR_HR)
133133
andc r3, r3, r4
134-
li r4,(LPCR_LPES0 >> LPCR_LPES_SH)
134+
li r4,0 /* LPES = 0 */
135135
bl __init_LPCR
136136
bl __init_HFSCR
137137
bl __init_tlb_power9

0 commit comments

Comments
 (0)