aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-06-30 00:25:15 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:47:21 -0400
commitf5f48ee15c2ee3e44cf429e34b16c6fa9b900246 (patch)
tree75496197219d9aeedd3317fa007cc3b2e414c5da /arch/x86/kvm/svm.c
parentcf3e3d3e19868ca01da163200bbfc687523df0fc (diff)
KVM: VMX: Execute WBINVD to keep data consistency with assigned devices
Some guest device driver may leverage the "Non-Snoop" I/O, and explicitly WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or CLFLUSH, we need to maintain data consistency either by: 1: flushing cache (wbinvd) when the guest is scheduled out if there is no wbinvd exit, or 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 587b99d37d44..56c9b6bd7655 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3424,6 +3424,11 @@ static bool svm_rdtscp_supported(void)
3424 return false; 3424 return false;
3425} 3425}
3426 3426
3427static bool svm_has_wbinvd_exit(void)
3428{
3429 return true;
3430}
3431
3427static void svm_fpu_deactivate(struct kvm_vcpu *vcpu) 3432static void svm_fpu_deactivate(struct kvm_vcpu *vcpu)
3428{ 3433{
3429 struct vcpu_svm *svm = to_svm(vcpu); 3434 struct vcpu_svm *svm = to_svm(vcpu);
@@ -3508,6 +3513,8 @@ static struct kvm_x86_ops svm_x86_ops = {
3508 .rdtscp_supported = svm_rdtscp_supported, 3513 .rdtscp_supported = svm_rdtscp_supported,
3509 3514
3510 .set_supported_cpuid = svm_set_supported_cpuid, 3515 .set_supported_cpuid = svm_set_supported_cpuid,
3516
3517 .has_wbinvd_exit = svm_has_wbinvd_exit,
3511}; 3518};
3512 3519
3513static int __init svm_init(void) 3520static int __init svm_init(void)