From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25929C43219 for ; Tue, 30 Apr 2019 15:06:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E63AE20652 for ; Tue, 30 Apr 2019 15:06:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=zoho.com header.i=strongbox8@zoho.com header.b="l7eqyrh5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726206AbfD3PGU (ORCPT ); Tue, 30 Apr 2019 11:06:20 -0400 Received: from sender-pp-092.zoho.com ([135.84.80.237]:25410 "EHLO sender-pp-o92.zoho.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725906AbfD3PGU (ORCPT ); Tue, 30 Apr 2019 11:06:20 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1556634062; cv=none; d=zoho.com; s=zohoarc; b=FekgT0yaoJTctRbEqW1SPQP+2EyMyVLnIk+jFPDwuwkRFyZeiaGlVsQcfK6kKGs5srwRz46tPuJTfeBB5ltW72KkBhuFXkzNQDvgSjM0mVBgJQsYo2H8uK5xcvsm+BN4x+HhaLIkMW8hIICe/8VIP2W/sA4cZ34YKBHTmvPHK4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556634062; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=K5BzyEqf24wVQe40Lud47ZVAeu3TYSMvcKqwIoHWhsQ=; b=DZxtfUb3RAvB/+5+saUGnk5PJyXA0E6E8QZK1AbGNJ8xT1J9C0vZFeAtBTt75MDLTllPW37bKv1VppsawEuWWLQvs643BHHMwo/DaRaQYYoVrKXwHyzNgcy7RbX1SAxiJT4asdDvCfAENeo+ETzLSoW3GI5DWi4afJwLgVor4d4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=strongbox8@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:message-id:subject:date:mime-version:content-type; b=LO7DJBJFTxshes/zPiT1qmQZpcE/5taXzgE75P3UwqIHDKWzcLRxKmA+DeDIx3BgVzKwkYAQqKhB DnMimChn5Do1y1RKMT8yWmhPBC6dp25PwbyQD8SpWbKsEO6wR8xR DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1556634062; s=default; d=zoho.com; i=strongbox8@zoho.com; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Transfer-Encoding:Content-Type; l=1352; bh=K5BzyEqf24wVQe40Lud47ZVAeu3TYSMvcKqwIoHWhsQ=; b=l7eqyrh568GmCaIvp38TDBukNpIyFXmgwrAMPIfQb4aFP3f2HY3vY6ZVZKIb7lIM PMu12LiE/W31YzMWXRANWwGBrC+1HACSfDBaXVT/8K8kbFwAsCLKsldZ41MKX6vv/lm uFHAmaPVWdRJ6IvVHImfQ76dz1xdmDapdp3pEbs8= Received: from archlinux.localdomain (180.97.206.46 [180.97.206.46]) by mx.zohomail.com with SMTPS id 1556634059124564.1015564377054; Tue, 30 Apr 2019 07:20:59 -0700 (PDT) From: Perr Zhang To: pbonzini@redhat.com Cc: rkrcmar@redhat.com, tglx@linutronix.de, stable@vger.kernel.org, mingo@redhat.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20190430142056.3133-1-strongbox8@zoho.com> Subject: [PATCH] KVM: x86: revert the order of calls in kvm_fast_pio() Date: Tue, 30 Apr 2019 22:20:56 +0800 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset=utf8 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org In commit 45def77ebf79, the order of function calls in kvm_fast_pio() was changed. This causes that the vm(XP,and also XP's iso img) failed to boot. This doesn't happen with win10 or ubuntu. After revert the order, the vm(XP) succeedes to boot. In addition, the change of calls's order of kvm_fast_pio() in commit 45def77ebf79 has no obvious reason. Fixes: 45def77ebf79 ("KVM: x86: update %rip after emulating IO") Cc: Signed-off-by: Perr Zhang --- arch/x86/kvm/x86.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a0d1fc80ac5a..248753cb94a1 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6610,13 +6610,12 @@ static int kvm_fast_pio_in(struct kvm_vcpu *vcpu, i= nt size, =20 int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int= in) { -=09int ret; +=09int ret =3D kvm_skip_emulated_instruction(vcpu); =20 =09if (in) -=09=09ret =3D kvm_fast_pio_in(vcpu, size, port); +=09=09return kvm_fast_pio_in(vcpu, size, port) && ret; =09else -=09=09ret =3D kvm_fast_pio_out(vcpu, size, port); -=09return ret && kvm_skip_emulated_instruction(vcpu); +=09=09return kvm_fast_pio_out(vcpu, size, port) && ret; } EXPORT_SYMBOL_GPL(kvm_fast_pio); =20 --=20 2.21.0