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 1/3] Dont use dummy set_virtual_address_map

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [patch 1/3] Dont use dummy set_virtual_address_map
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Wed, 12 Sep 2007 18:17:41 +0900
Delivery-date: Wed, 12 Sep 2007 02:26:13 -0700
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: <20070912091740.411152109@xxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
Instead of relying on purgatory to set up a dummy
set_virtual_address_map(), which requires purgatory
to know how to do __va() opperations, just test to see
if efi has already been mapped at boot time.

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: kexec-tools-unstable/purgatory/arch/ia64/entry.S
===================================================================
--- kexec-tools-unstable.orig/purgatory/arch/ia64/entry.S       2007-05-09 
19:25:45.000000000 +0900
+++ kexec-tools-unstable/purgatory/arch/ia64/entry.S    2007-05-15 
17:55:32.000000000 +0900
@@ -21,16 +21,6 @@
 .size  name, 8;        \
 name:  data8 0x0
 
-.global __dummy_efi_function
-.align  32
-.proc  __dummy_efi_function
-__dummy_efi_function:
-       mov r8=r0;;
-       br.ret.sptk.many rp;;
-.global __dummy_efi_function_end
-__dummy_efi_function_end:
-.endp  __dummy_efi_function
-
 .global purgatory_start
 .align  32
 .proc   purgatory_start
Index: kexec-tools-unstable/purgatory/arch/ia64/purgatory-ia64.c
===================================================================
--- kexec-tools-unstable.orig/purgatory/arch/ia64/purgatory-ia64.c      
2007-05-09 19:25:45.000000000 +0900
+++ kexec-tools-unstable/purgatory/arch/ia64/purgatory-ia64.c   2007-05-15 
17:58:24.000000000 +0900
@@ -21,8 +21,6 @@
 #include <string.h>
 #include "purgatory-ia64.h"
 
-#define PAGE_OFFSET             0xe000000000000000UL
-
 #define EFI_PAGE_SHIFT          12
 #define EFI_PAGE_SIZE          (1UL<<EFI_PAGE_SHIFT)
 #define EFI_PAGE_ALIGN(x)      ((x + EFI_PAGE_SIZE - 1)&~(EFI_PAGE_SIZE-1))
@@ -145,11 +143,6 @@ setup_arch(void)
        reset_vga();
 }
 
-inline unsigned long PA(unsigned long addr)
-{
-       return addr - PAGE_OFFSET;
-}
-
 void
 patch_efi_memmap(struct kexec_boot_params *params,
                struct ia64_boot_param *boot_param)
@@ -229,9 +222,6 @@ flush_icache_range(char *start, unsigned
        asm volatile ("srlz.i":::"memory");
 }
 
-extern char __dummy_efi_function[], __dummy_efi_function_end[];
-
-
 void
 ia64_env_setup(struct ia64_boot_param *boot_param,
        struct kexec_boot_params *params)
@@ -245,32 +235,7 @@ ia64_env_setup(struct ia64_boot_param *b
        struct ia64_boot_param *new_boot_param =
        (struct ia64_boot_param *) params->boot_param_base;
        memcpy(new_boot_param, boot_param, 4096);
-
-       /*
-        * patch efi_runtime->set_virtual_address_map to a dummy function
-        *
-        * The EFI specification mandates that set_virtual_address_map only
-        * takes effect the first time that it is called, and that
-        * subsequent calls will return error.  By replacing it with a
-        * dummy function the new OS can think it is calling it again
-        * without either the OS or any buggy EFI implementations getting
-        * upset.
-        *
-        * Note: as the EFI specification says that set_virtual_address_map
-        * will only take affect the first time it is called, the mapping
-        * can't be updated, and thus mapping of the old and new OS really
-        * needs to be the same.
-        */
-       len = __dummy_efi_function_end - __dummy_efi_function;
-       memcpy(command_line + command_line_len,
-               __dummy_efi_function, len);
-       systab = (efi_system_table_t *)new_boot_param->efi_systab;
-       runtime = (efi_runtime_services_t *)PA(systab->runtime);
-       set_virtual_address_map =
-               (unsigned long *)PA(runtime->set_virtual_address_map);
-       *(set_virtual_address_map) =
-               (unsigned long)(command_line + command_line_len);
-       flush_icache_range(command_line + command_line_len, len);
+       //XXX: 4096 -> params->efi_memmap_size ?
 
        patch_efi_memmap(params, new_boot_param);
 

-- 

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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