[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/20] pci: Honour wmask when resetting PCI_INTERRUPT_LINE
From: |
John Snow |
Subject: |
[PULL 07/20] pci: Honour wmask when resetting PCI_INTERRUPT_LINE |
Date: |
Tue, 17 Mar 2020 19:23:16 -0400 |
From: BALATON Zoltan <address@hidden>
The pci_do_device_reset() function (called from pci_device_reset)
clears the PCI_INTERRUPT_LINE config reg of devices on the bus but did
this without taking wmask into account. We'll have a device model now
that needs to set a constant value for this reg and this patch allows
to do that without additional workaround in device emulation to
reverse the effect of this PCI bus reset function.
Suggested-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: BALATON Zoltan <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Mark Cave-Ayland <address@hidden>
Tested-by: BALATON Zoltan <address@hidden>
Signed-off-by: Mark Cave-Ayland <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
hw/pci/pci.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index e1ed6677e1..b5bc842fac 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -302,8 +302,11 @@ static void pci_do_device_reset(PCIDevice *dev)
pci_word_test_and_clear_mask(dev->config + PCI_STATUS,
pci_get_word(dev->wmask + PCI_STATUS) |
pci_get_word(dev->w1cmask + PCI_STATUS));
+ /* Some devices make bits of PCI_INTERRUPT_LINE read only */
+ pci_byte_test_and_clear_mask(dev->config + PCI_INTERRUPT_LINE,
+ pci_get_word(dev->wmask + PCI_INTERRUPT_LINE) |
+ pci_get_word(dev->w1cmask + PCI_INTERRUPT_LINE));
dev->config[PCI_CACHE_LINE_SIZE] = 0x0;
- dev->config[PCI_INTERRUPT_LINE] = 0x0;
for (r = 0; r < PCI_NUM_REGIONS; ++r) {
PCIIORegion *region = &dev->io_regions[r];
if (!region->size) {
--
2.21.1
- [PULL 00/20] Ide patches, John Snow, 2020/03/17
- [PULL 01/20] cmd646: register cmd646_reset() function in DeviceClass, John Snow, 2020/03/17
- [PULL 02/20] cmd646: register vmstate_ide_pci VMStateDescription in DeviceClass, John Snow, 2020/03/17
- [PULL 03/20] dp264: use pci_create_simple() to initialise the cmd646 device, John Snow, 2020/03/17
- [PULL 04/20] cmd646: remove unused pci_cmd646_ide_init() function, John Snow, 2020/03/17
- [PULL 05/20] via-ide: move registration of VMStateDescription to DeviceClass, John Snow, 2020/03/17
- [PULL 06/20] ide/via: Get rid of via_ide_init(), John Snow, 2020/03/17
- [PULL 07/20] pci: Honour wmask when resetting PCI_INTERRUPT_LINE,
John Snow <=
- [PULL 08/20] via-ide: ensure that PCI_INTERRUPT_LINE is hard-wired to its default value, John Snow, 2020/03/17
- [PULL 09/20] via-ide: initialise IDE controller in legacy mode, John Snow, 2020/03/17
- [PULL 10/20] via-ide: allow guests to write to PCI_CLASS_PROG, John Snow, 2020/03/17
- [PULL 11/20] via-ide: always use legacy IRQ 14/15 routing, John Snow, 2020/03/17
- [PULL 12/20] hd-geo-test: Clean up use of buf[] in create_qcow2_with_mbr(), John Snow, 2020/03/17
- [PULL 13/20] hw/ide: Get rid of piix3_init functions, John Snow, 2020/03/17
- [PULL 14/20] hw/isa/piix4.c: Introduce variable to store devfn, John Snow, 2020/03/17
- [PULL 15/20] hw/ide: Get rid of piix4_init function, John Snow, 2020/03/17
- [PULL 16/20] hw/ide: Remove now unneded #include "hw/pci/pci.h" from hw/ide.h, John Snow, 2020/03/17
- [PULL 17/20] hw/ide/pci.c: Coding style update to fix checkpatch errors, John Snow, 2020/03/17