[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/63] hw/virtio: Propagate page_mask to vhost_vdpa_section_end()
From: |
Michael S. Tsirkin |
Subject: |
[PULL 03/63] hw/virtio: Propagate page_mask to vhost_vdpa_section_end() |
Date: |
Wed, 4 Oct 2023 04:43:18 -0400 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Propagate TARGET_PAGE_MASK (see the previous commit for
rationale).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230710094931.84402-3-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-vdpa.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 118c588205..3ab0dc0b5b 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -31,11 +31,12 @@
* Return one past the end of the end of section. Be careful with uint64_t
* conversions!
*/
-static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section)
+static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section,
+ int page_mask)
{
Int128 llend = int128_make64(section->offset_within_address_space);
llend = int128_add(llend, section->size);
- llend = int128_and(llend, int128_exts64(TARGET_PAGE_MASK));
+ llend = int128_and(llend, int128_exts64(page_mask));
return llend;
}
@@ -69,7 +70,7 @@ static bool
vhost_vdpa_listener_skipped_section(MemoryRegionSection *section,
*/
if (!memory_region_is_iommu(section->mr)) {
- llend = vhost_vdpa_section_end(section);
+ llend = vhost_vdpa_section_end(section, page_mask);
if (int128_gt(llend, int128_make64(iova_max))) {
error_report("RAM section out of device range (max=0x%" PRIx64
", end addr=0x%" PRIx64 ")",
@@ -331,7 +332,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener
*listener,
}
iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);
- llend = vhost_vdpa_section_end(section);
+ llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK);
if (int128_ge(int128_make64(iova), llend)) {
return;
}
@@ -415,7 +416,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener
*listener,
}
iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);
- llend = vhost_vdpa_section_end(section);
+ llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK);
trace_vhost_vdpa_listener_region_del(v, iova,
int128_get64(int128_sub(llend, int128_one())));
--
MST
- [PULL 00/63] virtio,pci: features, cleanups, Michael S. Tsirkin, 2023/10/04
- [PULL 04/63] hw/virtio/vhost-vdpa: Inline TARGET_PAGE_ALIGN() macro, Michael S. Tsirkin, 2023/10/04
- [PULL 03/63] hw/virtio: Propagate page_mask to vhost_vdpa_section_end(),
Michael S. Tsirkin <=
- [PULL 02/63] hw/virtio: Propagate page_mask to vhost_vdpa_listener_skipped_section(), Michael S. Tsirkin, 2023/10/04
- [PULL 06/63] hw/virtio: Build vhost-vdpa.o once, Michael S. Tsirkin, 2023/10/04
- [PULL 01/63] pci: SLT must be RO, Michael S. Tsirkin, 2023/10/04
- [PULL 05/63] hw/virtio/vhost-vdpa: Use target-agnostic qemu_target_page_mask(), Michael S. Tsirkin, 2023/10/04
- [PULL 07/63] hw/virtio/meson: Rename softmmu_virtio_ss[] -> system_virtio_ss[], Michael S. Tsirkin, 2023/10/04
- [PULL 11/63] virtio-net: Expose MAX_VLAN, Michael S. Tsirkin, 2023/10/04
- [PULL 09/63] hw/virtio: add config support to vhost-user-device, Michael S. Tsirkin, 2023/10/04
- [PULL 08/63] virtio: add vhost-user-base and a generic vhost-user-device, Michael S. Tsirkin, 2023/10/04
- [PULL 14/63] virtio: don't zero out memory region cache for indirect descriptors, Michael S. Tsirkin, 2023/10/04
- [PULL 13/63] vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ, Michael S. Tsirkin, 2023/10/04