]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: PPC: add pvinfo for hcall opcodes on e500mc/e5500
authorStuart Yoder <stuart.yoder@freescale.com>
Tue, 3 Jul 2012 05:48:51 +0000 (05:48 +0000)
committerAlexander Graf <agraf@suse.de>
Tue, 14 Aug 2012 22:28:52 +0000 (00:28 +0200)
Signed-off-by: Liu Yu <yu.liu@freescale.com>
[stuart: factored this out from idle hcall support in host patch]
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/powerpc.c

index 62165cc2f326dd826c5b3bcd1536cda9683291a9..4ff2f2714973dea7da055c2fa8dc34d2b1a58719 100644 (file)
@@ -747,9 +747,16 @@ int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
 
 static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo)
 {
+       u32 inst_nop = 0x60000000;
+#ifdef CONFIG_KVM_BOOKE_HV
+       u32 inst_sc1 = 0x44000022;
+       pvinfo->hcall[0] = inst_sc1;
+       pvinfo->hcall[1] = inst_nop;
+       pvinfo->hcall[2] = inst_nop;
+       pvinfo->hcall[3] = inst_nop;
+#else
        u32 inst_lis = 0x3c000000;
        u32 inst_ori = 0x60000000;
-       u32 inst_nop = 0x60000000;
        u32 inst_sc = 0x44000002;
        u32 inst_imm_mask = 0xffff;
 
@@ -766,6 +773,7 @@ static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo)
        pvinfo->hcall[1] = inst_ori | (KVM_SC_MAGIC_R0 & inst_imm_mask);
        pvinfo->hcall[2] = inst_sc;
        pvinfo->hcall[3] = inst_nop;
+#endif
 
        return 0;
 }