Re: [PATCH 01/21] x86: add methods for writing of an MSR on several CPUs

H. Peter Anvin
2009-05-04T17:26:39Z

Borislav Petkov wrote:
>>
>> Please, for the love of God, no!
>>
>> Make it an array of u64s or (equivalently!) an array of (l,h)
>> structures, not separate arrays for the halves of the register.
>
> how about something like the following then? If there's agreement I could
> convert all users to struct msr later.
>

I personally would prefer if you just used an array of u64s. The whole
l/h split for MSRs was a mistake in the first place. However, if not,
at least make it a union; using something like:

union msr {
u32 l[2];
u64 q;
};

Or fancier, using gcc's anonymous structs/unions:

struct msr {
union {
struct {
u32 l, h;
};
u64 q;
};
};

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.