]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - include/uapi/linux/kvm.h
KVM: arm64: timers: Allow userspace to set the global counter offset
authorMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 17:47:47 +0000 (18:47 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 18:01:10 +0000 (19:01 +0100)
commit30ec7997d175cd689fc61bfc4059f4d35b11858c
tree6d238cd0e5f3c253161a0333c5d5e8c604a69547
parent96906a9150a86a86b0464939625279b8e19f6e88
KVM: arm64: timers: Allow userspace to set the global counter offset

And this is the moment you have all been waiting for: setting the
counter offset from userspace.

We expose a brand new capability that reports the ability to set
the offset for both the virtual and physical sides.

In keeping with the architecture, the offset is expressed as
a delta that is substracted from the physical counter value.

Once this new API is used, there is no going back, and the counters
cannot be written to to set the offsets implicitly (the writes
are instead ignored).

Reviewed-by: Colton Lewis <coltonlewis@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230330174800.2677007-8-maz@kernel.org
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/uapi/asm/kvm.h
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/arm.c
include/uapi/linux/kvm.h