HomeFreeBSD

pvclock: Add 'struct pvclock' API

Description

pvclock: Add 'struct pvclock' API

Consolidate more hypervisor-agnostic functionality behind a new 'struct
pvclock' API.

This should also make it easier to subsequently add hypervisor-agnostic
vDSO timekeeping support.

Also, perform some clean-up:

  • Remove 'pvclock_get_last_cycles()'; do not allow external access to 'pvclock_last_systime' since this is not necessary.
  • Consolidate/simplify wall and system time reading codepaths.
  • Ensure correct ordering within wall and system time reading codepaths via 'atomic(9)' and 'rdtsc_ordered()' rather than via 'rmb()'.
  • Remove some extra newlines.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31418

Details

Provenance
adam_fenn.ioAuthored on Aug 7 2021, 8:01 PM
kibCommitted on Aug 14 2021, 12:57 PM
Reviewer
kib
Differential Revision
D31418: pvclock: Add vDSO support
Parents
rG346f5a0c483b: x86: files: Make sys/x86/x86/pvclock.c optional
Branches
Unknown
Tags
Unknown