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

Re: [PATCH v5] x86: clear RDRAND CPUID bit on AMD family 15h/16h


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 21 May 2020 11:47:17 +0200
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Thu, 21 May 2020 09:47:43 +0000
  • Ironport-sdr: T9lQX/REEirGqbQZzQ6/9OzM3tXUks4W10u7PepyFJvggWXvRcoOoh1wMySRTWkhBmiKJ2yxg3 m6HYmkDseFUzaMYVFDk3pTIwzgl9V4x6jCed+u3oE5BH2Tn0vfOPjWMbYbYPcRqK+iqdxRTGqK T/N3dKWEiF2YJr6g7m5aPo+iJI4Fe1ysuF5JxzefxARj++NNuN431aYB/fd5oM5lwYRZ52u+HB yRxeTh9ZfkrcScqmZqQ411VTOITFh9v0+jGuOLBZ3BnH0HEeo3/TFz8ORvHLtNmkX9kTbQYmdC Q3I=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, May 20, 2020 at 11:17:25PM +0100, Andrew Cooper wrote:
> On 18/05/2020 14:19, Jan Beulich wrote:
> > Inspired by Linux commit c49a0a80137c7ca7d6ced4c812c9e07a949f6f24:
> >
> >     There have been reports of RDRAND issues after resuming from suspend on
> >     some AMD family 15h and family 16h systems. This issue stems from a BIOS
> >     not performing the proper steps during resume to ensure RDRAND continues
> >     to function properly.
> >
> >     Update the CPU initialization to clear the RDRAND CPUID bit for any 
> > family
> >     15h and 16h processor that supports RDRAND. If it is known that the 
> > family
> >     15h or family 16h system does not have an RDRAND resume issue or that 
> > the
> >     system will not be placed in suspend, the "cpuid=rdrand" kernel 
> > parameter
> >     can be used to stop the clearing of the RDRAND CPUID bit.
> >
> >     Note, that clearing the RDRAND CPUID bit does not prevent a processor
> >     that normally supports the RDRAND instruction from executing it. So any
> >     code that determined the support based on family and model won't #UD.
> >
> > Warn if no explicit choice was given on affected hardware.
> >
> > Check RDRAND functions at boot as well as after S3 resume (the retry
> > limit chosen is entirely arbitrary).
> >
> > Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> > Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
> > ---
> > Still slightly RFC, and still in particular because of the change to
> > parse_xen_cpuid(): Alternative approach suggestions are welcome. But now
> > also because with many CPUs there may now be a lot of warnings in case
> > of issues.
> 
> It would still be nice if we could find a better way of determining
> whether S3 is supported on the platform, which would at least let us
> sort server and client platforms.
> 
> A straight string search for _S3 in the DSDT does look to be effective,
> on a sample of 5 boxes I've tried.

Hm, that's an interesting idea. There's also the _S3D device method
that could give a false positive? (ie: a device having a _S3D method
even when the DSDT doesn't have the _S3 method)

Roger.



 


Rackspace

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