xen-ia64-devel
[Xen-ia64-devel] [patch 15/15] ia64: kexec: Map EFI regions into the sam
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>
---
Mon, 14 Jul 2008 21:51:17 +1000
* Rediff for update to definition of __va_efi()
Index: xen-unstable.hg/xen/arch/ia64/linux-xen/efi.c
===================================================================
--- xen-unstable.hg.orig/xen/arch/ia64/linux-xen/efi.c 2008-07-14
17:41:55.000000000 +1000
+++ xen-unstable.hg/xen/arch/ia64/linux-xen/efi.c 2008-07-14
17:41:57.000000000 +1000
@@ -612,6 +612,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
@@ -644,6 +655,7 @@ efi_enter_virtual_mode (void)
#endif
}
}
+#endif
}
status = efi_call_phys(__va(runtime->set_virtual_address_map),
Index: xen-unstable.hg/xen/include/asm-ia64/xenpage.h
===================================================================
--- xen-unstable.hg.orig/xen/include/asm-ia64/xenpage.h 2008-07-14
17:41:55.000000000 +1000
+++ xen-unstable.hg/xen/include/asm-ia64/xenpage.h 2008-07-14
17:41:57.000000000 +1000
@@ -97,14 +97,7 @@ static inline u64 pa_clear_uc(u64 paddr)
/* It is sometimes very useful to have unsigned long as result. */
#define __va_ul(x) ({xen_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.l;})
-/* __va_efi() should just call __va() until the use of
- * __IA64_EFI_CACHED_OFFSET is activated in efi_enter_virtual_mode()
- */
-#if 0
#define __va_efi(x) ((void*)((unsigned long)(x) | __IA64_EFI_CACHED_OFFSET))
-#else
-#define __va_efi(x) __va(x)
-#endif
#endif
#endif /* _ASM_IA64_XENPAGE_H */
--
--
Horms
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-ia64-devel] [patch 04/15] ia64: kexec: Unpin the correct VHPT TR in ia64_do_tlb_purge, (continued)
- [Xen-ia64-devel] [patch 04/15] ia64: kexec: Unpin the correct VHPT TR in ia64_do_tlb_purge, Simon Horman
- [Xen-ia64-devel] [patch 03/15] ia64: kexec: Add a wrapper to vmx_switch_rr7(), Simon Horman
- [Xen-ia64-devel] [patch 10/15] ia64: kexec: Handle EFI UC area correctly in vmx_alt_dtlb, Simon Horman
- [Xen-ia64-devel] [patch 08/15] ia64: kexec: Allow EFI_RID to be used in ivt.S, Simon Horman
- [Xen-ia64-devel] [patch 01/15] ia64: kexec: Define macros for EFI RID, Simon Horman
- [Xen-ia64-devel] [patch 09/15] ia64: kexec: Add identity mapping of EFI memory to alt_dtlb_miss, Simon Horman
- [Xen-ia64-devel] [patch 06/15] ia64: kexec: Header changes in preparation for EFI RID, Simon Horman
- [Xen-ia64-devel] [patch 05/15] ia64: kexec: Unpin shared_info, mapped_regs and VPD TR in ia64_do_tlb_purge, Simon Horman
- [Xen-ia64-devel] [patch 07/15] ia64: kexec: Repining for EFI RID, Simon Horman
- [Xen-ia64-devel] [patch 13/15] ia64: kexec: add __va_efi, Simon Horman
- [Xen-ia64-devel] [patch 15/15] ia64: kexec: Map EFI regions into the same place they are maped into in Linux,
Simon Horman <=
- [Xen-ia64-devel] [patch 12/15] ia64: kexec: Use a separate RID for EFI, Simon Horman
- [Xen-ia64-devel] [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Simon Horman
- [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Isaku Yamahata
- [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Isaku Yamahata
- [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Simon Horman
- Re: [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Simon Horman
- Re: [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Isaku Yamahata
- Re: [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Simon Horman
- Re: [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Simon Horman
- Re: [Xen-ia64-devel] Re: [patch 14/15] ia64: kexec: Only map PAL when making EFI, PAL or SAL calls, Isaku Yamahata
|
|
|