x86/paravirt: don't restore second return reg
authorJeremy Fitzhardinge <jeremy@goop.org>
Sat, 31 Jan 2009 07:17:23 +0000 (23:17 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 2 Feb 2009 16:06:30 +0000 (08:06 -0800)
Impact: bugfix

In the 32-bit calling convention, %eax:%edx is used to return 64-bit
values.  Don't save and restore %edx around wrapped functions, or they
can't return a full 64-bit result.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/include/asm/paravirt.h

index b17365c39749d08e92715209ba12cd9a469e2588..016dce3113050ab14f16ff4b9c7ff70a14cfe734 100644 (file)
@@ -1524,8 +1524,8 @@ extern struct paravirt_patch_site __parainstructions[],
 #define PV_RESTORE_REGS "popl %edx; popl %ecx;"
 
 /* save and restore all caller-save registers, except return value */
-#define PV_SAVE_ALL_CALLER_REGS PV_SAVE_REGS
-#define PV_RESTORE_ALL_CALLER_REGS PV_RESTORE_REGS
+#define PV_SAVE_ALL_CALLER_REGS                "pushl %ecx;"
+#define PV_RESTORE_ALL_CALLER_REGS     "popl  %ecx;"
 
 #define PV_FLAGS_ARG "0"
 #define PV_EXTRA_CLOBBERS