Page MenuHomeFreeBSD

x86: cpufunc: Add rdtsc_ordered()
ClosedPublic

Authored by adam_fenn.io on Aug 5 2021, 2:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 12:52 AM
Unknown Object (File)
Fri, Nov 1, 3:40 PM
Unknown Object (File)
Sun, Oct 20, 1:49 PM
Unknown Object (File)
Tue, Oct 15, 6:24 AM
Unknown Object (File)
Oct 7 2024, 6:39 AM
Unknown Object (File)
Oct 1 2024, 1:10 PM
Unknown Object (File)
Oct 1 2024, 4:43 AM
Unknown Object (File)
Sep 30 2024, 6:02 PM

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.