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

Re: [Xen-devel] [PATCH 2/6] x86/cpuid: Introduce recalculate_xstate()



>>> On 16.01.17 at 18:02, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 16/01/17 16:45, Jan Beulich wrote:
>>>>> On 16.01.17 at 12:40, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> @@ -154,6 +152,13 @@ struct cpuid_policy
>>>              };
>>>              uint32_t /* b */:32, xss_low, xss_high;
>>>          };
>>> +
>>> +        /* Per-component common state.  Valid for i >= 2. */
>>> +        struct {
>>> +            uint32_t size, offset;
>>> +            bool xss:1, align:1;
>>> +            uint32_t /* c */:30, /* d */:32;
>>> +        } comp[CPUID_GUEST_NR_XSTATE];
>> Hmm, can we rely on this functioning on varying complier variants?
>> I think the standard doesn't exclude a uint32_t type bitfield to
>> start on a 4-byte boundary if not following another uint32_t one.
>> IOW I think we'd be better off giving the same type to all fields we
>> want to share a storage unit.
> 
> Hmm.  In this case, something like:
> 
> bool xss:1, align:1;
> uint32_t _res_d;
> 
> ought to work.

In a union you mean? Yes.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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