From: Avi Kivity Subject: [PATCH 3/3] test: realmode: fix pusha test stack Date: Sun, 25 Jul 2010 14:39:46 +0300 Message-ID: <1280057986-6815-4-git-send-email-avi@redhat.com> References: <1280057986-6815-1-git-send-email-avi@redhat.com> To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52996 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751881Ab0GYLjs (ORCPT ); Sun, 25 Jul 2010 07:39:48 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6PBdlEo011797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 25 Jul 2010 07:39:48 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6PBdlBN018391 for ; Sun, 25 Jul 2010 07:39:47 -0400 In-Reply-To: <1280057986-6815-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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