aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2025-02-10 09:46:46 +0100
committerPeter Xu <peterx@redhat.com>2025-02-12 11:33:05 -0500
commitd732b5a4ac3e8222e9527654f067bb766fdaecb6 (patch)
tree4c59e14105ab1fcde4b0f07d7d8d4d5fc6a382d1 /hw
parentd4337aa8e222802d342b9f58440ca8e005b8bf91 (diff)
downloadqemu-d732b5a4ac3e8222e9527654f067bb766fdaecb6.zip
qemu-d732b5a4ac3e8222e9527654f067bb766fdaecb6.tar.gz
qemu-d732b5a4ac3e8222e9527654f067bb766fdaecb6.tar.bz2
memory: pass MemTxAttrs to memory_access_is_direct()
We want to pass another flag that will be stored in MemTxAttrs. So pass MemTxAttrs directly. Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com> Link: https://lore.kernel.org/r/20250210084648.33798-6-david@redhat.com [peterx: Fix MacOS builds] Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/loader.c2
-rw-r--r--hw/display/apple-gfx.m3
-rw-r--r--hw/remote/vfio-user-obj.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index fd25c5e..332b879 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -144,7 +144,7 @@ ssize_t load_image_mr(const char *filename, MemoryRegion *mr)
{
ssize_t size;
- if (!memory_access_is_direct(mr, false)) {
+ if (!memory_access_is_direct(mr, false, MEMTXATTRS_UNSPECIFIED)) {
/* Can only load an image into RAM or ROM */
return -1;
}
diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m
index aa1455b..1554f3b 100644
--- a/hw/display/apple-gfx.m
+++ b/hw/display/apple-gfx.m
@@ -137,7 +137,8 @@ void *apple_gfx_host_ptr_for_gpa_range(uint64_t guest_physical,
MEMTXATTRS_UNSPECIFIED);
if (!ram_region || ram_region_length < length ||
- !memory_access_is_direct(ram_region, !read_only)) {
+ !memory_access_is_direct(ram_region, !read_only,
+ MEMTXATTRS_UNSPECIFIED)) {
return NULL;
}
diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c
index 9e5ff6d..6e51a92 100644
--- a/hw/remote/vfio-user-obj.c
+++ b/hw/remote/vfio-user-obj.c
@@ -358,7 +358,7 @@ static int vfu_object_mr_rw(MemoryRegion *mr, uint8_t *buf, hwaddr offset,
int access_size;
uint64_t val;
- if (memory_access_is_direct(mr, is_write)) {
+ if (memory_access_is_direct(mr, is_write, MEMTXATTRS_UNSPECIFIED)) {
/**
* Some devices expose a PCI expansion ROM, which could be buffer
* based as compared to other regions which are primarily based on