[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/22] vfio/spapr: Make vfio_spapr_create/remove_window static
|
From: |
Cédric Le Goater |
|
Subject: |
[PULL 21/22] vfio/spapr: Make vfio_spapr_create/remove_window static |
|
Date: |
Mon, 6 Nov 2023 15:36:52 +0100 |
From: Zhenzhong Duan <zhenzhong.duan@intel.com>
vfio_spapr_create_window calls vfio_spapr_remove_window,
With reoder of definition of the two, we can make
vfio_spapr_create/remove_window static.
No functional changes intended.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
include/hw/vfio/vfio-common.h | 6 -----
hw/vfio/spapr.c | 48 +++++++++++++++++------------------
2 files changed, 24 insertions(+), 30 deletions(-)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index
ed5a8e4754d8105ce1a41ef72168473b2d5d239f..87848982bd7c2920a76db2274d039728c6485ae5
100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -293,12 +293,6 @@ struct vfio_info_cap_header *
vfio_get_cap(void *ptr, uint32_t cap_offset, uint16_t id);
#endif
-int vfio_spapr_create_window(VFIOContainer *container,
- MemoryRegionSection *section,
- hwaddr *pgsize);
-int vfio_spapr_remove_window(VFIOContainer *container,
- hwaddr offset_within_address_space);
-
bool vfio_migration_realize(VFIODevice *vbasedev, Error **errp);
void vfio_migration_exit(VFIODevice *vbasedev);
diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
index
00dbd7af11faa0222609a40818ba846e0411ba27..4428990c28c9609cfa6211bfcfe063e104d5aee8
100644
--- a/hw/vfio/spapr.c
+++ b/hw/vfio/spapr.c
@@ -146,9 +146,30 @@ static const MemoryListener vfio_prereg_listener = {
.region_del = vfio_prereg_listener_region_del,
};
-int vfio_spapr_create_window(VFIOContainer *container,
- MemoryRegionSection *section,
- hwaddr *pgsize)
+static int vfio_spapr_remove_window(VFIOContainer *container,
+ hwaddr offset_within_address_space)
+{
+ struct vfio_iommu_spapr_tce_remove remove = {
+ .argsz = sizeof(remove),
+ .start_addr = offset_within_address_space,
+ };
+ int ret;
+
+ ret = ioctl(container->fd, VFIO_IOMMU_SPAPR_TCE_REMOVE, &remove);
+ if (ret) {
+ error_report("Failed to remove window at %"PRIx64,
+ (uint64_t)remove.start_addr);
+ return -errno;
+ }
+
+ trace_vfio_spapr_remove_window(offset_within_address_space);
+
+ return 0;
+}
+
+static int vfio_spapr_create_window(VFIOContainer *container,
+ MemoryRegionSection *section,
+ hwaddr *pgsize)
{
int ret = 0;
IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr);
@@ -238,27 +259,6 @@ int vfio_spapr_create_window(VFIOContainer *container,
return 0;
}
-int vfio_spapr_remove_window(VFIOContainer *container,
- hwaddr offset_within_address_space)
-{
- struct vfio_iommu_spapr_tce_remove remove = {
- .argsz = sizeof(remove),
- .start_addr = offset_within_address_space,
- };
- int ret;
-
- ret = ioctl(container->fd, VFIO_IOMMU_SPAPR_TCE_REMOVE, &remove);
- if (ret) {
- error_report("Failed to remove window at %"PRIx64,
- (uint64_t)remove.start_addr);
- return -errno;
- }
-
- trace_vfio_spapr_remove_window(offset_within_address_space);
-
- return 0;
-}
-
int vfio_container_add_section_window(VFIOContainer *container,
MemoryRegionSection *section,
Error **errp)
--
2.41.0
- [PULL 12/22] test: Add some tests for range and resv-mem helpers, (continued)
- [PULL 12/22] test: Add some tests for range and resv-mem helpers, Cédric Le Goater, 2023/11/06
- [PULL 11/22] virtio-iommu: Consolidate host reserved regions and property set ones, Cédric Le Goater, 2023/11/06
- [PULL 13/22] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps, Cédric Le Goater, 2023/11/06
- [PULL 14/22] util/uuid: Add UUID_STR_LEN definition, Cédric Le Goater, 2023/11/06
- [PULL 15/22] vfio/pci: Fix buffer overrun when writing the VF token, Cédric Le Goater, 2023/11/06
- [PULL 16/22] util/uuid: Remove UUID_FMT_LEN, Cédric Le Goater, 2023/11/06
- [PULL 17/22] util/uuid: Define UUID_STR_LEN from UUID_NONE string, Cédric Le Goater, 2023/11/06
- [PULL 18/22] vfio/container: Move IBM EEH related functions into spapr_pci_vfio.c, Cédric Le Goater, 2023/11/06
- [PULL 19/22] vfio/container: Move vfio_container_add/del_section_window into spapr.c, Cédric Le Goater, 2023/11/06
- [PULL 20/22] vfio/container: Move spapr specific init/deinit into spapr.c, Cédric Le Goater, 2023/11/06
- [PULL 21/22] vfio/spapr: Make vfio_spapr_create/remove_window static,
Cédric Le Goater <=
- [PULL 22/22] vfio/common: Move vfio_host_win_add/del into spapr.c, Cédric Le Goater, 2023/11/06
- Re: [PULL 00/22] vfio queue, Stefan Hajnoczi, 2023/11/06