From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.123]) by mx.groups.io with SMTP id smtpd.web10.6723.1644291838020300609 for ; Mon, 07 Feb 2022 19:43:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=em4P0ej2; spf=pass (domain: os.amperecomputing.com, ip: 40.107.243.123, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mV/8vVEmJj8f3y+rN7q2Kz6/sWnwKVS5dPQ6yoP5wxfZgmQimLWk/az0efRX+SRJLKXWNWwqcwLdukmMLxn5wnvPcmXR/dWpFW4oc1VODbjPI6VWiAHIj5AD5zLk3HidGjtM4nbevYyvVhu8vcDaNfYUNU6iY7DkujTbJaMb2PXESKlQ2PTwUhKZOsvdMWXKoqNnrcnVh2YmVlf+1BsHq+cRCIunna3beMa1yHi0IldapzXyXaEN3nCZaTxmaPkYHoNZ3cGV9X7O7hN0q9g0e4CM7XpsAVDTbg37tx4sivr2vOP/OH43zbbhxGgBTVR70DxaiF3thSo8o69eKOPX7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7LPo3ZlAjvSjP0l4TEPaWcWSqY2ZWD35azpBi/K066A=; b=Dr708OTfuKVacpJHHf2wLjXZiE09+tpN3R+W9jF0f44XJjf5BtbQO9/3EHRP+jSHUYBgglL0eYWx+WFTo+Zxy6f5AaKOLMal/+bTGZ1oURmISiKEPUxskNBx/sZDciLIL2wkEttnUMemsFJBOGnYsa29EZXDAgRhOYTOg3W5/1cbCXD3W7T6FNXPW/ZRpQI+UrerU/wVQ2CGfgVRf9yDiyn53hE0BcA1llvhpyM7n6E+qIJBayby6ZlZCp43MhGdhrkc4weB29xdq7QQ/hfKLnWHfTNPejgf6GZ1JF8GuuP5ku01P3SUYAy9g/umMCUneEno9T18/NUYru1uVUBQQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7LPo3ZlAjvSjP0l4TEPaWcWSqY2ZWD35azpBi/K066A=; b=em4P0ej2FQNHJv/n5we6dPJj8BOd8vEmryX2bf9zkSnZoFo8U0swjBXsPjcTOERWPd07YEAghE2sHRUanz0ro//eg7I0UZxujJeQ7Ii8TIZbS39+S3Mb/oYgUDXDX0mOSINON3ovCudEt8O3Z8sO8mF/CSD73YquL4xiXp5sfpU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by DM5PR01MB2778.prod.exchangelabs.com (2603:10b6:3:fe::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Tue, 8 Feb 2022 03:43:56 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::2c2c:1dc:acb5:e313]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::2c2c:1dc:acb5:e313%6]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 03:43:56 +0000 Message-ID: Date: Tue, 8 Feb 2022 10:41:15 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v2 14/17] Silicon/Ampere: Update ArmPlatformLib to work with changed ARM_CORE_INFO To: Leif Lindholm Cc: Rebecca Cran , Ard Biesheuvel , edk2-devel-groups-io , Ard Biesheuvel , Vu Nguyen , Thang Nguyen , Chuong Tran References: <20211216220800.9628-1-rebecca@nuviainc.com> <20211216220800.9628-15-rebecca@nuviainc.com> From: "Nhi Pham" In-Reply-To: X-ClientProxiedBy: HK2P15301CA0019.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::29) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50c09c64-41ad-4585-b2bd-08d9eab53b6a X-MS-TrafficTypeDiagnostic: DM5PR01MB2778:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TxAJ/lX3NTrdqa69Vm26fOzL9zZBrrE30/QTzf8hw/SjROTCrXeVpbjjX6u68TBUV/zO0UdPdoCpoMPI2W6DX+yhFU5DfvBbk5r+X+T4lZwqv9VpbD32KOs0RwSJ1iu2mL0ivQ5ESbt3LWcL4GbN7XZa+J6XjFMEctSC+92ocsSUxn90Ryzw6MxoA+qMfyteBRpCCPi7ssvZBYutTklQDq7hOgdHw+TeeYbTjOOYDYW0jG5srDeJ+RveDpPnEfqZxbjR3b5EzWxhxBKf7saWX3ITsDnLDe2S16G+LDs0M8cGxh8CQLx3lNncnzARWLE310SpimpC2gu1xA9UFAyxcLOfEl6qU36L2ytZ8x+MqcevFxjNZt72dj2gUq83EcQbG/5ksndndHdrDA5FmWu6TaGdjgn/j7lk7taaYhbgm+1ff+lB3watx4n15cZBtg//3/t6oyO5fnKhkf0cXsRZzIPHhZvlPLp3oDNZkBtQqr1oHZplJo45XKIcDAoQY4R2LEn8M19FYdqqpAHkaXoBU+lMCezTMKL8wlTOnBdOlSThnxFmPkYZX4z3LZZPdvkGojN1FYNBfX997Z7qmzuCHoLSsyJOZGDyCAsdB/+GNl46h34x5Zc7NqqEaaMj7SK+U1uy2Tda+2/LYTMc2/jrX7d6YRAhgTY05ChALUoA+Tkjl1nLKNX1/0GYn9kUenpsaO8y4SHaHHX+UjTz95KNVTDOs6lYFHVn118TWVwBmqM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(38100700002)(38350700002)(66946007)(6506007)(8676002)(8936002)(4326008)(66476007)(15650500001)(5660300002)(31696002)(6512007)(6666004)(66556008)(83380400001)(31686004)(107886003)(6486002)(186003)(2906002)(54906003)(508600001)(6916009)(86362001)(26005)(316002)(52116002)(53546011)(2616005)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YVBxNWp3eFpJK0pGYUVtVGN5UHNPZEV4Nld4U0FmUWJsQm8vVmJNdm9CZ0hH?= =?utf-8?B?VWpmQVVqT3pTVW5ydThxcUNGYTBuZVpWTFROQXdoR245SXJ1WGFJZWdFa0pu?= =?utf-8?B?emt1bkxRVjJpanFtZnJtQjFyejVmTENvajI2ZkZKa3p5a3NzVi9vUDdEQm1x?= =?utf-8?B?R3hYRDMvUUlWaVBiMHNlYW5DRVp5d1VDMHE1eTFyaS9aSExMZzdQNUNtVFE0?= =?utf-8?B?eVhVNXBVTTNMTjU4Qk9LSTJFWS9aNGhuNm9teVdaY3A1SStCZUFWZ1BTVENL?= =?utf-8?B?NFZsRHhma2ROWWRycXBEZHFKQnlldlRGOWtRaytuS0FRWG45QTlpaU9SNzJI?= =?utf-8?B?MytBSnpyd0U3Yk9OL2dzUmFoNkVvN3VjMlV0QWp1WStvQ3Zla2lZbE0yYlpi?= =?utf-8?B?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XduRjJtcnk1?= =?utf-8?B?NFNJU2lKekt5OVZUVTZZcXV3czBBPT0=?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50c09c64-41ad-4585-b2bd-08d9eab53b6a X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 03:43:56.0369 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yjy/6u94EcFlXftMHnekCdjSVfAG/miwuHiuF07UxlmvLoAfEpKnlT/JPd+pmgn/EVX3aySEyYHD+bvFCsT6ABo1LNWUpubKt20mj8hBrsk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR01MB2778 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 31/01/2022 19:08, Leif Lindholm wrote: > On Sun, Jan 30, 2022 at 11:36:51 +0100, Ard Biesheuvel wrote: >> 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. > Thanks, that was the right call. > > Apologies for radio silence, catching up on backlog (including > remainder of Altra port) now. Thanks much, Leif. -Nhi > > / > Leif > >>> 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.