From patchwork Thu May 9 14:23:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 2544231 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 3CA6EDFE75 for ; Thu, 9 May 2013 14:23:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755180Ab3EIOXr (ORCPT ); Thu, 9 May 2013 10:23:47 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:63484 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753190Ab3EIOXq (ORCPT ); Thu, 9 May 2013 10:23:46 -0400 Received: by mail-wi0-f178.google.com with SMTP id hm14so3169173wib.17 for ; Thu, 09 May 2013 07:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=aALDW3DKVPMt3V1pb3CRFTkdBzaEAHeO5OGfmm2BDu4=; b=fVJhQ5vaTYY1c8vP65aL+7TKiEeTx8kP/NINUDtdm+fE+l+wIw0THbDeBG65DWtuBq HAImZF1W/NTg3mmIM+ZZO0AndenL8yeMmtg6wGLHlH9ALVeirHaVEh6ZgSWIRW2kjE0k Wty+HcYRIfcVpnRIZzqbPm1Xlh0ILH/A20kr3ELDptzkihrbc8wSmbAGotHWSP3IJ8zX p5ay/AhG0VmsVTHpyua7OId0HnsfV7xdUnWZZJsqtCCx02LtFBRrLT+4AWzOIBzfU1+k QxoY3Zv4yJA6JGqkJ0OIkfT4pQcLzdn5DmhrQCZ4cuV6Cdju3y/wDBYcDxOBPUZs/XSA mhpg== X-Received: by 10.180.160.200 with SMTP id xm8mr17887495wib.23.1368109424375; Thu, 09 May 2013 07:23:44 -0700 (PDT) Received: from playground.lan (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPSA id q20sm4786961wiv.7.2013.05.09.07.23.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 May 2013 07:23:43 -0700 (PDT) From: Paolo Bonzini To: kvm@vger.kernel.org Subject: [PATCH kvm-unit-tests 1/2] realmode: restore DF at exit from exec_in_big_real_mode Date: Thu, 9 May 2013 16:23:33 +0200 Message-Id: <1368109414-6458-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1368109414-6458-1-git-send-email-pbonzini@redhat.com> References: <1368109414-6458-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Some tests fail if DF=1. Restore it directly after executing the test, do not do it "magically" in print_serial. Signed-off-by: Paolo Bonzini --- x86/realmode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x86/realmode.c b/x86/realmode.c index 35ace08..71c8a7d 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -26,7 +26,7 @@ static void print_serial(const char *buf) { unsigned long len = strlen(buf); - asm volatile ("cld; addr32/rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1)); + asm volatile ("addr32/rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1)); } static void exit(int code) @@ -109,6 +109,8 @@ static void exec_in_big_real_mode(struct insn_desc *insn) "pushfl \n\t" "popl %[save]+36 \n\t" + /* Restore DF as required by the harness code */ + "cld\n\t" "xor %[tmp], %[tmp] \n\t" "mov %[tmp], %%gs \n\t" : [tmp]"=&r"(tmp), [save]"+m"(save)