Re: [tip:x86/urgent] x86, AMD: Disable wrongly set X86_FEATURE_LAHF_LMCPUID bit

From: H. Peter Anvin
Date: Sun Aug 30 2009 - 13:08:25 EST


On 08/30/2009 04:43 AM, Borislav Petkov wrote:
> On Mon, Aug 24, 2009 at 11:44:30PM -0700, H. Peter Anvin wrote:
>> On 08/24/2009 10:52 PM, Borislav Petkov wrote:
>>> On Mon, Aug 24, 2009 at 01:34:07PM -0700, H. Peter Anvin wrote:
>>>> Looks reasonable... although part of me wonders if having a pointer to
>>>> an array containing the entire register file in and out is even better,
>>>> of if I'm just overengineering at this point.
>>> Hmm, let's have necessity determine that. I can only think of %edi being
>>> used as an input reg to rd/wrmsr beside %ecx but it could be very well
>>> that some other x86 hardware uses other regs too. Do we actually need
>>> all regs or a two should suffice?
>>>
>> Hard to know. In theory we shouldn't need ESI and EDI either!
>>
>> As I said, I wouldn't have worried about it at all if it wasn't for
>> paravirt_ops turning these things into ABIs.
>
> Ok, here's what I could come up with. It seems to work (tested only on a
> Fam10h box), it should cover all our msr needs for now and alleviate the
> need for adding yet another paravirt_ops member.
>

Looks good... there are a few minor tweaks to the assembly (in
particular, if we're going to do the single file with a macro then the
macro invocation should be outside the architecture #ifdef; second, I
realized a better implementation of the 64-bit code after I sent you the
email) but I can take care of this.

This is for .32, right?

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