From patchwork Thu May 9 14:55:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 2544351 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 F10E5DF24C for ; Thu, 9 May 2013 14:55:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755748Ab3EIOz1 (ORCPT ); Thu, 9 May 2013 10:55:27 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:46236 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755032Ab3EIOzR (ORCPT ); Thu, 9 May 2013 10:55:17 -0400 Received: by mail-wi0-f171.google.com with SMTP id hn3so372051wib.4 for ; Thu, 09 May 2013 07:55:16 -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=4QChhzOLRbtk/g0RH96buDgLwsBnpAYzLd7PPseg8qY=; b=L4fLQi9W1sXx/bcuUiIMpOMA6/t2ULiN0oDYAEwkVULoQ1+N09WJ4+7NG6L+fdQ2/x 5bpxsxunA3G9s2IArZF+DMSdwUJtCHB5qOFxCzKQzWOV+L8Wi1nG35XkrbdZPIH983v2 msjMkVsXne4Yz19wA0WKJNtD7CEVelXdnYFK4DBWWlhE5QKGiAV0HSVXkDjnsuQtoo2t cYBnicGleho4TCoEs5SFb2K2PDgJqMPq8ycr5sgM9iCHUPDw/xIRz77T6HL6dJrxhx6m jp8a6F/vdCZQsvz8RE+2jaF1xs2sqLsDBAQxcL5Uv5SyZKbHBBCzYE1nMJ4bIkwzamOD PrHA== X-Received: by 10.194.158.37 with SMTP id wr5mr18652698wjb.23.1368111312607; Thu, 09 May 2013 07:55:12 -0700 (PDT) Received: from playground.lan (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPSA id q20sm4969266wiv.7.2013.05.09.07.55.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 May 2013 07:55:11 -0700 (PDT) From: Paolo Bonzini To: kvm@vger.kernel.org Subject: [PATCH kvm-unit-tests v2 1/3] realmode: restore DF at exit from exec_in_big_real_mode Date: Thu, 9 May 2013 16:55:03 +0200 Message-Id: <1368111305-9076-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1368111305-9076-1-git-send-email-pbonzini@redhat.com> References: <1368111305-9076-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 for the harness code */ + "cld\n\t" "xor %[tmp], %[tmp] \n\t" "mov %[tmp], %%gs \n\t" : [tmp]"=&r"(tmp), [save]"+m"(save)