Page MenuHomeFreeBSD

x86: cpufunc: Add rdtsc_ordered()
ClosedPublic

Authored by adam_fenn.io on Aug 5 2021, 2:25 AM.
Tags
None
Referenced Files
F115553877: D31416.id93309.diff
Fri, Apr 25, 6:23 AM
Unknown Object (File)
Mon, Apr 14, 8:43 AM
Unknown Object (File)
Sat, Apr 12, 6:12 AM
Unknown Object (File)
Thu, Apr 10, 12:23 PM
Unknown Object (File)
Sun, Apr 6, 5:43 AM
Unknown Object (File)
Fri, Apr 4, 9:01 PM
Unknown Object (File)
Mar 15 2025, 4:00 AM
Unknown Object (File)
Mar 8 2025, 12:34 AM

Details

Summary

Add a variant of rdtsc() that performs the ordered version of rdtsc
appropriate for the invoking x86 variant.

Test Plan

Tested as part of testing D29733.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40885
Build 37774: arc lint + arc unit

Event Timeline

adam_fenn.io held this revision as a draft.
sys/x86/x86/rdtsc_ordered.c
54 ↗(On Diff #93245)

I would add rdtsc_ordered_*fence() functions to cpufunc.h as well.

63 ↗(On Diff #93245)

I suppose this branch did not caused a warning from the compiler? I suggest to add {} around the body of the case. Or write it as

return (cpu_is_amd ? rdtsc_ordered_mfence : rdtsc_ordered_lfence);
sys/conf/files.x86
322 ↗(On Diff #93290)

Drop this file at all.

sys/i386/include/cpufunc.h
850

Move this to x86/include/md_var.h

sys/x86/x86/rdtsc_ordered.c
54 ↗(On Diff #93290)

Move this to x86/cpu_machdep.c

This revision was not accepted when it landed; it landed in state Needs Review.Aug 14 2021, 12:59 PM
Closed by commit rG652ae7b11485: x86: cpufunc: Add rdtsc_ordered() (authored by adam_fenn.io, committed by kib). · Explain Why
This revision was automatically updated to reflect the committed changes.