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

hw/arm/pxa2xx_pic: Use LOG_GUEST_ERROR for bad guest register accesses

Instead of using printf() for logging guest accesses to invalid
register offsets in the pxa2xx PIC device, use the usual
qemu_log_mask(LOG_GUEST_ERROR,...).

This was the only user of the REG_FMT macro in pxa.h, so we can
remove that.

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

+7 -3
+7 -2
hw/arm/pxa2xx_pic.c
··· 11 11 #include "qemu/osdep.h" 12 12 #include "qapi/error.h" 13 13 #include "qemu/module.h" 14 + #include "qemu/log.h" 14 15 #include "cpu.h" 15 16 #include "hw/arm/pxa.h" 16 17 #include "hw/sysbus.h" ··· 166 167 case ICHP: /* Highest Priority register */ 167 168 return pxa2xx_pic_highest(s); 168 169 default: 169 - printf("%s: Bad register offset " REG_FMT "\n", __func__, offset); 170 + qemu_log_mask(LOG_GUEST_ERROR, 171 + "pxa2xx_pic_mem_read: bad register offset 0x%" HWADDR_PRIx 172 + "\n", offset); 170 173 return 0; 171 174 } 172 175 } ··· 199 202 s->priority[32 + ((offset - IPR32) >> 2)] = value & 0x8000003f; 200 203 break; 201 204 default: 202 - printf("%s: Bad register offset " REG_FMT "\n", __func__, offset); 205 + qemu_log_mask(LOG_GUEST_ERROR, 206 + "pxa2xx_pic_mem_write: bad register offset 0x%" 207 + HWADDR_PRIx "\n", offset); 203 208 return; 204 209 } 205 210 pxa2xx_pic_update(opaque);
-1
include/hw/arm/pxa.h
··· 184 184 }; 185 185 186 186 # define PA_FMT "0x%08lx" 187 - # define REG_FMT "0x" TARGET_FMT_plx 188 187 189 188 PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size, 190 189 const char *revision);