* [PATCH 1/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one()
2024-06-12 13:25 [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*() Philippe Mathieu-Daudé
@ 2024-06-12 13:25 ` Philippe Mathieu-Daudé
2024-06-12 13:25 ` [PATCH 2/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu() Philippe Mathieu-Daudé
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-12 13:25 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Peter Xu, Jason Wang,
David Hildenbrand, Paolo Bonzini, Michael S. Tsirkin,
Richard Henderson
@event access is read-only.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/memory.h | 2 +-
system/memory.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 1be58f694c..2bf5e23b6a 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1852,7 +1852,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr,
* range.
*/
void memory_region_notify_iommu_one(IOMMUNotifier *notifier,
- IOMMUTLBEvent *event);
+ const IOMMUTLBEvent *event);
/**
* memory_region_unmap_iommu_notifier_range: notify a unmap for an IOMMU
diff --git a/system/memory.c b/system/memory.c
index 74cd73ebc7..f3a37c97c1 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -2006,9 +2006,9 @@ void memory_region_unregister_iommu_notifier(MemoryRegion *mr,
}
void memory_region_notify_iommu_one(IOMMUNotifier *notifier,
- IOMMUTLBEvent *event)
+ const IOMMUTLBEvent *event)
{
- IOMMUTLBEntry *entry = &event->entry;
+ const IOMMUTLBEntry *entry = &event->entry;
hwaddr entry_end = entry->iova + entry->addr_mask;
IOMMUTLBEntry tmp = *entry;
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu()
2024-06-12 13:25 [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*() Philippe Mathieu-Daudé
2024-06-12 13:25 ` [PATCH 1/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one() Philippe Mathieu-Daudé
@ 2024-06-12 13:25 ` Philippe Mathieu-Daudé
2024-06-12 13:25 ` [PATCH 3/3] hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype Philippe Mathieu-Daudé
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-12 13:25 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Peter Xu, Jason Wang,
David Hildenbrand, Paolo Bonzini, Michael S. Tsirkin,
Richard Henderson
@event access is read-only.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/memory.h | 2 +-
system/memory.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 2bf5e23b6a..2d7c278b9f 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1837,7 +1837,7 @@ uint64_t memory_region_iommu_get_min_page_size(IOMMUMemoryRegion *iommu_mr);
*/
void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr,
int iommu_idx,
- IOMMUTLBEvent event);
+ const IOMMUTLBEvent event);
/**
* memory_region_notify_iommu_one: notify a change in an IOMMU translation
diff --git a/system/memory.c b/system/memory.c
index f3a37c97c1..47c600df63 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -2052,7 +2052,7 @@ void memory_region_unmap_iommu_notifier_range(IOMMUNotifier *notifier)
void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr,
int iommu_idx,
- IOMMUTLBEvent event)
+ const IOMMUTLBEvent event)
{
IOMMUNotifier *iommu_notifier;
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype
2024-06-12 13:25 [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*() Philippe Mathieu-Daudé
2024-06-12 13:25 ` [PATCH 1/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one() Philippe Mathieu-Daudé
2024-06-12 13:25 ` [PATCH 2/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu() Philippe Mathieu-Daudé
@ 2024-06-12 13:25 ` Philippe Mathieu-Daudé
2024-06-12 14:30 ` [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*() Peter Xu
2024-06-18 10:41 ` Philippe Mathieu-Daudé
4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-12 13:25 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Peter Xu, Jason Wang,
David Hildenbrand, Paolo Bonzini, Michael S. Tsirkin,
Richard Henderson
@event access is read-only.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/intel_iommu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index cc8e59674e..c4350e0ff0 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1170,7 +1170,7 @@ static int vtd_iova_to_slpte(IntelIOMMUState *s, VTDContextEntry *ce,
}
}
-typedef int (*vtd_page_walk_hook)(IOMMUTLBEvent *event, void *private);
+typedef int (*vtd_page_walk_hook)(const IOMMUTLBEvent *event, void *private);
/**
* Constant information used during page walking
@@ -1533,7 +1533,7 @@ static int vtd_dev_to_context_entry(IntelIOMMUState *s, uint8_t bus_num,
return 0;
}
-static int vtd_sync_shadow_page_hook(IOMMUTLBEvent *event,
+static int vtd_sync_shadow_page_hook(const IOMMUTLBEvent *event,
void *private)
{
memory_region_notify_iommu(private, 0, *event);
@@ -2219,7 +2219,7 @@ static void vtd_iotlb_page_invalidate_notify(IntelIOMMUState *s,
* page tables. We just deliver the PSI down to
* invalidate caches.
*/
- IOMMUTLBEvent event = {
+ const IOMMUTLBEvent event = {
.type = IOMMU_NOTIFIER_UNMAP,
.entry = {
.target_as = &address_space_memory,
@@ -3889,7 +3889,7 @@ static void vtd_address_space_refresh_all(IntelIOMMUState *s)
vtd_switch_address_space_all(s);
}
-static int vtd_replay_hook(IOMMUTLBEvent *event, void *private)
+static int vtd_replay_hook(const IOMMUTLBEvent *event, void *private)
{
memory_region_notify_iommu_one(private, event);
return 0;
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*()
2024-06-12 13:25 [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*() Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2024-06-12 13:25 ` [PATCH 3/3] hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype Philippe Mathieu-Daudé
@ 2024-06-12 14:30 ` Peter Xu
2024-06-18 10:41 ` Philippe Mathieu-Daudé
4 siblings, 0 replies; 6+ messages in thread
From: Peter Xu @ 2024-06-12 14:30 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Jason Wang, David Hildenbrand, Paolo Bonzini,
Michael S. Tsirkin, Richard Henderson
On Wed, Jun 12, 2024 at 03:25:28PM +0200, Philippe Mathieu-Daudé wrote:
> Trivial patches using const IOMMUTLBEvent.
>
> Philippe Mathieu-Daudé (3):
> memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one()
> memory: Constify IOMMUTLBEvent in memory_region_notify_iommu()
> hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*()
2024-06-12 13:25 [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*() Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2024-06-12 14:30 ` [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*() Peter Xu
@ 2024-06-18 10:41 ` Philippe Mathieu-Daudé
4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-18 10:41 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Xu, Jason Wang, David Hildenbrand, Paolo Bonzini,
Michael S. Tsirkin, Richard Henderson
On 12/6/24 15:25, Philippe Mathieu-Daudé wrote:
> Trivial patches using const IOMMUTLBEvent.
>
> Philippe Mathieu-Daudé (3):
> memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one()
> memory: Constify IOMMUTLBEvent in memory_region_notify_iommu()
> hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype
Series queued.
^ permalink raw reply [flat|nested] 6+ messages in thread