Skip to content

Trap and emulate cpuid (disabling RDRAND) #1561

@sporksmith

Description

@sporksmith

On some newer Intel CPUs, the cpuid instruction can be trapped and emulated in a similar way as rdtsc, using arch_prctl(ARCH_SET_CPUID). In particular this could be useful for making it appear as though the RDRAND instruction isn't present.

From https://lwn.net/Articles/713970/:

Newer Intel CPUs (Ivy Bridge and later) can fault when CPUID is executed at
CPL > 0. Expose this capability to userspace as a new pair of arch_prctls,
ARCH_GET_CPUID and ARCH_SET_CPUID.

See also https://man7.org/linux/man-pages/man2/arch_prctl.2.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugError or flaw producing unexpected results

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions