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 59212AC14FE for ; Wed, 17 Jan 2024 21:26:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3JReNFs9w3y5bjyXDGFQ5Aa34dZ8oUuB98mJfpYdpRk=; 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=1705526769; v=1; b=hU35EdB5VTzBJxN2f7Zx+s9IQ6PalR7xroEc1JvCmQqbJ14i1HszImInn8Th6e3jGyJilYTN /5lZuAHrdESMp+xxwofLghIhoYl9ft3CrqX8ttVjCkwR7KKszDJtGL4lqeQ3IY/K0jTp+l/uVcl /51WKCE92qubwtlVTkf9m2tY= X-Received: by 127.0.0.2 with SMTP id A3i1YY7687511xl9OeyN9gFA; Wed, 17 Jan 2024 13:26:09 -0800 X-Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.45]) by mx.groups.io with SMTP id smtpd.web11.376.1705526768094377914 for ; Wed, 17 Jan 2024 13:26:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K9jet/h3JzERt2zrHIhIhUZyxXaKwEaeP/Urp8ntHBFHSFOmSesSFQZVKeYjOS+j/XtRhV2JFY9JgZsbyTnRTM0YcL8p/WjWSKdB0wm+gW/Mm72VL3auhmO/U42rDfXKYRIIw5SFVgOk8oK/j24wHA+1MNADcPqtGKIzv7mK6R0QbgwQM3MzMlExDVc1QZ37n5YD5XgGJKJJVEdn+T2r0OC6mB1in9fZjmdjHgNb6IqH3tEfE81UgThTPOE69Y5Y4R+PD/9wkhVOcmoopoBoBmkLxbO/9hBODeJjRm7UHm1ohTk0Y/sGmVmUAL9x4rfRF89+AeiUUa804UcqrU2q4g== 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=0RGxjjtpf4Msmfiz6Iq9pWggRTnnzXETJ4VLfkBd+a8=; b=gJN9sI3+M/yibgdhXm6f5nRQHw6UN/kKjaL4nK9Ki9DRihPh7pLKkmQtY0wbW1i0xUVa2Hs+qLla3eMQ4tN38ImGYMggXkDFshOU7nrOA2uSqoo8JJql0hxxC1gxneapzTyd33GVREiiSq3vjCyqm5igLPtZygz9mTTINf3AQGmhdeKm6+ECwTI1oXqaFR9xKsSfl8gaW0tQmzTBri8vpoR//V09h9bhPcGFlEL3DQ7D4tSr7+ZTdoI4/OSuXTPGdXpDq5ONVnxU3TljFUGxsEaGK0ZRmrc/TmJZlBucXFQB8mvdQ3HJajwZbUG+MIBPSnVY6XaKQ+86TdpuPVkTrw== 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 BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) by IA0PR12MB7774.namprd12.prod.outlook.com (2603:10b6:208:430::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Wed, 17 Jan 2024 21:26:05 +0000 X-Received: from BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::200:c1d0:b9aa:e16c]) by BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::200:c1d0:b9aa:e16c%4]) with mapi id 15.20.7202.020; Wed, 17 Jan 2024 21:26:05 +0000 Message-ID: Date: Wed, 17 Jan 2024 15:26:02 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [edk2-devel] [PATCH 1/2] UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY leaf To: devel@edk2.groups.io, "Kinney, Michael D" , "Gao, Liming" , "Liu, Zhiguang" , Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Ard Biesheuvel Cc: Michael Roth References: <17952A20A9E21541.12603@groups.io> <26becea4-2ad8-4773-ab3d-5ad98ff48759@amd.com> <179BD02AA4207037.22216@groups.io> From: "Lendacky, Thomas via groups.io" In-Reply-To: <179BD02AA4207037.22216@groups.io> X-ClientProxiedBy: DM6PR02CA0139.namprd02.prod.outlook.com (2603:10b6:5:332::6) To BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5732:EE_|IA0PR12MB7774:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ec69cbb-4bff-4917-6018-08dc17a2e9cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: w/nZqYfoqEcg8N4vnnaNd1tj392/AsEtERjD2hBjY9BT5ZFqTwr2hd3KCXM1T+r4bXbbtIfGUllfED5dTZARJlXYoADub+FRJU/ZWqBZc/fjcFcSTE9aDWyrd/TXZGnmkfYrjmz9e9jLyBw8McPuSHiX6D92BAVr4UuY5/8gGdDL9J5A6derBy1L0fpdPNOfgGXCEm9ObysDrSatnObDQ1P53SzJ5sMcbTCqxrly8Gaon4M2YQmUb6yJt4D93TV+HsKeUOTm3/cMe30CSeZXGx6/08ifkYAQHiki72WDLhKuWXKUGA9gdsww07D+4+qFTvjtXtic8IQ3QFzezl2Vo/6g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NjlPYUgwZjh6bDllZWRzVUpwenpLbFcvdVp0Ympwd2xqUmVuYlRlMDRR?= =?utf-8?B?cXJINFBCd3B5TVpJWG5RMTMwcHU0VWlhZXpDN0pnK0JVSFpEQlhYQThSSklJ?= =?utf-8?B?d1NhVUkwb2xJU0plN0Z6aXQ3TDFTVlhVYW5uMU12K2YyTEpsYlRwbXBhSWpz?= =?utf-8?B?YUNzaTJvSVY1cHhjRVFtQW1nVTRNYmtubGQxSnBnZzhtSnp4L1ZQYmlIU2xp?= =?utf-8?B?MUpna0NWdCtVN0xDZHl5bmhocjdXU1E1OHhpZlVVb09PT29RdjlLV3JMdUdF?= =?utf-8?B?ZmpFMDJBQWRnQnhkMkdjbmpWRlJxbXEyRFgyU25FQVNHSElMdkdzQzdmZ21l?= =?utf-8?B?OW1USmxGQldUWHE4U0k1bDVzSmMvWnRSczFFZSsrSk1PS0wwejl0bVYwaEdL?= =?utf-8?B?OHZuT0lObmVyYUxJbXJKd2NjSy9aSUxWMjF4bzRjK2thak90NlZ3bTVQQ1NX?= =?utf-8?B?K3JCbS9YMFlFbmVWdE1PNThyWjZIQ0RBUGtjM2cyME9idGxZVmptSTdaNGc4?= =?utf-8?B?QjRpTWJsT1dtMHJ0OU9uTW1oQ0VabWUzbzJpVVUyUUMxNjd1YWpjMko4WUlx?= =?utf-8?B?TmovWFZBaHRVZjc2c3hRTHc2dUlPcGRTZ09sUDFSQndCMm56emtrMG5oL1B1?= =?utf-8?Q?tMCDCznen8gPl3bpJatDYa3au?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ec69cbb-4bff-4917-6018-08dc17a2e9cf X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5732.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2024 21:26:05.5741 (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: Y/fd11TKW4uzxeo4M4bYxvYG4mtsYYoQnT3EQI5ttBYKFW3sX8856u2DqNxJRrmsNNuDTqy1Q8y1H5LlbX0gZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7774 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,thomas.lendacky@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: PJ2sYYTGUogdkkZm0gQT05d6x7686176AA= 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=hU35EdB5; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 On 11/28/23 08:35, Lendacky, Thomas via groups.io wrote: > On 11/6/23 17:15, Tom Lendacky wrote: >> On 11/6/23 16:45, Lendacky, Thomas via groups.io wrote: >>> The CPUID_EXTENDED_TOPOLOGY CPUID leaf takes a subleaf as input when >>> returning CPUID information. However, the AsmCpuid() function does not >>> zero out ECX before the CPUID instruction, so the input leaf is used as >>> the sub-leaf for the CPUID request and returns erroneous/invalid CPUID >>> data, since the intent of the request was to get data related to sub-le= af >>> 0. Instead, use AsmCpuidEx() for the CPUID_EXTENDED_TOPOLOGY leaf. >> >> Alternatively, the AsmCpuid() function could be changed to XOR ECX=20 >> before invoking the CPUID instruction. This would ensure that the 0=20 >> sub-leaf is returned for any CPUID leaves that support sub-leaves.=20 >> Thoughts? >> >> Adding some additional maintainers for their thoughts, too. >=20 > Any thoughts on this approach (as a separate, unrelated patch) to=20 > eliminate future issues that could pop up? >=20 > Seems like zeroing out ECX before calling CPUID would be an appropriate= =20 > thing to do, but I'm not sure if that will have any impact on the existin= g=20 > code base... it shouldn't, but you never know. Just a re-ping for thoughts on this. Thanks, Tom >=20 > Thanks, > Tom >=20 >> >> Thanks, >> Tom -=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 (#113959): https://edk2.groups.io/g/devel/message/113959 Mute This Topic: https://groups.io/mt/102432782/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-