Re: [Xen-ia64-devel] PATCH [resent**2]: FPH handling and cleanup

2006-04-26 Thread Tristan Gingold
Le Mardi 25 Avril 2006 18:36, Magenheimer, Dan (HP Labs Fort Collins) a écrit 
:
  After much testing, there is at least one path where saving
  fp registers
  faults (I got it with a 12 VCPUs domain).  I have to look more.

 I think Tony's program has already been on the list, but the
 following might be useful for Xen/ia64 FPU SMP and multi-domain
 stress testing.
Currently FP regs are always saved at context switch.  But DFH is now always 
reset.

But this stress programm will be useful for FP lazy save/restore.

Thanks,
Tristan.



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


RE: [Xen-ia64-devel] PATCH [resent**2]: FPH handling and cleanup

2006-04-25 Thread Magenheimer, Dan (HP Labs Fort Collins)
 After much testing, there is at least one path where saving 
 fp registers 
 faults (I got it with a 12 VCPUs domain).  I have to look more.

I think Tony's program has already been on the list, but the
following might be useful for Xen/ia64 FPU SMP and multi-domain
stress testing.

Dan

  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Luck, Tony
  Sent: Tuesday, March 01, 2005 4:33 PM
  To: linux-ia64@vger.kernel.org
  Subject: RE: [patch 2.6.11-rc3-bk4] Correctly dereference 
  ia64_mca_data
  
  Back on February 9th, I wrote:
  I wrote a test program that loads up random values into registers
  (just r1-r31, a bunch of stacked registers, and f2-f127 for now)
  and then checks that all the registers haven't changed value a
  few thousand times, before reloading with a new set of random
  values.
  
  A few people asked whether I could post the program ... it took
  a while to get sign-off ... but that gave me time to add branch,
  predicate and half a dozen application registers to the mix,
  plus make it print the name of the register that was nuked (instead
  of a number that required manual translation).
  
  I've tested it by using a debugger to zap one of each class 
  of register
  that is being monitored to check that it works.
  
  http://www.kernel.org/pub/linux/kernel/people/aegl/ia64regcheck.tgz 
  
  Usage ... compile, and run a few copies.  If they all 
 exit(0) (which
  may take a couple of days) the test passed.  Otherwise you 
 should see
  the name of the register printed to stderr, and exit code 1.
  
  Apart from the MCA case, I haven't seen it report a problem 
  yet ... but
  I've only run a few hours.
  
  -Tony
  
  -
  To unsubscribe from this list: send the line unsubscribe 
  linux-ia64 in
  the body of a message to [EMAIL PROTECTED]
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
 

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


[Xen-ia64-devel] PATCH [resent**2]: FPH handling and cleanup

2006-04-24 Thread Tristan Gingold
Hi,

thank you for all the comments.  This patch improve context switch time (by a 
few ns).  FPH is always enabled in Xen.

Tristan.
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID f9ffc95fbd428c006b3ecae297ab98278ae1351a
# Parent  de0c04ed4ab7b9c4572c42df2de838e2b243a8e2
Move contents of switch_to macro from xensystem.h to context_switch function.
Initialize FPU on all processors.  FPH is always enabled in Xen.
Speed up context-switch (a little bit) by not enabling/disabling FPH.
Cleanup (unused function/variables, debug printf...)
vmx_ia64_switch_to removed (was unused).

Signed-off-by: Tristan Gingold [EMAIL PROTECTED]

diff -r de0c04ed4ab7 -r f9ffc95fbd42 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c	Fri Apr 21 16:40:17 2006
+++ b/xen/arch/ia64/linux-xen/setup.c	Mon Apr 24 05:55:06 2006
@@ -384,7 +384,9 @@
 {
 	unw_init();
 
+#ifndef XEN
 	ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
+#endif
 
 	*cmdline_p = __va(ia64_boot_param-command_line);
 #ifndef XEN
@@ -870,6 +872,11 @@
 #endif
 		BUG();
 
+#ifdef XEN
+	ia64_fph_enable();
+	__ia64_init_fpu();
+#endif
+
 	ia64_mmu_init(ia64_imva(cpu_data));
 	ia64_mca_cpu_init(ia64_imva(cpu_data));
 
@@ -931,9 +938,11 @@
 #endif
 }
 
+#ifndef XEN
 void
 check_bugs (void)
 {
 	ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
 			   (unsigned long) __end___mckinley_e9_bundles);
 }
+#endif
diff -r de0c04ed4ab7 -r f9ffc95fbd42 xen/arch/ia64/vmx/vmx_entry.S
--- a/xen/arch/ia64/vmx/vmx_entry.S	Fri Apr 21 16:40:17 2006
+++ b/xen/arch/ia64/vmx/vmx_entry.S	Mon Apr 24 05:55:06 2006
@@ -36,48 +36,6 @@
 #include asm/vhpt.h
 #include asm/vmmu.h
 #include vmx_minstate.h
-
-/*
- * prev_task - vmx_ia64_switch_to(struct task_struct *next)
- *	With Ingo's new scheduler, interrupts are disabled when this routine gets
- *	called.  The code starting at .map relies on this.  The rest of the code
- *	doesn't care about the interrupt masking status.
- *
- * Since we allocate domain stack in xenheap, there's no need to map new
- * domain's stack since all xenheap is mapped by TR. Another different task
- * for vmx_ia64_switch_to is to switch to bank0 and change current pointer.
- */
-GLOBAL_ENTRY(vmx_ia64_switch_to)
-	.prologue
-	alloc r16=ar.pfs,1,0,0,0
-	DO_SAVE_SWITCH_STACK
-	.body
-
-	bsw.0	// Switch to bank0, because bank0 r21 is current pointer
-	;;
-	adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
-	movl r25=init_task
-	adds r26=IA64_TASK_THREAD_KSP_OFFSET,in0
-	;;
-	st8 [r22]=sp			// save kernel stack pointer of old task
-	;;
-	/*
-	 * TR always mapped this task's page, we can skip doing it again.
-	 */
-	ld8 sp=[r26]			// load kernel stack pointer of new task
-	mov r21=in0			// update current application register
-	mov r8=r13			// return pointer to previously running task
-	mov r13=in0			// set current pointer
-	;;
-	bsw.1
-	;;
-	DO_LOAD_SWITCH_STACK
-
-#ifdef CONFIG_SMP
-	sync.i// ensure fcs done by this CPU are visible on other CPUs
-#endif
-	br.ret.sptk.many rp		// boogie on out in new context
-END(vmx_ia64_switch_to)
 
 GLOBAL_ENTRY(ia64_leave_nested)
 	rsm psr.i
diff -r de0c04ed4ab7 -r f9ffc95fbd42 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Fri Apr 21 16:40:17 2006
+++ b/xen/arch/ia64/xen/domain.c	Mon Apr 24 05:55:06 2006
@@ -70,11 +70,8 @@
 #define IS_XEN_ADDRESS(d,a) ((a = d-xen_vastart)  (a = d-xen_vaend))
 
 /* FIXME: where these declarations should be there ? */
-extern void domain_pend_keyboard_interrupt(int);
 extern long platform_is_hp_ski(void);
-extern void sync_split_caches(void);
 extern void serial_input_init(void);
-
 static void init_switch_stack(struct vcpu *v);
 void build_physmap_table(struct domain *d);
 
@@ -302,7 +299,6 @@
 {
 	struct pt_regs *regs = vcpu_regs (v);
 
-	printf(arch_getdomaininfo_ctxt\n);
 	c-regs = *regs;
 	c-vcpu.evtchn_vector = v-vcpu_info-arch.evtchn_vector;
 
@@ -314,7 +310,6 @@
 	struct pt_regs *regs = vcpu_regs (v);
 	struct domain *d = v-domain;
 
-	printf(arch_set_info_guest\n);
 	if ( test_bit(_VCPUF_initialised, v-vcpu_flags) )
 return 0;
 	if (c-flags  VGCF_VMX_GUEST) {
@@ -866,9 +861,8 @@
 	dom0_start = alloc_boot_pages(dom0_size  PAGE_SHIFT, dom0_align  PAGE_SHIFT);
 	dom0_start = PAGE_SHIFT;
 	if (!dom0_start) {
-	printf(alloc_dom0: can't allocate contiguous memory size=%lu\n,
+	  panic(alloc_dom0: can't allocate contiguous memory size=%lu\n,
 		dom0_size);
-	while(1);
 	}
 	printf(alloc_dom0: dom0_start=0x%lx\n, dom0_start);
 #else
@@ -1133,17 +1127,6 @@
 	while(1);
 }
 
-
-#if 0
-void switch_to(struct vcpu *prev, struct vcpu *next)
-{
- 	struct vcpu *last;
-
-	__switch_to(prev,next,last);
-	//set_current(next);
-}
-#endif
-
 void domain_pend_keyboard_interrupt(int irq)
 {
 	vcpu_pend_interrupt(dom0-vcpu[0],irq);
@@ -1154,10 +1137,6 @@
 	ia64_save_fpu(v-arch._thread.fph);
 	if (VMX_DOMAIN(v))
 		vmx_save_state(v);
-	else {
-		if (IA64_HAS_EXTRA_STATE(v))
-			ia64_save_extra(v);
-	}
 	// FIXME SMP: Anything 

Re: [Xen-ia64-devel] PATCH [resent**2]: FPH handling and cleanup

2006-04-24 Thread Tristan Gingold
Alex,

please do not integrate xen-system4.diffs.

After much testing, there is at least one path where saving fp registers 
faults (I got it with a 12 VCPUs domain).  I have to look more.

Please, integrate xen-system3.diffs (the previous one), it is much more safer.

Excuse me for not testing enough.  I am sorry.

Tristan.

Le Lundi 24 Avril 2006 13:20, Tristan Gingold a écrit :
 Hi,

 thank you for all the comments.  This patch improve context switch time (by
 a few ns).  FPH is always enabled in Xen.

 Tristan.



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