From patchwork Sun Aug 16 17:51:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Gamal X-Patchwork-Id: 41799 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 n7GHqLGB029394 for ; Sun, 16 Aug 2009 17:52:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755354AbZHPRvq (ORCPT ); Sun, 16 Aug 2009 13:51:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755230AbZHPRvq (ORCPT ); Sun, 16 Aug 2009 13:51:46 -0400 Received: from mail-bw0-f222.google.com ([209.85.218.222]:61578 "EHLO mail-bw0-f222.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753335AbZHPRvo (ORCPT ); Sun, 16 Aug 2009 13:51:44 -0400 Received: by bwz22 with SMTP id 22so1934397bwz.18 for ; Sun, 16 Aug 2009 10:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=PEK+Ltb4YVtlOBaxEraKayHFEAuSp0oorip4isLT+3Y=; b=TZhYDJ2xG01m82JiVkPJliDx5Jb5vL7j7Ph0Sgoo0ok6qnl4DeZA4AcrCUnc0ERJPj F33h2TCMY0jjJlGCPyIqkoJPRrci6UOMOwLy0rzjBZvYKM3Ys6gTsB5kDtxorflxIIz5 ipsKL+pHIZfk3T08XLnB6tzGpBkVz6MjZp7s4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=Pf4zsaP/psx2dZrppO05b/NUUxsdoED4BGyqSqDpE1Zx76h0OGJ2c0LSwk3z4ys8rp 9jNz+LyPM1zPPSWOavppHtPdYn6haiO9Vot4I/6K6drD+PG/w5+CkdGkgz7sUw/WfT9X w1IHzoz/dS1HB0P+JcGqFJrfOEmF962aJNkNU= Received: by 10.103.222.1 with SMTP id z1mr1074472muq.54.1250445104327; Sun, 16 Aug 2009 10:51:44 -0700 (PDT) Received: from localhost ([188.51.87.106]) by mx.google.com with ESMTPS id e8sm15627331muf.6.2009.08.16.10.51.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 Aug 2009 10:51:43 -0700 (PDT) Date: Sun, 16 Aug 2009 20:51:41 +0300 From: Mohammed Gamal To: avi@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] Add push es instruction test in test harness Message-ID: <20090816175141.GA8516@mohd-laptop> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Mohammed Gamal --- kvm/user/test/x86/realmode.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index 755b5d1..041f0a5 100644 --- a/kvm/user/test/x86/realmode.c +++ b/kvm/user/test/x86/realmode.c @@ -468,6 +468,22 @@ void test_long_jmp() print_serial("Long JMP Test: FAIL\n"); } +void test_push_es() +{ + struct regs inregs = { 0 }, outregs; + + MK_INSN(push_es, "mov $0x231, %bx\n\t" //Just write a dummy value to see if it gets overwritten + "mov %ax, %es\n\t" + "push %es\n\t" + "pop %bx \n\t" + ); + exec_in_big_real_mode(&inregs, &outregs, + insn_push_es, + insn_push_es_end - insn_push_es); + if(!regs_equal(&inregs, &outregs, R_AX|R_BX) || outregs.ebx != outregs.eax) + print_serial("Push ES Test: FAIL\n"); +} + void test_null(void) { struct regs inregs = { 0 }, outregs; @@ -481,6 +497,7 @@ void start(void) test_null(); test_shld(); + test_push_es(); test_mov_imm(); test_cmp_imm(); test_add_imm();