From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web08.8545.1609942893569725968 for ; Wed, 06 Jan 2021 06:21:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MyDfLF1r; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609942892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q6AccLJ63DdtpS3FA59wDDX0X87BJT309m8OrVK82LA=; b=MyDfLF1rBMjR8duUiKe7NzZA40pTZzEZfvAa+HP+5qTETnuues7tR69tykQxDJI4fnxxCs TNJ27aVDTTEhAwcTTMdK8JKyITHMgHWEZZkX8WRiIEHl/UGv8Ldv1CzzlY5bnUVPlwP4Vt uq4jXXDm2nYSeJiCpNuOeSOJxhZMV7Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-282-AMf76ADoOK2TTjNwjgFmtg-1; Wed, 06 Jan 2021 09:21:29 -0500 X-MC-Unique: AMf76ADoOK2TTjNwjgFmtg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF594107ACE8; Wed, 6 Jan 2021 14:21:27 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-59.ams2.redhat.com [10.36.114.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 672081F478; Wed, 6 Jan 2021 14:21:25 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 08/12] OvmfPkg/MemEncryptSevLib: Make the MemEncryptSevLib available for SEC To: devel@edk2.groups.io, thomas.lendacky@amd.com Cc: Brijesh Singh , James Bottomley , Jordan Justen , Ard Biesheuvel References: <6b14be9c75dd31656e986c8e7611b739c2b22a9e.1608065471.git.thomas.lendacky@amd.com> <3bd1ca24-c743-5688-9ec5-2af467a8c595@redhat.com> From: "Laszlo Ersek" Message-ID: <25da1e83-d2ed-562c-6719-cf373b3401ee@redhat.com> Date: Wed, 6 Jan 2021 15:21:25 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/05/21 15:34, Lendacky, Thomas wrote: > On 1/5/21 3:40 AM, Laszlo Ersek wrote: >> On 12/15/20 21:51, Lendacky, Thomas wrote: >>> diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/SecBaseMemEncryptSevLib.inf b/OvmfPkg/Library/BaseMemEncryptSevLib/SecBaseMemEncryptSevLib.inf >>> new file mode 100644 >>> index 000000000000..b26f739d69fd >>> --- /dev/null >>> +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/SecBaseMemEncryptSevLib.inf >>> @@ -0,0 +1,54 @@ >>> +## @file >>> +# Library provides the helper functions for SEV guest >>> +# >>> +# Copyright (c) 2020 Advanced Micro Devices. All rights reserved.
>>> +# >>> +# SPDX-License-Identifier: BSD-2-Clause-Patent >>> +# >>> +# >>> +## >>> + >>> +[Defines] >>> + INF_VERSION = 1.25 >>> + BASE_NAME = SecMemEncryptSevLib >>> + FILE_GUID = 046388b4-430e-4e61-88f6-51ea21db2632 >>> + MODULE_TYPE = BASE >>> + VERSION_STRING = 1.0 >>> + LIBRARY_CLASS = MemEncryptSevLib|SEC >>> + >>> +# >>> +# The following information is for reference only and not required by the build >>> +# tools. >>> +# >>> +# VALID_ARCHITECTURES = IA32 X64 >>> +# >>> + >>> +[Packages] >>> + MdeModulePkg/MdeModulePkg.dec >>> + MdePkg/MdePkg.dec >>> + OvmfPkg/OvmfPkg.dec >>> + UefiCpuPkg/UefiCpuPkg.dec >>> + >>> +[Sources.X64] >>> + SecMemEncryptSevLibInternal.c >>> + MemEncryptSevLibInternal.c >>> + X64/MemEncryptSevLib.c >>> + X64/SecVirtualMemory.c >>> + X64/VirtualMemory.h >>> + >>> +[Sources.IA32] >>> + SecMemEncryptSevLibInternal.c >>> + MemEncryptSevLibInternal.c >>> + Ia32/MemEncryptSevLib.c >>> + >>> +[LibraryClasses] >>> + BaseLib >>> + CpuLib >>> + DebugLib >>> + PcdLib >>> + >>> +[FeaturePcd] >>> + gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire >>> + >> >> (2) This PCD does not look useful for the new library instance (at least >> at this stage). > > The PCD is used in MemEncryptSevLocateInitialSmramSaveStateMapPages() in > the MemEncryptSevLibInternal.c file, which is part of the library. Because > of that, I assumed that it needed to be added even though the function > that uses it isn't called during SEC. > > I'll remove it. My apologies, your original thought was correct; please keep the PCD here. Thanks! Laszlo