summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/kvm_cache_regs.h
diff options
context:
space:
mode:
authorDexuan Cui <dexuan.cui@intel.com>2010-06-10 11:27:12 +0800
committerAvi Kivity <avi@redhat.com>2010-08-01 10:46:31 +0300
commit2acf923e38fb6a4ce0c57115decbb38d334902ac (patch)
tree51a0fba243c857a3bc373ab152c6374c804df224 /arch/x86/kvm/kvm_cache_regs.h
parentf495c6e5e8fdc972162241df5bdff5bcebb4dc33 (diff)
downloadop-kernel-dev-2acf923e38fb6a4ce0c57115decbb38d334902ac.zip
op-kernel-dev-2acf923e38fb6a4ce0c57115decbb38d334902ac.tar.gz
KVM: VMX: Enable XSAVE/XRSTOR for guest
This patch enable guest to use XSAVE/XRSTOR instructions. We assume that host_xcr0 would use all possible bits that OS supported. And we loaded xcr0 in the same way we handled fpu - do it as late as we can. Signed-off-by: Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/kvm_cache_regs.h')
-rw-r--r--arch/x86/kvm/kvm_cache_regs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/kvm_cache_regs.h b/arch/x86/kvm/kvm_cache_regs.h
index d2a98f8..6491ac8 100644
--- a/arch/x86/kvm/kvm_cache_regs.h
+++ b/arch/x86/kvm/kvm_cache_regs.h
@@ -71,4 +71,10 @@ static inline ulong kvm_read_cr4(struct kvm_vcpu *vcpu)
return kvm_read_cr4_bits(vcpu, ~0UL);
}
+static inline u64 kvm_read_edx_eax(struct kvm_vcpu *vcpu)
+{
+ return (kvm_register_read(vcpu, VCPU_REGS_RAX) & -1u)
+ | ((u64)(kvm_register_read(vcpu, VCPU_REGS_RDX) & -1u) << 32);
+}
+
#endif
OpenPOWER on IntegriCloud