]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pvclock: Add 'struct pvclock' API
authorAdam Fenn <adam@fenn.io>
Sat, 7 Aug 2021 20:01:46 +0000 (13:01 -0700)
committerKonstantin Belousov <kib@FreeBSD.org>
Tue, 12 Oct 2021 16:01:26 +0000 (19:01 +0300)
commit249f2478e38224df653878bc58ab549f1b7c0465
treed24e7f64482981df3e0f9b3931481b5c93f75a86
parent2f1e66f27040bda7a6fedbbfa6dadcb2c5a7e66c
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)
sys/x86/include/pvclock.h
sys/x86/x86/pvclock.c