Skip to content

Commit 5a9f95b

Browse files
committed
tools headers UAPI: Update tools's copy of kvm.h header
tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Paolo Bonzini <[email protected]> Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1118446 commit 5a9f95b

File tree

1 file changed

+21
-3
lines changed
  • tools/include/uapi/linux

1 file changed

+21
-3
lines changed

tools/include/uapi/linux/kvm.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ struct kvm_xen_exit {
264264
#define KVM_EXIT_RISCV_SBI 35
265265
#define KVM_EXIT_RISCV_CSR 36
266266
#define KVM_EXIT_NOTIFY 37
267+
#define KVM_EXIT_LOONGARCH_IOCSR 38
267268

268269
/* For KVM_EXIT_INTERNAL_ERROR */
269270
/* Emulate instruction failed. */
@@ -336,6 +337,13 @@ struct kvm_run {
336337
__u32 len;
337338
__u8 is_write;
338339
} mmio;
340+
/* KVM_EXIT_LOONGARCH_IOCSR */
341+
struct {
342+
__u64 phys_addr;
343+
__u8 data[8];
344+
__u32 len;
345+
__u8 is_write;
346+
} iocsr_io;
339347
/* KVM_EXIT_HYPERCALL */
340348
struct {
341349
__u64 nr;
@@ -1192,6 +1200,7 @@ struct kvm_ppc_resize_hpt {
11921200
#define KVM_CAP_COUNTER_OFFSET 227
11931201
#define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228
11941202
#define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 229
1203+
#define KVM_CAP_ARM_SUPPORTED_REG_MASK_RANGES 230
11951204

11961205
#ifdef KVM_CAP_IRQ_ROUTING
11971206

@@ -1362,6 +1371,7 @@ struct kvm_dirty_tlb {
13621371
#define KVM_REG_ARM64 0x6000000000000000ULL
13631372
#define KVM_REG_MIPS 0x7000000000000000ULL
13641373
#define KVM_REG_RISCV 0x8000000000000000ULL
1374+
#define KVM_REG_LOONGARCH 0x9000000000000000ULL
13651375

13661376
#define KVM_REG_SIZE_SHIFT 52
13671377
#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
@@ -1418,9 +1428,16 @@ struct kvm_device_attr {
14181428
__u64 addr; /* userspace address of attr data */
14191429
};
14201430

1421-
#define KVM_DEV_VFIO_GROUP 1
1422-
#define KVM_DEV_VFIO_GROUP_ADD 1
1423-
#define KVM_DEV_VFIO_GROUP_DEL 2
1431+
#define KVM_DEV_VFIO_FILE 1
1432+
1433+
#define KVM_DEV_VFIO_FILE_ADD 1
1434+
#define KVM_DEV_VFIO_FILE_DEL 2
1435+
1436+
/* KVM_DEV_VFIO_GROUP aliases are for compile time uapi compatibility */
1437+
#define KVM_DEV_VFIO_GROUP KVM_DEV_VFIO_FILE
1438+
1439+
#define KVM_DEV_VFIO_GROUP_ADD KVM_DEV_VFIO_FILE_ADD
1440+
#define KVM_DEV_VFIO_GROUP_DEL KVM_DEV_VFIO_FILE_DEL
14241441
#define KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE 3
14251442

14261443
enum kvm_device_type {
@@ -1555,6 +1572,7 @@ struct kvm_s390_ucas_mapping {
15551572
#define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)
15561573
/* Available with KVM_CAP_COUNTER_OFFSET */
15571574
#define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset)
1575+
#define KVM_ARM_GET_REG_WRITABLE_MASKS _IOR(KVMIO, 0xb6, struct reg_mask_range)
15581576

15591577
/* ioctl for vm fd */
15601578
#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)

0 commit comments

Comments
 (0)