2021-09-20 14:17:37

by David Edmondson

[permalink] [raw]
Subject: [PATCH v6 1/4] 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]>
---
include/uapi/linux/kvm.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index a067410ebea5..8618fe973215 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -402,8 +402,12 @@ struct kvm_run {
__u32 suberror;
__u32 ndata;
__u64 flags;
- __u8 insn_size;
- __u8 insn_bytes[15];
+ union {
+ struct {
+ __u8 insn_size;
+ __u8 insn_bytes[15];
+ };
+ };
} emulation_failure;
/* KVM_EXIT_OSI */
struct {
--
2.33.0


2021-10-12 23:47:17

by Sean Christopherson

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] KVM: x86: Clarify the kvm_run.emulation_failure structure layout

On Mon, Sep 20, 2021, David Edmondson wrote:
> 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]>
> ---

To complete the set... :-)

Reviewed-by: Sean Christopherson <[email protected]>

2021-10-13 09:33:50

by David Edmondson

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] KVM: x86: Clarify the kvm_run.emulation_failure structure layout

On Tuesday, 2021-10-12 at 23:45:43 GMT, Sean Christopherson wrote:

> On Mon, Sep 20, 2021, David Edmondson wrote:
>> 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]>
>> ---
>
> To complete the set... :-)
>
> Reviewed-by: Sean Christopherson <[email protected]>

Thanks!

2021-10-22 15:28:01

by Paolo Bonzini

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] KVM: x86: Clarify the kvm_run.emulation_failure structure layout

On 13/10/21 11:29, David Edmondson wrote:
> On Tuesday, 2021-10-12 at 23:45:43 GMT, Sean Christopherson wrote:
>
>> On Mon, Sep 20, 2021, David Edmondson wrote:
>>> 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]>
>>> ---
>>
>> To complete the set... :-)
>>
>> Reviewed-by: Sean Christopherson <[email protected]>
>
> Thanks!
>

Queued, thanks!

Paolo