From patchwork Wed Aug 22 14:56:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1361591 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3C9DADF280 for ; Wed, 22 Aug 2012 14:56:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756727Ab2HVO4K (ORCPT ); Wed, 22 Aug 2012 10:56:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46307 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756663Ab2HVO4I (ORCPT ); Wed, 22 Aug 2012 10:56:08 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7MEu8mf007359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 22 Aug 2012 10:56:08 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7MEu6W9032747; Wed, 22 Aug 2012 10:56:07 -0400 From: Avi Kivity To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [PATCH kvm-unit-tests] realmode: test that stack operations ignore the high word of %esp if ss.b is set Date: Wed, 22 Aug 2012 17:56:04 +0300 Message-Id: <1345647364-15894-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Avi Kivity --- x86/realmode.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/x86/realmode.c b/x86/realmode.c index 710a06b..82a66b3 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -554,6 +554,11 @@ void test_push_pop() "mov %fs, %ebx\n\t" "pop %fs\n\t" ); + MK_INSN(push_pop_high_esp_bits, + "xor $0x12340000, %esp \n\t" + "push %ax; \n\t" + "xor $0x12340000, %esp \n\t" + "pop %bx"); inregs = (struct regs){ 0 }; @@ -577,6 +582,11 @@ void test_push_pop() exec_in_big_real_mode(&insn_push_pop_fs); report("push/pop 6", R_AX|R_BX, outregs.ebx == outregs.eax); + + inregs.eax = 0x9977; + inregs.ebx = 0x7799; + exec_in_big_real_mode(&insn_push_pop_high_esp_bits); + report("push/pop with high bits set in %esp", R_BX, outregs.ebx == 0x9977); } void test_null(void)