hw/arm: Replace hw_error() by qemu_log_mask()
Subsystems (2)
cover hw/arm: Replace hw_error() by qemu_log_mask()
When fuzzing the devices, we don't want the whole process to exit calling hw_error().
Replace these calls by qemu_log_mask LOG_GUEST_ERROR/LOG_UNIMP when possible.
Philippe Mathieu-Daudé (4):
hw/arm/integratorcp: Replace hw_error() by qemu_log_mask() hw/arm/pxa2xx: Replace hw_error() by qemu_log_mask() hw/char/xilinx_uartlite: Replace hw_error() by qemu_log_mask() hw/timer/exynos4210_mct: Replace hw_error() by qemu_log_mask()
hw/arm/integratorcp.c | 23 +++++++++++++++-------- hw/arm/pxa2xx_gpio.c | 7 ++++--- hw/char/xilinx_uartlite.c | 5 +++-- hw/display/pxa2xx_lcd.c | 8 +++++--- hw/dma/pxa2xx_dma.c | 14 +++++++++----- hw/timer/exynos4210_mct.c | 10 ++++------ 6 files changed, 40 insertions(+), 27 deletions(-)
Signature · 1 line
2.21.3
PATCH 1/4 hw/arm/integratorcp: 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().
--- hw/arm/integratorcp.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
hw/arm/integratorcp.c +15 -8
@@ -20,6 +20,7 @@#include "exec/address-spaces.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" +#include "qemu/log.h" #include "qemu/error-report.h" #include "hw/char/pl011.h" #include "hw/hw.h"
@@ -144,8 +145,9 @@ static uint64_t integratorcm_read(void *opaque, hwaddr offset,/* ??? Voltage control unimplemented. */ return 0 ;default : -hw_error ("integratorcm_read: Unimplemented offset 0x%x\n" , - (int )offset); +qemu_log_mask (LOG_UNIMP , +"%s: Unimplemented offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);return 0 ; } }
@@ -252,8 +254,9 @@ static void integratorcm_write(void *opaque, hwaddr offset,/* ??? Voltage control unimplemented. */ break ;default : -hw_error ("integratorcm_write: Unimplemented offset 0x%x\n" , - (int )offset); +qemu_log_mask (LOG_UNIMP , +"%s: Unimplemented offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);break ; } }
@@ -394,7 +397,8 @@ static uint64_t icp_pic_read(void *opaque, hwaddr offset,case 5 :/* INT_SOFTCLR */ case 11 :/* FRQ_ENABLECLR */ default : -printf ("icp_pic_read: Bad register offset 0x%x\n" , (int )offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);return 0 ; } }
@@ -430,7 +434,8 @@ static void icp_pic_write(void *opaque, hwaddr offset,case 8 :/* FRQ_STATUS */ case 9 :/* FRQ_RAWSTAT */ default : -printf ("icp_pic_write: Bad register offset 0x%x\n" , (int )offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);return ; }icp_pic_update (s);
@@ -504,7 +509,8 @@ static uint64_t icp_control_read(void *opaque, hwaddr offset,case 3 :/* CP_DECODE */ return 0x11 ;default : -hw_error ("icp_control_read: Bad offset %x\n" , (int )offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);return 0 ; } }
@@ -524,7 +530,8 @@ static void icp_control_write(void *opaque, hwaddr offset,/* Nothing interesting implemented yet. */ break ;default : -hw_error ("icp_control_write: Bad offset %x\n" , (int )offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset); } }
Signature · 1 line
2.21.3
PATCH 2/4 hw/arm/pxa2xx: Replace hw_error() by qemu_log_mask()
In reply to Philippe Mathieu-Daudé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().
--- hw/arm/pxa2xx_gpio.c | 7 ++++--- hw/display/pxa2xx_lcd.c | 8 +++++--- hw/dma/pxa2xx_dma.c | 14 +++++++++----- 3 files changed, 18 insertions(+), 11 deletions(-)
hw/arm/pxa2xx_gpio.c +4 -3
@@ -9,7 +9,6 @@#include "qemu/osdep.h" #include "cpu.h" -#include "hw/hw.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h"
@@ -199,7 +198,8 @@ static uint64_t pxa2xx_gpio_read(void *opaque, hwaddr offset,return s->status[bank];default : -hw_error ("%s: Bad offset " REG_FMT "\n" , __func__, offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset); }return 0 ;
@@ -252,7 +252,8 @@ static void pxa2xx_gpio_write(void *opaque, hwaddr offset,break ;default : -hw_error ("%s: Bad offset " REG_FMT "\n" , __func__, offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset); } }
hw/display/pxa2xx_lcd.c +5 -3
@@ -11,7 +11,7 @@*/ #include "qemu/osdep.h" -#include "hw/hw.h" +#include "qemu/log.h" #include "hw/irq.h" #include "migration/vmstate.h" #include "ui/console.h"
@@ -407,7 +407,8 @@ static uint64_t pxa2xx_lcdc_read(void *opaque, hwaddr offset,default : fail: -hw_error ("%s: Bad offset " REG_FMT "\n" , __func__, offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset); }return 0 ;
@@ -562,7 +563,8 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offset,default : fail: -hw_error ("%s: Bad offset " REG_FMT "\n" , __func__, offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset); } }
hw/dma/pxa2xx_dma.c +9 -5
@@ -9,6 +9,7 @@*/ #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/hw.h" #include "hw/irq.h" #include "hw/qdev-properties.h"
@@ -268,7 +269,8 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset,unsigned int channel;if (size !=4 ) { -hw_error ("%s: Bad access width\n" , __func__); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad access width %u\n" , + __func__, size);return 5 ; }
@@ -315,8 +317,8 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset,return s->chan[channel].cmd; } } - -hw_error ("%s: Bad offset 0x" TARGET_FMT_plx"\n" , __func__, offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);return 7 ; }
@@ -327,7 +329,8 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset,unsigned int channel;if (size !=4 ) { -hw_error ("%s: Bad access width\n" , __func__); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad access width %u\n" , + __func__, size);return ; }
@@ -420,7 +423,8 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset,break ; } fail: -hw_error ("%s: Bad offset " TARGET_FMT_plx"\n" , __func__, offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset); } }
Signature · 1 line
2.21.3
PATCH 3/4 hw/char/xilinx_uartlite: Replace hw_error() by qemu_log_mask()
In reply to Philippe Mathieu-Daudé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().
--- hw/char/xilinx_uartlite.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/char/xilinx_uartlite.c +3 -2
@@ -23,7 +23,7 @@*/ #include "qemu/osdep.h" -#include "hw/hw.h" +#include "qemu/log.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h"
@@ -135,7 +135,8 @@ uart_write(void *opaque, hwaddr addr,switch (addr) {case R_STATUS : -hw_error ("write to UART STATUS?\n" ); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: write to UART STATUS\n" , + __func__);break ;case R_CTRL :
Signature · 1 line
2.21.3
Re: [PATCH 3/4] hw/char/xilinx_uartlite: Replace hw_error() by qemu_log_mask()
Quoted 5 lines · Philippe Mathieu-Daudé
hw_error()callsexit(). 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 byqemu_log_mask().
Quoted 32 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/char/xilinx_uartlite.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)hw/char/xilinx_uartlite.c +3
-2@@ -23,7 +23,7 @@*/ #include "qemu/osdep.h" -#include "hw/hw.h" +#include "qemu/log.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h" @@ -135,7 +135,8 @@ uart_write(void *opaque, hwaddr addr,switch (addr) {case R_STATUS : -hw_error ("write to UART STATUS?\n" ); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: write to UART STATUS\n" , + __func__);break ;case R_CTRL :Signature · 1 line
2.21.3
PATCH 4/4 hw/timer/exynos4210_mct: Replace hw_error() by qemu_log_mask()
In reply to Philippe Mathieu-Daudé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().
--- hw/timer/exynos4210_mct.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
hw/timer/exynos4210_mct.c +4 -6
@@ -54,7 +54,6 @@#include "qemu/osdep.h" #include "qemu/log.h" -#include "hw/hw.h" #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qemu/timer.h"
@@ -62,7 +61,6 @@#include "hw/ptimer.h" #include "hw/arm/exynos4210.h" -#include "hw/hw.h" #include "hw/irq.h" //#define DEBUG_MCT
@@ -1158,8 +1156,8 @@ static uint64_t exynos4210_mct_read(void *opaque, hwaddr offset,break ;default : -hw_error ("exynos4210.mct: bad read offset " - TARGET_FMT_plx"\n" , offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);break ; }return value;
@@ -1484,8 +1482,8 @@ static void exynos4210_mct_write(void *opaque, hwaddr offset,break ;default : -hw_error ("exynos4210.mct: bad write offset " - TARGET_FMT_plx"\n" , offset); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: Bad offset 0x%" HWADDR_PRIX "\n" , + __func__, offset);break ; } }
Signature · 1 line
2.21.3
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
CC hw/xen/xen-bus.o
CC hw/xen/xen-bus-helper.o/tmp/qemu-test/src/hw/timer/exynos4210_mct.c: In function 'exynos4210_mct_read':/tmp/qemu-test/src/hw/timer/exynos4210_mct.c:1163:5: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return value;
^cc1: all warnings being treated as errors
CC hw/xen/xen-backend.o
make: *** [hw/timer/exynos4210_mct.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
File "./tests/docker/docker.py", line 664, in <module>
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=bf3c7472f2054a9a96a2632f835d0520', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-6oonsuxg/src/docker-src.2020-05-18-08.47.24.20860:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=bf3c7472f2054a9a96a2632f835d0520
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-6oonsuxg/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 2m29.302s
user 0m9.175s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===
BUILD pc-bios/optionrom/multiboot.img
CC pc-bios/optionrom/pvh_main.o/tmp/qemu-test/src/hw/timer/exynos4210_mct.c: In function 'exynos4210_mct_read':/tmp/qemu-test/src/hw/timer/exynos4210_mct.c:1163:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return value;
^~~~~cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: hw/timer/exynos4210_mct.o] Error 1
make: *** Waiting for unfinished jobs....
BUILD pc-bios/optionrom/linuxboot.img
BUILD pc-bios/optionrom/multiboot.raw
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=66e69e66db6a4cee93b9e70e50c0bc31', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-ags415do/src/docker-src.2020-05-18-08.58.38.5219:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=66e69e66db6a4cee93b9e70e50c0bc31
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-ags415do/src'
make: *** [docker-run-test-mingw@fedora] Error 2
real 2m45.200s
user 0m8.526s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]