Skip to content

Commit

Permalink
x86/paravirt: don't restore second return reg
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeremy Fitzhardinge authored and H. Peter Anvin committed Feb 2, 2009
1 parent 4767afb commit e584f55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/include/asm/paravirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e584f55

Please sign in to comment.