qemu-e2k/hw/pci-host
Peter Maydell a6091108aa hw/pci-host/gpex: Don't fault for unmapped parts of MMIO and PIO windows
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>
2021-04-30 11:16:52 +01:00
..
bonito.c hw/pci-host/bonito: Use pci_config_set_interrupt_pin() 2021-01-04 23:24:44 +01:00
designware.c pci-host: designware: add pcie-msi read method 2021-02-08 15:15:32 +01:00
gpex-acpi.c acpi/gpex: Fix cca attribute check for pxb device 2021-02-23 10:06:55 -05:00
gpex.c hw/pci-host/gpex: Don't fault for unmapped parts of MMIO and PIO windows 2021-04-30 11:16:52 +01:00
grackle.c grackle: use qdev gpios for PCI IRQs 2020-10-18 16:21:42 +01:00
i440fx.c i440fx: Register i440FX-pcihost properties as class properties 2020-09-22 16:48:29 -04:00
Kconfig hw/pci-host: Introduce SH_PCI Kconfig entry 2021-03-06 16:18:42 +01:00
meson.build hw/pci-host: Introduce SH_PCI Kconfig entry 2021-03-06 16:18:42 +01:00
pam.c hw/pci-host/pam: Replace magic number by PAM_REGIONS_COUNT definition 2020-12-13 17:07:05 +01:00
pnv_phb3_msi.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
pnv_phb3_pbcq.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
pnv_phb3.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
pnv_phb4_pec.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
pnv_phb4.c ppc/pnv: Add trace events for PCI event notification 2021-02-10 10:43:50 +11:00
ppce500.c hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h' 2021-01-04 23:24:44 +01:00
prep.c hw/pci-host: add pci-intack write method 2021-02-08 15:15:32 +01:00
q35.c hw/pci-host/pam: Replace magic number by PAM_REGIONS_COUNT definition 2020-12-13 17:07:05 +01:00
remote.c multi-process: setup PCI host bridge for remote device 2021-02-10 09:23:22 +00:00
sabre.c hw/pci-host/sabre: Simplify code initializing variable once 2020-10-28 07:59:26 +00:00
sh_pci.c hw/pci-host: Introduce SH_PCI Kconfig entry 2021-03-06 16:18:42 +01:00
trace-events ppc/pnv: Add trace events for PCI event notification 2021-02-10 10:43:50 +11:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
uninorth.c hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h' 2021-01-04 23:24:44 +01:00
versatile.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
xen_igd_pt.c xen: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
xilinx-pcie.c hw/mips/boston: Fix Lesser GPL version number 2020-11-03 16:51:13 +01:00