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 <jbeul...@suse.com>
> > Reviewed-by: Roger Pau Monné <roger....@citrix.com>
> 
> Acked-by: Andrew Cooper <andrew.coop...@citrix.com>
> 
> > ---
> > 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.

Reply via email to