Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-23 Thread Paolo Bonzini
Il 23/09/2013 17:09, Gleb Natapov ha scritto: > On Mon, Sep 23, 2013 at 12:22:37PM +0200, Paolo Bonzini wrote: @@ -6940,6 +6948,9 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) vcpu->arch.ia32_tsc_adjust_msr = 0x0; vcpu->arch.pv_time_enabled = false; + +

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-23 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 12:22:37PM +0200, Paolo Bonzini wrote: > >> @@ -6940,6 +6948,9 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) > >> > >>vcpu->arch.ia32_tsc_adjust_msr = 0x0; > >>vcpu->arch.pv_time_enabled = false; > >> + > >> + vcpu->arch.supported_xcr0 = XSTATE_FPSSE; > >> + >

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-23 Thread Paolo Bonzini
Il 22/09/2013 11:33, Gleb Natapov ha scritto: > On Mon, Sep 16, 2013 at 04:26:30PM +0200, Paolo Bonzini wrote: >> A guest can still attempt to save and restore XSAVE states even if they >> have been masked in CPUID leaf 0Dh. This usually is not visible to >> the guest, but is still wrong: "Any

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-23 Thread Paolo Bonzini
Il 22/09/2013 11:33, Gleb Natapov ha scritto: On Mon, Sep 16, 2013 at 04:26:30PM +0200, Paolo Bonzini wrote: A guest can still attempt to save and restore XSAVE states even if they have been masked in CPUID leaf 0Dh. This usually is not visible to the guest, but is still wrong: Any attempt to

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-23 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 12:22:37PM +0200, Paolo Bonzini wrote: @@ -6940,6 +6948,9 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) vcpu-arch.ia32_tsc_adjust_msr = 0x0; vcpu-arch.pv_time_enabled = false; + + vcpu-arch.supported_xcr0 = XSTATE_FPSSE; + Why is this needed? It

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-23 Thread Paolo Bonzini
Il 23/09/2013 17:09, Gleb Natapov ha scritto: On Mon, Sep 23, 2013 at 12:22:37PM +0200, Paolo Bonzini wrote: @@ -6940,6 +6948,9 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) vcpu-arch.ia32_tsc_adjust_msr = 0x0; vcpu-arch.pv_time_enabled = false; + + vcpu-arch.supported_xcr0 =

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-22 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 04:26:30PM +0200, Paolo Bonzini wrote: > A guest can still attempt to save and restore XSAVE states even if they > have been masked in CPUID leaf 0Dh. This usually is not visible to > the guest, but is still wrong: "Any attempt to set a reserved bit (as > determined by the

Re: [PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-22 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 04:26:30PM +0200, Paolo Bonzini wrote: A guest can still attempt to save and restore XSAVE states even if they have been masked in CPUID leaf 0Dh. This usually is not visible to the guest, but is still wrong: Any attempt to set a reserved bit (as determined by the

[PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-16 Thread Paolo Bonzini
A guest can still attempt to save and restore XSAVE states even if they have been masked in CPUID leaf 0Dh. This usually is not visible to the guest, but is still wrong: "Any attempt to set a reserved bit (as determined by the contents of EAX and EDX after executing CPUID with EAX=0DH, ECX= 0H)

[PATCH v2 2/3] KVM: x86: prevent setting unsupported XSAVE states

2013-09-16 Thread Paolo Bonzini
A guest can still attempt to save and restore XSAVE states even if they have been masked in CPUID leaf 0Dh. This usually is not visible to the guest, but is still wrong: Any attempt to set a reserved bit (as determined by the contents of EAX and EDX after executing CPUID with EAX=0DH, ECX= 0H) in