History

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).

Marc Zyngier committed 3 years ago

Commit 30ec7991 parent 96906a95 files · +73 −5Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/kvm.h+3−0
@@ -1184,6 +1184,7 @@ struct kvm_ppc_resize_hpt { · 1183 unmodified lines
11841184 #define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 224
11851185 #define KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP 225
11861186 #define KVM_CAP_PMU_EVENT_MASKED_EVENTS 226
1187+#define KVM_CAP_COUNTER_OFFSET 227
11871188
11881189 #ifdef KVM_CAP_IRQ_ROUTING
11891190
@@ -1543,6 +1544,8 @@ struct kvm_s390_ucas_mapping { · 353 unmodified lines
15431544 #define KVM_SET_PMU_EVENT_FILTER _IOW(KVMIO, 0xb2, struct kvm_pmu_event_filter)
15441545 #define KVM_PPC_SVM_OFF _IO(KVMIO, 0xb3)
15451546 #define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)
1547+/* Available with KVM_CAP_COUNTER_OFFSET */
1548+#define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset)
15461549
15471550 /* ioctl for vm fd */
15481551 #define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t