x86: Set RDRAND usable if CPU supports RDRAND
Commit Message
On Fri, Dec 4, 2020 at 12:12 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> > Set RDRAND usable if CPU supports RDRAND. Also check HAS_CPU_FEATURE
> > instead of CPU_FEATURE_USABLE for FSGSBASE, LM and XSAVES since
> > FSGSBASE/LM require kernel support and XSAVES is supervisor-mode only.
>
> I think the commit subject is misleading because the RDRAND part is a
> glibc bug fix. Rest looks okay to me.
>
> Thanks,
I am checking the RDRAND fix as a separate patch. I will submit a
new patch with the tst-cpu-features-supports.c fix only.
Thanks.
Comments
* H. J. Lu:
> On Fri, Dec 4, 2020 at 12:12 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * H. J. Lu via Libc-alpha:
>>
>> > Set RDRAND usable if CPU supports RDRAND. Also check HAS_CPU_FEATURE
>> > instead of CPU_FEATURE_USABLE for FSGSBASE, LM and XSAVES since
>> > FSGSBASE/LM require kernel support and XSAVES is supervisor-mode only.
>>
>> I think the commit subject is misleading because the RDRAND part is a
>> glibc bug fix. Rest looks okay to me.
>>
>> Thanks,
>
> I am checking the RDRAND fix as a separate patch. I will submit a
> new patch with the tst-cpu-features-supports.c fix only.
Okay, thanks. Feel free to check in both patches.
Florian
From eacbdebffb55aa570c53d87898fa99a9aeb5f5a1 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 3 Dec 2020 15:02:44 -0800
Subject: [PATCH] x86: Set RDRAND usable if CPU supports RDRAND
Set RDRAND usable if CPU supports RDRAND.
---
sysdeps/x86/cpu-features.c | 1 +
1 file changed, 1 insertion(+)
@@ -85,6 +85,7 @@ update_usable (struct cpu_features *cpu_features)
CPU_FEATURE_SET_USABLE (cpu_features, WAITPKG);
CPU_FEATURE_SET_USABLE (cpu_features, GFNI);
CPU_FEATURE_SET_USABLE (cpu_features, RDPID);
+ CPU_FEATURE_SET_USABLE (cpu_features, RDRAND);
CPU_FEATURE_SET_USABLE (cpu_features, CLDEMOTE);
CPU_FEATURE_SET_USABLE (cpu_features, MOVDIRI);
CPU_FEATURE_SET_USABLE (cpu_features, MOVDIR64B);
--
2.28.0