HomeFreeBSD

tsc: add RDTSCP or faster variants of get_timecount()

Description

tsc: add RDTSCP or faster variants of get_timecount()

Use it in preference of Xfenced RDTSC if RDTSCP is supported. It is
recommended by both Intel and AMD. But, on AMD Zens and newer use
LFENCE, as recommended by AMD [*]. In particular, this means that now
AMD CPUs use more appropriate fence instead of too harsh MFENCe.

Add comment explaining the intent of the selection logic.

Reported by: gallatin [*]
Reviewed by: gallatin, markj
Tested by: gallatin, pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27986

Details

Provenance
kibAuthored on Jan 5 2021, 9:00 PM
Reviewer
gallatin
Differential Revision
D27986: x86 tsc: use RDTSCP in preference of fence + RDTSC
Parents
rG45974de8fb23: x86: Add rdtscp32() into cpufunc.h.
Branches
Unknown
Tags
Unknown