* [Qemu-devel] [PATCH] vhost: check region type before casting @ 2018-07-20 8:36 Tiwei Bie 2018-07-20 8:52 ` no-reply ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Tiwei Bie @ 2018-07-20 8:36 UTC (permalink / raw) To: mst, jasowang; +Cc: qemu-devel, Peter Maydell Check region type first before casting the memory region to IOMMUMemoryRegion. Otherwise QEMU will abort with below error message when casting non-IOMMU memory region: vhost_iommu_region_add: Object 0x561f28bce4f0 is not an instance of type qemu:iommu-memory-region Fixes: cb1efcf462a2 ("iommu: Add IOMMU index argument to notifier APIs") Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> --- hw/virtio/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index b129cb9ddd..d4cb5894a8 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -663,12 +663,14 @@ static void vhost_iommu_region_add(MemoryListener *listener, struct vhost_iommu *iommu; Int128 end; int iommu_idx; - IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr); + IOMMUMemoryRegion *iommu_mr; if (!memory_region_is_iommu(section->mr)) { return; } + iommu_mr = IOMMU_MEMORY_REGION(section->mr); + iommu = g_malloc0(sizeof(*iommu)); end = int128_add(int128_make64(section->offset_within_region), section->size); -- 2.18.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-07-20 8:36 [Qemu-devel] [PATCH] vhost: check region type before casting Tiwei Bie @ 2018-07-20 8:52 ` no-reply 2018-07-20 9:08 ` Peter Maydell 2018-08-01 8:22 ` Tiwei Bie 2 siblings, 0 replies; 10+ messages in thread From: no-reply @ 2018-07-20 8:52 UTC (permalink / raw) To: tiwei.bie; +Cc: famz, mst, jasowang, peter.maydell, qemu-devel Hi, This series failed docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. Type: series Message-id: 20180720083644.1431-1-tiwei.bie@intel.com Subject: [Qemu-devel] [PATCH] vhost: check region type before casting === TEST SCRIPT BEGIN === #!/bin/bash set -e git submodule update --init dtc # Let docker tests dump environment info export SHOW_ENV=1 export J=8 time make docker-test-mingw@fedora === TEST SCRIPT END === Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 fatal: unable to access 'https://github.com/patchew-project/qemu/': Encountered end of file error: Could not fetch 3c8cf5a9c21ff8782164d1def7f44bd888713384 Traceback (most recent call last): File "/usr/bin/patchew", line 442, in test_one git_clone_repo(clone, r["repo"], r["head"], logf) File "/usr/bin/patchew", line 48, in git_clone_repo stdout=logf, stderr=logf) File "/usr/lib64/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['git', 'remote', 'add', '-f', '--mirror=fetch', '3c8cf5a9c21ff8782164d1def7f44bd888713384', 'https://github.com/patchew-project/qemu']' returned non-zero exit status 1. --- Email generated automatically by Patchew [http://patchew.org/]. Please send your feedback to patchew-devel@redhat.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-07-20 8:36 [Qemu-devel] [PATCH] vhost: check region type before casting Tiwei Bie 2018-07-20 8:52 ` no-reply @ 2018-07-20 9:08 ` Peter Maydell 2018-08-01 8:22 ` Tiwei Bie 2 siblings, 0 replies; 10+ messages in thread From: Peter Maydell @ 2018-07-20 9:08 UTC (permalink / raw) To: Tiwei Bie; +Cc: Michael S. Tsirkin, Jason Wang, QEMU Developers On 20 July 2018 at 09:36, Tiwei Bie <tiwei.bie@intel.com> wrote: > Check region type first before casting the memory region > to IOMMUMemoryRegion. Otherwise QEMU will abort with below > error message when casting non-IOMMU memory region: > > vhost_iommu_region_add: Object 0x561f28bce4f0 is not an > instance of type qemu:iommu-memory-region > > Fixes: cb1efcf462a2 ("iommu: Add IOMMU index argument to notifier APIs") > Cc: Peter Maydell <peter.maydell@linaro.org> > > Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> > --- Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-07-20 8:36 [Qemu-devel] [PATCH] vhost: check region type before casting Tiwei Bie 2018-07-20 8:52 ` no-reply 2018-07-20 9:08 ` Peter Maydell @ 2018-08-01 8:22 ` Tiwei Bie 2018-08-01 8:33 ` Jason Wang 2018-08-01 10:13 ` Peter Maydell 2 siblings, 2 replies; 10+ messages in thread From: Tiwei Bie @ 2018-08-01 8:22 UTC (permalink / raw) To: mst, jasowang; +Cc: Peter Maydell, qemu-devel Ping.. It seems that the final release for QEMU 3.0 will be out soon [1]. But this fix hasn't been merged yet. [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg06004.html Thanks, Tiwei On Fri, Jul 20, 2018 at 04:36:44PM +0800, Tiwei Bie wrote: > Check region type first before casting the memory region > to IOMMUMemoryRegion. Otherwise QEMU will abort with below > error message when casting non-IOMMU memory region: > > vhost_iommu_region_add: Object 0x561f28bce4f0 is not an > instance of type qemu:iommu-memory-region > > Fixes: cb1efcf462a2 ("iommu: Add IOMMU index argument to notifier APIs") > Cc: Peter Maydell <peter.maydell@linaro.org> > > Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> > --- > hw/virtio/vhost.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index b129cb9ddd..d4cb5894a8 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -663,12 +663,14 @@ static void vhost_iommu_region_add(MemoryListener *listener, > struct vhost_iommu *iommu; > Int128 end; > int iommu_idx; > - IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr); > + IOMMUMemoryRegion *iommu_mr; > > if (!memory_region_is_iommu(section->mr)) { > return; > } > > + iommu_mr = IOMMU_MEMORY_REGION(section->mr); > + > iommu = g_malloc0(sizeof(*iommu)); > end = int128_add(int128_make64(section->offset_within_region), > section->size); > -- > 2.18.0 > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-08-01 8:22 ` Tiwei Bie @ 2018-08-01 8:33 ` Jason Wang 2018-08-01 10:13 ` Peter Maydell 1 sibling, 0 replies; 10+ messages in thread From: Jason Wang @ 2018-08-01 8:33 UTC (permalink / raw) To: Tiwei Bie, mst; +Cc: Peter Maydell, qemu-devel On 2018年08月01日 16:22, Tiwei Bie wrote: > Ping.. > > It seems that the final release for QEMU 3.0 will be > out soon [1]. But this fix hasn't been merged yet. > > [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg06004.html > > Thanks, > Tiwei Cc: qemu-stable@nongnu.org Acked-by: Jason Wang <jasowang@redhat.com> > > On Fri, Jul 20, 2018 at 04:36:44PM +0800, Tiwei Bie wrote: >> Check region type first before casting the memory region >> to IOMMUMemoryRegion. Otherwise QEMU will abort with below >> error message when casting non-IOMMU memory region: >> >> vhost_iommu_region_add: Object 0x561f28bce4f0 is not an >> instance of type qemu:iommu-memory-region >> >> Fixes: cb1efcf462a2 ("iommu: Add IOMMU index argument to notifier APIs") >> Cc: Peter Maydell <peter.maydell@linaro.org> >> >> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> >> --- >> hw/virtio/vhost.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c >> index b129cb9ddd..d4cb5894a8 100644 >> --- a/hw/virtio/vhost.c >> +++ b/hw/virtio/vhost.c >> @@ -663,12 +663,14 @@ static void vhost_iommu_region_add(MemoryListener *listener, >> struct vhost_iommu *iommu; >> Int128 end; >> int iommu_idx; >> - IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr); >> + IOMMUMemoryRegion *iommu_mr; >> >> if (!memory_region_is_iommu(section->mr)) { >> return; >> } >> >> + iommu_mr = IOMMU_MEMORY_REGION(section->mr); >> + >> iommu = g_malloc0(sizeof(*iommu)); >> end = int128_add(int128_make64(section->offset_within_region), >> section->size); >> -- >> 2.18.0 >> >> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-08-01 8:22 ` Tiwei Bie 2018-08-01 8:33 ` Jason Wang @ 2018-08-01 10:13 ` Peter Maydell 2018-08-01 11:02 ` Tiwei Bie 2018-08-01 21:58 ` Michael S. Tsirkin 1 sibling, 2 replies; 10+ messages in thread From: Peter Maydell @ 2018-08-01 10:13 UTC (permalink / raw) To: Tiwei Bie; +Cc: Michael S. Tsirkin, Jason Wang, QEMU Developers On 1 August 2018 at 09:22, Tiwei Bie <tiwei.bie@intel.com> wrote: > Ping.. > > It seems that the final release for QEMU 3.0 will be > out soon [1]. But this fix hasn't been merged yet. > > [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg06004.html :-( You just missed rc3 (which we tagged yesterday), and I'm not sure if this meets the barrier for causing us to put out an rc4. It is a regression, but when does it happen? The commit message isn't very clear whether this is a corner case or not. thanks -- PMM ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-08-01 10:13 ` Peter Maydell @ 2018-08-01 11:02 ` Tiwei Bie 2018-08-01 21:58 ` Michael S. Tsirkin 1 sibling, 0 replies; 10+ messages in thread From: Tiwei Bie @ 2018-08-01 11:02 UTC (permalink / raw) To: Peter Maydell; +Cc: Michael S. Tsirkin, Jason Wang, QEMU Developers On Wed, Aug 01, 2018 at 11:13:34AM +0100, Peter Maydell wrote: > On 1 August 2018 at 09:22, Tiwei Bie <tiwei.bie@intel.com> wrote: > > Ping.. > > > > It seems that the final release for QEMU 3.0 will be > > out soon [1]. But this fix hasn't been merged yet. > > > > [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg06004.html > > :-( > > You just missed rc3 (which we tagged yesterday), and I'm > not sure if this meets the barrier for causing us to put > out an rc4. This is just a very simple fix. I'm not sure whether an rc4 is really needed. > It is a regression, but when does it happen? > The commit message isn't very clear whether this is a > corner case or not. It always happens when I try to use vIOMMU in vhost, as long as qom-cast-debug isn't disabled during ./configure. Thanks, Tiwei ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-08-01 10:13 ` Peter Maydell 2018-08-01 11:02 ` Tiwei Bie @ 2018-08-01 21:58 ` Michael S. Tsirkin 2018-08-02 8:51 ` Peter Maydell 1 sibling, 1 reply; 10+ messages in thread From: Michael S. Tsirkin @ 2018-08-01 21:58 UTC (permalink / raw) To: Peter Maydell; +Cc: Tiwei Bie, Jason Wang, QEMU Developers On Wed, Aug 01, 2018 at 11:13:34AM +0100, Peter Maydell wrote: > On 1 August 2018 at 09:22, Tiwei Bie <tiwei.bie@intel.com> wrote: > > Ping.. > > > > It seems that the final release for QEMU 3.0 will be > > out soon [1]. But this fix hasn't been merged yet. > > > > [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg06004.html > > :-( > > You just missed rc3 (which we tagged yesterday), and I'm > not sure if this meets the barrier for causing us to put > out an rc4. It is a regression, but when does it happen? > The commit message isn't very clear whether this is a > corner case or not. > > thanks > -- PMM There's also Igor's fix for memory hotplug. Pretty small fixes for sure, and I'd like to have them in if possible, but if I'm the only one maybe we can put it in stable ... I have collected these two in my tree meanwhile. Let me know. -- MST ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-08-01 21:58 ` Michael S. Tsirkin @ 2018-08-02 8:51 ` Peter Maydell 2018-08-02 9:13 ` Michael S. Tsirkin 0 siblings, 1 reply; 10+ messages in thread From: Peter Maydell @ 2018-08-02 8:51 UTC (permalink / raw) To: Michael S. Tsirkin; +Cc: Tiwei Bie, Jason Wang, QEMU Developers On 1 August 2018 at 22:58, Michael S. Tsirkin <mst@redhat.com> wrote: > There's also Igor's fix for memory hotplug. > Pretty small fixes for sure, and I'd like to have them in if possible, > but if I'm the only one maybe we can put it in stable ... Can you make sure that's listed on the release planning page: https://wiki.qemu.org/Planning/3.0#Not_yet_fixed_in_any_rc We have a handful of maybe-we-should-put-these in bugs, so I'll make a call one way or the other on whether to do an rc4 depending on what we've got... thanks -- PMM ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: check region type before casting 2018-08-02 8:51 ` Peter Maydell @ 2018-08-02 9:13 ` Michael S. Tsirkin 0 siblings, 0 replies; 10+ messages in thread From: Michael S. Tsirkin @ 2018-08-02 9:13 UTC (permalink / raw) To: Peter Maydell; +Cc: Tiwei Bie, Jason Wang, QEMU Developers On Thu, Aug 02, 2018 at 09:51:10AM +0100, Peter Maydell wrote: > On 1 August 2018 at 22:58, Michael S. Tsirkin <mst@redhat.com> wrote: > > There's also Igor's fix for memory hotplug. > > Pretty small fixes for sure, and I'd like to have them in if possible, > > but if I'm the only one maybe we can put it in stable ... > > Can you make sure that's listed on the release planning page: > https://wiki.qemu.org/Planning/3.0#Not_yet_fixed_in_any_rc > > We have a handful of maybe-we-should-put-these in bugs, > so I'll make a call one way or the other on whether to do > an rc4 depending on what we've got... > > thanks > -- PMM Done. There's one regression and one non-regression. -- MST ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-08-02 9:14 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-07-20 8:36 [Qemu-devel] [PATCH] vhost: check region type before casting Tiwei Bie 2018-07-20 8:52 ` no-reply 2018-07-20 9:08 ` Peter Maydell 2018-08-01 8:22 ` Tiwei Bie 2018-08-01 8:33 ` Jason Wang 2018-08-01 10:13 ` Peter Maydell 2018-08-01 11:02 ` Tiwei Bie 2018-08-01 21:58 ` Michael S. Tsirkin 2018-08-02 8:51 ` Peter Maydell 2018-08-02 9:13 ` Michael S. Tsirkin
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).