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>
Message-Id: <
20200526094052.1723-3-f4bug@amsat.org>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
#include "qemu/osdep.h"
#include "qemu/error-report.h"
+#include "qemu/log.h"
#include "cpu.h"
#include "hw/hw.h"
#include "hw/irq.h"
break;
default:
/* Unknown vector. */
- error_report("Unhandled vector for IRQ %d", irq);
+ qemu_log_mask(LOG_UNIMP, "%s: Unhandled vector for IRQ %d\n",
+ __func__, irq);
vector = 0xf;
break;
}
case 0x170: return s->uivr[0];
case 0x1b0: return s->uivr[1];
}
- hw_error("Bad MBAR read offset 0x%"PRIx16, offset);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad MBAR offset 0x%"PRIx16"\n",
+ __func__, offset);
return 0;
}
s->uivr[1] = value;
break;
default:
- hw_error("Bad MBAR write offset 0x%"PRIx16, offset);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad MBAR offset 0x%"PRIx16"\n",
+ __func__, offset);
break;
}
}
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "qemu/error-report.h"
+#include "qemu/log.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
-#include "hw/hw.h"
#include "hw/irq.h"
#include "hw/m68k/mcf.h"
#include "hw/m68k/mcf_fec.h"
case 4:
break;
default:
- hw_error("m5208_timer_write: Bad offset 0x%x\n", (int)offset);
- break;
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n",
+ __func__, offset);
+ return;
}
m5208_timer_update(s);
}
case 4:
return ptimer_get_count(s->timer);
default:
- hw_error("m5208_timer_read: Bad offset 0x%x\n", (int)addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n",
+ __func__, addr);
return 0;
}
}
return 0;
default:
- hw_error("m5208_sys_read: Bad offset 0x%x\n", (int)addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n",
+ __func__, addr);
return 0;
}
}
static void m5208_sys_write(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
- hw_error("m5208_sys_write: Bad offset 0x%x\n", (int)addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n",
+ __func__, addr);
}
static const MemoryRegionOps m5208_sys_ops = {
#include "qemu/osdep.h"
#include "qemu/module.h"
+#include "qemu/log.h"
#include "cpu.h"
#include "hw/hw.h"
#include "hw/irq.h"
case 0xe1: case 0xe2: case 0xe3: case 0xe4:
case 0xe5: case 0xe6: case 0xe7:
/* LnIACK */
- hw_error("mcf_intc_read: LnIACK not implemented\n");
+ qemu_log_mask(LOG_UNIMP, "%s: LnIACK not implemented (offset 0x%02x)\n",
+ __func__, offset);
+ /* fallthru */
default:
return 0;
}
}
break;
default:
- hw_error("mcf_intc_write: Bad write offset %d\n", offset);
- break;
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%02x\n",
+ __func__, offset);
+ return;
}
mcf_intc_update(s);
}
*/
#include "qemu/osdep.h"
-#include "hw/hw.h"
+#include "qemu/log.h"
#include "hw/irq.h"
#include "net/net.h"
#include "qemu/module.h"
case 0x188: return s->emrbr;
case 0x200 ... 0x2e0: return s->mib[(addr & 0x1ff) / 4];
default:
- hw_error("mcf_fec_read: Bad address 0x%x\n", (int)addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad address 0x%" HWADDR_PRIX "\n",
+ __func__, addr);
return 0;
}
}
s->mib[(addr & 0x1ff) / 4] = value;
break;
default:
- hw_error("mcf_fec_write Bad address 0x%x\n", (int)addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad address 0x%" HWADDR_PRIX "\n",
+ __func__, addr);
+ return;
}
mcf_fec_update(s);
}