From nobody Mon May 13 19:26:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1597635928; cv=none; d=zohomail.com; s=zohoarc; b=eBJ74V6GJ+RZK/tVU/JIF/mnZeEwkPkOt7i4BJYzjjPIRxcjrj5TazkqwmB1IF+P8PPHTc37/horABBuOpXAt4G4SWQzDllbVR718F8wAhMpjM2KaDUDNjpM8uoEVeZTOL5p21xmV/1RD2DyF+UbOg1lUMQonfT2bbvYyDPbTOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597635928; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=70rMjcQ6Pf9TO9ZtNgB2UBipC90AD7jQylpO5tInbO4=; b=miF72KlMP+1pn4LBGilR534X2OWKhjThmeK6ef6kfATWgVzkffJ9c5rkIa8Y1f0svpWyTndzXTwdmfEMFi8EaQv19d1RCUhsY05jw0ovuFlp/XoADeoxnlURL/ImyUrHgL92FyQ+ya36MGqsSCrw91pwN1yHOkj3OLHDTgNbO6s= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597635928065889.4113677971922; Sun, 16 Aug 2020 20:45:28 -0700 (PDT) Received: from localhost ([::1]:43462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7W5O-00018g-53 for importer@patchew.org; Sun, 16 Aug 2020 23:45:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7W4i-0000jJ-9F for qemu-devel@nongnu.org; Sun, 16 Aug 2020 23:44:44 -0400 Received: from [203.148.12.81] (port=12059 helo=ZXSHCAS1.zhaoxin.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7W4f-00053x-Jz for qemu-devel@nongnu.org; Sun, 16 Aug 2020 23:44:43 -0400 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 17 Aug 2020 11:38:14 +0800 Received: from zhaoxin-ubuntu20.04 (124.64.19.137) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 17 Aug 2020 11:38:13 +0800 From: "zhaoxin\\RockCuioc" To: Subject: [PATCH] ide:do nothing for identify cmd if no any device attached Date: Mon, 17 Aug 2020 11:38:03 +0800 Message-ID: <20200817033803.14014-1-RockCui-oc@zhaoxin.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [124.64.19.137] X-ClientProxiedBy: ZXSHCAS1.zhaoxin.com (10.28.252.161) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Host-Lookup-Failed: Reverse DNS lookup failed for 203.148.12.81 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=203.148.12.81; envelope-from=RockCui-oc@zhaoxin.com; helo=ZXSHCAS1.zhaoxin.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/16 23:38:19 X-ACL-Warn: Detected OS = Windows 7 or 8 [fuzzy] X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CobeChen@zhaoxin.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This patch is for avoiding win7 IDE driver polling 0x1f7 when no any device attached. During Win7 VM boot procedure, if use virtio for disk and there is no any device be attached on hda & hdb, the win7 IDE driv= er would poll 0x1f7 for a while. This action may be stop windows LOGO atomic f= or a while too on a poor performance CPU. Signed-off-by: zhaoxin\RockCuioc --- hw/ide/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index d997a78e47..26d86f4b40 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2073,8 +2073,9 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) s =3D idebus_active_if(bus); trace_ide_exec_cmd(bus, s, val); =20 - /* ignore commands to non existent slave */ - if (s !=3D bus->ifs && !s->blk) { + /* ignore commands if no any device exist or non existent slave */ + if ((!bus->ifs[0].blk && !bus->ifs[1].blk) || + (s !=3D bus->ifs && !s->blk)) { return; } =20 --=20 2.17.1