Skip to content

Commit bf465ca

Browse files
committed
tools headers UAPI: Sync linux/kvm.h with the kernel sources
To pick the changes in: 8a06156 ("RISC-V: KVM: Add extensible CSR emulation framework") f5ecfee ("KVM: s390: resetting the Topology-Change-Report") 450a563 ("KVM: stats: Fix value for KVM_STATS_UNIT_MAX for boolean stats") 1b870fa ("kvm: stats: tell userspace which values are boolean") db1c875 ("KVM: s390: add KVM_S390_ZPCI_OP to manage guest zPCI devices") 94dfc73 ("treewide: uapi: Replace zero-length arrays with flexible-array members") 084cc29 ("KVM: x86/MMU: Allow NX huge pages to be disabled on a per-vm basis") 2f4073e ("KVM: VMX: Enable Notify VM exit") ed23511 ("KVM: x86: Extend KVM_{G,S}ET_VCPU_EVENTS to support pending triple fault") e9bf3ac ("KVM: s390: Add KVM_CAP_S390_PROTECTED_DUMP") 8aba095 ("KVM: s390: Add CPU dump functionality") 0460eb3 ("KVM: s390: Add configuration dump functionality") fe9a93e ("KVM: s390: pv: Add query dump information") 35d0249 ("KVM: s390: pv: Add query interface") c24a950 ("KVM, SEV: Add KVM_EXIT_SHUTDOWN metadata for SEV-ES") ffbb61d ("KVM: x86: Accept KVM_[GS]ET_TSC_KHZ as a VM ioctl.") 661a20f ("KVM: x86/xen: Advertise and document KVM_XEN_HVM_CONFIG_EVTCHN_SEND") fde0451 ("KVM: x86/xen: Support per-vCPU event channel upcall via local APIC") 28d1629 ("KVM: x86/xen: Kernel acceleration for XENVER_version") 5363952 ("KVM: x86/xen: handle PV timers oneshot mode") 942c249 ("KVM: x86/xen: Add KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID") 2fd6df2 ("KVM: x86/xen: intercept EVTCHNOP_send from guests") 3502573 ("KVM: x86/xen: Support direct injection of event channel events") That just rebuilds perf, as these patches add just an ioctl that is S390 specific and may clash with other arches, so are so far being excluded in the harvester script: $ tools/perf/trace/beauty/kvm_ioctl.sh > before $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h $ tools/perf/trace/beauty/kvm_ioctl.sh > after $ diff -u before after $ grep 390 tools/perf/trace/beauty/kvm_ioctl.sh egrep -v " ((ARM|PPC|S390)_|[GS]ET_(DEBUGREGS|PIT2|XSAVE|TSC_KHZ)|CREATE_SPAPR_TCE_64)" | \ $ This is also by now used by tools/testing/selftests/kvm/, a simple test build succeeded. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Anup Patel <anup@brainfault.org> Cc: Ben Gardon <bgardon@google.com> Cc: Chenyi Qiang <chenyi.qiang@intel.com> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: David Woodhouse <dwmw@amazon.co.uk> Cc: Gustavo A. R. Silva <gustavoars@kernel.org> Cc: Janosch Frank <frankja@linux.ibm.com> Cc: João Martins <joao.m.martins@oracle.com> Cc: Matthew Rosato <mjrosato@linux.ibm.com> Cc: Oliver Upton <oupton@google.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Peter Gonda <pgonda@google.com> Cc: Pierre Morel <pmorel@linux.ibm.com> Cc: Tao Xu <tao3.xu@intel.com> Link: https://lore.kernel.org/lkml/YvzuryClcn%2FvA0Gn@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 54cd4cd commit bf465ca

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

  • tools/include/uapi/linux

tools/include/uapi/linux/kvm.h

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ struct kvm_xen_exit {
270270
#define KVM_EXIT_X86_BUS_LOCK 33
271271
#define KVM_EXIT_XEN 34
272272
#define KVM_EXIT_RISCV_SBI 35
273+
#define KVM_EXIT_RISCV_CSR 36
274+
#define KVM_EXIT_NOTIFY 37
273275

274276
/* For KVM_EXIT_INTERNAL_ERROR */
275277
/* Emulate instruction failed. */
@@ -496,6 +498,18 @@ struct kvm_run {
496498
unsigned long args[6];
497499
unsigned long ret[2];
498500
} riscv_sbi;
501+
/* KVM_EXIT_RISCV_CSR */
502+
struct {
503+
unsigned long csr_num;
504+
unsigned long new_value;
505+
unsigned long write_mask;
506+
unsigned long ret_value;
507+
} riscv_csr;
508+
/* KVM_EXIT_NOTIFY */
509+
struct {
510+
#define KVM_NOTIFY_CONTEXT_INVALID (1 << 0)
511+
__u32 flags;
512+
} notify;
499513
/* Fix the size of the union. */
500514
char padding[256];
501515
};
@@ -1157,6 +1171,12 @@ struct kvm_ppc_resize_hpt {
11571171
#define KVM_CAP_VM_TSC_CONTROL 214
11581172
#define KVM_CAP_SYSTEM_EVENT_DATA 215
11591173
#define KVM_CAP_ARM_SYSTEM_SUSPEND 216
1174+
#define KVM_CAP_S390_PROTECTED_DUMP 217
1175+
#define KVM_CAP_X86_TRIPLE_FAULT_EVENT 218
1176+
#define KVM_CAP_X86_NOTIFY_VMEXIT 219
1177+
#define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
1178+
#define KVM_CAP_S390_ZPCI_OP 221
1179+
#define KVM_CAP_S390_CPU_TOPOLOGY 222
11601180

11611181
#ifdef KVM_CAP_IRQ_ROUTING
11621182

@@ -1660,6 +1680,55 @@ struct kvm_s390_pv_unp {
16601680
__u64 tweak;
16611681
};
16621682

1683+
enum pv_cmd_dmp_id {
1684+
KVM_PV_DUMP_INIT,
1685+
KVM_PV_DUMP_CONFIG_STOR_STATE,
1686+
KVM_PV_DUMP_COMPLETE,
1687+
KVM_PV_DUMP_CPU,
1688+
};
1689+
1690+
struct kvm_s390_pv_dmp {
1691+
__u64 subcmd;
1692+
__u64 buff_addr;
1693+
__u64 buff_len;
1694+
__u64 gaddr; /* For dump storage state */
1695+
__u64 reserved[4];
1696+
};
1697+
1698+
enum pv_cmd_info_id {
1699+
KVM_PV_INFO_VM,
1700+
KVM_PV_INFO_DUMP,
1701+
};
1702+
1703+
struct kvm_s390_pv_info_dump {
1704+
__u64 dump_cpu_buffer_len;
1705+
__u64 dump_config_mem_buffer_per_1m;
1706+
__u64 dump_config_finalize_len;
1707+
};
1708+
1709+
struct kvm_s390_pv_info_vm {
1710+
__u64 inst_calls_list[4];
1711+
__u64 max_cpus;
1712+
__u64 max_guests;
1713+
__u64 max_guest_addr;
1714+
__u64 feature_indication;
1715+
};
1716+
1717+
struct kvm_s390_pv_info_header {
1718+
__u32 id;
1719+
__u32 len_max;
1720+
__u32 len_written;
1721+
__u32 reserved;
1722+
};
1723+
1724+
struct kvm_s390_pv_info {
1725+
struct kvm_s390_pv_info_header header;
1726+
union {
1727+
struct kvm_s390_pv_info_dump dump;
1728+
struct kvm_s390_pv_info_vm vm;
1729+
};
1730+
};
1731+
16631732
enum pv_cmd_id {
16641733
KVM_PV_ENABLE,
16651734
KVM_PV_DISABLE,
@@ -1668,6 +1737,8 @@ enum pv_cmd_id {
16681737
KVM_PV_VERIFY,
16691738
KVM_PV_PREP_RESET,
16701739
KVM_PV_UNSHARE_ALL,
1740+
KVM_PV_INFO,
1741+
KVM_PV_DUMP,
16711742
};
16721743

16731744
struct kvm_pv_cmd {
@@ -2119,4 +2190,41 @@ struct kvm_stats_desc {
21192190
/* Available with KVM_CAP_XSAVE2 */
21202191
#define KVM_GET_XSAVE2 _IOR(KVMIO, 0xcf, struct kvm_xsave)
21212192

2193+
/* Available with KVM_CAP_S390_PROTECTED_DUMP */
2194+
#define KVM_S390_PV_CPU_COMMAND _IOWR(KVMIO, 0xd0, struct kvm_pv_cmd)
2195+
2196+
/* Available with KVM_CAP_X86_NOTIFY_VMEXIT */
2197+
#define KVM_X86_NOTIFY_VMEXIT_ENABLED (1ULL << 0)
2198+
#define KVM_X86_NOTIFY_VMEXIT_USER (1ULL << 1)
2199+
2200+
/* Available with KVM_CAP_S390_ZPCI_OP */
2201+
#define KVM_S390_ZPCI_OP _IOW(KVMIO, 0xd1, struct kvm_s390_zpci_op)
2202+
2203+
struct kvm_s390_zpci_op {
2204+
/* in */
2205+
__u32 fh; /* target device */
2206+
__u8 op; /* operation to perform */
2207+
__u8 pad[3];
2208+
union {
2209+
/* for KVM_S390_ZPCIOP_REG_AEN */
2210+
struct {
2211+
__u64 ibv; /* Guest addr of interrupt bit vector */
2212+
__u64 sb; /* Guest addr of summary bit */
2213+
__u32 flags;
2214+
__u32 noi; /* Number of interrupts */
2215+
__u8 isc; /* Guest interrupt subclass */
2216+
__u8 sbo; /* Offset of guest summary bit vector */
2217+
__u16 pad;
2218+
} reg_aen;
2219+
__u64 reserved[8];
2220+
} u;
2221+
};
2222+
2223+
/* types for kvm_s390_zpci_op->op */
2224+
#define KVM_S390_ZPCIOP_REG_AEN 0
2225+
#define KVM_S390_ZPCIOP_DEREG_AEN 1
2226+
2227+
/* flags for kvm_s390_zpci_op->u.reg_aen.flags */
2228+
#define KVM_S390_ZPCIOP_REGAEN_HOST (1 << 0)
2229+
21222230
#endif /* __LINUX_KVM_H */

0 commit comments

Comments
 (0)