qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

hw/arm/pxa2xx: Replace hw_error() by qemu_log_mask()

hw_error() calls exit(). This a bit overkill when we can log
the accesses as unimplemented or guest error.

When fuzzing the devices, we don't want the whole process to
exit. Replace some hw_error() calls by qemu_log_mask().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20200518140309.5220-3-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Philippe Mathieu-Daudé and committed by
Peter Maydell
5a0001ec 9904625f

+18 -11
+4 -3
hw/arm/pxa2xx_gpio.c
··· 9 9 10 10 #include "qemu/osdep.h" 11 11 #include "cpu.h" 12 - #include "hw/hw.h" 13 12 #include "hw/irq.h" 14 13 #include "hw/qdev-properties.h" 15 14 #include "hw/sysbus.h" ··· 199 198 return s->status[bank]; 200 199 201 200 default: 202 - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); 201 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", 202 + __func__, offset); 203 203 } 204 204 205 205 return 0; ··· 252 252 break; 253 253 254 254 default: 255 - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); 255 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", 256 + __func__, offset); 256 257 } 257 258 } 258 259
+5 -3
hw/display/pxa2xx_lcd.c
··· 11 11 */ 12 12 13 13 #include "qemu/osdep.h" 14 - #include "hw/hw.h" 14 + #include "qemu/log.h" 15 15 #include "hw/irq.h" 16 16 #include "migration/vmstate.h" 17 17 #include "ui/console.h" ··· 407 407 408 408 default: 409 409 fail: 410 - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); 410 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", 411 + __func__, offset); 411 412 } 412 413 413 414 return 0; ··· 562 563 563 564 default: 564 565 fail: 565 - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); 566 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", 567 + __func__, offset); 566 568 } 567 569 } 568 570
+9 -5
hw/dma/pxa2xx_dma.c
··· 9 9 */ 10 10 11 11 #include "qemu/osdep.h" 12 + #include "qemu/log.h" 12 13 #include "hw/hw.h" 13 14 #include "hw/irq.h" 14 15 #include "hw/qdev-properties.h" ··· 268 269 unsigned int channel; 269 270 270 271 if (size != 4) { 271 - hw_error("%s: Bad access width\n", __func__); 272 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad access width %u\n", 273 + __func__, size); 272 274 return 5; 273 275 } 274 276 ··· 315 317 return s->chan[channel].cmd; 316 318 } 317 319 } 318 - 319 - hw_error("%s: Bad offset 0x" TARGET_FMT_plx "\n", __func__, offset); 320 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", 321 + __func__, offset); 320 322 return 7; 321 323 } 322 324 ··· 327 329 unsigned int channel; 328 330 329 331 if (size != 4) { 330 - hw_error("%s: Bad access width\n", __func__); 332 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad access width %u\n", 333 + __func__, size); 331 334 return; 332 335 } 333 336 ··· 420 423 break; 421 424 } 422 425 fail: 423 - hw_error("%s: Bad offset " TARGET_FMT_plx "\n", __func__, offset); 426 + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", 427 + __func__, offset); 424 428 } 425 429 } 426 430