Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ACPI: preserve the ebx value in acpi_copy_wakeup_routine

Register %ebx serves as the "global offset table base register" for
position-independent code. For absolute code, %ebx serves as a local
register and has no specified role in the function calling sequence. In
either case, a function must preserve the register value for the caller.

acpi_copy_wakeup_routine overrides %ebx without saving it, this may corrupt
the called data.

Kevin found that most time the value of Sx is saved in %esi, however
sometimes compiler also uses %ebx. When this happens, suspends fails since
sleep value in ebx is changed by acpi_copy_wakeup_routine.

The same funtion in X86_64 doesn't have this problem.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Looks-okay-to: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Tian Kevin and committed by
Linus Torvalds
c8cbee61 e5d2861f

+2
+2
arch/i386/kernel/acpi/wakeup.S
··· 230 230 # 231 231 ENTRY(acpi_copy_wakeup_routine) 232 232 233 + pushl %ebx 233 234 sgdt saved_gdt 234 235 sidt saved_idt 235 236 sldt saved_ldt ··· 264 263 movl %edx, video_flags - wakeup_start (%eax) 265 264 movl $0x12345678, real_magic - wakeup_start (%eax) 266 265 movl $0x12345678, saved_magic 266 + popl %ebx 267 267 ret 268 268 269 269 save_registers: