Skip to contentSkip to conversation

KVM: PPC: Book3S HV: Remove vcpu->arch.dec usage

PATCH Applied Alexander Graf 2 participants 2 messages Dec 19, 2017 – Jan 11, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: Book3S HV: Remove vcpu->arch.dec usage

On Book3S in HV mode, we don't use the vcpu->arch.dec field at all. Instead, all logic is built around vcpu->arch.dec_expires.

So let's remove the one remaining piece of code that was setting it.

---

Looking through the DEC logic, I fail to see any code that allows save or restore of DEC. Do we maybe miss out on that register for (live) migration?

---
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kvm/book3s_hv_rmhandlers.S +0 -1
index 2659844784b8..c8ffd69adfec 100644
@@ -957,7 +957,6 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_300)
 	mftb	r7
 	subf	r3,r7,r8
 	mtspr	SPRN_DEC,r3
-	std	r3,VCPU_DEC(r4)
 
 	ld	r5, VCPU_SPRG0(r4)
 	ld	r6, VCPU_SPRG1(r4)
Signature · 1 line
2.12.3
#1 lore raw
Quoted 6 lines · Alexander Graf

On Book3S in HV mode, we don't use the vcpu->arch.dec field at all. Instead, all logic is built around vcpu->arch.dec_expires.

So let's remove the one remaining piece of code that was setting it.

Thanks, applied to my kvm-ppc-next branch.

Quoted 3 lines

Looking through the DEC logic, I fail to see any code that allows save or restore of DEC. Do we maybe miss out on that register for (live) migration?

Yes, it looks like we do. I'm amazed no-one has noticed before. I'll fix it.

Paul.