mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 23:47:06 +00:00
Make sure the machine supports RDRAND, otherwise there is no trusted source of randomness in the system. To also check this in the pre-decompression stage, make has_cpuflag() not depend on CONFIG_RANDOMIZE_BASE anymore. Signed-off-by: Martin Radev <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
10 lines
146 B
C
10 lines
146 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include "../cpuflags.c"
|
|
|
|
bool has_cpuflag(int flag)
|
|
{
|
|
get_cpuflags();
|
|
|
|
return test_bit(flag, cpu.flags);
|
|
}
|