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.84]) by mx.groups.io with SMTP id smtpd.web09.17893.1661174326200215866 for ; Mon, 22 Aug 2022 06:18:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=JrC2OWql; 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.243.84, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nm4wu5E1TBScyf7THk9cOo8M8/k/AaEC5tJNsewEt05lSMfUaGNUL3Bow9GtKRjB2wxibg5ZK0UBDm0IDQMas6kmuLXRUT+t+agDQuIguxYqIUTMVrkcWO8PtUbyNYNSkny9m+xi3F9ITygNuFOEcWPpdnqCHOvO5r8e4HyBxs8D2wngn+yzlxf5fN/L8RIgW3GkUabyFDtdGq9SpzwDO8pXSOakslV5SYCU8nlznEt1Fb996MWZoJyWThIdosINvlAlZHZEyzL8JvFP7neoZ1czX91gHrSF5JlMh95omplCglEhds5aPBqOWIQyi4Mpie3O0gDy85t1VACkd01YGg== 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=Xo6fDv0B5j6LehTKCLzQIOKxFSrAqFKDkppb6XVuCk4=; b=DuamDzkpVqYxfV081vN89DChvo/627zoVWLIv+iY4tXkAlaTcfDDwy8nMKRuVnpfnl/E5C9tSGt0AUlVBKVNT6/3MTE4DV0mlnEvGEy0y6Qwlnj1mIRbDdG6EtbMbhhbMZ2DLf2wkrl8kpHMwD0F6TmtZ23stVY4CFYm9jYUTSA6/YuC3DiLdLz8OeWNz0ANLVxk1OB/3vy8eWfruCHVsGOtcL+0VZT8a7QoC5RUuNRj6q9neoAG0WefkKPaCxY1C+V6m9tKBnIZhRz5GcUa081DAOt867i/vHqfJXCxp13vUwxh/Ow4Wv5aFODrO3WGHEB0YNipSsPxwedzYs5lrg== 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=Xo6fDv0B5j6LehTKCLzQIOKxFSrAqFKDkppb6XVuCk4=; b=JrC2OWqlhJVn+k5sotuEWN34gLpQeMe3UqMHoWAAXf22Q9BXadNgrZ3Pxsv86PwER85/30Gzie+jZMHWx3GpiXbZrvVuKWW8Pvd5oFUvoLDhePLE08IDQUFNGzv3jahg5HMWN3R9nViH0HltnUKRgIVYU4z+0aXfBuTPL64b/w4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5221.namprd12.prod.outlook.com (2603:10b6:208:30b::9) by CY4PR1201MB0119.namprd12.prod.outlook.com (2603:10b6:910:1e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Mon, 22 Aug 2022 13:18:44 +0000 Received: from BL1PR12MB5221.namprd12.prod.outlook.com ([fe80::219f:8080:9607:b847]) by BL1PR12MB5221.namprd12.prod.outlook.com ([fe80::219f:8080:9607:b847%6]) with mapi id 15.20.5546.023; Mon, 22 Aug 2022 13:18:44 +0000 Message-ID: <982ab701-e912-db72-51e8-090c3ba5b63d@amd.com> Date: Mon, 22 Aug 2022 08:18:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/1] OvmfPkg: Reserve the Ovmf work area as RT_DATA To: Min Xu , devel@edk2.groups.io Cc: Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann References: <20220822022301.1454-1-min.m.xu@intel.com> From: "Lendacky, Thomas" In-Reply-To: <20220822022301.1454-1-min.m.xu@intel.com> X-ClientProxiedBy: BL0PR02CA0106.namprd02.prod.outlook.com (2603:10b6:208:51::47) To BL1PR12MB5221.namprd12.prod.outlook.com (2603:10b6:208:30b::9) Return-Path: Thomas.Lendacky@amd.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4a2c532-0995-4b99-aa5e-08da8440d68b X-MS-TrafficTypeDiagnostic: CY4PR1201MB0119:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bBz8qRO7xMOgnv3cdKSv/ATKihrkZx15HrekfFkwM0Ryxt3NuTd8bu6zn80Amz2axcrHmrBe7SA2nHrJjJzqD8GRGQORbb6lTYe/H8peYT0yY4oYdwYA7lIjLgw33jpKw8eW6nxOYqOthssRXf5DPEGxxGImk+5julCJe3qYxVNfB+mecpCM/PCfUXe8XgoJplvmTEVCTDaFVBwibIDgORDZ6PhdLmDFO4c6R4fUlI1PG7tg1RY9ti2LRHaZIs9b0x3UY2ftuIJYKlhxTK3qROlK/g2DIIPGGosyt1KWZFf7vy0KdOyQ1+q8EozUhfhmRs44qAqCAABUJZTuN6wgXrxnJtJSYGDfxRLfGTra3EKxihYeFRT9LrUHh8/I5fcPMcXHI76NAnALiYbgvKwHJVjr45Ux3P6Jtq97vyQErmUvG/1mIbQJ1euQ1LjMOmrfMiB3l+pQyx3+hkF+jHikBFDJXVBeHTFThO8r7nzHKd/qZAZgoNCda5Szl5/Q4uTKJuZTNLsIyP+Foe4E10HgmcvFFgogmBClRHE1g42Ykp4cQvh8HorY/UM+1yzR36wrMHWIH82PHQR760d1/cSt0KELlpVd2en7cnwHYlLFQZTWJQZytffoEMnuJ2UtntRuH1/ZDhcGNL+mCXyCpawQ5YkCnIfMBdfllV8idDJlL7EYWqp7e/AmhDs6/s3zZs63IWx37oWq8yq+F7jxAt83udlzbkb4XiDSfwgY7azbRYK2fuhfBDgOruZl7JnOcvv+ZB5NuHhYJ0xEGsDwpFtbirLuFeMjhm5QHjg0v48FiOHEkzus213RTQE1pHv5Zt598NrbMyjfXW1qAhIvtcuKiA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5221.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(83380400001)(38100700002)(36756003)(66556008)(66476007)(4326008)(8676002)(66946007)(8936002)(26005)(5660300002)(6506007)(19627235002)(6512007)(31686004)(478600001)(966005)(6486002)(316002)(41300700001)(54906003)(53546011)(31696002)(86362001)(2906002)(186003)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YittUitmWmg5ZkFRcFZ4eDVHZUd2bzR5ZnNkajB3QzRQVVlWRWxVcHVNUy9X?= =?utf-8?B?YUZYcktzaHM2Sm5lQ1dyMG5BY2lteXAzTGZ4Ui85azhUOTBTWUV3Wkl0TFJB?= =?utf-8?B?ZjZ2TGdnOUx3VW9kWTREYjlLNTJ6R01LUHhaREFKelV2d2JTY0FGYXpZRU52?= =?utf-8?B?MkhXeStHNDZkV3lsNyt0VW5xdmRhVFhMQmV1ellVaWxxYjQvVGllSWFFRlc4?= =?utf-8?B?bWFQeDVvMm9YcEh5NkhUbzZPeENkVmdxb2F3c0N0cGFYT2F1S3FQYzBaVTFt?= =?utf-8?B?QndzalRBN3greWtxVGM5RjU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56Vyt3MGVlSmFj?= =?utf-8?Q?nJbMHZ2Aw3OBPGpAaVf3SQme2?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4a2c532-0995-4b99-aa5e-08da8440d68b X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5221.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2022 13:18:44.0784 (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: NydhvqOXRCD9Psv6EoyZVUpG3fnTX8ZsbRkDATCWYY1Lf4U608nZD0oVudpCC1ErX8GxDVqnmQAP7dg9N3/JmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0119 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/21/22 21:23, Min Xu wrote: > From: Min M Xu > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3974 > > Ovmf work-area (PcdOvmfWorkArea) was designed to store the Confidential > Computing guest information, including the CC guest type. This > information will be probed by CcProbeLib so that the CC guest type can > be determined in run-time. But the Ovmf work-area was reserved as > BT_Data so that it cannot be accessed after ExitBootService. Please see > the detailed analysis in BZ#3974. > > RH also reports a similar bug. Please see: > https://bugzilla.redhat.com/show_bug.cgi?id=2114858 > > This patch reserves the work-area as RT_Data to fix this bug. The work area was never meant to be kept around. When first introduced, Laszlo had said it could be used early, but that global structures should be represented by PCDs. So the code is correct. It seems that the CcProbeLib should be setting some PCDs during the start of DXE or similar for use during run time services. Thanks, Tom > > Cc: Erdem Aktas > Cc: James Bottomley > Cc: Jiewen Yao > Cc: Gerd Hoffmann > Cc: Tom Lendacky > Signed-off-by: Min Xu > --- > OvmfPkg/Library/PlatformInitLib/IntelTdx.c | 2 +- > OvmfPkg/Library/PlatformInitLib/MemDetect.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/OvmfPkg/Library/PlatformInitLib/IntelTdx.c b/OvmfPkg/Library/PlatformInitLib/IntelTdx.c > index c6d7c8bb6e0e..286f447fea03 100644 > --- a/OvmfPkg/Library/PlatformInitLib/IntelTdx.c > +++ b/OvmfPkg/Library/PlatformInitLib/IntelTdx.c > @@ -557,7 +557,7 @@ PlatformTdxPublishRamRegions ( > BuildMemoryAllocationHob ( > (EFI_PHYSICAL_ADDRESS)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaBase), > (UINT64)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaSize), > - EfiBootServicesData > + EfiRuntimeServicesData > ); > } > } > diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > index 942eaf89cfcf..83fc061fcbac 100644 > --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c > +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > @@ -1022,7 +1022,7 @@ PlatformQemuInitializeRamForS3 ( > BuildMemoryAllocationHob ( > (EFI_PHYSICAL_ADDRESS)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaBase), > (UINT64)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaSize), > - PlatformInfoHob->S3Supported ? EfiACPIMemoryNVS : EfiBootServicesData > + PlatformInfoHob->S3Supported ? EfiACPIMemoryNVS : EfiRuntimeServicesData > ); > } >