[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/16] target/avr: Ignore unimplemented WDR opcode
From: |
Laurent Vivier |
Subject: |
[PULL 16/16] target/avr: Ignore unimplemented WDR opcode |
Date: |
Sat, 15 May 2021 12:03:35 +0200 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Running the WDR opcode triggers a segfault:
$ cat > foo.S << EOF
> __start:
> wdr
> EOF
$ avr-gcc -nostdlib -nostartfiles -mmcu=avr6 foo.S -o foo.elf
$ qemu-system-avr -serial mon:stdio -nographic -no-reboot \
-M mega -bios foo.elf -d in_asm --singlestep
IN:
0x00000000: WDR
Segmentation fault (core dumped)
(gdb) bt
#0 0x00005555add0b23a in gdb_get_cpu_pid (cpu=0x5555af5a4af0) at
../gdbstub.c:718
#1 0x00005555add0b2dd in gdb_get_cpu_process (cpu=0x5555af5a4af0) at
../gdbstub.c:743
#2 0x00005555add0e477 in gdb_set_stop_cpu (cpu=0x5555af5a4af0) at
../gdbstub.c:2742
#3 0x00005555adc99b96 in cpu_handle_guest_debug (cpu=0x5555af5a4af0) at
../softmmu/cpus.c:306
#4 0x00005555adcc66ab in rr_cpu_thread_fn (arg=0x5555af5a4af0) at
../accel/tcg/tcg-accel-ops-rr.c:224
#5 0x00005555adefaf12 in qemu_thread_start (args=0x5555af5d9870) at
../util/qemu-thread-posix.c:521
#6 0x00007f692d940ea5 in start_thread () from /lib64/libpthread.so.0
#7 0x00007f692d6699fd in clone () from /lib64/libc.so.6
Since the watchdog peripheral is not implemented, simply
log the opcode as unimplemented and keep going.
Reported-by: Fred Konrad <konrad@adacore.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Message-Id: <20210502190900.604292-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
target/avr/helper.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/target/avr/helper.c b/target/avr/helper.c
index 35e101959404..981c29da4535 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -188,11 +188,7 @@ void helper_break(CPUAVRState *env)
void helper_wdr(CPUAVRState *env)
{
- CPUState *cs = env_cpu(env);
-
- /* WD is not implemented yet, placeholder */
- cs->exception_index = EXCP_DEBUG;
- cpu_loop_exit(cs);
+ qemu_log_mask(LOG_UNIMP, "WDG reset (not implemented)\n");
}
/*
--
2.31.1
- [PULL 06/16] qapi: spelling fix (addtional), (continued)
- [PULL 06/16] qapi: spelling fix (addtional), Laurent Vivier, 2021/05/15
- [PULL 02/16] hw/virtio: Pass virtio_feature_get_config_size() a const argument, Laurent Vivier, 2021/05/15
- [PULL 01/16] backends/tpm: Replace qemu_mutex_lock calls with QEMU_LOCK_GUARD, Laurent Vivier, 2021/05/15
- [PULL 03/16] virtio-blk: Constify VirtIOFeature feature_sizes[], Laurent Vivier, 2021/05/15
- [PULL 04/16] virtio-net: Constify VirtIOFeature feature_sizes[], Laurent Vivier, 2021/05/15
- [PULL 05/16] virtiofsd: Fix check of chown()'s return value, Laurent Vivier, 2021/05/15
- [PULL 10/16] cutils: fix memory leak in get_relocated_path(), Laurent Vivier, 2021/05/15
- [PULL 07/16] hw/gpio/aspeed: spelling fix (addtional), Laurent Vivier, 2021/05/15
- [PULL 11/16] hw/mem/meson: Fix linking sparse-mem device with fuzzer, Laurent Vivier, 2021/05/15
- [PULL 14/16] target/sh4: Return error if CPUClass::get_phys_page_debug() fails, Laurent Vivier, 2021/05/15
- [PULL 16/16] target/avr: Ignore unimplemented WDR opcode,
Laurent Vivier <=
- [PULL 08/16] hw/timer/etraxfs_timer: Convert to 3-phase reset (Resettable interface), Laurent Vivier, 2021/05/15
- [PULL 09/16] hw/rtc/mc146818rtc: Convert to 3-phase reset (Resettable interface), Laurent Vivier, 2021/05/15
- [PULL 13/16] multi-process: Avoid logical AND of mutually exclusive tests, Laurent Vivier, 2021/05/15
- [PULL 12/16] hw/pci-host: Do not build gpex-acpi.c if GPEX is not selected, Laurent Vivier, 2021/05/15
- [PULL 15/16] hw/avr/atmega.c: use the avr51 cpu for atmega1280, Laurent Vivier, 2021/05/15
- Re: [PULL 00/16] Trivial branch for 6.1 patches, Peter Maydell, 2021/05/17