History

KVM: arm64: Allow userspace to get the writable masks for feature ID registers

While the Feature ID range is well defined and pretty large, it isn't inconceivable that the architecture will eventually grow some other ranges that will need to similarly be described to userspace. Add a VM ioctl to allow userspace to get writable masks for feature ID registers in below system register space: op0 = 3, op1 = {0, 1, 3}, CRn = 0, CRm = {0 - 7}, op2 = {0 - 7} This is used to support mix-and-match userspace and kernels for writable ID registers, where userspace may want to know upfront whether it can actually tweak the contents of an idreg or not. Add a new capability (KVM_CAP_ARM_SUPPORTED_FEATURE_ID_RANGES) that returns a bitmap of the valid ranges, which can subsequently be retrieved, one at a time by setting the index of the set bit as the range identifier.

Jing Zhang committed 3 years ago

Commit 3f9cd0c1 parent 6465e265 files · +112 −0Browse files

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

Unified · Split

include/uapi/linux/kvm.h+2−0
@@ -1192,6 +1192,7 @@ struct kvm_ppc_resize_hpt { · 1191 unmodified lines
11921192 #define KVM_CAP_COUNTER_OFFSET 227
11931193 #define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228
11941194 #define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 229
1195+#define KVM_CAP_ARM_SUPPORTED_REG_MASK_RANGES 230
11951196
11961197 #ifdef KVM_CAP_IRQ_ROUTING
11971198
@@ -1562,6 +1563,7 @@ struct kvm_s390_ucas_mapping { · 364 unmodified lines
15621563 #define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)
15631564 /* Available with KVM_CAP_COUNTER_OFFSET */
15641565 #define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset)
1566+#define KVM_ARM_GET_REG_WRITABLE_MASKS _IOR(KVMIO, 0xb6, struct reg_mask_range)
15651567
15661568 /* ioctl for vm fd */
15671569 #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