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

From: Mauro Carvalho Chehab
Date: Mon May 04 2009 - 16:53:03 EST


Borislav Petkov escreveu:
On Mon, May 04, 2009 at 10:25:12AM -0700, H. Peter Anvin wrote:
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.

... 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>

That sounds good also to me.

Reviewed-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>

--
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/