On Mon, May 04, 2009 at 10:25:12AM -0700, H. Peter Anvin wrote:That sounds good also to me.
Borislav Petkov wrote:
I personally would prefer if you just used an array of u64s. The wholePlease, for the love of God, no!how about something like the following then? If there's agreement I could
Make it an array of u64s or (equivalently!) an array of (l,h)
structures, not separate arrays for the halves of the register.
convert all users to struct msr later.
l/h split for MSRs was a mistake in the first place.
... on the other hand, the two u32s kinda resemble more the EDX:EAX
register pair of rdmsr/wrmsr, hm...
[..]
Or fancier, using gcc's anonymous structs/unions:
struct msr {
union {
struct {
u32 l, h;
};
u64 q;
};
};
yeah, that sounds good:
--
From: Borislav Petkov <borislav.petkov@xxxxxxx>
Date: Wed, 29 Apr 2009 15:20:11 +0200
Subject: [PATCH 1/2] x86: add methods for writing of an MSR on several CPUs
Add a struct representing a 64bit MSR pair consisting of a low and high
register part.
Also, rename msr-on-cpu.c to msr.c accordingly.
Signed-off-by: Borislav Petkov <borislav.petkov@xxxxxxx>