From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 74B9F21A18AAC for ; Mon, 27 Mar 2017 11:44:55 -0700 (PDT) Received: by mail-qk0-x234.google.com with SMTP id r142so17885722qke.2 for ; Mon, 27 Mar 2017 11:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eErlHZXNR4nMnpDCmXmWO9EJmy48aq6oSfKtouN/0Es=; b=dh36OeXT6zxIBu79MkOYLZ3g6wRE1d0uqUvGepwbM/oGoC5nNLxI2zGCMSKUPd5iEA 8Xt5i97NjcUNQ3KfyqydPKyushwls9nVMLAYCbKogigRzQ3FvN/bxItaSHR0ZUOL71Zc MqiZQVAvtgVWiQ/yU/C4q6/0JH60jmM763nD1NyFhLZnlN+ZGqonJflYECdVnDLVj88s y5cR0CGjb/b3297ndMczKjLRChyVxZHVRFj92Z+yolWugxwULxGdVCz2J51y5xNnrS1W jY3XcQsDaJ9LRom/JDOH1CopFvx5CwvIcwFDxQgbOspSpfD0uvRXfH8emblgS/NbDPDq fclg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eErlHZXNR4nMnpDCmXmWO9EJmy48aq6oSfKtouN/0Es=; b=uMDQC+ZU1zqlxP5WMi2KUBOLQ6y2pz8mFxB4jIwI8UfgFBTh1N5+/0CApA7kLRA34o 8yBMVVlgQyo5FrIzySmOCoG7R/7YH6v0o9YXdwq2/zi6DQuwczxjGMNw+hwZv64n1DTH joWOEbQtbsYB5IRI0yGVYah8mWS+hfTTYxa1nvR4V1T0+rr1gb46EDdr0Z7mIbirQEIX +9o7G3D4KbZ2fijXVM0/1VJUYaTPvyLKusFlwMdISqysK6LHZskaoxMGIcgmOgx3t4mm EdRncC43u0v35tK1gIM0jKYVmNrAy+DUiXDBcF8izN3Txs1lItCO/WaYV0uagYeIn2mV tsnA== X-Gm-Message-State: AFeK/H0gCWg47GQQt0pVx5dGfBFfHz4+W4kH1xXbmw7TyN6K77vWUr2jfT0IcZUvDW0z30wEiM6gCb7vdqNQ5w== X-Received: by 10.55.47.69 with SMTP id v66mr20889310qkh.222.1490640294557; Mon, 27 Mar 2017 11:44:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.182.65 with HTTP; Mon, 27 Mar 2017 11:44:54 -0700 (PDT) In-Reply-To: <6f2a60a0-2480-457a-ca30-bc260b20f13f@redhat.com> References: <149013076154.27235.10725020825643505862.stgit@brijesh-build-machine> <149013078709.27235.16179070664669554073.stgit@brijesh-build-machine> <6f2a60a0-2480-457a-ca30-bc260b20f13f@redhat.com> From: Brijesh Singh Date: Mon, 27 Mar 2017 13:44:54 -0500 Message-ID: To: Laszlo Ersek Cc: "Kinney, Michael D" , "Justen, Jordan L" , edk2-devel@ml01.01.org, "Gao, Liming" , "Singh, Brijesh" , Leo Duran , Tom Lendacky X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: [RFC PATCH v2 04/10] OvmfPkg/BaseMemcryptSevLib: Add SEV helper library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:44:55 -0000 Content-Type: text/plain; charset=UTF-8 On Mon, Mar 27, 2017 at 5:07 AM, Laszlo Ersek wrote: > On 03/27/17 11:19, Laszlo Ersek wrote: > > On 03/21/17 22:13, Brijesh Singh wrote: > > >> + Returns a boolean to indicate whether SEV is enabled > >> + > >> + @retval TRUE When SEV is active > >> + @retval FALSE When SEV is not enabled > >> + **/ > >> +BOOLEAN > >> +EFIAPI > >> +MemEncryptSevIsEnabled ( > >> + VOID > >> + ); > > > > Would it make sense to call this library function in PlatformPei, rather > > than add a separate SevIsEnabled() function to it (in patch #3)? The > > implementations look nearly identical. > > I realize that earlier I seemingly suggested the opposite: > > http://mid.mail-archive.com/dd9436dc-415c-9fab-081c- > 39dd2cd71fd5@redhat.com > > http://mid.mail-archive.com/9193d837-6a78-b1c4-42c0- > 427fbc1f2364@redhat.com > > However, at that time, my understanding was that this library would only > be used in PlatformPei (hence the single user wouldn't justify the new > library instance). Now it seems that there are going to be several > client modules that check on SEV enablement. Is that right? > > Yes, I do expect several client module link against this library to check whether the SEV is enabled. Are you okay if we link MemEncryptSevLib in PlatformPei and make use of MemEncryptSevIsEnabled() routine instead of having a local copy ? I was not sure which way to go hence I still have PlatformPei and QemuFwCfgPei using the local implementation of the same functions. My personal perference would be to link with MemEncryptSevLib instead of having local function. But as always I am open to suggestions. Thanks Brijesh