From: Avi Kivity Subject: [PATCH 4/5] realmode: fix esp in long jump test Date: Sun, 22 Aug 2010 17:52:39 +0300 Message-ID: <1282488760-22162-5-git-send-email-avi@redhat.com> References: <1282488760-22162-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]:18058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300Ab0HVOwm (ORCPT ); Sun, 22 Aug 2010 10:52:42 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7MEqgm6003829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 22 Aug 2010 10:52:42 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7MEqfDD013397 for ; Sun, 22 Aug 2010 10:52:41 -0400 In-Reply-To: <1282488760-22162-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: esp needs to point at the end of the stack, or it will corrupt memory. Signed-off-by: Avi Kivity --- 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