From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web09.17480.1643539026562442532 for ; Sun, 30 Jan 2022 02:37:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TvSKlg7l; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B42CD61164 for ; Sun, 30 Jan 2022 10:37:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B587C340F6 for ; Sun, 30 Jan 2022 10:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643539024; bh=0NbFp/+XttQPhmFGp6mn57ozlgE+TG+P7qTB3y0OXlA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TvSKlg7lsNn+Bk0Rvpi8k7lqNq+dYy+yGT0v+l+V8wjxDAVz5d5cvVGmx1VILrRMR QOQBv2DYTATUG2Ob7Tu7WwH3NpLQCxOoJfj2SmlmSSsFF3wYMFLh0LdnD+itW7cOpx Uo1y/awGfWO2i9yP+sjFjVtAHVlT1eccczn5gW1KsizmeRfSdm8uDrLPkHRKCF/LuG DhuXndS6rn1z1an/ft/oDPEcBrIYIHzBYNGUgiFyuisGbR0WWhpnSqQCfuuMEFUHCp rtSHYuQCmqWHtUBiafdxf1TFWJGVkasxmAfzVc2+h5jYewYb075I+h43sYNq5b3XOh e3g/lZERji5nw== Received: by mail-wr1-f41.google.com with SMTP id e8so19855820wrc.0 for ; Sun, 30 Jan 2022 02:37:04 -0800 (PST) X-Gm-Message-State: AOAM5320svJ3NdsSLCn89XofvUNIM48pbR7d1NpZ0IC61+6dkNn7VLgh fjjVaG+kjkuuSlMX+aTFSxVH/eaNpYHOjfyRspg= X-Google-Smtp-Source: ABdhPJzDomYJjRAneCotK1GemC6y34Vuhomecg6ikvjWKkqTKLqZdQUzKc3J6lhbAwJTF68uNymwE4XoS5CINlmqctc= X-Received: by 2002:adf:f386:: with SMTP id m6mr13524400wro.447.1643539022794; Sun, 30 Jan 2022 02:37:02 -0800 (PST) MIME-Version: 1.0 References: <20211216220800.9628-1-rebecca@nuviainc.com> <20211216220800.9628-15-rebecca@nuviainc.com> In-Reply-To: From: "Ard Biesheuvel" Date: Sun, 30 Jan 2022 11:36:51 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 14/17] Silicon/Ampere: Update ArmPlatformLib to work with changed ARM_CORE_INFO To: Nhi Pham Cc: Rebecca Cran , edk2-devel-groups-io , Ard Biesheuvel , Samer El-Haj-Mahmoud , Leif Lindholm , Sami Mujawar , Wenyi Xie , Peng Xie , Ling Jia , Yiqi Shu , Vu Nguyen , Thang Nguyen , Chuong Tran , Pete Batard , Masami Hiramatsu , Graeme Gregory , Radoslaw Biernacki , Marcin Wojtas Content-Type: text/plain; charset="UTF-8" On Sun, 19 Dec 2021 at 04:36, Nhi Pham wrote: > > Hi Rebecca, > > Leif is merging the rest of Altra port to the edk2-platforms which has > SRAT ACPI table consuming the CPU Core Info table. Therefore, we will > need to fix the SRAT too. I would defer the fix until the Altra port is > fully merged. > This seems to be stalled so to make progress, I am going to merge this. > On 17/12/2021 05:07, Rebecca Cran wrote: > > The ARM_CORE_INFO struct has been updated so the MPIDR is now a single > > field instead of separate cluster/core fields. Update ArmPlatformLib. > > > > Signed-off-by: Rebecca Cran > > --- > > Silicon/Ampere/AmpereAltraPkg/Library/ArmPlatformLib/ArmPlatformLib.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/ArmPlatformLib/ArmPlatformLib.c b/Silicon/Ampere/AmpereAltraPkg/Library/ArmPlatformLib/ArmPlatformLib.c > > index 5b4be0e55516..f2ec923d6f8d 100644 > > --- a/Silicon/Ampere/AmpereAltraPkg/Library/ArmPlatformLib/ArmPlatformLib.c > > +++ b/Silicon/Ampere/AmpereAltraPkg/Library/ArmPlatformLib/ArmPlatformLib.c > > @@ -108,9 +108,8 @@ PrePeiCoreGetMpCoreInfo ( > > } > > SocketId = SOCKET_ID (Index); > > ClusterId = CLUSTER_ID (Index); > > - mArmPlatformMpCoreInfoTable[mArmPlatformCoreCount].ClusterId = SocketId; > > - mArmPlatformMpCoreInfoTable[mArmPlatformCoreCount].CoreId = > > - (ClusterId << 8) | (Index % PLATFORM_CPU_NUM_CORES_PER_CPM); > > + mArmPlatformMpCoreInfoTable[mArmPlatformCoreCount].Mpidr = GET_MPID ( > > + SocketId, (ClusterId << 8) | (Index % PLATFORM_CPU_NUM_CORES_PER_CPM)); > > For Ampere Altra, the correct MPIDR encoding is SocketId << 32 | > ClusterId << 16 | (Index % PLATFORM_CPU_NUM_CORES_PER_CPM) << 8 > > It would be the same what > Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiMadt.c (not > available yet - being merged in) is describing. > Feel free to follow up with a patch that changes this into the correct representation, but this patch does not make it less correct than it already is; it just stores the socket ID in the cluster ID field in a different way.