All of lore.kernel.org
 help / color / mirror / Atom feed
From: "zhaoxin\\RockCuioc" <RockCui-oc@zhaoxin.com>
To: <qemu-devel@nongnu.org>
Cc: CobeChen@zhaoxin.com, John Snow <jsnow@redhat.com>,
	"open list:IDE" <qemu-block@nongnu.org>,
	"zhaoxin\\rockcuioc" <RockCui-oc@zhaoxin.com>
Subject: [PATCH] ide:do nothing for identify cmd if no any device attached
Date: Fri, 14 Aug 2020 12:36:57 +0800	[thread overview]
Message-ID: <20200814043657.5815-1-RockCui-oc@zhaoxin.com> (raw)

From: "zhaoxin\\rockcuioc" <RockCui-oc@zhaoxin.com>

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 driver
would poll 0x1f7 for a while. This action may be stop windows LOGO atomic for
a while too on a poor performance CPU.

Signed-off-by: zhaoxin\RockCuioc <RockCui-oc@zhaoxin.com>
---
 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 = idebus_active_if(bus);
     trace_ide_exec_cmd(bus, s, val);
 
-    /* ignore commands to non existent slave */
-    if (s != 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 != bus->ifs && !s->blk)) {
         return;
     }
 
-- 
2.17.1



             reply	other threads:[~2020-08-14 13:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14  4:36 zhaoxin\RockCuioc [this message]
2020-08-14 15:25 ` [PATCH] ide:do nothing for identify cmd if no any device attached no-reply
2020-08-14 15:43 ` no-reply
2020-08-17  3:38 zhaoxin\RockCuioc
2020-08-17  4:15 ` no-reply
2020-09-02 18:02 ` John Snow
2020-09-03 10:40   ` Max Reitz
2020-10-02 19:37     ` John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200814043657.5815-1-RockCui-oc@zhaoxin.com \
    --to=rockcui-oc@zhaoxin.com \
    --cc=CobeChen@zhaoxin.com \
    --cc=jsnow@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.