[PATCH 4/5] realmode: fix esp in long jump test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 x86/realmode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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"
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux