From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6BA8C04AB5 for ; Thu, 6 Jun 2019 08:49:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF52F20684 for ; Thu, 6 Jun 2019 08:49:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbfFFItr (ORCPT ); Thu, 6 Jun 2019 04:49:47 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:43132 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725267AbfFFItq (ORCPT ); Thu, 6 Jun 2019 04:49:46 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 86D3DEE6FCD080AE8278; Thu, 6 Jun 2019 16:49:44 +0800 (CST) Received: from [127.0.0.1] (10.202.227.238) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Thu, 6 Jun 2019 16:49:37 +0800 Subject: Re: [PATCH 2/2] arm64: topology: Use PPTT to determine if PE is a thread To: Jeremy Linton , References: <20190523224015.56270-1-jeremy.linton@arm.com> <20190523224015.56270-3-jeremy.linton@arm.com> CC: , , , , , , Linuxarm , "Guohanjun (Hanjun Guo)" , wanghuiqiang , From: John Garry Message-ID: Date: Thu, 6 Jun 2019 09:49:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20190523224015.56270-3-jeremy.linton@arm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.238] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On 23/05/2019 23:40, Jeremy Linton wrote: > 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. > Hi Jeremy, I was just wondering if we should look to get this support backported (when merged)? I worry about the case of a system with the CPU having MT bit in the MPIDR (while not actually threaded), i.e. the system for which these PPTT flags were added (as I understand). > Signed-off-by: Jeremy Linton > --- > 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; For described above scenario, this seems wrong. > topology_id = find_acpi_cpu_topology(cpu, 1); > BTW, we did test an old kernel with 6.3 PPTT bios for this on D06 (some versions have MT bit set), and it looked ok. But I am still a bit skeptical. Thanks, John