aboutsummaryrefslogtreecommitdiff
path: root/include/hw/pci-host/gpex.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-25 16:33:15 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-04-30 11:16:52 +0100
commita6091108aa44e9017af4ca13c43f55a629e3744c (patch)
treea7de5a0f4073ca01343b5b415fecab94ee7559d5 /include/hw/pci-host/gpex.h
parentda7e13c00b5962016b9c72079bef5e0a5398db0d (diff)
hw/pci-host/gpex: Don't fault for unmapped parts of MMIO and PIO windowspull-target-arm-20210430
Currently the gpex PCI controller implements no special behaviour for guest accesses to areas of the PIO and MMIO where it has not mapped any PCI devices, which means that for Arm you end up with a CPU exception due to a data abort. Most host OSes expect "like an x86 PC" behaviour, where bad accesses like this return -1 for reads and ignore writes. In the interests of not being surprising, make host CPU accesses to these windows behave as -1/discard where there's no mapped PCI device. The old behaviour generally didn't cause any problems, because almost always the guest OS will map the PCI devices and then only access where it has mapped them. One corner case where you will see this kind of access is if Linux attempts to probe legacy ISA devices via a PIO window access. So far the only case where we've seen this has been via the syzkaller fuzzer. Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20210325163315.27724-1-peter.maydell@linaro.org Fixes: https://bugs.launchpad.net/qemu/+bug/1918917 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw/pci-host/gpex.h')
-rw-r--r--include/hw/pci-host/gpex.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h
index d48a020a95..fcf8b63820 100644
--- a/include/hw/pci-host/gpex.h
+++ b/include/hw/pci-host/gpex.h
@@ -49,8 +49,12 @@ struct GPEXHost {
MemoryRegion io_ioport;
MemoryRegion io_mmio;
+ MemoryRegion io_ioport_window;
+ MemoryRegion io_mmio_window;
qemu_irq irq[GPEX_NUM_IRQS];
int irq_num[GPEX_NUM_IRQS];
+
+ bool allow_unmapped_accesses;
};
struct GPEXConfig {