Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread Paolo Bonzini
On 31/01/2018 12:39, Jim Mattson wrote: > On Wed, Jan 31, 2018 at 8:55 AM, Paolo Bonzini wrote: > >> In fact this MSR can even be passed down unconditionally, since it needs >> no save/restore and has no ill performance effect on the sibling >> hyperthread. > > I'm a bit surprised to hear that I

RE: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread Van De Ven, Arjan
> On Wed, Jan 31, 2018 at 8:55 AM, Paolo Bonzini wrote: > > > In fact this MSR can even be passed down unconditionally, since it needs > > no save/restore and has no ill performance effect on the sibling > > hyperthread. > > I'm a bit surprised to hear that IBPB has no ill performance impact on

Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread Jim Mattson
On Wed, Jan 31, 2018 at 8:55 AM, Paolo Bonzini wrote: > In fact this MSR can even be passed down unconditionally, since it needs > no save/restore and has no ill performance effect on the sibling > hyperthread. I'm a bit surprised to hear that IBPB has no ill performance impact on the sibling hy

Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread Paolo Bonzini
Looking at SVM now... On 31/01/2018 08:10, KarimAllah Ahmed wrote: > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index f40d0da..89495cf 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -529,6 +529,7 @@ struct svm_cpu_data { > struct kvm_ldttss_desc *tss_desc; >

Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread KarimAllah Ahmed
On 01/31/2018 05:55 PM, Paolo Bonzini wrote: On 31/01/2018 11:50, Jim Mattson wrote: + if (to_vmx(vcpu)->save_spec_ctrl_on_exit) { + nested_vmx_disable_intercept_for_msr( + msr_bitmap_l1, msr_bitmap_l0, + MSR_IA32_PR

Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread Paolo Bonzini
On 31/01/2018 12:11, KarimAllah Ahmed wrote: > On 01/31/2018 05:50 PM, Jim Mattson wrote: >> On Wed, Jan 31, 2018 at 5:10 AM, KarimAllah Ahmed >> wrote: >> >>> +   vmx_disable_intercept_for_msr(vmx->vmcs01.msr_bitmap, >>> MSR_IA32_PRED_CMD, >>> +

Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread KarimAllah Ahmed
On 01/31/2018 05:50 PM, Jim Mattson wrote: On Wed, Jan 31, 2018 at 5:10 AM, KarimAllah Ahmed wrote: + vmx_disable_intercept_for_msr(vmx->vmcs01.msr_bitmap, MSR_IA32_PRED_CMD, + MSR_TYPE_W); Why not disable this intercept eagerly, rat

Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread Paolo Bonzini
On 31/01/2018 11:50, Jim Mattson wrote: >> + if (to_vmx(vcpu)->save_spec_ctrl_on_exit) { >> + nested_vmx_disable_intercept_for_msr( >> + msr_bitmap_l1, msr_bitmap_l0, >> + MSR_IA32_PRED_CMD, >> +

Re: [PATCH v4 2/5] KVM: x86: Add IBPB support

2018-01-31 Thread Jim Mattson
On Wed, Jan 31, 2018 at 5:10 AM, KarimAllah Ahmed wrote: > + vmx_disable_intercept_for_msr(vmx->vmcs01.msr_bitmap, > MSR_IA32_PRED_CMD, > + MSR_TYPE_W); Why not disable this intercept eagerly, rather than lazily? Unlike MSR_IA32_SPEC_CTR