From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.9136.1580978639578797780 for ; Thu, 06 Feb 2020 00:43:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Va+oa7BI; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580978638; 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=GRphLvNra6tZktT7m3R5rb3aHJ+xRMzYtarefc1N1i8=; b=Va+oa7BIGvlLq8liWvSZDqwRHHdz1Hz1v1AyzldRIhJpYB3WBqAy6wu/FS6qycnI7FdzTg hADTTpOj2q2Pf+UVrU11kpIDjYYM4qcjrpyF7dehIGUWdlQZMqni7ubVFasFdIIWtirY3Z oEtpjYTYeW3i/2ZnAGqIxR2TVZCvks4= 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-411-NamhhkAXMhG5t0ZUN9rj9w-1; Thu, 06 Feb 2020 03:43:52 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4103B1902EC3; Thu, 6 Feb 2020 08:43:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-20.ams2.redhat.com [10.36.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3279C5DA75; Thu, 6 Feb 2020 08:43:47 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 30/40] OvmfPkg: Reserve a page in memory for the SEV-ES usage To: devel@edk2.groups.io, thomas.lendacky@amd.com Cc: Jordan Justen , Ard Biesheuvel , Michael D Kinney , Liming Gao , Eric Dong , Ray Ni , Brijesh Singh References: <0e6bf397c276117bfca51f574870a4927c05c173.1580857303.git.thomas.lendacky@amd.com> From: "Laszlo Ersek" Message-ID: <186da20a-b975-6ec4-d74e-1276aefb5e3a@redhat.com> Date: Thu, 6 Feb 2020 09:43:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <0e6bf397c276117bfca51f574870a4927c05c173.1580857303.git.thomas.lendacky@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: NamhhkAXMhG5t0ZUN9rj9w-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 02/05/20 00:01, Lendacky, Thomas wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 > > Reserve a fixed area of memory for SEV-ES use and set a fixed PCD, > PcdSevEsWorkAreaBase, to this value. > > This area will be used by SEV-ES support for two purposes: > 1. Communicating the SEV-ES status during BSP boot to SEC: > Using a byte of memory from the page, the BSP reset vector code can > communicate the SEV-ES status to SEC for use before exception > handling can be enabled in SEC. After SEC, this field is no longer > valid and the standard way of determine if SEV-ES is active should > be used. > > 2. Establishing an area of memory for AP boot support: > A hypervisor is not allowed to update an SEV-ES guest's register > state, so when booting an SEV-ES guest AP, the hypervisor is not > allowed to set the RIP to the guest requested value. Instead an > SEV-ES AP must be re-directed from within the guest to the actual > requested staring location as specified in the INIT-SIPI-SIPI > sequence. > > Use this memory for reset vector code that can be programmed to have > the AP jump to the desired RIP location after starting the AP. This > is required for only the very first AP reset. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Signed-off-by: Tom Lendacky > --- > OvmfPkg/OvmfPkgX64.fdf | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf > index f541481dc95c..3504aa35dc37 100644 > --- a/OvmfPkg/OvmfPkgX64.fdf > +++ b/OvmfPkg/OvmfPkgX64.fdf > @@ -82,6 +82,9 @@ [FD.MEMFD] > 0x009000|0x002000 > gUefiCpuPkgTokenSpaceGuid.PcdSecGhcbBase|gUefiCpuPkgTokenSpaceGuid.PcdSecGhcbSize > > +0x00B000|0x001000 > +gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase|gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize > + > 0x010000|0x010000 > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize > > Reviewed-by: Laszlo Ersek