[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/63] hw/virtio: Propagate page_mask to vhost_vdpa_listener_skipp
From: |
Michael S. Tsirkin |
Subject: |
[PULL 02/63] hw/virtio: Propagate page_mask to vhost_vdpa_listener_skipped_section() |
Date: |
Wed, 4 Oct 2023 04:43:16 -0400 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
In order to make vhost-vdpa.c a target-agnostic source unit,
we need to remove the TARGET_PAGE_SIZE / TARGET_PAGE_MASK /
TARGET_PAGE_ALIGN uses. TARGET_PAGE_SIZE will be replaced by
the runtime qemu_target_page_size(). The other ones will be
deduced from TARGET_PAGE_SIZE.
Since the 3 macros are used in 3 related functions (sharing
the same call tree), we'll refactor them to only depend on
TARGET_PAGE_MASK.
Having the following call tree:
vhost_vdpa_listener_region_del()
-> vhost_vdpa_listener_skipped_section()
-> vhost_vdpa_section_end()
The first step is to propagate TARGET_PAGE_MASK to
vhost_vdpa_listener_skipped_section().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230710094931.84402-2-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 | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 42f2a4bae9..118c588205 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -42,7 +42,8 @@ static Int128 vhost_vdpa_section_end(const
MemoryRegionSection *section)
static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section,
uint64_t iova_min,
- uint64_t iova_max)
+ uint64_t iova_max,
+ int page_mask)
{
Int128 llend;
@@ -313,7 +314,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener
*listener,
int ret;
if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first,
- v->iova_range.last)) {
+ v->iova_range.last,
TARGET_PAGE_MASK)) {
return;
}
if (memory_region_is_iommu(section->mr)) {
@@ -398,7 +399,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener
*listener,
int ret;
if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first,
- v->iova_range.last)) {
+ v->iova_range.last,
TARGET_PAGE_MASK)) {
return;
}
if (memory_region_is_iommu(section->mr)) {
--
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, 2023/10/04
- [PULL 02/63] hw/virtio: Propagate page_mask to vhost_vdpa_listener_skipped_section(),
Michael S. Tsirkin <=
- [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
- [PULL 10/63] virtio-net: do not reset vlan filtering at set_features, Michael S. Tsirkin, 2023/10/04