[kvm-unit-tests v2 PATCH 2/2] x86: realmode: fix esp in call 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: Bill Wendling <morbo@xxxxxxxxxx>

This is a port of Avi Kivity patch for the long jump test:
4aa229495b0e4159642b4a77e9adfdc81501c095.

Signed-off-by: Bill Wendling <morbo@xxxxxxxxxx>
---
 x86/realmode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x86/realmode.c b/x86/realmode.c
index 41b8592..f318910 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -520,7 +520,7 @@ static void test_call(void)
 	u32 addr;
 
 	inregs = (struct regs){ 0 };
-	inregs.esp = (u32)esp;
+	inregs.esp = (u32)(esp+16);
 
 	MK_INSN(call1, "mov $test_function, %eax \n\t"
 		       "call *%eax\n\t");
-- 
2.23.0.700.g56cf767bdb-goog




[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