]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel: Directly pass AccelState argument to AccelClass::has_memory()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 30 Jun 2025 13:28:08 +0000 (15:28 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 4 Jul 2025 10:08:44 +0000 (12:08 +0200)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250703173248.44995-34-philmd@linaro.org>

accel/kvm/kvm-all.c
include/qemu/accel.h
system/memory.c

index 007f82a50dee1554e9d6136d92f6792f83995e06..6f6f9ef69bac31aa9adcc07e5006d0211544b9c8 100644 (file)
@@ -3786,10 +3786,10 @@ int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target)
     return r;
 }
 
-static bool kvm_accel_has_memory(MachineState *ms, AddressSpace *as,
+static bool kvm_accel_has_memory(AccelState *accel, AddressSpace *as,
                                  hwaddr start_addr, hwaddr size)
 {
-    KVMState *kvm = KVM_STATE(ms->accelerator);
+    KVMState *kvm = KVM_STATE(accel);
     int i;
 
     for (i = 0; i < kvm->nr_as; ++i) {
index b9a9b3593d81ffd926cca091fec6c294fe92067b..f327a71282c7a943e90dffd6625e3b0fcaf338a6 100644 (file)
@@ -46,7 +46,7 @@ typedef struct AccelClass {
 
     /* system related hooks */
     void (*setup_post)(MachineState *ms, AccelState *accel);
-    bool (*has_memory)(MachineState *ms, AddressSpace *as,
+    bool (*has_memory)(AccelState *accel, AddressSpace *as,
                        hwaddr start_addr, hwaddr size);
 
     /* gdbstub related hooks */
index 76b44b8220f3196efcc7a7a0eb60d85bc0f22b37..e8d9b15b28f6bb95c52afef9457e12478b3d1083 100644 (file)
@@ -3501,7 +3501,7 @@ static void mtree_print_flatview(gpointer key, gpointer value,
         if (fvi->ac) {
             for (i = 0; i < fv_address_spaces->len; ++i) {
                 as = g_array_index(fv_address_spaces, AddressSpace*, i);
-                if (fvi->ac->has_memory(current_machine, as,
+                if (fvi->ac->has_memory(current_machine->accelerator, as,
                                         int128_get64(range->addr.start),
                                         MR_SIZE(range->addr.size) + 1)) {
                     qemu_printf(" %s", fvi->ac->name);