From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 850AA9419DC for ; Tue, 16 Jan 2024 13:14:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=g3ZCNYWc92UhwpOtCzndxYMGGyiSKybTwxAiS0sJ9Nk=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1705410864; v=1; b=BG9w9VCJaNmyJIjHJsQ3LQC5PX61GJb1CO00PMUa4qnkM0tM6o4kJS+BOotYzXUrd6KFXgSN XPcRwAwZk5BRwmU/P0XATZaT73CJMlINMBzXbeNPymDqp/ZsHK9POwiI+SS/FUYqWPFkSxe8q7Q 7Y82S6VnDGzkvZP/Zl3FJH/o= X-Received: by 127.0.0.2 with SMTP id 7quHYY7687511xDTupvNh8fM; Tue, 16 Jan 2024 05:14:24 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.87]) by mx.groups.io with SMTP id smtpd.web10.13309.1705410863170547664 for ; Tue, 16 Jan 2024 05:14:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qg8aH4wm8ADiYTtlArgKiIb10/b07nB4U3G9oAKDAzQnZUOp4yaOpjtvHSYm5itWWZZSAjU3GojbBIVP5od97hLWGMIFsDMhFQlCq0PuqdOq9W5njqqfifrb/tx1vo7kI9L1orrQdhcPntlRebD6/j0TSmVRhITSlExWxkkYXLUULUGwy8AtTDsbMF0uP40OiwCsr7NzWI78ZUWMHb6RwAXsnoIgLVAD9HklKuSEvrnmEgn9JD9x4/lPmxdCGfAkGPKsQhiaqWxSNcwurmEar4+SHxBKa/nZer20KyewZmX5Jv7dgceHOldwd9JXraacYQv+udfR+gEdPdDyu2kl8A== 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=aHNczDz9FohRDGZlfbrSA68G2BfQGot1pFAiGHvXLTM=; b=ckp2duB9erBhXa+PXzlog7P0Hslmp5kNM5lYIsY2bFTrhYeFpXJtfyPF2VDaesNbuE6BLLa3MsNQ1kIbBtxRwjzjelnnMJjQXGsXCxU9zOx5DNYO5asGyvk3gfLpzIehlSBHjWclCWKb7hfyKB5urNWKob1P4EBMtsedvggVhfYykh9lLMUHWPqWPchG0STa6q5SH9Gj5MuL9byIlKZPGBS4eUFBRXXwQ3mlO9ufVdpediAgH97d/1EuwSaR+E9Ev8Kiso3z4d1O5/Mu7Fuqh7oAKLVU6VxgdkNzCmnQqQ2+ID0Ai/CkUqS+cNSrhhWXP7jh0xXijJuU7gl+9CBaEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from IA1PR12MB6458.namprd12.prod.outlook.com (2603:10b6:208:3aa::22) by DM4PR12MB8498.namprd12.prod.outlook.com (2603:10b6:8:183::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Tue, 16 Jan 2024 13:14:18 +0000 X-Received: from IA1PR12MB6458.namprd12.prod.outlook.com ([fe80::17a8:12cf:5e09:c48d]) by IA1PR12MB6458.namprd12.prod.outlook.com ([fe80::17a8:12cf:5e09:c48d%6]) with mapi id 15.20.7181.029; Tue, 16 Jan 2024 13:14:17 +0000 Message-ID: <8c473d92-86de-43af-8a45-ee145eab2e8b@amd.com> Date: Tue, 16 Jan 2024 18:44:09 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/BaseXApicX2ApicLib: Implements AMD extended cpu topology To: Gerd Hoffmann , Abdul Lateef Attar Cc: devel@edk2.groups.io, Ray Ni , Rahul Kumar References: <030184fe0cac804e7f3c98569ebedaf67c71fc50.1705387772.git.AbdulLateef.Attar@amd.com> From: "Abdul Lateef Attar via groups.io" In-Reply-To: X-ClientProxiedBy: PN3PR01CA0047.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:98::18) To IA1PR12MB6458.namprd12.prod.outlook.com (2603:10b6:208:3aa::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6458:EE_|DM4PR12MB8498:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d780198-54d3-408e-8aeb-08dc16950b44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 6etAOKgm7PUmSPaHFG25uQxcrhyUl+wkhJqohQiteUJ3xylIvSKGSD2aG95ksF7VWHnjd3w7XLn0tRucNK9Li9EaobFJ3NowjiMupAOavR+FO2zGfS8qtif7x3vnSIAgdKuCpJX2t9YkyV09uZc0m2V3YTXz3wPdXxINcOSx1kbwkCnHbJDv2hXSu6+iFbJikUaSpHX5kA8JiHlqM+VyF3/FMDz+iqE9rkLkqiOX6zQdEUwSPQFUk4Q7wN2zPZdN6mgc+eewxsi7vPSRTjcb+QZtMknsEuzJPCU3OsNJV07sGfs7AO3QAqDjQ1wWwXlT1P/kcwQ+S+56jpLZloI9WKb5QaDxDQByFULB/kGHfWDrEt15PyvgXV0nFxoLP4TMb39txKWqapHL+YvRb7MqQ3ij2IoMnB+aOI5Llj9OmEbVrNSJTavkFHGGbsJeyeP1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?B?bEpkS3VSSHlUcXpJUUlIZkNyRElvajhJcnh5ZWUwenhoMXdYZ1JBcGcwSXdq?= =?utf-8?B?T05rRWY1QTZUQm4yYUZoRUZLK1pIQXhsUlNsVmRjWXRCbWRLbndUTW5ORlJ0?= =?utf-8?B?MmsrWlhmRmtzd0hhU3VvRXl5bGFoYktrVjZ4c21VN0liRlBMc29RSVgwaWpO?= =?utf-8?B?TGJoUjY2a0FGUnhDbXA2YlBuZkFGVEF6OTMxdmwxc0ZSMDloMnl0Z002d3NX?= =?utf-8?B?SytxOHF0a3p1dUNmLzRNNEVESlY0ekZvVC9KZk1VR05ZUHJNMHJ2U0V1U2VE?= =?utf-8?B?M3lWTXAyaDEzODd4RnlHRXJnUlN6NFlKaHZ3WlBBYXB0SnpjTDFrY0FkQ2JX?= =?utf-8?B?MnNIcXZXUXV5ejFOUWx0NldFRStqZElQdUxmSUp3YXhOOC8yVkptRXBJaytE?= =?utf-8?B?TFBHNU9yNEVQbUIwY09KZG91WFg1KzREQ1VOeWRwSWkwRjZCVWFJTE5xeFMy?= =?utf-8?B?RlRLUytsa3hrOE1FWG1GN0hsRU9CMENhY29WMmdzUUQ0WU5lQTY1aS9obXRD?= =?utf-8?B?K1kvSEtRdTBKR0hpNmxnQjBacWFkNWNlSmwyWFRKUjRXbE1TZFc1ME03M1Ri?= =?utf-8?Q?UGfsx//Z7k81vQ6hcXwvqabfL?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d780198-54d3-408e-8aeb-08dc16950b44 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6458.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 13:14:17.8459 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /c+BJk1ZR+qwuuPcQPFoCj0ul0l81n+57bdJ/V7kSsG5uzYlu+wDHm5C5pCjOYczAhcNN/gYGe9L1Y4jDYEscg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8498 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: mlFNQxAbmSlUQj1jYRMUNutvx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=BG9w9VCJ; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Thanks Gerd for providing the inputs. I'll enhance the logic accordingly and submit the V2 patch. Thanks AbduL On 16-01-2024 15:11, Gerd Hoffmann wrote: > Caution: This message originated from an External Source. Use proper caut= ion when opening attachments, clicking links, or responding. > > > On Tue, Jan 16, 2024 at 12:31:21PM +0530, Abdul Lateef Attar wrote: >> From: Abdul Lateef Attar >> >> This patch adds support for AMD's new extended topology. >> If processor supports CPUID 80000026 leaf then obtain >> the topology information using new method. >> + /// Check if extended toplogy supported >> + AsmCpuid (CPUID_EXTENDED_FUNCTION, &MaxExtendedCpuIdIndex, NULL, NULL= , NULL); >> + if (MaxExtendedCpuIdIndex < AMD_CPUID_EXTENDED_TOPOLOGY) { >> + GetProcessorLocationByApicId (InitialApicId, Package, Core, Thread)= ; >> + return; >> + } > Sure this is correct? > > On Intel processors checking MaxExtendedCpuIdIndex alone is not enough, > see commit 170d4ce8e90a ("UefiCpuPkg/BaseXApicX2ApicLib: fix > CPUID_V2_EXTENDED_TOPOLOGY detection") > > Especially in virtual machines it can happen that the vCPU supports > extended cpuid leaf N but does not support N-1, so checking > MaxExtendedCpuIdIndex alone looks rather fragile to me. > > take care, > Gerd > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113897): https://edk2.groups.io/g/devel/message/113897 Mute This Topic: https://groups.io/mt/103757657/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-