KVM: PPC: Assorted 440 fixes
Subsystems (3)
cover KVM: PPC: Assorted 440 fixes
With these patches, I get at least shortly into a KVM guest on 440. It fails for me later on, but I'm quite sure that's an orthogonal issue.
Alexander Graf (2):
KVM: PPC: 44x: Initialize PVR
KVM: PPC: BookE: Add MCSR SPR support
arch/powerpc/kvm/44x.c | 1 + arch/powerpc/kvm/booke_emulate.c | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-)
PATCH 1/2 KVM: PPC: 44x: Initialize PVR
We need to make sure that vcpu->arch.pvr is initialized to a sane value, so let's just take the host PVR.
Signed-off-by Alexander Graf <[email protected]>
--- arch/powerpc/kvm/44x.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/kvm/44x.c +1 -0
@@ -83,6 +83,7 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu) vcpu_44x->shadow_refs[i].gtlb_index =-1 ; vcpu->arch.cpu_type =KVM_CPU_440 ; + vcpu->arch.pvr =mfspr (SPRN_PVR );return 0 ; }
Signature · 1 line
1.6.0.2
PATCH 2/2 KVM: PPC: BookE: Add MCSR SPR support
In reply to Alexander GrafAdd support for the MCSR SPR. This only implements the SPR storage bits, not actual machine checks.
Signed-off-by Alexander Graf <[email protected]>
--- arch/powerpc/kvm/booke_emulate.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/powerpc/kvm/booke_emulate.c +6 -0
@@ -237,6 +237,9 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)case SPRN_IVOR15 : vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG ] = spr_val;break ; +case SPRN_MCSR : + vcpu->arch.mcsr &= ~spr_val; +break ;default : emulated =EMULATE_FAIL ;
@@ -329,6 +332,9 @@ int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val)case SPRN_IVOR15 : *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG ];break ; +case SPRN_MCSR : + *spr_val = vcpu->arch.mcsr; +break ;default : emulated =EMULATE_FAIL ;
Signature · 1 line
1.6.0.2