Re: [RFC 02/10] x86/kvm: Add IBPB support

2018-01-22 Thread Jim Mattson
Oh, but to do that properly, you need one of the per-vCPU bitmap implementations that Paolo and I have independently posted. On Mon, Jan 22, 2018 at 10:56 AM, Jim Mattson wrote: > On Sat, Jan 20, 2018 at 11:22 AM, KarimAllah Ahmed wrote: >> From: Ashok Raj >> >> Add MSR passthrough for MSR_IA32

Re: [RFC 02/10] x86/kvm: Add IBPB support

2018-01-22 Thread Jim Mattson
On Sat, Jan 20, 2018 at 11:22 AM, KarimAllah Ahmed wrote: > From: Ashok Raj > > Add MSR passthrough for MSR_IA32_PRED_CMD and place branch predictor > barriers on switching between VMs to avoid inter VM specte-v2 attacks. > > [peterz: rebase and changelog rewrite] > [dwmw2: fixes] > [karahmed: -

Re: [RFC 02/10] x86/kvm: Add IBPB support

2018-01-20 Thread Woodhouse, David
On Sat, 2018-01-20 at 12:28 -0800, Liran Alon wrote: > Isn't it cleaner to check for "boot_cpu_has(X86_FEATURE_IBPB)" both > in svm_vcpu_init_msrpm() and hardware_setup()? Strictly speaking that's a different check. That's checking if we're *using* IBPB, not if it exists. Now that's probably OK h

Re: [RFC 02/10] x86/kvm: Add IBPB support

2018-01-20 Thread Liran Alon
- karah...@amazon.de wrote: > From: Ashok Raj > > Add MSR passthrough for MSR_IA32_PRED_CMD and place branch predictor > barriers on switching between VMs to avoid inter VM specte-v2 > attacks. > > [peterz: rebase and changelog rewrite] > [dwmw2: fixes] > [karahmed: - vmx: expose PRED_CMD

Re: [RFC 02/10] x86/kvm: Add IBPB support

2018-01-20 Thread Woodhouse, David
On Sat, 2018-01-20 at 20:22 +0100, KarimAllah Ahmed wrote: > > @@ -6791,6 +6792,9 @@ static __init int hardware_setup(void) > kvm_tsc_scaling_ratio_frac_bits = 48; > } >   > +   if (boot_cpu_has(X86_FEATURE_SPEC_CTRL)) > +   vmx_disable_intercept_for_msr(MSR

[RFC 02/10] x86/kvm: Add IBPB support

2018-01-20 Thread KarimAllah Ahmed
From: Ashok Raj Add MSR passthrough for MSR_IA32_PRED_CMD and place branch predictor barriers on switching between VMs to avoid inter VM specte-v2 attacks. [peterz: rebase and changelog rewrite] [dwmw2: fixes] [karahmed: - vmx: expose PRED_CMD whenever it is available - svm: only pass