[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3] x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED
On Monday, April 7th, 2025 at 2:17 AM, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote: > > > On 05/04/2025 2:25 am, dmkhn@xxxxxxxxx wrote: > > > From: Denis Mukhin dmukhin@xxxxxxxx > > > > The new toolchain baseline knows the rdrand/rdseed instructions, > > no need to carry the workaround in the code. > > > A few minor notes. Instructions in CAPITALS please to make them easier > to parse in context. The comma ought to be a semi-colon. > > You should note that arch_get_random() is adjusted too. > > Also, it's useful to state "No functional change." to help reviewers. > (Or to help archaeologies figure out the intent of the patch if they > subsequently find a bug in it.) Noted, thanks for the feedback > > > diff --git a/xen/arch/x86/include/asm/random.h > > b/xen/arch/x86/include/asm/random.h > > index 9e1fe0bc1d..e1c1c765e1 100644 > > --- a/xen/arch/x86/include/asm/random.h > > +++ b/xen/arch/x86/include/asm/random.h > > @@ -8,7 +8,7 @@ static inline unsigned int arch_get_random(void) > > unsigned int val = 0; > > > > if ( cpu_has(¤t_cpu_data, X86_FEATURE_RDRAND) ) > > - asm volatile ( ".byte 0x0f,0xc7,0xf0" : "+a" (val) ); > > + asm volatile ( "rdrand %0" : "=a" (val) ); > > > This was only tied to "a" because 0xf0 is the ModRM byte. Now that we > can use the mnemonic, it can become "=r". > > I've fixed all on commit. Thank you! > > ~Andrew
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |