Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-07-04 Thread Arvind Sankar
On Fri, Jul 03, 2020 at 09:48:14PM +, Andersen, John wrote: > > > Is there a plan for fixing this for real? I'm wondering if there is a > > > sane weakening of this feature that still allows things like kexec. > > > > > > > I'm pretty sure kexec can be fixed. I had it working at one point,

Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-07-03 Thread Andersen, John
> > Is there a plan for fixing this for real? I'm wondering if there is a > > sane weakening of this feature that still allows things like kexec. > > > > I'm pretty sure kexec can be fixed. I had it working at one point, I'm > currently in the process of revalidating this. The issue was though

Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-06-23 Thread Andersen, John
On Fri, Jun 19, 2020 at 10:13:25PM -0700, Andy Lutomirski wrote: > On Wed, Jun 17, 2020 at 12:05 PM John Andersen > wrote: > > Guests using the kexec system call currently do not support > > paravirtualized control register pinning. This is due to early boot > > code writing known good values to

Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-06-19 Thread Andy Lutomirski
On Wed, Jun 17, 2020 at 12:05 PM John Andersen wrote: > Guests using the kexec system call currently do not support > paravirtualized control register pinning. This is due to early boot > code writing known good values to control registers, these values do > not contain the protected bits. This

Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-06-18 Thread Andersen, John
On Thu, Jun 18, 2020 at 08:38:06AM -0700, Dave Hansen wrote: > On 6/18/20 8:26 AM, Andersen, John wrote: > > On Thu, Jun 18, 2020 at 07:41:04AM -0700, Dave Hansen wrote: > >>> +config PARAVIRT_CR_PIN > >>> + bool "Paravirtual bit pinning for CR0 and CR4" > >>> + depends on KVM_GUEST >

Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-06-18 Thread Dave Hansen
On 6/18/20 8:26 AM, Andersen, John wrote: > On Thu, Jun 18, 2020 at 07:41:04AM -0700, Dave Hansen wrote: >> Let's say kexec is config'd off. This feature is enabled by default and >> crashes the kernel in early boot. I have no way to disable this fancy >> new feature. Is that what we want? >>

Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-06-18 Thread Andersen, John
On Thu, Jun 18, 2020 at 07:41:04AM -0700, Dave Hansen wrote: > On 6/17/20 12:07 PM, John Andersen wrote: > > diff --git a/Documentation/admin-guide/kernel-parameters.txt > > b/Documentation/admin-guide/kernel-parameters.txt > > index 89386f6f3ab6..54fb2b5ab8fc 100644 > > ---

Re: [PATCH 4/4] X86: Use KVM CR pin MSRs

2020-06-18 Thread Dave Hansen
On 6/17/20 12:07 PM, John Andersen wrote: > diff --git a/Documentation/admin-guide/kernel-parameters.txt > b/Documentation/admin-guide/kernel-parameters.txt > index 89386f6f3ab6..54fb2b5ab8fc 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++

[PATCH 4/4] X86: Use KVM CR pin MSRs

2020-06-17 Thread John Andersen
Strengthen existing control register pinning when running paravirtualized under KVM. Check which bits KVM supports pinning for each control register and only pin supported bits which are already pinned via the existing native protection. Write to KVM CR0/4 pinned MSRs to enable pinning. Initiate