vhost: check region type before casting
PATCH 1/1 vhost: check region type before casting
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
--- hw/virtio/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/virtio/vhost.c +3 -1
@@ -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);
Signature · 1 line
2.18.0
Quoted 4 lines · Tiwei Bie
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:
Quoted 8 lines
vhost_iommu_region_add: Object0x561f28bce4f0is not an instance of type qemu:iommu-memory-regionFixes cb1efcf462a2 ("iommu: Add IOMMU index argument to notifier APIs")Cc Peter Maydell <[email protected]>Signed-off-by Tiwei Bie <[email protected]>---
thanks
-- PMM
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.
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: [email protected]
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 [email protected]
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
Quoted 39 lines · Tiwei Bie
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: Object0x561f28bce4f0is not an instance of type qemu:iommu-memory-regionFixes cb1efcf462a2 ("iommu: Add IOMMU index argument to notifier APIs")Cc Peter Maydell <[email protected]>Signed-off-by Tiwei Bie <[email protected]>--- hw/virtio/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/virtio/vhost.c +3
-1@@ -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);Signature · 1 line
2.18.0
Jason Wang
Acked-byQuoted 9 lines · Tiwei Bie
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
Quoted 41 lines · Tiwei Bie
Quoted 39 lines
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: Object0x561f28bce4f0is not an instance of type qemu:iommu-memory-regionFixes cb1efcf462a2 ("iommu: Add IOMMU index argument to notifier APIs")Cc Peter Maydell <[email protected]>Signed-off-by Tiwei Bie <[email protected]>--- hw/virtio/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/virtio/vhost.c +3
-1@@ -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);Signature · 1 line
2.18.0
Quoted 6 lines · Tiwei Bie
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
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Tiwei Bie
Ping..
It seems that the final release for QEMU 3.0 will be out soon [1]. But this fix hasn't been merged yet.
Quoted 7 lines
:-(
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.
Quoted 3 lines
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
Quoted 10 lines · Peter Maydell
Quoted 6 lines · Tiwei Bie
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
:-(
Quoted 8 lines
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.
Signature · 1 line
MST
Quoted 3 lines · Michael S. Tsirkin
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
Quoted 8 lines · Peter Maydell
Quoted 3 lines · Michael S. Tsirkin
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
Quoted 6 lines
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.
Signature · 1 line
MST