From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH kvm-unit-tests] realmode: test AAM, XLAT, SALC Date: Thu, 9 May 2013 12:20:10 +0300 Message-ID: <20130509092010.GA32023@redhat.com> References: <1368089617-11098-1-git-send-email-pbonzini@redhat.com> <20130509091324.GA31410@redhat.com> <518B69CF.2020009@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:65166 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752933Ab3EIJX5 (ORCPT ); Thu, 9 May 2013 05:23:57 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r499NvaM006937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 May 2013 05:23:57 -0400 Content-Disposition: inline In-Reply-To: <518B69CF.2020009@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, May 09, 2013 at 11:18:07AM +0200, Paolo Bonzini wrote: > Il 09/05/2013 11:13, Gleb Natapov ha scritto: > > On Thu, May 09, 2013 at 10:53:37AM +0200, Paolo Bonzini wrote: > >> Signed-off-by: Paolo Bonzini > >> --- > >> x86/realmode.c | 40 ++++++++++++++++++++++++++++++++++++++++ > >> 1 file changed, 40 insertions(+) > >> > >> diff --git a/x86/realmode.c b/x86/realmode.c > >> index 91c93a9..35ace08 100644 > >> --- a/x86/realmode.c > >> +++ b/x86/realmode.c > >> @@ -1391,6 +1391,43 @@ static void test_aad(void) > >> report("aad", R_AX, outregs.eax == 0x123400d4); > >> } > >> > >> +static void test_aam(void) > >> +{ > >> + MK_INSN(aam, "aam"); > >> + > >> + inregs.eax = 0x76543210; > >> + exec_in_big_real_mode(&insn_aam); > >> + report("aam", R_AX, outregs.eax == 0x76540106); > >> +} > >> + > >> +static void test_xlat(void) > >> +{ > >> + MK_INSN(xlat, "xlat"); > >> + u8 table[256]; > >> + int i; > >> + > >> + for (i = 0; i < 256; i++) { > >> + table[i] = i + 1; > >> + } > >> + > >> + inregs.eax = 0x89abcdef; > >> + inregs.ebx = (u32)table; > >> + exec_in_big_real_mode(&insn_xlat); > >> + report("xlat", R_AX, outregs.eax == 0x89abcdf0); > >> +} > >> + > >> +static void test_salc(void) > >> +{ > >> + MK_INSN(clc_salc, "clc; .byte 0xd6"); > >> + MK_INSN(stc_salc, "stc; .byte 0xd6"); > > Heh, who uses that? > > Some real-mode programs do. Plus, the "N" in the opcode table looked > really bad. :) > Ah, I thought sgabios use that one too. -- Gleb.