diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-04-18 20:16:48 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-04-19 18:07:56 -0400 |
commit | ffc4bc9c6fa4eaf935d96d139bfa7443cac0b88e (patch) | |
tree | 61296184c680a012f7d4a10deedec2caba87dc53 /arch/x86/kernel/head_64.S | |
parent | 84f4fc524eed040660bd4ebc8cba259d8afe8461 (diff) |
x86, paravirt: Replace GET_CR2_INTO_RCX with GET_CR2_INTO_RAX
GET_CR2_INTO_RCX is asinine: it is only used in one place, the actual
paravirt call returns the value in %rax, not %rcx; and the one place
that wants it wants the result in %r9. We actually generate as a
result of this call:
call ...
movq %rax, %rcx
xorq %rax, %rax /* this value isn't even used... */
movq %rcx, %r9
At least make the macro do what the paravirt call does, which is put
the value into %rax.
Nevermind the fact that the macro clobbers all the volatile registers.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/r/1334794610-5546-4-git-send-email-hpa@zytor.com
Cc: Glauber de Oliveira Costa <glommer@parallels.com>
Diffstat (limited to 'arch/x86/kernel/head_64.S')
-rw-r--r-- | arch/x86/kernel/head_64.S | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index adf52e85d551..d1e112c8b577 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -23,8 +23,9 @@ | |||
23 | #ifdef CONFIG_PARAVIRT | 23 | #ifdef CONFIG_PARAVIRT |
24 | #include <asm/asm-offsets.h> | 24 | #include <asm/asm-offsets.h> |
25 | #include <asm/paravirt.h> | 25 | #include <asm/paravirt.h> |
26 | #define GET_CR2_INTO(reg) GET_CR2_INTO_RAX ; movq %rax, reg | ||
26 | #else | 27 | #else |
27 | #define GET_CR2_INTO_RCX movq %cr2, %rcx | 28 | #define GET_CR2_INTO(reg) movq %cr2, reg |
28 | #endif | 29 | #endif |
29 | 30 | ||
30 | /* we are not able to switch in one step to the final KERNEL ADDRESS SPACE | 31 | /* we are not able to switch in one step to the final KERNEL ADDRESS SPACE |
@@ -286,8 +287,7 @@ ENTRY(early_idt_handler) | |||
286 | cmpl $2,early_recursion_flag(%rip) | 287 | cmpl $2,early_recursion_flag(%rip) |
287 | jz 1f | 288 | jz 1f |
288 | incl early_recursion_flag(%rip) | 289 | incl early_recursion_flag(%rip) |
289 | GET_CR2_INTO_RCX | 290 | GET_CR2_INTO(%r9) |
290 | movq %rcx,%r9 | ||
291 | xorl %r8d,%r8d # zero for error code | 291 | xorl %r8d,%r8d # zero for error code |
292 | movl %esi,%ecx # get vector number | 292 | movl %esi,%ecx # get vector number |
293 | # Test %ecx against mask of vectors that push error code. | 293 | # Test %ecx against mask of vectors that push error code. |