Re: [PATCH 01/21] x86: add methods for writing of an MSR on severalCPUs
From: H. Peter Anvin
Date: Mon May 04 2009 - 13:26:41 EST
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/