[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Remove the unused ia64 patch directory.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 2b95125015a59eeb086b3748f9415ac440133b4d
# Parent  5978be010beca73a6b88ae68d2e120c531bb0edd
Remove the unused ia64 patch directory.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/cpumask.h
--- a/xen/arch/ia64/patch/linux-2.6.11/cpumask.h        Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,12 +0,0 @@
---- ../../linux-2.6.11/include/linux/cpumask.h 2005-03-02 00:38:00.000000000 
-0700
-+++ include/asm-ia64/linux/cpumask.h   2005-04-28 13:21:20.000000000 -0600
-@@ -342,7 +342,9 @@
-  */
- 
- extern cpumask_t cpu_possible_map;
-+#ifndef XEN
- extern cpumask_t cpu_online_map;
-+#endif
- extern cpumask_t cpu_present_map;
- 
- #if NR_CPUS > 1
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/efi.c
--- a/xen/arch/ia64/patch/linux-2.6.11/efi.c    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,50 +0,0 @@
---- ../../linux-2.6.11/arch/ia64/kernel/efi.c  2005-03-02 00:37:47.000000000 
-0700
-+++ arch/ia64/efi.c    2005-06-09 06:15:36.000000000 -0600
-@@ -320,6 +320,16 @@
-               if (!(md->attribute & EFI_MEMORY_WB))
-                       continue;
- 
-+#ifdef XEN
-+// this works around a problem in the ski bootloader
-+{
-+              extern long running_on_sim;
-+              if (running_on_sim && md->type != EFI_CONVENTIONAL_MEMORY)
-+                      continue;
-+}
-+// this is a temporary hack to avoid CONFIG_VIRTUAL_MEM_MAP
-+              if (md->phys_addr >= 0x100000000) continue;
-+#endif
-               /*
-                * granule_addr is the base of md's first granule.
-                * [granule_addr - first_non_wb_addr) is guaranteed to
-@@ -719,6 +729,30 @@
-       return 0;
- }
- 
-+#ifdef XEN
-+// variation of efi_get_iobase which returns entire memory descriptor
-+efi_memory_desc_t *
-+efi_get_io_md (void)
-+{
-+      void *efi_map_start, *efi_map_end, *p;
-+      efi_memory_desc_t *md;
-+      u64 efi_desc_size;
-+
-+      efi_map_start = __va(ia64_boot_param->efi_memmap);
-+      efi_map_end   = efi_map_start + ia64_boot_param->efi_memmap_size;
-+      efi_desc_size = ia64_boot_param->efi_memdesc_size;
-+
-+      for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
-+              md = p;
-+              if (md->type == EFI_MEMORY_MAPPED_IO_PORT_SPACE) {
-+                      if (md->attribute & EFI_MEMORY_UC)
-+                              return md;
-+              }
-+      }
-+      return 0;
-+}
-+#endif
-+
- u32
- efi_mem_type (unsigned long phys_addr)
- {
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/entry.S
--- a/xen/arch/ia64/patch/linux-2.6.11/entry.S  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,237 +0,0 @@
---- ../../linux-2.6.11/arch/ia64/kernel/entry.S        2005-03-02 
00:37:50.000000000 -0700
-+++ arch/ia64/entry.S  2005-05-23 16:49:23.000000000 -0600
-@@ -46,6 +46,7 @@
- 
- #include "minstate.h"
- 
-+#ifndef XEN
-       /*
-        * execve() is special because in case of success, we need to
-        * setup a null register window frame.
-@@ -174,6 +175,7 @@
-       mov rp=loc0
-       br.ret.sptk.many rp
- END(sys_clone)
-+#endif /* !XEN */
- 
- /*
-  * prev_task <- ia64_switch_to(struct task_struct *next)
-@@ -191,7 +193,11 @@
-       movl r25=init_task
-       mov r27=IA64_KR(CURRENT_STACK)
-       adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
-+#ifdef XEN
-+      dep r20=0,in0,60,4              // physical address of "next"
-+#else
-       dep r20=0,in0,61,3              // physical address of "next"
-+#endif
-       ;;
-       st8 [r22]=sp                    // save kernel stack pointer of old task
-       shr.u r26=r20,IA64_GRANULE_SHIFT
-@@ -220,6 +226,16 @@
-       br.ret.sptk.many rp             // boogie on out in new context
- 
- .map:
-+#ifdef XEN
-+      // avoid overlapping with kernel TR
-+      movl r25=KERNEL_START
-+      dep  r23=0,in0,0,KERNEL_TR_PAGE_SHIFT
-+      ;;
-+      cmp.eq p7,p0=r25,r23
-+      ;;
-+(p7)  mov IA64_KR(CURRENT_STACK)=r26  // remember last page we mapped...
-+(p7)  br.cond.sptk .done
-+#endif
-       rsm psr.ic                      // interrupts (psr.i) are already 
disabled here
-       movl r25=PAGE_KERNEL
-       ;;
-@@ -376,7 +392,11 @@
-  *    - b7 holds address to return to
-  *    - must not touch r8-r11
-  */
-+#ifdef XEN
-+GLOBAL_ENTRY(load_switch_stack)
-+#else
- ENTRY(load_switch_stack)
-+#endif
-       .prologue
-       .altrp b7
- 
-@@ -470,6 +490,7 @@
-       br.cond.sptk.many b7
- END(load_switch_stack)
- 
-+#ifndef XEN
- GLOBAL_ENTRY(__ia64_syscall)
-       .regstk 6,0,0,0
-       mov r15=in5                             // put syscall number in place
-@@ -588,6 +609,7 @@
- }
- .ret4:        br.cond.sptk ia64_leave_kernel
- END(ia64_strace_leave_kernel)
-+#endif
- 
- GLOBAL_ENTRY(ia64_ret_from_clone)
-       PT_REGS_UNWIND_INFO(0)
-@@ -604,6 +626,15 @@
-        */
-       br.call.sptk.many rp=ia64_invoke_schedule_tail
- }
-+#ifdef XEN
-+      // new domains are cloned but not exec'ed so switch to user mode here
-+      cmp.ne pKStk,pUStk=r0,r0
-+#ifdef CONFIG_VTI
-+      br.cond.spnt ia64_leave_hypervisor
-+#else // CONFIG_VTI
-+      br.cond.spnt ia64_leave_kernel
-+#endif // CONFIG_VTI
-+#else
- .ret8:
-       adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
-       ;;
-@@ -614,6 +645,7 @@
-       ;;
-       cmp.ne p6,p0=r2,r0
- (p6)  br.cond.spnt .strace_check_retval
-+#endif
-       ;;                                      // added stop bits to prevent 
r8 dependency
- END(ia64_ret_from_clone)
-       // fall through
-@@ -700,19 +732,27 @@
- .work_processed_syscall:
-       adds r2=PT(LOADRS)+16,r12
-       adds r3=PT(AR_BSPSTORE)+16,r12
-+#ifdef XEN
-+      ;;
-+#else
-       adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
-       ;;
- (p6)  ld4 r31=[r18]                           // load 
current_thread_info()->flags
-+#endif
-       ld8 r19=[r2],PT(B6)-PT(LOADRS)          // load ar.rsc value for 
"loadrs"
-       mov b7=r0               // clear b7
-       ;;
-       ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE)    // load ar.bspstore (may be 
garbage)
-       ld8 r18=[r2],PT(R9)-PT(B6)              // load b6
-+#ifndef XEN
- (p6)  and r15=TIF_WORK_MASK,r31               // any work other than 
TIF_SYSCALL_TRACE?
-+#endif
-       ;;
-       mov r16=ar.bsp                          // M2  get existing backing 
store pointer
-+#ifndef XEN
- (p6)  cmp4.ne.unc p6,p0=r15, r0               // any special work pending?
- (p6)  br.cond.spnt .work_pending_syscall
-+#endif
-       ;;
-       // start restoring the state saved on the kernel stack (struct pt_regs):
-       ld8 r9=[r2],PT(CR_IPSR)-PT(R9)
-@@ -757,7 +797,11 @@
-       ;;
-       ld8.fill r12=[r2]       // restore r12 (sp)
-       ld8.fill r15=[r3]       // restore r15
-+#ifdef XEN
-+      movl r3=THIS_CPU(ia64_phys_stacked_size_p8)
-+#else
-       addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0
-+#endif
-       ;;
- (pUStk)       ld4 r3=[r3]             // r3 = cpu_data->phys_stacked_size_p8
- (pUStk) st1 [r14]=r17
-@@ -814,9 +858,18 @@
- (pUStk)       cmp.eq.unc p6,p0=r0,r0          // p6 <- pUStk
- #endif
- .work_processed_kernel:
-+#ifdef XEN
-+      alloc loc0=ar.pfs,0,1,1,0
-+      adds out0=16,r12
-+      ;;
-+(p6)  br.call.sptk.many b0=deliver_pending_interrupt
-+      mov ar.pfs=loc0
-+      mov r31=r0
-+#else
-       adds r17=TI_FLAGS+IA64_TASK_SIZE,r13
-       ;;
- (p6)  ld4 r31=[r17]                           // load 
current_thread_info()->flags
-+#endif
-       adds r21=PT(PR)+16,r12
-       ;;
- 
-@@ -828,17 +881,20 @@
-       ld8 r28=[r2],8          // load b6
-       adds r29=PT(R24)+16,r12
- 
--      ld8.fill r16=[r3],PT(AR_CSD)-PT(R16)
-+      ld8.fill r16=[r3]
-       adds r30=PT(AR_CCV)+16,r12
- (p6)  and r19=TIF_WORK_MASK,r31               // any work other than 
TIF_SYSCALL_TRACE?
-       ;;
-+      adds r3=PT(AR_CSD)-PT(R16),r3
-       ld8.fill r24=[r29]
-       ld8 r15=[r30]           // load ar.ccv
- (p6)  cmp4.ne.unc p6,p0=r19, r0               // any special work pending?
-       ;;
-       ld8 r29=[r2],16         // load b7
-       ld8 r30=[r3],16         // load ar.csd
-+#ifndef XEN
- (p6)  br.cond.spnt .work_pending
-+#endif
-       ;;
-       ld8 r31=[r2],16         // load ar.ssd
-       ld8.fill r8=[r3],16
-@@ -934,7 +990,11 @@
-       shr.u r18=r19,16        // get byte size of existing "dirty" partition
-       ;;
-       mov r16=ar.bsp          // get existing backing store pointer
-+#ifdef XEN
-+      movl r17=THIS_CPU(ia64_phys_stacked_size_p8)
-+#else
-       addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0
-+#endif
-       ;;
-       ld4 r17=[r17]           // r17 = cpu_data->phys_stacked_size_p8
- (pKStk)       br.cond.dpnt skip_rbs_switch
-@@ -1069,6 +1129,7 @@
-       mov pr=r31,-1           // I0
-       rfi                     // B
- 
-+#ifndef XEN
-       /*
-        * On entry:
-        *      r20 = &current->thread_info->pre_count (if CONFIG_PREEMPT)
-@@ -1130,6 +1191,7 @@
-       ld8 r8=[r2]
-       ld8 r10=[r3]
-       br.cond.sptk.many .work_processed_syscall       // re-check
-+#endif
- 
- END(ia64_leave_kernel)
- 
-@@ -1166,6 +1228,7 @@
-       br.ret.sptk.many rp
- END(ia64_invoke_schedule_tail)
- 
-+#ifndef XEN
-       /*
-        * Setup stack and call do_notify_resume_user().  Note that pSys and 
pNonSys need to
-        * be set up by the caller.  We declare 8 input registers so the system 
call
-@@ -1264,6 +1327,7 @@
-       mov ar.unat=r9
-       br.many b7
- END(sys_rt_sigreturn)
-+#endif
- 
- GLOBAL_ENTRY(ia64_prepare_handle_unaligned)
-       .prologue
-@@ -1278,6 +1342,7 @@
-       br.cond.sptk.many rp                            // goes to 
ia64_leave_kernel
- END(ia64_prepare_handle_unaligned)
- 
-+#ifndef XEN
-       //
-       // unw_init_running(void (*callback)(info, arg), void *arg)
-       //
-@@ -1585,3 +1650,4 @@
-       data8 sys_ni_syscall
- 
-       .org sys_call_table + 8*NR_syscalls     // guard against failures to 
increase NR_syscalls
-+#endif
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/entry.h
--- a/xen/arch/ia64/patch/linux-2.6.11/entry.h  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,37 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/test3.bk/xen/../../linux-2.6.11/arch/ia64/kernel/entry.h
     2005-03-01 23:38:07.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/test3.bk/xen/arch/ia64/entry.h       
2005-05-18 14:00:53.000000000 -0700
-@@ -7,6 +7,12 @@
- #define PRED_LEAVE_SYSCALL    1 /* TRUE iff leave from syscall */
- #define PRED_KERNEL_STACK     2 /* returning to kernel-stacks? */
- #define PRED_USER_STACK               3 /* returning to user-stacks? */
-+#ifdef CONFIG_VTI
-+#define PRED_EMUL             2 /* Need to save r4-r7 for inst emulation */
-+#define PRED_NON_EMUL         3 /* No need to save r4-r7 for normal path */
-+#define PRED_BN0              6 /* Guest is in bank 0 */
-+#define PRED_BN1              7 /* Guest is in bank 1 */
-+#endif // CONFIG_VTI
- #define PRED_SYSCALL          4 /* inside a system call? */
- #define PRED_NON_SYSCALL      5 /* complement of PRED_SYSCALL */
- 
-@@ -17,12 +23,21 @@
- # define pLvSys               PASTE(p,PRED_LEAVE_SYSCALL)
- # define pKStk                PASTE(p,PRED_KERNEL_STACK)
- # define pUStk                PASTE(p,PRED_USER_STACK)
-+#ifdef CONFIG_VTI
-+# define pEml         PASTE(p,PRED_EMUL)
-+# define pNonEml      PASTE(p,PRED_NON_EMUL)
-+# define pBN0         PASTE(p,PRED_BN0)
-+# define pBN1         PASTE(p,PRED_BN1)
-+#endif // CONFIG_VTI
- # define pSys         PASTE(p,PRED_SYSCALL)
- # define pNonSys      PASTE(p,PRED_NON_SYSCALL)
- #endif
- 
- #define PT(f)         (IA64_PT_REGS_##f##_OFFSET)
- #define SW(f)         (IA64_SWITCH_STACK_##f##_OFFSET)
-+#ifdef CONFIG_VTI
-+#define VPD(f)      (VPD_##f##_START_OFFSET)
-+#endif // CONFIG_VTI
- 
- #define PT_REGS_SAVES(off)                    \
-       .unwabi 3, 'i';                         \
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.11/gcc_intrin.h
--- a/xen/arch/ia64/patch/linux-2.6.11/gcc_intrin.h     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,69 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/test3.bk/xen/../../linux-2.6.11/include/asm-ia64/gcc_intrin.h
        2005-03-01 23:38:08.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/test3.bk/xen/include/asm-ia64/gcc_intrin.h   
2005-05-18 14:00:53.000000000 -0700
-@@ -368,6 +368,66 @@
- #define ia64_mf()     asm volatile ("mf" ::: "memory")
- #define ia64_mfa()    asm volatile ("mf.a" ::: "memory")
- 
-+#ifdef CONFIG_VTI
-+/*
-+ * Flushrs instruction stream.
-+ */
-+#define ia64_flushrs() asm volatile ("flushrs;;":::"memory")
-+
-+#define ia64_loadrs() asm volatile ("loadrs;;":::"memory")
-+
-+#define ia64_get_rsc()                          \
-+({                                  \
-+    unsigned long val;                     \
-+    asm volatile ("mov %0=ar.rsc;;" : "=r"(val) :: "memory");  \
-+    val;                               \
-+})
-+
-+#define ia64_set_rsc(val)                       \
-+    asm volatile ("mov ar.rsc=%0;;" :: "r"(val) : "memory")
-+
-+#define ia64_get_bspstore()     \
-+({                                  \
-+    unsigned long val;                     \
-+    asm volatile ("mov %0=ar.bspstore;;" : "=r"(val) :: "memory");  \
-+    val;                               \
-+})
-+
-+#define ia64_set_bspstore(val)                       \
-+    asm volatile ("mov ar.bspstore=%0;;" :: "r"(val) : "memory")
-+
-+#define ia64_get_rnat()     \
-+({                                  \
-+    unsigned long val;                     \
-+    asm volatile ("mov %0=ar.rnat;" : "=r"(val) :: "memory");  \
-+    val;                               \
-+})
-+
-+#define ia64_set_rnat(val)                       \
-+    asm volatile ("mov ar.rnat=%0;;" :: "r"(val) : "memory")
-+
-+#define ia64_ttag(addr)                                                       
\
-+({                                                                            
\
-+      __u64 ia64_intri_res;                                                   
\
-+      asm volatile ("ttag %0=%1" : "=r"(ia64_intri_res) : "r" (addr));        
\
-+      ia64_intri_res;                                                         
\
-+})
-+
-+#define ia64_get_dcr()                          \
-+({                                      \
-+    __u64 result;                               \
-+    asm volatile ("mov %0=cr.dcr" : "=r"(result) : );           \
-+    result;                                 \
-+})
-+
-+#define ia64_set_dcr(val)                           \
-+({                                      \
-+    asm volatile ("mov cr.dcr=%0" :: "r"(val) );            \
-+})
-+
-+#endif // CONFIG_VTI
-+
-+
- #define ia64_invala() asm volatile ("invala" ::: "memory")
- 
- #define ia64_thash(addr)                                                      
\
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/hardirq.h
--- a/xen/arch/ia64/patch/linux-2.6.11/hardirq.h        Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,14 +0,0 @@
---- ../../linux-2.6.11/include/linux/hardirq.h 2005-03-02 00:38:00.000000000 
-0700
-+++ include/asm-ia64/linux/hardirq.h   2005-04-28 16:34:39.000000000 -0600
-@@ -60,7 +60,11 @@
-  */
- #define in_irq()              (hardirq_count())
- #define in_softirq()          (softirq_count())
-+#ifndef XEN
- #define in_interrupt()                (irq_count())
-+#else
-+#define in_interrupt()                0               // FIXME LATER
-+#endif
- 
- #if defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_BKL)
- # define in_atomic()  ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/head.S
--- a/xen/arch/ia64/patch/linux-2.6.11/head.S   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,120 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/kernel/head.S
       2005-03-01 23:38:13.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/arch/ia64/head.S 
2005-05-18 12:40:50.000000000 -0700
-@@ -76,21 +76,21 @@
-        * We initialize all of them to prevent inadvertently assuming
-        * something about the state of address translation early in boot.
-        */
--      mov r6=((ia64_rid(IA64_REGION_ID_KERNEL, (0<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-+      movl r6=((ia64_rid(IA64_REGION_ID_KERNEL, (0<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-       movl r7=(0<<61)
--      mov r8=((ia64_rid(IA64_REGION_ID_KERNEL, (1<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-+      movl r8=((ia64_rid(IA64_REGION_ID_KERNEL, (1<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-       movl r9=(1<<61)
--      mov r10=((ia64_rid(IA64_REGION_ID_KERNEL, (2<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-+      movl r10=((ia64_rid(IA64_REGION_ID_KERNEL, (2<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-       movl r11=(2<<61)
--      mov r12=((ia64_rid(IA64_REGION_ID_KERNEL, (3<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-+      movl r12=((ia64_rid(IA64_REGION_ID_KERNEL, (3<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-       movl r13=(3<<61)
--      mov r14=((ia64_rid(IA64_REGION_ID_KERNEL, (4<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-+      movl r14=((ia64_rid(IA64_REGION_ID_KERNEL, (4<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-       movl r15=(4<<61)
--      mov r16=((ia64_rid(IA64_REGION_ID_KERNEL, (5<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-+      movl r16=((ia64_rid(IA64_REGION_ID_KERNEL, (5<<61)) << 8) | (PAGE_SHIFT 
<< 2) | 1)
-       movl r17=(5<<61)
--      mov r18=((ia64_rid(IA64_REGION_ID_KERNEL, (6<<61)) << 8) | 
(IA64_GRANULE_SHIFT << 2))
-+      movl r18=((ia64_rid(IA64_REGION_ID_KERNEL, (6<<61)) << 8) | 
(IA64_GRANULE_SHIFT << 2))
-       movl r19=(6<<61)
--      mov r20=((ia64_rid(IA64_REGION_ID_KERNEL, (7<<61)) << 8) | 
(IA64_GRANULE_SHIFT << 2))
-+      movl r20=((ia64_rid(IA64_REGION_ID_KERNEL, (7<<61)) << 8) | 
(IA64_GRANULE_SHIFT << 2))
-       movl r21=(7<<61)
-       ;;
-       mov rr[r7]=r6
-@@ -129,8 +129,13 @@
-       /*
-        * Switch into virtual mode:
-        */
-+#ifdef CONFIG_VTI
-+      movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH \
-+                |IA64_PSR_DI)
-+#else // CONFIG_VTI
-       movl 
r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN \
-                 |IA64_PSR_DI)
-+#endif // CONFIG_VTI
-       ;;
-       mov cr.ipsr=r16
-       movl r17=1f
-@@ -143,7 +148,11 @@
- 1:    // now we are in virtual mode
- 
-       // set IVT entry point---can't access I/O ports without it
-+#ifdef CONFIG_VTI
-+    movl r3=vmx_ia64_ivt
-+#else // CONFIG_VTI
-       movl r3=ia64_ivt
-+#endif // CONFIG_VTI
-       ;;
-       mov cr.iva=r3
-       movl r2=FPSR_DEFAULT
-@@ -187,7 +196,11 @@
-       dep r18=0,r3,0,12
-       ;;
-       or r18=r17,r18
-+#ifdef XEN
-+      dep r2=-1,r3,60,4       // IMVA of task
-+#else
-       dep r2=-1,r3,61,3       // IMVA of task
-+#endif
-       ;;
-       mov r17=rr[r2]
-       shr.u r16=r3,IA64_GRANULE_SHIFT
-@@ -207,8 +220,15 @@
- 
- .load_current:
-       // load the "current" pointer (r13) and ar.k6 with the current task
-+#ifdef CONFIG_VTI
-+      mov r21=r2              // virtual address
-+      ;;
-+      bsw.1
-+      ;;
-+#else // CONFIG_VTI
-       mov IA64_KR(CURRENT)=r2         // virtual address
-       mov IA64_KR(CURRENT_STACK)=r16
-+#endif // CONFIG_VTI
-       mov r13=r2
-       /*
-        * Reserve space at the top of the stack for "struct pt_regs".  Kernel 
threads
-@@ -227,7 +247,11 @@
-       ;;
-       mov ar.rsc=0x3          // place RSE in eager mode
- 
-+#ifdef XEN
-+(isBP)        dep r28=-1,r28,60,4     // make address virtual
-+#else
- (isBP)        dep r28=-1,r28,61,3     // make address virtual
-+#endif
- (isBP)        movl r2=ia64_boot_param
-       ;;
- (isBP)        st8 [r2]=r28            // save the address of the boot param 
area passed by the bootloader
-@@ -254,7 +278,9 @@
-       br.call.sptk.many b0=console_print
- 
- self: hint @pause
-+      ;;
-       br.sptk.many self               // endless loop
-+      ;;
- END(_start)
- 
- GLOBAL_ENTRY(ia64_save_debug_regs)
-@@ -850,7 +876,11 @@
-  * intermediate precision so that we can produce a full 64-bit result.
-  */
- GLOBAL_ENTRY(sched_clock)
-+#ifdef XEN
-+      movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET
-+#else
-       addl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
-+#endif
-       mov.m r9=ar.itc         // fetch cycle-counter                          
(35 cyc)
-       ;;
-       ldf8 f8=[r8]
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.11/hpsim_ssc.h
--- a/xen/arch/ia64/patch/linux-2.6.11/hpsim_ssc.h      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,26 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/hp/sim/hpsim_ssc.h
  2005-03-01 23:38:17.000000000 -0800
-+++ 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/include/asm-ia64/hpsim_ssc.h
     2005-05-18 12:40:19.000000000 -0700
-@@ -33,4 +33,23 @@
-  */
- extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr);
- 
-+#ifdef XEN
-+/* Note: These are declared in linux/arch/ia64/hp/sim/simscsi.c but belong
-+ * in linux/include/asm-ia64/hpsim_ssc.h, hence their addition here */
-+#define SSC_OPEN                      50
-+#define SSC_CLOSE                     51
-+#define SSC_READ                      52
-+#define SSC_WRITE                     53
-+#define SSC_GET_COMPLETION            54
-+#define SSC_WAIT_COMPLETION           55
-+
-+#define SSC_WRITE_ACCESS              2
-+#define SSC_READ_ACCESS                       1
-+
-+struct ssc_disk_req {
-+      unsigned long addr;
-+      unsigned long len;
-+};
-+#endif
-+
- #endif /* _IA64_PLATFORM_HPSIM_SSC_H */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/ia64regs.h
--- a/xen/arch/ia64/patch/linux-2.6.11/ia64regs.h       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,38 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/test3.bk/xen/../../linux-2.6.11/include/asm-ia64/ia64regs.h
  2005-03-01 23:38:07.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/test3.bk/xen/include/asm-ia64/ia64regs.h     
2005-05-18 14:00:53.000000000 -0700
-@@ -87,6 +87,35 @@
- #define _IA64_REG_CR_LRR0     4176
- #define _IA64_REG_CR_LRR1     4177
- 
-+#ifdef  CONFIG_VTI
-+#define IA64_REG_CR_DCR   0
-+#define IA64_REG_CR_ITM   1
-+#define IA64_REG_CR_IVA   2
-+#define IA64_REG_CR_PTA   8
-+#define IA64_REG_CR_IPSR  16
-+#define IA64_REG_CR_ISR   17
-+#define IA64_REG_CR_IIP   19
-+#define IA64_REG_CR_IFA   20
-+#define IA64_REG_CR_ITIR  21
-+#define IA64_REG_CR_IIPA  22
-+#define IA64_REG_CR_IFS   23
-+#define IA64_REG_CR_IIM   24
-+#define IA64_REG_CR_IHA   25
-+#define IA64_REG_CR_LID   64
-+#define IA64_REG_CR_IVR   65
-+#define IA64_REG_CR_TPR   66
-+#define IA64_REG_CR_EOI   67
-+#define IA64_REG_CR_IRR0  68
-+#define IA64_REG_CR_IRR1  69
-+#define IA64_REG_CR_IRR2  70
-+#define IA64_REG_CR_IRR3  71
-+#define IA64_REG_CR_ITV   72
-+#define IA64_REG_CR_PMV   73
-+#define IA64_REG_CR_CMCV  74
-+#define IA64_REG_CR_LRR0  80
-+#define IA64_REG_CR_LRR1  81
-+#endif  //  CONFIG_VTI
-+
- /* Indirect Registers for getindreg() and setindreg() */
- 
- #define _IA64_REG_INDR_CPUID  9000    /* getindreg only */
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.11/interrupt.h
--- a/xen/arch/ia64/patch/linux-2.6.11/interrupt.h      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,27 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/include/linux/interrupt.h
     2005-03-01 23:38:09.000000000 -0800
-+++ 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/include/asm-ia64/linux/interrupt.h
       2005-05-18 12:40:50.000000000 -0700
-@@ -33,6 +33,7 @@
- #define IRQ_HANDLED   (1)
- #define IRQ_RETVAL(x) ((x) != 0)
- 
-+#ifndef XEN
- struct irqaction {
-       irqreturn_t (*handler)(int, void *, struct pt_regs *);
-       unsigned long flags;
-@@ -49,6 +50,7 @@
-                      irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                      unsigned long, const char *, void *);
- extern void free_irq(unsigned int, void *);
-+#endif
- 
- 
- #ifdef CONFIG_GENERIC_HARDIRQS
-@@ -121,7 +123,7 @@
- };
- 
- asmlinkage void do_softirq(void);
--extern void open_softirq(int nr, void (*action)(struct softirq_action*), void 
*data);
-+//extern void open_softirq(int nr, void (*action)(struct softirq_action*), 
void *data);
- extern void softirq_init(void);
- #define __raise_softirq_irqoff(nr) do { local_softirq_pending() |= 1UL << 
(nr); } while (0)
- extern void FASTCALL(raise_softirq_irqoff(unsigned int nr));
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/io.h
--- a/xen/arch/ia64/patch/linux-2.6.11/io.h     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,14 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/include/asm-ia64/io.h
 2005-03-01 23:38:34.000000000 -0800
-+++ 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/include/asm-ia64/io.h 
   2005-05-18 12:40:50.000000000 -0700
-@@ -23,7 +23,11 @@
- #define __SLOW_DOWN_IO        do { } while (0)
- #define SLOW_DOWN_IO  do { } while (0)
- 
-+#ifdef XEN
-+#define __IA64_UNCACHED_OFFSET        0xe800000000000000UL
-+#else
- #define __IA64_UNCACHED_OFFSET        0xc000000000000000UL    /* region 6 */
-+#endif
- 
- /*
-  * The legacy I/O space defined by the ia64 architecture supports only 65536 
ports, but
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c
--- a/xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,126 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/kernel/irq_ia64.c
   2005-03-01 23:38:07.000000000 -0800
-+++ 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/arch/ia64/irq_ia64.c  
   2005-05-18 12:40:51.000000000 -0700
-@@ -106,6 +106,9 @@
-       unsigned long saved_tpr;
- 
- #if IRQ_DEBUG
-+#ifdef XEN
-+      xen_debug_irq(vector, regs);
-+#endif
-       {
-               unsigned long bsp, sp;
- 
-@@ -148,6 +151,9 @@
-                       ia64_setreg(_IA64_REG_CR_TPR, vector);
-                       ia64_srlz_d();
- 
-+#ifdef XEN
-+                      if (!xen_do_IRQ(vector))
-+#endif
-                       __do_IRQ(local_vector_to_irq(vector), regs);
- 
-                       /*
-@@ -167,6 +173,103 @@
-       irq_exit();
- }
- 
-+#ifdef  CONFIG_VTI
-+#define vmx_irq_enter()               \
-+      add_preempt_count(HARDIRQ_OFFSET);
-+
-+/* Now softirq will be checked when leaving hypervisor, or else
-+ * scheduler irq will be executed too early.
-+ */
-+#define vmx_irq_exit(void)    \
-+      sub_preempt_count(HARDIRQ_OFFSET);
-+/*
-+ * That's where the IVT branches when we get an external
-+ * interrupt. This branches to the correct hardware IRQ handler via
-+ * function ptr.
-+ */
-+void
-+vmx_ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
-+{
-+      unsigned long saved_tpr;
-+      int     wake_dom0 = 0;
-+
-+
-+#if IRQ_DEBUG
-+      {
-+              unsigned long bsp, sp;
-+
-+              /*
-+               * Note: if the interrupt happened while executing in
-+               * the context switch routine (ia64_switch_to), we may
-+               * get a spurious stack overflow here.  This is
-+               * because the register and the memory stack are not
-+               * switched atomically.
-+               */
-+              bsp = ia64_getreg(_IA64_REG_AR_BSP);
-+              sp = ia64_getreg(_IA64_REG_AR_SP);
-+
-+              if ((sp - bsp) < 1024) {
-+                      static unsigned char count;
-+                      static long last_time;
-+
-+                      if (jiffies - last_time > 5*HZ)
-+                              count = 0;
-+                      if (++count < 5) {
-+                              last_time = jiffies;
-+                              printk("ia64_handle_irq: DANGER: less than "
-+                                     "1KB of free stack space!!\n"
-+                                     "(bsp=0x%lx, sp=%lx)\n", bsp, sp);
-+                      }
-+              }
-+      }
-+#endif /* IRQ_DEBUG */
-+
-+      /*
-+       * Always set TPR to limit maximum interrupt nesting depth to
-+       * 16 (without this, it would be ~240, which could easily lead
-+       * to kernel stack overflows).
-+       */
-+      vmx_irq_enter();
-+      saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
-+      ia64_srlz_d();
-+      while (vector != IA64_SPURIOUS_INT_VECTOR) {
-+          if (!IS_RESCHEDULE(vector)) {
-+              ia64_setreg(_IA64_REG_CR_TPR, vector);
-+              ia64_srlz_d();
-+
-+              if (vector != IA64_TIMER_VECTOR) {
-+                      /* FIXME: Leave IRQ re-route later */
-+                      vmx_vcpu_pend_interrupt(dom0->vcpu[0],vector);
-+                      wake_dom0 = 1;
-+              }
-+              else {  // FIXME: Handle Timer only now
-+                      __do_IRQ(local_vector_to_irq(vector), regs);
-+              }
-+              
-+              /*
-+               * Disable interrupts and send EOI:
-+               */
-+              local_irq_disable();
-+              ia64_setreg(_IA64_REG_CR_TPR, saved_tpr);
-+          }
-+          else {
-+                printf("Oops: RESCHEDULE IPI absorbed by HV\n");
-+            }
-+          ia64_eoi();
-+          vector = ia64_get_ivr();
-+      }
-+      /*
-+       * This must be done *after* the ia64_eoi().  For example, the keyboard 
softirq
-+       * handler needs to be able to wait for further keyboard interrupts, 
which can't
-+       * come through until ia64_eoi() has been done.
-+       */
-+      vmx_irq_exit();
-+      if ( wake_dom0 && current != dom0 ) 
-+              vcpu_wake(dom0->vcpu[0]);
-+}
-+#endif
-+
-+
- #ifdef CONFIG_HOTPLUG_CPU
- /*
-  * This function emulates a interrupt processing when a cpu is about to be
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/kregs.h
--- a/xen/arch/ia64/patch/linux-2.6.11/kregs.h  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,66 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/include/asm-ia64/kregs.h
      2005-03-01 23:37:49.000000000 -0800
-+++ 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/include/asm-ia64/kregs.h
 2005-05-18 12:40:50.000000000 -0700
-@@ -29,8 +29,21 @@
-  */
- #define IA64_TR_KERNEL                0       /* itr0, dtr0: maps kernel 
image (code & data) */
- #define IA64_TR_PALCODE               1       /* itr1: maps PALcode as 
required by EFI */
-+#ifdef CONFIG_VTI
-+#define IA64_TR_XEN_IN_DOM    6       /* itr6, dtr6: Double mapping for xen 
image in domain space */
-+#endif // CONFIG_VTI
- #define IA64_TR_PERCPU_DATA   1       /* dtr1: percpu data */
- #define IA64_TR_CURRENT_STACK 2       /* dtr2: maps kernel's memory- & 
register-stacks */
-+#ifdef XEN
-+#define IA64_TR_SHARED_INFO   3       /* dtr3: page shared with domain */
-+#define       IA64_TR_VHPT            4       /* dtr4: vhpt */
-+#define IA64_TR_ARCH_INFO      5
-+#ifdef CONFIG_VTI
-+#define IA64_TR_VHPT_IN_DOM   5       /* dtr5: Double mapping for vhpt table 
in domain space */
-+#define IA64_TR_RR7_SWITCH_STUB       7       /* dtr7: mapping for rr7 switch 
stub */
-+#define IA64_TEMP_PHYSICAL    8       /* itr8, dtr8: temp mapping for guest 
physical memory 256M */
-+#endif // CONFIG_VTI
-+#endif
- 
- /* Processor status register bits: */
- #define IA64_PSR_BE_BIT               1
-@@ -66,6 +78,9 @@
- #define IA64_PSR_ED_BIT               43
- #define IA64_PSR_BN_BIT               44
- #define IA64_PSR_IA_BIT               45
-+#ifdef CONFIG_VTI
-+#define IA64_PSR_VM_BIT               46
-+#endif // CONFIG_VTI
- 
- /* A mask of PSR bits that we generally don't want to inherit across a 
clone2() or an
-    execve().  Only list flags here that need to be cleared/set for BOTH 
clone2() and
-@@ -107,6 +122,9 @@
- #define IA64_PSR_ED   (__IA64_UL(1) << IA64_PSR_ED_BIT)
- #define IA64_PSR_BN   (__IA64_UL(1) << IA64_PSR_BN_BIT)
- #define IA64_PSR_IA   (__IA64_UL(1) << IA64_PSR_IA_BIT)
-+#ifdef CONFIG_VTI
-+#define IA64_PSR_VM   (__IA64_UL(1) << IA64_PSR_VM_BIT)
-+#endif // CONFIG_VTI
- 
- /* User mask bits: */
- #define IA64_PSR_UM   (IA64_PSR_BE | IA64_PSR_UP | IA64_PSR_AC | IA64_PSR_MFL 
| IA64_PSR_MFH)
-@@ -160,4 +178,21 @@
- #define IA64_ISR_CODE_LFETCH  4
- #define IA64_ISR_CODE_PROBEF  5
- 
-+#ifdef XEN
-+/* Interruption Function State */
-+#define IA64_IFS_V_BIT                63
-+#define IA64_IFS_V    (__IA64_UL(1) << IA64_IFS_V_BIT)
-+
-+/* Page Table Address */
-+#define IA64_PTA_VE_BIT 0
-+#define IA64_PTA_SIZE_BIT 2
-+#define IA64_PTA_VF_BIT 8
-+#define IA64_PTA_BASE_BIT 15
-+
-+#define IA64_PTA_VE     (__IA64_UL(1) << IA64_PTA_VE_BIT)
-+#define IA64_PTA_SIZE   (__IA64_UL(0x3f) << IA64_PTA_SIZE_BIT)
-+#define IA64_PTA_VF     (__IA64_UL(1) << IA64_PTA_VF_BIT)
-+#define IA64_PTA_BASE   (__IA64_UL(0) - ((__IA64_UL(1) << IA64_PTA_BASE_BIT)))
-+#endif
-+
- #endif /* _ASM_IA64_kREGS_H */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/mca_asm.h
--- a/xen/arch/ia64/patch/linux-2.6.11/mca_asm.h        Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,32 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/include/asm-ia64/mca_asm.h
    2005-03-01 23:38:38.000000000 -0800
-+++ 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/include/asm-ia64/mca_asm.h
       2005-05-18 12:40:19.000000000 -0700
-@@ -26,8 +26,13 @@
-  * direct mapped to physical addresses.
-  *    1. Lop off bits 61 thru 63 in the virtual address
-  */
-+#ifdef XEN
-+#define INST_VA_TO_PA(addr)                                                   
\
-+      dep     addr    = 0, addr, 60, 4
-+#else // XEN
- #define INST_VA_TO_PA(addr)                                                   
\
-       dep     addr    = 0, addr, 61, 3
-+#endif // XEN
- /*
-  * This macro converts a data virtual address to a physical address
-  * Right now for simulation purposes the virtual addresses are
-@@ -42,9 +47,15 @@
-  * direct mapped to physical addresses.
-  *    1. Put 0x7 in bits 61 thru 63.
-  */
-+#ifdef XEN
-+#define DATA_PA_TO_VA(addr,temp)                                              
        \
-+      mov     temp    = 0xf   ;;                                              
        \
-+      dep     addr    = temp, addr, 60, 4
-+#else // XEN
- #define DATA_PA_TO_VA(addr,temp)                                              
        \
-       mov     temp    = 0x7   ;;                                              
        \
-       dep     addr    = temp, addr, 61, 3
-+#endif // XEN
- 
- #define GET_THIS_PADDR(reg, var)              \
-       mov     reg = IA64_KR(PER_CPU_DATA);;   \
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/minstate.h
--- a/xen/arch/ia64/patch/linux-2.6.11/minstate.h       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,25 +0,0 @@
- minstate.h |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-Index: linux-2.6.11-xendiffs/arch/ia64/kernel/minstate.h
-===================================================================
---- linux-2.6.11-xendiffs.orig/arch/ia64/kernel/minstate.h     2005-04-06 
22:51:31.170261541 -0500
-+++ linux-2.6.11-xendiffs/arch/ia64/kernel/minstate.h  2005-04-06 
22:54:03.210575034 -0500
-@@ -48,7 +48,7 @@
- (pUStk)       mov r24=ar.rnat;                                                
                        \
- (pUStk)       addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1;   /* compute base 
of memory stack */      \
- (pUStk)       mov r23=ar.bspstore;                            /* save 
ar.bspstore */                  \
--(pUStk)       dep r22=-1,r22,61,3;                    /* compute kernel 
virtual addr of RBS */        \
-+(pUStk)       dep r22=-1,r22,60,4;                    /* compute kernel 
virtual addr of RBS */        \
-       ;;                                                                      
                \
- (pKStk) addl r1=-IA64_PT_REGS_SIZE,r1;                /* if in kernel mode, 
use sp (r12) */           \
- (pUStk)       mov ar.bspstore=r22;                    /* switch to kernel RBS 
*/                      \
-@@ -57,7 +57,7 @@
- (pUStk)       mov ar.rsc=0x3;         /* set eager mode, pl 0, little-endian, 
loadrs=0 */             \
- 
- #define MINSTATE_END_SAVE_MIN_PHYS                                            
                \
--      dep r12=-1,r12,61,3;            /* make sp a kernel virtual address */  
                \
-+      dep r12=-1,r12,60,4;            /* make sp a kernel virtual address */  
                \
-       ;;
- 
- #ifdef MINSTATE_VIRT
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.11/mm_contig.c
--- a/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,47 +0,0 @@
---- ../../linux-2.6.11/arch/ia64/mm/contig.c   2005-03-02 00:37:55.000000000 
-0700
-+++ arch/ia64/mm_contig.c      2005-04-28 16:13:52.000000000 -0600
-@@ -35,6 +35,7 @@
-  *
-  * Just walks the pages in the system and describes where they're allocated.
-  */
-+#ifndef XEN
- void
- show_mem (void)
- {
-@@ -63,6 +64,7 @@
-       printk("%d pages swap cached\n", cached);
-       printk("%ld pages in page table cache\n", pgtable_cache_size);
- }
-+#endif
- 
- /* physical address where the bootmem map is located */
- unsigned long bootmap_start;
-@@ -140,6 +142,7 @@
-  * Walk the EFI memory map and find usable memory for the system, taking
-  * into account reserved areas.
-  */
-+#ifndef XEN
- void
- find_memory (void)
- {
-@@ -168,6 +171,7 @@
- 
-       find_initrd();
- }
-+#endif
- 
- #ifdef CONFIG_SMP
- /**
-@@ -225,6 +229,7 @@
-  * Set up the page tables.
-  */
- 
-+#ifndef XEN
- void
- paging_init (void)
- {
-@@ -297,3 +302,4 @@
- #endif /* !CONFIG_VIRTUAL_MEM_MAP */
-       zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
- }
-+#endif /* !CONFIG_XEN */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/page.h
--- a/xen/arch/ia64/patch/linux-2.6.11/page.h   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,74 +0,0 @@
---- 
/home/adsharma/xeno-unstable-ia64-staging.bk/xen/../../linux-2.6.11/include/asm-ia64/page.h
        2005-03-01 23:37:48.000000000 -0800
-+++ /home/adsharma/xeno-unstable-ia64-staging.bk/xen/include/asm-ia64/page.h   
2005-05-20 09:36:02.000000000 -0700
-@@ -32,6 +32,7 @@
- #define PAGE_ALIGN(addr)      (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
- 
- #define PERCPU_PAGE_SHIFT     16      /* log2() of max. size of per-CPU area 
*/
-+
- #define PERCPU_PAGE_SIZE      (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT)
- 
- #define RGN_MAP_LIMIT ((1UL << (4*PAGE_SHIFT - 12)) - PAGE_SIZE)      /* per 
region addr limit */
-@@ -95,9 +96,15 @@
- #endif
- 
- #ifndef CONFIG_DISCONTIGMEM
-+#ifdef XEN
-+# define pfn_valid(pfn)               (0)
-+# define page_to_pfn(_page)   ((unsigned long)((_page) - frame_table))
-+# define pfn_to_page(_pfn)    (frame_table + (_pfn))
-+#else
- # define pfn_valid(pfn)               (((pfn) < max_mapnr) && 
ia64_pfn_valid(pfn))
- # define page_to_pfn(page)    ((unsigned long) (page - mem_map))
- # define pfn_to_page(pfn)     (mem_map + (pfn))
-+#endif
- #else
- extern struct page *vmem_map;
- extern unsigned long max_low_pfn;
-@@ -109,6 +116,11 @@
- #define page_to_phys(page)    (page_to_pfn(page) << PAGE_SHIFT)
- #define virt_to_page(kaddr)   pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
- 
-+#ifdef XEN
-+#define page_to_virt(_page)   phys_to_virt(page_to_phys(_page))
-+#define phys_to_page(kaddr)   pfn_to_page(((kaddr) >> PAGE_SHIFT))
-+#endif
-+
- typedef union ia64_va {
-       struct {
-               unsigned long off : 61;         /* intra-region offset */
-@@ -124,8 +136,23 @@
-  * expressed in this way to ensure they result in a single "dep"
-  * instruction.
-  */
-+#ifdef XEN
-+typedef union xen_va {
-+      struct {
-+              unsigned long off : 60;
-+              unsigned long reg : 4;
-+      } f;
-+      unsigned long l;
-+      void *p;
-+} xen_va;
-+
-+// xen/drivers/console.c uses __va in a declaration (should be fixed!)
-+#define __pa(x)               ({xen_va _v; _v.l = (long) (x); _v.f.reg = 0; 
_v.l;})
-+#define __va(x)               ({xen_va _v; _v.l = (long) (x); _v.f.reg = -1; 
_v.p;})
-+#else
- #define __pa(x)               ({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; 
_v.l;})
- #define __va(x)               ({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; 
_v.p;})
-+#endif
- 
- #define REGION_NUMBER(x)      ({ia64_va _v; _v.l = (long) (x); _v.f.reg;})
- #define REGION_OFFSET(x)      ({ia64_va _v; _v.l = (long) (x); _v.f.off;})
-@@ -197,7 +224,11 @@
- # define __pgprot(x)  (x)
- #endif /* !STRICT_MM_TYPECHECKS */
- 
-+#ifdef XEN
-+#define PAGE_OFFSET                   __IA64_UL_CONST(0xf000000000000000)
-+#else
- #define PAGE_OFFSET                   __IA64_UL_CONST(0xe000000000000000)
-+#endif
- 
- #define VM_DATA_DEFAULT_FLAGS         (VM_READ | VM_WRITE |                   
                \
-                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC 
|                \
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/pal.S
--- a/xen/arch/ia64/patch/linux-2.6.11/pal.S    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,26 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/kernel/pal.S
        2005-03-01 23:38:33.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/arch/ia64/pal.S  
2005-05-18 12:40:19.000000000 -0700
-@@ -166,7 +166,11 @@
-       adds r8  = 1f-1b,r8             // calculate return address for call
-       ;;
-       mov loc4=ar.rsc                 // save RSE configuration
-+#ifdef XEN
-+      dep.z loc2=loc2,0,60            // convert pal entry point to physical
-+#else // XEN
-       dep.z loc2=loc2,0,61            // convert pal entry point to physical
-+#endif // XEN
-       tpa r8=r8                       // convert rp to physical
-       ;;
-       mov b7 = loc2                   // install target to branch reg
-@@ -225,7 +229,11 @@
-       mov loc3 = psr          // save psr
-       ;;
-       mov loc4=ar.rsc                 // save RSE configuration
-+#ifdef XEN
-+      dep.z loc2=loc2,0,60            // convert pal entry point to physical
-+#else // XEN
-       dep.z loc2=loc2,0,61            // convert pal entry point to physical
-+#endif // XEN
-       ;;
-       mov ar.rsc=0                    // put RSE in enforced lazy, LE mode
-       movl r16=PAL_PSR_BITS_TO_CLEAR
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/pal.h
--- a/xen/arch/ia64/patch/linux-2.6.11/pal.h    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,12 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/test3.bk/xen/../../linux-2.6.11/include/asm-ia64/pal.h
       2005-03-01 23:38:13.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/test3.bk/xen/include/asm-ia64/pal.h  
2005-05-18 14:00:53.000000000 -0700
-@@ -1559,6 +1559,9 @@
-       return iprv.status;
- }
- 
-+#ifdef CONFIG_VTI
-+#include <asm/vmx_pal.h>
-+#endif // CONFIG_VTI
- #endif /* __ASSEMBLY__ */
- 
- #endif /* _ASM_IA64_PAL_H */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/pgalloc.h
--- a/xen/arch/ia64/patch/linux-2.6.11/pgalloc.h        Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,76 +0,0 @@
---- ../../linux-2.6.11/include/asm-ia64/pgalloc.h      2005-03-02 
00:37:31.000000000 -0700
-+++ include/asm-ia64/pgalloc.h 2005-06-09 13:40:48.000000000 -0600
-@@ -61,7 +61,12 @@
-       pgd_t *pgd = pgd_alloc_one_fast(mm);
- 
-       if (unlikely(pgd == NULL)) {
-+#ifdef XEN
-+              pgd = (pgd_t *)alloc_xenheap_page();
-+              memset(pgd,0,PAGE_SIZE);
-+#else
-               pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
-+#endif
-       }
-       return pgd;
- }
-@@ -104,7 +109,12 @@
- static inline pmd_t*
- pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
- {
-+#ifdef XEN
-+      pmd_t *pmd = (pmd_t *)alloc_xenheap_page();
-+      memset(pmd,0,PAGE_SIZE);
-+#else
-       pmd_t *pmd = (pmd_t 
*)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
-+#endif
- 
-       return pmd;
- }
-@@ -136,7 +146,12 @@
- static inline struct page *
- pte_alloc_one (struct mm_struct *mm, unsigned long addr)
- {
-+#ifdef XEN
-+      struct page *pte = alloc_xenheap_page();
-+      memset(pte,0,PAGE_SIZE);
-+#else
-       struct page *pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
-+#endif
- 
-       return pte;
- }
-@@ -144,7 +159,12 @@
- static inline pte_t *
- pte_alloc_one_kernel (struct mm_struct *mm, unsigned long addr)
- {
-+#ifdef XEN
-+      pte_t *pte = (pte_t *)alloc_xenheap_page();
-+      memset(pte,0,PAGE_SIZE);
-+#else
-       pte_t *pte = (pte_t 
*)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
-+#endif
- 
-       return pte;
- }
-@@ -152,13 +172,21 @@
- static inline void
- pte_free (struct page *pte)
- {
-+#ifdef XEN
-+      free_xenheap_page(pte);
-+#else
-       __free_page(pte);
-+#endif
- }
- 
- static inline void
- pte_free_kernel (pte_t *pte)
- {
-+#ifdef XEN
-+      free_xenheap_page((unsigned long) pte);
-+#else
-       free_page((unsigned long) pte);
-+#endif
- }
- 
- #define __pte_free_tlb(tlb, pte)      tlb_remove_page((tlb), (pte))
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.11/processor.h
--- a/xen/arch/ia64/patch/linux-2.6.11/processor.h      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,37 +0,0 @@
---- 
/home/adsharma/xeno-unstable-ia64-staging.bk/xen/../../linux-2.6.11/include/asm-ia64/processor.h
   2005-03-01 23:37:58.000000000 -0800
-+++ 
/home/adsharma/xeno-unstable-ia64-staging.bk/xen/include/asm-ia64/processor.h   
   2005-05-20 09:36:02.000000000 -0700
-@@ -94,7 +94,11 @@
- #ifdef CONFIG_NUMA
- #include <asm/nodedata.h>
- #endif
-+#ifdef XEN
-+#include <asm/xenprocessor.h>
-+#endif
- 
-+#ifndef XEN
- /* like above but expressed as bitfields for more efficient access: */
- struct ia64_psr {
-       __u64 reserved0 : 1;
-@@ -133,6 +137,7 @@
-       __u64 bn : 1;
-       __u64 reserved4 : 19;
- };
-+#endif
- 
- /*
-  * CPU type, hardware bug flags, and per-CPU state.  Frequently used
-@@ -408,12 +413,14 @@
-  */
- 
- /* Return TRUE if task T owns the fph partition of the CPU we're running on. 
*/
-+#ifndef XEN
- #define ia64_is_local_fpu_owner(t)                                            
                \
- ({                                                                            
                \
-       struct task_struct *__ia64_islfo_task = (t);                            
                \
-       (__ia64_islfo_task->thread.last_fph_cpu == smp_processor_id()           
                \
-        && __ia64_islfo_task == (struct task_struct *) 
ia64_get_kr(IA64_KR_FPU_OWNER));        \
- })
-+#endif
- 
- /* Mark task T as owning the fph partition of the CPU we're running on. */
- #define ia64_set_local_fpu_owner(t) do {                                      
        \
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/ptrace.h
--- a/xen/arch/ia64/patch/linux-2.6.11/ptrace.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,20 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/test3.bk/xen/../../linux-2.6.11/include/asm-ia64/ptrace.h
    2005-03-01 23:38:38.000000000 -0800
-+++ /home/adsharma/disk2/xen-ia64/test3.bk/xen/include/asm-ia64/ptrace.h       
2005-05-18 14:00:53.000000000 -0700
-@@ -95,6 +95,9 @@
-  * (because the memory stack pointer MUST ALWAYS be aligned this way)
-  *
-  */
-+#ifdef XEN
-+#include <public/arch-ia64.h>
-+#else
- struct pt_regs {
-       /* The following registers are saved by SAVE_MIN: */
-       unsigned long b6;               /* scratch */
-@@ -170,6 +173,7 @@
-       struct ia64_fpreg f10;          /* scratch */
-       struct ia64_fpreg f11;          /* scratch */
- };
-+#endif
- 
- /*
-  * This structure contains the addition registers that need to
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/series
--- a/xen/arch/ia64/patch/linux-2.6.11/series   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,40 +0,0 @@
-bootmem.h
-current.h
-efi.c
-efi.h
-entry.S
-gcc_intrin.h
-hardirq.h
-head.S
-hpsim_irq.c
-hpsim_ssc.h
-hw_irq.h
-ide.h
-init_task.c
-init_task.h
-interrupt.h
-io.h
-irq.h
-irq_ia64.c
-ivt.S
-kregs.h
-lds.S
-linuxtime.h
-minstate.h
-mm_bootmem.c
-mm_contig.c
-mmzone.h
-page_alloc.c
-page.h
-processor.h
-sal.h
-setup.c
-slab.c
-slab.h
-system.h
-time.c
-kernel-time.c
-tlb.c
-types.h
-unaligned.c
-wait.h
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/setup.c
--- a/xen/arch/ia64/patch/linux-2.6.11/setup.c  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,151 +0,0 @@
---- ../../linux-2.6.11/arch/ia64/kernel/setup.c        2005-03-02 
00:37:49.000000000 -0700
-+++ arch/ia64/setup.c  2005-06-03 10:14:24.000000000 -0600
-@@ -51,6 +51,10 @@
- #include <asm/smp.h>
- #include <asm/system.h>
- #include <asm/unistd.h>
-+#ifdef CONFIG_VTI
-+#include <asm/vmx.h>
-+#endif // CONFIG_VTI
-+#include <asm/io.h>
- 
- #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
- # error "struct cpuinfo_ia64 too big!"
-@@ -127,7 +131,16 @@
-               range_end   = min(end, rsvd_region[i].start);
- 
-               if (range_start < range_end)
-+#ifdef XEN
-+              {
-+              /* init_boot_pages requires "ps, pe" */
-+                      printk("Init boot pages: 0x%lx -> 0x%lx.\n",
-+                              __pa(range_start), __pa(range_end));
-+                      (*func)(__pa(range_start), __pa(range_end), 0);
-+              }
-+#else
-                       call_pernode_memory(__pa(range_start), range_end - 
range_start, func);
-+#endif
- 
-               /* nothing more available in this segment */
-               if (range_end == end) return 0;
-@@ -185,7 +198,12 @@
-       n++;
- 
-       rsvd_region[n].start = (unsigned long) ia64_imva((void *)KERNEL_START);
-+#ifdef XEN
-+      /* Reserve xen image/bitmap/xen-heap */
-+      rsvd_region[n].end   = rsvd_region[n].start + xenheap_size;
-+#else
-       rsvd_region[n].end   = (unsigned long) ia64_imva(_end);
-+#endif
-       n++;
- 
- #ifdef CONFIG_BLK_DEV_INITRD
-@@ -299,17 +317,25 @@
- }
- 
- void __init
-+#ifdef XEN
-+early_setup_arch (char **cmdline_p)
-+#else
- setup_arch (char **cmdline_p)
-+#endif
- {
-       unw_init();
- 
-       ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) 
__end___vtop_patchlist);
- 
-       *cmdline_p = __va(ia64_boot_param->command_line);
-+#ifdef XEN
-+      efi_init();
-+#else
-       strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
- 
-       efi_init();
-       io_port_init();
-+#endif
- 
- #ifdef CONFIG_IA64_GENERIC
-       {
-@@ -336,6 +362,11 @@
-       }
- #endif
- 
-+#ifdef XEN
-+      early_cmdline_parse(cmdline_p);
-+      cmdline_parse(*cmdline_p);
-+#undef CONFIG_ACPI_BOOT
-+#endif
-       if (early_console_setup(*cmdline_p) == 0)
-               mark_bsp_online();
- 
-@@ -351,8 +382,18 @@
- # endif
- #endif /* CONFIG_APCI_BOOT */
- 
-+#ifndef XEN
-       find_memory();
-+#else
-+      io_port_init();
-+}
- 
-+void __init
-+late_setup_arch (char **cmdline_p)
-+{
-+#undef CONFIG_ACPI_BOOT
-+      acpi_table_init();
-+#endif
-       /* process SAL system table: */
-       ia64_sal_init(efi.sal_systab);
- 
-@@ -360,6 +401,10 @@
-       cpu_physical_id(0) = hard_smp_processor_id();
- #endif
- 
-+#ifdef CONFIG_VTI
-+      identify_vmx_feature();
-+#endif // CONFIG_VTI
-+
-       cpu_init();     /* initialize the bootstrap CPU */
- 
- #ifdef CONFIG_ACPI_BOOT
-@@ -492,12 +537,14 @@
- {
- }
- 
-+#ifndef XEN
- struct seq_operations cpuinfo_op = {
-       .start =        c_start,
-       .next =         c_next,
-       .stop =         c_stop,
-       .show =         show_cpuinfo
- };
-+#endif
- 
- void
- identify_cpu (struct cpuinfo_ia64 *c)
-@@ -551,6 +598,12 @@
-       }
-       c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1));
-       c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1));
-+
-+#ifdef CONFIG_VTI
-+      /* If vmx feature is on, do necessary initialization for vmx */
-+      if (vmx_enabled)
-+              vmx_init_env();
-+#endif
- }
- 
- void
-@@ -659,7 +712,11 @@
-                                       | IA64_DCR_DA | IA64_DCR_DD | 
IA64_DCR_LC));
-       atomic_inc(&init_mm.mm_count);
-       current->active_mm = &init_mm;
-+#ifdef XEN
-+      if (current->domain->arch.mm)
-+#else
-       if (current->mm)
-+#endif
-               BUG();
- 
-       ia64_mmu_init(ia64_imva(cpu_data));
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/sn_sal.h
--- a/xen/arch/ia64/patch/linux-2.6.11/sn_sal.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,33 +0,0 @@
---- /data/lwork/attica1/edwardsg/linux-2.6.11/include/asm-ia64/sn/sn_sal.h     
2005-03-02 01:38:33 -06:00
-+++ include/asm-ia64/sn/sn_sal.h       2005-06-01 14:31:47 -05:00
-@@ -123,6 +123,7 @@
- #define SALRET_ERROR          (-3)
-
-
-+#ifndef XEN
- /**
-  * sn_sal_rev_major - get the major SGI SAL revision number
-  *
-@@ -226,6 +227,7 @@ ia64_sn_get_klconfig_addr(nasid_t nasid)
-       }
-       return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL;
- }
-+#endif /* !XEN */
-
- /*
-  * Returns the next console character.
-@@ -304,6 +306,7 @@ ia64_sn_console_putb(const char *buf, in
-       return (u64)0;
- }
-
-+#ifndef XEN
- /*
-  * Print a platform error record
-  */
-@@ -987,5 +990,5 @@ ia64_sn_hwperf_op(nasid_t nasid, u64 opc
-               *v0 = (int) rv.v0;
-       return (int) rv.status;
- }
--
-+#endif /* !XEN */
- #endif /* _ASM_IA64_SN_SN_SAL_H */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/system.h
--- a/xen/arch/ia64/patch/linux-2.6.11/system.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,38 +0,0 @@
---- 
/home/adsharma/xeno-unstable-ia64-staging.bk/xen/../../linux-2.6.11/include/asm-ia64/system.h
      2005-03-01 23:38:07.000000000 -0800
-+++ /home/adsharma/xeno-unstable-ia64-staging.bk/xen/include/asm-ia64/system.h 
2005-05-20 09:36:02.000000000 -0700
-@@ -18,14 +18,19 @@
- #include <asm/page.h>
- #include <asm/pal.h>
- #include <asm/percpu.h>
-+#ifdef XEN
-+#include <asm/xensystem.h>
-+#endif
- 
- #define GATE_ADDR             __IA64_UL_CONST(0xa000000000000000)
- /*
-  * 0xa000000000000000+2*PERCPU_PAGE_SIZE
-  * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
-  */
-+#ifndef XEN
- #define KERNEL_START           __IA64_UL_CONST(0xa000000100000000)
- #define PERCPU_ADDR           (-PERCPU_PAGE_SIZE)
-+#endif
- 
- #ifndef __ASSEMBLY__
- 
-@@ -218,6 +223,7 @@
- # define PERFMON_IS_SYSWIDE() (0)
- #endif
- 
-+#ifndef XEN
- #define IA64_HAS_EXTRA_STATE(t)                                               
        \
-       ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID)       
\
-        || IS_IA32_PROCESS(ia64_task_regs(t)) || PERFMON_IS_SYSWIDE())
-@@ -230,6 +236,7 @@
-       ia64_psr(ia64_task_regs(next))->dfh = !ia64_is_local_fpu_owner(next);   
                 \
-       (last) = ia64_switch_to((next));                                        
                 \
- } while (0)
-+#endif 
- 
- #ifdef CONFIG_SMP
- /*
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/time.c
--- a/xen/arch/ia64/patch/linux-2.6.11/time.c   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,56 +0,0 @@
---- ../../linux-2.6.11/arch/ia64/kernel/time.c 2005-03-02 00:37:50.000000000 
-0700
-+++ arch/ia64/time.c   2005-05-02 11:19:29.000000000 -0600
-@@ -29,6 +29,9 @@
- #include <asm/sal.h>
- #include <asm/sections.h>
- #include <asm/system.h>
-+#ifdef XEN
-+#include <linux/jiffies.h>    // not included by xen/sched.h
-+#endif
- 
- extern unsigned long wall_jiffies;
- 
-@@ -45,6 +48,7 @@
- 
- #endif
- 
-+#ifndef XEN
- static struct time_interpolator itc_interpolator = {
-       .shift = 16,
-       .mask = 0xffffffffffffffffLL,
-@@ -110,6 +114,7 @@
-       } while (time_after_eq(ia64_get_itc(), new_itm));
-       return IRQ_HANDLED;
- }
-+#endif
- 
- /*
-  * Encapsulate access to the itm structure for SMP.
-@@ -212,6 +217,7 @@
-                                       + itc_freq/2)/itc_freq;
- 
-       if (!(sal_platform_features & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT)) {
-+#ifndef XEN
-               itc_interpolator.frequency = local_cpu_data->itc_freq;
-               itc_interpolator.drift = itc_drift;
- #ifdef CONFIG_SMP
-@@ -228,12 +234,14 @@
-               if (!nojitter) itc_interpolator.jitter = 1;
- #endif
-               register_time_interpolator(&itc_interpolator);
-+#endif
-       }
- 
-       /* Setup the CPU local timer tick */
-       ia64_cpu_local_tick();
- }
- 
-+#ifndef XEN
- static struct irqaction timer_irqaction = {
-       .handler =      timer_interrupt,
-       .flags =        SA_INTERRUPT,
-@@ -253,3 +261,4 @@
-        */
-       set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, 
-xtime.tv_nsec);
- }
-+#endif
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/tlb.c
--- a/xen/arch/ia64/patch/linux-2.6.11/tlb.c    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,38 +0,0 @@
---- ../../linux-2.6.11/arch/ia64/mm/tlb.c      2005-03-02 00:38:38.000000000 
-0700
-+++ arch/ia64/tlb.c    2005-05-02 10:23:09.000000000 -0600
-@@ -43,6 +43,9 @@
- void
- wrap_mmu_context (struct mm_struct *mm)
- {
-+#ifdef XEN
-+printf("wrap_mmu_context: called, not implemented\n");
-+#else
-       unsigned long tsk_context, max_ctx = ia64_ctx.max_ctx;
-       struct task_struct *tsk;
-       int i;
-@@ -83,6 +86,7 @@
-               put_cpu();
-       }
-       local_flush_tlb_all();
-+#endif
- }
- 
- void
-@@ -132,6 +136,9 @@
- void
- flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned 
long end)
- {
-+#ifdef XEN
-+printf("flush_tlb_range: called, not implemented\n");
-+#else
-       struct mm_struct *mm = vma->vm_mm;
-       unsigned long size = end - start;
-       unsigned long nbits;
-@@ -163,6 +170,7 @@
- # endif
- 
-       ia64_srlz_i();                  /* srlz.i implies srlz.d */
-+#endif
- }
- EXPORT_SYMBOL(flush_tlb_range);
- 
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/types.h
--- a/xen/arch/ia64/patch/linux-2.6.11/types.h  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,44 +0,0 @@
---- ../../linux-2.6.11/include/asm-ia64/types.h        2005-03-04 
10:26:30.000000000 -0700
-+++ include/asm-ia64/types.h   2005-04-11 15:23:49.000000000 -0600
-@@ -1,5 +1,12 @@
- #ifndef _ASM_IA64_TYPES_H
- #define _ASM_IA64_TYPES_H
-+#ifdef XEN
-+#ifndef __ASSEMBLY__
-+typedef unsigned long ssize_t;
-+typedef unsigned long size_t;
-+typedef long long loff_t;
-+#endif
-+#endif
- 
- /*
-  * This file is never included by application software unless explicitly 
requested (e.g.,
-@@ -61,6 +68,28 @@
- typedef __s64 s64;
- typedef __u64 u64;
- 
-+#ifdef XEN
-+/*
-+ * Below are truly Linux-specific types that should never collide with
-+ * any application/library that wants linux/types.h.
-+ */
-+
-+#ifdef __CHECKER__
-+#define __bitwise __attribute__((bitwise))
-+#else
-+#define __bitwise
-+#endif
-+
-+typedef __u16 __bitwise __le16;
-+typedef __u16 __bitwise __be16;
-+typedef __u32 __bitwise __le32;
-+typedef __u32 __bitwise __be32;
-+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-+typedef __u64 __bitwise __le64;
-+typedef __u64 __bitwise __be64;
-+#endif
-+#endif
-+
- #define BITS_PER_LONG 64
- 
- /* DMA addresses are 64-bits wide, in general.  */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.11/uaccess.h
--- a/xen/arch/ia64/patch/linux-2.6.11/uaccess.h        Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,41 +0,0 @@
---- ../../linux-2.6.11/include/asm-ia64/uaccess.h      2005-03-02 
00:37:53.000000000 -0700
-+++ include/asm-ia64/uaccess.h 2005-06-21 21:53:20.000000000 -0600
-@@ -32,6 +32,10 @@
-  *    David Mosberger-Tang <davidm@xxxxxxxxxx>
-  */
- 
-+#ifdef CONFIG_VTI
-+#include <asm/vmx_uaccess.h>
-+#else // CONFIG_VTI
-+
- #include <linux/compiler.h>
- #include <linux/errno.h>
- #include <linux/sched.h>
-@@ -60,6 +64,11 @@
-  * address TASK_SIZE is never valid.  We also need to make sure that the 
address doesn't
-  * point inside the virtually mapped linear page table.
-  */
-+#ifdef XEN
-+/* VT-i reserves bit 60 for the VMM; guest addresses have bit 60 = bit 59 */
-+#define IS_VMM_ADDRESS(addr) ((((addr) >> 60) ^ ((addr) >> 59)) & 1)
-+#define __access_ok(addr, size, segment) (!IS_VMM_ADDRESS((unsigned 
long)(addr)))
-+#else
- #define __access_ok(addr, size, segment)                                      
        \
- ({                                                                            
        \
-       __chk_user_ptr(addr);                                                   
        \
-@@ -67,6 +76,7 @@
-        && ((segment).seg == KERNEL_DS.seg                                     
        \
-            || likely(REGION_OFFSET((unsigned long) (addr)) < 
RGN_MAP_LIMIT)));        \
- })
-+#endif
- #define access_ok(type, addr, size)   __access_ok((addr), (size), get_fs())
- 
- static inline int
-@@ -343,6 +353,7 @@
-       __su_ret;                                               \
- })
- 
-+#endif // CONFIG_VTI
- /* Generic code can't deal with the location-relative format that we use for 
compactness.  */
- #define ARCH_HAS_SORT_EXTABLE
- #define ARCH_HAS_SEARCH_EXTABLE
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.11/unaligned.c
--- a/xen/arch/ia64/patch/linux-2.6.11/unaligned.c      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,227 +0,0 @@
---- 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/kernel/unaligned.c
  2005-03-01 23:38:25.000000000 -0800
-+++ 
/home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/arch/ia64/unaligned.c 
   2005-05-18 12:40:50.000000000 -0700
-@@ -201,7 +201,11 @@
- 
-       RPT(r1), RPT(r2), RPT(r3),
- 
-+#ifdef  CONFIG_VTI
-+      RPT(r4), RPT(r5), RPT(r6), RPT(r7),
-+#else   //CONFIG_VTI
-       RSW(r4), RSW(r5), RSW(r6), RSW(r7),
-+#endif  //CONFIG_VTI
- 
-       RPT(r8), RPT(r9), RPT(r10), RPT(r11),
-       RPT(r12), RPT(r13), RPT(r14), RPT(r15),
-@@ -291,6 +295,121 @@
-       return reg;
- }
- 
-+#ifdef CONFIG_VTI
-+static void
-+set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, 
unsigned long nat)
-+{
-+      struct switch_stack *sw = (struct switch_stack *) regs - 1;
-+      unsigned long *bsp, *bspstore, *addr, *rnat_addr, *ubs_end;
-+      unsigned long *kbs = (void *) current + IA64_RBS_OFFSET;
-+      unsigned long rnats, nat_mask;
-+    unsigned long old_rsc,new_rsc;
-+      unsigned long on_kbs,rnat;
-+      long sof = (regs->cr_ifs) & 0x7f;
-+      long sor = 8 * ((regs->cr_ifs >> 14) & 0xf);
-+      long rrb_gr = (regs->cr_ifs >> 18) & 0x7f;
-+      long ridx = r1 - 32;
-+
-+      if (ridx >= sof) {
-+              /* this should never happen, as the "rsvd register fault" has 
higher priority */
-+              DPRINT("ignoring write to r%lu; only %lu registers are 
allocated!\n", r1, sof);
-+              return;
-+      }
-+
-+      if (ridx < sor)
-+              ridx = rotate_reg(sor, rrb_gr, ridx);
-+
-+    old_rsc=ia64_get_rsc();
-+    new_rsc=old_rsc&(~0x3);
-+    ia64_set_rsc(new_rsc);
-+
-+    bspstore = ia64_get_bspstore();
-+    bsp =kbs + (regs->loadrs >> 19);//16+3
-+
-+      addr = ia64_rse_skip_regs(bsp, -sof + ridx);
-+    nat_mask = 1UL << ia64_rse_slot_num(addr);
-+      rnat_addr = ia64_rse_rnat_addr(addr);
-+
-+    if(addr >= bspstore){
-+
-+        ia64_flushrs ();
-+        ia64_mf ();
-+              *addr = val;
-+        bspstore = ia64_get_bspstore();
-+      rnat = ia64_get_rnat ();
-+        if(bspstore < rnat_addr){
-+            rnat=rnat&(~nat_mask);
-+        }else{
-+            *rnat_addr = (*rnat_addr)&(~nat_mask);
-+        }
-+        ia64_mf();
-+        ia64_loadrs();
-+        ia64_set_rnat(rnat);
-+    }else{
-+
-+      rnat = ia64_get_rnat ();
-+              *addr = val;
-+        if(bspstore < rnat_addr){
-+            rnat=rnat&(~nat_mask);
-+        }else{
-+            *rnat_addr = (*rnat_addr)&(~nat_mask);
-+        }
-+        ia64_set_bspstore (bspstore);
-+        ia64_set_rnat(rnat);
-+    }
-+    ia64_set_rsc(old_rsc);
-+}
-+
-+
-+static void
-+get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, 
unsigned long *nat)
-+{
-+      struct switch_stack *sw = (struct switch_stack *) regs - 1;
-+      unsigned long *bsp, *addr, *rnat_addr, *ubs_end, *bspstore;
-+      unsigned long *kbs = (void *) current + IA64_RBS_OFFSET;
-+      unsigned long rnats, nat_mask;
-+      unsigned long on_kbs;
-+    unsigned long old_rsc, new_rsc;
-+      long sof = (regs->cr_ifs) & 0x7f;
-+      long sor = 8 * ((regs->cr_ifs >> 14) & 0xf);
-+      long rrb_gr = (regs->cr_ifs >> 18) & 0x7f;
-+      long ridx = r1 - 32;
-+
-+      if (ridx >= sof) {
-+              /* read of out-of-frame register returns an undefined value; 0 
in our case.  */
-+              DPRINT("ignoring read from r%lu; only %lu registers are 
allocated!\n", r1, sof);
-+              panic("wrong stack register number");
-+      }
-+
-+      if (ridx < sor)
-+              ridx = rotate_reg(sor, rrb_gr, ridx);
-+
-+    old_rsc=ia64_get_rsc();
-+    new_rsc=old_rsc&(~(0x3));
-+    ia64_set_rsc(new_rsc);
-+
-+    bspstore = ia64_get_bspstore();
-+    bsp =kbs + (regs->loadrs >> 19); //16+3;
-+
-+      addr = ia64_rse_skip_regs(bsp, -sof + ridx);
-+    nat_mask = 1UL << ia64_rse_slot_num(addr);
-+      rnat_addr = ia64_rse_rnat_addr(addr);
-+
-+    if(addr >= bspstore){
-+
-+        ia64_flushrs ();
-+        ia64_mf ();
-+        bspstore = ia64_get_bspstore();
-+    }
-+      *val=*addr;
-+    if(bspstore < rnat_addr){
-+        *nat=!!(ia64_get_rnat()&nat_mask);
-+    }else{
-+        *nat = !!((*rnat_addr)&nat_mask);
-+    }
-+    ia64_set_rsc(old_rsc);
-+}
-+#else // CONFIG_VTI
- static void
- set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, int 
nat)
- {
-@@ -435,9 +554,14 @@
-               *nat = 0;
-       return;
- }
-+#endif // CONFIG_VTI
- 
- 
-+#ifdef XEN
-+void
-+#else
- static void
-+#endif
- setreg (unsigned long regnum, unsigned long val, int nat, struct pt_regs 
*regs)
- {
-       struct switch_stack *sw = (struct switch_stack *) regs - 1;
-@@ -466,7 +590,11 @@
-               unat = &sw->ar_unat;
-       } else {
-               addr = (unsigned long)regs;
-+#ifdef CONFIG_VTI
-+              unat = &regs->eml_unat;
-+#else //CONFIG_VTI
-               unat = &sw->caller_unat;
-+#endif  //CONFIG_VTI
-       }
-       DPRINT("tmp_base=%lx switch_stack=%s offset=%d\n",
-              addr, unat==&sw->ar_unat ? "yes":"no", GR_OFFS(regnum));
-@@ -522,7 +650,11 @@
-        */
-       if (regnum >= IA64_FIRST_ROTATING_FR) {
-               ia64_sync_fph(current);
-+#ifdef XEN
-+              current->arch._thread.fph[fph_index(regs, regnum)] = *fpval;
-+#else
-               current->thread.fph[fph_index(regs, regnum)] = *fpval;
-+#endif
-       } else {
-               /*
-                * pt_regs or switch_stack ?
-@@ -581,7 +713,11 @@
-        */
-       if (regnum >= IA64_FIRST_ROTATING_FR) {
-               ia64_flush_fph(current);
-+#ifdef XEN
-+              *fpval = current->arch._thread.fph[fph_index(regs, regnum)];
-+#else
-               *fpval = current->thread.fph[fph_index(regs, regnum)];
-+#endif
-       } else {
-               /*
-                * f0 = 0.0, f1= 1.0. Those registers are constant and are thus
-@@ -611,7 +747,11 @@
- }
- 
- 
-+#ifdef XEN
-+void
-+#else
- static void
-+#endif
- getreg (unsigned long regnum, unsigned long *val, int *nat, struct pt_regs 
*regs)
- {
-       struct switch_stack *sw = (struct switch_stack *) regs - 1;
-@@ -640,7 +780,11 @@
-               unat = &sw->ar_unat;
-       } else {
-               addr = (unsigned long)regs;
-+#ifdef  CONFIG_VTI
-+              unat = &regs->eml_unat;;
-+#else   //CONFIG_VTI
-               unat = &sw->caller_unat;
-+#endif  //CONFIG_VTI
-       }
- 
-       DPRINT("addr_base=%lx offset=0x%x\n", addr,  GR_OFFS(regnum));
-@@ -1294,6 +1438,9 @@
- void
- ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
- {
-+#ifdef XEN
-+printk("ia64_handle_unaligned: called, not working yet\n");
-+#else
-       struct ia64_psr *ipsr = ia64_psr(regs);
-       mm_segment_t old_fs = get_fs();
-       unsigned long bundle[2];
-@@ -1502,4 +1649,5 @@
-       si.si_imm = 0;
-       force_sig_info(SIGBUS, &si, current);
-       goto done;
-+#endif
- }
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/bootmem.h
--- a/xen/arch/ia64/patch/linux-2.6.7/bootmem.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,12 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/bootmem.h     
2004-06-15 23:19:52.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/linux/bootmem.h        
2004-08-25 19:28:13.000000000 -0600
-@@ -41,7 +41,9 @@
- extern void __init free_bootmem (unsigned long addr, unsigned long size);
- extern void * __init __alloc_bootmem (unsigned long size, unsigned long 
align, unsigned long goal);
- #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
-+#ifndef XEN
- extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
-+#endif
- #define alloc_bootmem(x) \
-       __alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
- #define alloc_bootmem_low(x) \
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/current.h
--- a/xen/arch/ia64/patch/linux-2.6.7/current.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,17 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/current.h  
2004-06-15 23:19:52.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/current.h      
2004-08-25 19:28:12.000000000 -0600
-@@ -12,6 +12,14 @@
-  * In kernel mode, thread pointer (r13) is used to point to the current task
-  * structure.
-  */
-+#ifdef XEN
-+struct domain;
-+#define get_current() ((struct vcpu *) ia64_getreg(_IA64_REG_TP))
-+#define current get_current()
-+//#define set_current(d)      ia64_setreg(_IA64_REG_TP,(void *)d);
-+#define set_current(d)                (ia64_r13 = (void *)d)
-+#else
- #define current       ((struct task_struct *) ia64_getreg(_IA64_REG_TP))
-+#endif
- 
- #endif /* _ASM_IA64_CURRENT_H */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/efi.c
--- a/xen/arch/ia64/patch/linux-2.6.7/efi.c     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,85 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/arch/ia64/kernel/efi.c      
2004-06-15 23:18:55.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/efi.c 2004-12-17 
13:47:03.000000000 -0700
-@@ -25,6 +25,9 @@
- #include <linux/types.h>
- #include <linux/time.h>
- #include <linux/efi.h>
-+#ifdef XEN
-+#include <xen/sched.h>
-+#endif
- 
- #include <asm/io.h>
- #include <asm/kregs.h>
-@@ -49,7 +52,10 @@
- {                                                                             
                \
-       struct ia64_fpreg fr[6];                                                
                \
-       efi_status_t ret;                                                       
                \
-+      efi_time_cap_t *atc = NULL;                                             
                \
-                                                                               
                \
-+      if (tc)                                                                 
                \
-+              atc = adjust_arg(tc);                                           
                \
-       ia64_save_scratch_fpregs(fr);                                           
                \
-       ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), 
adjust_arg(tm),     \
-                               adjust_arg(tc));                                
                \
-@@ -201,6 +207,7 @@
-       if ((*efi.get_time)(&tm, 0) != EFI_SUCCESS)
-               return;
- 
-+      dummy();
-       ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, 
tm.second);
-       ts->tv_nsec = tm.nanosecond;
- }
-@@ -303,6 +310,10 @@
-               if (!(md->attribute & EFI_MEMORY_WB))
-                       continue;
- 
-+#ifdef XEN
-+// this is a temporary hack to avoid CONFIG_VIRTUAL_MEM_MAP
-+              if (md->phys_addr >= 0x100000000) continue;
-+#endif
-               /*
-                * granule_addr is the base of md's first granule.
-                * [granule_addr - first_non_wb_addr) is guaranteed to
-@@ -456,9 +467,11 @@
- 
-               cpu = smp_processor_id();
- 
-+#ifndef XEN
-               /* insert this TR into our list for MCA recovery purposes */
-               ia64_mca_tlb_list[cpu].pal_base = vaddr & mask;
-               ia64_mca_tlb_list[cpu].pal_paddr = 
pte_val(mk_pte_phys(md->phys_addr, PAGE_KERNEL));
-+#endif
-       }
- }
- 
-@@ -680,6 +693,30 @@
-       return 0;
- }
- 
-+#ifdef XEN
-+// variation of efi_get_iobase which returns entire memory descriptor
-+efi_memory_desc_t *
-+efi_get_io_md (void)
-+{
-+      void *efi_map_start, *efi_map_end, *p;
-+      efi_memory_desc_t *md;
-+      u64 efi_desc_size;
-+
-+      efi_map_start = __va(ia64_boot_param->efi_memmap);
-+      efi_map_end   = efi_map_start + ia64_boot_param->efi_memmap_size;
-+      efi_desc_size = ia64_boot_param->efi_memdesc_size;
-+
-+      for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
-+              md = p;
-+              if (md->type == EFI_MEMORY_MAPPED_IO_PORT_SPACE) {
-+                      if (md->attribute & EFI_MEMORY_UC)
-+                              return md;
-+              }
-+      }
-+      return 0;
-+}
-+#endif
-+
- u32
- efi_mem_type (unsigned long phys_addr)
- {
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/efi.h
--- a/xen/arch/ia64/patch/linux-2.6.7/efi.h     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,13 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/efi.h 
2004-06-15 23:20:03.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/linux/efi.h    
2004-08-25 19:28:13.000000000 -0600
-@@ -15,8 +15,10 @@
- #include <linux/string.h>
- #include <linux/time.h>
- #include <linux/types.h>
-+#ifndef XEN
- #include <linux/proc_fs.h>
- #include <linux/rtc.h>
-+#endif
- #include <linux/ioport.h>
- 
- #include <asm/page.h>
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/entry.S
--- a/xen/arch/ia64/patch/linux-2.6.7/entry.S   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,195 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/kernel/entry.S 2005-03-24 19:39:56.000000000 
-0700
-+++ arch/ia64/entry.S  2005-04-01 12:56:01.000000000 -0700
-@@ -35,7 +35,9 @@
- 
- #include <asm/asmmacro.h>
- #include <asm/cache.h>
-+#ifndef XEN
- #include <asm/errno.h>
-+#endif
- #include <asm/kregs.h>
- #include <asm/offsets.h>
- #include <asm/pgtable.h>
-@@ -46,6 +48,23 @@
- 
- #include "minstate.h"
- 
-+#ifdef XEN
-+#define       sys_execve 0
-+#define do_fork 0
-+#define       syscall_trace 0
-+#define schedule 0
-+#define do_notify_resume_user 0
-+#define ia64_rt_sigsuspend 0
-+#define ia64_rt_sigreturn 0
-+#define       ia64_handle_unaligned 0
-+#define       errno 0
-+#define       sys_ni_syscall 0
-+#define unw_init_frame_info 0
-+#define sys_call_table 0
-+#endif
-+
-+      /*
-+
-       /*
-        * execve() is special because in case of success, we need to
-        * setup a null register window frame.
-@@ -178,11 +197,14 @@
-       DO_SAVE_SWITCH_STACK
-       .body
- 
-+#ifdef XEN
-+//#undef IA64_TASK_THREAD_KSP_OFFSET
-+//#define     IA64_TASK_THREAD_KSP_OFFSET     0x38
-       adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
-       movl r25=init_task
-       mov r27=IA64_KR(CURRENT_STACK)
-       adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
--      dep r20=0,in0,61,3              // physical address of "current"
-+      dep r20=0,in0,60,4              // physical address of "current"
-       ;;
-       st8 [r22]=sp                    // save kernel stack pointer of old task
-       shr.u r26=r20,IA64_GRANULE_SHIFT
-@@ -194,6 +216,22 @@
- (p6)  cmp.eq p7,p6=r26,r27
- (p6)  br.cond.dpnt .map
-       ;;
-+#else
-+      adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
-+      mov r27=IA64_KR(CURRENT_STACK)
-+      dep r20=0,in0,61,3              // physical address of "current"
-+      ;;
-+      st8 [r22]=sp                    // save kernel stack pointer of old task
-+      shr.u r26=r20,IA64_GRANULE_SHIFT
-+      adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
-+      ;;
-+      /*
-+       * If we've already mapped this task's page, we can skip doing it again.
-+       */
-+      cmp.eq p7,p6=r26,r27
-+(p6)  br.cond.dpnt .map
-+      ;;
-+#endif
- .done:
- (p6)  ssm psr.ic                      // if we we had to map, renable the 
psr.ic bit FIRST!!!
-       ;;
-@@ -211,6 +249,16 @@
-       br.ret.sptk.many rp             // boogie on out in new context
- 
- .map:
-+#ifdef XEN
-+      // avoid overlapping with kernel TR
-+      movl r25=KERNEL_START
-+      dep  r23=0,in0,0,KERNEL_TR_PAGE_SHIFT
-+      ;;
-+      cmp.eq p7,p0=r25,r23
-+      ;;
-+(p7)  mov IA64_KR(CURRENT_STACK)=r26  // remember last page we mapped...
-+(p7)  br.cond.sptk .done
-+#endif
-       rsm psr.ic                      // interrupts (psr.i) are already 
disabled here
-       movl r25=PAGE_KERNEL
-       ;;
-@@ -367,7 +415,11 @@
-  *    - b7 holds address to return to
-  *    - must not touch r8-r11
-  */
-+#ifdef XEN
-+GLOBAL_ENTRY(load_switch_stack)
-+#else
- ENTRY(load_switch_stack)
-+#endif
-       .prologue
-       .altrp b7
- 
-@@ -595,6 +647,11 @@
-        */
-       br.call.sptk.many rp=ia64_invoke_schedule_tail
- }
-+#ifdef XEN
-+      // new domains are cloned but not exec'ed so switch to user mode here
-+      cmp.ne pKStk,pUStk=r0,r0
-+      br.cond.spnt ia64_leave_kernel
-+#else
- .ret8:
-       adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
-       ;;
-@@ -603,6 +660,7 @@
-       mov r8=0
-       tbit.nz p6,p0=r2,TIF_SYSCALL_TRACE
- (p6)  br.cond.spnt .strace_check_retval
-+#endif
-       ;;                                      // added stop bits to prevent 
r8 dependency
- END(ia64_ret_from_clone)
-       // fall through
-@@ -684,9 +742,14 @@
- #endif /* CONFIG_PREEMPT */
-       adds r16=PT(LOADRS)+16,r12
-       adds r17=PT(AR_BSPSTORE)+16,r12
-+#ifdef XEN
-+      mov r31=r0
-+      ;;
-+#else
-       adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
-       ;;
- (p6)  ld4 r31=[r18]                           // load 
current_thread_info()->flags
-+#endif
-       ld8 r19=[r16],PT(B6)-PT(LOADRS)         // load ar.rsc value for 
"loadrs"
-       nop.i 0
-       ;;
-@@ -745,7 +808,11 @@
-       mov b7=r0               // clear b7
-       ;;
- (pUStk) st1 [r14]=r3
-+#ifdef XEN
-+      movl r17=THIS_CPU(ia64_phys_stacked_size_p8)
-+#else
-       addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0
-+#endif
-       ;;
-       mov r16=ar.bsp          // get existing backing store pointer
-       srlz.i                  // ensure interruption collection is off
-@@ -796,9 +863,18 @@
-       ;;
- (p6)  cmp.eq.unc p6,p0=r21,r0         // p6 <- p6 && (r21 == 0)
- #endif /* CONFIG_PREEMPT */
-+#ifdef XEN
-+      alloc loc0=ar.pfs,0,1,1,0
-+      adds out0=16,r12
-+      ;;
-+(p6)  br.call.sptk.many b0=deliver_pending_interrupt
-+      mov ar.pfs=loc0
-+      mov r31=r0
-+#else
-       adds r17=TI_FLAGS+IA64_TASK_SIZE,r13
-       ;;
- (p6)  ld4 r31=[r17]                           // load 
current_thread_info()->flags
-+#endif
-       adds r21=PT(PR)+16,r12
-       ;;
- 
-@@ -912,7 +988,11 @@
-       shr.u r18=r19,16        // get byte size of existing "dirty" partition
-       ;;
-       mov r16=ar.bsp          // get existing backing store pointer
-+#ifdef XEN
-+      movl r17=THIS_CPU(ia64_phys_stacked_size_p8)
-+#else
-       addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0
-+#endif
-       ;;
-       ld4 r17=[r17]           // r17 = cpu_data->phys_stacked_size_p8
- (pKStk)       br.cond.dpnt skip_rbs_switch
-@@ -1264,6 +1344,7 @@
-       br.ret.sptk.many rp
- END(unw_init_running)
- 
-+#ifndef XEN
-       .rodata
-       .align 8
-       .globl sys_call_table
-@@ -1526,3 +1607,4 @@
-       data8 sys_ni_syscall
- 
-       .org sys_call_table + 8*NR_syscalls     // guard against failures to 
increase NR_syscalls
-+#endif
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.7/gcc_intrin.h
--- a/xen/arch/ia64/patch/linux-2.6.7/gcc_intrin.h      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,20 +0,0 @@
---- 
/home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/gcc_intrin.h    
   2005-01-23 13:23:36.000000000 -0700
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/gcc_intrin.h   
2004-08-25 19:28:13.000000000 -0600
-@@ -92,6 +92,9 @@
- 
- #define ia64_hint_pause 0
- 
-+#ifdef XEN
-+#define ia64_hint(mode)       0
-+#else
- #define ia64_hint(mode)                                               \
- ({                                                            \
-       switch (mode) {                                         \
-@@ -100,6 +103,7 @@
-               break;                                          \
-       }                                                       \
- })
-+#endif
- 
- 
- /* Integer values for mux1 instruction */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/hardirq.h
--- a/xen/arch/ia64/patch/linux-2.6.7/hardirq.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,22 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/hardirq.h  
2004-06-15 23:19:02.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/hardirq.h      
2004-12-17 13:47:03.000000000 -0700
-@@ -81,10 +81,19 @@
-  */
- #define in_irq()              (hardirq_count())
- #define in_softirq()          (softirq_count())
-+#ifdef XEN
- #define in_interrupt()                (irq_count())
-+#else
-+#define in_interrupt()                0               // FIXME LATER
-+#endif
- 
-+#ifdef XEN
-+#define hardirq_trylock(cpu)  (!in_interrupt())
-+#define hardirq_endlock(cpu)  do { } while (0)
-+#else
- #define hardirq_trylock()     (!in_interrupt())
- #define hardirq_endlock()     do { } while (0)
-+#endif
- 
- #ifdef CONFIG_PREEMPT
- # include <linux/smp_lock.h>
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/head.S
--- a/xen/arch/ia64/patch/linux-2.6.7/head.S    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,93 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/kernel/head.S  2005-03-24 19:39:56.000000000 
-0700
-+++ arch/ia64/head.S   2005-04-01 12:56:01.000000000 -0700
-@@ -1,3 +1,8 @@
-+#ifdef XEN
-+#define       console_print   printf
-+#define kernel_thread_helper 0
-+#define sys_exit 0
-+#endif
- /*
-  * Here is where the ball gets rolling as far as the kernel is concerned.
-  * When control is transferred to _start, the bootload has already
-@@ -166,7 +171,11 @@
-       dep r18=0,r3,0,12
-       ;;
-       or r18=r17,r18
-+#ifdef XEN
-+      dep r2=-1,r3,60,4       // IMVA of task
-+#else
-       dep r2=-1,r3,61,3       // IMVA of task
-+#endif
-       ;;
-       mov r17=rr[r2]
-       ;;
-@@ -205,7 +214,11 @@
-       ;;
-       mov ar.rsc=0x3          // place RSE in eager mode
- 
-+#ifdef XEN
-+(isBP)        dep r28=-1,r28,60,4     // make address virtual
-+#else
- (isBP)        dep r28=-1,r28,61,3     // make address virtual
-+#endif
- (isBP)        movl r2=ia64_boot_param
-       ;;
- (isBP)        st8 [r2]=r28            // save the address of the boot param 
area passed by the bootloader
-@@ -238,14 +251,30 @@
-       br.call.sptk.many rp=sys_fw_init
- .ret1:
- #endif
-+#ifdef XEN
-+      alloc r2=ar.pfs,8,0,2,0
-+      ;;
-+#define fake_mbi_magic 0
-+#define MULTIBOOT_INFO_SIZE   1024
-+      .rodata
-+fake_mbi:
-+      .skip MULTIBOOT_INFO_SIZE
-+      .previous
-+      movl out0=fake_mbi
-+      ;;
-+      br.call.sptk.many rp=cmain
-+#else
-       br.call.sptk.many rp=start_kernel
-+#endif
- .ret2:        addl r3=@ltoff(halt_msg),gp
-       ;;
-       alloc r2=ar.pfs,8,0,2,0
-       ;;
-       ld8 out0=[r3]
-       br.call.sptk.many b0=console_print
-+      ;;
- self: br.sptk.many self               // endless loop
-+      ;;
- END(_start)
- 
- GLOBAL_ENTRY(ia64_save_debug_regs)
-@@ -781,8 +810,13 @@
-       movl r18=KERNEL_START
-       dep r3=0,r3,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
-       dep r14=0,r14,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
-+#ifdef XEN
-+      dep r17=-1,r17,60,4
-+      dep sp=-1,sp,60,4
-+#else
-       dep r17=-1,r17,61,3
-       dep sp=-1,sp,61,3
-+#endif
-       ;;
-       or r3=r3,r18
-       or r14=r14,r18
-@@ -838,7 +872,12 @@
-  * intermediate precision so that we can produce a full 64-bit result.
-  */
- GLOBAL_ENTRY(sched_clock)
-+#ifdef XEN
-+      break 0;;       // FIX IA64_CPUINFO_NSEC_PER_CYC_OFFSET
-+      //movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET
-+#else
-       addl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
-+#endif
-       mov.m r9=ar.itc         // fetch cycle-counter                          
(35 cyc)
-       ;;
-       ldf8 f8=[r8]
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/hpsim_irq.c
--- a/xen/arch/ia64/patch/linux-2.6.7/hpsim_irq.c       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,36 +0,0 @@
---- 
/home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/arch/ia64/hp/sim/hpsim_irq.c     
   2004-06-15 23:20:26.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/hpsim_irq.c   2004-11-01 
17:54:15.000000000 -0700
-@@ -9,7 +9,17 @@
- #include <linux/kernel.h>
- #include <linux/sched.h>
- #include <linux/irq.h>
-+#ifdef XEN
-+#include <asm/hw_irq.h>
-+#endif
- 
-+#if 1
-+void __init
-+hpsim_irq_init (void)
-+{
-+      printf("*** hpsim_irq_init called: NOT NEEDED?!?!?\n");
-+}
-+#else
- static unsigned int
- hpsim_irq_startup (unsigned int irq)
- {
-@@ -19,6 +29,10 @@
- static void
- hpsim_irq_noop (unsigned int irq)
- {
-+#if 1
-+printf("hpsim_irq_noop: irq=%d\n",irq);
-+while(irq);
-+#endif
- }
- 
- static struct hw_interrupt_type irq_type_hp_sim = {
-@@ -44,3 +58,4 @@
-                       idesc->handler = &irq_type_hp_sim;
-       }
- }
-+#endif
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/hpsim_ssc.h
--- a/xen/arch/ia64/patch/linux-2.6.7/hpsim_ssc.h       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,26 +0,0 @@
---- 
/home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/arch/ia64/hp/sim/hpsim_ssc.h     
   2004-06-15 23:19:43.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/hpsim_ssc.h    
2004-08-29 01:04:23.000000000 -0600
-@@ -33,4 +33,23 @@
-  */
- extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr);
- 
-+#ifdef XEN
-+/* Note: These are declared in linux/arch/ia64/hp/sim/simscsi.c but belong
-+ * in linux/include/asm-ia64/hpsim_ssc.h, hence their addition here */
-+#define SSC_OPEN                      50
-+#define SSC_CLOSE                     51
-+#define SSC_READ                      52
-+#define SSC_WRITE                     53
-+#define SSC_GET_COMPLETION            54
-+#define SSC_WAIT_COMPLETION           55
-+
-+#define SSC_WRITE_ACCESS              2
-+#define SSC_READ_ACCESS                       1
-+
-+struct ssc_disk_req {
-+      unsigned long addr;
-+      unsigned long len;
-+};
-+#endif
-+
- #endif /* _IA64_PLATFORM_HPSIM_SSC_H */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/hw_irq.h
--- a/xen/arch/ia64/patch/linux-2.6.7/hw_irq.h  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,24 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/hw_irq.h   
2004-06-15 23:19:22.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/hw_irq.h       
2004-08-27 09:07:38.000000000 -0600
-@@ -9,7 +9,9 @@
- #include <linux/interrupt.h>
- #include <linux/sched.h>
- #include <linux/types.h>
-+#ifndef XEN
- #include <linux/profile.h>
-+#endif
- 
- #include <asm/machvec.h>
- #include <asm/ptrace.h>
-@@ -96,7 +98,11 @@
-  * Default implementations for the irq-descriptor API:
-  */
- 
-+#ifdef XEN
-+#define _irq_desc irq_desc
-+#else
- extern irq_desc_t _irq_desc[NR_IRQS];
-+#endif
- 
- #ifndef CONFIG_IA64_GENERIC
- static inline irq_desc_t *
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/ide.h
--- a/xen/arch/ia64/patch/linux-2.6.7/ide.h     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,35 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/ide.h      
2004-06-15 23:19:36.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/ide.h  2004-08-25 
19:28:13.000000000 -0600
-@@ -64,6 +64,32 @@
- #define ide_init_default_irq(base)    ide_default_irq(base)
- #endif
- 
-+#ifdef XEN
-+// this is moved to linux/ide.h in newer versions of linux
-+typedef union {
-+      unsigned all                    : 8;    /* all of the bits together */
-+      struct {
-+              unsigned head           : 4;    /* always zeros here */
-+              unsigned unit           : 1;    /* drive select number, 0 or 1 
*/
-+              unsigned bit5           : 1;    /* always 1 */
-+              unsigned lba            : 1;    /* using LBA instead of CHS */
-+              unsigned bit7           : 1;    /* always 1 */
-+      } b;
-+} select_t;
-+
-+typedef union {
-+      unsigned all                    : 8;    /* all of the bits together */
-+      struct {
-+              unsigned bit0           : 1;
-+              unsigned nIEN           : 1;    /* device INTRQ to host */
-+              unsigned SRST           : 1;    /* host soft reset bit */
-+              unsigned bit3           : 1;    /* ATA-2 thingy */
-+              unsigned reserved456    : 3;
-+              unsigned HOB            : 1;    /* 48-bit address ordering */
-+      } b;
-+} control_t;
-+#endif
-+
- #include <asm-generic/ide_iops.h>
- 
- #endif /* __KERNEL__ */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/init_task.c
--- a/xen/arch/ia64/patch/linux-2.6.7/init_task.c       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,35 +0,0 @@
---- 
/home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/arch/ia64/kernel/init_task.c     
   2004-06-15 23:20:26.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/init_task.c   2004-08-27 
00:06:35.000000000 -0600
-@@ -15,10 +15,12 @@
- #include <asm/uaccess.h>
- #include <asm/pgtable.h>
- 
-+#ifndef XEN
- static struct fs_struct init_fs = INIT_FS;
- static struct files_struct init_files = INIT_FILES;
- static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
- static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
-+#endif
- struct mm_struct init_mm = INIT_MM(init_mm);
- 
- EXPORT_SYMBOL(init_mm);
-@@ -33,13 +35,19 @@
- 
- union {
-       struct {
-+#ifdef XEN
-+              struct domain task;
-+#else
-               struct task_struct task;
-               struct thread_info thread_info;
-+#endif
-       } s;
-       unsigned long stack[KERNEL_STACK_SIZE/sizeof (unsigned long)];
- } init_task_mem asm ("init_task") __attribute__((section(".data.init_task"))) 
= {{
-       .task =         INIT_TASK(init_task_mem.s.task),
-+#ifndef XEN
-       .thread_info =  INIT_THREAD_INFO(init_task_mem.s.task)
-+#endif
- }};
- 
- EXPORT_SYMBOL(init_task);
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/init_task.h
--- a/xen/arch/ia64/patch/linux-2.6.7/init_task.h       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,53 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/init_task.h   
2004-06-15 23:18:57.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/linux/init_task.h      
2004-11-15 17:06:20.000000000 -0700
-@@ -31,6 +31,18 @@
-       .max_reqs       = ~0U,                          \
- }
- 
-+#ifdef XEN
-+#define INIT_MM(name) \
-+{                                                             \
-+      .mm_rb          = RB_ROOT,                              \
-+      .pgd            = swapper_pg_dir,                       \
-+      .mm_users       = ATOMIC_INIT(2),                       \
-+      .mm_count       = ATOMIC_INIT(1),                       \
-+      .page_table_lock =  SPIN_LOCK_UNLOCKED,                 \
-+      .mmlist         = LIST_HEAD_INIT(name.mmlist),          \
-+      .cpu_vm_mask    = CPU_MASK_ALL,                         \
-+}
-+#else
- #define INIT_MM(name) \
- {                                                             \
-       .mm_rb          = RB_ROOT,                              \
-@@ -43,6 +55,7 @@
-       .cpu_vm_mask    = CPU_MASK_ALL,                         \
-       .default_kioctx = INIT_KIOCTX(name.default_kioctx, name),       \
- }
-+#endif
- 
- #define INIT_SIGNALS(sig) {   \
-       .count          = ATOMIC_INIT(1),               \
-@@ -64,6 +77,15 @@
-  *  INIT_TASK is used to set up the first task table, touch at
-  * your own risk!. Base=0, limit=0x1fffff (=2MB)
-  */
-+#ifdef XEN
-+#define INIT_TASK(tsk) \
-+{                                                     \
-+      /*processor:    0,*/                            \
-+      /*domain_id:    IDLE_DOMAIN_ID,*/               \
-+      /*domain_flags: DOMF_idle_domain,*/             \
-+      refcnt:         ATOMIC_INIT(1)                  \
-+}
-+#else
- #define INIT_TASK(tsk)        \
- {                                                                     \
-       .state          = 0,                                            \
-@@ -113,6 +135,7 @@
-       .switch_lock    = SPIN_LOCK_UNLOCKED,                           \
-       .journal_info   = NULL,                                         \
- }
-+#endif
- 
- 
- 
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/interrupt.h
--- a/xen/arch/ia64/patch/linux-2.6.7/interrupt.h       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,18 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/interrupt.h   
2004-06-15 23:19:29.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/linux/interrupt.h      
2004-08-25 19:28:13.000000000 -0600
-@@ -32,6 +32,7 @@
- #define IRQ_HANDLED   (1)
- #define IRQ_RETVAL(x) ((x) != 0)
- 
-+#ifndef XEN
- struct irqaction {
-       irqreturn_t (*handler)(int, void *, struct pt_regs *);
-       unsigned long flags;
-@@ -46,6 +47,7 @@
-                      irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                      unsigned long, const char *, void *);
- extern void free_irq(unsigned int, void *);
-+#endif
- 
- /*
-  * Temporary defines for UP kernels, until all code gets fixed.
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/io.h
--- a/xen/arch/ia64/patch/linux-2.6.7/io.h      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,14 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/io.h       
2004-06-15 23:18:57.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/io.h   2004-11-05 
16:53:36.000000000 -0700
-@@ -23,7 +23,11 @@
- #define __SLOW_DOWN_IO        do { } while (0)
- #define SLOW_DOWN_IO  do { } while (0)
- 
-+#ifdef XEN
-+#define __IA64_UNCACHED_OFFSET        0xdffc000000000000      /* region 6 */
-+#else
- #define __IA64_UNCACHED_OFFSET        0xc000000000000000      /* region 6 */
-+#endif
- 
- /*
-  * The legacy I/O space defined by the ia64 architecture supports only 65536 
ports, but
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/irq.h
--- a/xen/arch/ia64/patch/linux-2.6.7/irq.h     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,18 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/irq.h      
2005-01-23 13:23:36.000000000 -0700
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/irq.h  2004-08-25 
19:28:13.000000000 -0600
-@@ -30,6 +30,15 @@
- extern void enable_irq (unsigned int);
- extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
- 
-+#ifdef XEN
-+// dup'ed from signal.h to avoid changes to includes
-+#define       SA_NOPROFILE    0x02000000
-+#define       SA_SHIRQ        0x04000000
-+#define       SA_RESTART      0x10000000
-+#define       SA_INTERRUPT    0x20000000
-+#define       SA_SAMPLE_RANDOM        SA_RESTART
-+#endif
-+
- #ifdef CONFIG_SMP
- extern void move_irq(int irq);
- #else
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/irq_ia64.c
--- a/xen/arch/ia64/patch/linux-2.6.7/irq_ia64.c        Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,82 +0,0 @@
---- /home/djm/linux-2.6.7/arch/ia64/kernel/irq_ia64.c  2004-06-15 
23:19:13.000000000 -0600
-+++ arch/ia64/irq_ia64.c       2005-02-17 13:17:16.000000000 -0700
-@@ -17,18 +17,26 @@
- #include <linux/config.h>
- #include <linux/module.h>
- 
-+#ifndef XEN
- #include <linux/jiffies.h>
-+#endif
- #include <linux/errno.h>
- #include <linux/init.h>
- #include <linux/interrupt.h>
- #include <linux/ioport.h>
-+#ifndef XEN
- #include <linux/kernel_stat.h>
-+#endif
- #include <linux/slab.h>
-+#ifndef XEN
- #include <linux/ptrace.h>
- #include <linux/random.h>     /* for rand_initialize_irq() */
- #include <linux/signal.h>
-+#endif
- #include <linux/smp.h>
-+#ifndef XEN
- #include <linux/smp_lock.h>
-+#endif
- #include <linux/threads.h>
- 
- #include <asm/bitops.h>
-@@ -101,6 +109,24 @@
- ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
- {
-       unsigned long saved_tpr;
-+#if 0
-+//FIXME: For debug only, can be removed
-+      static char firstirq = 1;
-+      static char firsttime[256];
-+      static char firstpend[256];
-+      if (firstirq) {
-+              int i;
-+              for (i=0;i<256;i++) firsttime[i] = 1;
-+              for (i=0;i<256;i++) firstpend[i] = 1;
-+              firstirq = 0;
-+      }
-+      if (firsttime[vector]) {
-+              printf("**** (entry) First received int on vector=%d,itc=%lx\n",
-+                      (unsigned long) vector, ia64_get_itc());
-+              firsttime[vector] = 0;
-+      }
-+#endif
-+
- 
- #if IRQ_DEBUG
-       {
-@@ -145,6 +171,27 @@
-                       ia64_setreg(_IA64_REG_CR_TPR, vector);
-                       ia64_srlz_d();
- 
-+#ifdef XEN
-+      if (vector != 0xef) {
-+              extern void vcpu_pend_interrupt(void *, int);
-+#if 0
-+              if (firsttime[vector]) {
-+                      printf("**** (iterate) First received int on 
vector=%d,itc=%lx\n",
-+                      (unsigned long) vector, ia64_get_itc());
-+                      firsttime[vector] = 0;
-+              }
-+              if (firstpend[vector]) {
-+                      printf("**** First pended int on vector=%d,itc=%lx\n",
-+                              (unsigned long) vector,ia64_get_itc());
-+                      firstpend[vector] = 0;
-+              }
-+#endif
-+              //FIXME: TEMPORARY HACK!!!!
-+              vcpu_pend_interrupt(dom0->vcpu[0],vector);
-+              vcpu_wake(dom0->vcpu[0]);
-+      }
-+      else
-+#endif
-                       do_IRQ(local_vector_to_irq(vector), regs);
- 
-                       /*
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/ivt.S
--- a/xen/arch/ia64/patch/linux-2.6.7/ivt.S     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,528 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/kernel/ivt.S   2004-06-15 23:18:59.000000000 
-0600
-+++ arch/ia64/ivt.S    2005-04-01 12:56:01.000000000 -0700
-@@ -1,3 +1,21 @@
-+
-+#ifdef XEN
-+//#define CONFIG_DISABLE_VHPT // FIXME: change when VHPT is enabled??
-+// these are all hacked out for now as the entire IVT
-+// will eventually be replaced... just want to use it
-+// for startup code to handle TLB misses
-+//#define ia64_leave_kernel 0
-+//#define ia64_ret_from_syscall 0
-+//#define ia64_handle_irq 0
-+//#define ia64_fault 0
-+#define ia64_illegal_op_fault 0
-+#define ia64_prepare_handle_unaligned 0
-+#define ia64_bad_break 0
-+#define ia64_trace_syscall 0
-+#define sys_call_table 0
-+#define sys_ni_syscall 0
-+#include <asm/vhpt.h>
-+#endif
- /*
-  * arch/ia64/kernel/ivt.S
-  *
-@@ -76,6 +94,13 @@
-       mov r19=n;;                     /* prepare to save predicates */        
        \
-       br.sptk.many dispatch_to_fault_handler
- 
-+#ifdef XEN
-+#define REFLECT(n)                                                            
        \
-+      mov r31=pr;                                                             
        \
-+      mov r19=n;;                     /* prepare to save predicates */        
        \
-+      br.sptk.many dispatch_reflection
-+#endif
-+
-       .section .text.ivt,"ax"
- 
-       .align 32768    // align on 32KB boundary
-@@ -213,6 +238,13 @@
- // 0x0400 Entry 1 (size 64 bundles) ITLB (21)
- ENTRY(itlb_miss)
-       DBG_FAULT(1)
-+#ifdef XEN
-+      VHPT_CCHAIN_LOOKUP(itlb_miss,i)
-+#ifdef VHPT_GLOBAL
-+      br.cond.sptk page_fault
-+      ;;
-+#endif
-+#endif
-       /*
-        * The ITLB handler accesses the L3 PTE via the virtually mapped linear
-        * page table.  If a nested TLB miss occurs, we switch into physical
-@@ -257,6 +289,13 @@
- // 0x0800 Entry 2 (size 64 bundles) DTLB (9,48)
- ENTRY(dtlb_miss)
-       DBG_FAULT(2)
-+#ifdef XEN
-+      VHPT_CCHAIN_LOOKUP(dtlb_miss,d)
-+#ifdef VHPT_GLOBAL
-+      br.cond.sptk page_fault
-+      ;;
-+#endif
-+#endif
-       /*
-        * The DTLB handler accesses the L3 PTE via the virtually mapped linear
-        * page table.  If a nested TLB miss occurs, we switch into physical
-@@ -301,6 +340,13 @@
- // 0x0c00 Entry 3 (size 64 bundles) Alt ITLB (19)
- ENTRY(alt_itlb_miss)
-       DBG_FAULT(3)
-+#ifdef XEN
-+//#ifdef VHPT_GLOBAL
-+//    VHPT_CCHAIN_LOOKUP(alt_itlb_miss,i)
-+//    br.cond.sptk page_fault
-+//    ;;
-+//#endif
-+#endif
-       mov r16=cr.ifa          // get address that caused the TLB miss
-       movl r17=PAGE_KERNEL
-       mov r21=cr.ipsr
-@@ -339,6 +385,13 @@
- // 0x1000 Entry 4 (size 64 bundles) Alt DTLB (7,46)
- ENTRY(alt_dtlb_miss)
-       DBG_FAULT(4)
-+#ifdef XEN
-+//#ifdef VHPT_GLOBAL
-+//    VHPT_CCHAIN_LOOKUP(alt_dtlb_miss,d)
-+//    br.cond.sptk page_fault
-+//    ;;
-+//#endif
-+#endif
-       mov r16=cr.ifa          // get address that caused the TLB miss
-       movl r17=PAGE_KERNEL
-       mov r20=cr.isr
-@@ -368,6 +421,17 @@
-       cmp.ne p8,p0=r0,r23
- (p9)  cmp.eq.or.andcm p6,p7=IA64_ISR_CODE_LFETCH,r22  // check isr.code field
- (p8)  br.cond.spnt page_fault
-+#ifdef XEN
-+      ;;
-+      // FIXME: inadequate test, this is where we test for Xen address
-+      // note that 0xf000 (cached) and 0xd000 (uncached) addresses
-+      // should be OK.  (Though no I/O is done in Xen, EFI needs uncached
-+      // addresses and some domain EFI calls are passed through)
-+      tbit.nz p0,p8=r16,60
-+(p8)  br.cond.spnt page_fault
-+//(p8)        br.cond.spnt 0
-+      ;;
-+#endif
- 
-       dep r21=-1,r21,IA64_PSR_ED_BIT,1
-       or r19=r19,r17          // insert PTE control bits into r19
-@@ -448,6 +512,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x1800 Entry 6 (size 64 bundles) Instruction Key Miss (24)
- ENTRY(ikey_miss)
-+#ifdef XEN
-+      REFLECT(6)
-+#endif
-       DBG_FAULT(6)
-       FAULT(6)
- END(ikey_miss)
-@@ -460,9 +527,16 @@
-       srlz.i
-       ;;
-       SAVE_MIN_WITH_COVER
-+#ifdef XEN
-+      alloc r15=ar.pfs,0,0,4,0
-+      mov out0=cr.ifa
-+      mov out1=cr.isr
-+      mov out3=cr.itir
-+#else
-       alloc r15=ar.pfs,0,0,3,0
-       mov out0=cr.ifa
-       mov out1=cr.isr
-+#endif
-       adds r3=8,r2                            // set up second base pointer
-       ;;
-       ssm psr.ic | PSR_DEFAULT_BITS
-@@ -483,6 +557,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51)
- ENTRY(dkey_miss)
-+#ifdef XEN
-+      REFLECT(7)
-+#endif
-       DBG_FAULT(7)
-       FAULT(7)
- END(dkey_miss)
-@@ -491,6 +568,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x2000 Entry 8 (size 64 bundles) Dirty-bit (54)
- ENTRY(dirty_bit)
-+#ifdef XEN
-+      REFLECT(8)
-+#endif
-       DBG_FAULT(8)
-       /*
-        * What we do here is to simply turn on the dirty bit in the PTE.  We 
need to
-@@ -553,6 +633,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x2400 Entry 9 (size 64 bundles) Instruction Access-bit (27)
- ENTRY(iaccess_bit)
-+#ifdef XEN
-+      REFLECT(9)
-+#endif
-       DBG_FAULT(9)
-       // Like Entry 8, except for instruction access
-       mov r16=cr.ifa                          // get the address that caused 
the fault
-@@ -618,6 +701,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x2800 Entry 10 (size 64 bundles) Data Access-bit (15,55)
- ENTRY(daccess_bit)
-+#ifdef XEN
-+      REFLECT(10)
-+#endif
-       DBG_FAULT(10)
-       // Like Entry 8, except for data access
-       mov r16=cr.ifa                          // get the address that caused 
the fault
-@@ -686,6 +772,16 @@
-        * to prevent leaking bits from kernel to user level.
-        */
-       DBG_FAULT(11)
-+#ifdef XEN
-+      mov r16=cr.isr
-+      mov r17=cr.iim
-+      mov r31=pr
-+      ;;
-+      cmp.eq p7,p0=r0,r17                     // is this a psuedo-cover?
-+      // FIXME: may also need to check slot==2?
-+(p7)  br.sptk.many dispatch_privop_fault
-+      br.sptk.many dispatch_break_fault
-+#endif
-       mov r16=IA64_KR(CURRENT)                // r16 = current task; 12 cycle 
read lat.
-       mov r17=cr.iim
-       mov r18=__IA64_BREAK_SYSCALL
-@@ -696,7 +792,9 @@
-       mov r27=ar.rsc
-       mov r26=ar.pfs
-       mov r28=cr.iip
-+#ifndef XEN
-       mov r31=pr                              // prepare to save predicates
-+#endif
-       mov r20=r1
-       ;;
-       adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16
-@@ -792,6 +890,36 @@
-       DBG_FAULT(13)
-       FAULT(13)
- 
-+#ifdef XEN
-+      // There is no particular reason for this code to be here, other than 
that
-+      // there happens to be space here that would go unused otherwise.  If 
this
-+      // fault ever gets "unreserved", simply moved the following code to a 
more
-+      // suitable spot...
-+
-+ENTRY(dispatch_break_fault)
-+      SAVE_MIN_WITH_COVER
-+      ;;
-+      alloc r14=ar.pfs,0,0,4,0 // now it's safe (must be first in insn group!)
-+      mov out0=cr.ifa
-+      adds out1=16,sp
-+      mov out2=cr.isr         // FIXME: pity to make this slow access twice
-+      mov out3=cr.iim         // FIXME: pity to make this slow access twice
-+
-+      ssm psr.ic | PSR_DEFAULT_BITS
-+      ;;
-+      srlz.i                                  // guarantee that interruption 
collection is on
-+      ;;
-+(p15) ssm psr.i                               // restore psr.i
-+      adds r3=8,r2                            // set up second base pointer
-+      ;;
-+      SAVE_REST
-+      movl r14=ia64_leave_kernel
-+      ;;
-+      mov rp=r14
-+      br.sptk.many ia64_prepare_handle_break
-+END(dispatch_break_fault)
-+#endif
-+
-       .org ia64_ivt+0x3800
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x3800 Entry 14 (size 64 bundles) Reserved
-@@ -842,9 +970,11 @@
-        *      - ar.fpsr: set to kernel settings
-        */
- GLOBAL_ENTRY(ia64_syscall_setup)
-+#ifndef XEN
- #if PT(B6) != 0
- # error This code assumes that b6 is the first field in pt_regs.
- #endif
-+#endif
-       st8 [r1]=r19                            // save b6
-       add r16=PT(CR_IPSR),r1                  // initialize first base pointer
-       add r17=PT(R11),r1                      // initialize second base 
pointer
-@@ -974,6 +1104,37 @@
-       DBG_FAULT(16)
-       FAULT(16)
- 
-+#ifdef XEN
-+      // There is no particular reason for this code to be here, other than 
that
-+      // there happens to be space here that would go unused otherwise.  If 
this
-+      // fault ever gets "unreserved", simply moved the following code to a 
more
-+      // suitable spot...
-+
-+ENTRY(dispatch_privop_fault)
-+      SAVE_MIN_WITH_COVER
-+      ;;
-+      alloc r14=ar.pfs,0,0,4,0                // now it's safe (must be first 
in insn group!)
-+      mov out0=cr.ifa
-+      adds out1=16,sp
-+      mov out2=cr.isr         // FIXME: pity to make this slow access twice
-+      mov out3=cr.itir
-+
-+      ssm psr.ic | PSR_DEFAULT_BITS
-+      ;;
-+      srlz.i                                  // guarantee that interruption 
collection is on
-+      ;;
-+(p15) ssm psr.i                               // restore psr.i
-+      adds r3=8,r2                            // set up second base pointer
-+      ;;
-+      SAVE_REST
-+      movl r14=ia64_leave_kernel
-+      ;;
-+      mov rp=r14
-+      br.sptk.many ia64_prepare_handle_privop
-+END(dispatch_privop_fault)
-+#endif
-+
-+
-       .org ia64_ivt+0x4400
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x4400 Entry 17 (size 64 bundles) Reserved
-@@ -1090,6 +1251,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5000 Entry 20 (size 16 bundles) Page Not Present (10,22,49)
- ENTRY(page_not_present)
-+#ifdef XEN
-+      REFLECT(20)
-+#endif
-       DBG_FAULT(20)
-       mov r16=cr.ifa
-       rsm psr.dt
-@@ -1110,6 +1274,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5100 Entry 21 (size 16 bundles) Key Permission (13,25,52)
- ENTRY(key_permission)
-+#ifdef XEN
-+      REFLECT(21)
-+#endif
-       DBG_FAULT(21)
-       mov r16=cr.ifa
-       rsm psr.dt
-@@ -1123,6 +1290,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5200 Entry 22 (size 16 bundles) Instruction Access Rights (26)
- ENTRY(iaccess_rights)
-+#ifdef XEN
-+      REFLECT(22)
-+#endif
-       DBG_FAULT(22)
-       mov r16=cr.ifa
-       rsm psr.dt
-@@ -1136,6 +1306,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5300 Entry 23 (size 16 bundles) Data Access Rights (14,53)
- ENTRY(daccess_rights)
-+#ifdef XEN
-+      REFLECT(23)
-+#endif
-       DBG_FAULT(23)
-       mov r16=cr.ifa
-       rsm psr.dt
-@@ -1153,8 +1326,13 @@
-       mov r16=cr.isr
-       mov r31=pr
-       ;;
-+#ifdef XEN
-+      cmp4.ge p6,p0=0x20,r16
-+(p6)  br.sptk.many dispatch_privop_fault
-+#else
-       cmp4.eq p6,p0=0,r16
- (p6)  br.sptk.many dispatch_illegal_op_fault
-+#endif
-       ;;
-       mov r19=24              // fault number
-       br.sptk.many dispatch_to_fault_handler
-@@ -1164,6 +1342,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5500 Entry 25 (size 16 bundles) Disabled FP-Register (35)
- ENTRY(disabled_fp_reg)
-+#ifdef XEN
-+      REFLECT(25)
-+#endif
-       DBG_FAULT(25)
-       rsm psr.dfh             // ensure we can access fph
-       ;;
-@@ -1177,6 +1358,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50)
- ENTRY(nat_consumption)
-+#ifdef XEN
-+      REFLECT(26)
-+#endif
-       DBG_FAULT(26)
-       FAULT(26)
- END(nat_consumption)
-@@ -1185,6 +1369,10 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5700 Entry 27 (size 16 bundles) Speculation (40)
- ENTRY(speculation_vector)
-+#ifdef XEN
-+      // this probably need not reflect...
-+      REFLECT(27)
-+#endif
-       DBG_FAULT(27)
-       /*
-        * A [f]chk.[as] instruction needs to take the branch to the recovery 
code but
-@@ -1228,6 +1416,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5900 Entry 29 (size 16 bundles) Debug (16,28,56)
- ENTRY(debug_vector)
-+#ifdef XEN
-+      REFLECT(29)
-+#endif
-       DBG_FAULT(29)
-       FAULT(29)
- END(debug_vector)
-@@ -1236,6 +1427,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57)
- ENTRY(unaligned_access)
-+#ifdef XEN
-+      REFLECT(30)
-+#endif
-       DBG_FAULT(30)
-       mov r16=cr.ipsr
-       mov r31=pr              // prepare to save predicates
-@@ -1247,6 +1441,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5b00 Entry 31 (size 16 bundles) Unsupported Data Reference (57)
- ENTRY(unsupported_data_reference)
-+#ifdef XEN
-+      REFLECT(31)
-+#endif
-       DBG_FAULT(31)
-       FAULT(31)
- END(unsupported_data_reference)
-@@ -1255,6 +1452,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5c00 Entry 32 (size 16 bundles) Floating-Point Fault (64)
- ENTRY(floating_point_fault)
-+#ifdef XEN
-+      REFLECT(32)
-+#endif
-       DBG_FAULT(32)
-       FAULT(32)
- END(floating_point_fault)
-@@ -1263,6 +1463,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5d00 Entry 33 (size 16 bundles) Floating Point Trap (66)
- ENTRY(floating_point_trap)
-+#ifdef XEN
-+      REFLECT(33)
-+#endif
-       DBG_FAULT(33)
-       FAULT(33)
- END(floating_point_trap)
-@@ -1271,6 +1474,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5e00 Entry 34 (size 16 bundles) Lower Privilege Transfer Trap (66)
- ENTRY(lower_privilege_trap)
-+#ifdef XEN
-+      REFLECT(34)
-+#endif
-       DBG_FAULT(34)
-       FAULT(34)
- END(lower_privilege_trap)
-@@ -1279,6 +1485,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x5f00 Entry 35 (size 16 bundles) Taken Branch Trap (68)
- ENTRY(taken_branch_trap)
-+#ifdef XEN
-+      REFLECT(35)
-+#endif
-       DBG_FAULT(35)
-       FAULT(35)
- END(taken_branch_trap)
-@@ -1287,6 +1496,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x6000 Entry 36 (size 16 bundles) Single Step Trap (69)
- ENTRY(single_step_trap)
-+#ifdef XEN
-+      REFLECT(36)
-+#endif
-       DBG_FAULT(36)
-       FAULT(36)
- END(single_step_trap)
-@@ -1343,6 +1555,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x6900 Entry 45 (size 16 bundles) IA-32 Exeception 
(17,18,29,41,42,43,44,58,60,61,62,72,73,75,76,77)
- ENTRY(ia32_exception)
-+#ifdef XEN
-+      REFLECT(45)
-+#endif
-       DBG_FAULT(45)
-       FAULT(45)
- END(ia32_exception)
-@@ -1351,6 +1566,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept  (30,31,59,70,71)
- ENTRY(ia32_intercept)
-+#ifdef XEN
-+      REFLECT(46)
-+#endif
-       DBG_FAULT(46)
- #ifdef        CONFIG_IA32_SUPPORT
-       mov r31=pr
-@@ -1381,6 +1599,9 @@
- 
/////////////////////////////////////////////////////////////////////////////////////////
- // 0x6b00 Entry 47 (size 16 bundles) IA-32 Interrupt  (74)
- ENTRY(ia32_interrupt)
-+#ifdef XEN
-+      REFLECT(47)
-+#endif
-       DBG_FAULT(47)
- #ifdef CONFIG_IA32_SUPPORT
-       mov r31=pr
-@@ -1510,6 +1731,39 @@
-       DBG_FAULT(67)
-       FAULT(67)
- 
-+#ifdef XEN
-+      .org ia64_ivt+0x8000
-+ENTRY(dispatch_reflection)
-+      /*
-+       * Input:
-+       *      psr.ic: off
-+       *      r19:    intr type (offset into ivt, see ia64_int.h)
-+       *      r31:    contains saved predicates (pr)
-+       */
-+      SAVE_MIN_WITH_COVER_R19
-+      alloc r14=ar.pfs,0,0,5,0
-+      mov out4=r15
-+      mov out0=cr.ifa
-+      adds out1=16,sp
-+      mov out2=cr.isr
-+      mov out3=cr.iim
-+//    mov out3=cr.itir
-+
-+      ssm psr.ic | PSR_DEFAULT_BITS
-+      ;;
-+      srlz.i                                  // guarantee that interruption 
collection is on
-+      ;;
-+(p15) ssm psr.i                               // restore psr.i
-+      adds r3=8,r2                            // set up second base pointer
-+      ;;
-+      SAVE_REST
-+      movl r14=ia64_leave_kernel
-+      ;;
-+      mov rp=r14
-+      br.sptk.many ia64_prepare_handle_reflection
-+END(dispatch_reflection)
-+#endif
-+
- #ifdef CONFIG_IA32_SUPPORT
- 
-       /*
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/kregs.h
--- a/xen/arch/ia64/patch/linux-2.6.7/kregs.h   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,13 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/kregs.h    
2004-06-15 23:19:01.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/kregs.h        
2004-09-17 18:27:22.000000000 -0600
-@@ -30,6 +30,10 @@
- #define IA64_TR_PALCODE               1       /* itr1: maps PALcode as 
required by EFI */
- #define IA64_TR_PERCPU_DATA   1       /* dtr1: percpu data */
- #define IA64_TR_CURRENT_STACK 2       /* dtr2: maps kernel's memory- & 
register-stacks */
-+#ifdef XEN
-+#define IA64_TR_SHARED_INFO   3       /* dtr3: page shared with domain */
-+#define       IA64_TR_VHPT            4       /* dtr4: vhpt */
-+#endif
- 
- /* Processor status register bits: */
- #define IA64_PSR_BE_BIT               1
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/lds.S
--- a/xen/arch/ia64/patch/linux-2.6.7/lds.S     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,17 +0,0 @@
---- 
/home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/arch/ia64/kernel/vmlinux.lds.S   
   2004-06-15 23:19:52.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/xen.lds.S     2004-08-25 
19:28:12.000000000 -0600
-@@ -11,12 +11,14 @@
- OUTPUT_FORMAT("elf64-ia64-little")
- OUTPUT_ARCH(ia64)
- ENTRY(phys_start)
-+#ifndef XEN
- jiffies = jiffies_64;
- PHDRS {
-   code   PT_LOAD;
-   percpu PT_LOAD;
-   data   PT_LOAD;
- }
-+#endif
- SECTIONS
- {
-   /* Sections to be discarded */
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/linuxtime.h
--- a/xen/arch/ia64/patch/linux-2.6.7/linuxtime.h       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,34 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/time.h        
2004-06-15 23:19:37.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/xen/linuxtime.h 2004-11-15 
17:42:04.000000000 -0700
-@@ -1,6 +1,11 @@
- #ifndef _LINUX_TIME_H
- #define _LINUX_TIME_H
- 
-+#ifdef XEN
-+typedef       s64 time_t;
-+typedef       s64 suseconds_t;
-+#endif
-+
- #include <asm/param.h>
- #include <linux/types.h>
- 
-@@ -25,7 +30,9 @@
- #ifdef __KERNEL__
- 
- #include <linux/spinlock.h>
-+#ifndef XEN
- #include <linux/seqlock.h>
-+#endif
- #include <linux/timex.h>
- #include <asm/div64.h>
- #ifndef div_long_long_rem
-@@ -322,7 +329,9 @@
- 
- extern struct timespec xtime;
- extern struct timespec wall_to_monotonic;
-+#ifndef XEN
- extern seqlock_t xtime_lock;
-+#endif
- 
- static inline unsigned long get_seconds(void)
- { 
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/mca_asm.h
--- a/xen/arch/ia64/patch/linux-2.6.7/mca_asm.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,32 +0,0 @@
---- ../../linux-2.6.7/include/asm-ia64/mca_asm.h       2004-06-15 
23:20:03.000000000 -0600
-+++ include/asm-ia64/mca_asm.h 2005-04-01 12:56:37.000000000 -0700
-@@ -26,8 +26,13 @@
-  * direct mapped to physical addresses.
-  *    1. Lop off bits 61 thru 63 in the virtual address
-  */
-+#ifdef XEN
-+#define INST_VA_TO_PA(addr)                                                   
\
-+      dep     addr    = 0, addr, 60, 4
-+#else // XEN
- #define INST_VA_TO_PA(addr)                                                   
\
-       dep     addr    = 0, addr, 61, 3
-+#endif // XEN
- /*
-  * This macro converts a data virtual address to a physical address
-  * Right now for simulation purposes the virtual addresses are
-@@ -42,9 +47,15 @@
-  * direct mapped to physical addresses.
-  *    1. Put 0x7 in bits 61 thru 63.
-  */
-+#ifdef XEN
-+#define DATA_PA_TO_VA(addr,temp)                                              
        \
-+      mov     temp    = 0xf   ;;                                              
        \
-+      dep     addr    = temp, addr, 60, 4
-+#else // XEN
- #define DATA_PA_TO_VA(addr,temp)                                              
        \
-       mov     temp    = 0x7   ;;                                              
        \
-       dep     addr    = temp, addr, 61, 3
-+#endif // XEN
- 
- /*
-  * This macro jumps to the instruction at the given virtual address
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/minstate.h
--- a/xen/arch/ia64/patch/linux-2.6.7/minstate.h        Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,29 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/kernel/minstate.h      2004-06-15 
23:19:52.000000000 -0600
-+++ arch/ia64/minstate.h       2005-04-01 12:56:01.000000000 -0700
-@@ -45,7 +45,7 @@
- (pKStk) tpa r1=sp;                            /* compute physical addr of sp  
*/              \
- (pUStk)       addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1;   /* compute base 
of memory stack */      \
- (pUStk)       mov r23=ar.bspstore;                            /* save 
ar.bspstore */                  \
--(pUStk)       dep r22=-1,r22,61,3;                    /* compute kernel 
virtual addr of RBS */        \
-+(pUStk)       dep r22=-1,r22,60,4;                    /* compute kernel 
virtual addr of RBS */        \
-       ;;                                                                      
                \
- (pKStk) addl r1=-IA64_PT_REGS_SIZE,r1;                /* if in kernel mode, 
use sp (r12) */           \
- (pUStk)       mov ar.bspstore=r22;                    /* switch to kernel RBS 
*/                      \
-@@ -65,7 +65,7 @@
- #endif
- 
- #ifdef MINSTATE_PHYS
--# define MINSTATE_GET_CURRENT(reg)    mov reg=IA64_KR(CURRENT);; dep 
reg=0,reg,61,3
-+# define MINSTATE_GET_CURRENT(reg)    mov reg=IA64_KR(CURRENT);; dep 
reg=0,reg,60,4
- # define MINSTATE_START_SAVE_MIN      MINSTATE_START_SAVE_MIN_PHYS
- # define MINSTATE_END_SAVE_MIN                MINSTATE_END_SAVE_MIN_PHYS
- #endif
-@@ -172,7 +172,7 @@
-       ;;                                                                      
                \
- .mem.offset 0,0; st8.spill [r16]=r15,16;                                      
                \
- .mem.offset 8,0; st8.spill [r17]=r14,16;                                      
                \
--      dep r14=-1,r0,61,3;                                                     
                \
-+      dep r14=-1,r0,60,4;                                                     
                \
-       ;;                                                                      
                \
- .mem.offset 0,0; st8.spill [r16]=r2,16;                                       
                        \
- .mem.offset 8,0; st8.spill [r17]=r3,16;                                       
                        \
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.7/mm_bootmem.c
--- a/xen/arch/ia64/patch/linux-2.6.7/mm_bootmem.c      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,92 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/mm/bootmem.c        
2004-06-15 23:19:09.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/mm_bootmem.c  2004-12-17 
13:47:03.000000000 -0700
-@@ -10,7 +10,9 @@
-  */
- 
- #include <linux/mm.h>
-+#ifndef XEN
- #include <linux/kernel_stat.h>
-+#endif
- #include <linux/swap.h>
- #include <linux/interrupt.h>
- #include <linux/init.h>
-@@ -55,6 +57,9 @@
-       bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT);
-       bdata->node_boot_start = (start << PAGE_SHIFT);
-       bdata->node_low_pfn = end;
-+#ifdef XEN
-+//printk("init_bootmem_core: 
mapstart=%lx,start=%lx,end=%lx,bdata->node_bootmem_map=%lx,bdata->node_boot_start=%lx,bdata->node_low_pfn=%lx\n",mapstart,start,end,bdata->node_bootmem_map,bdata->node_boot_start,bdata->node_low_pfn);
-+#endif
- 
-       /*
-        * Initially all pages are reserved - setup_arch() has to
-@@ -146,6 +151,9 @@
-       unsigned long i, start = 0, incr, eidx;
-       void *ret;
- 
-+#ifdef XEN
-+//printf("__alloc_bootmem_core(%lx,%lx,%lx,%lx) 
called\n",bdata,size,align,goal);
-+#endif
-       if(!size) {
-               printk("__alloc_bootmem_core(): zero-sized request\n");
-               BUG();
-@@ -153,6 +161,9 @@
-       BUG_ON(align & (align-1));
- 
-       eidx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
-+#ifdef XEN
-+//printf("__alloc_bootmem_core: eidx=%lx\n",eidx);
-+#endif
-       offset = 0;
-       if (align &&
-           (bdata->node_boot_start & (align - 1UL)) != 0)
-@@ -182,6 +193,9 @@
-               unsigned long j;
-               i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);
-               i = ALIGN(i, incr);
-+#ifdef XEN
-+//if (i >= eidx) goto fail_block;
-+#endif
-               if (test_bit(i, bdata->node_bootmem_map))
-                       continue;
-               for (j = i + 1; j < i + areasize; ++j) {
-@@ -203,6 +217,9 @@
-       return NULL;
- 
- found:
-+#ifdef XEN
-+//printf("__alloc_bootmem_core: start=%lx\n",start);
-+#endif
-       bdata->last_success = start << PAGE_SHIFT;
-       BUG_ON(start >= eidx);
- 
-@@ -262,6 +279,9 @@
-       page = virt_to_page(phys_to_virt(bdata->node_boot_start));
-       idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
-       map = bdata->node_bootmem_map;
-+#ifdef XEN
-+//printk("free_all_bootmem_core: bdata=%lx, bdata->node_boot_start=%lx, 
bdata->node_low_pfn=%lx, 
bdata->node_bootmem_map=%lx\n",bdata,bdata->node_boot_start,bdata->node_low_pfn,bdata->node_bootmem_map);
-+#endif
-       for (i = 0; i < idx; ) {
-               unsigned long v = ~map[i / BITS_PER_LONG];
-               if (v) {
-@@ -285,6 +305,9 @@
-        * Now free the allocator bitmap itself, it's not
-        * needed anymore:
-        */
-+#ifdef XEN
-+//printk("About to free the allocator bitmap itself\n");
-+#endif
-       page = virt_to_page(bdata->node_bootmem_map);
-       count = 0;
-       for (i = 0; i < ((bdata->node_low_pfn-(bdata->node_boot_start >> 
PAGE_SHIFT))/8 + PAGE_SIZE-1)/PAGE_SIZE; i++,page++) {
-@@ -327,6 +350,9 @@
-       return(init_bootmem_core(&contig_page_data, start, 0, pages));
- }
- 
-+#ifdef XEN
-+#undef reserve_bootmem
-+#endif
- #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
- void __init reserve_bootmem (unsigned long addr, unsigned long size)
- {
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/mm_contig.c
--- a/xen/arch/ia64/patch/linux-2.6.7/mm_contig.c       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,216 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/mm/contig.c    2004-06-15 23:19:12.000000000 
-0600
-+++ arch/ia64/mm_contig.c      2005-03-23 14:54:06.000000000 -0700
-@@ -15,11 +15,21 @@
-  * memory.
-  */
- #include <linux/config.h>
-+#ifdef XEN
-+#include <xen/sched.h>
-+#endif
- #include <linux/bootmem.h>
- #include <linux/efi.h>
- #include <linux/mm.h>
- #include <linux/swap.h>
- 
-+#ifdef XEN
-+#undef reserve_bootmem
-+extern struct page *zero_page_memmap_ptr;
-+struct page *mem_map;
-+#define MAX_DMA_ADDRESS ~0UL  // FIXME???
-+#endif
-+
- #include <asm/meminit.h>
- #include <asm/pgalloc.h>
- #include <asm/pgtable.h>
-@@ -37,30 +47,7 @@
- void
- show_mem (void)
- {
--      int i, total = 0, reserved = 0;
--      int shared = 0, cached = 0;
--
--      printk("Mem-info:\n");
--      show_free_areas();
--
--      printk("Free swap:       %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
--      i = max_mapnr;
--      while (i-- > 0) {
--              if (!pfn_valid(i))
--                      continue;
--              total++;
--              if (PageReserved(mem_map+i))
--                      reserved++;
--              else if (PageSwapCache(mem_map+i))
--                      cached++;
--              else if (page_count(mem_map + i))
--                      shared += page_count(mem_map + i) - 1;
--      }
--      printk("%d pages of RAM\n", total);
--      printk("%d reserved pages\n", reserved);
--      printk("%d pages shared\n", shared);
--      printk("%d pages swap cached\n", cached);
--      printk("%ld pages in page table cache\n", pgtable_cache_size);
-+      printk("Dummy show_mem\n");
- }
- 
- /* physical address where the bootmem map is located */
-@@ -80,6 +67,9 @@
- {
-       unsigned long *max_pfnp = arg, pfn;
- 
-+#ifdef XEN
-+//printf("find_max_pfn: start=%lx, end=%lx, *arg=%lx\n",start,end,*(unsigned 
long *)arg);
-+#endif
-       pfn = (PAGE_ALIGN(end - 1) - PAGE_OFFSET) >> PAGE_SHIFT;
-       if (pfn > *max_pfnp)
-               *max_pfnp = pfn;
-@@ -133,41 +123,6 @@
-       return 0;
- }
- 
--/**
-- * find_memory - setup memory map
-- *
-- * Walk the EFI memory map and find usable memory for the system, taking
-- * into account reserved areas.
-- */
--void
--find_memory (void)
--{
--      unsigned long bootmap_size;
--
--      reserve_memory();
--
--      /* first find highest page frame number */
--      max_pfn = 0;
--      efi_memmap_walk(find_max_pfn, &max_pfn);
--
--      /* how many bytes to cover all the pages */
--      bootmap_size = bootmem_bootmap_pages(max_pfn) << PAGE_SHIFT;
--
--      /* look for a location to hold the bootmap */
--      bootmap_start = ~0UL;
--      efi_memmap_walk(find_bootmap_location, &bootmap_size);
--      if (bootmap_start == ~0UL)
--              panic("Cannot find %ld bytes for bootmap\n", bootmap_size);
--
--      bootmap_size = init_bootmem(bootmap_start >> PAGE_SHIFT, max_pfn);
--
--      /* Free all available memory, then mark bootmem-map as being in use. */
--      efi_memmap_walk(filter_rsvd_memory, free_bootmem);
--      reserve_bootmem(bootmap_start, bootmap_size);
--
--      find_initrd();
--}
--
- #ifdef CONFIG_SMP
- /**
-  * per_cpu_init - setup per-cpu variables
-@@ -227,73 +182,42 @@
- void
- paging_init (void)
- {
--      unsigned long max_dma;
--      unsigned long zones_size[MAX_NR_ZONES];
--#ifdef CONFIG_VIRTUAL_MEM_MAP
--      unsigned long zholes_size[MAX_NR_ZONES];
--      unsigned long max_gap;
--#endif
--
--      /* initialize mem_map[] */
-+      struct pfn_info *pg;
-+      /* Allocate and map the machine-to-phys table */
-+      if ((pg = alloc_domheap_pages(NULL, 10)) == NULL)
-+              panic("Not enough memory to bootstrap Xen.\n");
-+      memset(page_to_virt(pg), 0x55, 16UL << 20);
- 
--      memset(zones_size, 0, sizeof(zones_size));
-+      /* Other mapping setup */
- 
--      num_physpages = 0;
--      efi_memmap_walk(count_pages, &num_physpages);
- 
--      max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;
--
--#ifdef CONFIG_VIRTUAL_MEM_MAP
--      memset(zholes_size, 0, sizeof(zholes_size));
--
--      num_dma_physpages = 0;
--      efi_memmap_walk(count_dma_pages, &num_dma_physpages);
--
--      if (max_low_pfn < max_dma) {
--              zones_size[ZONE_DMA] = max_low_pfn;
--              zholes_size[ZONE_DMA] = max_low_pfn - num_dma_physpages;
--      } else {
--              zones_size[ZONE_DMA] = max_dma;
--              zholes_size[ZONE_DMA] = max_dma - num_dma_physpages;
--              if (num_physpages > num_dma_physpages) {
--                      zones_size[ZONE_NORMAL] = max_low_pfn - max_dma;
--                      zholes_size[ZONE_NORMAL] =
--                              ((max_low_pfn - max_dma) -
--                               (num_physpages - num_dma_physpages));
--              }
--      }
--
--      max_gap = 0;
--      efi_memmap_walk(find_largest_hole, (u64 *)&max_gap);
--      if (max_gap < LARGE_GAP) {
--              vmem_map = (struct page *) 0;
--              free_area_init_node(0, &contig_page_data, NULL, zones_size, 0,
--                                  zholes_size);
--              mem_map = contig_page_data.node_mem_map;
--      } else {
--              unsigned long map_size;
--
--              /* allocate virtual_mem_map */
--
--              map_size = PAGE_ALIGN(max_low_pfn * sizeof(struct page));
--              vmalloc_end -= map_size;
--              vmem_map = (struct page *) vmalloc_end;
--              efi_memmap_walk(create_mem_map_page_table, 0);
--
--              free_area_init_node(0, &contig_page_data, vmem_map, zones_size,
--                                  0, zholes_size);
--
--              mem_map = contig_page_data.node_mem_map;
--              printk("Virtual mem_map starts at 0x%p\n", mem_map);
--      }
--#else /* !CONFIG_VIRTUAL_MEM_MAP */
--      if (max_low_pfn < max_dma)
--              zones_size[ZONE_DMA] = max_low_pfn;
--      else {
--              zones_size[ZONE_DMA] = max_dma;
--              zones_size[ZONE_NORMAL] = max_low_pfn - max_dma;
--      }
--      free_area_init(zones_size);
--#endif /* !CONFIG_VIRTUAL_MEM_MAP */
-       zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
- }
-+
-+struct pfn_info *frame_table;
-+unsigned long frame_table_size;
-+unsigned long max_page;
-+
-+/* FIXME: postpone support to machines with big holes between physical 
memorys.
-+ * Current hack allows only efi memdesc upto 4G place. (See efi.c)
-+ */ 
-+#ifndef CONFIG_VIRTUAL_MEM_MAP
-+#define FT_ALIGN_SIZE (16UL << 20)
-+void __init init_frametable(void)
-+{
-+      unsigned long i, p;
-+      frame_table_size = max_page * sizeof(struct pfn_info);
-+      frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
-+
-+      /* Request continuous trunk from boot allocator, since HV
-+       * address is identity mapped */
-+      p = alloc_boot_pages(frame_table_size>>PAGE_SHIFT, 
FT_ALIGN_SIZE>>PAGE_SHIFT) << PAGE_SHIFT;
-+      if (p == 0)
-+              panic("Not enough memory for frame table.\n");
-+
-+      frame_table = __va(p);
-+      memset(frame_table, 0, frame_table_size);
-+      printk("size of frame_table: %lukB\n",
-+              frame_table_size >> 10);
-+}
-+#endif
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/mmzone.h
--- a/xen/arch/ia64/patch/linux-2.6.7/mmzone.h  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,14 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/mmzone.h      
2004-06-15 23:19:36.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/linux/mmzone.h 
2004-08-25 19:28:13.000000000 -0600
-@@ -185,7 +185,11 @@
-       char                    *name;
-       unsigned long           spanned_pages;  /* total size, including holes 
*/
-       unsigned long           present_pages;  /* amount of memory (excluding 
holes) */
-+#ifdef XEN
-+};
-+#else
- } ____cacheline_maxaligned_in_smp;
-+#endif
- 
- 
- /*
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/page.h
--- a/xen/arch/ia64/patch/linux-2.6.7/page.h    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,84 +0,0 @@
---- ../../linux-2.6.7/include/asm-ia64/page.h  2004-06-15 23:18:58.000000000 
-0600
-+++ include/asm-ia64/page.h    2005-04-01 12:56:37.000000000 -0700
-@@ -12,6 +12,9 @@
- #include <asm/intrinsics.h>
- #include <asm/types.h>
- 
-+#ifndef __ASSEMBLY__
-+#include <asm/flushtlb.h>
-+#endif
- /*
-  * PAGE_SHIFT determines the actual kernel page size.
-  */
-@@ -84,14 +87,22 @@
- #endif
- 
- #ifndef CONFIG_DISCONTIGMEM
-+#ifdef XEN
-+#define pfn_valid(pfn)                (0)
-+#else
- #define pfn_valid(pfn)                (((pfn) < max_mapnr) && 
ia64_pfn_valid(pfn))
--#define page_to_pfn(page)     ((unsigned long) (page - mem_map))
--#define pfn_to_page(pfn)      (mem_map + (pfn))
-+#endif
- #endif /* CONFIG_DISCONTIGMEM */
- 
--#define page_to_phys(page)    (page_to_pfn(page) << PAGE_SHIFT)
-+#define page_to_pfn(_page)  ((unsigned long)((_page) - frame_table))
-+#define page_to_virt(_page) phys_to_virt(page_to_phys(_page))
-+
-+#define page_to_phys(_page)   (page_to_pfn(_page) << PAGE_SHIFT)
- #define virt_to_page(kaddr)   pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
- 
-+#define pfn_to_page(_pfn)     (frame_table + (_pfn))
-+#define phys_to_page(kaddr)   pfn_to_page(((kaddr) >> PAGE_SHIFT))
-+
- typedef union ia64_va {
-       struct {
-               unsigned long off : 61;         /* intra-region offset */
-@@ -107,8 +118,25 @@
-  * expressed in this way to ensure they result in a single "dep"
-  * instruction.
-  */
-+#ifdef XEN
-+typedef union xen_va {
-+      struct {
-+              unsigned long off : 60;
-+              unsigned long reg : 4;
-+      } f;
-+      unsigned long l;
-+      void *p;
-+} xen_va;
-+
-+// xen/drivers/console.c uses __va in a declaration (should be fixed!)
-+#define __pa(x)               ({xen_va _v; _v.l = (long) (x); _v.f.reg = 0; 
_v.l;})
-+#define __va(x)               ({xen_va _v; _v.l = (long) (x); _v.f.reg = -1; 
_v.p;})
-+//# define __pa(x)    ((unsigned long)(((unsigned long)x) - PAGE_OFFSET))
-+//# define __va(x)    ((void *)((char *)(x) + PAGE_OFFSET))
-+#else
- #define __pa(x)               ({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; 
_v.l;})
- #define __va(x)               ({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; 
_v.p;})
-+#endif
- 
- #define REGION_NUMBER(x)      ({ia64_va _v; _v.l = (long) (x); _v.f.reg;})
- #define REGION_OFFSET(x)      ({ia64_va _v; _v.l = (long) (x); _v.f.off;})
-@@ -180,11 +208,19 @@
- # define __pgprot(x)  (x)
- #endif /* !STRICT_MM_TYPECHECKS */
- 
-+#ifdef XEN
-+#define PAGE_OFFSET                   0xf000000000000000
-+#else
- #define PAGE_OFFSET                   0xe000000000000000
-+#endif
- 
- #define VM_DATA_DEFAULT_FLAGS         (VM_READ | VM_WRITE |                   
                \
-                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC 
|                \
-                                        (((current->thread.flags & 
IA64_THREAD_XSTACK) != 0)   \
-                                         ? VM_EXEC : 0))
- 
-+#ifdef XEN
-+#define __flush_tlb() do {} while(0);
-+#endif
-+
- #endif /* _ASM_IA64_PAGE_H */
diff -r 5978be010bec -r 2b95125015a5 
xen/arch/ia64/patch/linux-2.6.7/page_alloc.c
--- a/xen/arch/ia64/patch/linux-2.6.7/page_alloc.c      Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,305 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/mm/page_alloc.c     
2004-06-15 23:18:57.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/page_alloc.c  2004-12-17 
13:47:03.000000000 -0700
-@@ -19,20 +19,28 @@
- #include <linux/mm.h>
- #include <linux/swap.h>
- #include <linux/interrupt.h>
-+#ifndef XEN
- #include <linux/pagemap.h>
-+#endif
- #include <linux/bootmem.h>
- #include <linux/compiler.h>
- #include <linux/module.h>
-+#ifndef XEN
- #include <linux/suspend.h>
- #include <linux/pagevec.h>
- #include <linux/blkdev.h>
-+#endif
- #include <linux/slab.h>
-+#ifndef XEN
- #include <linux/notifier.h>
-+#endif
- #include <linux/topology.h>
-+#ifndef XEN
- #include <linux/sysctl.h>
- #include <linux/cpu.h>
- 
- #include <asm/tlbflush.h>
-+#endif
- 
- DECLARE_BITMAP(node_online_map, MAX_NUMNODES);
- struct pglist_data *pgdat_list;
-@@ -71,6 +79,9 @@
- 
- static void bad_page(const char *function, struct page *page)
- {
-+#ifdef XEN
-+printk("bad_page: called but disabled\n");
-+#else
-       printk(KERN_EMERG "Bad page state at %s (in process '%s', page %p)\n",
-               function, current->comm, page);
-       printk(KERN_EMERG "flags:0x%08lx mapping:%p mapcount:%d count:%d\n",
-@@ -91,6 +102,7 @@
-       set_page_count(page, 0);
-       page->mapping = NULL;
-       page->mapcount = 0;
-+#endif
- }
- 
- #ifndef CONFIG_HUGETLB_PAGE
-@@ -218,6 +230,7 @@
- 
- static inline void free_pages_check(const char *function, struct page *page)
- {
-+#ifndef XEN
-       if (    page_mapped(page) ||
-               page->mapping != NULL ||
-               page_count(page) != 0 ||
-@@ -233,6 +246,7 @@
-                       1 << PG_swapcache |
-                       1 << PG_writeback )))
-               bad_page(function, page);
-+#endif
-       if (PageDirty(page))
-               ClearPageDirty(page);
- }
-@@ -276,6 +290,9 @@
- 
- void __free_pages_ok(struct page *page, unsigned int order)
- {
-+#ifdef XEN
-+printk("__free_pages_ok: called but disabled\n");
-+#else
-       LIST_HEAD(list);
-       int i;
- 
-@@ -285,6 +302,7 @@
-       list_add(&page->lru, &list);
-       kernel_map_pages(page, 1<<order, 0);
-       free_pages_bulk(page_zone(page), 1, &list, order);
-+#endif
- }
- 
- #define MARK_USED(index, order, area) \
-@@ -330,6 +348,7 @@
-  */
- static void prep_new_page(struct page *page, int order)
- {
-+#ifndef XEN
-       if (page->mapping || page_mapped(page) ||
-           (page->flags & (
-                       1 << PG_private |
-@@ -343,11 +362,14 @@
-                       1 << PG_swapcache |
-                       1 << PG_writeback )))
-               bad_page(__FUNCTION__, page);
-+#endif
- 
-       page->flags &= ~(1 << PG_uptodate | 1 << PG_error |
-                       1 << PG_referenced | 1 << PG_arch_1 |
-                       1 << PG_checked | 1 << PG_mappedtodisk);
-+#ifndef XEN
-       page->private = 0;
-+#endif
-       set_page_refs(page, order);
- }
- 
-@@ -590,13 +612,17 @@
-       unsigned long min;
-       struct zone **zones;
-       struct page *page;
-+#ifndef XEN
-       struct reclaim_state reclaim_state;
-+#endif
-       struct task_struct *p = current;
-       int i;
-       int alloc_type;
-       int do_retry;
- 
-+#ifndef XEN
-       might_sleep_if(wait);
-+#endif
- 
-       zones = zonelist->zones;  /* the list of zones suitable for gfp_mask */
-       if (zones[0] == NULL)     /* no zones in the zonelist */
-@@ -610,12 +636,14 @@
- 
-               min = (1<<order) + z->protection[alloc_type];
- 
-+#ifndef XEN
-               /*
-                * We let real-time tasks dip their real-time paws a little
-                * deeper into reserves.
-                */
-               if (rt_task(p))
-                       min -= z->pages_low >> 1;
-+#endif
- 
-               if (z->free_pages >= min ||
-                               (!wait && z->free_pages >= z->pages_high)) {
-@@ -627,9 +655,11 @@
-               }
-       }
- 
-+#ifndef XEN
-       /* we're somewhat low on memory, failed to find what we needed */
-       for (i = 0; zones[i] != NULL; i++)
-               wakeup_kswapd(zones[i]);
-+#endif
- 
-       /* Go through the zonelist again, taking __GFP_HIGH into account */
-       for (i = 0; zones[i] != NULL; i++) {
-@@ -639,8 +669,10 @@
- 
-               if (gfp_mask & __GFP_HIGH)
-                       min -= z->pages_low >> 2;
-+#ifndef XEN
-               if (rt_task(p))
-                       min -= z->pages_low >> 1;
-+#endif
- 
-               if (z->free_pages >= min ||
-                               (!wait && z->free_pages >= z->pages_high)) {
-@@ -654,6 +686,7 @@
- 
-       /* here we're in the low on memory slow path */
- 
-+#ifndef XEN
- rebalance:
-       if ((p->flags & (PF_MEMALLOC | PF_MEMDIE)) && !in_interrupt()) {
-               /* go through the zonelist yet again, ignoring mins */
-@@ -681,6 +714,7 @@
- 
-       p->reclaim_state = NULL;
-       p->flags &= ~PF_MEMALLOC;
-+#endif
- 
-       /* go through the zonelist yet one more time */
-       for (i = 0; zones[i] != NULL; i++) {
-@@ -698,6 +732,11 @@
-               }
-       }
- 
-+#ifdef XEN
-+printk(KERN_WARNING "%s: page allocation failure."
-+                      " order:%d, mode:0x%x\n",
-+                      "(xen tasks have no comm)", order, gfp_mask);
-+#else
-       /*
-        * Don't let big-order allocations loop unless the caller explicitly
-        * requests that.  Wait for some write requests to complete then retry.
-@@ -724,6 +763,7 @@
-                       p->comm, order, gfp_mask);
-               dump_stack();
-       }
-+#endif
-       return NULL;
- got_pg:
-       kernel_map_pages(page, 1 << order, 1);
-@@ -808,6 +848,7 @@
- 
- EXPORT_SYMBOL(get_zeroed_page);
- 
-+#ifndef XEN
- void __pagevec_free(struct pagevec *pvec)
- {
-       int i = pagevec_count(pvec);
-@@ -815,10 +856,15 @@
-       while (--i >= 0)
-               free_hot_cold_page(pvec->pages[i], pvec->cold);
- }
-+#endif
- 
- fastcall void __free_pages(struct page *page, unsigned int order)
- {
-+#ifdef XEN
-+      if (!PageReserved(page)) {
-+#else
-       if (!PageReserved(page) && put_page_testzero(page)) {
-+#endif
-               if (order == 0)
-                       free_hot_page(page);
-               else
-@@ -914,6 +960,13 @@
-       return nr_free_zone_pages(GFP_HIGHUSER & GFP_ZONEMASK);
- }
- 
-+#ifdef XEN
-+unsigned int nr_free_highpages (void)
-+{
-+printf("nr_free_highpages: called but not implemented\n");
-+}
-+#endif
-+
- #ifdef CONFIG_HIGHMEM
- unsigned int nr_free_highpages (void)
- {
-@@ -1022,6 +1075,7 @@
- 
- void si_meminfo(struct sysinfo *val)
- {
-+#ifndef XEN
-       val->totalram = totalram_pages;
-       val->sharedram = 0;
-       val->freeram = nr_free_pages();
-@@ -1034,6 +1088,7 @@
-       val->freehigh = 0;
- #endif
-       val->mem_unit = PAGE_SIZE;
-+#endif
- }
- 
- EXPORT_SYMBOL(si_meminfo);
-@@ -1165,7 +1220,9 @@
-               printk("= %lukB\n", K(total));
-       }
- 
-+#ifndef XEN
-       show_swap_cache_info();
-+#endif
- }
- 
- /*
-@@ -1530,6 +1587,9 @@
-               zone->wait_table_size = wait_table_size(size);
-               zone->wait_table_bits =
-                       wait_table_bits(zone->wait_table_size);
-+#ifdef XEN
-+//printf("free_area_init_core-1: calling 
alloc_bootmem_node(%lx,%lx)\n",pgdat,zone->wait_table_size * 
sizeof(wait_queue_head_t));
-+#endif
-               zone->wait_table = (wait_queue_head_t *)
-                       alloc_bootmem_node(pgdat, zone->wait_table_size
-                                               * sizeof(wait_queue_head_t));
-@@ -1584,6 +1644,9 @@
-                        */
-                       bitmap_size = (size-1) >> (i+4);
-                       bitmap_size = LONG_ALIGN(bitmap_size+1);
-+#ifdef XEN
-+//printf("free_area_init_core-2: calling 
alloc_bootmem_node(%lx,%lx)\n",pgdat, bitmap_size);
-+#endif
-                       zone->free_area[i].map = 
-                         (unsigned long *) alloc_bootmem_node(pgdat, 
bitmap_size);
-               }
-@@ -1601,6 +1664,9 @@
-       calculate_zone_totalpages(pgdat, zones_size, zholes_size);
-       if (!node_mem_map) {
-               size = (pgdat->node_spanned_pages + 1) * sizeof(struct page);
-+#ifdef XEN
-+//printf("free_area_init_node: calling 
alloc_bootmem_node(%lx,%lx)\n",pgdat,size);
-+#endif
-               node_mem_map = alloc_bootmem_node(pgdat, size);
-       }
-       pgdat->node_mem_map = node_mem_map;
-@@ -1784,6 +1850,7 @@
- 
- #endif /* CONFIG_PROC_FS */
- 
-+#ifndef XEN
- #ifdef CONFIG_HOTPLUG_CPU
- static int page_alloc_cpu_notify(struct notifier_block *self,
-                                unsigned long action, void *hcpu)
-@@ -2011,3 +2078,4 @@
-       setup_per_zone_protection();
-       return 0;
- }
-+#endif
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/pal.S
--- a/xen/arch/ia64/patch/linux-2.6.7/pal.S     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,26 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/kernel/pal.S   2004-06-15 23:20:25.000000000 
-0600
-+++ arch/ia64/pal.S    2005-04-01 12:56:01.000000000 -0700
-@@ -163,7 +163,11 @@
-       adds r8  = 1f-1b,r8             // calculate return address for call
-       ;;
-       mov loc4=ar.rsc                 // save RSE configuration
-+#ifdef XEN
-+      dep.z loc2=loc2,0,60            // convert pal entry point to physical
-+#else // XEN
-       dep.z loc2=loc2,0,61            // convert pal entry point to physical
-+#endif // XEN
-       tpa r8=r8                       // convert rp to physical
-       ;;
-       mov b7 = loc2                   // install target to branch reg
-@@ -218,7 +222,11 @@
-       mov loc3 = psr          // save psr
-       ;;
-       mov loc4=ar.rsc                 // save RSE configuration
-+#ifdef XEN
-+      dep.z loc2=loc2,0,60            // convert pal entry point to physical
-+#else // XEN
-       dep.z loc2=loc2,0,61            // convert pal entry point to physical
-+#endif // XEN
-       ;;
-       mov ar.rsc=0                    // put RSE in enforced lazy, LE mode
-       movl r16=PAL_PSR_BITS_TO_CLEAR
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/pgalloc.h
--- a/xen/arch/ia64/patch/linux-2.6.7/pgalloc.h Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,65 +0,0 @@
---- ../../linux-2.6.7/include/asm-ia64/pgalloc.h       2004-06-15 
23:18:54.000000000 -0600
-+++ include/asm-ia64/pgalloc.h 2005-03-23 14:54:11.000000000 -0700
-@@ -34,6 +34,10 @@
- #define pmd_quicklist         (local_cpu_data->pmd_quick)
- #define pgtable_cache_size    (local_cpu_data->pgtable_cache_sz)
- 
-+/* FIXME: Later 3 level page table should be over, to create 
-+ * new interface upon xen memory allocator. To simplify first
-+ * effort moving to xen allocator, use xenheap pages temporarily. 
-+ */
- static inline pgd_t*
- pgd_alloc_one_fast (struct mm_struct *mm)
- {
-@@ -55,7 +59,7 @@
-       pgd_t *pgd = pgd_alloc_one_fast(mm);
- 
-       if (unlikely(pgd == NULL)) {
--              pgd = (pgd_t *)__get_free_page(GFP_KERNEL);
-+              pgd = (pgd_t *)alloc_xenheap_page();
-               if (likely(pgd != NULL))
-                       clear_page(pgd);
-       }
-@@ -93,7 +97,7 @@
- static inline pmd_t*
- pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
- {
--      pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
-+      pmd_t *pmd = (pmd_t *)alloc_xenheap_page();
- 
-       if (likely(pmd != NULL))
-               clear_page(pmd);
-@@ -125,7 +129,7 @@
- static inline struct page *
- pte_alloc_one (struct mm_struct *mm, unsigned long addr)
- {
--      struct page *pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
-+      struct page *pte = alloc_xenheap_page();
- 
-       if (likely(pte != NULL))
-               clear_page(page_address(pte));
-@@ -135,7 +139,7 @@
- static inline pte_t *
- pte_alloc_one_kernel (struct mm_struct *mm, unsigned long addr)
- {
--      pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
-+      pte_t *pte = (pte_t *)alloc_xenheap_page();
- 
-       if (likely(pte != NULL))
-               clear_page(pte);
-@@ -145,13 +149,13 @@
- static inline void
- pte_free (struct page *pte)
- {
--      __free_page(pte);
-+      free_xenheap_page(pte);
- }
- 
- static inline void
- pte_free_kernel (pte_t *pte)
- {
--      free_page((unsigned long) pte);
-+      free_xenheap_page((unsigned long) pte);
- }
- 
- #define __pte_free_tlb(tlb, pte)      tlb_remove_page((tlb), (pte))
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/processor.h
--- a/xen/arch/ia64/patch/linux-2.6.7/processor.h       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,19 +0,0 @@
---- 
/home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/processor.h     
   2005-01-23 13:23:36.000000000 -0700
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/processor.h    
2004-08-25 19:28:13.000000000 -0600
-@@ -406,12 +406,16 @@
-  */
- 
- /* Return TRUE if task T owns the fph partition of the CPU we're running on. 
*/
-+#ifdef XEN
-+#define ia64_is_local_fpu_owner(t) 0
-+#else
- #define ia64_is_local_fpu_owner(t)                                            
                \
- ({                                                                            
                \
-       struct task_struct *__ia64_islfo_task = (t);                            
                \
-       (__ia64_islfo_task->thread.last_fph_cpu == smp_processor_id()           
                \
-        && __ia64_islfo_task == (struct task_struct *) 
ia64_get_kr(IA64_KR_FPU_OWNER));        \
- })
-+#endif
- 
- /* Mark task T as owning the fph partition of the CPU we're running on. */
- #define ia64_set_local_fpu_owner(t) do {                                      
        \
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/sal.h
--- a/xen/arch/ia64/patch/linux-2.6.7/sal.h     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,26 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/sal.h      
2004-06-15 23:20:04.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/sal.h  2004-10-27 
13:55:23.000000000 -0600
-@@ -646,7 +646,23 @@
- {
-       struct ia64_sal_retval isrv;
- 
-+//#ifdef XEN
-+#if 0
-+      unsigned long *x = (unsigned long *)ia64_sal;
-+      unsigned long *inst = (unsigned long *)*x;
-+      unsigned long __ia64_sc_flags;
-+      struct ia64_fpreg __ia64_sc_fr[6];
-+printf("ia64_sal_freq_base: about to save_scratch_fpregs\n");
-+      ia64_save_scratch_fpregs(__ia64_sc_fr);
-+      spin_lock_irqsave(&sal_lock, __ia64_sc_flags);
-+printf("ia64_sal_freq_base: about to call, ia64_sal=%p, ia64_sal[0]=%p, 
ia64_sal[1]=%p\n",x,x[0],x[1]);
-+printf("first inst=%p,%p\n",inst[0],inst[1]);
-+      isrv = (*ia64_sal)(SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0);
-+      spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags);
-+      ia64_load_scratch_fpregs(__ia64_sc_fr);
-+#else
-       SAL_CALL(isrv, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0);
-+#endif
-       *ticks_per_second = isrv.v0;
-       *drift_info = isrv.v1;
-       return isrv.status;
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/setup.c
--- a/xen/arch/ia64/patch/linux-2.6.7/setup.c   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,203 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/kernel/setup.c 2004-06-15 23:18:58.000000000 
-0600
-+++ arch/ia64/setup.c  2005-04-04 22:31:09.000000000 -0600
-@@ -21,6 +21,9 @@
- #include <linux/init.h>
- 
- #include <linux/acpi.h>
-+#ifdef XEN
-+#include <xen/sched.h>
-+#endif
- #include <linux/bootmem.h>
- #include <linux/console.h>
- #include <linux/delay.h>
-@@ -30,13 +33,17 @@
- #include <linux/seq_file.h>
- #include <linux/string.h>
- #include <linux/threads.h>
-+#ifndef XEN
- #include <linux/tty.h>
- #include <linux/serial.h>
- #include <linux/serial_core.h>
-+#endif
- #include <linux/efi.h>
- #include <linux/initrd.h>
- 
-+#ifndef XEN
- #include <asm/ia32.h>
-+#endif
- #include <asm/machvec.h>
- #include <asm/mca.h>
- #include <asm/meminit.h>
-@@ -50,6 +57,11 @@
- #include <asm/smp.h>
- #include <asm/system.h>
- #include <asm/unistd.h>
-+#ifdef XEN
-+#include <linux/mm.h>
-+#include <asm/mmu_context.h>
-+extern unsigned long loops_per_jiffy; // from linux/init/main.c
-+#endif
- 
- #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
- # error "struct cpuinfo_ia64 too big!"
-@@ -65,7 +77,9 @@
- DEFINE_PER_CPU(unsigned long, ia64_phys_stacked_size_p8);
- unsigned long ia64_cycles_per_usec;
- struct ia64_boot_param *ia64_boot_param;
-+#ifndef XEN
- struct screen_info screen_info;
-+#endif
- 
- unsigned long ia64_max_cacheline_size;
- unsigned long ia64_iobase;    /* virtual address for I/O accesses */
-@@ -98,7 +112,6 @@
- struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
- int num_rsvd_regions;
- 
--
- /*
-  * Filter incoming memory segments based on the primitive map created from 
the boot
-  * parameters. Segments contained in the map are removed from the memory 
ranges. A
-@@ -128,9 +141,12 @@
-       for (i = 0; i < num_rsvd_regions; ++i) {
-               range_start = max(start, prev_start);
-               range_end   = min(end, rsvd_region[i].start);
--
--              if (range_start < range_end)
--                      call_pernode_memory(__pa(range_start), range_end - 
range_start, func);
-+              /* init_boot_pages requires "ps, pe" */
-+              if (range_start < range_end) {
-+                      printk("Init boot pages: 0x%lx -> 0x%lx.\n",
-+                              __pa(range_start), __pa(range_end));
-+                      (*func)(__pa(range_start), __pa(range_end), 0);
-+              }
- 
-               /* nothing more available in this segment */
-               if (range_end == end) return 0;
-@@ -187,17 +203,17 @@
-                               + strlen(__va(ia64_boot_param->command_line)) + 
1);
-       n++;
- 
-+      /* Reserve xen image/bitmap/xen-heap */
-       rsvd_region[n].start = (unsigned long) ia64_imva((void *)KERNEL_START);
--      rsvd_region[n].end   = (unsigned long) ia64_imva(_end);
-+      rsvd_region[n].end   = rsvd_region[n].start + xenheap_size;
-       n++;
- 
--#ifdef CONFIG_BLK_DEV_INITRD
-+      /* This is actually dom0 image */
-       if (ia64_boot_param->initrd_start) {
-               rsvd_region[n].start = (unsigned 
long)__va(ia64_boot_param->initrd_start);
-               rsvd_region[n].end   = rsvd_region[n].start + 
ia64_boot_param->initrd_size;
-               n++;
-       }
--#endif
- 
-       /* end of memory marker */
-       rsvd_region[n].start = ~0UL;
-@@ -207,6 +223,16 @@
-       num_rsvd_regions = n;
- 
-       sort_regions(rsvd_region, num_rsvd_regions);
-+
-+      {
-+              int i;
-+              printk("Reserved regions: \n");
-+              for (i = 0; i < num_rsvd_regions; i++)
-+                      printk("  [%d] -> [0x%lx, 0x%lx]\n",
-+                              i,
-+                              rsvd_region[i].start,
-+                              rsvd_region[i].end);
-+      }
- }
- 
- /**
-@@ -280,23 +306,26 @@
- }
- #endif
- 
-+#ifdef XEN
- void __init
--setup_arch (char **cmdline_p)
-+early_setup_arch(char **cmdline_p)
- {
-       unw_init();
--
--      ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) 
__end___vtop_patchlist);
--
-+      
-       *cmdline_p = __va(ia64_boot_param->command_line);
-       strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
--
-+      cmdline_parse(*cmdline_p);
-+      
-       efi_init();
--      io_port_init();
--
-+      
- #ifdef CONFIG_IA64_GENERIC
-       machvec_init(acpi_get_sysname());
- #endif
- 
-+#ifdef XEN
-+#undef CONFIG_ACPI_BOOT
-+#endif
-+
- #ifdef CONFIG_ACPI_BOOT
-       /* Initialize the ACPI boot-time table parser */
-       acpi_table_init();
-@@ -308,9 +337,13 @@
-       smp_build_cpu_map();    /* happens, e.g., with the Ski simulator */
- # endif
- #endif /* CONFIG_APCI_BOOT */
-+      io_port_init();
-+}
-+#endif
- 
--      find_memory();
--
-+void __init
-+setup_arch (void)
-+{
-       /* process SAL system table: */
-       ia64_sal_init(efi.sal_systab);
- 
-@@ -353,7 +386,6 @@
-       /* enable IA-64 Machine Check Abort Handling */
-       ia64_mca_init();
- 
--      platform_setup(cmdline_p);
-       paging_init();
- }
- 
-@@ -413,6 +445,9 @@
-               sprintf(cp, " 0x%lx", mask);
-       }
- 
-+#ifdef XEN
-+#define seq_printf(a,b...) printf(b)
-+#endif
-       seq_printf(m,
-                  "processor  : %d\n"
-                  "vendor     : %s\n"
-@@ -616,7 +651,11 @@
-                                       | IA64_DCR_DA | IA64_DCR_DD | 
IA64_DCR_LC));
-       atomic_inc(&init_mm.mm_count);
-       current->active_mm = &init_mm;
-+#ifdef XEN
-+      if (current->domain->arch.mm)
-+#else
-       if (current->mm)
-+#endif
-               BUG();
- 
-       ia64_mmu_init(ia64_imva(cpu_data));
-@@ -667,6 +706,8 @@
- void
- check_bugs (void)
- {
-+#ifndef XEN
-       ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
-                              (unsigned long) __end___mckinley_e9_bundles);
-+#endif
- }
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/slab.c
--- a/xen/arch/ia64/patch/linux-2.6.7/slab.c    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,139 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/mm/slab.c   2004-06-15 
23:19:44.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/slab.c        2004-12-17 
13:47:03.000000000 -0700
-@@ -86,15 +86,30 @@
- #include      <linux/init.h>
- #include      <linux/compiler.h>
- #include      <linux/seq_file.h>
-+#ifndef XEN
- #include      <linux/notifier.h>
- #include      <linux/kallsyms.h>
- #include      <linux/cpu.h>
- #include      <linux/sysctl.h>
- #include      <linux/module.h>
-+#endif
- 
- #include      <asm/uaccess.h>
- #include      <asm/cacheflush.h>
-+#ifndef XEN
- #include      <asm/tlbflush.h>
-+#endif
-+
-+#ifdef XEN
-+#define lock_cpu_hotplug()    do { } while (0)
-+#define unlock_cpu_hotplug()  do { } while (0)
-+#define might_sleep_if(x)     do { } while (0)
-+#define       dump_stack()            do { } while (0)
-+#define start_cpu_timer(cpu)  do { } while (0)
-+static inline void __down(struct semaphore *sem) { }
-+static inline void __up(struct semaphore *sem) { }
-+static inline void might_sleep(void) { }
-+#endif
- 
- /*
-  * DEBUG      - 1 for kmem_cache_create() to honour; SLAB_DEBUG_INITIAL,
-@@ -530,7 +545,9 @@
-       FULL
- } g_cpucache_up;
- 
-+#ifndef XEN
- static DEFINE_PER_CPU(struct timer_list, reap_timers);
-+#endif
- 
- static void reap_timer_fnc(unsigned long data);
- static void free_block(kmem_cache_t* cachep, void** objpp, int len);
-@@ -588,6 +605,7 @@
-  * Add the CPU number into the expiry time to minimize the possibility of the
-  * CPUs getting into lockstep and contending for the global cache chain lock.
-  */
-+#ifndef XEN
- static void __devinit start_cpu_timer(int cpu)
- {
-       struct timer_list *rt = &per_cpu(reap_timers, cpu);
-@@ -600,6 +618,7 @@
-               add_timer_on(rt, cpu);
-       }
- }
-+#endif
- 
- #ifdef CONFIG_HOTPLUG_CPU
- static void stop_cpu_timer(int cpu)
-@@ -634,6 +653,7 @@
-       return nc;
- }
- 
-+#ifndef XEN
- static int __devinit cpuup_callback(struct notifier_block *nfb,
-                                 unsigned long action,
-                                 void *hcpu)
-@@ -693,6 +713,7 @@
- }
- 
- static struct notifier_block cpucache_notifier = { &cpuup_callback, NULL, 0 };
-+#endif
- 
- /* Initialisation.
-  * Called after the gfp() functions have been enabled, and before smp_init().
-@@ -805,10 +826,14 @@
-       /* Done! */
-       g_cpucache_up = FULL;
- 
-+#ifdef XEN
-+printk("kmem_cache_init: some parts commented out, ignored\n");
-+#else
-       /* Register a cpu startup notifier callback
-        * that initializes ac_data for all new cpus
-        */
-       register_cpu_notifier(&cpucache_notifier);
-+#endif
-       
- 
-       /* The reap timers are started later, with a module init call:
-@@ -886,8 +911,10 @@
-               page++;
-       }
-       sub_page_state(nr_slab, nr_freed);
-+#ifndef XEN
-       if (current->reclaim_state)
-               current->reclaim_state->reclaimed_slab += nr_freed;
-+#endif
-       free_pages((unsigned long)addr, cachep->gfporder);
-       if (cachep->flags & SLAB_RECLAIM_ACCOUNT) 
-               atomic_sub(1<<cachep->gfporder, &slab_reclaim_pages);
-@@ -1363,8 +1390,10 @@
-                                       + cachep->num;
-       } 
- 
-+#ifndef XEN
-       cachep->lists.next_reap = jiffies + REAPTIMEOUT_LIST3 +
-                                       ((unsigned 
long)cachep)%REAPTIMEOUT_LIST3;
-+#endif
- 
-       /* Need the semaphore to access the chain. */
-       down(&cache_chain_sem);
-@@ -2237,8 +2266,10 @@
- 
-       if (unlikely(addr < min_addr))
-               goto out;
-+#ifndef XEN
-       if (unlikely(addr > (unsigned long)high_memory - size))
-               goto out;
-+#endif
-       if (unlikely(addr & align_mask))
-               goto out;
-       if (unlikely(!kern_addr_valid(addr)))
-@@ -2769,6 +2800,7 @@
-  */
- static void reap_timer_fnc(unsigned long cpu)
- {
-+#ifndef XEN
-       struct timer_list *rt = &__get_cpu_var(reap_timers);
- 
-       /* CPU hotplug can drag us off cpu: don't run on wrong CPU */
-@@ -2776,6 +2808,7 @@
-               cache_reap();
-               mod_timer(rt, jiffies + REAPTIMEOUT_CPUC + cpu);
-       }
-+#endif
- }
- 
- #ifdef CONFIG_PROC_FS
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/slab.h
--- a/xen/arch/ia64/patch/linux-2.6.7/slab.h    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,14 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/slab.h        
2004-06-15 23:20:26.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/slab.h 2004-08-25 
19:28:13.000000000 -0600
-@@ -83,7 +83,11 @@
-                       goto found; \
-               else \
-                       i++;
-+#ifdef XEN
-+#include <linux/kmalloc_sizes.h>
-+#else
- #include "kmalloc_sizes.h"
-+#endif
- #undef CACHE
-               {
-                       extern void __you_cannot_kmalloc_that_much(void);
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/swiotlb.c
--- a/xen/arch/ia64/patch/linux-2.6.7/swiotlb.c Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,47 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/lib/swiotlb.c  2004-06-15 23:19:43.000000000 
-0600
-+++ arch/ia64/lib/swiotlb.c    2005-03-23 14:54:05.000000000 -0700
-@@ -100,7 +100,11 @@
-       /*
-        * Get IO TLB memory from the low pages
-        */
--      io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs * (1 << 
IO_TLB_SHIFT));
-+      /* FIXME: Do we really need swiotlb in HV? If all memory trunks
-+       * presented to guest as <4G, are actually <4G in machine range,
-+       * no DMA intevention from HV...
-+       */
-+      io_tlb_start = alloc_xenheap_pages(get_order(io_tlb_nslabs * (1 << 
IO_TLB_SHIFT)));
-       if (!io_tlb_start)
-               BUG();
-       io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT);
-@@ -110,11 +114,11 @@
-        * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
-        * between io_tlb_start and io_tlb_end.
-        */
--      io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int));
-+      io_tlb_list = alloc_xenheap_pages(get_order(io_tlb_nslabs * 
sizeof(int)));
-       for (i = 0; i < io_tlb_nslabs; i++)
-               io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
-       io_tlb_index = 0;
--      io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *));
-+      io_tlb_orig_addr = alloc_xenheap_pages(get_order(io_tlb_nslabs * 
sizeof(char *)));
- 
-       printk(KERN_INFO "Placing software IO TLB between 0x%p - 0x%p\n",
-              (void *) io_tlb_start, (void *) io_tlb_end);
-@@ -279,7 +283,7 @@
-       /* XXX fix me: the DMA API should pass us an explicit DMA mask instead: 
*/
-       flags |= GFP_DMA;
- 
--      ret = (void *)__get_free_pages(flags, get_order(size));
-+      ret = (void *)alloc_xenheap_pages(get_order(size));
-       if (!ret)
-               return NULL;
- 
-@@ -294,7 +298,7 @@
- void
- swiotlb_free_coherent (struct device *hwdev, size_t size, void *vaddr, 
dma_addr_t dma_handle)
- {
--      free_pages((unsigned long) vaddr, get_order(size));
-+      free_xenheap_pages((unsigned long) vaddr, get_order(size));
- }
- 
- /*
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/system.h
--- a/xen/arch/ia64/patch/linux-2.6.7/system.h  Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,43 +0,0 @@
---- ../../linux-2.6.7/include/asm-ia64/system.h        2005-03-24 
19:39:56.000000000 -0700
-+++ include/asm-ia64/system.h  2005-04-01 12:56:37.000000000 -0700
-@@ -24,8 +24,16 @@
-  * 0xa000000000000000+2*PERCPU_PAGE_SIZE
-  * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
-  */
-+#ifdef XEN
-+//#define KERNEL_START                 0xf000000100000000
-+#define KERNEL_START           0xf000000004000000
-+#define PERCPU_ADDR            0xf100000000000000-PERCPU_PAGE_SIZE
-+#define SHAREDINFO_ADDR                0xf100000000000000
-+#define VHPT_ADDR              0xf200000000000000
-+#else
- #define KERNEL_START           0xa000000100000000
- #define PERCPU_ADDR           (-PERCPU_PAGE_SIZE)
-+#endif
- 
- #ifndef __ASSEMBLY__
- 
-@@ -218,9 +226,13 @@
- # define PERFMON_IS_SYSWIDE() (0)
- #endif
- 
-+#ifdef XEN
-+#define IA64_HAS_EXTRA_STATE(t) 0
-+#else
- #define IA64_HAS_EXTRA_STATE(t)                                               
        \
-       ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID)       
\
-        || IS_IA32_PROCESS(ia64_task_regs(t)) || PERFMON_IS_SYSWIDE())
-+#endif
- 
- #define __switch_to(prev,next,last) do {                                      
                 \
-       if (IA64_HAS_EXTRA_STATE(prev))                                         
                 \
-@@ -249,6 +261,9 @@
- #else
- # define switch_to(prev,next,last)    __switch_to(prev, next, last)
- #endif
-+//#ifdef XEN
-+//#undef switch_to
-+//#endif
- 
- /*
-  * On IA-64, we don't want to hold the runqueue's lock during the low-level 
context-switch,
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/time.c
--- a/xen/arch/ia64/patch/linux-2.6.7/time.c    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,338 +0,0 @@
---- ../../linux-2.6.7/arch/ia64/kernel/time.c  2004-06-15 23:19:01.000000000 
-0600
-+++ arch/ia64/time.c   2005-03-14 17:27:11.000000000 -0700
-@@ -10,16 +10,22 @@
-  */
- #include <linux/config.h>
- 
-+#ifndef XEN
- #include <linux/cpu.h>
-+#endif
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
-+#ifndef XEN
- #include <linux/profile.h>
-+#endif
- #include <linux/sched.h>
- #include <linux/time.h>
- #include <linux/interrupt.h>
- #include <linux/efi.h>
-+#ifndef XEN
- #include <linux/profile.h>
-+#endif
- #include <linux/timex.h>
- 
- #include <asm/machvec.h>
-@@ -29,6 +35,9 @@
- #include <asm/sal.h>
- #include <asm/sections.h>
- #include <asm/system.h>
-+#ifdef XEN
-+#include <asm/ia64_int.h>
-+#endif
- 
- extern unsigned long wall_jiffies;
- 
-@@ -45,6 +54,59 @@
- 
- #endif
- 
-+#ifdef XEN
-+volatile unsigned long last_nsec_offset;
-+extern rwlock_t xtime_lock;
-+unsigned long cpu_khz;  /* Detected as we calibrate the TSC */
-+static s_time_t        stime_irq;       /* System time at last 'time update' 
*/
-+
-+static inline u64 get_time_delta(void)
-+{
-+      return ia64_get_itc();
-+}
-+
-+s_time_t get_s_time(void)
-+{
-+    s_time_t now;
-+    unsigned long flags;
-+
-+    read_lock_irqsave(&xtime_lock, flags);
-+
-+    now = stime_irq + get_time_delta();
-+
-+    /* Ensure that the returned system time is monotonically increasing. */
-+    {
-+        static s_time_t prev_now = 0;
-+        if ( unlikely(now < prev_now) )
-+            now = prev_now;
-+        prev_now = now;
-+    }
-+
-+    read_unlock_irqrestore(&xtime_lock, flags);
-+
-+    return now; 
-+}
-+
-+void update_dom_time(struct vcpu *v)
-+{
-+// FIXME: implement this?
-+//    printf("update_dom_time: called, not implemented, skipping\n");
-+      return;
-+}
-+
-+/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
-+void do_settime(unsigned long secs, unsigned long usecs, u64 system_time_base)
-+{
-+// FIXME: Should this be do_settimeofday (from linux)???
-+      printf("do_settime: called, not implemented, stopping\n");
-+      dummy();
-+}
-+#endif
-+
-+#if 0 /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
-+#endif        /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
-+
-+#ifndef XEN
- static void
- itc_reset (void)
- {
-@@ -80,12 +142,15 @@
-       return (elapsed_cycles*local_cpu_data->nsec_per_cyc) >> 
IA64_NSEC_PER_CYC_SHIFT;
- }
- 
-+#ifndef XEN
- static struct time_interpolator itc_interpolator = {
-       .get_offset =   itc_get_offset,
-       .update =       itc_update,
-       .reset =        itc_reset
- };
-+#endif
- 
-+#ifndef XEN
- int
- do_settimeofday (struct timespec *tv)
- {
-@@ -95,7 +160,9 @@
-       if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
-               return -EINVAL;
- 
-+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN
-       write_seqlock_irq(&xtime_lock);
-+#endif
-       {
-               /*
-                * This is revolting. We need to set "xtime" correctly. 
However, the value
-@@ -117,12 +184,15 @@
-               time_esterror = NTP_PHASE_LIMIT;
-               time_interpolator_reset();
-       }
-+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN
-       write_sequnlock_irq(&xtime_lock);
-+#endif
-       clock_was_set();
-       return 0;
- }
- 
- EXPORT_SYMBOL(do_settimeofday);
-+#endif
- 
- void
- do_gettimeofday (struct timeval *tv)
-@@ -185,6 +255,7 @@
- }
- 
- EXPORT_SYMBOL(do_gettimeofday);
-+#endif
- 
- /*
-  * The profiling function is SMP safe. (nothing can mess
-@@ -195,6 +266,9 @@
- static inline void
- ia64_do_profile (struct pt_regs * regs)
- {
-+#ifdef XEN
-+}
-+#else
-       unsigned long ip, slot;
-       extern cpumask_t prof_cpu_mask;
- 
-@@ -231,24 +305,89 @@
-               ip = prof_len-1;
-       atomic_inc((atomic_t *)&prof_buffer[ip]);
- }
-+#endif
-+
-+#ifdef XEN
-+unsigned long domain0_ready = 0;      // FIXME (see below)
-+#define typecheck(a,b)        1
-+/* FROM linux/include/linux/jiffies.h */
-+/*
-+ *    These inlines deal with timer wrapping correctly. You are 
-+ *    strongly encouraged to use them
-+ *    1. Because people otherwise forget
-+ *    2. Because if the timer wrap changes in future you won't have to
-+ *       alter your driver code.
-+ *
-+ * time_after(a,b) returns true if the time a is after time b.
-+ *
-+ * Do this with "<0" and ">=0" to only test the sign of the result. A
-+ * good compiler would generate better code (and a really good compiler
-+ * wouldn't care). Gcc is currently neither.
-+ */
-+#define time_after(a,b)               \
-+      (typecheck(unsigned long, a) && \
-+       typecheck(unsigned long, b) && \
-+       ((long)(b) - (long)(a) < 0))
-+#define time_before(a,b)      time_after(b,a)
-+
-+#define time_after_eq(a,b)    \
-+      (typecheck(unsigned long, a) && \
-+       typecheck(unsigned long, b) && \
-+       ((long)(a) - (long)(b) >= 0))
-+#define time_before_eq(a,b)   time_after_eq(b,a)
-+#endif
- 
- static irqreturn_t
- timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
- {
-       unsigned long new_itm;
- 
-+#ifndef XEN
-       if (unlikely(cpu_is_offline(smp_processor_id()))) {
-               return IRQ_HANDLED;
-       }
-+#endif
-+#ifdef XEN
-+      if (current->domain == dom0) {
-+              // FIXME: there's gotta be a better way of doing this...
-+              // We have to ensure that domain0 is launched before we
-+              // call vcpu_timer_expired on it
-+              //domain0_ready = 1; // moved to xensetup.c
-+      }
-+      if (domain0_ready && vcpu_timer_expired(dom0->vcpu[0])) {
-+              vcpu_pend_timer(dom0->vcpu[0]);
-+              //vcpu_set_next_timer(dom0->vcpu[0]);
-+              vcpu_wake(dom0->vcpu[0]);
-+      }
-+      if (!is_idle_task(current->domain) && current->domain != dom0) {
-+              if (vcpu_timer_expired(current)) {
-+                      vcpu_pend_timer(current);
-+                      // ensure another timer interrupt happens even if 
domain doesn't
-+                      vcpu_set_next_timer(current);
-+                      vcpu_wake(current);
-+              }
-+      }
-+      raise_actimer_softirq();
-+#endif
- 
-+#ifndef XEN
-       platform_timer_interrupt(irq, dev_id, regs);
-+#endif
- 
-       new_itm = local_cpu_data->itm_next;
- 
-       if (!time_after(ia64_get_itc(), new_itm))
-+#ifdef XEN
-+              return;
-+#else
-               printk(KERN_ERR "Oops: timer tick before it's due 
(itc=%lx,itm=%lx)\n",
-                      ia64_get_itc(), new_itm);
-+#endif
- 
-+#ifdef XEN
-+//    printf("GOT TO HERE!!!!!!!!!!!\n");
-+      //while(1);
-+#endif
-       ia64_do_profile(regs);
- 
-       while (1) {
-@@ -269,10 +408,16 @@
-                        * another CPU. We need to avoid to SMP race by 
acquiring the
-                        * xtime_lock.
-                        */
-+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN
-                       write_seqlock(&xtime_lock);
-+#endif
-+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN
-                       do_timer(regs);
-+#endif
-                       local_cpu_data->itm_next = new_itm;
-+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN
-                       write_sequnlock(&xtime_lock);
-+#endif
-               } else
-                       local_cpu_data->itm_next = new_itm;
- 
-@@ -292,7 +437,12 @@
-                */
-               while (!time_after(new_itm, ia64_get_itc() + 
local_cpu_data->itm_delta/2))
-                       new_itm += local_cpu_data->itm_delta;
-+//#ifdef XEN
-+//            vcpu_set_next_timer(current);
-+//#else
-+//printf("***** timer_interrupt: Setting itm to %lx\n",new_itm);
-               ia64_set_itm(new_itm);
-+//#endif
-               /* double check, in case we got hit by a (slow) PMI: */
-       } while (time_after_eq(ia64_get_itc(), new_itm));
-       return IRQ_HANDLED;
-@@ -307,6 +457,7 @@
-       int cpu = smp_processor_id();
-       unsigned long shift = 0, delta;
- 
-+printf("ia64_cpu_local_tick: about to call ia64_set_itv\n");
-       /* arrange for the cycle counter to generate a timer interrupt: */
-       ia64_set_itv(IA64_TIMER_VECTOR);
- 
-@@ -320,6 +471,7 @@
-               shift = (2*(cpu - hi) + 1) * delta/hi/2;
-       }
-       local_cpu_data->itm_next = ia64_get_itc() + delta + shift;
-+printf("***** ia64_cpu_local_tick: Setting itm to 
%lx\n",local_cpu_data->itm_next);
-       ia64_set_itm(local_cpu_data->itm_next);
- }
- 
-@@ -335,6 +487,7 @@
-        * frequency and then a PAL call to determine the frequency ratio 
between the ITC
-        * and the base frequency.
-        */
-+
-       status = ia64_sal_freq_base(SAL_FREQ_BASE_PLATFORM,
-                                   &platform_base_freq, &platform_base_drift);
-       if (status != 0) {
-@@ -384,9 +537,11 @@
-                                       + itc_freq/2)/itc_freq;
- 
-       if (!(sal_platform_features & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT)) {
-+#ifndef XEN
-               itc_interpolator.frequency = local_cpu_data->itc_freq;
-               itc_interpolator.drift = itc_drift;
-               register_time_interpolator(&itc_interpolator);
-+#endif
-       }
- 
-       /* Setup the CPU local timer tick */
-@@ -395,7 +550,9 @@
- 
- static struct irqaction timer_irqaction = {
-       .handler =      timer_interrupt,
-+#ifndef XEN
-       .flags =        SA_INTERRUPT,
-+#endif
-       .name =         "timer"
- };
- 
-@@ -403,12 +560,16 @@
- time_init (void)
- {
-       register_percpu_irq(IA64_TIMER_VECTOR, &timer_irqaction);
-+#ifndef XEN
-       efi_gettimeofday(&xtime);
-+#endif
-       ia64_init_itm();
- 
-+#ifndef XEN
-       /*
-        * Initialize wall_to_monotonic such that adding it to xtime will yield 
zero, the
-        * tv_nsec field must be normalized (i.e., 0 <= nsec < NSEC_PER_SEC).
-        */
-       set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, 
-xtime.tv_nsec);
-+#endif
- }
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/tlb.c
--- a/xen/arch/ia64/patch/linux-2.6.7/tlb.c     Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,48 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/arch/ia64/mm/tlb.c  
2004-06-15 23:19:43.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/tlb.c 2004-08-25 
19:28:12.000000000 -0600
-@@ -21,7 +21,9 @@
- #include <asm/mmu_context.h>
- #include <asm/pgalloc.h>
- #include <asm/pal.h>
-+#ifndef XEN
- #include <asm/tlbflush.h>
-+#endif
- 
- static struct {
-       unsigned long mask;     /* mask of supported purge page-sizes */
-@@ -43,6 +45,9 @@
- void
- wrap_mmu_context (struct mm_struct *mm)
- {
-+#ifdef XEN
-+printf("wrap_mmu_context: called, not implemented\n");
-+#else
-       unsigned long tsk_context, max_ctx = ia64_ctx.max_ctx;
-       struct task_struct *tsk;
-       int i;
-@@ -83,6 +88,7 @@
-               put_cpu();
-       }
-       local_flush_tlb_all();
-+#endif
- }
- 
- void
-@@ -132,6 +138,9 @@
- void
- flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned 
long end)
- {
-+#ifdef XEN
-+printf("flush_tlb_range: called, not implemented\n");
-+#else
-       struct mm_struct *mm = vma->vm_mm;
-       unsigned long size = end - start;
-       unsigned long nbits;
-@@ -163,6 +172,7 @@
- # endif
- 
-       ia64_srlz_i();                  /* srlz.i implies srlz.d */
-+#endif
- }
- EXPORT_SYMBOL(flush_tlb_range);
- 
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/types.h
--- a/xen/arch/ia64/patch/linux-2.6.7/types.h   Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,15 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/asm-ia64/types.h    
2004-06-15 23:19:01.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/types.h        
2004-11-11 17:08:30.000000000 -0700
-@@ -1,5 +1,12 @@
- #ifndef _ASM_IA64_TYPES_H
- #define _ASM_IA64_TYPES_H
-+#ifdef XEN
-+#ifndef __ASSEMBLY__
-+typedef unsigned long ssize_t;
-+typedef unsigned long size_t;
-+typedef long long loff_t;
-+#endif
-+#endif
- 
- /*
-  * This file is never included by application software unless explicitly 
requested (e.g.,
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/unaligned.c
--- a/xen/arch/ia64/patch/linux-2.6.7/unaligned.c       Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,97 +0,0 @@
---- 
/home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/arch/ia64/kernel/unaligned.c     
   2004-06-15 23:20:03.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/arch/ia64/unaligned.c   2004-08-25 
19:28:12.000000000 -0600
-@@ -15,8 +15,10 @@
-  */
- #include <linux/kernel.h>
- #include <linux/sched.h>
-+#ifndef XEN
- #include <linux/smp_lock.h>
- #include <linux/tty.h>
-+#endif
- 
- #include <asm/intrinsics.h>
- #include <asm/processor.h>
-@@ -24,7 +26,16 @@
- #include <asm/uaccess.h>
- #include <asm/unaligned.h>
- 
-+#ifdef XEN
-+#define       ia64_peek(x...) printk("ia64_peek: called, not implemented\n")
-+#define       ia64_poke(x...) printk("ia64_poke: called, not implemented\n")
-+#define       ia64_sync_fph(x...) printk("ia64_sync_fph: called, not 
implemented\n")
-+#define       ia64_flush_fph(x...) printk("ia64_flush_fph: called, not 
implemented\n")
-+#define       die_if_kernel(x...) printk("die_if_kernel: called, not 
implemented\n")
-+#define jiffies 0
-+#else
- extern void die_if_kernel(char *str, struct pt_regs *regs, long err) 
__attribute__ ((noreturn));
-+#endif
- 
- #undef DEBUG_UNALIGNED_TRAP
- 
-@@ -437,7 +448,11 @@
- }
- 
- 
-+#ifdef XEN
-+void
-+#else
- static void
-+#endif
- setreg (unsigned long regnum, unsigned long val, int nat, struct pt_regs 
*regs)
- {
-       struct switch_stack *sw = (struct switch_stack *) regs - 1;
-@@ -611,7 +626,11 @@
- }
- 
- 
-+#ifdef XEN
-+void
-+#else
- static void
-+#endif
- getreg (unsigned long regnum, unsigned long *val, int *nat, struct pt_regs 
*regs)
- {
-       struct switch_stack *sw = (struct switch_stack *) regs - 1;
-@@ -1298,7 +1317,9 @@
-       mm_segment_t old_fs = get_fs();
-       unsigned long bundle[2];
-       unsigned long opcode;
-+#ifndef XEN
-       struct siginfo si;
-+#endif
-       const struct exception_table_entry *eh = NULL;
-       union {
-               unsigned long l;
-@@ -1317,6 +1338,9 @@
-        * user-level unaligned accesses.  Otherwise, a clever program could 
trick this
-        * handler into reading an arbitrary kernel addresses...
-        */
-+#ifdef XEN
-+printk("ia64_handle_unaligned: called, not working yet\n");
-+#else
-       if (!user_mode(regs))
-               eh = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri);
-       if (user_mode(regs) || eh) {
-@@ -1353,6 +1377,7 @@
- 
-       if (__copy_from_user(bundle, (void *) regs->cr_iip, 16))
-               goto failure;
-+#endif
- 
-       /*
-        * extract the instruction from the bundle given the slot number
-@@ -1493,6 +1518,7 @@
-               /* NOT_REACHED */
-       }
-   force_sigbus:
-+#ifndef XEN
-       si.si_signo = SIGBUS;
-       si.si_errno = 0;
-       si.si_code = BUS_ADRALN;
-@@ -1501,5 +1527,6 @@
-       si.si_isr = 0;
-       si.si_imm = 0;
-       force_sig_info(SIGBUS, &si, current);
-+#endif
-       goto done;
- }
diff -r 5978be010bec -r 2b95125015a5 xen/arch/ia64/patch/linux-2.6.7/wait.h
--- a/xen/arch/ia64/patch/linux-2.6.7/wait.h    Fri Aug 26 11:02:14 2005
+++ /dev/null   Fri Aug 26 13:06:49 2005
@@ -1,26 +0,0 @@
---- /home/djm/src/xen/xeno-ia64.bk/xen/linux-2.6.7/include/linux/wait.h        
2004-06-15 23:19:31.000000000 -0600
-+++ /home/djm/src/xen/xeno-ia64.bk/xen/include/asm-ia64/linux/wait.h   
2004-08-25 19:28:13.000000000 -0600
-@@ -104,10 +104,15 @@
-       list_del(&old->task_list);
- }
- 
-+#ifdef XEN
-+void FASTCALL(__wake_up(struct task_struct *p));
-+#else
- void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void 
*key));
-+#endif
- extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int 
mode));
- extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, 
int nr));
- 
-+#ifndef XEN
- #define wake_up(x)                    __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 1, NULL)
- #define wake_up_nr(x, nr)             __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, nr, NULL)
- #define wake_up_all(x)                        __wake_up(x, 
TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0, NULL)
-@@ -117,6 +122,7 @@
- #define wake_up_interruptible_all(x)  __wake_up(x, TASK_INTERRUPTIBLE, 0, 
NULL)
- #define       wake_up_locked(x)               __wake_up_locked((x), 
TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
- #define wake_up_interruptible_sync(x)   
__wake_up_sync((x),TASK_INTERRUPTIBLE, 1)
-+#endif
- 
- #define __wait_event(wq, condition)                                   \
- do {                                                                  \

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.