[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v11 10/23] KVM: x86: Remove pvclock_gtod_data and private timekeeping code



From: David Woodhouse <dwmw@xxxxxxxxxxxx>

Remove the now-unused KVM-private timekeeping infrastructure:

 - struct pvclock_clock and struct pvclock_gtod_data
 - update_pvclock_gtod() and its seqcount-protected state copy
   (the private readers were already removed when their last callers
   went away)

Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
 arch/x86/kvm/x86.c | 56 ----------------------------------------------
 1 file changed, 56 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index e81e527e7b99..940168528721 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -889,60 +889,6 @@ static inline bool kvm_vcpu_exit_request(struct kvm_vcpu 
*vcpu)
               kvm_request_pending(vcpu) || xfer_to_guest_mode_work_pending();
 }
 
-#ifdef CONFIG_X86_64
-struct pvclock_clock {
-       int vclock_mode;
-       u64 cycle_last;
-       u64 mask;
-       u32 mult;
-       u32 shift;
-       u64 base_cycles;
-       u64 offset;
-};
-
-struct pvclock_gtod_data {
-       seqcount_t      seq;
-
-       struct pvclock_clock clock; /* extract of a clocksource struct */
-       struct pvclock_clock raw_clock; /* extract of a clocksource struct */
-
-       ktime_t         offs_boot;
-       u64             wall_time_sec;
-};
-
-static struct pvclock_gtod_data pvclock_gtod_data;
-
-static void update_pvclock_gtod(struct timekeeper *tk)
-{
-       struct pvclock_gtod_data *vdata = &pvclock_gtod_data;
-
-       write_seqcount_begin(&vdata->seq);
-
-       /* copy pvclock gtod data */
-       vdata->clock.vclock_mode        = tk->tkr_mono.clock->vdso_clock_mode;
-       vdata->clock.cycle_last         = tk->tkr_mono.cycle_last;
-       vdata->clock.mask               = tk->tkr_mono.mask;
-       vdata->clock.mult               = tk->tkr_mono.mult;
-       vdata->clock.shift              = tk->tkr_mono.shift;
-       vdata->clock.base_cycles        = tk->tkr_mono.xtime_nsec;
-       vdata->clock.offset             = tk->tkr_mono.base;
-
-       vdata->raw_clock.vclock_mode    = tk->tkr_raw.clock->vdso_clock_mode;
-       vdata->raw_clock.cycle_last     = tk->tkr_raw.cycle_last;
-       vdata->raw_clock.mask           = tk->tkr_raw.mask;
-       vdata->raw_clock.mult           = tk->tkr_raw.mult;
-       vdata->raw_clock.shift          = tk->tkr_raw.shift;
-       vdata->raw_clock.base_cycles    = tk->tkr_raw.xtime_nsec;
-       vdata->raw_clock.offset         = tk->tkr_raw.base;
-
-       vdata->wall_time_sec            = tk->xtime_sec;
-
-       vdata->offs_boot                = tk->offs_boot;
-
-       write_seqcount_end(&vdata->seq);
-}
-#endif
-
 static s64 get_kvmclock_base_ns(void)
 {
        /* Count up from boot time, but with the frequency of the raw clock.  */
@@ -7092,8 +7038,6 @@ static int pvclock_gtod_notify(struct notifier_block *nb, 
unsigned long unused,
 {
        struct timekeeper *tk = priv;
 
-       update_pvclock_gtod(tk);
-
        /*
         * Pairs with the READ_ONCE() in the lockless readers; the race is
         * benign by design, relying on eventual consistency (the notifier
-- 
2.43.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.