qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperti


From: Babu Moger
Subject: Re: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties
Date: Mon, 13 Jul 2020 11:43:33 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


On 7/13/20 11:17 AM, Igor Mammedov wrote:
> On Mon, 13 Jul 2020 10:02:22 -0500
> Babu Moger <babu.moger@amd.com> wrote:
> 
>>> -----Original Message-----
>>> From: Igor Mammedov <imammedo@redhat.com>
>>> Sent: Monday, July 13, 2020 4:08 AM
>>> To: Moger, Babu <Babu.Moger@amd.com>
>>> Cc: pbonzini@redhat.com; rth@twiddle.net; ehabkost@redhat.com; qemu-
>>> devel@nongnu.org
>>> Subject: Re: [PATCH v2 1/3] hw/i386: Initialize topo_ids from
>>> CpuInstanceProperties
> [...]
>>>> +
>>>> +/*
>>>> + * Initialize topo_ids from CpuInstanceProperties
>>>> + * node_id in CpuInstanceProperties(or in CPU device) is a sequential
>>>> + * number, but while building the topology  
>>>   
>>>> we need to separate it for
>>>> + * each socket(mod nodes_per_pkg).  
>>> could you clarify a bit more on why this is necessary?  
>>
>> If you have two sockets and 4 numa nodes, node_id in CpuInstanceProperties
>> will be number sequentially as 0, 1, 2, 3.  But in EPYC topology, it will
>> be  0, 1, 0, 1( Basically mod % number of nodes per socket).
> 
> I'm confused, let's suppose we have 2 EPYC sockets with 2 nodes per socket
> so APIC id woulbe be composed like:
> 
>  1st socket
>    pkg_id(0) | node_id(0)
>    pkg_id(0) | node_id(1)
> 
>  2nd socket
>    pkg_id(1) | node_id(0)
>    pkg_id(1) | node_id(1)
>   
> if that's the case, then EPYC's node_id here doesn't look like
> a NUMA node in the sense it's usually used
> (above config would have 4 different memory controllers => 4 conventional 
> NUMA nodes).

EPIC model uses combination of socket id and node id to identify the numa
nodes. So, it internally uses all the information.

> 
> I wonder if linux guest actually uses node_id encoded in apic id for
> configuring/checking numa structures, or it just uses whatever ACPI SRAT
> table provided.
>  
>>>> + */
>>>> +static inline void x86_init_topo_ids(X86CPUTopoInfo *topo_info,
>>>> +                                     CpuInstanceProperties props,
>>>> +                                     X86CPUTopoIDs *topo_ids) {
>>>> +    topo_ids->smt_id = props.has_thread_id ? props.thread_id : 0;
>>>> +    topo_ids->core_id = props.has_core_id ? props.core_id : 0;
>>>> +    topo_ids->die_id = props.has_die_id ? props.die_id : 0;
>>>> +    topo_ids->node_id = props.has_node_id ?
>>>> +                        props.node_id % MAX(topo_info->nodes_per_pkg, 1) 
>>>> : 0;
>>>> +    topo_ids->pkg_id = props.has_socket_id ? props.socket_id : 0; }
>>>>  /*
>>>>   * Make APIC ID for the CPU 'cpu_index'
>>>>   *
>>>>  
>>
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]