Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01522df3 authored by Michael K. Johnson's avatar Michael K. Johnson Committed by H. Peter Anvin
Browse files

x86, setup: mark %esi as clobbered in E820 BIOS call



Jordan Hargrave diagnosed a BIOS clobbering %esi in the E820 call.
That particular BIOS has been fixed, but there is a possibility that
this is responsible for other occasional reports of early boot
failure, and it does not hurt to add %esi to the clobbers.

-stable candidate patch.

Cc: Justin Forbes <jmforbes@linuxtx.org>
Signed-off-by: default avatarMichael K Johnson <johnsonm@rpath.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
Cc: stable@kernel.org
parent c8608d6b
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -27,13 +27,14 @@ static int detect_memory_e820(void)
	do {
	do {
		size = sizeof(struct e820entry);
		size = sizeof(struct e820entry);


		/* Important: %edx is clobbered by some BIOSes,
		/* Important: %edx and %esi are clobbered by some BIOSes,
		   so it must be either used for the error output
		   so they must be either used for the error output
		   or explicitly marked clobbered. */
		   or explicitly marked clobbered. */
		asm("int $0x15; setc %0"
		asm("int $0x15; setc %0"
		    : "=d" (err), "+b" (next), "=a" (id), "+c" (size),
		    : "=d" (err), "+b" (next), "=a" (id), "+c" (size),
		      "=m" (*desc)
		      "=m" (*desc)
		    : "D" (desc), "d" (SMAP), "a" (0xe820));
		    : "D" (desc), "d" (SMAP), "a" (0xe820)
		    : "esi");


		/* BIOSes which terminate the chain with CF = 1 as opposed
		/* BIOSes which terminate the chain with CF = 1 as opposed
		   to %ebx = 0 don't always report the SMAP signature on
		   to %ebx = 0 don't always report the SMAP signature on