[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [PATCH 7/9] x86/asm/entry/32: tidy up some instructions
From:       Linus Torvalds <torvalds () linux-foundation ! org>
Date:       2015-03-31 23:09:47
Message-ID: CA+55aFx48=K9PjkDnRiHezFe6ePMhc3iVXGMk44keXoKvXaoPA () mail ! gmail ! com
[Download RAW message or body]

On Tue, Mar 31, 2015 at 3:21 PM, Brian Gerst <brgerst@gmail.com> wrote:
>>
>> @@ -708,7 +708,7 @@ END(sysenter_badsys)
>>  #ifdef CONFIG_X86_ESPFIX32
>>         movl %ss, %eax
>>         /* see if on espfix stack */
>> -       cmpw $__ESPFIX_SS, %ax
>> +       cmpl $__ESPFIX_SS, %eax
>>         jne 27f
>>         movl $__KERNEL_DS, %eax
>>         movl %eax, %ds
>
> This is incorrect.  32-bit reads from a segment register are not
> zero-extended.  The upper 16 bits are implementation-defined.  Most
> processors will clear them but it's not guaranteed.

Indeed. Brian is right. That cmpw needs to stay as a 16-bit compare.

                      Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic