Re: [PATCH v2] KVM x86/xen: add an override for PVCLOCK_TSC_STABLE_BIT

From: Paul Durrant
Date: Wed Nov 01 2023 - 07:06:37 EST


On 31/10/2023 23:06, David Woodhouse wrote:
[snip]
                mutex_lock(&kvm->lock);
                if (!kvm->created_vcpus) {
                        kvm->arch.force_tsc_unstable = true;
                        r = 0;
                }
                mutex_unlock(&kvm->lock);

So that it would be blatantly obvious that there's no race with checking a per-VM
flag without any lock/RCU protections.

Makes sense. Although TBH if the VMM wants to flip this bit on and off
at runtime while the guest clocks are being updated, it deserves what
it gets. It's not a problem for KVM.


The first version of the patch that used an attribute requested a clock update when the attribute was set. I dropped that in this version but I think it'd best to re-instate it.

Paul