All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: f4bug@amsat.org, Eric Blake <eblake@redhat.com>, atar4qemu@gmail.com
Cc: 李强 <liq3ea@163.com>, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Laszlo Ersek" <lersek@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	ehabkost@redhat.com, mst@redhat.com,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"P J P" <ppandit@redhat.com>,
	"Qemu Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 0/8] Add missed read callback for some memory region
Date: Thu, 13 Sep 2018 09:41:33 +0800	[thread overview]
Message-ID: <CAKXe6SL7zAsE78qL4-iJkTLrX2Lg+gv4WhwwneTJCNdPxeBXCQ@mail.gmail.com> (raw)
In-Reply-To: <c8bfd44b-4d12-c2f6-7ac1-f8cda7178355@amsat.org>

Philippe Mathieu-Daudé <f4bug@amsat.org> 于2018年9月13日周四 上午1:12写道:

> Hi Li,
>
> On 9/12/18 6:01 PM, Li Qiang wrote:
> > From: Li Qiang <liq3ea@gmail.com>
> >
> > This patch set try to add the missed read callback for memory region.
> > Without this patchset, when the guest reads the IO port/memory, it will
> > cause an NULL-dereference issue. For example, add
> > "-device isa-debug-exit" to command, then read the 0x501 port, it causes
> a
> > SIGSEGV.
> >
> > The only exception is 'readonly_mem_ops' as its read is directly
> > access the underlying host ram as the comments says.
> >
> > These missed read callback is mostly pointed by Laszlo Ersek.
> >
> >
> >
> > Li Qiang (8):
> >   fw_cfg_mem: add read memory region callback
> >   hw: debugexit: add read callback
> >   hw: hyperv_testdev: add read callback
> >   hw: pc-testdev: add read memory region callback
> >   hw: designware: add read memory region callback
> >   hw: pvrdma: add read memory region callback
> >   hw: sun4c: add read memory region callback
> >   exec: add read callback for notdirty memory region
>
> Why not rather simply add a check in
> memory_region_oldmmio_read_accessor() instead?
>
> Eventually:
>
> {
>     uint64_t tmp;
>     int idx = ctz32(size);
>
>     if (unlikely(mr->ops->old_mmio.write[idx]
>                  && !mr->ops->old_mmio.read[idx])) {
>         tmp = 0; /* XXX is 0 the expected value??? */
>     } else {
>         tmp = mr->ops->old_mmio.read[idx](mr->opaque, addr);
>     }
>     ...
>

Hi, I have sent this patch. But...


We have discussed in another thread:
-->https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg01391.html

Thanks,
Li Qiang

      reply	other threads:[~2018-09-13  1:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 16:01 [Qemu-devel] [PATCH 0/8] Add missed read callback for some memory region Li Qiang
2018-09-12 16:01 ` [Qemu-devel] [PATCH 1/8] fw_cfg_mem: add read memory region callback Li Qiang
2018-09-12 16:48   ` Eric Blake
2018-09-12 16:01 ` [Qemu-devel] [PATCH 2/8] hw: debugexit: add read callback Li Qiang
2018-09-12 16:01 ` [Qemu-devel] [PATCH 3/8] hw: hyperv_testdev: " Li Qiang
2018-09-12 16:01 ` [Qemu-devel] [PATCH 4/8] hw: pc-testdev: add read memory region callback Li Qiang
2018-09-12 16:01 ` [Qemu-devel] [PATCH 5/8] hw: designware: " Li Qiang
2018-09-13 15:12   ` Paolo Bonzini
2018-09-14  5:08     ` Li Qiang
2018-09-12 16:01 ` [Qemu-devel] [PATCH 6/8] hw: pvrdma: " Li Qiang
2018-09-12 16:01 ` [Qemu-devel] [PATCH 7/8] hw: sun4c: " Li Qiang
2018-09-12 19:22   ` Artyom Tarasenko
2018-09-12 16:01 ` [Qemu-devel] [PATCH 8/8] exec: add read callback for notdirty memory region Li Qiang
2018-09-13 10:53   ` Paolo Bonzini
2018-09-12 16:13 ` [Qemu-devel] [PATCH 0/8] Add missed read callback for some " Philippe Mathieu-Daudé
2018-09-13  1:41   ` Li Qiang [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=CAKXe6SL7zAsE78qL4-iJkTLrX2Lg+gv4WhwwneTJCNdPxeBXCQ@mail.gmail.com \
    --to=liq3ea@gmail.com \
    --cc=atar4qemu@gmail.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=lersek@redhat.com \
    --cc=liq3ea@163.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.