From 154523a874e37f4ca26bc76e9f483b5de8fbc344 Mon Sep 17 00:00:00 2001 From: Shuo Liu Date: Mon, 5 Mar 2018 18:11:47 +0800 Subject: [PATCH] Ignore length of resource for PCI ROM request Writing PCIR_BIOS is to get PCI ROM resource length. Ingore the request as it's not support currently. Else, guest might get wrong information about the PCI ROM resource. Signed-off-by: Shuo Liu --- hw/pci/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/pci/core.c b/hw/pci/core.c index 9b87f3f81..73af37a2b 100644 --- a/hw/pci/core.c +++ b/hw/pci/core.c @@ -1905,6 +1905,8 @@ pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func, } pci_set_cfgdata32(dev, coff, bar); + } else if (coff == PCIR_BIOS) { + /* ignore ROM BAR length request */ } else if (pci_emul_iscap(dev, coff)) { pci_emul_capwrite(dev, coff, bytes, *eax); } else if (coff >= PCIR_COMMAND && coff < PCIR_REVID) {