[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: |
Igor Mammedov |
Subject: |
Re: [PATCH v7 07/13] hw/386: Add EPYC mode topology decoding functions |
Date: |
Thu, 12 Mar 2020 13:39:16 +0100 |
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.
[...]
>
> 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://bugzilla.kernel.org/show_bug.cgi?id=206537
>
> 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
- Re: [PATCH v7 07/13] hw/386: Add EPYC mode topology decoding functions,
Igor Mammedov <=
- [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