Commit-ID: 420957dca32e5b6ec9a2dcc2637838cd2d02aadf Gitweb: http://git.kernel.org/tip/420957dca32e5b6ec9a2dcc2637838cd2d02aadf Author: H. Peter Anvin <hpa@xxxxxxxxx> AuthorDate: Sat, 28 Mar 2009 13:53:26 -0700 Committer: H. Peter Anvin <hpa@xxxxxxxxx> CommitDate: Sat, 28 Mar 2009 17:56:11 -0700 x86, setup: preemptively save/restore edit and ebp around INT 15 E820 Impact: BIOS bugproofing Since there are BIOSes known to clobber %ebx and %esi for INT 15 E820, assume there is something out there clobbering %edi and/or %ebp too, and don't wait for it to fail. Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx> --- arch/x86/boot/memory.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c index a99dbbe..05bd541 100644 --- a/arch/x86/boot/memory.c +++ b/arch/x86/boot/memory.c @@ -29,8 +29,9 @@ static int detect_memory_e820(void) /* Important: %edx and %esi are clobbered by some BIOSes, so they must be either used for the error output - or explicitly marked clobbered. */ - asm("int $0x15; setc %0" + or explicitly marked clobbered. Given that, assume there + is something out there clobbering %ebp, too. */ + asm("pushl %%ebp; int $0x15; popl %%ebp; setc %0" : "=d" (err), "+b" (next), "=a" (id), "+c" (size), "=m" (*desc) : "D" (desc), "d" (SMAP), "a" (0xe820) -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html