[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 07/13] hw/386: Add EPYC mode topology decoding functions
From: |
Babu Moger |
Subject: |
Re: [PATCH v7 07/13] hw/386: Add EPYC mode topology decoding functions |
Date: |
Thu, 12 Mar 2020 08:44:00 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/12/20 7:39 AM, Igor Mammedov wrote:
> On Wed, 11 Mar 2020 17:53:34 -0500
> Babu Moger <address@hidden> wrote:
>
>> These functions add support for building EPYC mode topology given the smp
>> details like numa nodes, cores, threads and sockets.
>>
>> The new apic id decoding is mostly similar to current apic id decoding
>> except that it adds a new field node_id when numa configured. Removes all
>> the hardcoded values. Subsequent patches will use these functions to build
>> the topology.
>>
>> Following functions are added.
> [...]
>> x86_topo_ids_from_idx_epyc
> you forgot to remove unused anymore function.
> No need to respin whole series for it though, you can post as reply to
> this patch v8 or do it as a patch on top.
Igor, The function x86_topo_ids_from_idx_epyc(or x86_topo_ids_from_idx) is
still there. We are using it internally now. It is used by
x86_apicid_from_cpu_idx_epyc(or x86_apicid_from_cpu_idx). We removed it as
callback function. So, we are good here. Thanks
>
>
>
>
> [...]
>>
>> The topology details are available in Processor Programming Reference (PPR)
>> for AMD Family 17h Model 01h, Revision B1 Processors. The revision guides are
>> available from the bugzilla Link below.
>> Link:
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D206537&data=02%7C01%7Cbabu.moger%40amd.com%7C3d1032fb1cc94a5a197308d7c68268c5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637196135715465573&sdata=13zSN7AqPGKHFG%2FePmkWTVbwM0qzktrnolEidnNzyhs%3D&reserved=0
>>
>> Signed-off-by: Babu Moger <address@hidden>
>> Acked-by: Igor Mammedov <address@hidden>
>> Acked-by: Michael S. Tsirkin <address@hidden>
> [...]
>> +static inline void x86_topo_ids_from_idx_epyc(X86CPUTopoInfo *topo_info,
>> + unsigned cpu_index,
>> + X86CPUTopoIDs *topo_ids)
>> +{
>> + unsigned nr_nodes = MAX(topo_info->nodes_per_pkg, 1);
>> + unsigned nr_dies = topo_info->dies_per_pkg;
>> + unsigned nr_cores = topo_info->cores_per_die;
>> + unsigned nr_threads = topo_info->threads_per_core;
>> + unsigned cores_per_node = DIV_ROUND_UP((nr_dies * nr_cores *
>> nr_threads),
>> + nr_nodes);
>> +
>> + topo_ids->pkg_id = cpu_index / (nr_dies * nr_cores * nr_threads);
>> + topo_ids->node_id = (cpu_index / cores_per_node) % nr_nodes;
>> + topo_ids->die_id = cpu_index / (nr_cores * nr_threads) % nr_dies;
>> + topo_ids->core_id = cpu_index / nr_threads % nr_cores;
>> + topo_ids->smt_id = cpu_index % nr_threads;
>> +}
>> +
>> +/*
> [...]
>
- [PATCH v7 00/13] APIC ID fixes for AMD EPYC CPU model, Babu Moger, 2020/03/11
- [PATCH v7 01/13] hw/i386: Introduce X86CPUTopoInfo to contain topology info, Babu Moger, 2020/03/11
- [PATCH v7 02/13] hw/i386: Consolidate topology functions, Babu Moger, 2020/03/11
- [PATCH v7 03/13] machine: Add SMP Sockets in CpuTopology, Babu Moger, 2020/03/11
- [PATCH v7 04/13] hw/i386: Remove unnecessary initialization in x86_cpu_new, Babu Moger, 2020/03/11
- [PATCH v7 05/13] hw/i386: Update structures to save the number of nodes per package, Babu Moger, 2020/03/11
- [PATCH v7 06/13] hw/i386: Rename apicid_from_topo_ids to x86_apicid_from_topo_ids, Babu Moger, 2020/03/11
- [PATCH v7 07/13] hw/386: Add EPYC mode topology decoding functions, Babu Moger, 2020/03/11
- [PATCH v7 08/13] target/i386: Cleanup and use the EPYC mode topology functions, Babu Moger, 2020/03/11
- [PATCH v7 09/13] hw/i386: Introduce apicid functions inside X86MachineState, Babu Moger, 2020/03/11
- [PATCH v7 10/13] i386: Introduce use_epyc_apic_id_encoding in X86CPUDefinition, Babu Moger, 2020/03/11
- [PATCH v7 11/13] hw/i386: Move arch_id decode inside x86_cpus_init, Babu Moger, 2020/03/11
- [PATCH v7 12/13] target/i386: Enable new apic id encoding for EPYC based cpus models, Babu Moger, 2020/03/11
- [PATCH v7 13/13] i386: Fix pkg_id offset for EPYC cpu models, Babu Moger, 2020/03/11
- Re: [PATCH v7 00/13] APIC ID fixes for AMD EPYC CPU model, Babu Moger, 2020/03/12