[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/vtx: Introduce a typed union for CR access exit information



>>> On 20.03.18 at 15:28, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 20/03/18 10:51, Jan Beulich wrote:
>>>>> On 15.03.18 at 13:07, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> +typedef union cr_access_qual {
>>> +    unsigned long raw;
>>> +    struct {
>>> +        uint16_t cr:4,
>>> +                 access_type:2,  /* VMX_CR_ACCESS_TYPE_* */
>>> +                 lmsw_op_type:1, /* 0 => reg, 1 => mem   */
>>> +                 :1,
>>> +                 gpr:4,
>>> +                 :4;
>>> +        uint16_t lmsw_data;
>>> +        uint32_t :32;
>> Strictly speaking this doesn't belong here, as it doesn't exist for
>> 32-bit VMX implementations.
> 
> It is only here to keep clang happy.  See c/s ac6e7fd7a482

Oh, I didn't recall that.

> As an alternative, we could see about not using transparent unions, and
> explicitly casting in the function calls.

Let's rather not - transparent unions are quite nice an aid to avoid
casts.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.