[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/msr: don't inject #GP when trying to read FEATURE_CONTROL


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 29 Dec 2020 17:47:20 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tNFZy/MIRSFikQTym8lclrghQytdhgD3kmzLxP9N5XY=; b=AbtbvwP3eoxoVk+RRIyR0hPmNNICeW1Aox9hszyADHLuKrTq8XODJYJ9doFGlQEFNdFXQ16X6p5MimiEdkSZkK4MaxAZTC+jArVDmTomQRQIeyyCCSHShk0IG69wffOtZoBLBhEcs8//KMHuonNA97JET9DZa+7Eh9n1WzxqZBQMeUcM1UAuXSS9g8QEbS+XjmfyhVv/j7Q0JX2x6W/X1l0wRUuglvjyZNAxICYwuxxbJGmxAVpT8q/zaj1IM6qdhWtf2SO2cFWXE3U1w6VZlFjL/30FNSROmckaPGPWraDlLrbHMJHXwz9CMZfghTj0Gm/AdOaOj3IdFXcjHJ69Hg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jKx/fxh7jbYGzSozAa7I9RDqSwtS11N0oF9r51Ya2BpQ3msyHBa+aPZqxdB7pfZLVdrutqiPbLVSn5SwWdATU+BQUmTwXRJezawG4kLWfkSxKtSfB/9OKAMsBHqqPTbTpk0FD5iTEvhHY+rxDWmCjZdZ8bMjPMRdq+XI84bVP3ZZx9jTrLx4zugLD7hFbBYCVqytL95M1HS4ZcxetGaqox8DbVJ7WDD8+T2XWI6Of+H3bLSAMU6FbtLKcHJydA60GXbA1IwScF1ita4sHoXJv+SNxwKUl9tSNcaNbD7ZE4r0JWMATfyf0Jx226qjzJdy/zOgq/Dr2ftKK+4fR35kRg==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 29 Dec 2020 16:48:06 +0000
  • Ironport-sdr: Yv5bDJI6PwMDzTphQAunHE+XhBy+6QntrPxz085G7jvmeZtMnLwycCv6EnK/W4aLOU6HAgvkjP 1N+8HDQujBcGJxTkewKgu1SeupIzDn8EajPeg6XtqVp7n1P/0WDcjkm4hxLd8Za6+xBUqD9gR/ 8WZVh+O6f0x3mpsFxiSHLRjM7fbcCUuVWft8/KZJMOYPU0ewd6N773Xqe9JnumKUxModvPh2qA 3zkSunproLdyDuym3tEB62tR1D4RK4rufTnMOq641WrDTuoUqBUSF249xCHjQ5DJG2HQCvYWte KUw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Nov 27, 2020 at 11:56:25AM +0100, Jan Beulich wrote:
> On 27.11.2020 11:46, Roger Pau Monne wrote:
> > Windows 10 will triple fault if #GP is injected when attempting to
> > read the FEATURE_CONTROL MSR on Intel or compatible hardware. Fix this
> > by injecting a #GP only when the vendor doesn't support the MSR, even
> > if there are no features to expose.
> > 
> > Fixes: 39ab598c50a2 ('x86/pv: allow reading FEATURE_CONTROL MSR')
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> In principle
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> However, iirc it was Andrew who had suggested the conditional you
> now replace, so I'd like to wait for him to voice a view.
> 
> > --- a/xen/arch/x86/msr.c
> > +++ b/xen/arch/x86/msr.c
> > @@ -176,7 +176,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t 
> > *val)
> >      switch ( msr )
> >      {
> >      case MSR_IA32_FEATURE_CONTROL:
> > -        if ( !cp->basic.vmx && !vmce_has_lmce(v) )
> > +        if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR)) )
> 
> What about Shanghai? init_shanghai() calling init_intel_cacheinfo()
> suggests to me it's at least as Intel-like as Centaur/VIA.

Right, and it also has VMX AFAICT. I'm not sure whether we could also
gate on the presence of VMX and LMCE on the physical CPU. I will send
and updated version with Shanghai added and will keep your Ack.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.