Skip to content

Commit a9d496d

Browse files
dmebonzini
authored andcommitted
KVM: x86: Clarify the kvm_run.emulation_failure structure layout
Until more flags for kvm_run.emulation_failure flags are defined, it is undetermined whether new payload elements corresponding to those flags will be additive or alternative. As a hint to userspace that an alternative is possible, wrap the current payload elements in a union. Suggested-by: Sean Christopherson <[email protected]> Signed-off-by: David Edmondson <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent ed290e1 commit a9d496d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/uapi/linux/kvm.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,12 @@ struct kvm_run {
403403
__u32 suberror;
404404
__u32 ndata;
405405
__u64 flags;
406-
__u8 insn_size;
407-
__u8 insn_bytes[15];
406+
union {
407+
struct {
408+
__u8 insn_size;
409+
__u8 insn_bytes[15];
410+
};
411+
};
408412
} emulation_failure;
409413
/* KVM_EXIT_OSI */
410414
struct {

0 commit comments

Comments
 (0)