efi: Add EFI_MEMORY_{NV, MORE_RELIABLE, RO} attributes
authorEugeniu Rosca <roscaeugeniu@gmail.com>
Sat, 14 Jul 2018 20:53:31 +0000 (22:53 +0200)
committerAlexander Graf <agraf@suse.de>
Mon, 20 Aug 2018 22:03:56 +0000 (00:03 +0200)
With this update, the memory attributes are in sync with Linux
kernel v4.18-rc4. They also match page 190 of UEFI 2.7 spec [1].

[1] http://www.uefi.org/sites/default/files/resources/UEFI_Spec_2_7.pdf

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
cmd/efi.c
include/efi.h

index 92a565f713734ed11ad1da62764f723c07df5ba9..366a79a96488716afca576f355f447aa74ea13d3 100644 (file)
--- a/cmd/efi.c
+++ b/cmd/efi.c
@@ -39,6 +39,9 @@ static struct attr_info {
        { EFI_MEMORY_WP, "write-protect" },
        { EFI_MEMORY_RP, "read-protect" },
        { EFI_MEMORY_XP, "execute-protect" },
+       { EFI_MEMORY_NV, "non-volatile" },
+       { EFI_MEMORY_MORE_RELIABLE, "higher reliability" },
+       { EFI_MEMORY_RO, "read-only" },
        { EFI_MEMORY_RUNTIME, "needs runtime mapping" }
 };
 
index cfdccd7693fb30a20e068794b6536abe11a01d1a..7e7c1cafc28fa90801cf24da54f90270f4fc3837 100644 (file)
@@ -178,6 +178,10 @@ enum efi_mem_type {
 #define EFI_MEMORY_WP          ((u64)0x0000000000001000ULL)    /* write-protect */
 #define EFI_MEMORY_RP          ((u64)0x0000000000002000ULL)    /* read-protect */
 #define EFI_MEMORY_XP          ((u64)0x0000000000004000ULL)    /* execute-protect */
+#define EFI_MEMORY_NV          ((u64)0x0000000000008000ULL)    /* non-volatile */
+#define EFI_MEMORY_MORE_RELIABLE \
+                               ((u64)0x0000000000010000ULL)    /* higher reliability */
+#define EFI_MEMORY_RO          ((u64)0x0000000000020000ULL)    /* read-only */
 #define EFI_MEMORY_RUNTIME     ((u64)0x8000000000000000ULL)    /* range requires runtime mapping */
 #define EFI_MEM_DESC_VERSION   1