KVM: PPC E500: Add register l1csr0 emulation
authorLiu Yu <yu.liu@freescale.com>
Fri, 22 Jan 2010 10:50:29 +0000 (18:50 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:05 +0000 (12:36 -0300)
Latest kernel start to access l1csr0 to contron L1.
We just tell guest no operation is on going.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/powerpc/include/asm/kvm_e500.h
arch/powerpc/kvm/e500_emulate.c

index 9d497ce497267fa8958add05cfa0aa5d211af903..569dfd31ee79d2d0bea7cc0be9c6519e65330d14 100644 (file)
@@ -52,6 +52,7 @@ struct kvmppc_vcpu_e500 {
        u32 mas5;
        u32 mas6;
        u32 mas7;
+       u32 l1csr0;
        u32 l1csr1;
        u32 hid0;
        u32 hid1;
index 7644f7a9bac3a3207c9dde0118ad5b715540cfa1..95f8ec8fdc71a14a35046f1a5d6b8b9d54b28b96 100644 (file)
@@ -99,6 +99,10 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
                vcpu_e500->mas6 = spr_val; break;
        case SPRN_MAS7:
                vcpu_e500->mas7 = spr_val; break;
+       case SPRN_L1CSR0:
+               vcpu_e500->l1csr0 = spr_val;
+               vcpu_e500->l1csr0 &= ~(L1CSR0_DCFI | L1CSR0_CLFC);
+               break;
        case SPRN_L1CSR1:
                vcpu_e500->l1csr1 = spr_val; break;
        case SPRN_HID0:
@@ -179,6 +183,8 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
                break;
        }
 
+       case SPRN_L1CSR0:
+               kvmppc_set_gpr(vcpu, rt, vcpu_e500->l1csr0); break;
        case SPRN_L1CSR1:
                kvmppc_set_gpr(vcpu, rt, vcpu_e500->l1csr1); break;
        case SPRN_HID0: