From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.134]) by mx.groups.io with SMTP id smtpd.web10.192544.1673949241746345351 for ; Tue, 17 Jan 2023 01:54:02 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="no key for verify" header.i=@amperemail.onmicrosoft.com header.s=selector1-amperemail-onmicrosoft-com header.b=VnId9tKe; spf=pass (domain: os.amperecomputing.com, ip: 40.107.244.134, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W+87X/3bWxBUiw1+J+FKZb8LOCpRXPGxjgIz9M5CwqZmhfzw2OgkLZDEu5MhqAOQ5HtiXLhosb71Oxf6qZnyG7y7SGA2mfyndWZhfAxzzOSnlEdNsPcaxsC3dvDqi0ACXf8G+conHnQ2+j7B81hpzQahPJh0YmwgPGIeZzjW34dag+q/DJb3YAUloV04EJpmdTa3c9dbQ12E7+Ig6fSdaoh7pAOf28CGh762MBmW8wYJFNBw6voLsM5dcVtBhdv0I9ArC6s4i1ZyVolTV25Eq5xgloayitCL2JMUL0xg7rl6Tw2VJ5BU5xNw8Ce0JTuW7LvHF9gv5uXxZRJRM745TQ== 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=0uH4ClbS6QcaGO3hAsgXMDw7tuZj2GCsBefyYpzl1YI=; b=jePYeRMYbVCUlIfg6cZyKiuNSVF5vL2JQpf/Y4q1QMRUsi15Wj9uwKGqjlaMBKz6P7/vI1dPd5uqCtvDp6PyoyEgK8CFWC0ONARBHJmIANhX3bfoQrnA1If1fQ+FV5VxYwJVAIYhlRW9IFMbOUavCJRZhWeOcaPws25ANCFDsjOgOur6eBGNJ+BhH8/ZyiPgODvcS9sdMCPNlkurJGFHmcECtsJiv4yq7wLOPENUSDszCGhHPRJFEmh6eqQgkjBRGOoUlWGi0bBUTnxnFKiVZUlVJFLszwv1dTXstAHmfvR6184jZfEv1bx6RZPA+4AituG7wMVClDQl2XXyhtGYhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=amperemail.onmicrosoft.com; dkim=pass header.d=amperemail.onmicrosoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-amperemail-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0uH4ClbS6QcaGO3hAsgXMDw7tuZj2GCsBefyYpzl1YI=; b=VnId9tKe2NkbVWU1ChE55XusRdy6LdU1kLUDOljgwtOyBk00tlH31U7H24d2FVuLm5rYu2inKB57hmSVsYkMArQLvTdsCsWQi0hLroluVHJrMzKB1Ky2e/SdylVncIlU04Rx4u3kzK1Biee2nLounYtrZ4tuCCG6K2hsLYCNPdw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amperemail.onmicrosoft.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by SN6PR0102MB3549.prod.exchangelabs.com (2603:10b6:805:7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 09:53:58 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::d70e:926e:41bb:a73a]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::d70e:926e:41bb:a73a%5]) with mapi id 15.20.6002.013; Tue, 17 Jan 2023 09:53:58 +0000 Message-ID: Date: Tue, 17 Jan 2023 16:53:49 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] AmpereAltraPkg: Update ArmPlatformLib to work with changed ARM_CORE_INFO To: Rebecca Cran , devel@edk2.groups.io, nhi@os.amperecomputing.com CC: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, Tinh Nguyen References: <20230113042126.3107135-1-nhi@os.amperecomputing.com> <7d401f29-56d9-d754-88a6-684ce329a727@quicinc.com> From: "Nhi Pham" In-Reply-To: <7d401f29-56d9-d754-88a6-684ce329a727@quicinc.com> X-ClientProxiedBy: SGXP274CA0019.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::31) 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-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|SN6PR0102MB3549:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ee433ac-f91a-47c1-3b40-08daf870c0ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: znlN3uqv/NvXJqAmYv92ai9oO2hVUZcl1s7mC4ZVQz0HEuVa/uYEg3oZ48eLEhwd4FNbYAAUCaCFnUugsvJOEOkJsTtonIvM6mYuzoy28uFCfVSSo2CV+t2pvCM9vVU4GFgozUoxrtH92qZPqyG6j+plgNhvDHsxblmgq0dMCh0PGy6KOrrOZEIj6pvs2XR74UI0edf1yA/NVAh/m4TmURoeV6BrznMoAuYKwfc4GjDQOjRW3MBPGMktVN4hoOHcoU6wNddufMFOQi21s9vYj3KJlrJZWitgqejaOt6AwCaoLM93Ru2n+shjpgaOumFJ7n7cS3uQbwMiZa6pwbxb/UJsZ5nSIo5C6OtUZHnHE/UkULNew6rCbsA0lfwkmlLHAwY5VXhZOppvPutUvbwcZBY+SSPuHtAlA+MnDGyL/zfRB6V5tZbDAwKJIseZp+OT8qXUZQ+fjE86hdTjPz+ckmbpNee6gvBY4wCAlD4xtwornKRZ45YMLZTqiVl1FST6z/SAY8g0MIIrw+/XybkFSodnZcZLiy4k01RcFeeyF4xUNQkqClFEoi9nlUJytbsWrkkVBEvb2PVITZZvqhYgKxkz0jyxQi/14MqhND4W/JRpdqH7dMScCHBa916qlxgbbO4d8EPU50qMAsW7abCuWjCavg3rMbvJiU0+Cy+H5oFnd2JihWrSAscMtGF5M7AUEEY6Kkgrt2pYOG7yXfc5Sw== 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:(13230022)(4636009)(376002)(396003)(39840400004)(346002)(366004)(136003)(451199015)(31686004)(66899015)(66946007)(66556008)(8936002)(8676002)(66476007)(4744005)(2906002)(4326008)(31696002)(38100700002)(83170400001)(5660300002)(42882007)(316002)(6666004)(6486002)(41300700001)(478600001)(2616005)(6512007)(107886003)(186003)(53546011)(26005)(6506007)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bFsFLqvKNb0H1wK7PKsak28WSAZamUaB8DNe7TQ7HD/gcKjAfWdph38JF+1u?= =?us-ascii?Q?16rnSdh8Bwfu9gT9N0oFABR3XZWki2A/iZvNrx3SMToA/aW7mLj9WpBkmzcA?= =?us-ascii?Q?iIvZr3IiYcPTTJRdg8QFN/gp6r024GYhcl6XuGi/A9KskK6EcygFEoTjZYzJ?= =?us-ascii?Q?dLB3AfHdth4/In5/6zAXpIkqFBXyB9F8mQQcrs8MZCb81w5TrpaCLEwQcjhn?= =?us-ascii?Q?QOcZ//ukHny5LQrgigzumzbM1n188SRevfKOZ2R6RJNrqgkP5D6jA427/C17?= =?us-ascii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c7fewcPbiy2Jtscu0IBl0mDNp6L?= =?us-ascii?Q?TXjgyxan1nnwYzvlkSAZmY7IQYZqzz6YCQ7n/hDryeYAFFZy79Z1xAxl4byK?= =?us-ascii?Q?YE1v2FaI0HCHrL+t0raChkCe2zlS1mb71SnCmmdvSvd07tDnpqMCKtUehq8C?= =?us-ascii?Q?iUg/jbS77W1Gun1PvdWSZjGgs9IX/BMBprxLnm0mgPZQh/HfSXgWSfVoX7hX?= =?us-ascii?Q?74oglI6SM2HnWf2QGevaChtHsXV2I7kAuYU0zUg0+7daEHnfuPLkeqqNsc6H?= =?us-ascii?Q?8oXg0qb57iTEUMDaHLTdpOrnD6Gdo5uwl/zYneYj/V7teV28o+LMmEwzLjG/?= =?us-ascii?Q?LU7qsw+WLEPHEgtJ/+L3gnLf4FidHJXWpEgRB85TJndh9pfVz/70qJt/5bp7?= =?us-ascii?Q?0PgGSfbFrdCJXMGjp/ErVjtG8DJszmPtfJxw6cXkXyqZvmg2Ak92Y6X4rD6G?= =?us-ascii?Q?IXv9uNipRyiArJxJxU9L+U4=3D?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ee433ac-f91a-47c1-3b40-08daf870c0ac X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 09:53:58.2959 (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: 1Vs6Nmooa3bHM8j/9lknuX/L8kL5+HYMaVB1qqZMu6zsGMZFAZKN4iFqQ7RERX6LgLszpqr/GaSbrx2VYdMX8w7v+XpTcDzc2rcNCXUGazo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR0102MB3549 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Rebecca, That's Ampere Altra Family specific MPIDR encoding. So, we could not=20 leverage the definitions in the ArmPkg/Include/Library/ArmLib.h. -Nhi On 1/13/2023 9:40 PM, Rebecca Cran wrote: > On 1/12/23 21:21, Nhi Pham via groups.io wrote: > >> +// >> +// MPIDR manipulation >> +// >> +#define AC01_GET_MPIDR(SocketId, ClusterId, CoreId) \ >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (((SocketId) << = 32) | ((ClusterId) << 16) | ((CoreId) << 8)) >> +#define AC01_GET_SOCKET_ID(Mpidr)=C2=A0 (((Mpidr) & ARM_CORE_AFF3) >> 3= 2) >> +#define AC01_GET_CLUSTER_ID(Mpidr) (((Mpidr) & ARM_CORE_AFF2) >> 16) >> +#define AC01_GET_CORE_ID(Mpidr)=C2=A0=C2=A0=C2=A0 (((Mpidr) & ARM_CORE_= AFF1) >> 8) >> + > > Ideally, this should go in ArmPkg/Include/Library/ArmLib.h, but I'm=20 > not sure how we should handle the older format where the the core was=20 > in the first 8 bits. >