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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 5B00DC433ED for ; Thu, 15 Apr 2021 18:11:38 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 18A636105A for ; Thu, 15 Apr 2021 18:11:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18A636105A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+4QdWO3sqbKkysA/ThdDlOGByZHzq3LFJLc6QxsgYzo=; b=Wa6HLFMrX5UXPNnUbOWLgG8mz 4kj+/hjpMKVgJ6tKAIH7DC+0PlCm7zyfugAX/Msw+lAnuwJCnMLfwuUpzvEvs9yV1nofsja8DD6h8 VIU/k+m/+mJUTTke+3ksw4UmiGfetCjrK45oCq5g80mWQZHY+x56vasmDPdxulXDHvdCjAZIJ+sZx RT7+mK47TBHVN3PHNNV6/wdmKd7Ru1s7pvyfMhjhEA0ZupsL3dA88x0+NjiZGERKlgzg3CO1FbWAY SFJJKU/oaxJqpbaDzM7k98nFsQfdG0KJG6LGZhDFcVAyTW20XTsC53/lmQIlDym6VY8Kb2G+NPPc0 5/a5oKWxg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lX6R3-00GwfG-12; Thu, 15 Apr 2021 18:09:49 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lX6Qw-00Gwdp-1L for linux-arm-kernel@desiato.infradead.org; Thu, 15 Apr 2021 18:09:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=70YFyHg+GwyqtmeMWQHXkH0NEKZffV5NgGEDGzeZebM=; b=qFXlAr7CBEvMWrGzUb0+bMZsyt iIoeNnqEkNMl4OQXu5jl+CsgGsQB7OqdaSjVlUcz/wal48Fsur6s+dm+La1AV/34ENX4F8bE3FsHa 4YCZ6dNgJmRojNoUrFQsEdbtVmxbLNtcQyxu3jxPosPEyUteQ4bbkc/GRWkOieH9LESCaCHACp99Q Tfhdf56TOaE61bDETBwV8/7shvWAa1bX5nVB41fAY6ulBc2cVi87bNeiZUqH8ZSzDLTN2Dg09shtN Iwlqp5KswbeTGRs3YW1hdOIWHsDhDFiQEGmDwvWN8U8ZAAbgeuGiGTLDvD7RQ1fUoMDIFD3s7P928 giAx55iw==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lX6Qs-008nhb-Ty for linux-arm-kernel@lists.infradead.org; Thu, 15 Apr 2021 18:09:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3E7F6106F; Thu, 15 Apr 2021 11:09:35 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AA3313FA45; Thu, 15 Apr 2021 11:09:33 -0700 (PDT) From: Valentin Schneider To: Ruifeng Zhang , linux@armlinux.org.uk, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, a.p.zijlstra@chello.nl, dietmar.eggemann@arm.com, mingo@kernel.org, ruifeng.zhang1@unisoc.com, nianfu.bai@unisoc.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/1] arm: topology: parse the topology from the dt In-Reply-To: <20210414122326.5255-1-ruifeng.zhang0110@gmail.com> References: <20210414122326.5255-1-ruifeng.zhang0110@gmail.com> Date: Thu, 15 Apr 2021 19:09:28 +0100 Message-ID: <8735vrmnc7.mognet@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210415_110939_031437_FB0C6C78 X-CRM114-Status: GOOD ( 13.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14/04/21 20:23, Ruifeng Zhang wrote: > From: Ruifeng Zhang > > In Unisoc, the sc9863a SoC which using cortex-a55, it has two software > version, one of them is the kernel running on EL1 using aarch32. > user(EL0) kernel(EL1) > sc9863a_go aarch32 aarch32 > sc9863a aarch64 aarch64 > > When kernel runs on EL1 using aarch32, the topology will parse wrong. > For example, > The MPIDR has been written to the chip register in armv8.2 format. > For example, > core0: 0000000080000000 > core1: 0000000080000100 > core2: 0000000080000200 > ... > > It will parse to: > | | aff2 | packageid | coreid | > |-------+------+-----------+--------| > | Core0 | 0 | 0 | 0 | > | Core1 | 0 | 1 | 0 | > | Core2 | 0 | 2 | 0 | > | ... | | | | > > The wrong topology is that all of the coreid are 0 and unexpected > packageid. > > The reason is the MPIDR format is different between armv7 and armv8.2. > armv7 (A7) mpidr is: > [11:8] [7:2] [1:0] > cluster reserved cpu > The cortex-a7 spec DDI0464F 4.3.5 > https://developer.arm.com/documentation/ddi0464/f/?lang=en > > armv8.2 (A55) mpidr is: > [23:16] [15:8] [7:0] > cluster cpu thread > What I had understood from our conversation was that there *isn't* a format difference (at least for the bottom 32 bits) - arm64/kernel/topopology.c would parse it the same, except that MPIDR parsing has been deprecated for arm64. The problem is that those MPIDR values don't match the actual topology. If they had the MT bit set, i.e. core0: 0000000081000000 core1: 0000000081000100 core2: 0000000081000200 then it would be parsed as: | | package_id | core_id | thread_id | |-------+------------+---------+-----------| | Core0 | 0 | 0 | 0 | | Core1 | 0 | 1 | 0 | | Core2 | 0 | 2 | 0 | which would make more sense (wrt the actual, physical topology). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel