Skip to content

Commit 21b7e35

Browse files
committed
tools headers UAPI: Sync kvm.h headers with the kernel sources
To pick the changes in: d9a47ed ("KVM: PPC: Book3S HV: Introduce new capability for 2nd DAWR") 8d4e7e8 ("KVM: x86: declare Xen HVM shared info capability and add test case") 40da8cc ("KVM: x86/xen: Add event channel interrupt vector upcall") These new IOCTLs are now supported on 'perf trace': $ 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 --- before 2021-02-23 09:55:46.229058308 -0300 +++ after 2021-02-23 09:55:57.509308058 -0300 @@ -91,6 +91,10 @@ [0xc1] = "GET_SUPPORTED_HV_CPUID", [0xc6] = "X86_SET_MSR_FILTER", [0xc7] = "RESET_DIRTY_RINGS", + [0xc8] = "XEN_HVM_GET_ATTR", + [0xc9] = "XEN_HVM_SET_ATTR", + [0xca] = "XEN_VCPU_GET_ATTR", + [0xcb] = "XEN_VCPU_SET_ATTR", [0xe0] = "CREATE_DEVICE", [0xe1] = "SET_DEVICE_ATTR", [0xe2] = "GET_DEVICE_ATTR", $ Addressing 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: David Woodhouse <dwmw@amazon.co.uk> Cc: Paul Mackerras <paulus@ozlabs.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 303550a commit 21b7e35

File tree

1 file changed

+73
-0
lines changed
  • tools/include/uapi/linux

1 file changed

+73
-0
lines changed

tools/include/uapi/linux/kvm.h

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ struct kvm_hyperv_exit {
216216
} u;
217217
};
218218

219+
struct kvm_xen_exit {
220+
#define KVM_EXIT_XEN_HCALL 1
221+
__u32 type;
222+
union {
223+
struct {
224+
__u32 longmode;
225+
__u32 cpl;
226+
__u64 input;
227+
__u64 result;
228+
__u64 params[6];
229+
} hcall;
230+
} u;
231+
};
232+
219233
#define KVM_S390_GET_SKEYS_NONE 1
220234
#define KVM_S390_SKEYS_MAX 1048576
221235

@@ -252,6 +266,8 @@ struct kvm_hyperv_exit {
252266
#define KVM_EXIT_X86_WRMSR 30
253267
#define KVM_EXIT_DIRTY_RING_FULL 31
254268
#define KVM_EXIT_AP_RESET_HOLD 32
269+
#define KVM_EXIT_X86_BUS_LOCK 33
270+
#define KVM_EXIT_XEN 34
255271

256272
/* For KVM_EXIT_INTERNAL_ERROR */
257273
/* Emulate instruction failed. */
@@ -428,6 +444,8 @@ struct kvm_run {
428444
__u32 index; /* kernel -> user */
429445
__u64 data; /* kernel <-> user */
430446
} msr;
447+
/* KVM_EXIT_XEN */
448+
struct kvm_xen_exit xen;
431449
/* Fix the size of the union. */
432450
char padding[256];
433451
};
@@ -1058,6 +1076,7 @@ struct kvm_ppc_resize_hpt {
10581076
#define KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190
10591077
#define KVM_CAP_SYS_HYPERV_CPUID 191
10601078
#define KVM_CAP_DIRTY_LOG_RING 192
1079+
#define KVM_CAP_X86_BUS_LOCK_EXIT 193
10611080
#define KVM_CAP_PPC_DAWR1 194
10621081

10631082
#ifdef KVM_CAP_IRQ_ROUTING
@@ -1132,6 +1151,10 @@ struct kvm_x86_mce {
11321151
#endif
11331152

11341153
#ifdef KVM_CAP_XEN_HVM
1154+
#define KVM_XEN_HVM_CONFIG_HYPERCALL_MSR (1 << 0)
1155+
#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1)
1156+
#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)
1157+
11351158
struct kvm_xen_hvm_config {
11361159
__u32 flags;
11371160
__u32 msr;
@@ -1566,6 +1589,45 @@ struct kvm_pv_cmd {
15661589
/* Available with KVM_CAP_DIRTY_LOG_RING */
15671590
#define KVM_RESET_DIRTY_RINGS _IO(KVMIO, 0xc7)
15681591

1592+
/* Per-VM Xen attributes */
1593+
#define KVM_XEN_HVM_GET_ATTR _IOWR(KVMIO, 0xc8, struct kvm_xen_hvm_attr)
1594+
#define KVM_XEN_HVM_SET_ATTR _IOW(KVMIO, 0xc9, struct kvm_xen_hvm_attr)
1595+
1596+
struct kvm_xen_hvm_attr {
1597+
__u16 type;
1598+
__u16 pad[3];
1599+
union {
1600+
__u8 long_mode;
1601+
__u8 vector;
1602+
struct {
1603+
__u64 gfn;
1604+
} shared_info;
1605+
__u64 pad[8];
1606+
} u;
1607+
};
1608+
1609+
/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
1610+
#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0
1611+
#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1
1612+
#define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR 0x2
1613+
1614+
/* Per-vCPU Xen attributes */
1615+
#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)
1616+
#define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr)
1617+
1618+
struct kvm_xen_vcpu_attr {
1619+
__u16 type;
1620+
__u16 pad[3];
1621+
union {
1622+
__u64 gpa;
1623+
__u64 pad[8];
1624+
} u;
1625+
};
1626+
1627+
/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
1628+
#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO 0x0
1629+
#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_TIME_INFO 0x1
1630+
15691631
/* Secure Encrypted Virtualization command */
15701632
enum sev_cmd_id {
15711633
/* Guest initialization commands */
@@ -1594,6 +1656,8 @@ enum sev_cmd_id {
15941656
KVM_SEV_DBG_ENCRYPT,
15951657
/* Guest certificates commands */
15961658
KVM_SEV_CERT_EXPORT,
1659+
/* Attestation report */
1660+
KVM_SEV_GET_ATTESTATION_REPORT,
15971661

15981662
KVM_SEV_NR_MAX,
15991663
};
@@ -1646,6 +1710,12 @@ struct kvm_sev_dbg {
16461710
__u32 len;
16471711
};
16481712

1713+
struct kvm_sev_attestation_report {
1714+
__u8 mnonce[16];
1715+
__u64 uaddr;
1716+
__u32 len;
1717+
};
1718+
16491719
#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
16501720
#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
16511721
#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)
@@ -1767,4 +1837,7 @@ struct kvm_dirty_gfn {
17671837
__u64 offset;
17681838
};
17691839

1840+
#define KVM_BUS_LOCK_DETECTION_OFF (1 << 0)
1841+
#define KVM_BUS_LOCK_DETECTION_EXIT (1 << 1)
1842+
17701843
#endif /* __LINUX_KVM_H */

0 commit comments

Comments
 (0)