[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 2 PATCH 13/16] machine: Add new epyc property in PCMac
From: |
Moger, Babu |
Subject: |
[Qemu-devel] [RFC 2 PATCH 13/16] machine: Add new epyc property in PCMachineState |
Date: |
Fri, 6 Sep 2019 19:13:09 +0000 |
Adds new epyc property in PCMachineState and also in MachineState.
This property will be used to initialize the mode specific handlers
to generate apic ids.
Signed-off-by: Babu Moger <address@hidden>
---
hw/i386/pc.c | 23 +++++++++++++++++++++++
include/hw/boards.h | 2 ++
include/hw/i386/pc.h | 1 +
3 files changed, 26 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 959bd3821b..14760523a9 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2810,6 +2810,22 @@ static void pc_machine_set_pit(Object *obj, bool value,
Error **errp)
pcms->pit_enabled = value;
}
+static bool pc_machine_get_epyc(Object *obj, Error **errp)
+{
+ PCMachineState *pcms = PC_MACHINE(obj);
+
+ return pcms->epyc;
+}
+
+static void pc_machine_set_epyc(Object *obj, bool value, Error **errp)
+{
+ PCMachineState *pcms = PC_MACHINE(obj);
+ MachineState *ms = MACHINE(pcms);
+
+ pcms->epyc = value;
+ ms->epyc = value;
+}
+
static void pc_machine_initfn(Object *obj)
{
PCMachineState *pcms = PC_MACHINE(obj);
@@ -3015,6 +3031,13 @@ static void pc_machine_class_init(ObjectClass *oc, void
*data)
object_class_property_add_bool(oc, PC_MACHINE_PIT,
pc_machine_get_pit, pc_machine_set_pit, &error_abort);
+
+ object_class_property_add_bool(oc, "epyc",
+ pc_machine_get_epyc, pc_machine_set_epyc, &error_abort);
+
+ object_class_property_set_description(oc, "epyc",
+ "Set on/off to use epyc mode", &error_abort);
+
}
static const TypeInfo pc_machine_info = {
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 12eb5032a5..0001d42e50 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -299,6 +299,8 @@ struct MachineState {
AccelState *accelerator;
CPUArchIdList *possible_cpus;
CpuTopology smp;
+ bool epyc;
+
struct NVDIMMState *nvdimms_state;
};
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index d6f1189997..cf9e7b0045 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -68,6 +68,7 @@ struct PCMachineState {
uint64_t *node_mem;
/* Apic id specific handlers */
+ bool epyc;
uint32_t (*apicid_from_cpu_idx)(X86CPUTopoInfo *topo_info, unsigned
cpu_index);
void (*topo_ids_from_apicid)(apic_id_t apicid, X86CPUTopoInfo *topo_info,
X86CPUTopoIDs *topo_ids);
- Re: [Qemu-devel] [RFC 2 PATCH 06/16] hw/core: Add core complex id in X86CPU topology, (continued)
- [Qemu-devel] [RFC 2 PATCH 07/16] hw/386: Add new epyc mode topology decoding functions, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 08/16] i386: Cleanup and use the new epyc mode topology functions, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 09/16] hw/i386: Introduce initialize_topo_info function, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 10/16] hw/i386: Introduce apicid_from_cpu_idx in PCMachineState, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 11/16] Introduce-topo_ids_from_apicid-handler, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 12/16] hw/i386: Introduce apic_id_from_topo_ids handler in PCMachineState, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 13/16] machine: Add new epyc property in PCMachineState,
Moger, Babu <=
- [Qemu-devel] [RFC 2 PATCH 14/16] hw/i386: Introduce epyc mode function handlers, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 15/16] i386: Fix pkg_id offset for epyc mode, Moger, Babu, 2019/09/06
- [Qemu-devel] [RFC 2 PATCH 16/16] hw/core: Fix up the machine_set_cpu_numa_node for epyc, Moger, Babu, 2019/09/06
- Re: [RFC 2 PATCH 00/16] APIC ID fixes for AMD EPYC CPU models, Moger, Babu, 2019/09/20