diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2023-03-14 09:40:39 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-03-14 09:40:39 -0400 |
commit | bceeedb2f0b803fa188b931b30c064ee60196f09 (patch) | |
tree | 527c70145cde7ed5b11cc41e8621244c225881df /include | |
parent | eeac8ede17557680855031c6f305ece2378af326 (diff) | |
parent | 47053904e18282af4525a02e3e0f519f014fc7f9 (diff) |
Merge tag 'kvmarm-fixes-6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 fixes for 6.3, part #1
A single patch to address a rather annoying bug w.r.t. guest timer
offsetting. Effectively the synchronization of timer offsets between
vCPUs was broken, leading to inconsistent timer reads within the VM.
Diffstat (limited to 'include')
-rw-r--r-- | include/kvm/arm_arch_timer.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h index 71916de7c6c4..c52a6e6839da 100644 --- a/include/kvm/arm_arch_timer.h +++ b/include/kvm/arm_arch_timer.h @@ -23,6 +23,19 @@ enum kvm_arch_timer_regs { TIMER_REG_CTL, }; +struct arch_timer_offset { + /* + * If set, pointer to one of the offsets in the kvm's offset + * structure. If NULL, assume a zero offset. + */ + u64 *vm_offset; +}; + +struct arch_timer_vm_data { + /* Offset applied to the virtual timer/counter */ + u64 voffset; +}; + struct arch_timer_context { struct kvm_vcpu *vcpu; @@ -32,6 +45,8 @@ struct arch_timer_context { /* Emulated Timer (may be unused) */ struct hrtimer hrtimer; + /* Offset for this counter/timer */ + struct arch_timer_offset offset; /* * We have multiple paths which can save/restore the timer state onto * the hardware, so we need some way of keeping track of where the |