qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Li Qiang <liq3ea@gmail.com>, Laszlo Ersek <lersek@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	ehabkost@redhat.com, mst@redhat.com,
	richard.henderson@linaro.org,
	"Qemu Developers" <qemu-devel@nongnu.org>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback
Date: Wed, 12 Sep 2018 11:52:43 -0500	[thread overview]
Message-ID: <6973b8ab-ab3a-d320-0080-4171d8bce427@redhat.com> (raw)
In-Reply-To: <CAKXe6SJjxne34PvxrbLKE3mz+XCowLxo_MSngPTazsVkPRqJUg@mail.gmail.com>

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	other threads:[~2018-09-12 16:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12  5:17 [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback Li Qiang
2018-09-12  7:16 ` Marc-André Lureau
2018-09-12  8:02   ` Li Qiang
2018-09-12 10:36     ` Laszlo Ersek
2018-09-12 12:33       ` Li Qiang
2018-09-12 16:52         ` Eric Blake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6973b8ab-ab3a-d320-0080-4171d8bce427@redhat.com \
    --to=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lersek@redhat.com \
    --cc=liq3ea@gmail.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).