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.web12.51848.1597085855987898619 for ; Mon, 10 Aug 2020 11:57:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D+0GbzQr; 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=1597085855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=si7sG2wAhlWcP9WZuQJIT7RkPtBtLOJHYoMO/XWMUp8=; b=D+0GbzQrfEgKe7BRGe+RBNAsvL8Vw1HQ4CMY9L5vyNKP2k9yiXQEyrwllO+4M83hh8vvYh 8ZD2WfBDhxLWSBbSbTNTJuksaeN+jFsf8Qp6ASJOW2vU6UxRwP80ibIft+o3y0ka7XPcla 7/y39IjXfl5eyxyR6FknsTiAiKJPBc4= 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-459-mTZVAr2RPj6NKrO04mGnrQ-1; Mon, 10 Aug 2020 14:57:33 -0400 X-MC-Unique: mTZVAr2RPj6NKrO04mGnrQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5DFDC19067E0; Mon, 10 Aug 2020 18:57:32 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-53.ams2.redhat.com [10.36.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A85AD7C0E5; Mon, 10 Aug 2020 18:57:31 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v14 45/46] UefiCpuPkg/MpInitLib: Prepare SEV-ES guest APs for OS use To: devel@edk2.groups.io, thomas.lendacky@amd.com References: From: "Laszlo Ersek" Message-ID: Date: Mon, 10 Aug 2020 20:57:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 08/07/20 23:53, Lendacky, Thomas wrote: > From: Tom Lendacky > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 > > Before UEFI transfers control to the OS, it must park the AP. This is > done using the AsmRelocateApLoop function to transition into 32-bit > non-paging mode. For an SEV-ES guest, a few additional things must be > done: > - AsmRelocateApLoop must be updated to support SEV-ES. This means > performing a VMGEXIT AP Reset Hold instead of an MWAIT or HLT loop. > - Since the AP must transition to real mode, a small routine is copied > to the WakeupBuffer area. Since the WakeupBuffer will be used by > the AP during OS booting, it must be placed in reserved memory. > Additionally, the AP stack must be located where it can be accessed > in real mode. > - Once the AP is in real mode it will transfer control to the > destination specified by the OS in the SEV-ES AP Jump Table. The > SEV-ES AP Jump Table address is saved by the hypervisor for the OS > using the GHCB VMGEXIT AP Jump Table exit code. > > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Reviewed-by: Eric Dong > Signed-off-by: Tom Lendacky > --- > UefiCpuPkg/Library/MpInitLib/MpLib.h | 8 +- > UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 54 +++++++- > .../Library/MpInitLib/Ia32/MpFuncs.nasm | 5 +- > UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 130 ++++++++++++++++-- > 4 files changed, 179 insertions(+), 18 deletions(-) this patch is indeed the v13 variant with the incremental fix that I had tested squashed in it. Thanks! Laszlo