From: Avi Kivity <[EMAIL PROTECTED]>

KVM_SET_CPUID fails to remove NX when the host doesn't support it, as previous
versions do.  On the other hand, KVM_SET_CPUID2 removes the feature even
though, since we tell userspace about it, it shouldn't be necessary.

Swap the two cases.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index 4f46661..12f1d6f 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -768,6 +768,7 @@ static int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
                vcpu->cpuid_entries[i].padding[2] = 0;
        }
        vcpu->cpuid_nent = cpuid->nent;
+       cpuid_fix_nx_cap(vcpu);
        r = 0;
 
 out_free:
@@ -790,7 +791,6 @@ static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
                           cpuid->nent * sizeof(struct kvm_cpuid_entry2)))
                goto out;
        vcpu->cpuid_nent = cpuid->nent;
-       cpuid_fix_nx_cap(vcpu);
        return 0;
 
 out:

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to