ia64/xen-unstable

changeset 7930:eae5812f33f1

Stack pal call emulation implemented. (by Tristan Gingold)
PAL_HALT emulation added: stop machine if dom0, shutdown domain otherwise.
author djm@kirby.fc.hp.com
date Fri Dec 02 12:12:11 2005 -0600 (2005-12-02)
parents 97de0e776d8b
children 28bd01c9b596
files xen/arch/ia64/linux-xen/unaligned.c xen/arch/ia64/vmx/vmx_process.c xen/arch/ia64/xen/dom_fw.c xen/arch/ia64/xen/hypercall.c xen/arch/ia64/xen/privop.c xen/arch/ia64/xen/process.c xen/arch/ia64/xen/xenasm.S xen/arch/ia64/xen/xenmisc.c xen/include/asm-ia64/dom_fw.h xen/include/asm-ia64/privop.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/unaligned.c	Fri Dec 02 10:27:22 2005 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/unaligned.c	Fri Dec 02 12:12:11 2005 -0600
     1.3 @@ -378,7 +378,7 @@ get_rse_reg (struct pt_regs *regs, unsig
     1.4      if (ridx >= sof) {
     1.5          /* read of out-of-frame register returns an undefined value; 0 in our case.  */
     1.6          DPRINT("ignoring read from r%lu; only %lu registers are allocated!\n", r1, sof);
     1.7 -        panic("wrong stack register number");
     1.8 +        panic("wrong stack register number (iip=%p)\n", regs->cr_iip);
     1.9      }
    1.10  
    1.11      if (ridx < sor)
     2.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Fri Dec 02 10:27:22 2005 -0600
     2.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Fri Dec 02 12:12:11 2005 -0600
     2.3 @@ -53,8 +53,6 @@
     2.4  #define INITIAL_PSR_VALUE_AT_INTERRUPTION 0x0000001808028034
     2.5  
     2.6  
     2.7 -extern struct ia64_sal_retval pal_emulator_static(UINT64);
     2.8 -extern struct ia64_sal_retval sal_emulator(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
     2.9  extern void rnat_consumption (VCPU *vcpu);
    2.10  #define DOMN_PAL_REQUEST    0x110000
    2.11  
    2.12 @@ -110,14 +108,15 @@ vmx_ia64_handle_break (unsigned long ifa
    2.13  	}
    2.14  #endif
    2.15  	if (iim == d->arch.breakimm) {
    2.16 -		struct ia64_sal_retval x;
    2.17 +		struct ia64_pal_retval y;
    2.18 +		struct sal_ret_values x;
    2.19  		switch (regs->r2) {
    2.20  		    case FW_HYPERCALL_PAL_CALL:
    2.21  			//printf("*** PAL hypercall: index=%d\n",regs->r28);
    2.22  			//FIXME: This should call a C routine
    2.23 -			x = pal_emulator_static(VCPU(v, vgr[12]));
    2.24 -			regs->r8 = x.status; regs->r9 = x.v0;
    2.25 -			regs->r10 = x.v1; regs->r11 = x.v2;
    2.26 +			y = pal_emulator_static(VCPU(v, vgr[12]));
    2.27 +			regs->r8 = y.status; regs->r9 = y.v0;
    2.28 +			regs->r10 = y.v1; regs->r11 = y.v2;
    2.29  #if 0
    2.30  			if (regs->r8)
    2.31  				printk("Failed vpal emulation, with index:0x%lx\n",
    2.32 @@ -131,8 +130,8 @@ vmx_ia64_handle_break (unsigned long ifa
    2.33  					 sal_param[2], sal_param[3],
    2.34  					 sal_param[4], sal_param[5],
    2.35  					 sal_param[6], sal_param[7]);
    2.36 -			regs->r8 = x.status; regs->r9 = x.v0;
    2.37 -			regs->r10 = x.v1; regs->r11 = x.v2;
    2.38 +			regs->r8 = x.r8; regs->r9 = x.r9;
    2.39 +			regs->r10 = x.r10; regs->r11 = x.r11;
    2.40  #if 0
    2.41  			if (regs->r8)
    2.42  				printk("Failed vsal emulation, with index:0x%lx\n",
     3.1 --- a/xen/arch/ia64/xen/dom_fw.c	Fri Dec 02 10:27:22 2005 -0600
     3.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Fri Dec 02 12:12:11 2005 -0600
     3.3 @@ -18,7 +18,7 @@
     3.4  
     3.5  #include <asm/dom_fw.h>
     3.6  
     3.7 -struct ia64_boot_param *dom_fw_init(struct domain *, char *,int,char *,int);
     3.8 +static struct ia64_boot_param *dom_fw_init(struct domain *, char *,int,char *,int);
     3.9  extern unsigned long domain_mpa_to_imva(struct domain *,unsigned long mpaddr);
    3.10  extern struct domain *dom0;
    3.11  extern unsigned long dom0_start;
    3.12 @@ -56,15 +56,24 @@ void dom_efi_hypercall_patch(struct doma
    3.13  
    3.14  
    3.15  // builds a hypercall bundle at domain physical address
    3.16 -void dom_fw_hypercall_patch(struct domain *d, unsigned long paddr, unsigned long hypercall,unsigned long ret)
    3.17 +static void dom_fw_hypercall_patch(struct domain *d, unsigned long paddr, unsigned long hypercall,unsigned long ret)
    3.18  {
    3.19  	unsigned long imva;
    3.20  
    3.21 -	if (d == dom0) paddr += dom0_start;
    3.22  	imva = domain_mpa_to_imva(d,paddr);
    3.23  	build_hypercall_bundle(imva,d->arch.breakimm,hypercall,ret);
    3.24  }
    3.25  
    3.26 +static void dom_fw_pal_hypercall_patch(struct domain *d, unsigned long paddr)
    3.27 +{
    3.28 +	unsigned long *imva;
    3.29 +
    3.30 +	imva = (unsigned long *)domain_mpa_to_imva(d,paddr);
    3.31 +
    3.32 +	build_pal_hypercall_bundles (imva, d->arch.breakimm,
    3.33 +				      FW_HYPERCALL_PAL_CALL);
    3.34 +}
    3.35 +
    3.36  
    3.37  // FIXME: This is really a hack: Forcing the boot parameter block
    3.38  // at domain mpaddr 0 page, then grabbing only the low bits of the
    3.39 @@ -155,8 +164,6 @@ offtime (unsigned long t, efi_time_t *tp
    3.40  	return 1;
    3.41  }
    3.42  
    3.43 -extern struct ia64_pal_retval pal_emulator_static (unsigned long);
    3.44 -
    3.45  /* Macro to emulate SAL call using legacy IN and OUT calls to CF8, CFC etc.. */
    3.46  
    3.47  #define BUILD_CMD(addr)		((0x80000000 | (addr)) & ~3)
    3.48 @@ -293,11 +300,6 @@ xen_pal_emulator(unsigned long index, un
    3.49  	long status = -1;
    3.50  
    3.51  	if (running_on_sim) return pal_emulator_static(index);
    3.52 -	if (index >= PAL_COPY_PAL) {
    3.53 -		// build_hypercall_bundle needs to be modified to generate
    3.54 -		// a second bundle that conditionally does a br.ret
    3.55 -		panic("xen_pal_emulator: stacked calls not supported!!\n");
    3.56 -	}
    3.57  	printk("xen_pal_emulator: index=%d\n",index);
    3.58  	// pal code must be mapped by a TR when pal is called, however
    3.59  	// calls are rare enough that we will map it lazily rather than
    3.60 @@ -390,9 +392,26 @@ xen_pal_emulator(unsigned long index, un
    3.61  	    case PAL_VM_TR_READ:	/* FIXME: vcpu_get_tr?? */
    3.62  		printk("PAL_VM_TR_READ NOT IMPLEMENTED, IGNORED!\n");
    3.63  		break;
    3.64 -	    case PAL_HALT_INFO:		/* inappropriate info for guest? */
    3.65 -		printk("PAL_HALT_INFO NOT IMPLEMENTED, IGNORED!\n");
    3.66 +	    case PAL_HALT_INFO:
    3.67 +	        {
    3.68 +		    /* 1000 cycles to enter/leave low power state,
    3.69 +		       consumes 10 mW, implemented and cache/TLB coherent.  */
    3.70 +		    unsigned long res = 1000UL | (1000UL << 16) | (10UL << 32)
    3.71 +			    | (1UL << 61) | (1UL << 60);
    3.72 +		    if (copy_to_user ((void *)in1, &res, sizeof (res)))
    3.73 +			    status = PAL_STATUS_EINVAL;    
    3.74 +		    else
    3.75 +			    status = PAL_STATUS_SUCCESS;
    3.76 +	        }
    3.77  		break;
    3.78 +	    case PAL_HALT:
    3.79 +		    if (current->domain == dom0) {
    3.80 +			    printf ("Domain0 halts the machine\n");
    3.81 +			    (*efi.reset_system)(EFI_RESET_SHUTDOWN,0,0,NULL);
    3.82 +		    }
    3.83 +		    else
    3.84 +			    domain_shutdown (current->domain, 0);
    3.85 +		    break;
    3.86  	    default:
    3.87  		printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %d!!!!\n",
    3.88  				index);
    3.89 @@ -401,6 +420,7 @@ xen_pal_emulator(unsigned long index, un
    3.90  	return ((struct ia64_pal_retval) {status, r9, r10, r11});
    3.91  }
    3.92  
    3.93 +
    3.94  #define NFUNCPTRS 20
    3.95  
    3.96  void print_md(efi_memory_desc_t *md)
    3.97 @@ -607,7 +627,7 @@ dom_fw_fake_acpi(struct fake_acpi_tables
    3.98  	return;
    3.99  }
   3.100  
   3.101 -struct ia64_boot_param *
   3.102 +static struct ia64_boot_param *
   3.103  dom_fw_init (struct domain *d, char *args, int arglen, char *fw_mem, int fw_mem_size)
   3.104  {
   3.105  	efi_system_table_t *efi_systab;
   3.106 @@ -615,7 +635,6 @@ dom_fw_init (struct domain *d, char *arg
   3.107  	efi_config_table_t *efi_tables;
   3.108  	struct ia64_sal_systab *sal_systab;
   3.109  	efi_memory_desc_t *efi_memmap, *md;
   3.110 -	unsigned long *pal_desc, *sal_desc;
   3.111  	struct ia64_sal_desc_entry_point *sal_ed;
   3.112  	struct ia64_boot_param *bp;
   3.113  	unsigned long *pfn;
   3.114 @@ -623,7 +642,7 @@ dom_fw_init (struct domain *d, char *arg
   3.115  	char *cp, *cmd_line, *fw_vendor;
   3.116  	int i = 0;
   3.117  	unsigned long maxmem = (d->max_pages - d->arch.sys_pgnr) * PAGE_SIZE;
   3.118 -	unsigned long start_mpaddr = ((d==dom0)?dom0_start:0);
   3.119 +	const unsigned long start_mpaddr = ((d==dom0)?dom0_start:0);
   3.120  
   3.121  #	define MAKE_MD(typ, attr, start, end, abs) 	\	
   3.122  	do {						\
   3.123 @@ -646,13 +665,6 @@ dom_fw_init (struct domain *d, char *arg
   3.124  */
   3.125  	memset(fw_mem, 0, fw_mem_size);
   3.126  
   3.127 -#ifdef USE_PAL_EMULATOR
   3.128 -	pal_desc = (unsigned long *) &pal_emulator_static;
   3.129 -#else
   3.130 -	pal_desc = (unsigned long *) &xen_pal_emulator;
   3.131 -#endif
   3.132 -	sal_desc = (unsigned long *) &sal_emulator;
   3.133 -
   3.134  	cp = fw_mem;
   3.135  	efi_systab  = (void *) cp; cp += sizeof(*efi_systab);
   3.136  	efi_runtime = (void *) cp; cp += sizeof(*efi_runtime);
   3.137 @@ -695,7 +707,7 @@ dom_fw_init (struct domain *d, char *arg
   3.138  #define EFI_HYPERCALL_PATCH(tgt,call) do { \
   3.139      dom_efi_hypercall_patch(d,FW_HYPERCALL_##call##_PADDR,FW_HYPERCALL_##call); \
   3.140      tgt = dom_pa(pfn); \
   3.141 -    *pfn++ = FW_HYPERCALL_##call##_PADDR + ((d==dom0)?dom0_start:0); \
   3.142 +    *pfn++ = FW_HYPERCALL_##call##_PADDR + start_mpaddr; \
   3.143      *pfn++ = 0; \
   3.144      } while (0)
   3.145  
   3.146 @@ -783,12 +795,10 @@ dom_fw_init (struct domain *d, char *arg
   3.147  
   3.148  	/* fill in an entry point: */
   3.149  	sal_ed->type = SAL_DESC_ENTRY_POINT;
   3.150 -#define FW_HYPERCALL_PATCH(tgt,call,ret) do { \
   3.151 -    dom_fw_hypercall_patch(d,FW_HYPERCALL_##call##_PADDR,FW_HYPERCALL_##call,ret); \
   3.152 -    tgt = FW_HYPERCALL_##call##_PADDR + ((d==dom0)?dom0_start:0); \
   3.153 -    } while (0)
   3.154 -	FW_HYPERCALL_PATCH(sal_ed->pal_proc,PAL_CALL,0);
   3.155 -	FW_HYPERCALL_PATCH(sal_ed->sal_proc,SAL_CALL,1);
   3.156 +	sal_ed->pal_proc = FW_HYPERCALL_PAL_CALL_PADDR + start_mpaddr;
   3.157 +	dom_fw_pal_hypercall_patch (d, sal_ed->pal_proc);
   3.158 +	sal_ed->sal_proc = FW_HYPERCALL_SAL_CALL_PADDR + start_mpaddr;
   3.159 +	dom_fw_hypercall_patch (d, sal_ed->sal_proc, FW_HYPERCALL_SAL_CALL, 1);
   3.160  	sal_ed->gp = 0;  // will be ignored
   3.161  
   3.162  	for (cp = (char *) sal_systab; cp < (char *) efi_memmap; ++cp)
     4.1 --- a/xen/arch/ia64/xen/hypercall.c	Fri Dec 02 10:27:22 2005 -0600
     4.2 +++ b/xen/arch/ia64/xen/hypercall.c	Fri Dec 02 12:12:11 2005 -0600
     4.3 @@ -18,8 +18,6 @@
     4.4  #include <public/sched.h>
     4.5  
     4.6  extern unsigned long translate_domain_mpaddr(unsigned long);
     4.7 -extern struct ia64_pal_retval xen_pal_emulator(UINT64,UINT64,UINT64,UINT64);
     4.8 -extern struct ia64_sal_retval sal_emulator(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
     4.9  
    4.10  unsigned long idle_when_pending = 0;
    4.11  unsigned long pal_halt_light_count = 0;
    4.12 @@ -28,8 +26,7 @@ int
    4.13  ia64_hypercall (struct pt_regs *regs)
    4.14  {
    4.15  	struct vcpu *v = (struct domain *) current;
    4.16 -	struct ia64_sal_retval x;
    4.17 -	struct ia64_pal_retval y;
    4.18 +	struct sal_ret_values x;
    4.19  	unsigned long *tv, *tc;
    4.20  	int pi;
    4.21  
    4.22 @@ -62,25 +59,33 @@ ia64_hypercall (struct pt_regs *regs)
    4.23  				pal_halt_light_count++;
    4.24  				do_sched_op(SCHEDOP_yield);
    4.25  			}
    4.26 -			//break;
    4.27 +			regs->r8 = 0;
    4.28 +			regs->r9 = 0;
    4.29 +			regs->r10 = 0;
    4.30 +			regs->r11 = 0;
    4.31  		}
    4.32 -		else if (regs->r28 >= PAL_COPY_PAL) {	/* FIXME */
    4.33 -			printf("stacked PAL hypercalls not supported\n");
    4.34 -			regs->r8 = -1;
    4.35 -			break;
    4.36 +		else {
    4.37 +			struct ia64_pal_retval y;
    4.38 +
    4.39 +			if (regs->r28 >= PAL_COPY_PAL)
    4.40 +				y = xen_pal_emulator
    4.41 +					(regs->r28, vcpu_get_gr (v, 33),
    4.42 +					 vcpu_get_gr (v, 34),
    4.43 +					 vcpu_get_gr (v, 35));
    4.44 +			else
    4.45 +				y = xen_pal_emulator(regs->r28,regs->r29,
    4.46 +						     regs->r30,regs->r31);
    4.47 +			regs->r8 = y.status; regs->r9 = y.v0;
    4.48 +			regs->r10 = y.v1; regs->r11 = y.v2;
    4.49  		}
    4.50 -		else y = xen_pal_emulator(regs->r28,regs->r29,
    4.51 -						regs->r30,regs->r31);
    4.52 -		regs->r8 = y.status; regs->r9 = y.v0;
    4.53 -		regs->r10 = y.v1; regs->r11 = y.v2;
    4.54  		break;
    4.55  	    case FW_HYPERCALL_SAL_CALL:
    4.56  		x = sal_emulator(vcpu_get_gr(v,32),vcpu_get_gr(v,33),
    4.57  			vcpu_get_gr(v,34),vcpu_get_gr(v,35),
    4.58  			vcpu_get_gr(v,36),vcpu_get_gr(v,37),
    4.59  			vcpu_get_gr(v,38),vcpu_get_gr(v,39));
    4.60 -		regs->r8 = x.status; regs->r9 = x.v0;
    4.61 -		regs->r10 = x.v1; regs->r11 = x.v2;
    4.62 +		regs->r8 = x.r8; regs->r9 = x.r9;
    4.63 +		regs->r10 = x.r10; regs->r11 = x.r11;
    4.64  		break;
    4.65  	    case FW_HYPERCALL_EFI_RESET_SYSTEM:
    4.66  		printf("efi.reset_system called ");
     5.1 --- a/xen/arch/ia64/xen/privop.c	Fri Dec 02 10:27:22 2005 -0600
     5.2 +++ b/xen/arch/ia64/xen/privop.c	Fri Dec 02 12:12:11 2005 -0600
     5.3 @@ -10,6 +10,7 @@
     5.4  #include <asm/vcpu.h>
     5.5  #include <asm/processor.h>
     5.6  #include <asm/delay.h>	// Debug only
     5.7 +#include <asm/dom_fw.h>
     5.8  //#include <debug.h>
     5.9  
    5.10  long priv_verbose=0;
    5.11 @@ -54,6 +55,39 @@ void build_hypercall_bundle(UINT64 *imva
    5.12  	*imva++ = bundle.i64[0]; *imva = bundle.i64[1];
    5.13  }
    5.14  
    5.15 +void build_pal_hypercall_bundles(UINT64 *imva, UINT64 brkimm, UINT64 hypnum)
    5.16 +{
    5.17 +	extern unsigned long pal_call_stub[];
    5.18 +	IA64_BUNDLE bundle;
    5.19 +	INST64_A5 slot_a5;
    5.20 +	INST64_M37 slot_m37;
    5.21 +
    5.22 +	/* The source of the hypercall stub is the pal_call_stub function
    5.23 +	   defined in xenasm.S.  */
    5.24 +
    5.25 +	/* Copy the first bundle and patch the hypercall number.  */
    5.26 +	bundle.i64[0] = pal_call_stub[0];
    5.27 +	bundle.i64[1] = pal_call_stub[1];
    5.28 +	slot_a5.inst = bundle.slot0;
    5.29 +	slot_a5.imm7b = hypnum;
    5.30 +	slot_a5.imm9d = hypnum >> 7;
    5.31 +	slot_a5.imm5c = hypnum >> 16;
    5.32 +	bundle.slot0 = slot_a5.inst;
    5.33 +	imva[0] = bundle.i64[0];
    5.34 +	imva[1] = bundle.i64[1];
    5.35 +	
    5.36 +	/* Copy the second bundle and patch the hypercall vector.  */
    5.37 +	bundle.i64[0] = pal_call_stub[2];
    5.38 +	bundle.i64[1] = pal_call_stub[3];
    5.39 +	slot_m37.inst = bundle.slot0;
    5.40 +	slot_m37.imm20a = brkimm;
    5.41 +	slot_m37.i = brkimm >> 20;
    5.42 +	bundle.slot0 = slot_m37.inst;
    5.43 +	imva[2] = bundle.i64[0];
    5.44 +	imva[3] = bundle.i64[1];
    5.45 +}
    5.46 +
    5.47 +
    5.48  /**************************************************************************
    5.49  Privileged operation emulation routines
    5.50  **************************************************************************/
     6.1 --- a/xen/arch/ia64/xen/process.c	Fri Dec 02 10:27:22 2005 -0600
     6.2 +++ b/xen/arch/ia64/xen/process.c	Fri Dec 02 12:12:11 2005 -0600
     6.3 @@ -33,8 +33,6 @@
     6.4  #include <xen/multicall.h>
     6.5  
     6.6  extern unsigned long vcpu_get_itir_on_fault(struct vcpu *, UINT64);
     6.7 -extern struct ia64_sal_retval pal_emulator_static(UINT64);
     6.8 -extern struct ia64_sal_retval sal_emulator(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
     6.9  
    6.10  extern unsigned long dom0_start, dom0_size;
    6.11  
     7.1 --- a/xen/arch/ia64/xen/xenasm.S	Fri Dec 02 10:27:22 2005 -0600
     7.2 +++ b/xen/arch/ia64/xen/xenasm.S	Fri Dec 02 12:12:11 2005 -0600
     7.3 @@ -516,3 +516,27 @@ GLOBAL_ENTRY(vhpt_insert)
     7.4  	br.ret.sptk.few rp
     7.5  	;;
     7.6  END(vhpt_insert)
     7.7 +
     7.8 +//  These instructions are copied in the domains.
     7.9 +//  This is the virtual PAL, which simply does an hypercall.
    7.10 +//  The size is 2 bunldes (32 Bytes).  It handles both static and stacked
    7.11 +//    convention.
    7.12 +//  If you modify this code, you have to modify dom_fw.h (for the size) and
    7.13 +//   dom_fw_pal_hypercall_patch.
    7.14 +GLOBAL_ENTRY(pal_call_stub)
    7.15 +	{
    7.16 +	 .mii
    7.17 +	addl r2=0x1000,r0	//  Hypercall number (Value is patched).
    7.18 +	mov r9=256
    7.19 +	;; 
    7.20 +	cmp.gtu p7,p8=r9,r28		/* r32 <= 255? */
    7.21 +	}
    7.22 +	{
    7.23 +	 .mbb
    7.24 +	break 0x1000	//  Hypercall vector (Value is patched).
    7.25 +(p7)	br.cond.sptk.few rp
    7.26 +(p8)	br.ret.sptk.few rp
    7.27 +	}
    7.28 +END(pal_call_stub)
    7.29 +
    7.30 +
     8.1 --- a/xen/arch/ia64/xen/xenmisc.c	Fri Dec 02 10:27:22 2005 -0600
     8.2 +++ b/xen/arch/ia64/xen/xenmisc.c	Fri Dec 02 12:12:11 2005 -0600
     8.3 @@ -141,10 +141,12 @@ void init_percpu_info(void)
     8.4      //memset(percpu_info, 0, sizeof(percpu_info));
     8.5  }
     8.6  
     8.7 +#if 0
     8.8  void free_page_type(struct pfn_info *page, unsigned int type)
     8.9  {
    8.10  	dummy();
    8.11  }
    8.12 +#endif
    8.13  
    8.14  ///////////////////////////////
    8.15  //// misc memory stuff
     9.1 --- a/xen/include/asm-ia64/dom_fw.h	Fri Dec 02 10:27:22 2005 -0600
     9.2 +++ b/xen/include/asm-ia64/dom_fw.h	Fri Dec 02 12:12:11 2005 -0600
     9.3 @@ -35,6 +35,7 @@ extern unsigned long dom_fw_setup(struct
     9.4   * rp=b0 indicates the return point.
     9.5   *
     9.6   * A single hypercall is used for all PAL calls.
     9.7 + * The hypercall stub is pal_call_stub (xenasm.S).  Its size is 2 bundles.
     9.8   */
     9.9  
    9.10  #define FW_HYPERCALL_PAL_CALL_INDEX	0x80UL
    9.11 @@ -53,7 +54,7 @@ extern unsigned long dom_fw_setup(struct
    9.12   * A single hypercall is used for all SAL calls.
    9.13   */
    9.14  
    9.15 -#define FW_HYPERCALL_SAL_CALL_INDEX	0x81UL
    9.16 +#define FW_HYPERCALL_SAL_CALL_INDEX	0x82UL
    9.17  #define FW_HYPERCALL_SAL_CALL_PADDR	FW_HYPERCALL_PADDR(FW_HYPERCALL_SAL_CALL_INDEX)
    9.18  #define FW_HYPERCALL_SAL_CALL		0x1001UL
    9.19  
    9.20 @@ -117,3 +118,12 @@ extern unsigned long dom_fw_setup(struct
    9.21  #define FW_HYPERCALL_EFI_SET_VARIABLE_PADDR		FW_HYPERCALL_PADDR(FW_HYPERCALL_EFI_SET_VARIABLE_INDEX)
    9.22  #define FW_HYPERCALL_EFI_GET_NEXT_HIGH_MONO_COUNT_PADDR	FW_HYPERCALL_PADDR(FW_HYPERCALL_EFI_GET_NEXT_HIGH_MONO_COUNT_INDEX)
    9.23  #define FW_HYPERCALL_EFI_RESET_SYSTEM_PADDR		FW_HYPERCALL_PADDR(FW_HYPERCALL_EFI_RESET_SYSTEM_INDEX)
    9.24 +
    9.25 +extern struct ia64_pal_retval xen_pal_emulator(UINT64,UINT64,UINT64,UINT64);
    9.26 +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);
    9.27 +extern struct ia64_pal_retval pal_emulator_static (unsigned long);
    9.28 +
    9.29 +extern void build_pal_hypercall_bundles(unsigned long *imva, unsigned long brkimm, unsigned long hypnum);
    9.30 +extern void build_hypercall_bundle(UINT64 *imva, UINT64 brkimm, UINT64 hypnum, UINT64 ret);
    9.31 +
    9.32 +
    10.1 --- a/xen/include/asm-ia64/privop.h	Fri Dec 02 10:27:22 2005 -0600
    10.2 +++ b/xen/include/asm-ia64/privop.h	Fri Dec 02 12:12:11 2005 -0600
    10.3 @@ -100,6 +100,11 @@ typedef union U_INST64_M36 {
    10.4      struct { unsigned long qp:6, r1:7, :14, x6:6, x3:3, :1, major:4; }; 
    10.5  } INST64_M36;
    10.6  
    10.7 +typedef union U_INST64_M37 {
    10.8 +    IA64_INST inst;
    10.9 +    struct { unsigned long qp:6, imm20a:20,:1, x4:4,x2:2,x3:3, i:1, major:4; };
   10.10 +} INST64_M37;
   10.11 +
   10.12  typedef union U_INST64_M41 {
   10.13      IA64_INST inst;
   10.14      struct { unsigned long qp:6, :7, r2:7, :7, x6:6, x3:3, :1, major:4; }; 
   10.15 @@ -190,6 +195,7 @@ typedef union U_INST64 {
   10.16      INST64_M33 M33;	// mov from cr
   10.17      INST64_M35 M35;	// mov to psr
   10.18      INST64_M36 M36;	// mov from psr
   10.19 +    INST64_M37 M37;	// break.m
   10.20      INST64_M41 M41;	// translation cache insert
   10.21      INST64_M42 M42;	// mov to indirect reg/translation reg insert
   10.22      INST64_M43 M43;	// mov from indirect reg