[PATCH 3/3] test: realmode: fix pusha test stack

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

 



pusha needs some stack space, or it will fault.  The supplied value of 7 is too
small.

Provide a real stack for pusha.

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

diff --git a/kvm/test/x86/realmode.c b/kvm/test/x86/realmode.c
index c4a2e1e..587f331 100644
--- a/kvm/test/x86/realmode.c
+++ b/kvm/test/x86/realmode.c
@@ -820,9 +820,14 @@ void test_null(void)
 		print_serial("null test: PASS\n");
 }
 
+struct {
+    char stack[500];
+    char top[];
+} tmp_stack;
+
 void test_pusha_popa()
 {
-	struct regs inregs = { .eax = 0, .ebx = 1, .ecx = 2, .edx = 3, .esi = 4, .edi = 5, .ebp = 6, .esp = 7}, outregs;
+	struct regs inregs = { .eax = 0, .ebx = 1, .ecx = 2, .edx = 3, .esi = 4, .edi = 5, .ebp = 6, .esp = (unsigned long)&tmp_stack.top }, outregs;
 
 	MK_INSN(pusha, "pusha\n\t"
 		       "pop %edi\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