From patchwork Sun Apr 5 07:05:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 16389 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3575hUg010988 for ; Sun, 5 Apr 2009 07:05:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758050AbZDEHF3 (ORCPT ); Sun, 5 Apr 2009 03:05:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757952AbZDEHF2 (ORCPT ); Sun, 5 Apr 2009 03:05:28 -0400 Received: from mx2.redhat.com ([66.187.237.31]:35354 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757927AbZDEHF1 (ORCPT ); Sun, 5 Apr 2009 03:05:27 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3575H6a005087 for ; Sun, 5 Apr 2009 03:05:20 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3575I7o012609; Sun, 5 Apr 2009 03:05:19 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3575GBG014137; Sun, 5 Apr 2009 03:05:17 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 587) id 0613118D41D; Sun, 5 Apr 2009 10:05:16 +0300 (IDT) Date: Sun, 5 Apr 2009 10:05:16 +0300 From: Gleb Natapov To: avi@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] test long JMP emulation Message-ID: <20090405070515.GI4013@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Goes on top of Jcc tests patch. Signed-off-by: Gleb Natapov --- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/user/test/x86/realmode.c b/user/test/x86/realmode.c index 336ba1c..755b5d1 100644 --- a/user/test/x86/realmode.c +++ b/user/test/x86/realmode.c @@ -451,6 +451,23 @@ void test_jcc_near(void) print_serial("JMP near Test 1: FAIL\n"); } +void test_long_jmp() +{ + struct regs inregs = { 0 }, outregs; + u32 esp[16]; + + inregs.esp = (u32)esp; + MK_INSN(long_jmp, "call 1f\n\t" + "jmp 2f\n\t" + "1: jmp $0, $test_function\n\t" + "2:\n\t"); + exec_in_big_real_mode(&inregs, &outregs, + insn_long_jmp, + insn_long_jmp_end - insn_long_jmp); + if(!regs_equal(&inregs, &outregs, R_AX) || outregs.eax != 0x1234) + print_serial("Long JMP Test: FAIL\n"); +} + void test_null(void) { struct regs inregs = { 0 }, outregs; @@ -473,6 +490,8 @@ void start(void) test_jcc_near(); /* test_call() uses short jump so call it after testing jcc */ test_call(); + /* long jmp test uses call near so test it after testing call */ + test_long_jmp(); exit(0); }