ia64/xen-unstable

changeset 9985:9de9ad0685bf

[IA64] SetVirtualAddressMap emulation support

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Wed May 10 15:29:48 2006 -0600 (2006-05-10)
parents e2fba6729281
children f024bb5f5a07
files linux-2.6-xen-sparse/arch/ia64/xen/hypercall.S xen/arch/ia64/xen/Makefile xen/arch/ia64/xen/dom_fw.c xen/arch/ia64/xen/efi_emul.c xen/arch/ia64/xen/hypercall.c xen/arch/ia64/xen/process.c xen/include/asm-ia64/dom_fw.h xen/include/asm-ia64/domain.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypercall.S	Tue May 09 16:56:45 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypercall.S	Wed May 10 15:29:48 2006 -0600
     1.3 @@ -345,7 +345,7 @@ END(xen_set_eflag)
     1.4  GLOBAL_ENTRY(xen_send_ipi)
     1.5          mov r14=r32
     1.6          mov r15=r33
     1.7 -        mov r2=0x380
     1.8 +        mov r2=0x400
     1.9          break 0x1000
    1.10          ;;
    1.11          br.ret.sptk.many rp
     2.1 --- a/xen/arch/ia64/xen/Makefile	Tue May 09 16:56:45 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/Makefile	Wed May 10 15:29:48 2006 -0600
     2.3 @@ -2,6 +2,7 @@ obj-y += acpi.o
     2.4  obj-y += dom0_ops.o
     2.5  obj-y += domain.o
     2.6  obj-y += dom_fw.o
     2.7 +obj-y += efi_emul.o
     2.8  obj-y += hpsimserial.o
     2.9  obj-y += hypercall.o
    2.10  obj-y += hyperprivop.o
     3.1 --- a/xen/arch/ia64/xen/dom_fw.c	Tue May 09 16:56:45 2006 -0600
     3.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Wed May 10 15:29:48 2006 -0600
     3.3 @@ -798,6 +798,9 @@ dom_fw_init (struct domain *d, const cha
     3.4  	pfn         = (void *) cp; cp += NFUNCPTRS * 2 * sizeof(pfn);
     3.5  	cmd_line    = (void *) cp;
     3.6  
     3.7 +	/* Initialise for EFI_SET_VIRTUAL_ADDRESS_MAP emulation */
     3.8 +	d->arch.efi_runtime = efi_runtime;
     3.9 +
    3.10  	if (args) {
    3.11  		if (arglen >= 1024)
    3.12  			arglen = 1023;
    3.13 @@ -959,7 +962,7 @@ dom_fw_init (struct domain *d, const cha
    3.14  		MAKE_MD(EFI_LOADER_DATA,EFI_MEMORY_WB,0*MB,1*MB, 0);//XXX
    3.15  #endif
    3.16  		/* hypercall patches live here, masquerade as reserved PAL memory */
    3.17 -		MAKE_MD(EFI_PAL_CODE,EFI_MEMORY_WB,HYPERCALL_START,HYPERCALL_END, 0);
    3.18 +		MAKE_MD(EFI_PAL_CODE,EFI_MEMORY_WB|EFI_MEMORY_RUNTIME,HYPERCALL_START,HYPERCALL_END, 0);
    3.19   		MAKE_MD(EFI_CONVENTIONAL_MEMORY,EFI_MEMORY_WB,HYPERCALL_END,maxmem-IA64_GRANULE_SIZE, 0);//XXX make sure this doesn't overlap on i/o, runtime area.
    3.20  #ifndef CONFIG_XEN_IA64_DOM0_VP
    3.21  /* hack */	MAKE_MD(EFI_CONVENTIONAL_MEMORY,EFI_MEMORY_WB,last_start,last_end,1);
    3.22 @@ -993,7 +996,7 @@ dom_fw_init (struct domain *d, const cha
    3.23  		MAKE_MD(EFI_LOADER_DATA,EFI_MEMORY_WB,0*MB,1*MB, 1);
    3.24  #endif
    3.25  		/* hypercall patches live here, masquerade as reserved PAL memory */
    3.26 -		MAKE_MD(EFI_PAL_CODE,EFI_MEMORY_WB,HYPERCALL_START,HYPERCALL_END, 1);
    3.27 +		MAKE_MD(EFI_PAL_CODE,EFI_MEMORY_WB|EFI_MEMORY_RUNTIME,HYPERCALL_START,HYPERCALL_END, 1);
    3.28  		MAKE_MD(EFI_CONVENTIONAL_MEMORY,EFI_MEMORY_WB,HYPERCALL_END,maxmem, 1);
    3.29  		/* Create a dummy entry for IO ports, so that IO accesses are
    3.30  		   trapped by Xen.  */
    3.31 @@ -1009,7 +1012,7 @@ dom_fw_init (struct domain *d, const cha
    3.32  	BUG_ON(i > NUM_MEM_DESCS);
    3.33  	bp->efi_memmap_size = i * sizeof(efi_memory_desc_t);
    3.34  	bp->efi_memdesc_size = sizeof(efi_memory_desc_t);
    3.35 -	bp->efi_memdesc_version = 1;
    3.36 +	bp->efi_memdesc_version = EFI_MEMDESC_VERSION;
    3.37  	bp->command_line = dom_pa((unsigned long) cmd_line);
    3.38  	bp->console_info.num_cols = 80;
    3.39  	bp->console_info.num_rows = 25;
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/xen/arch/ia64/xen/efi_emul.c	Wed May 10 15:29:48 2006 -0600
     4.3 @@ -0,0 +1,180 @@
     4.4 +/*
     4.5 + * efi_emul.c:
     4.6 + *
     4.7 + * This program is free software; you can redistribute it and/or modify it
     4.8 + * under the terms and conditions of the GNU General Public License,
     4.9 + * version 2, as published by the Free Software Foundation.
    4.10 + *
    4.11 + * This program is distributed in the hope it will be useful, but WITHOUT
    4.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    4.14 + * more details.
    4.15 + *
    4.16 + * You should have received a copy of the GNU General Public License along with
    4.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    4.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    4.19 + *
    4.20 + */
    4.21 +
    4.22 +#include <xen/config.h>
    4.23 +#include <xen/compile.h>
    4.24 +#include <asm/pgalloc.h>
    4.25 +#include <asm/vcpu.h>
    4.26 +#include <asm/dom_fw.h>
    4.27 +#include <public/sched.h>
    4.28 +
    4.29 +extern unsigned long translate_domain_mpaddr(unsigned long);
    4.30 +extern unsigned long domain_mpa_to_imva(struct domain *,unsigned long mpaddr);
    4.31 +
    4.32 +// given a current domain (virtual or metaphysical) address, return the virtual address
    4.33 +static unsigned long
    4.34 +efi_translate_domain_addr(unsigned long domain_addr, IA64FAULT *fault)
    4.35 +{
    4.36 +	struct vcpu *v = current;
    4.37 +	unsigned long mpaddr = domain_addr;
    4.38 +	*fault = IA64_NO_FAULT;
    4.39 +
    4.40 +	if (v->domain->arch.efi_virt_mode) {
    4.41 +		*fault = vcpu_tpa(v, domain_addr, &mpaddr);
    4.42 +		if (*fault != IA64_NO_FAULT) return 0;
    4.43 +	}
    4.44 +
    4.45 +	return ((unsigned long) __va(translate_domain_mpaddr(mpaddr)));
    4.46 +}
    4.47 +
    4.48 +static efi_status_t
    4.49 +efi_emulate_get_time(
    4.50 +	unsigned long tv_addr, unsigned long tc_addr,
    4.51 +	IA64FAULT *fault)
    4.52 +{
    4.53 +	unsigned long tv = 0, tc = 0;
    4.54 +	efi_status_t status;
    4.55 +
    4.56 +	//printf("efi_get_time(%016lx,%016lx) called\n", tv_addr, tc_addr);
    4.57 +	tv = efi_translate_domain_addr(tv_addr, fault);
    4.58 +	if (*fault != IA64_NO_FAULT) return 0;
    4.59 +	if (tc_addr) {
    4.60 +		tc = efi_translate_domain_addr(tc_addr, fault);
    4.61 +		if (*fault != IA64_NO_FAULT) return 0;
    4.62 +	}
    4.63 +	//printf("efi_get_time(%016lx,%016lx) translated to xen virtual address\n", tv, tc);
    4.64 +	status = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t *) tc);
    4.65 +	//printf("efi_get_time returns %lx\n", status);
    4.66 +	return status;
    4.67 +}
    4.68 +
    4.69 +static efi_status_t
    4.70 +efi_emulate_set_virtual_address_map(
    4.71 +	unsigned long memory_map_size, unsigned long descriptor_size,
    4.72 +	u32 descriptor_version, efi_memory_desc_t *virtual_map)
    4.73 +{
    4.74 +	void *efi_map_start, *efi_map_end, *p;
    4.75 +	efi_memory_desc_t entry, *md = &entry;
    4.76 +	u64 efi_desc_size;
    4.77 +
    4.78 +	unsigned long *vfn;
    4.79 +	struct domain *d = current->domain;
    4.80 +	efi_runtime_services_t *efi_runtime = d->arch.efi_runtime;
    4.81 +
    4.82 +	if (descriptor_version != EFI_MEMDESC_VERSION) {
    4.83 +		printf ("efi_emulate_set_virtual_address_map: memory descriptor version unmatched\n");
    4.84 +		return EFI_INVALID_PARAMETER;
    4.85 +	}
    4.86 +
    4.87 +	if (descriptor_size != sizeof(efi_memory_desc_t)) {
    4.88 +		printf ("efi_emulate_set_virtual_address_map: memory descriptor size unmatched\n");
    4.89 +		return EFI_INVALID_PARAMETER;
    4.90 +	}
    4.91 +
    4.92 +	if (d->arch.efi_virt_mode) return EFI_UNSUPPORTED;
    4.93 +
    4.94 +	efi_map_start = virtual_map;
    4.95 +	efi_map_end   = efi_map_start + memory_map_size;
    4.96 +	efi_desc_size = sizeof(efi_memory_desc_t);
    4.97 +
    4.98 +	for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
    4.99 +		if (copy_from_user(&entry, p, sizeof(efi_memory_desc_t))) {
   4.100 +			printf ("efi_emulate_set_virtual_address_map: copy_from_user() fault. addr=0x%p\n", p);
   4.101 +			return EFI_UNSUPPORTED;
   4.102 +		}
   4.103 +
   4.104 +		/* skip over non-PAL_CODE memory descriptors; EFI_RUNTIME is included in PAL_CODE. */
   4.105 +                if (md->type != EFI_PAL_CODE)
   4.106 +                        continue;
   4.107 +
   4.108 +#define EFI_HYPERCALL_PATCH_TO_VIRT(tgt,call) \
   4.109 +	do { \
   4.110 +		vfn = (unsigned long *) domain_mpa_to_imva(d, tgt); \
   4.111 +		*vfn++ = FW_HYPERCALL_##call##_INDEX * 16UL + md->virt_addr; \
   4.112 +		*vfn++ = 0; \
   4.113 +	} while (0)
   4.114 +
   4.115 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->get_time,EFI_GET_TIME);
   4.116 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->set_time,EFI_SET_TIME);
   4.117 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->get_wakeup_time,EFI_GET_WAKEUP_TIME);
   4.118 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->set_wakeup_time,EFI_SET_WAKEUP_TIME);
   4.119 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->set_virtual_address_map,EFI_SET_VIRTUAL_ADDRESS_MAP);
   4.120 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->get_variable,EFI_GET_VARIABLE);
   4.121 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->get_next_variable,EFI_GET_NEXT_VARIABLE);
   4.122 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->set_variable,EFI_SET_VARIABLE);
   4.123 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->get_next_high_mono_count,EFI_GET_NEXT_HIGH_MONO_COUNT);
   4.124 +		EFI_HYPERCALL_PATCH_TO_VIRT(efi_runtime->reset_system,EFI_RESET_SYSTEM);
   4.125 +	}
   4.126 +
   4.127 +	/* The virtual address map has been applied. */
   4.128 +	d->arch.efi_virt_mode = 1;
   4.129 +
   4.130 +	return EFI_SUCCESS;
   4.131 +}
   4.132 +
   4.133 +efi_status_t
   4.134 +efi_emulator (struct pt_regs *regs, IA64FAULT *fault)
   4.135 +{
   4.136 +	struct vcpu *v = current;
   4.137 +	efi_status_t status;
   4.138 +
   4.139 +	*fault = IA64_NO_FAULT;
   4.140 +
   4.141 +	switch (regs->r2) {
   4.142 +	    case FW_HYPERCALL_EFI_RESET_SYSTEM:
   4.143 +		printf("efi.reset_system called ");
   4.144 +		if (current->domain == dom0) {
   4.145 +			printf("(by dom0)\n ");
   4.146 +			(*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
   4.147 +		}
   4.148 +		else
   4.149 +			domain_shutdown (current->domain, SHUTDOWN_reboot);
   4.150 +		status = EFI_UNSUPPORTED;
   4.151 +		break;
   4.152 +	    case FW_HYPERCALL_EFI_GET_TIME:
   4.153 +		status = efi_emulate_get_time (
   4.154 +				vcpu_get_gr(v,32),
   4.155 +				vcpu_get_gr(v,33),
   4.156 +				fault);
   4.157 +		break;
   4.158 +	    case FW_HYPERCALL_EFI_SET_VIRTUAL_ADDRESS_MAP:
   4.159 +		status = efi_emulate_set_virtual_address_map (
   4.160 +				vcpu_get_gr(v,32),
   4.161 +				vcpu_get_gr(v,33),
   4.162 + 				(u32) vcpu_get_gr(v,34),
   4.163 +				(efi_memory_desc_t *) vcpu_get_gr(v,35));
   4.164 +		break;
   4.165 +	    case FW_HYPERCALL_EFI_SET_TIME:
   4.166 +	    case FW_HYPERCALL_EFI_GET_WAKEUP_TIME:
   4.167 +	    case FW_HYPERCALL_EFI_SET_WAKEUP_TIME:
   4.168 +		// FIXME: need fixes in efi.h from 2.6.9
   4.169 +	    case FW_HYPERCALL_EFI_GET_VARIABLE:
   4.170 +		// FIXME: need fixes in efi.h from 2.6.9
   4.171 +	    case FW_HYPERCALL_EFI_GET_NEXT_VARIABLE:
   4.172 +	    case FW_HYPERCALL_EFI_SET_VARIABLE:
   4.173 +	    case FW_HYPERCALL_EFI_GET_NEXT_HIGH_MONO_COUNT:
   4.174 +		// FIXME: need fixes in efi.h from 2.6.9
   4.175 +		status = EFI_UNSUPPORTED;
   4.176 +		break;
   4.177 +	    default:
   4.178 +		printf("unknown ia64 fw hypercall %lx\n", regs->r2);
   4.179 +		status = EFI_UNSUPPORTED;
   4.180 +	}
   4.181 +
   4.182 +	return status;
   4.183 +}
     5.1 --- a/xen/arch/ia64/xen/hypercall.c	Tue May 09 16:56:45 2006 -0600
     5.2 +++ b/xen/arch/ia64/xen/hypercall.c	Wed May 10 15:29:48 2006 -0600
     5.3 @@ -26,7 +26,6 @@
     5.4  #include <public/physdev.h>
     5.5  #include <xen/domain.h>
     5.6  
     5.7 -extern unsigned long translate_domain_mpaddr(unsigned long);
     5.8  static long do_physdev_op_compat(XEN_GUEST_HANDLE(physdev_op_t) uop);
     5.9  static long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg);
    5.10  /* FIXME: where these declarations should be there ? */
    5.11 @@ -103,7 +102,7 @@ hypercall_t ia64_hypercall_table[] =
    5.12  uint32_t nr_hypercalls =
    5.13  	sizeof(ia64_hypercall_table) / sizeof(hypercall_t);
    5.14  
    5.15 -static int
    5.16 +static IA64FAULT
    5.17  xen_hypercall (struct pt_regs *regs)
    5.18  {
    5.19  	uint32_t cmd = (uint32_t)regs->r2;
    5.20 @@ -119,7 +118,7 @@ xen_hypercall (struct pt_regs *regs)
    5.21  	else
    5.22  		regs->r8 = -ENOSYS;
    5.23  
    5.24 -	return 1;
    5.25 +	return IA64_NO_FAULT;
    5.26  }
    5.27  
    5.28  
    5.29 @@ -182,14 +181,16 @@ fw_hypercall_ipi (struct pt_regs *regs)
    5.30  	return;
    5.31  }
    5.32  
    5.33 -static int
    5.34 +static IA64FAULT
    5.35  fw_hypercall (struct pt_regs *regs)
    5.36  {
    5.37  	struct vcpu *v = current;
    5.38  	struct sal_ret_values x;
    5.39 -	unsigned long *tv, *tc;
    5.40 +	efi_status_t efi_ret_value;
    5.41 +	IA64FAULT fault; 
    5.42 +	unsigned long index = regs->r2 & FW_HYPERCALL_NUM_MASK_HIGH;
    5.43  
    5.44 -	switch (regs->r2) {
    5.45 +	switch (index) {
    5.46  	    case FW_HYPERCALL_PAL_CALL:
    5.47  		//printf("*** PAL hypercall: index=%d\n",regs->r28);
    5.48  		//FIXME: This should call a C routine
    5.49 @@ -247,40 +248,10 @@ fw_hypercall (struct pt_regs *regs)
    5.50  		regs->r8 = x.r8; regs->r9 = x.r9;
    5.51  		regs->r10 = x.r10; regs->r11 = x.r11;
    5.52  		break;
    5.53 -	    case FW_HYPERCALL_EFI_RESET_SYSTEM:
    5.54 -		printf("efi.reset_system called ");
    5.55 -		if (current->domain == dom0) {
    5.56 -			printf("(by dom0)\n ");
    5.57 -			(*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
    5.58 -		}
    5.59 -		else
    5.60 -			domain_shutdown (current->domain, SHUTDOWN_reboot);
    5.61 -		regs->r8 = EFI_UNSUPPORTED;
    5.62 -		break;
    5.63 -	    case FW_HYPERCALL_EFI_GET_TIME:
    5.64 -		tv = (unsigned long *) vcpu_get_gr(v,32);
    5.65 -		tc = (unsigned long *) vcpu_get_gr(v,33);
    5.66 -		//printf("efi_get_time(%p,%p) called...",tv,tc);
    5.67 -		tv = (unsigned long *) __va(translate_domain_mpaddr((unsigned long) tv));
    5.68 -		if (tc) tc = (unsigned long *) __va(translate_domain_mpaddr((unsigned long) tc));
    5.69 -		regs->r8 = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t *) tc);
    5.70 -		//printf("and returns %lx\n",regs->r8);
    5.71 -		break;
    5.72 -	    case FW_HYPERCALL_EFI_SET_TIME:
    5.73 -	    case FW_HYPERCALL_EFI_GET_WAKEUP_TIME:
    5.74 -	    case FW_HYPERCALL_EFI_SET_WAKEUP_TIME:
    5.75 -		// FIXME: need fixes in efi.h from 2.6.9
    5.76 -	    case FW_HYPERCALL_EFI_SET_VIRTUAL_ADDRESS_MAP:
    5.77 -		// FIXME: WARNING!! IF THIS EVER GETS IMPLEMENTED
    5.78 -		// SOME OF THE OTHER EFI EMULATIONS WILL CHANGE AS 
    5.79 -		// POINTER ARGUMENTS WILL BE VIRTUAL!!
    5.80 -	    case FW_HYPERCALL_EFI_GET_VARIABLE:
    5.81 -		// FIXME: need fixes in efi.h from 2.6.9
    5.82 -	    case FW_HYPERCALL_EFI_GET_NEXT_VARIABLE:
    5.83 -	    case FW_HYPERCALL_EFI_SET_VARIABLE:
    5.84 -	    case FW_HYPERCALL_EFI_GET_NEXT_HIGH_MONO_COUNT:
    5.85 -		// FIXME: need fixes in efi.h from 2.6.9
    5.86 -		regs->r8 = EFI_UNSUPPORTED;
    5.87 +	    case FW_HYPERCALL_EFI_CALL:
    5.88 +		efi_ret_value = efi_emulator (regs, &fault);
    5.89 +		if (fault != IA64_NO_FAULT) return fault;
    5.90 +		regs->r8 = efi_ret_value;
    5.91  		break;
    5.92  	    case FW_HYPERCALL_IPI:
    5.93  		fw_hypercall_ipi (regs);
    5.94 @@ -289,7 +260,7 @@ fw_hypercall (struct pt_regs *regs)
    5.95  		printf("unknown ia64 fw hypercall %lx\n", regs->r2);
    5.96  		regs->r8 = do_ni_hypercall();
    5.97  	}
    5.98 -	return 1;
    5.99 +	return IA64_NO_FAULT;
   5.100  }
   5.101  
   5.102  /* opt_unsafe_hypercall: If true, unsafe debugging hypercalls are allowed.
   5.103 @@ -297,7 +268,7 @@ fw_hypercall (struct pt_regs *regs)
   5.104  static int opt_unsafe_hypercall = 0;
   5.105  boolean_param("unsafe_hypercall", opt_unsafe_hypercall);
   5.106  
   5.107 -int
   5.108 +IA64FAULT
   5.109  ia64_hypercall (struct pt_regs *regs)
   5.110  {
   5.111  	struct vcpu *v = current;
   5.112 @@ -327,7 +298,7 @@ ia64_hypercall (struct pt_regs *regs)
   5.113  			printf("unknown user xen/ia64 hypercall %lx\n", index);
   5.114  			regs->r8 = do_ni_hypercall();
   5.115  	    }
   5.116 -	    return 1;
   5.117 +	    return IA64_NO_FAULT;
   5.118  	}
   5.119  
   5.120  	/* Hypercalls are only allowed by kernel.
   5.121 @@ -336,7 +307,7 @@ ia64_hypercall (struct pt_regs *regs)
   5.122  	    /* FIXME: Return a better error value ?
   5.123  	       Reflection ? Illegal operation ?  */
   5.124  	    regs->r8 = -1;
   5.125 -	    return 1;
   5.126 +	    return IA64_NO_FAULT;
   5.127  	}
   5.128  
   5.129  	if (index >= FW_HYPERCALL_FIRST_ARCH)
     6.1 --- a/xen/arch/ia64/xen/process.c	Tue May 09 16:56:45 2006 -0600
     6.2 +++ b/xen/arch/ia64/xen/process.c	Wed May 10 15:29:48 2006 -0600
     6.3 @@ -15,7 +15,6 @@
     6.4  #include <asm/ptrace.h>
     6.5  #include <xen/delay.h>
     6.6  
     6.7 -#include <linux/efi.h>	/* FOR EFI_UNIMPLEMENTED */
     6.8  #include <asm/sal.h>	/* FOR struct ia64_sal_retval */
     6.9  
    6.10  #include <asm/system.h>
    6.11 @@ -40,7 +39,7 @@ extern void die_if_kernel(char *str, str
    6.12  extern void panic_domain(struct pt_regs *, const char *, ...);
    6.13  extern long platform_is_hp_ski(void);
    6.14  extern int ia64_hyperprivop(unsigned long, REGS *);
    6.15 -extern int ia64_hypercall(struct pt_regs *regs);
    6.16 +extern IA64FAULT ia64_hypercall(struct pt_regs *regs);
    6.17  extern void vmx_do_launch(struct vcpu *);
    6.18  extern unsigned long lookup_domain_mpa(struct domain *,unsigned long);
    6.19  
    6.20 @@ -680,6 +679,7 @@ ia64_handle_break (unsigned long ifa, st
    6.21  {
    6.22  	struct domain *d = current->domain;
    6.23  	struct vcpu *v = current;
    6.24 +	IA64FAULT vector;
    6.25  
    6.26  	if (first_break) {
    6.27  		if (platform_is_hp_ski()) running_on_sim = 1;
    6.28 @@ -700,9 +700,11 @@ ia64_handle_break (unsigned long ifa, st
    6.29  		/* by default, do not continue */
    6.30  		v->arch.hypercall_continuation = 0;
    6.31  
    6.32 -		if (ia64_hypercall(regs) &&
    6.33 -		    !PSCBX(v, hypercall_continuation))
    6.34 -			vcpu_increment_iip(current);
    6.35 +		if ((vector = ia64_hypercall(regs)) == IA64_NO_FAULT) {
    6.36 +			if (!PSCBX(v, hypercall_continuation))
    6.37 +				vcpu_increment_iip(current);
    6.38 +		}
    6.39 +		else reflect_interruption(isr, regs, vector);
    6.40  	}
    6.41  	else if (!PSCB(v,interrupt_collection_enabled)) {
    6.42  		if (ia64_hyperprivop(iim,regs))
     7.1 --- a/xen/include/asm-ia64/dom_fw.h	Tue May 09 16:56:45 2006 -0600
     7.2 +++ b/xen/include/asm-ia64/dom_fw.h	Wed May 10 15:29:48 2006 -0600
     7.3 @@ -5,7 +5,7 @@
     7.4   *	Dan Magenheimer (dan.magenheimer@hp.com)
     7.5   */
     7.6  
     7.7 -extern unsigned long dom_fw_setup(struct domain *, const char *, int);
     7.8 +#include <linux/efi.h>
     7.9  
    7.10  #ifndef MB
    7.11  #define MB (1024*1024)
    7.12 @@ -55,7 +55,7 @@ extern unsigned long dom_fw_setup(struct
    7.13  
    7.14  #define FW_HYPERCALL_SAL_CALL_INDEX	0x82UL
    7.15  #define FW_HYPERCALL_SAL_CALL_PADDR	FW_HYPERCALL_PADDR(FW_HYPERCALL_SAL_CALL_INDEX)
    7.16 -#define FW_HYPERCALL_SAL_CALL		0x1001UL
    7.17 +#define FW_HYPERCALL_SAL_CALL		0x1100UL
    7.18  
    7.19  /*
    7.20   * EFI is accessed via the EFI system table, which contains:
    7.21 @@ -94,6 +94,7 @@ extern unsigned long dom_fw_setup(struct
    7.22  #define FW_HYPERCALL_EFI_RESET_SYSTEM_INDEX		9UL
    7.23  
    7.24  /* these are hypercall numbers */
    7.25 +#define FW_HYPERCALL_EFI_CALL				0x300UL
    7.26  #define FW_HYPERCALL_EFI_GET_TIME			0x300UL
    7.27  #define FW_HYPERCALL_EFI_SET_TIME			0x301UL
    7.28  #define FW_HYPERCALL_EFI_GET_WAKEUP_TIME		0x302UL
    7.29 @@ -125,7 +126,7 @@ extern unsigned long dom_fw_setup(struct
    7.30  */
    7.31  #define FW_HYPERCALL_FIRST_ARCH		0x300UL
    7.32  
    7.33 -#define FW_HYPERCALL_IPI		0x380UL
    7.34 +#define FW_HYPERCALL_IPI		0x400UL
    7.35  
    7.36  /* Xen/ia64 user hypercalls.  Only used for debugging.  */
    7.37  #define FW_HYPERCALL_FIRST_USER		0xff00UL
    7.38 @@ -133,9 +134,16 @@ extern unsigned long dom_fw_setup(struct
    7.39  /* Interrupt vector used for os boot rendez vous.  */
    7.40  #define XEN_SAL_BOOT_RENDEZ_VEC	0xF3
    7.41  
    7.42 +#define FW_HYPERCALL_NUM_MASK_HIGH	~0xffUL
    7.43 +#define FW_HYPERCALL_NUM_MASK_LOW	 0xffUL
    7.44 +
    7.45 +#define EFI_MEMDESC_VERSION		1
    7.46 +
    7.47  extern struct ia64_pal_retval xen_pal_emulator(UINT64, u64, u64, u64);
    7.48  extern struct sal_ret_values sal_emulator (long index, unsigned long in1, unsigned long in2, unsigned long in3, unsigned long in4, unsigned long in5, unsigned long in6, unsigned long in7);
    7.49  extern struct ia64_pal_retval pal_emulator_static (unsigned long);
    7.50 +extern unsigned long dom_fw_setup (struct domain *, const char *, int);
    7.51 +extern efi_status_t efi_emulator (struct pt_regs *regs, unsigned long *fault);
    7.52  
    7.53  extern void build_pal_hypercall_bundles(unsigned long *imva, unsigned long brkimm, unsigned long hypnum);
    7.54  extern void build_hypercall_bundle(UINT64 *imva, UINT64 brkimm, UINT64 hypnum, UINT64 ret);
     8.1 --- a/xen/include/asm-ia64/domain.h	Tue May 09 16:56:45 2006 -0600
     8.2 +++ b/xen/include/asm-ia64/domain.h	Wed May 10 15:29:48 2006 -0600
     8.3 @@ -54,6 +54,8 @@ struct arch_domain {
     8.4      unsigned long initrd_start;
     8.5      unsigned long initrd_len;
     8.6      char *cmdline;
     8.7 +    int efi_virt_mode;		/* phys : 0 , virt : 1 */
     8.8 +    void *efi_runtime;
     8.9  };
    8.10  #define xen_vastart arch.xen_vastart
    8.11  #define xen_vaend arch.xen_vaend