Skip to content

Commit 4e5acdc

Browse files
committed
KVM: PPC: Book3S HV: Don't use ASDR for real-mode HPT faults on POWER9
In HPT mode on POWER9, the ASDR register is supposed to record segment information for hypervisor page faults. It turns out that POWER9 DD1 does not record the page size information in the ASDR for faults in guest real mode. We have the necessary information in memory already, so by moving the checks for real mode that already existed, we can use the in-memory copy. Since a load is likely to be faster than reading an SPR, we do this unconditionally (not just for POWER9 DD1). Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
1 parent 70cd4c1 commit 4e5acdc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/powerpc/kvm/book3s_hv_rmhandlers.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,12 +1787,12 @@ kvmppc_hdsi:
17871787
/* HPTE not found fault or protection fault? */
17881788
andis. r0, r6, (DSISR_NOHPTE | DSISR_PROTFAULT)@h
17891789
beq 1f /* if not, send it to the guest */
1790+
andi. r0, r11, MSR_DR /* data relocation enabled? */
1791+
beq 3f
17901792
BEGIN_FTR_SECTION
17911793
mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */
17921794
b 4f
17931795
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
1794-
andi. r0, r11, MSR_DR /* data relocation enabled? */
1795-
beq 3f
17961796
clrrdi r0, r4, 28
17971797
PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */
17981798
li r0, BOOK3S_INTERRUPT_DATA_SEGMENT
@@ -1879,12 +1879,12 @@ kvmppc_hisi:
18791879
bne .Lradix_hisi /* for radix, just save ASDR */
18801880
andis. r0, r11, SRR1_ISI_NOPT@h
18811881
beq 1f
1882+
andi. r0, r11, MSR_IR /* instruction relocation enabled? */
1883+
beq 3f
18821884
BEGIN_FTR_SECTION
18831885
mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */
18841886
b 4f
18851887
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
1886-
andi. r0, r11, MSR_IR /* instruction relocation enabled? */
1887-
beq 3f
18881888
clrrdi r0, r10, 28
18891889
PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */
18901890
li r0, BOOK3S_INTERRUPT_INST_SEGMENT

0 commit comments

Comments
 (0)