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

(cherry picked from commit 0b3382b863f3195d88b99f94d5af7fe4a7b9726a)

Details

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