qemu/hw/misc
Philippe Mathieu-Daudé 158b659451 hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers
Guests can crash QEMU when writting to PnP registers:

  $ echo 'writeb 0x800ff042 69' | qemu-system-sparc -M leon3_generic -S -bios /etc/magic -qtest stdio
  [I 1571938309.932255] OPENED
  [R +0.063474] writeb 0x800ff042 69
  Segmentation fault (core dumped)

  (gdb) bt
  #0  0x0000000000000000 in  ()
  #1  0x0000555f4bcdf0bc in memory_region_write_with_attrs_accessor (mr=0x555f4d7be8c0, addr=66, value=0x7fff07d00f08, size=1, shift=0, mask=255, attrs=...) at memory.c:503
  #2  0x0000555f4bcdf185 in access_with_adjusted_size (addr=66, value=0x7fff07d00f08, size=1, access_size_min=1, access_size_max=4, access_fn=0x555f4bcdeff4 <memory_region_write_with_attrs_accessor>, mr=0x555f4d7be8c0, attrs=...) at memory.c:539
  #3  0x0000555f4bce2243 in memory_region_dispatch_write (mr=0x555f4d7be8c0, addr=66, data=69, op=MO_8, attrs=...) at memory.c:1489
  #4  0x0000555f4bc80b20 in flatview_write_continue (fv=0x555f4d92c400, addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1, addr1=66, l=1, mr=0x555f4d7be8c0) at exec.c:3161
  #5  0x0000555f4bc80c65 in flatview_write (fv=0x555f4d92c400, addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1) at exec.c:3201
  #6  0x0000555f4bc80fb0 in address_space_write (as=0x555f4d7aa460, addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1) at exec.c:3291
  #7  0x0000555f4bc8101d in address_space_rw (as=0x555f4d7aa460, addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1, is_write=true) at exec.c:3301
  #8  0x0000555f4bcdb388 in qtest_process_command (chr=0x555f4c2ed7e0 <qtest_chr>, words=0x555f4db0c5d0) at qtest.c:432

Instead of crashing, log the access as unimplemented.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Message-Id: <20191025110114.27091-2-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-11-05 15:01:43 +01:00
..
macio sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
a9scu.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
applesmc.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
arm11scu.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
arm_integrator_debug.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
arm_l2x0.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
arm_sysctl.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
armsse-cpuid.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
armsse-mhu.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
aspeed_scu.c aspeed/sdmc: Add AST2600 support 2019-10-15 18:09:04 +01:00
aspeed_sdmc.c aspeed/sdmc: Add AST2600 support 2019-10-15 18:09:04 +01:00
aspeed_xdma.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
auxbus.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
bcm2835_mbox.c hw/misc/bcm2835_mbox: Add trace events 2019-10-15 18:09:05 +01:00
bcm2835_property.c hw/misc/bcm2835_mbox: Add trace events 2019-10-15 18:09:05 +01:00
bcm2835_rng.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
bcm2835_thermal.c hw/misc/bcm2835_thermal: Add a dummy BCM2835 thermal sensor 2019-10-25 13:09:27 +01:00
cbus.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
debugexit.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
eccmemctl.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
edu.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
exynos4210_clk.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
exynos4210_pmu.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
exynos4210_rng.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
grlib_ahb_apb_pnp.c hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers 2019-11-05 15:01:43 +01:00
imx2_wdt.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
imx6_ccm.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
imx6_src.c hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
imx6ul_ccm.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
imx7_ccm.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
imx7_gpr.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
imx7_snvs.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
imx25_ccm.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
imx31_ccm.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
imx_ccm.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
iotkit-secctl.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
iotkit-sysctl.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
iotkit-sysinfo.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
ivshmem.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
Kconfig hw/m68k: implement ADB bus support for via 2019-10-28 19:06:45 +01:00
mac_via.c hw/m68k: implement ADB bus support for via 2019-10-28 19:06:45 +01:00
Makefile.objs hw/m68k: add VIA support 2019-10-28 19:06:42 +01:00
max111x.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
milkymist-hpdmc.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
milkymist-pfpu.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
mips_cmgcr.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
mips_cpc.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
mips_itu.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
mos6522.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
mps2-fpgaio.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
mps2-scc.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
msf2-sysreg.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
mst_fpga.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
nrf51_rng.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
omap_clk.c Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
omap_gpmc.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
omap_l4.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
omap_sdrc.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
omap_tap.c Replace all occurances of __FUNCTION__ with __func__ 2018-01-22 09:46:18 +01:00
pc-testdev.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pca9552.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
pci-testdev.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
puv3_pm.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
pvpanic.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sga.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
slavio_misc.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
stm32f2xx_syscfg.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
tmp105.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
tmp105.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
tmp421.c Do not use %m in common code to print error messages 2019-10-22 09:38:42 +02:00
trace-events hw/misc/bcm2835_mbox: Add trace events 2019-10-15 18:09:05 +01:00
tz-mpc.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
tz-msc.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
tz-ppc.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
unimp.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
vmcoreinfo.c hw/misc/vmcoreinfo: Add comment about reset handler 2019-10-15 18:18:08 -03:00
zynq_slcr.c target-arm queue: 2019-08-16 17:21:40 +01:00
zynq-xadc.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00