[edk2-devel] [PATCH RFC v2 01/28] MdePkg: Expand the SEV MSR to include the SNP definition

Laszlo Ersek lersek at redhat.com
Mon May 3 08:39:20 UTC 2021


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 <jejb at linux.ibm.com>
> Cc: Min Xu <min.m.xu at intel.com>
> Cc: Jiewen Yao <jiewen.yao at intel.com>
> Cc: Tom Lendacky <thomas.lendacky at amd.com>
> Cc: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Cc: Erdem Aktas <erdemaktas at google.com>
> Signed-off-by: Brijesh Singh <brijesh.singh at amd.com>
> ---
>  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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74694): https://edk2.groups.io/g/devel/message/74694
Mute This Topic: https://groups.io/mt/82479047/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list