提交 34d0b02e 编写于 作者: J Jarkko Sakkinen 提交者: H. Peter Anvin

x86, realmode: Fix no cache bits test in reboot_32.S

Before the new real-mode code infrastructure %edx was
used for testing CD and NW bits with andl in order to
decide whether to flush the processor caches or not.
The value of cr0 was also stored in %eax, which was
later used to set cr0 after masking out lower byte
(except TS bit) in order to enter real-mode.

In the new real-mode code infrastructure we wanted to
keep input parameter in %eax so we are using %edx for
both cr0 cases. This has caused regression since andl
overwrites the value of %edx.

This patch fixes the issue by replacing andl with testl,
which is essentially andl without writing result to the
register.

Special thanks to Paolo Bonzini for noting this and
proposing a fix.
Reported-and-tested-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NJarkko Sakkinen <jarkko.sakkinen@intel.com>
Link: http://lkml.kernel.org/r/1336633898-23743-1-git-send-email-jarkko.sakkinen@intel.comSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
上级 0f6f11eb
...@@ -76,7 +76,7 @@ machine_real_restart_asm16: ...@@ -76,7 +76,7 @@ machine_real_restart_asm16:
movl %edx, %cr0 movl %edx, %cr0
movl %ecx, %cr3 movl %ecx, %cr3
movl %cr0, %edx movl %cr0, %edx
andl $0x60000000, %edx /* If no cache bits -> no wbinvd */ testl $0x60000000, %edx /* If no cache bits -> no wbinvd */
jz 2f jz 2f
wbinvd wbinvd
2: 2:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册