From: Avi Kivity <[email protected]>

esp needs to point at the end of the stack, or it will corrupt memory.

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/x86/realmode.c b/x86/realmode.c
index 5c62ec4..50eaa5e 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -541,7 +541,7 @@ void test_long_jmp()
        u32 esp[16];
 
        inregs = (struct regs){ 0 };
-       inregs.esp = (u32)esp;
+       inregs.esp = (u32)(esp+16);
        MK_INSN(long_jmp, "call 1f\n\t"
                          "jmp 2f\n\t"
                          "1: jmp $0, $test_function\n\t"
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to