qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback
Date: Wed, 12 Sep 2018 11:52:43 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]