On Thu, Feb 1, 2018 at 1:59 PM, KarimAllah Ahmed <karah...@amazon.de> wrote: > [ Based on a patch from Ashok Raj <ashok....@intel.com> ] > > Add direct access to MSR_IA32_SPEC_CTRL for guests. This is needed for > guests that will only mitigate Spectre V2 through IBRS+IBPB and will not > be using a retpoline+IBPB based approach. > > To avoid the overhead of saving and restoring the MSR_IA32_SPEC_CTRL for > guests that do not actually use the MSR, only start saving and restoring > when a non-zero is written to it. > > No attempt is made to handle STIBP here, intentionally. Filtering STIBP > may be added in a future patch, which may require trapping all writes > if we don't want to pass it through directly to the guest. > > [dwmw2: Clean up CPUID bits, save/restore manually, handle reset] > > Cc: Asit Mallick <asit.k.mall...@intel.com> > Cc: Arjan Van De Ven <arjan.van.de....@intel.com> > Cc: Dave Hansen <dave.han...@intel.com> > Cc: Andi Kleen <a...@linux.intel.com> > Cc: Andrea Arcangeli <aarca...@redhat.com> > Cc: Linus Torvalds <torva...@linux-foundation.org> > Cc: Tim Chen <tim.c.c...@linux.intel.com> > Cc: Thomas Gleixner <t...@linutronix.de> > Cc: Dan Williams <dan.j.willi...@intel.com> > Cc: Jun Nakajima <jun.nakaj...@intel.com> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: David Woodhouse <d...@amazon.co.uk> > Cc: Greg KH <gre...@linuxfoundation.org> > Cc: Andy Lutomirski <l...@kernel.org> > Cc: Ashok Raj <ashok....@intel.com> > Signed-off-by: KarimAllah Ahmed <karah...@amazon.de> > Signed-off-by: David Woodhouse <d...@amazon.co.uk>
Reviewed-by: Jim Mattson <jmatt...@google.com>