Re: [PATCH v2 10/10] x86, asm: Use CC_SET()/CC_OUT() and static_cpu_has() in archrandom.h
From: Borislav Petkov
Date: Thu Jun 09 2016 - 11:49:35 EST
On Wed, Jun 08, 2016 at 12:38:46PM -0700, H. Peter Anvin wrote:
> Use CC_SET()/CC_OUT() and static_cpu_has(). This produces code good
> enough to eliminate ad hoc use of alternatives in <asm/archrandom.h>,
> greatly simplifying the code.
>
> While we are at it, make x86_init_rdrand() compile out completely if
> we don't need it.
>
> Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
>
> v2: fix a conflict between <linux/random.h> and <asm/archrandom.h>
> discovered by Ingo Molnar. There are a few places in x86-specific
> code where we need all of <arch/archrandom.h> even when
> CONFIG_ARCH_RANDOM is disabled, so <linux/random.h> does not
> suffice.
> ---
> arch/x86/include/asm/archrandom.h | 128 ++++++++++++++++++--------------------
> arch/x86/kernel/cpu/rdrand.c | 4 +-
> 2 files changed, 62 insertions(+), 70 deletions(-)
Reviewed-by: Borislav Petkov <bp@xxxxxxx>
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.