From nobody Sun Oct 5 00:52:11 2025 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=1597413375; cv=none; d=zohomail.com; s=zohoarc; b=hMCgAScBGVIh33y5wxV0HTuWAhWK6U++Iu5tGfU9LZS2nhRa+Fh56aGzgmZ3TfAaFQNR4OGmxg6IozutKuoEFfzGTRyeChxR/7Fp1up2D6oZ/QaFz2Ybx/r5OX+l69gM4GPwBOi/nLZjc/MaCt5NCJVEk+sYCtINLKaKtP3VHwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597413375; 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=W9j4MrZrGZLDnL1tk+0mfXW5Q+dBuijBNR0RRrhaic4=; b=VoP4/c4MvMRuKh6xMEfjJbpE58Cp3pugsdu4Awc9549r5elDFrzmPh3NcihJEZYO7ZRKzvpYa3KG5Oni9KmOBjy829alGfvp+7f7sqdCgNFm+jwhpWvNFwCbLwEcNklzgxcAcM+XACOuLPoogwABK54IBNloP9bJAizhplXUVH8= 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 1597413374586709.9435012327395; Fri, 14 Aug 2020 06:56:14 -0700 (PDT) Received: from localhost ([::1]:40888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6Zrt-0006bp-PW for importer@patchew.org; Fri, 14 Aug 2020 09:35:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6Rix-0003mV-Qx; Fri, 14 Aug 2020 00:53:51 -0400 Received: from [203.148.12.82] (port=34281 helo=ZXSHCAS2.zhaoxin.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6Riv-0006o6-4H; Fri, 14 Aug 2020 00:53:51 -0400 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS2.zhaoxin.com (10.28.252.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 14 Aug 2020 12:37:06 +0800 Received: from zhaoxin-ubuntu20.04 (114.242.249.230) 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; Fri, 14 Aug 2020 12:37:04 +0800 From: "zhaoxin\\RockCuioc" To: Subject: [PATCH] ide:do nothing for identify cmd if no any device attached Date: Fri, 14 Aug 2020 12:36:57 +0800 Message-ID: <20200814043657.5815-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: [114.242.249.230] 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.82 (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.82; envelope-from=RockCui-oc@zhaoxin.com; helo=ZXSHCAS2.zhaoxin.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/14 00:37:07 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-Mailman-Approved-At: Fri, 14 Aug 2020 09:34:36 -0400 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, John Snow , "open list:IDE" , "zhaoxin\\rockcuioc" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "zhaoxin\\rockcuioc" 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..07968aadfd 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) ||=20 + (s !=3D bus->ifs && !s->blk)) { return; } =20 --=20 2.17.1