qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide:do nothing for identify cmd if no any device attached
@ 2020-08-17  3:38 zhaoxin\RockCuioc
  2020-08-17  4:15 ` no-reply
  2020-09-02 18:02 ` John Snow
  0 siblings, 2 replies; 7+ messages in thread
From: zhaoxin\RockCuioc @ 2020-08-17  3:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: CobeChen

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..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 = 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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-12  7:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-17  3:38 [PATCH] ide:do nothing for identify cmd if no any device attached zhaoxin\RockCuioc
2020-08-17  4:15 ` no-reply
2020-09-02 18:02 ` John Snow
2020-09-03 10:40   ` Max Reitz
2020-09-09  3:13     ` 答复: " RockCui-oc
2020-10-02 19:37     ` John Snow
2020-11-12  7:29       ` 答复: " RockCui-oc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).