[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH-for-9.1 18/21] target/i386: Use QMP generic_query_cpu_definit
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH-for-9.1 18/21] target/i386: Use QMP generic_query_cpu_definitions() |
Date: |
Fri, 15 Mar 2024 14:09:06 +0100 |
Register x86_cpu_definition_entry() and x86_cpu_list_compare()
as handler so we can use the QMP generic_query_cpu_definitions()
method.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/i386/cpu.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 07f64c1ea5..e5dbd307d8 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -38,6 +38,7 @@
#ifndef CONFIG_USER_ONLY
#include "sysemu/reset.h"
#include "qapi/qapi-commands-machine-target.h"
+#include "qapi/commands-target-compat.h"
#include "exec/address-spaces.h"
#include "hw/boards.h"
#include "hw/i386/sgx-epc.h"
@@ -5667,11 +5668,7 @@ static void x86_cpu_definition_entry(gpointer data,
gpointer user_data)
CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
{
- CpuDefinitionInfoList *cpu_list = NULL;
- GSList *list = get_sorted_cpu_model_list();
- g_slist_foreach(list, x86_cpu_definition_entry, &cpu_list);
- g_slist_free(list);
- return cpu_list;
+ return generic_query_cpu_definitions(errp);
}
#endif /* !CONFIG_USER_ONLY */
@@ -7937,6 +7934,8 @@ static Property x86_cpu_properties[] = {
#include "hw/core/sysemu-cpu-ops.h"
static const struct SysemuCPUOps i386_sysemu_ops = {
+ .add_definition = x86_cpu_definition_entry,
+ .cpu_list_compare = x86_cpu_list_compare,
.get_memory_mapping = x86_cpu_get_memory_mapping,
.get_paging_enabled = x86_cpu_get_paging_enabled,
.get_phys_page_attrs_debug = x86_cpu_get_phys_page_attrs_debug,
--
2.41.0
- Re: [PATCH-for-9.1 10/21] qapi: Make CpuModel* definitions target agnostic, (continued)
- [PATCH-for-9.1 11/21] qapi: Make CpuDefinitionInfo target agnostic, Philippe Mathieu-Daudé, 2024/03/15
- [PATCH-for-9.1 12/21] system: Introduce QemuArchBit enum, Philippe Mathieu-Daudé, 2024/03/15
- [RFC PATCH-for-9.1 16/21] target/loongarch: Use QMP generic_query_cpu_definitions(), Philippe Mathieu-Daudé, 2024/03/15
- [RFC PATCH-for-9.1 17/21] target/riscv: Use QMP generic_query_cpu_definitions(), Philippe Mathieu-Daudé, 2024/03/15
- [PATCH-for-9.1 13/21] system: Introduce cpu_typename_by_arch_bit(), Philippe Mathieu-Daudé, 2024/03/15
- [RFC PATCH-for-9.1 14/21] system: Introduce QMP generic_query_cpu_definitions(), Philippe Mathieu-Daudé, 2024/03/15
- [RFC PATCH-for-9.1 18/21] target/i386: Use QMP generic_query_cpu_definitions(),
Philippe Mathieu-Daudé <=
- [PATCH-for-9.1 19/21] target/ppc: Factor ppc_add_alias_definitions() out, Philippe Mathieu-Daudé, 2024/03/15
- [RFC PATCH-for-9.1 20/21] target/ppc: Use QMP generic_query_cpu_definitions(), Philippe Mathieu-Daudé, 2024/03/15
- [RFC PATCH-for-9.1 21/21] qapi: Make @query-cpu-definitions target-agnostic, Philippe Mathieu-Daudé, 2024/03/15
- Re: [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic, Markus Armbruster, 2024/03/26
- Re: [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic, Markus Armbruster, 2024/03/26