[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen/efi: Add /mapres to map EfiReservedMemoryType for runtime services



From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>

In the same vein as needing /mapbs, some EFI firmware runtime services access
areas marked as EfiReservedMemoryType.

The failing firmware implementations were:
    Product Name: PowerEdge R720
    Vendor: Dell Inc.
    Version: 2.1.2
    Release Date: 09/19/2013
    BIOS Revision: 2.1

    Product Name: PowerEdge R320
    Vendor: Dell Inc.
    Version: 1.5.2
    Release Date: 03/11/2013
    BIOS Revision: 1.5

Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
---
 xen/common/efi/boot.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 75a939f..8173490 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -88,6 +88,7 @@ static bool_t read_file(EFI_FILE_HANDLE dir_handle, CHAR16 
*name,
 
 static UINT32 __initdata mdesc_ver;
 static bool_t __initdata map_bs;
+static bool_t __initdata map_res;
 
 static struct file __initdata cfg;
 static struct file __initdata kernel;
@@ -763,6 +764,8 @@ static int __init __maybe_unused set_color(u32 mask, int 
bpp, u8 *pos, u8 *sz)
                     base_video = 1;
                 else if ( wstrcmp(ptr + 1, L"mapbs") == 0 )
                     map_bs = 1;
+                else if ( wstrcmp(ptr + 1, L"mapres") == 0 )
+                    map_res = 1;
                 else if ( wstrncmp(ptr + 1, L"cfg=", 4) == 0 )
                     cfg_file_name = ptr + 5;
                 else if ( i + 1 < argc && wstrcmp(ptr + 1, L"cfg") == 0 )
@@ -1216,7 +1219,9 @@ void __init efi_init_memory(void)
              (!(desc->Attribute & EFI_MEMORY_RUNTIME) &&
               (!map_bs ||
                (desc->Type != EfiBootServicesCode &&
-                desc->Type != EfiBootServicesData))) )
+                desc->Type != EfiBootServicesData)) &&
+              (!map_res ||
+               desc->Type != EfiReservedMemoryType)) )
             continue;
 
         desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
@@ -1311,7 +1316,9 @@ void __init efi_init_memory(void)
         if ( ((desc->Attribute & EFI_MEMORY_RUNTIME) ||
               (map_bs &&
                (desc->Type == EfiBootServicesCode ||
-                desc->Type == EfiBootServicesData))) &&
+                desc->Type == EfiBootServicesData)) ||
+              (map_res &&
+               (desc->Type == EfiReservedMemoryType))) &&
              desc->VirtualStart != INVALID_VIRTUAL_ADDRESS &&
              desc->VirtualStart != desc->PhysicalStart )
             copy_mapping(PFN_DOWN(desc->PhysicalStart),
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.