WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [patch 16/16] Kexec: Map EFI regions into the same plac

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [patch 16/16] Kexec: Map EFI regions into the same place they are maped into in Linux
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Wed, 06 Feb 2008 17:28:59 +0900
Cc: Aron Griffis <aron@xxxxxx>, Isaku Yamahata <yamahata@xxxxxxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxx>
Delivery-date: Wed, 06 Feb 2008 01:00:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20080206082843.559587291@xxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
Map EFI regions into the same place they are maped into in Linux

This is because of an unfortunate problem with the way that EFI interacts
with Kexec. The call to map the EFI regions may only be made once. This
means that after Kexec the EFI regions must be mapped into the same region
that they were mapped into prior to Kexec.

This is not usually a problem when kexecing from xen to xen or from linux
to linux, as the mapping will be the same. However when kexecing from xen
to linux or linux to xen, the mapping is different, and the problem
manifests.

So far Magnus Damm and I have come up with three different ideas for
resolving this problem.

1. Leave the EFI in physical mode
   - This is nice and simple
   - There is a potential performance hit, but PAL calls are not
     made very often, so it shouldn't be a problem
   - I have patches to do this, some of which are in the
     series that accompany this patch.
   - The SGI people tell me that it won't work on SN because
     it allows the OS to provide EFI (or SAL?) code.

2. Always map EFI into the space that Linux uses
   - Not so simple
   - Requires Xen to jump through some hoops
   - But leaves Linux unmodified
   - But it will break if Linux ever changes its mapping
   - This patch series implements this change

3. Always map EFI to some agreed space
   - Similar to 2. but less likely to break in the future
   - But it requires Xen and Linux to agree on a space to be used
   - Reqires both Xen and Linux to be modified

Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Cc: Tristan Gingold <tgingold@xxxxxxx>
Cc: Alex Williamson <alex.williamson@xxxxxx>
Cc: Aron Griffis <aron@xxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: xen-unstable.hg/xen/arch/ia64/linux-xen/efi.c
===================================================================
--- xen-unstable.hg.orig/xen/arch/ia64/linux-xen/efi.c  2008-02-05 
16:18:53.000000000 +0900
+++ xen-unstable.hg/xen/arch/ia64/linux-xen/efi.c       2008-02-05 
16:18:58.000000000 +0900
@@ -638,6 +638,17 @@ efi_enter_virtual_mode (void)
 
        for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
                md = p;
+#ifdef XEN
+               if (md->attribute & EFI_MEMORY_RUNTIME) {
+                       if (md->attribute & EFI_MEMORY_WB)
+                               md->virt_addr = __IA64_EFI_CACHED_OFFSET|
+                                               md->phys_addr;
+                       else if (md->attribute & (EFI_MEMORY_UC|EFI_MEMORY_WC|
+                                                 EFI_MEMORY_WT))
+                               md->virt_addr = __IA64_EFI_UNCACHED_OFFSET|
+                                               md->phys_addr;
+               }
+#else
                if (md->attribute & EFI_MEMORY_RUNTIME) {
                        /*
                         * Some descriptors have multiple bits set, so the 
order of
@@ -670,6 +681,7 @@ efi_enter_virtual_mode (void)
 #endif
                        }
                }
+#endif
        }
 
        status = efi_call_phys(__va(runtime->set_virtual_address_map),

-- 

-- 
Horms


_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel