From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.224.1621353756300482050 for ; Tue, 18 May 2021 09:02:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EBjlez+n; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621353755; 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=V3+reAHQGzzxEs6VWnGE8IXJ2jobKaO5Rkmtp32TySY=; b=EBjlez+njjCaQTvODa1Q+sUI+N+V6s69sCc9fRvyfFbtrekCriSMsA8+W+woN65b+6tFM4 K9bjAPplY9kIxc2V5FEsAo0A9OmLzxkrVq0Bu0564At19/lxSduY9xYFF7eMwxzzMxwwgx iojrHT4OWahV21oYduvvIniI9uqQHEo= 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-212-niDoZCOHM8mIxotX48RJjw-1; Tue, 18 May 2021 12:02:30 -0400 X-MC-Unique: niDoZCOHM8mIxotX48RJjw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC4E018BFFA1; Tue, 18 May 2021 16:02:28 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 538CD5C1A1; Tue, 18 May 2021 16:02:26 +0000 (UTC) Subject: Re: [PATCH v2 04/13] MdePkg/Register/Amd: define GHCB macro for Register GPA structure To: Erdem Aktas , Brijesh Singh Cc: devel@edk2.groups.io, James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Michael D Kinney , Liming Gao , Zhiguang Liu References: <20210512234615.1726-1-brijesh.singh@amd.com> <20210512234615.1726-5-brijesh.singh@amd.com> From: "Laszlo Ersek" Message-ID: <5fc233d3-020d-c16f-dd45-48665d9e7d71@redhat.com> Date: Tue, 18 May 2021 18:02:24 +0200 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 05/17/21 20:25, Erdem Aktas wrote: > I verified that the values align with the GHCB spec publication: > #56421 Revision: 2.00 > > Just one question: is there any reason why GHCB_* defines are decimal > while the SVM_EXIT_* are all in hexadecimal? Does EDK2 have any > preference? (I'm unaware of any preference in edk2 -- it's probably best to stick with the base that the spec itself uses, but even using a different base is not a huge deal, if the numbers in question are not large.) Thanks! Laszlo > > Reviewed-by: Erdem Aktas > > -Erdem > > On Wed, May 12, 2021 at 4:46 PM Brijesh Singh wrote: >> >> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 >> >> An SEV-SNP guest is required to perform the GHCB GPA registration. See >> the GHCB specification for further details. >> >> Cc: James Bottomley >> Cc: Min Xu >> Cc: Jiewen Yao >> Cc: Tom Lendacky >> Cc: Jordan Justen >> Cc: Ard Biesheuvel >> Cc: Laszlo Ersek >> Cc: Erdem Aktas >> Cc: Michael D Kinney >> Cc: Liming Gao >> Cc: Zhiguang Liu >> Reviewed-by: Laszlo Ersek >> Reviewed-by: Liming Gao >> Signed-off-by: Brijesh Singh >> --- >> MdePkg/Include/Register/Amd/Fam17Msr.h | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/MdePkg/Include/Register/Amd/Fam17Msr.h b/MdePkg/Include/Register/Amd/Fam17Msr.h >> index cdb8f588ccf8..542e4cdf4782 100644 >> --- a/MdePkg/Include/Register/Amd/Fam17Msr.h >> +++ b/MdePkg/Include/Register/Amd/Fam17Msr.h >> @@ -53,6 +53,11 @@ typedef union { >> UINT64 Features:52; >> } GhcbHypervisorFeatures; >> >> + struct { >> + UINT64 Function:12; >> + UINT64 GuestFrameNumber:52; >> + } GhcbGpaRegister; >> + >> VOID *Ghcb; >> >> UINT64 GhcbPhysicalAddress; >> @@ -62,6 +67,8 @@ typedef union { >> #define GHCB_INFO_SEV_INFO_GET 2 >> #define GHCB_INFO_CPUID_REQUEST 4 >> #define GHCB_INFO_CPUID_RESPONSE 5 >> +#define GHCB_INFO_GHCB_GPA_REGISTER_REQUEST 18 >> +#define GHCB_INFO_GHCB_GPA_REGISTER_RESPONSE 19 >> #define GHCB_HYPERVISOR_FEATURES_REQUEST 128 >> #define GHCB_HYPERVISOR_FEATURES_RESPONSE 129 >> #define GHCB_INFO_TERMINATE_REQUEST 256 >> -- >> 2.17.1 >> >