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.59]) by mx.groups.io with SMTP id smtpd.web10.30625.1674599632907961224 for ; Tue, 24 Jan 2023 14:33:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=L1yxfyPa; 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.244.59, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JL5E7lxnFJKDlXBJx+xs7lITxl5YOED3zFC/72Yf9+bxqeTSLZcvGaHhtNNWMgyEwGoyHSAeiei1VVacDnOrgJRKgEncsmVS8h/C7BAwdHgVgSNX3Y7neB/2QO4AHKYH7RqDBVjSoxBEvPx16g4UgkYZq2PIIVd6ekZySQ85WCnjqh8y9+yzwyZNtp3w0/R6I6qOxT4lMycUNURCrharXAUHSgte/kIOdBEEZp6dBW+iwfpoVnHDbSpNOTBKkDjAVkOa1ZOUyjWeIEa7DGfk6c0CGbNZbK1j6UeLPbxJzL7cT6fKPSJ/es4JlT/Nlge5KNqQfGaUlZunS71C4Q909g== 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=RIx1mIDxtWvDtYFG/1OV/1OVjyeN/81NcMyyQKtMtEc=; b=n92FP25jQ6B7cgrC+ValkaHjBh0L+a0LJ/MEcvC1wnOAd+TSriHlLDSqpzUtBIvnOv+Dnfn8ynAaZefBo/SNOeDjRE3e0vKjyNRzeOz/0TLpazMCN26nBc87vxdzFjyav2DopFrf2KJX2w6K62Ll7LIp+H8RWeRilS6i7S+Owg0KdxI/nOokgLVXSRtLXm2GXJEj8tE1l+IXMVNAQdBiNCpCI+AFmnc0MCIIj3mHYZNAw4rpdpinap3Php5/EiqO5A/SXI5cLI2Z2TFd3CHTsn6bu46QBzuZCBu1TcH4rd2whxfhcrTn4oO0rRM889zj6NzeYJfctN50S4Trh1QfGQ== 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=RIx1mIDxtWvDtYFG/1OV/1OVjyeN/81NcMyyQKtMtEc=; b=L1yxfyPaxDsNpug0P80UG9KGXm2+1TT1WjHVRA39YsBjf8+iuXuwxJpUVl+Z9c+9f7yIeDujUuZSlBoohY3fNxxzb+U9cRtKJKjeifYmwQT/I1dyXHYKs9TuflG/hSy7q6lZezwnCozwYA0Dto60xj/GFmCQB/x9d/kgT07upvo= 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 SJ0PR12MB6904.namprd12.prod.outlook.com (2603:10b6:a03:483::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 22:33:50 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::8200:4042:8db4:63d7]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::8200:4042:8db4:63d7%3]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 22:33:50 +0000 Message-ID: Date: Tue, 24 Jan 2023 16:33:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [edk2-devel] [PATCH v4 3/5] OvmfPkg/PlatformInitLib: Add PlatformAddHobCB To: devel@edk2.groups.io, kraxel@redhat.com Cc: Jiewen Yao , Oliver Steffen , =?UTF-8?B?TMOhc3psw7Mgw4lyc2Vr?= , Ard Biesheuvel , Pawel Polawski , Jordan Justen References: <20230117121629.2149112-1-kraxel@redhat.com> <20230117121629.2149112-4-kraxel@redhat.com> From: "Lendacky, Thomas" In-Reply-To: <20230117121629.2149112-4-kraxel@redhat.com> X-ClientProxiedBy: CH2PR17CA0013.namprd17.prod.outlook.com (2603:10b6:610:53::23) 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_|SJ0PR12MB6904:EE_ X-MS-Office365-Filtering-Correlation-Id: aa095f5c-3052-4f20-e8dd-08dafe5b10d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 16xQLgc7NnkhOilNd5cDKqlqzrFGG6hf78h5lT9XtjYYWVW7laEtJjKXE+k81clmpYa+wNyyZsHRXuN+DDzk1MXx7zkmfn93F9PW8dcn7V9IWB7ovVbfJU3MaheA0dJA4WGJJBvBF7ejhI8EBjLGWzD0hzX4mEE+w6gn6Ew7iNHiO4U0OZaVyEmcBgP6k+ftTy+XtM85e/B/ADL6oLGtRcH7hWzJzF8G4ybXrpm1UrR1CL6fNxv15LUMNMHj/N0DThCuAdqLuCt/Bh1l8bs68b7yofQCBWJwldcwbMaRA81NLZIb3LwvKIHm8v/LAzoTV0eL2S1o80Tqbtsly5c1tYBTAyQSdQHyp6AwB6jVy2Wpjj5idITwr9Dl5suw+xrK5ocjIfxFR70LPGhubc82vJ8c0TClYkqj3XsRWfoLZTTtLor0UM4yNLzcpAjQ9Tb7Sf5KA/XDYqdT4Gof6TorzYlHyIjROPau0TfuCFh1F2NGOnyeTI9Nm3pmUsjXjG1jK02ISP/QKS2rzFixc7yo7VWzqK+5IsZVGv8BmidKOHNPg53VR9cRNEso/DOEhkvGfF7V/bYqnkPwBG9+hJ/qyxj5Ft40lHNqTq+9byeWsvlbD3v50/Fb2xGdu5YvDG6G/3numDB7cu8DD6zov3FOYYwkfttDRAjPmIz9S2pY0vEOzTa/Q7uB4d+5nG7IDcU4Lf9zJ64oYSx7HBonLdILtpqESM3COEDDHKPJkWmLN8Eh6VSqFR5pw3qNYAVvI4yF5DEQPRxPmB2KhEQ8geCPmw== 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:(13230025)(4636009)(366004)(136003)(396003)(346002)(39860400002)(376002)(451199018)(86362001)(316002)(19627235002)(54906003)(8676002)(41300700001)(4326008)(31696002)(66946007)(36756003)(2616005)(66556008)(66476007)(83380400001)(38100700002)(478600001)(186003)(6486002)(53546011)(6506007)(2906002)(26005)(31686004)(5660300002)(8936002)(6512007)(145603002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U1JDS0hBSEs5dHFja2kvdklZb3daWFVLMWptWlpHNzNHWGdQZ1NEM2pYNFBM?= =?utf-8?B?K0dzbEVFeVZHelRmRDY3Vnd6dFdYZHdjdHM3SVQ1TXVJTXZadHpObDlqcDhQ?= =?utf-8?B?M0JKYXNGQWVTbmM3ZUV2cldxN2NRRWU2RlZhSGlIc2IwTDIwNEg4bjRveUdj?= =?utf-8?B?N1dLUUF5R055ZG5YNXFSU3NyakYwZmhiVlFlUVBaWFdvQ1BWUEhzeGlSb3Vk?= =?utf-8?B?RWx0L1hNWGlldDNua0RlK2NUY1FRMXdOOHhPV0FJM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VEs1Vm5Ra3krdVhSTlNPbWtrWklEUDhPMytSWUY4WXoyenhyeTRPVGo4enFS?= =?utf-8?Q?yC5bv11bee0WqlQAORg+hvtBV?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa095f5c-3052-4f20-e8dd-08dafe5b10d6 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2023 22:33:50.5918 (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: 08fWuAEfBgkWVnQaUTCucH5GnnbeKeX5SYuanBUvGHkpjfb2vR4Q3iWcNMpezaMmrMCaiHFJkB32b7/J92Kb0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6904 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/17/23 06:16, Gerd Hoffmann via groups.io wrote: > Add PlatformAddHobCB() callback function for use with > PlatformScanE820(). It adds HOBs for high memory and reservations (low > memory is handled elsewhere because there are some special cases to > consider). This replaces calls to PlatformScanOrAdd64BitE820Ram() with > AddHighHobs = TRUE. > > Write any actions done (adding HOBs, skip unknown types) to the firmware > log with INFO loglevel. > > Also remove PlatformScanOrAdd64BitE820Ram() which is not used any more. Hi Gerd, A problem was reported to me for an SEV-ES guest that I bisected to this patch. It only occurs when using the OVMF_CODE.fd file without specifying the OVMF_VARS.fd file (i.e. only the one pflash device on the qemu command line, but not using the OVMF.fd file). I don't ever boot without an OVMF_VARS.fd file, so I didn't catch this. With this patch, SEV-ES terminates now because it detects doing MMIO to encrypted memory area at 0xFFC00000 (where the OVMF_VARS.fd file would normally be mapped). Prior to this commit, an SEV-ES guest booted without issue in this configuration. First, is not specifying an OVMF_VARS.fd a valid configuration for booting given the CODE/VARS split build? If it is valid, is the lack of the OVMF_VARS.fd resulting in the 0xFFC00000 address range getting marked reserved now (and thus mapped encrypted)? Let me know if you need me to provide any output or testing if you can't boot an SEV-ES guest. Thanks, Tom > > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/Library/PlatformInitLib/MemDetect.c | 185 +++++--------------- > 1 file changed, 47 insertions(+), 138 deletions(-) > > diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > index dfaa05a1c24f..c626fc49cf6c 100644 > --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c > +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > @@ -112,143 +112,6 @@ PlatformQemuUc32BaseInitialization ( > } > } > > -/** > - Iterate over the RAM entries in QEMU's fw_cfg E820 RAM map that start outside > - of the 32-bit address range. > - > - Find the highest exclusive >=4GB RAM address, or produce memory resource > - descriptor HOBs for RAM entries that start at or above 4GB. > - > - @param[out] MaxAddress If MaxAddress is NULL, then PlatformScanOrAdd64BitE820Ram() > - produces memory resource descriptor HOBs for RAM > - entries that start at or above 4GB. > - > - Otherwise, MaxAddress holds the highest exclusive > - >=4GB RAM address on output. If QEMU's fw_cfg E820 > - RAM map contains no RAM entry that starts outside of > - the 32-bit address range, then MaxAddress is exactly > - 4GB on output. > - > - @retval EFI_SUCCESS The fw_cfg E820 RAM map was found and processed. > - > - @retval EFI_PROTOCOL_ERROR The RAM map was found, but its size wasn't a > - whole multiple of sizeof(EFI_E820_ENTRY64). No > - RAM entry was processed. > - > - @return Error codes from QemuFwCfgFindFile(). No RAM > - entry was processed. > -**/ > -STATIC > -EFI_STATUS > -PlatformScanOrAdd64BitE820Ram ( > - IN BOOLEAN AddHighHob, > - OUT UINT64 *LowMemory OPTIONAL, > - OUT UINT64 *MaxAddress OPTIONAL > - ) > -{ > - EFI_STATUS Status; > - FIRMWARE_CONFIG_ITEM FwCfgItem; > - UINTN FwCfgSize; > - EFI_E820_ENTRY64 E820Entry; > - UINTN Processed; > - > - Status = QemuFwCfgFindFile ("etc/e820", &FwCfgItem, &FwCfgSize); > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - if (FwCfgSize % sizeof E820Entry != 0) { > - return EFI_PROTOCOL_ERROR; > - } > - > - if (LowMemory != NULL) { > - *LowMemory = 0; > - } > - > - if (MaxAddress != NULL) { > - *MaxAddress = BASE_4GB; > - } > - > - QemuFwCfgSelectItem (FwCfgItem); > - for (Processed = 0; Processed < FwCfgSize; Processed += sizeof E820Entry) { > - QemuFwCfgReadBytes (sizeof E820Entry, &E820Entry); > - DEBUG (( > - DEBUG_VERBOSE, > - "%a: Base=0x%Lx Length=0x%Lx Type=%u\n", > - __FUNCTION__, > - E820Entry.BaseAddr, > - E820Entry.Length, > - E820Entry.Type > - )); > - if (E820Entry.Type == EfiAcpiAddressRangeMemory) { > - if (AddHighHob && (E820Entry.BaseAddr >= BASE_4GB)) { > - UINT64 Base; > - UINT64 End; > - > - // > - // Round up the start address, and round down the end address. > - // > - Base = ALIGN_VALUE (E820Entry.BaseAddr, (UINT64)EFI_PAGE_SIZE); > - End = (E820Entry.BaseAddr + E820Entry.Length) & > - ~(UINT64)EFI_PAGE_MASK; > - if (Base < End) { > - PlatformAddMemoryRangeHob (Base, End); > - DEBUG (( > - DEBUG_VERBOSE, > - "%a: PlatformAddMemoryRangeHob [0x%Lx, 0x%Lx)\n", > - __FUNCTION__, > - Base, > - End > - )); > - } > - } > - > - if (MaxAddress || LowMemory) { > - UINT64 Candidate; > - > - Candidate = E820Entry.BaseAddr + E820Entry.Length; > - if (MaxAddress && (Candidate > *MaxAddress)) { > - *MaxAddress = Candidate; > - DEBUG (( > - DEBUG_VERBOSE, > - "%a: MaxAddress=0x%Lx\n", > - __FUNCTION__, > - *MaxAddress > - )); > - } > - > - if (LowMemory && (Candidate > *LowMemory) && (Candidate < BASE_4GB)) { > - *LowMemory = Candidate; > - DEBUG (( > - DEBUG_VERBOSE, > - "%a: LowMemory=0x%Lx\n", > - __FUNCTION__, > - *LowMemory > - )); > - } > - } > - } else if (E820Entry.Type == EfiAcpiAddressRangeReserved) { > - if (AddHighHob) { > - DEBUG (( > - DEBUG_INFO, > - "%a: Reserved: Base=0x%Lx Length=0x%Lx\n", > - __FUNCTION__, > - E820Entry.BaseAddr, > - E820Entry.Length > - )); > - BuildResourceDescriptorHob ( > - EFI_RESOURCE_MEMORY_RESERVED, > - 0, > - E820Entry.BaseAddr, > - E820Entry.Length > - ); > - } > - } > - } > - > - return EFI_SUCCESS; > -} > - > typedef VOID (*E820_SCAN_CALLBACK) ( > EFI_E820_ENTRY64 *E820Entry, > EFI_HOB_PLATFORM_INFO *PlatformInfoHob > @@ -304,6 +167,52 @@ PlatformGetLowMemoryCB ( > } > } > > +/** > + Create HOBs for reservations and RAM (except low memory). > +**/ > +STATIC VOID > +PlatformAddHobCB ( > + IN EFI_E820_ENTRY64 *E820Entry, > + IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob > + ) > +{ > + UINT64 Base, End; > + > + Base = E820Entry->BaseAddr; > + End = E820Entry->BaseAddr + E820Entry->Length; > + > + switch (E820Entry->Type) { > + case EfiAcpiAddressRangeMemory: > + if (Base >= BASE_4GB) { > + // > + // Round up the start address, and round down the end address. > + // > + Base = ALIGN_VALUE (Base, (UINT64)EFI_PAGE_SIZE); > + End = End & ~(UINT64)EFI_PAGE_MASK; > + if (Base < End) { > + DEBUG ((DEBUG_INFO, "%a: HighMemory [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End-1)); > + PlatformAddMemoryRangeHob (Base, End); > + } > + } > + > + break; > + case EfiAcpiAddressRangeReserved: > + BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End); > + DEBUG ((DEBUG_INFO, "%a: Reserved [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End-1)); > + break; > + default: > + DEBUG (( > + DEBUG_WARN, > + "%a: Type %u [0x%Lx, 0x%Lx) (NOT HANDLED)\n", > + __FUNCTION__, > + E820Entry->Type, > + Base, > + End-1 > + )); > + break; > + } > +} > + > /** > Iterate over the entries in QEMU's fw_cfg E820 RAM map, call the > passed callback for each entry. > @@ -1049,7 +958,7 @@ PlatformQemuInitializeRam ( > // entries. Otherwise, create a single memory HOB with the flat >=4GB > // memory size read from the CMOS. > // > - Status = PlatformScanOrAdd64BitE820Ram (TRUE, NULL, NULL); > + Status = PlatformScanE820 (PlatformAddHobCB, PlatformInfoHob); > if (EFI_ERROR (Status)) { > UpperMemorySize = PlatformGetSystemMemorySizeAbove4gb (); > if (UpperMemorySize != 0) {