@@ -269,6 +269,7 @@ struct kvm_xen_exit {
269269#define KVM_EXIT_AP_RESET_HOLD 32
270270#define KVM_EXIT_X86_BUS_LOCK 33
271271#define KVM_EXIT_XEN 34
272+ #define KVM_EXIT_RISCV_SBI 35
272273
273274/* For KVM_EXIT_INTERNAL_ERROR */
274275/* Emulate instruction failed. */
@@ -397,13 +398,23 @@ struct kvm_run {
397398 * "ndata" is correct, that new fields are enumerated in "flags",
398399 * and that each flag enumerates fields that are 64-bit aligned
399400 * and sized (so that ndata+internal.data[] is valid/accurate).
401+ *
402+ * Space beyond the defined fields may be used to store arbitrary
403+ * debug information relating to the emulation failure. It is
404+ * accounted for in "ndata" but the format is unspecified and is
405+ * not represented in "flags". Any such information is *not* ABI!
400406 */
401407 struct {
402408 __u32 suberror ;
403409 __u32 ndata ;
404410 __u64 flags ;
405- __u8 insn_size ;
406- __u8 insn_bytes [15 ];
411+ union {
412+ struct {
413+ __u8 insn_size ;
414+ __u8 insn_bytes [15 ];
415+ };
416+ };
417+ /* Arbitrary debug data may follow. */
407418 } emulation_failure ;
408419 /* KVM_EXIT_OSI */
409420 struct {
@@ -469,6 +480,13 @@ struct kvm_run {
469480 } msr ;
470481 /* KVM_EXIT_XEN */
471482 struct kvm_xen_exit xen ;
483+ /* KVM_EXIT_RISCV_SBI */
484+ struct {
485+ unsigned long extension_id ;
486+ unsigned long function_id ;
487+ unsigned long args [6 ];
488+ unsigned long ret [2 ];
489+ } riscv_sbi ;
472490 /* Fix the size of the union. */
473491 char padding [256 ];
474492 };
@@ -1112,6 +1130,7 @@ struct kvm_ppc_resize_hpt {
11121130#define KVM_CAP_BINARY_STATS_FD 203
11131131#define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
11141132#define KVM_CAP_ARM_MTE 205
1133+ #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
11151134
11161135#ifdef KVM_CAP_IRQ_ROUTING
11171136
@@ -1223,11 +1242,16 @@ struct kvm_irqfd {
12231242
12241243/* Do not use 1, KVM_CHECK_EXTENSION returned it before we had flags. */
12251244#define KVM_CLOCK_TSC_STABLE 2
1245+ #define KVM_CLOCK_REALTIME (1 << 2)
1246+ #define KVM_CLOCK_HOST_TSC (1 << 3)
12261247
12271248struct kvm_clock_data {
12281249 __u64 clock ;
12291250 __u32 flags ;
1230- __u32 pad [9 ];
1251+ __u32 pad0 ;
1252+ __u64 realtime ;
1253+ __u64 host_tsc ;
1254+ __u32 pad [4 ];
12311255};
12321256
12331257/* For KVM_CAP_SW_TLB */
0 commit comments