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)
Fri, Mar 22, 7:30 AM
Unknown Object (File)
Feb 13 2024, 4:15 AM
Unknown Object (File)
Feb 11 2024, 2:31 AM
Unknown Object (File)
Feb 11 2024, 2:31 AM
Unknown Object (File)
Feb 1 2024, 8:49 AM
Unknown Object (File)
Jan 1 2024, 6:58 AM
Unknown Object (File)
Dec 21 2023, 2:21 PM
Unknown Object (File)
Dec 20 2023, 4:15 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
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.