From: Olaf Hering <olaf@aepfle.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Bernhard Beschow" <shentey@gmail.com>,
qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Kevin Wolf" <kwolf@redhat.com>,
"Lev Kujawski" <lkujaw@member.fsf.org>,
qemu-block@nongnu.org, "John Snow" <jsnow@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH v2] hw/ide/piix: properly initialize the BMIBA register
Date: Wed, 5 Jul 2023 12:01:21 +0200 [thread overview]
Message-ID: <20230705120121.4f353ba6.olaf@aepfle.de> (raw)
In-Reply-To: <dded4d33-d64f-9369-0742-a57a1e173153@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
Tue, 4 Jul 2023 08:38:33 +0200 Paolo Bonzini <pbonzini@redhat.com>:
> I agree that calling pci_device_reset() would be a better match for
> pci_xen_ide_unplug().
This change works as well:
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -164,8 +164,9 @@ static void pci_unplug_nics(PCIBus *bus)
*
* [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/misc/hvm-emulated-unplug.pandoc
*/
-static void pci_xen_ide_unplug(DeviceState *dev, bool aux)
+static void pci_xen_ide_unplug(PCIDevice *d, bool aux)
{
+ DeviceState *dev = DEVICE(d);
PCIIDEState *pci_ide;
int i;
IDEDevice *idedev;
@@ -195,7 +196,7 @@ static void pci_xen_ide_unplug(DeviceState *dev, bool aux)
blk_unref(blk);
}
}
- device_cold_reset(dev);
+ pci_device_reset(d);
}
static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque)
@@ -210,7 +211,7 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque)
switch (pci_get_word(d->config + PCI_CLASS_DEVICE)) {
case PCI_CLASS_STORAGE_IDE:
- pci_xen_ide_unplug(DEVICE(d), aux);
+ pci_xen_ide_unplug(d, aux);
break;
case PCI_CLASS_STORAGE_SCSI:
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -118,7 +118,6 @@ static void piix_ide_reset(DeviceState *dev)
pci_set_word(pci_conf + PCI_COMMAND, 0x0000);
pci_set_word(pci_conf + PCI_STATUS,
PCI_STATUS_DEVSEL_MEDIUM | PCI_STATUS_FAST_BACK);
- pci_set_byte(pci_conf + 0x20, 0x01); /* BMIBA: 20-23h */
}
static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp)
Olaf
[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-07-05 10:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-01 17:46 [PATCH v2] hw/ide/piix: properly initialize the BMIBA register Olaf Hering
2023-07-02 22:18 ` Bernhard Beschow
2023-07-03 7:59 ` Olaf Hering
2023-07-03 20:33 ` Bernhard Beschow
2023-07-04 6:38 ` Paolo Bonzini
2023-07-05 10:01 ` Olaf Hering [this message]
2023-07-05 21:52 ` Bernhard Beschow
2023-07-11 9:11 ` Olaf Hering
2023-07-11 19:06 ` Bernhard Beschow
2023-07-17 8:46 ` Bernhard Beschow
2023-07-17 8:52 ` Olaf Hering
2023-07-17 11:03 ` Olaf Hering
2023-07-17 18:55 ` Bernhard Beschow
2023-07-11 19:04 ` Bernhard Beschow
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=20230705120121.4f353ba6.olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=lkujaw@member.fsf.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=shentey@gmail.com \
/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 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).