qemu-e2k/hw/core
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
..
bus.c
clock-vmstate.c
clock.c clock: Add ClockPreUpdate callback event type 2021-03-08 17:20:01 +00:00
cpu.c
fw-path-provider.c
generic-loader.c
guest-loader.c hw/core: implement a guest-loader to support static hypervisor guests 2021-03-10 15:34:11 +00:00
guest-loader.h hw/core: implement a guest-loader to support static hypervisor guests 2021-03-10 15:34:11 +00:00
hotplug.c
irq.c
Kconfig hw/core: Only build guest-loader if libfdt is available 2021-03-17 07:17:46 +00:00
loader-fit.c
loader.c hw/core/loader: Add new function rom_ptr_for_as() 2021-03-23 11:47:31 +00:00
machine-hmp-cmds.c machine: remove 'query-cpus' QMP command 2021-03-18 09:22:55 +00:00
machine-qmp-cmds.c machine: remove 'arch' field from 'query-cpus-fast' QMP command 2021-03-18 09:22:55 +00:00
machine.c hw/pci-host/gpex: Don't fault for unmapped parts of MMIO and PIO windows 2021-04-30 11:16:52 +01:00
meson.build hw/core: Only build guest-loader if libfdt is available 2021-03-17 07:17:46 +00:00
nmi.c
null-machine.c
numa.c
or-irq.c
platform-bus.c
ptimer.c
qdev-clock.c clock: Add ClockEvent parameter to callbacks 2021-03-08 17:20:01 +00:00
qdev-fw.c
qdev-prop-internal.h
qdev-properties-system.c
qdev-properties.c
qdev.c
register.c
reset.c
resettable.c
split-irq.c
stream.c
sysbus.c
trace-events
trace.h
uboot_image.h
vm-change-state-handler.c
vmstate-if.c