Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Sean Christopherson
On Tue, Jul 07, 2020 at 02:35:59PM +0300, Maxim Levitsky wrote: > On Tue, 2020-07-07 at 01:14 -0700, Sean Christopherson wrote: > > Aren't you supposed to be on vacation? :-) > > > > On Tue, Jul 07, 2020 at 10:04:22AM +0200, Paolo Bonzini wrote: > > > On 07/07/20 08:11, Sean Christopherson wrote:

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Paolo Bonzini
On 07/07/20 13:30, Maxim Levitsky wrote: >> Somehwat crazy idea inbound... rather than calculating the valid bits in >> software, what if we throw the value at the CPU and see if it fails? At >> least that way the host and guest are subject to the same rules. E.g. >> >> --- a/arch/x86/kvm/vmx/vmx

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Paolo Bonzini
On 07/07/20 13:35, Maxim Levitsky wrote: > After thinking about this, I am thinking that we should apply similiar logic > as done with the 'cpu-pm' related features. > This way the user can choose between passing through the IA32_SPEC_CTRL, > (and in this case, we can since the user choose it, pass

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Maxim Levitsky
On Tue, 2020-07-07 at 01:14 -0700, Sean Christopherson wrote: > Aren't you supposed to be on vacation? :-) > > On Tue, Jul 07, 2020 at 10:04:22AM +0200, Paolo Bonzini wrote: > > On 07/07/20 08:11, Sean Christopherson wrote: > > > One oddity with this whole thing is that by passing through the MSR,

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Maxim Levitsky
On Mon, 2020-07-06 at 23:11 -0700, Sean Christopherson wrote: > On Sun, Jul 05, 2020 at 12:40:25PM +0300, Maxim Levitsky wrote: > > > Rather than compute the mask every time, it can be computed once on module > > > load and stashed in a global. Note, there's a RFC series[*] to support > > > reprob

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Wanpeng Li
On Tue, 7 Jul 2020 at 16:15, Sean Christopherson wrote: > > Aren't you supposed to be on vacation? :-) A long vacation, enjoy! > > On Tue, Jul 07, 2020 at 10:04:22AM +0200, Paolo Bonzini wrote: > > On 07/07/20 08:11, Sean Christopherson wrote: > > > One oddity with this whole thing is that by pa

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Sean Christopherson
On Tue, Jul 07, 2020 at 10:17:14AM +0200, Paolo Bonzini wrote: > On 07/07/20 10:14, Sean Christopherson wrote: > >>> One oddity with this whole thing is that by passing through the MSR, KVM > >>> is > >>> allowing the guest to write bits it doesn't know about, which is > >>> definitely > >>> not

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Paolo Bonzini
On 07/07/20 10:14, Sean Christopherson wrote: >>> One oddity with this whole thing is that by passing through the MSR, KVM is >>> allowing the guest to write bits it doesn't know about, which is definitely >>> not normal. It also means the guest could write bits that the host VMM >>> can't. >> Tha

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Sean Christopherson
Aren't you supposed to be on vacation? :-) On Tue, Jul 07, 2020 at 10:04:22AM +0200, Paolo Bonzini wrote: > On 07/07/20 08:11, Sean Christopherson wrote: > > One oddity with this whole thing is that by passing through the MSR, KVM is > > allowing the guest to write bits it doesn't know about, whic

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-07 Thread Paolo Bonzini
On 07/07/20 08:11, Sean Christopherson wrote: > One oddity with this whole thing is that by passing through the MSR, KVM is > allowing the guest to write bits it doesn't know about, which is definitely > not normal. It also means the guest could write bits that the host VMM > can't. That's true.

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-06 Thread Sean Christopherson
On Sun, Jul 05, 2020 at 12:40:25PM +0300, Maxim Levitsky wrote: > > Rather than compute the mask every time, it can be computed once on module > > load and stashed in a global. Note, there's a RFC series[*] to support > > reprobing bugs at runtime, but that has bigger issues with existing KVM > >

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-05 Thread Maxim Levitsky
On Thu, 2020-07-02 at 11:16 -0700, Sean Christopherson wrote: > On Thu, Jul 02, 2020 at 08:44:55PM +0300, Maxim Levitsky wrote: > > There are few cases when this function was creating a bogus #GP condition, > > for example case when and AMD host supports STIBP but doesn't support SSBD. > > > > Fol

Re: [PATCH] kvm: x86: rewrite kvm_spec_ctrl_valid_bits

2020-07-02 Thread Sean Christopherson
On Thu, Jul 02, 2020 at 08:44:55PM +0300, Maxim Levitsky wrote: > There are few cases when this function was creating a bogus #GP condition, > for example case when and AMD host supports STIBP but doesn't support SSBD. > > Follow the rules for AMD and Intel strictly instead. Can you elaborate on