From patchwork Mon Mar 1 14:14:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 82933 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o21EErw2010859 for ; Mon, 1 Mar 2010 14:14:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750873Ab0CAOOv (ORCPT ); Mon, 1 Mar 2010 09:14:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8810 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750798Ab0CAOOu (ORCPT ); Mon, 1 Mar 2010 09:14:50 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o21EEmpZ007002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Mar 2010 09:14:50 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o21EEkMn007793; Mon, 1 Mar 2010 09:14:47 -0500 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 3DB7F18D450; Mon, 1 Mar 2010 16:14:46 +0200 (IST) Date: Mon, 1 Mar 2010 16:14:46 +0200 From: Gleb Natapov To: mtosatti@redhat.com, avi@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] fix realmode.c emulator test Message-ID: <20100301141446.GM16909@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 01 Mar 2010 14:14:53 +0000 (UTC) diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index 9bf6cb0..bc6b27f 100644 --- a/kvm/user/test/x86/realmode.c +++ b/kvm/user/test/x86/realmode.c @@ -87,7 +87,7 @@ static void exec_in_big_real_mode(const struct regs *inregs, "xchg %%esp, %[save]+24 \n\t" "xchg %%ebp, %[save]+28 \n\t" - "test_insn: . = . + 16\n\t" + "test_insn: . = . + 32\n\t" "test_insn_end: \n\t" "xchg %%eax, %[save]+0 \n\t" @@ -134,10 +134,10 @@ int regs_equal(const struct regs *r1, const struct regs *r2, int ignore) #define MK_INSN(name, str) \ asm ( \ - ".pushsection \".text\" \n\t" \ + ".text 1\n\t" \ "insn_" #name ": " str " \n\t" \ "insn_" #name "_end: \n\t" \ - ".popsection \n\t" \ + ".text\n\t" \ ); \ extern u8 insn_##name[], insn_##name##_end[] @@ -293,25 +293,31 @@ void test_io(void) { struct regs inregs = { 0 }, outregs; MK_INSN(io_test1, "mov $0xff, %al \n\t" - "out %al, $0x10 \n\t" - "in $0x10, %al \n\t"); + "out %al, $0xe0 \n\t" + "mov $0x00, %al \n\t" + "in $0xe0, %al \n\t"); MK_INSN(io_test2, "mov $0xffff, %ax \n\t" - "out %ax, $0x10 \n\t" - "in $0x10, %ax \n\t"); + "out %ax, $0xe0 \n\t" + "mov $0x0000, %ax \n\t" + "in $0xe0, %ax \n\t"); MK_INSN(io_test3, "mov $0xffffffff, %eax \n\t" - "out %eax, $0x10 \n\t" - "in $0x10, %eax \n\t"); - MK_INSN(io_test4, "mov $0x10, %dx \n\t" + "out %eax, $0xe0 \n\t" + "mov $0x000000, %eax \n\t" + "in $0xe0, %eax \n\t"); + MK_INSN(io_test4, "mov $0xe0, %dx \n\t" "mov $0xff, %al \n\t" "out %al, %dx \n\t" + "mov $0x00, %al \n\t" "in %dx, %al \n\t"); - MK_INSN(io_test5, "mov $0x10, %dx \n\t" + MK_INSN(io_test5, "mov $0xe0, %dx \n\t" "mov $0xffff, %ax \n\t" "out %ax, %dx \n\t" + "mov $0x0000, %ax \n\t" "in %dx, %ax \n\t"); - MK_INSN(io_test6, "mov $0x10, %dx \n\t" + MK_INSN(io_test6, "mov $0xe0, %dx \n\t" "mov $0xffffffff, %eax \n\t" "out %eax, %dx \n\t" + "mov $0x00000000, %eax \n\t" "in %dx, %eax \n\t"); exec_in_big_real_mode(&inregs, &outregs,