aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2017-02-27 19:05:47 -0500
committerPaul Mackerras <paulus@ozlabs.org>2017-02-28 19:54:10 -0500
commit4e5acdc23a3dcbd6ad6dc93a9783dd9c838987c8 (patch)
treea8f9058470d24185e98dc02df00f2e1f9d24d08a
parent70cd4c10b290dd77fff6dc702a9a2c8c679df121 (diff)
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>
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 47414a6fe2dd..7c6477d1840a 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -1787,12 +1787,12 @@ kvmppc_hdsi:
1787 /* HPTE not found fault or protection fault? */ 1787 /* HPTE not found fault or protection fault? */
1788 andis. r0, r6, (DSISR_NOHPTE | DSISR_PROTFAULT)@h 1788 andis. r0, r6, (DSISR_NOHPTE | DSISR_PROTFAULT)@h
1789 beq 1f /* if not, send it to the guest */ 1789 beq 1f /* if not, send it to the guest */
1790 andi. r0, r11, MSR_DR /* data relocation enabled? */
1791 beq 3f
1790BEGIN_FTR_SECTION 1792BEGIN_FTR_SECTION
1791 mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */ 1793 mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */
1792 b 4f 1794 b 4f
1793END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) 1795END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
1794 andi. r0, r11, MSR_DR /* data relocation enabled? */
1795 beq 3f
1796 clrrdi r0, r4, 28 1796 clrrdi r0, r4, 28
1797 PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */ 1797 PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */
1798 li r0, BOOK3S_INTERRUPT_DATA_SEGMENT 1798 li r0, BOOK3S_INTERRUPT_DATA_SEGMENT
@@ -1879,12 +1879,12 @@ kvmppc_hisi:
1879 bne .Lradix_hisi /* for radix, just save ASDR */ 1879 bne .Lradix_hisi /* for radix, just save ASDR */
1880 andis. r0, r11, SRR1_ISI_NOPT@h 1880 andis. r0, r11, SRR1_ISI_NOPT@h
1881 beq 1f 1881 beq 1f
1882 andi. r0, r11, MSR_IR /* instruction relocation enabled? */
1883 beq 3f
1882BEGIN_FTR_SECTION 1884BEGIN_FTR_SECTION
1883 mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */ 1885 mfspr r5, SPRN_ASDR /* on POWER9, use ASDR to get VSID */
1884 b 4f 1886 b 4f
1885END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) 1887END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
1886 andi. r0, r11, MSR_IR /* instruction relocation enabled? */
1887 beq 3f
1888 clrrdi r0, r10, 28 1888 clrrdi r0, r10, 28
1889 PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */ 1889 PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */
1890 li r0, BOOK3S_INTERRUPT_INST_SEGMENT 1890 li r0, BOOK3S_INTERRUPT_INST_SEGMENT