Skip to contentSkip to conversation

kvm/e500: Add MMUCFG and PVR emulation

PATCH In review Liu Yu 1 participant 1 message Jun 5, 2009

Subsystems (2)
lore
Share & tools
lore

Liu Yu

author
#0 lore raw

PATCH 3/3 kvm/e500: Add MMUCFG and PVR emulation

Latest kernel start to use these two register.

---
 arch/powerpc/kvm/e500_emulate.c |    3 +++
 arch/powerpc/kvm/emulate.c      |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
arch/powerpc/kvm/e500_emulate.c +3 -0
index 3f76041..be95b8d 100644
@@ -180,6 +180,9 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
 	case SPRN_MMUCSR0:
 		vcpu->arch.gpr[rt] = 0; break;
 
+	case SPRN_MMUCFG:
+		vcpu->arch.gpr[rt] = mfspr(SPRN_MMUCFG); break;
+
 	/* extra exceptions */
 	case SPRN_IVOR32:
 		vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL];
arch/powerpc/kvm/emulate.c +2 -0
index f8b8248..28a8237 100644
@@ -188,6 +188,8 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
 				vcpu->arch.gpr[rt] = vcpu->arch.srr1; break;
 			case SPRN_PVR:
 				vcpu->arch.gpr[rt] = mfspr(SPRN_PVR); break;
+			case SPRN_PIR:
+				vcpu->arch.gpr[rt] = mfspr(SPRN_PIR); break;
 
 			/* Note: mftb and TBRL/TBWL are user-accessible, so
 			 * the guest can always access the real TB anyways.
Signature · 1 line
1.5.4