hw/net/lan9118: log [read|write]b when mode_16bit is enabled rather than abort
PATCH 1/1 hw/net/lan9118: log [read|write]b when mode_16bit is enabled rather than abort
This patch replaces hw_error to guest error log for [read|write]b accesses when mode_16bit is enabled. This avoids aborting qemu.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1433
--- hw/net/lan9118.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
hw/net/lan9118.c +4 -2
@@ -1209,7 +1209,8 @@ static void lan9118_16bit_mode_write(void *opaque, hwaddr offset,return ; } -hw_error ("lan9118_write: Bad size 0x%x\n" , size); +qemu_log_mask (LOG_GUEST_ERROR , +"lan9118_16bit_mode_write: Bad size 0x%x\n" , size); } static uint64_t lan9118_readl(void *opaque, hwaddr offset,
@@ -1324,7 +1325,8 @@ static uint64_t lan9118_16bit_mode_read(void *opaque, hwaddr offset,return lan9118_readl (opaque, offset, size); } -hw_error ("lan9118_read: Bad size 0x%x\n" , size); +qemu_log_mask (LOG_GUEST_ERROR , +"lan9118_16bit_mode_read: Bad size 0x%x\n" , size);return 0 ; }
Signature · 1 line
2.25.1
Hi Qiang,
Quoted 16 lines · Qiang Liu
This patch replaces
hw_errorto guest error log for [read|write]b accesses whenmode_16bitis enabled. This avoids aborting qemu.Fixes 1248f8d4cbc3 ("hw/lan9118: Add basic 16-bit mode support.")Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1433
Reported-by Qiang Liu <[email protected]>Signed-off-by Qiang Liu <[email protected]>--- hw/net/lan9118.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/net/lan9118.c +0
-0
hw/net/lan9118.c static void lan9118_16bit_mode_write(void *opaque, hwaddr offset, · line 1214
Quoted 7 lines
hw/net/lan9118.c +2
-1@@ -1209,7 +1209,8 @@ static void lan9118_16bit_mode_write(void *opaque, hwaddr offset,return ; } -hw_error ("lan9118_write: Bad size 0x%x\n" , size); +qemu_log_mask (LOG_GUEST_ERROR , +"lan9118_16bit_mode_write: Bad size 0x%x\n" , size); }
There are two other uses via BADF(), then we can remove the BADF() macro and the "hw/hw.h" inclusion.
Regards,
Phil.
Quoted 23 lines · Philippe Mathieu-Daudé
Hi Qiang,
hw/net/lan9118.c static void lan9118_16bit_mode_write(void *opaque,
Quoted 16 lines · Qiang Liu
This patch replaces
hw_errorto guest error log for [read|write]b accesses whenmode_16bitis enabled. This avoids aborting qemu.Fixes 1248f8d4cbc3 ("hw/lan9118: Add basic 16-bit mode support.")Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1433
Reported-by Qiang Liu <[email protected]>Signed-off-by Qiang Liu <[email protected]>--- hw/net/lan9118.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/net/lan9118.c +0
-0@@ -1209,7 +1209,8 @@ static void lan9118_16bit_mode_write(void *opaque,hwaddr offset,
Quoted 3 lines
hw/net/lan9118.c +0
-0return ; }
Quoted 7 lines
hw/net/lan9118.c static void lan9118_16bit_mode_write(void *opaque, hwaddr offset, · line 1214
Quoted 4 lines
hw/net/lan9118.c +2
-1-hw_error ("lan9118_write: Bad size 0x%x\n" , size); +qemu_log_mask (LOG_GUEST_ERROR , +"lan9118_16bit_mode_write: Bad size 0x%x\n" , size); }There are two other uses via
BADF(), then we can remove theBADF()macro and the "hw/hw.h" inclusion.
I see. Sounds nice! Let me resend the patch.
Best,
Qiang