Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools headers kvm: Sync linux/kvm.h with the kernel sources

To pick up the changes from:

9a5788c615f5 ("KVM: PPC: Book3S HV: Add a capability for enabling secure guests")
3c9bd4006bfc ("KVM: x86: enable dirty log gradually in small chunks")
13da9ae1cdbf ("KVM: s390: protvirt: introduce and enable KVM_CAP_S390_PROTECTED")
e0d2773d487c ("KVM: s390: protvirt: UV calls in support of diag308 0, 1")
19e122776886 ("KVM: S390: protvirt: Introduce instruction data area bounce buffer")
29b40f105ec8 ("KVM: s390: protvirt: Add initial vm and cpu lifecycle handling")

So far we're ignoring those arch specific ioctls, we need to revisit
this at some time to have arch specific tables, etc:

$ grep S390 tools/perf/trace/beauty/kvm_ioctl.sh
egrep -v " ((ARM|PPC|S390)_|[GS]ET_(DEBUGREGS|PIT2|XSAVE|TSC_KHZ)|CREATE_SPAPR_TCE_64)" | \
$

This addresses these tools/perf build warnings:

Warning: Kernel ABI header at 'tools/arch/arm/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm/include/uapi/asm/kvm.h'
diff -u tools/arch/arm/include/uapi/asm/kvm.h arch/arm/include/uapi/asm/kvm.h

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Jay Zhou <jianjay.zhou@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+45 -2
+45 -2
tools/include/uapi/linux/kvm.h
··· 474 474 __u32 size; /* amount of bytes */ 475 475 __u32 op; /* type of operation */ 476 476 __u64 buf; /* buffer in userspace */ 477 - __u8 ar; /* the access register number */ 478 - __u8 reserved[31]; /* should be set to 0 */ 477 + union { 478 + __u8 ar; /* the access register number */ 479 + __u32 sida_offset; /* offset into the sida */ 480 + __u8 reserved[32]; /* should be set to 0 */ 481 + }; 479 482 }; 480 483 /* types for kvm_s390_mem_op->op */ 481 484 #define KVM_S390_MEMOP_LOGICAL_READ 0 482 485 #define KVM_S390_MEMOP_LOGICAL_WRITE 1 486 + #define KVM_S390_MEMOP_SIDA_READ 2 487 + #define KVM_S390_MEMOP_SIDA_WRITE 3 483 488 /* flags for kvm_s390_mem_op->flags */ 484 489 #define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0) 485 490 #define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1) ··· 1015 1010 #define KVM_CAP_ARM_NISV_TO_USER 177 1016 1011 #define KVM_CAP_ARM_INJECT_EXT_DABT 178 1017 1012 #define KVM_CAP_S390_VCPU_RESETS 179 1013 + #define KVM_CAP_S390_PROTECTED 180 1014 + #define KVM_CAP_PPC_SECURE_GUEST 181 1018 1015 1019 1016 #ifdef KVM_CAP_IRQ_ROUTING 1020 1017 ··· 1485 1478 #define KVM_S390_NORMAL_RESET _IO(KVMIO, 0xc3) 1486 1479 #define KVM_S390_CLEAR_RESET _IO(KVMIO, 0xc4) 1487 1480 1481 + struct kvm_s390_pv_sec_parm { 1482 + __u64 origin; 1483 + __u64 length; 1484 + }; 1485 + 1486 + struct kvm_s390_pv_unp { 1487 + __u64 addr; 1488 + __u64 size; 1489 + __u64 tweak; 1490 + }; 1491 + 1492 + enum pv_cmd_id { 1493 + KVM_PV_ENABLE, 1494 + KVM_PV_DISABLE, 1495 + KVM_PV_SET_SEC_PARMS, 1496 + KVM_PV_UNPACK, 1497 + KVM_PV_VERIFY, 1498 + KVM_PV_PREP_RESET, 1499 + KVM_PV_UNSHARE_ALL, 1500 + }; 1501 + 1502 + struct kvm_pv_cmd { 1503 + __u32 cmd; /* Command to be executed */ 1504 + __u16 rc; /* Ultravisor return code */ 1505 + __u16 rrc; /* Ultravisor return reason code */ 1506 + __u64 data; /* Data or address */ 1507 + __u32 flags; /* flags for future extensions. Must be 0 for now */ 1508 + __u32 reserved[3]; 1509 + }; 1510 + 1511 + /* Available with KVM_CAP_S390_PROTECTED */ 1512 + #define KVM_S390_PV_COMMAND _IOWR(KVMIO, 0xc5, struct kvm_pv_cmd) 1513 + 1488 1514 /* Secure Encrypted Virtualization command */ 1489 1515 enum sev_cmd_id { 1490 1516 /* Guest initialization commands */ ··· 1667 1627 1668 1628 #define KVM_HYPERV_CONN_ID_MASK 0x00ffffff 1669 1629 #define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0) 1630 + 1631 + #define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) 1632 + #define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) 1670 1633 1671 1634 #endif /* __LINUX_KVM_H */