[edk2-devel] [PATCH V2 1/3] MdePkg: Add New Memory Attributes

Oleksiy Yakovlev posted 3 patches 4 years, 5 months ago
There is a newer version of this series
[edk2-devel] [PATCH V2 1/3] MdePkg: Add New Memory Attributes
Posted by Oleksiy Yakovlev 4 years, 5 months ago
Add usage of EFI_MEMORY_SP and EFI_MEMORY_CPU_CRYPTO
attributes introduced in UEFI 2.8.
(UEFI 2.8, mantis 1919 and 1872).
Fix typos in EFI_MEMORY_CPU_CRYPTO description.
Add attributes bitmasks, grouped by type.

Signed-off-by: Oleksiy Yakovlev <oleksiyy@ami.com>
---
 MdePkg/Include/Uefi/UefiSpec.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h
index 558e1bc..05b82e0 100644
--- a/MdePkg/Include/Uefi/UefiSpec.h
+++ b/MdePkg/Include/Uefi/UefiSpec.h
@@ -96,9 +96,9 @@ typedef enum {
 #define EFI_MEMORY_SP               0x0000000000040000ULL
 //
 // If this flag is set, the memory region is capable of being
-// protected with the CPU?s memory cryptographic
+// protected with the CPU's memory cryptographic
 // capabilities. If this flag is clear, the memory region is not
-// capable of being protected with the CPU?s memory
+// capable of being protected with the CPU's memory
 // cryptographic capabilities or the CPU does not support CPU
 // memory cryptographic capabilities.
 //
@@ -109,6 +109,12 @@ typedef enum {
 //
 #define EFI_MEMORY_RUNTIME          0x8000000000000000ULL
 
+//
+// Attributes bitmasks, grouped by type
+//
+#define EFI_CACHE_ATTRIBUTE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP)
+#define EFI_MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY_RO | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO)
+
 ///
 /// Memory descriptor version number.
 ///
-- 
2.9.0.windows.1


Please consider the environment before printing this email.

The information contained in this message may be confidential and proprietary to American Megatrends (AMI).  This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited.  Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61621): https://edk2.groups.io/g/devel/message/61621
Mute This Topic: https://groups.io/mt/75070221/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH V2 1/3] MdePkg: Add New Memory Attributes
Posted by Laszlo Ersek 4 years, 5 months ago
On 06/23/20 23:55, Oleksiy Yakovlev wrote:
> Add usage of EFI_MEMORY_SP and EFI_MEMORY_CPU_CRYPTO
> attributes introduced in UEFI 2.8.
> (UEFI 2.8, mantis 1919 and 1872).
> Fix typos in EFI_MEMORY_CPU_CRYPTO description.
> Add attributes bitmasks, grouped by type.
> 
> Signed-off-by: Oleksiy Yakovlev <oleksiyy@ami.com>
> ---
>  MdePkg/Include/Uefi/UefiSpec.h | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h
> index 558e1bc..05b82e0 100644
> --- a/MdePkg/Include/Uefi/UefiSpec.h
> +++ b/MdePkg/Include/Uefi/UefiSpec.h
> @@ -96,9 +96,9 @@ typedef enum {
>  #define EFI_MEMORY_SP               0x0000000000040000ULL
>  //
>  // If this flag is set, the memory region is capable of being
> -// protected with the CPU?s memory cryptographic
> +// protected with the CPU's memory cryptographic
>  // capabilities. If this flag is clear, the memory region is not
> -// capable of being protected with the CPU?s memory
> +// capable of being protected with the CPU's memory
>  // cryptographic capabilities or the CPU does not support CPU
>  // memory cryptographic capabilities.
>  //
> @@ -109,6 +109,12 @@ typedef enum {
>  //
>  #define EFI_MEMORY_RUNTIME          0x8000000000000000ULL
>  
> +//
> +// Attributes bitmasks, grouped by type
> +//
> +#define EFI_CACHE_ATTRIBUTE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP)
> +#define EFI_MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY_RO | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO)
> +
>  ///
>  /// Memory descriptor version number.
>  ///
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61644): https://edk2.groups.io/g/devel/message/61644
Mute This Topic: https://groups.io/mt/75070221/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH V2 1/3] MdePkg: Add New Memory Attributes
Posted by Liming Gao 4 years, 5 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Laszlo Ersek <lersek@redhat.com>
> Sent: Wednesday, June 24, 2020 5:27 PM
> To: Oleksiy Yakovlev <oleksiyy@ami.com>; devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Bi, Dandan <dandan.bi@intel.com>; Ni,
> Ray <ray.ni@intel.com>; Kumar, Rahul1 <rahul1.kumar@intel.com>; Felixp@ami.com
> Subject: Re: [PATCH V2 1/3] MdePkg: Add New Memory Attributes
> 
> On 06/23/20 23:55, Oleksiy Yakovlev wrote:
> > Add usage of EFI_MEMORY_SP and EFI_MEMORY_CPU_CRYPTO
> > attributes introduced in UEFI 2.8.
> > (UEFI 2.8, mantis 1919 and 1872).
> > Fix typos in EFI_MEMORY_CPU_CRYPTO description.
> > Add attributes bitmasks, grouped by type.
> >
> > Signed-off-by: Oleksiy Yakovlev <oleksiyy@ami.com>
> > ---
> >  MdePkg/Include/Uefi/UefiSpec.h | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h
> > index 558e1bc..05b82e0 100644
> > --- a/MdePkg/Include/Uefi/UefiSpec.h
> > +++ b/MdePkg/Include/Uefi/UefiSpec.h
> > @@ -96,9 +96,9 @@ typedef enum {
> >  #define EFI_MEMORY_SP               0x0000000000040000ULL
> >  //
> >  // If this flag is set, the memory region is capable of being
> > -// protected with the CPU?s memory cryptographic
> > +// protected with the CPU's memory cryptographic
> >  // capabilities. If this flag is clear, the memory region is not
> > -// capable of being protected with the CPU?s memory
> > +// capable of being protected with the CPU's memory
> >  // cryptographic capabilities or the CPU does not support CPU
> >  // memory cryptographic capabilities.
> >  //
> > @@ -109,6 +109,12 @@ typedef enum {
> >  //
> >  #define EFI_MEMORY_RUNTIME          0x8000000000000000ULL
> >
> > +//
> > +// Attributes bitmasks, grouped by type
> > +//
> > +#define EFI_CACHE_ATTRIBUTE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB |
> EFI_MEMORY_UCE | EFI_MEMORY_WP)
> > +#define EFI_MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY_RO | EFI_MEMORY_SP |
> EFI_MEMORY_CPU_CRYPTO)
> > +
> >  ///
> >  /// Memory descriptor version number.
> >  ///
> >
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61681): https://edk2.groups.io/g/devel/message/61681
Mute This Topic: https://groups.io/mt/75070221/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH V2 1/3] MdePkg: Add New Memory Attributes
Posted by Zhiguang Liu 4 years, 5 months ago
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oleksiy
> Yakovlev
> Sent: Wednesday, June 24, 2020 5:56 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Bi, Dandan <dandan.bi@intel.com>; Ni, Ray
> <ray.ni@intel.com>; lersek@redhat.com; Kumar, Rahul1
> <rahul1.kumar@intel.com>; Felixp@ami.com; oleksiyy@ami.com
> Subject: [edk2-devel] [PATCH V2 1/3] MdePkg: Add New Memory Attributes
> 
> Add usage of EFI_MEMORY_SP and EFI_MEMORY_CPU_CRYPTO
> attributes introduced in UEFI 2.8.
> (UEFI 2.8, mantis 1919 and 1872).
> Fix typos in EFI_MEMORY_CPU_CRYPTO description.
> Add attributes bitmasks, grouped by type.
> 
> Signed-off-by: Oleksiy Yakovlev <oleksiyy@ami.com>
> ---
>  MdePkg/Include/Uefi/UefiSpec.h | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Uefi/UefiSpec.h
> b/MdePkg/Include/Uefi/UefiSpec.h
> index 558e1bc..05b82e0 100644
> --- a/MdePkg/Include/Uefi/UefiSpec.h
> +++ b/MdePkg/Include/Uefi/UefiSpec.h
> @@ -96,9 +96,9 @@ typedef enum {
>  #define EFI_MEMORY_SP               0x0000000000040000ULL
>  //
>  // If this flag is set, the memory region is capable of being
> -// protected with the CPU?s memory cryptographic
> +// protected with the CPU's memory cryptographic
>  // capabilities. If this flag is clear, the memory region is not
> -// capable of being protected with the CPU?s memory
> +// capable of being protected with the CPU's memory
>  // cryptographic capabilities or the CPU does not support CPU
>  // memory cryptographic capabilities.
>  //
> @@ -109,6 +109,12 @@ typedef enum {
>  //
>  #define EFI_MEMORY_RUNTIME          0x8000000000000000ULL
> 
> +//
> +// Attributes bitmasks, grouped by type
> +//
> +#define EFI_CACHE_ATTRIBUTE_MASK (EFI_MEMORY_UC |
> EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB |
> EFI_MEMORY_UCE | EFI_MEMORY_WP)
> +#define EFI_MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_RP |
> EFI_MEMORY_XP | EFI_MEMORY_RO | EFI_MEMORY_SP |
> EFI_MEMORY_CPU_CRYPTO)
> +
>  ///
>  /// Memory descriptor version number.
>  ///
> --
> 2.9.0.windows.1
> 
> 
> Please consider the environment before printing this email.
> 
> The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI).  This communication is intended
> to be read only by the individual or entity to whom it is addressed or by their
> designee. If the reader of this message is not the intended recipient, you are
> on notice that any distribution of this message, in any form, is strictly
> prohibited.  Please promptly notify the sender by reply e-mail or by
> telephone at 770-246-8600, and then delete or destroy all copies of the
> transmission.
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61627): https://edk2.groups.io/g/devel/message/61627
Mute This Topic: https://groups.io/mt/75070221/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-