From nobody Wed Nov 19 04:32:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) client-ip=209.85.221.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1614357242; cv=none; d=zohomail.com; s=zohoarc; b=kOhRi0KnhFHzy09OFBRNue3WjGw+RiwzxtWTjOqnmJD+Qpd7UfTJiRyYtiBSki3hgHnXxhwho3xELya2AUhJcfI9SQn5A5iky4YTiIM4Y1u6VxJRQi5mHq5FNcX7InGGC6SaxHAqiErpMoQ+vetYlMHgvSN4KK8wGF+dUh/fL3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614357242; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yTanq6JfzM3gaBH0H5tWyaeDUZu7wVaLTH7Xl4MKE/E=; b=YsMPjSsldIhpC3yKtZFXGpEEZCWg/1Rsbx8+zRH+XJHWqR5yhi3Y7CWSbNgSbcgPCQ4+AqAGtiQs8diCZBGnaply3mIgWUd8ueAiiFaTVeR1sTjfuxcZ6+uuTHZ3z5dzFuS+6sOzidrjty+f1xnhU/hORIJ1GhR3ma0h/OxMhRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.zohomail.com with SMTPS id 1614357242664388.03827261700974; Fri, 26 Feb 2021 08:34:02 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id l12so9158149wry.2 for ; Fri, 26 Feb 2021 08:34:01 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id q18sm14489461wrw.91.2021.02.26.08.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 08:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yTanq6JfzM3gaBH0H5tWyaeDUZu7wVaLTH7Xl4MKE/E=; b=ITu5LX2ZI2JgkpR4iVu6NfsUJpxJeZlNMyg46p/tmS8LfsT0HI9bbllQfQXKzN/+au RZGdcIN8W7aOgtLTLnEWb98wEp6p3YSWO+lOZ05WetzYcUN0mXSa6nHpbVofD4YkbYqg se+HthTebJlRMrhwqLwYGOp8EmPYADXUn/UjfiraVZh0cnrf3kmFzHDMRjbLYCxVfg8y wNqq7iitezppheyLnerS5ErdJbcFnwoni/JotWF8hXuuQWDF0jbSnCuGLMiTuw4rEsyy F6xFGtzYVbqMTwq+bvv6EGGPPMps2AsERWWFn/kCVt6q0AI4dQgaNucHk6p2mWCa7NC2 IYbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yTanq6JfzM3gaBH0H5tWyaeDUZu7wVaLTH7Xl4MKE/E=; b=e/Tr/Ms9gmNvtvI0u+J7kkTkkUItgMF+FYiko5HKaWb6Bq/EA7E6FJy3NXOifPY+rV xGWHYj/l/G9bw5eU77QpvAOBm3OWy8E4BrFjz6gEZSF5GkeDqo8SHpDyhgnbo+oEvsn/ EuU29W7sl3cMTiJBgevYQDbhYijinJhzJqYbXFuQjIBz9eInfvyUIE+T/IXKu0lIpziy V5yp1iauUYcyNvPOOYWuO1T3E7c3jM3jrMtSsD2+cyr84T5XIYBvP7iXJ6UqQoGZNi9r vhfsNDggoxd9x9VaTtfXXYK2oX/uG6wV7/xYtX9VHWQxV335K4FJFx8nqwoANha+08eR /GHg== X-Gm-Message-State: AOAM533G3WCsnvpbsRu3psLr2APR0qI2zmFgEN5WG0FxmWmsWENm7eaS TuDpqo4oN415tCbdFfoTMtg= X-Google-Smtp-Source: ABdhPJzOTZ6UwHTS7Bvdqp61Ih9ss51SNMlWeHMb8F2NTz6lmT5nBAnqAYjA6kU0xWRWvddEWoF/qg== X-Received: by 2002:a5d:47a8:: with SMTP id 8mr3981793wrb.180.1614357240762; Fri, 26 Feb 2021 08:34:00 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Sarah Harris , Paolo Bonzini , Max Filippov , Yoshinori Sato , qemu-s390x@nongnu.org, Michael Rolnik , qemu-ppc@nongnu.org, Marek Vasut , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alistair Francis , Michael Walle , Guan Xuetao , Laurent Vivier , Anthony Green , Palmer Dabbelt , David Hildenbrand , qemu-riscv@nongnu.org, David Gibson , Peter Maydell , Cornelia Huck , Jiaxun Yang , Richard Henderson , Chris Wulff , "Michael S. Tsirkin" , Aurelien Jarno , Aleksandar Rikalo , Sagar Karandikar , Claudio Fontana , Thomas Huth , Artyom Tarasenko , Greg Kurz , Stafford Horne , Bastian Koppelmann , Mark Cave-Ayland , Marcel Apfelbaum , "Edgar E. Iglesias" Subject: [PATCH 14/16] cpu: Move CPUClass::get_memory_mapping to CPUSystemOperations Date: Fri, 26 Feb 2021 17:32:25 +0100 Message-Id: <20210226163227.4097950-15-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210226163227.4097950-1-f4bug@amsat.org> References: <20210226163227.4097950-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 8 +++++--- hw/core/cpu.c | 4 ++-- target/i386/cpu.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5bc66653c19..caca5896592 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -84,6 +84,11 @@ struct AccelCPUClass; * struct CPUSystemOperations: System operations specific to a CPU class */ typedef struct CPUSystemOperations { + /** + * @get_memory_mapping: Callback for obtaining the memory mappings. + */ + void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list, + Error **errp); /** * @get_phys_page_debug: Callback for obtaining a physical address. */ @@ -157,7 +162,6 @@ typedef struct CPUSystemOperations { * @dump_statistics: Callback for dumping statistics. * @get_arch_id: Callback for getting architecture-dependent CPU ID. * @get_paging_enabled: Callback for inquiring whether paging is enabled. - * @get_memory_mapping: Callback for obtaining the memory mappings. * @set_pc: Callback for setting the Program Counter register. This * should have the semantics used by the target architecture when * setting the PC from a source such as an ELF file entry point; @@ -201,8 +205,6 @@ struct CPUClass { void (*dump_statistics)(CPUState *cpu, int flags); int64_t (*get_arch_id)(CPUState *cpu); bool (*get_paging_enabled)(const CPUState *cpu); - void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list, - Error **errp); void (*set_pc)(CPUState *cpu, vaddr value); int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg); int (*gdb_write_register)(CPUState *cpu, uint8_t *buf, int reg); diff --git a/hw/core/cpu.c b/hw/core/cpu.c index f0c558c002e..606fc753bf0 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -83,8 +83,8 @@ void cpu_get_memory_mapping(CPUState *cpu, MemoryMappingL= ist *list, { CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 - if (cc->get_memory_mapping) { - cc->get_memory_mapping(cpu, list, errp); + if (cc->system_ops.get_memory_mapping) { + cc->system_ops.get_memory_mapping(cpu, list, errp); return; } =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f6f5c333b7e..92691a22de5 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7419,7 +7419,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) =20 #ifndef CONFIG_USER_ONLY cc->system_ops.asidx_from_attrs =3D x86_asidx_from_attrs; - cc->get_memory_mapping =3D x86_cpu_get_memory_mapping; + cc->system_ops.get_memory_mapping =3D x86_cpu_get_memory_mapping; cc->system_ops.get_phys_page_attrs_debug =3D x86_cpu_get_phys_page_att= rs_debug; cc->system_ops.get_crash_info =3D x86_cpu_get_crash_info; cc->system_ops.write_elf64_note =3D x86_cpu_write_elf64_note; --=20 2.26.2