From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.30838.1620031169346106079 for ; Mon, 03 May 2021 01:39:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fc7acbq4; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620031168; 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=rdOVFbvPQEhTGV/l18oNby94A9+jxvJEUbCULv4c764=; b=fc7acbq4cDbMT242JTc2+uzXxFMUioJ/y0feLxrE3wv/ulNd8cerfPwDWDMrpkuymHR0Rh 1cpvbCcmHuv1nuyMNj4/iKeEGNsCwgCByP8LVo39AuED85W+RhFFfqW9tSgiGeNXEZY+mB 6djbf25FP55/Hc4rCW87X3V1upXDuiE= 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-567-hCqOqEZqPuyOxQfI0kuaQQ-1; Mon, 03 May 2021 04:39:25 -0400 X-MC-Unique: hCqOqEZqPuyOxQfI0kuaQQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 841491006C82; Mon, 3 May 2021 08:39:23 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-8.ams2.redhat.com [10.36.114.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A1771045D02; Mon, 3 May 2021 08:39:21 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH RFC v2 01/28] MdePkg: Expand the SEV MSR to include the SNP definition To: devel@edk2.groups.io, brijesh.singh@amd.com Cc: James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Erdem Aktas References: <20210430115148.22267-1-brijesh.singh@amd.com> <20210430115148.22267-2-brijesh.singh@amd.com> From: "Laszlo Ersek" Message-ID: Date: Mon, 3 May 2021 10:39:20 +0200 MIME-Version: 1.0 In-Reply-To: <20210430115148.22267-2-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 04/30/21 13:51, Brijesh Singh wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 > > Define the SEV-SNP MSR bits. > > Cc: James Bottomley > Cc: Min Xu > Cc: Jiewen Yao > Cc: Tom Lendacky > Cc: Jordan Justen > Cc: Ard Biesheuvel > Cc: Laszlo Ersek > Cc: Erdem Aktas > Signed-off-by: Brijesh Singh > --- > MdePkg/Include/Register/Amd/Fam17Msr.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/MdePkg/Include/Register/Amd/Fam17Msr.h b/MdePkg/Include/Register/Amd/Fam17Msr.h > index e4db09c518..4d33bef220 100644 > --- a/MdePkg/Include/Register/Amd/Fam17Msr.h > +++ b/MdePkg/Include/Register/Amd/Fam17Msr.h > @@ -87,7 +87,12 @@ typedef union { > /// > UINT32 SevEsBit:1; > > - UINT32 Reserved:30; > + /// > + /// [Bit 2] Secure Nested Paging (SevSnp) is enabled > + /// > + UINT32 SevSnpBit:1; > + > + UINT32 Reserved:29; > } Bits; > /// > /// All bit fields as a 32-bit value > (1) When changing a Reserved field's meaning, the field should be renamed. Usually we do this by numbering, and the numbers only ever increase. This is because code might exist that uses a Reserved field. Such code should be prevented from compiling, because that's much better than silently breaking its behavior. So the new name of the field should be Reserved2. (If we modify Reserved2 later, it should be renamed to Reserved3, and so on -- we should never return to a field name used before.) Thanks Laszlo