[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190614223158.49575-3-jeremy.linton@arm.com>
Date: Fri, 14 Jun 2019 17:31:58 -0500
From: Jeremy Linton <jeremy.linton@....com>
To: linux-arm-kernel@...ts.infradead.org
Cc: linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
catalin.marinas@....com, will.deacon@....com, rjw@...ysocki.net,
sudeep.holla@....com, lenb@...nel.org,
Jeremy Linton <jeremy.linton@....com>
Subject: [PATCH v2 2/2] arm64: topology: Use PPTT to determine if PE is a thread
ACPI 6.3 adds a thread flag to represent if a CPU/PE is
actually a thread. Given that the MPIDR_MT bit may not
represent this information consistently on homogeneous machines
we should prefer the PPTT flag if its available.
Signed-off-by: Jeremy Linton <jeremy.linton@....com>
---
arch/arm64/kernel/topology.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index 0825c4a856e3..cbbedb53cf06 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -346,11 +346,9 @@ void remove_cpu_topology(unsigned int cpu)
*/
static int __init parse_acpi_topology(void)
{
- bool is_threaded;
+ int is_threaded;
int cpu, topology_id;
- is_threaded = read_cpuid_mpidr() & MPIDR_MT_BITMASK;
-
for_each_possible_cpu(cpu) {
int i, cache_id;
@@ -358,6 +356,10 @@ static int __init parse_acpi_topology(void)
if (topology_id < 0)
return topology_id;
+ is_threaded = acpi_pptt_cpu_is_thread(cpu);
+ if (is_threaded < 0)
+ is_threaded = read_cpuid_mpidr() & MPIDR_MT_BITMASK;
+
if (is_threaded) {
cpu_topology[cpu].thread_id = topology_id;
topology_id = find_acpi_cpu_topology(cpu, 1);
--
2.21.0
Powered by blists - more mailing lists