On 9/12/18 7:33 AM, Li Qiang wrote:
Do you have a reproducer and/or a backtrace?
memory_region_dispatch_write() checks if ops->write != NULL.
FWIW, looking at the codebase, there's a good number of static
MemoryRegionOps structures for which the "read_with_attrs" and "read"
members are default-initialized to NULL. It seems unlikely they are all
wrong.
I uses the debugexit.
QEMU command: gdb --args qemu-system-x86_64 -m 2048 -hda
/home/liqiang02/ubuntu1801.img -enable-kvm -vnc :100 -device isa-debug-exit
guest: inw(0x501)
We can get the following backtrack.
Starting program: /usr/local/bin/qemu-system-x86_64 -m 2048 -hda
/home/liqiang02/ubuntu1801.img -enable-kvm -vnc :100 -device isa-debug-exit
Thread 4 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffcca3c700 (LWP 52826)]
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00005555557c1f81 in memory_region_oldmmio_read_accessor
(mr=0x5555577b32b0, addr=0, value=0x7fffcca39568, size=2, shift=0,
mask=65535, attrs=...) at /home/liqiang02/qemu_max_cpu/qemu-2.8/memory.c:409
Doesn't that mean we should fix memory_region_oldmmio_read_accessor() to
deal with a NULL callback, rather than hacking up a large number of
devices to supply a no-op callback?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org