Commit 7fc49f19 authored by Andreas Schwab's avatar Andreas Schwab Committed by Ingo Molnar

x86 setup: fix asm constraints in vesa_store_edid

Impact: fix potential miscompile (currently believed non-manifest)

As the comment explains, the VBE DDC call can clobber any register.
Tell the compiler about that fact.
Signed-off-by: default avatarAndreas Schwab <schwab@suse.de>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 618b2c8d
...@@ -269,9 +269,8 @@ void vesa_store_edid(void) ...@@ -269,9 +269,8 @@ void vesa_store_edid(void)
we genuinely have to assume all registers are destroyed here. */ we genuinely have to assume all registers are destroyed here. */
asm("pushw %%es; movw %2,%%es; "INT10"; popw %%es" asm("pushw %%es; movw %2,%%es; "INT10"; popw %%es"
: "+a" (ax), "+b" (bx) : "+a" (ax), "+b" (bx), "+c" (cx), "+D" (di)
: "c" (cx), "D" (di) : : "esi", "edx");
: "esi");
if (ax != 0x004f) if (ax != 0x004f)
return; /* No EDID */ return; /* No EDID */
...@@ -285,9 +284,9 @@ void vesa_store_edid(void) ...@@ -285,9 +284,9 @@ void vesa_store_edid(void)
dx = 0; /* EDID block number */ dx = 0; /* EDID block number */
di =(size_t) &boot_params.edid_info; /* (ES:)Pointer to block */ di =(size_t) &boot_params.edid_info; /* (ES:)Pointer to block */
asm(INT10 asm(INT10
: "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info) : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info),
: "c" (cx), "D" (di) "+c" (cx), "+D" (di)
: "esi"); : : "esi");
#endif /* CONFIG_FIRMWARE_EDID */ #endif /* CONFIG_FIRMWARE_EDID */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment