Skip to content

Commit ef8c640

Browse files
paulusmackmpe
authored andcommitted
KVM: PPC: Book3S HV: Use ASDR for HPT guests on POWER9
POWER9 adds a register called ASDR (Access Segment Descriptor Register), which is set by hypervisor data/instruction storage interrupts to contain the segment descriptor for the address being accessed, assuming the guest is using HPT translation. (For radix guests, it contains the guest real address of the access.) Thus, for HPT guests on POWER9, we can use this register rather than looking up the SLB with the slbfee. instruction. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 468808b commit ef8c640

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/powerpc/kvm/book3s_hv_rmhandlers.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,10 @@ kvmppc_hdsi:
17151715
/* HPTE not found fault or protection fault? */
17161716
andis. r0, r6, (DSISR_NOHPTE | DSISR_PROTFAULT)@h
17171717
beq 1f /* if not, send it to the guest */
1718+
BEGIN_FTR_SECTION
1719+
mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */
1720+
b 4f
1721+
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
17181722
andi. r0, r11, MSR_DR /* data relocation enabled? */
17191723
beq 3f
17201724
clrrdi r0, r4, 28
@@ -1791,6 +1795,10 @@ fast_interrupt_c_return:
17911795
kvmppc_hisi:
17921796
andis. r0, r11, SRR1_ISI_NOPT@h
17931797
beq 1f
1798+
BEGIN_FTR_SECTION
1799+
mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */
1800+
b 4f
1801+
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
17941802
andi. r0, r11, MSR_IR /* instruction relocation enabled? */
17951803
beq 3f
17961804
clrrdi r0, r10, 28

0 commit comments

Comments
 (0)