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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH autolearn=unavailable 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 7B6CEC282DD for ; Mon, 10 Jun 2019 08:31:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FFEB206E0 for ; Mon, 10 Jun 2019 08:31:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dubE2DA8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FFEB206E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FMEh7Y0/PnCfIx30LuXbRh3PJs4ov+or/zyhxbo+Enw=; b=dubE2DA8MCmBBA8mKJxugNV09 tgBNJKD8B7Diii5QxdFrUVOXyZ860W0gzKp+wWN+5Db0jc634EkpNIHI4E8drhTJ5jwusAXaQp7JV 24XJwBYcyAhlaRY2JlCPnBm8VemJddLE8Agp3wJTYMQa1Ivgu1EPgFeGO6VANgH4unlZ4fC+OHsgg g/+BedP/q0YTNoX4Chfum4ONUg1oyNFOEzEx88Kr9s31r+71vwk1RCtjaVBxCp09KxvudPitMdcio 6YiRsFh94QRv6i9Zml4NJJvGO/WkLiDOIS4Px7sb3ssygfDLpaLmSKALPo9q1ZCLC8gaoDhxbQD6o wp2HmBT/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haFi1-0007Cq-Od; Mon, 10 Jun 2019 08:31:17 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haFhx-0007Bl-If for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2019 08:31:15 +0000 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C42DAD8FAD9F6E5E5A51; Mon, 10 Jun 2019 16:31:04 +0800 (CST) Received: from [127.0.0.1] (10.202.227.238) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Mon, 10 Jun 2019 16:30:56 +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> <24541261-f86d-0d19-6275-6e110144e761@arm.com> From: John Garry Message-ID: <4c8db8fa-de8e-d9b8-2de3-eda13651f223@huawei.com> Date: Mon, 10 Jun 2019 09:30:49 +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: <24541261-f86d-0d19-6275-6e110144e761@arm.com> X-Originating-IP: [10.202.227.238] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_013113_841332_2C24D640 X-CRM114-Status: GOOD ( 23.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, will.deacon@arm.com, "Guohanjun \(Hanjun Guo\)" , rjw@rjwysocki.net, Linuxarm , linux-acpi@vger.kernel.org, yaohongbo@huawei.com, sudeep.holla@arm.com, wanghuiqiang , lenb@kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07/06/2019 20:21, Jeremy Linton wrote: > Hi, > > Thanks for testing and looking at this. > > On 6/6/19 3:49 AM, John Garry wrote: >> 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 imagine that will happen.. > >> >> 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). > > I have tested this patch on DAWN which happens to have the MT bit set, > but isn't threaded, and it appears to work. Can you describe your test? > >> >>> 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. > > I'm not sure I understand the concern. Maybe I wasn't clear enough previously. I am saying that without this patch, then this info would not be correct. Hence the request to backport to stable. cheers, > > This is going to ignore the MPIDR_MT bit on any machine with a PPTT > revision > 1. Are you worried about the topology_id assignment? > > >> >>> 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 >> >> > > > Thanks, > > . > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel