Commit c24a41bb authored by Babu Moger's avatar Babu Moger Committed by Eduardo Habkost
Browse files

hw/i386: Update structures to save the number of nodes per package



Update structures X86CPUTopoIDs and CPUX86State to hold the number of
nodes per package. This is required to build EPYC mode topology.

Signed-off-by: default avatarBabu Moger <babu.moger@amd.com>
Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Message-Id: <158396720035.58170.1973738805301006456.stgit@naples-babu.amd.com>
parent 156778a0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1525,6 +1525,7 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
    init_topo_info(&topo_info, x86ms);

    env->nr_dies = x86ms->smp_dies;
    env->nr_nodes = topo_info.nodes_per_pkg;

    /*
     * If APIC ID is not set,
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ inline void init_topo_info(X86CPUTopoInfo *topo_info,
{
    MachineState *ms = MACHINE(x86ms);

    topo_info->nodes_per_pkg = ms->numa_state->num_nodes / ms->smp.sockets;
    topo_info->dies_per_pkg = x86ms->smp_dies;
    topo_info->cores_per_die = ms->smp.cores;
    topo_info->threads_per_core = ms->smp.threads;
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ typedef struct X86CPUTopoIDs {
} X86CPUTopoIDs;

typedef struct X86CPUTopoInfo {
    unsigned nodes_per_pkg;
    unsigned dies_per_pkg;
    unsigned cores_per_die;
    unsigned threads_per_core;
+1 −0
Original line number Diff line number Diff line
@@ -6957,6 +6957,7 @@ static void x86_cpu_initfn(Object *obj)
    FeatureWord w;

    env->nr_dies = 1;
    env->nr_nodes = 1;
    cpu_set_cpustate_pointers(cpu);

    object_property_add(obj, "family", "int",
+1 −0
Original line number Diff line number Diff line
@@ -1609,6 +1609,7 @@ typedef struct CPUX86State {
    TPRAccess tpr_access_type;

    unsigned nr_dies;
    unsigned nr_nodes;
} CPUX86State;

struct kvm_msrs;
Loading