From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.86]) by mx.groups.io with SMTP id smtpd.web11.28654.1680190136395631397 for ; Thu, 30 Mar 2023 08:28:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=YvsQhDlG; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.94.86, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oj9hxka5XSEOF55P5GuemvPbtOTB4bB5KBKeV4zMNat7Iv+PTAxJlK1GMiwdCOrip8Rc4yVnNnv9qp1eUAwUmcvkO9g69fwMYPngQaapIEjS3bGYl3z3uESlv0LQ1yQfhpsjWreN9kWXIhoiOZTliJ2GAJwXAT3Qbwva9CzKFCRe9tUDQtjss1vAdi7jJAyI+LF8OPpR4VMPleYNb/M/6kMQ/LAczji4C6vilk3RhaH2xni4vrpmhc5qor2x8yCeWCPS/jWtGBDzgp/RDCEanXgLj3Lhx9geQprnrzNSmFpJihyyKda8AlXXzewjDhyIB+yHGwWGZ25dofd6m1nxwA== 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=nduTTXDb9Ur9meUUmqMy1iL4mMDuv7gQlIDrUKfJos8=; b=N4SyH5nSlwodpkEu5K5IdDntmXIcT460cdJKwnwZL2QiXzZfOwT8uBXMJPISQVxOlAxhrxNa2Nmmn0X2LyirWFbtjqZyDl0frseQXXFIaZaQrHBHXRBq/wuhBHHf8xV99pgLHZG9XZ2qiu0Q3Ntlo4wIHK2Qooh+5qmjazxYIlgpqkQ1ZVhvKbiznHbCvnie3plYGzHrVq80NbfUOdzucl9d0KT3ezDvRZZyN5VigkEMm4LW9bC2p2fEX1Ml1N2pDR6Q3olEvmktAMrZR8t+mK6jdEpLQe+re2jA1+SR0A35aKp81RWw0CUdk1VLKKfik+KHcJlkdIkusKmzXKuVxg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nduTTXDb9Ur9meUUmqMy1iL4mMDuv7gQlIDrUKfJos8=; b=YvsQhDlG+Cnl9RPAxh9v1bhK1Cm0mbiSS6NEW8yrXOctxkJs+38DAYj9QFoGUg9ryKlTC0NR0RlnC0HfGtFr4OlIGfdXdNFHF7ie5HlkKFiZ3X3eNvxTd0dAJaBRLy+VNfNtEmnPvEPDl75gGKoezhP/R/EoRKK2vyh6JAG5sKo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by SJ0PR12MB5488.namprd12.prod.outlook.com (2603:10b6:a03:3ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20; Thu, 30 Mar 2023 15:28:54 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::5b56:bf13:70be:ea60]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::5b56:bf13:70be:ea60%5]) with mapi id 15.20.6254.022; Thu, 30 Mar 2023 15:28:53 +0000 Message-ID: <329f51f1-8f6a-8da3-5f4e-98e41e8bd08e@amd.com> Date: Thu, 30 Mar 2023 10:28:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from CPU max PA To: "Ni, Ray" , 'Gerd Hoffmann' Cc: "devel@edk2.groups.io" References: <174E9488256AAAA5.22739@groups.io> <17509A92F1FF60E5.28404@groups.io> From: "Lendacky, Thomas" In-Reply-To: X-ClientProxiedBy: SA0PR11CA0139.namprd11.prod.outlook.com (2603:10b6:806:131::24) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) Return-Path: Thomas.Lendacky@amd.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|SJ0PR12MB5488:EE_ X-MS-Office365-Filtering-Correlation-Id: 751a667a-42f1-4703-0066-08db3133786f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: An6y/F5uzPyUKaJUXvg7NBYXQvAyX3tx4eqprNvByGvSnv0Yumff213qes90rHmV+FUq1zx6XRJyTqCAKHRM4ly2OJ8oeQuT63tNfkwcovjcHFwKOf6kK24US2zGuyGw8L+LwkNgmt9UFoSj5Ta1/ifGPy92cGwCxdknoBmkCChhDahIEpm3v/BcrraCX4JFRfxgYqy0TOhVNsl1fSd1oT0qKXqKYepNwtI9b35mvkVNsKR4v//XwsiTbLLwDc/usZ3xTBltyjh/EMlr+b74UJV48J37KAf4Af/a/noo972NcxOzdorg3LTRDC11OjgTvsV+TCuMTrCUxuX7/0dolx3ekDErOzyTn0IUH74fPkIZ5hLaA3+QWT9ugUrKqWs2J34dOEXOEDZi4FMbwDC3xVxRMYm1rB34Kmki4GMoaNuz2KVqoUqy7BxvhYX5Sy/Ry9gK8vZJuHjPTgR8oaz67VA6yqSrEIhDFPik7zkebgh/C6OmlpDiIKgyxDLR7mlRZv/D93XKpsERwyQCy7pulp284tX1jYBvEmxbK83LhD47Z9McO9ZnnKnQv25AjF/CcKaAyQCNTzwX0roBn4gNltMoFbqFD9ovvZt5fxSNSzYcdFtYNjCmF09Tv4uWWl78FplkYrxsfvW0Qcl1u8k1Sw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(39860400002)(346002)(366004)(396003)(84040400005)(451199021)(31686004)(2906002)(53546011)(8936002)(86362001)(66899021)(41300700001)(66476007)(8676002)(66946007)(66556008)(4326008)(186003)(36756003)(316002)(110136005)(6512007)(6506007)(6486002)(26005)(83380400001)(5660300002)(31696002)(2616005)(38100700002)(478600001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cnZ2azVyOURoOUV4dmZDQ3ZGbTZkblRQeTJKWUtOcUxFcFpkUGFTdktuQitM?= =?utf-8?B?Tmc5ZFlnN0NlUyt1S0l6SW5Qd1FTaVlNVlBOMEU1R0VOK0QvVUN5OGJlOFB5?= =?utf-8?B?eG9kbFlrbTcxSTBBazl1VTVVeHJkeVNNeXE3cjFvWGh0WDRWNWFyU2lmQmxq?= =?utf-8?B?b1JjbmdQZ0o2bFpDWmdsTnNPZGNmMWNFa2ZrOG5tVUdLZHBFWWh3T1VkUVZK?= =?utf-8?B?ZWQxM01LMVNpQmE0UXV5bnpsWXorK05ObTRlUHJ3WkF2SVJuT3dIeDN4SE5l?= =?utf-8?B?NzJxblRTaDk2SmVMOU1RVk9tamdMaXBwSTZFQjFNemRkODJjWUVRODF6NjZY?= =?utf-8?B?UzVMZEF0NkNQWmZ4NjNwUUZxZE8vdDdBejhqRTllOWJoaS8xUm5zVkoxTG5z?= =?utf-8?B?endKZXlCOFFuT0NNTEE1cXlkSDhPSFBBTTN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XN2ZYbHFpdG1aQU56VnZsanM1c2tMWmRMK1lDeDZKMC9IdzBC?= =?utf-8?B?bytmSHlSVmZSbTBmRUlxWWpUZHhBSHZDR25wd0NNemtuaUE4Vm5qMy9BVnJn?= =?utf-8?B?RVVWS09BK2xNYitaSDlaZG5vcmg2V29HYlFZcWlodVdHaGZrNW1GS2M2V3pO?= =?utf-8?B?OHluN1FxanppZ2xYb3hsaXU0Q1hSRllQYzZkVmJBU2tBK3pFeHIvOWxHVDYw?= =?utf-8?B?RFl6T01JZElMdjg0OGsyQUdkbE5XcXZDQUcrcVFBTVFEcnRyNkZWdmJVTExB?= =?utf-8?B?SGRDc05aTWVLdXAyd3V5OVZxV0N3QlpmOFRySmZjWUNuYTU5K0FwRkRXUHZ1?= =?utf-8?B?SmN4cnVURnZoTlhtVS9vM0ljL2k3V1NoUHpZdU1INmJkTW05UlVqNEZWd05s?= =?utf-8?B?SGdZSWpDUHdZbXMwVlN2cWY4K0FCd2tPVWw2Z2tuZ3E4bTJtYUEwbHBXRklV?= =?utf-8?B?MzU3d1pSbEphZm5oZ2VNVlVjOTFkaXAyZWhaM0lqTzB2a3VrM0I0bHBCV1Ry?= =?utf-8?B?YkF3ZVlvdlBscGlHNGo4NlFxMXp0ZEtxY2k5RkplWFlENE9PMFJTZmJpUW9H?= =?utf-8?B?Q096UElZK01Eb3N3V3VacGpiQ2R5KzBhU1RreHZ4ZDVmVEJROUNHaVM0VFAr?= =?utf-8?B?aDdWTHMyRWNxYUhUdXpVZmdvWjhyVk1lK0RKMmxMSzFKSG1OVGZvVm1RcUhP?= =?utf-8?B?OFVWK1FYYVRNTTlEUjNqUVhucG5RZU9BZ25VbENZRzdPRWVXUmNTNk81YXpn?= =?utf-8?Q?u3bNJO5LDrha9faWtIICq4oWo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 751a667a-42f1-4703-0066-08db3133786f X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2023 15:28:53.8090 (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: pGtj8z2Dus1RWlLNt9Pxpl4uhDJI/x0u/Fc26huILlyeY00Ne1OtR/+M3MLG5KLFOo0DvViK+y+kYcNfMum8EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5488 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/29/23 21:26, Ni, Ray wrote: > Tom, > I would assume this won't break any AMD system because the CPUID bit doesn't declare this feature. Right, shouldn't be an issue on AMD systems. Though it does bring to mind that we should probably do something similar for AMD at some point. With SEV there is a 1-bit physical address reduction (reported via CPUID) in the guest (but it should only be reported in CPUID if the encryption bit is part of the reported max physical address). Thanks, Tom > > Gerd, > This is needed by Intel platform for TME-MK. Can you help to analyze if it has any impact to OVMF? I assume no. > > > Thanks, > Ray > > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Tuesday, March 28, 2023 10:10 PM > To: devel@edk2.groups.io > Cc: 'Gerd Hoffmann' ; Tom Lendacky > Subject: Re: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from CPU max PA > > Gerd, Tom, > Can you please review this patch series? > > thanks, > ray > ________________________________ > From: devel@edk2.groups.io > on behalf of Ni, Ray > > Sent: Wednesday, March 22, 2023 7:56:44 AM > To: devel@edk2.groups.io > > Subject: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from CPU max PA > > > Ray Ni (6): > MdePkg: Add TME-MK related CPUID and MSR definitions > UefiCpuPkg/MtrrTest: Only claim CPUID max leaf as 1 > UefiCpuPkg/MtrrLib: Substract TME-MK KEY_ID_BITS from CPU max PA > UefiCpuPkg/CpuDxe: Refactor to use CPUID definitions > UefiCpuPkg/CpuDxe: Substract TME-MK KEY_ID_BITS from CPU max PA > UefiCpuPkg/MtrrTest: Add test cases for TME-MK enable case > > .../Include/Register/Intel/ArchitecturalMsr.h | 106 ++++++++++++++- > MdePkg/Include/Register/Intel/Cpuid.h | 9 +- > UefiCpuPkg/CpuDxe/CpuDxe.c | 38 ++++-- > UefiCpuPkg/CpuDxe/CpuDxe.h | 3 +- > UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 24 +++- > .../MtrrLib/UnitTest/MtrrLibUnitTest.c | 18 +-- > .../MtrrLib/UnitTest/MtrrLibUnitTest.h | 3 +- > UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c | 126 ++++++++++++++---- > 8 files changed, 278 insertions(+), 49 deletions(-) > > -- > 2.39.1.windows.1 > > > > > > >