Skip to content

Commit 4907cdc

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull another kvm fix from Paolo Bonzini: "A fix for a PowerPC bug that was introduced during the 3.14 merge window" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: PPC: Book3S HV: Fix register usage when loading/saving VRSAVE KVM: PPC: Book3S HV: Remove bogus duplicate code
2 parents 9a15c94 + e724f08 commit 4907cdc

File tree

1 file changed

+2
-69
lines changed

1 file changed

+2
-69
lines changed

arch/powerpc/kvm/book3s_hv_rmhandlers.S

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,73 +1504,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
15041504
1: addi r8,r8,16
15051505
.endr
15061506

1507-
/* Save DEC */
1508-
mfspr r5,SPRN_DEC
1509-
mftb r6
1510-
extsw r5,r5
1511-
add r5,r5,r6
1512-
std r5,VCPU_DEC_EXPIRES(r9)
1513-
1514-
BEGIN_FTR_SECTION
1515-
b 8f
1516-
END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
1517-
/* Turn on TM so we can access TFHAR/TFIAR/TEXASR */
1518-
mfmsr r8
1519-
li r0, 1
1520-
rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG
1521-
mtmsrd r8
1522-
1523-
/* Save POWER8-specific registers */
1524-
mfspr r5, SPRN_IAMR
1525-
mfspr r6, SPRN_PSPB
1526-
mfspr r7, SPRN_FSCR
1527-
std r5, VCPU_IAMR(r9)
1528-
stw r6, VCPU_PSPB(r9)
1529-
std r7, VCPU_FSCR(r9)
1530-
mfspr r5, SPRN_IC
1531-
mfspr r6, SPRN_VTB
1532-
mfspr r7, SPRN_TAR
1533-
std r5, VCPU_IC(r9)
1534-
std r6, VCPU_VTB(r9)
1535-
std r7, VCPU_TAR(r9)
1536-
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1537-
mfspr r5, SPRN_TFHAR
1538-
mfspr r6, SPRN_TFIAR
1539-
mfspr r7, SPRN_TEXASR
1540-
std r5, VCPU_TFHAR(r9)
1541-
std r6, VCPU_TFIAR(r9)
1542-
std r7, VCPU_TEXASR(r9)
1543-
#endif
1544-
mfspr r8, SPRN_EBBHR
1545-
std r8, VCPU_EBBHR(r9)
1546-
mfspr r5, SPRN_EBBRR
1547-
mfspr r6, SPRN_BESCR
1548-
mfspr r7, SPRN_CSIGR
1549-
mfspr r8, SPRN_TACR
1550-
std r5, VCPU_EBBRR(r9)
1551-
std r6, VCPU_BESCR(r9)
1552-
std r7, VCPU_CSIGR(r9)
1553-
std r8, VCPU_TACR(r9)
1554-
mfspr r5, SPRN_TCSCR
1555-
mfspr r6, SPRN_ACOP
1556-
mfspr r7, SPRN_PID
1557-
mfspr r8, SPRN_WORT
1558-
std r5, VCPU_TCSCR(r9)
1559-
std r6, VCPU_ACOP(r9)
1560-
stw r7, VCPU_GUEST_PID(r9)
1561-
std r8, VCPU_WORT(r9)
1562-
8:
1563-
1564-
/* Save and reset AMR and UAMOR before turning on the MMU */
1565-
BEGIN_FTR_SECTION
1566-
mfspr r5,SPRN_AMR
1567-
mfspr r6,SPRN_UAMOR
1568-
std r5,VCPU_AMR(r9)
1569-
std r6,VCPU_UAMOR(r9)
1570-
li r6,0
1571-
mtspr SPRN_AMR,r6
1572-
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)
1573-
15741507
/* Unset guest mode */
15751508
li r0, KVM_GUEST_MODE_NONE
15761509
stb r0, HSTATE_IN_GUEST(r13)
@@ -2203,7 +2136,7 @@ BEGIN_FTR_SECTION
22032136
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
22042137
#endif
22052138
mfspr r6,SPRN_VRSAVE
2206-
stw r6,VCPU_VRSAVE(r3)
2139+
stw r6,VCPU_VRSAVE(r31)
22072140
mtlr r30
22082141
mtmsrd r5
22092142
isync
@@ -2240,7 +2173,7 @@ BEGIN_FTR_SECTION
22402173
bl .load_vr_state
22412174
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
22422175
#endif
2243-
lwz r7,VCPU_VRSAVE(r4)
2176+
lwz r7,VCPU_VRSAVE(r31)
22442177
mtspr SPRN_VRSAVE,r7
22452178
mtlr r30
22462179
mr r4,r31

0 commit comments

Comments
 (0)