diff options
author | Marc Zyngier <maz@kernel.org> | 2023-03-30 18:47:47 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2023-03-30 19:01:10 +0100 |
commit | 30ec7997d175cd689fc61bfc4059f4d35b11858c (patch) | |
tree | 6d238cd0e5f3c253161a0333c5d5e8c604a69547 /arch/arm64/include/uapi | |
parent | 96906a9150a86a86b0464939625279b8e19f6e88 (diff) | |
download | linux-stable-30ec7997d175cd689fc61bfc4059f4d35b11858c.tar.gz linux-stable-30ec7997d175cd689fc61bfc4059f4d35b11858c.tar.bz2 linux-stable-30ec7997d175cd689fc61bfc4059f4d35b11858c.zip |
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
Diffstat (limited to 'arch/arm64/include/uapi')
-rw-r--r-- | arch/arm64/include/uapi/asm/kvm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index f8129c624b07..12fb0d8a760a 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -198,6 +198,15 @@ struct kvm_arm_copy_mte_tags { __u64 reserved[2]; }; +/* + * Counter/Timer offset structure. Describe the virtual/physical offset. + * To be used with KVM_ARM_SET_COUNTER_OFFSET. + */ +struct kvm_arm_counter_offset { + __u64 counter_offset; + __u64 reserved; +}; + #define KVM_ARM_TAGS_TO_GUEST 0 #define KVM_ARM_TAGS_FROM_GUEST 1 |