virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* paravirt repo rebased to 2.6.21-rc6-mm1
@ 2007-04-10 23:23 Jeremy Fitzhardinge
  2007-04-10 23:29 ` Zachary Amsden
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2007-04-10 23:23 UTC (permalink / raw)
  To: Zachary Amsden, Rusty Russell, Chris Wright; +Cc: Virtualization Mailing List

Seems to work OK for native and Xen.  I had to play a bit with the
paravirt-sched-clock patch to deal with the VMI changes.  Zach, can you
check that it still works?

Thanks,
    J

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: paravirt repo rebased to 2.6.21-rc6-mm1
  2007-04-10 23:23 paravirt repo rebased to 2.6.21-rc6-mm1 Jeremy Fitzhardinge
@ 2007-04-10 23:29 ` Zachary Amsden
  2007-04-11  0:10   ` Chris Wright
  2007-04-10 23:29 ` Zachary Amsden
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Zachary Amsden @ 2007-04-10 23:29 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Chris Wright, Virtualization Mailing List

Jeremy Fitzhardinge wrote:
> Seems to work OK for native and Xen.  I had to play a bit with the
> paravirt-sched-clock patch to deal with the VMI changes.  Zach, can you
> check that it still works?
>   

I'm on it.

Zach

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: paravirt repo rebased to 2.6.21-rc6-mm1
  2007-04-10 23:23 paravirt repo rebased to 2.6.21-rc6-mm1 Jeremy Fitzhardinge
  2007-04-10 23:29 ` Zachary Amsden
@ 2007-04-10 23:29 ` Zachary Amsden
  2007-04-10 23:48 ` Chris Wright
  2007-04-12  8:54 ` Chris Wright
  3 siblings, 0 replies; 7+ messages in thread
From: Zachary Amsden @ 2007-04-10 23:29 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Chris Wright, Virtualization Mailing List

Jeremy Fitzhardinge wrote:
> Seems to work OK for native and Xen.  I had to play a bit with the
> paravirt-sched-clock patch to deal with the VMI changes.  Zach, can you
> check that it still works?
>
> Thanks,
>   

Thanks, btw.

Zach

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: paravirt repo rebased to 2.6.21-rc6-mm1
  2007-04-10 23:23 paravirt repo rebased to 2.6.21-rc6-mm1 Jeremy Fitzhardinge
  2007-04-10 23:29 ` Zachary Amsden
  2007-04-10 23:29 ` Zachary Amsden
@ 2007-04-10 23:48 ` Chris Wright
  2007-04-12  8:54 ` Chris Wright
  3 siblings, 0 replies; 7+ messages in thread
From: Chris Wright @ 2007-04-10 23:48 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Chris Wright, Virtualization Mailing List

* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Seems to work OK for native and Xen.  I had to play a bit with the
> paravirt-sched-clock patch to deal with the VMI changes.  Zach, can you
> check that it still works?

Cool, thanks for the rebase.  Here's some small fixes.

Minor issue with CONFIG_STACK_UNWIND in -mm vs. pda-to-percpu:

diff -r a5e50a2e914a include/asm-i386/unwind.h
--- a/include/asm-i386/unwind.h	Tue Apr 10 16:20:13 2007 -0700
+++ b/include/asm-i386/unwind.h	Tue Apr 10 16:34:58 2007 -0700
@@ -71,7 +71,7 @@ static inline void arch_unw_init_blocked
 	info->regs.xss = __KERNEL_DS;
 	info->regs.xds = __USER_DS;
 	info->regs.xes = __USER_DS;
-	info->regs.xfs = __KERNEL_PDA;
+	info->regs.xfs = __KERNEL_PERCPU;
 }
 
 extern asmlinkage int arch_unwind_init_running(struct unwind_frame_info *,

Another issue when !SMP from xen-smp.patch.  leave_mm was SMP only before,
it basically still is except for one call from xen_exit_mmap().  This is
the simplest sol'n.


diff -r a5e50a2e914a include/asm-i386/mmu_context.h
--- a/include/asm-i386/mmu_context.h	Tue Apr 10 16:20:13 2007 -0700
+++ b/include/asm-i386/mmu_context.h	Tue Apr 10 16:45:58 2007 -0700
@@ -41,9 +41,11 @@ static inline void enter_lazy_tlb(struct
  */
 static inline void leave_mm (unsigned long cpu)
 {
+#ifdef CONFIG_SMP
 	if (per_cpu(cpu_tlbstate, cpu).state == TLBSTATE_OK)
 		BUG();
 	cpu_clear(cpu, per_cpu(cpu_tlbstate, cpu).active_mm->cpu_vm_mask);
+#endif
 	load_cr3(swapper_pg_dir);
 }
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: paravirt repo rebased to 2.6.21-rc6-mm1
  2007-04-10 23:29 ` Zachary Amsden
@ 2007-04-11  0:10   ` Chris Wright
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wright @ 2007-04-11  0:10 UTC (permalink / raw)
  To: Zachary Amsden; +Cc: Chris Wright, Virtualization Mailing List

* Zachary Amsden (zach@vmware.com) wrote:
> Jeremy Fitzhardinge wrote:
> >Seems to work OK for native and Xen.  I had to play a bit with the
> >paravirt-sched-clock patch to deal with the VMI changes.  Zach, can you
> >check that it still works?
> 
> I'm on it.

Not sure about cycles_2_ns...

arch/i386/kernel/built-in.o: In function `activate_vmi':
/home/chrisw/hg/xen/linux-2.6-pv/arch/i386/kernel/vmi.c:894: undefined reference to `vmi_sched_clock'

diff -r a5e50a2e914a arch/i386/kernel/vmiclock.c
--- a/arch/i386/kernel/vmiclock.c	Tue Apr 10 16:20:13 2007 -0700
+++ b/arch/i386/kernel/vmiclock.c	Tue Apr 10 17:07:47 2007 -0700
@@ -64,10 +64,10 @@ int vmi_set_wallclock(unsigned long now)
 	return 0;
 }
 
-/* paravirt_ops.get_scheduled_cycles = vmi_get_sched_cycles */
-unsigned long long vmi_get_sched_cycles(void)
-{
-	return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_AVAILABLE);
+unsigned long long vmi_sched_clock(void)
+{
+	cycle_t cycles = vmi_timer_ops.get_cycle_counter(VMI_CYCLES_AVAILABLE);
+	return cycles_2_ns(cycles);
 }
 
 /* paravirt_ops.get_cpu_khz = vmi_cpu_khz */

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: paravirt repo rebased to 2.6.21-rc6-mm1
  2007-04-10 23:23 paravirt repo rebased to 2.6.21-rc6-mm1 Jeremy Fitzhardinge
                   ` (2 preceding siblings ...)
  2007-04-10 23:48 ` Chris Wright
@ 2007-04-12  8:54 ` Chris Wright
  2007-04-12 15:40   ` Zachary Amsden
  3 siblings, 1 reply; 7+ messages in thread
From: Chris Wright @ 2007-04-12  8:54 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Chris Wright, Virtualization Mailing List

* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Seems to work OK for native and Xen.  I had to play a bit with the
> paravirt-sched-clock patch to deal with the VMI changes.  Zach, can you
> check that it still works?

Here's what's working for me on UP.  The boot cpu on UP is never getting
the GDT loaded.  Also __KERNEL_PERCPU is a bad selector on UP (ifdef
was Jeremy's idea, I was just hacking entry.S to get things to boot ;-).

diff -r cde7063e34bd arch/i386/kernel/cpu/common.c
--- a/arch/i386/kernel/cpu/common.c	Wed Apr 11 18:07:02 2007 -0700
+++ b/arch/i386/kernel/cpu/common.c	Thu Apr 12 01:36:00 2007 -0700
@@ -644,6 +644,18 @@ struct pt_regs * __devinit idle_regs(str
 	return regs;
 }
 
+/* Current gdt points %fs at the "master" per-cpu area: after this,
+ * it's on the real one. */
+void switch_to_new_gdt(void)
+{
+	struct Xgt_desc_struct gdt_descr;
+
+	gdt_descr.address = (long)get_cpu_gdt_table(smp_processor_id());
+	gdt_descr.size = GDT_SIZE - 1;
+	load_gdt(&gdt_descr);
+	asm("mov %0, %%fs" : : "r" (__KERNEL_PERCPU) : "memory");
+}
+
 /*
  * cpu_init() initializes state that is per-CPU. Some data is already
  * initialized (naturally) in the bootstrap process, such as the GDT
@@ -674,6 +688,7 @@ void __cpuinit cpu_init(void)
 	}
 
 	load_idt(&idt_descr);
+	switch_to_new_gdt();
 
 	/*
 	 * Set up and load the per-CPU TSS and LDT
diff -r cde7063e34bd arch/i386/kernel/smpboot.c
--- a/arch/i386/kernel/smpboot.c	Wed Apr 11 18:07:02 2007 -0700
+++ b/arch/i386/kernel/smpboot.c	Thu Apr 12 01:35:05 2007 -0700
@@ -1176,18 +1176,6 @@ void __init native_smp_prepare_cpus(unsi
 	smp_boot_cpus(max_cpus);
 }
 
-/* Current gdt points %fs at the "master" per-cpu area: after this,
- * it's on the real one. */
-static inline void switch_to_new_gdt(void)
-{
-	struct Xgt_desc_struct gdt_descr;
-
-	gdt_descr.address = (long)get_cpu_gdt_table(smp_processor_id());
-	gdt_descr.size = GDT_SIZE - 1;
-	load_gdt(&gdt_descr);
-	asm("mov %0, %%fs" : : "r" (__KERNEL_PERCPU) : "memory");
-}
-
 void __init native_smp_prepare_boot_cpu(void)
 {
 	unsigned int cpu = smp_processor_id();
diff -r cde7063e34bd include/asm-i386/processor.h
--- a/include/asm-i386/processor.h	Wed Apr 11 18:07:02 2007 -0700
+++ b/include/asm-i386/processor.h	Thu Apr 12 01:37:44 2007 -0700
@@ -777,6 +777,7 @@ extern int sysenter_setup(void);
 extern int sysenter_setup(void);
 
 extern void cpu_set_gdt(int);
+extern void switch_to_new_gdt(void);
 extern void cpu_init(void);
 
 #endif /* __ASM_I386_PROCESSOR_H */
diff -r cde7063e34bd include/asm-i386/segment.h
--- a/include/asm-i386/segment.h	Wed Apr 11 18:07:02 2007 -0700
+++ b/include/asm-i386/segment.h	Thu Apr 12 01:45:24 2007 -0700
@@ -75,7 +75,11 @@
 #define __ESPFIX_SS (GDT_ENTRY_ESPFIX_SS * 8)
 
 #define GDT_ENTRY_PERCPU			(GDT_ENTRY_KERNEL_BASE + 15)
+#ifdef CONFIG_SMP
 #define __KERNEL_PERCPU (GDT_ENTRY_PERCPU * 8)
+#else
+#define __KERNEL_PERCPU 0
+#endif
 
 #define GDT_ENTRY_DOUBLEFAULT_TSS	31
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: paravirt repo rebased to 2.6.21-rc6-mm1
  2007-04-12  8:54 ` Chris Wright
@ 2007-04-12 15:40   ` Zachary Amsden
  0 siblings, 0 replies; 7+ messages in thread
From: Zachary Amsden @ 2007-04-12 15:40 UTC (permalink / raw)
  To: Chris Wright; +Cc: Virtualization Mailing List

Chris Wright wrote:
> * Jeremy Fitzhardinge (jeremy@goop.org) wrote:
>   
>> Seems to work OK for native and Xen.  I had to play a bit with the
>> paravirt-sched-clock patch to deal with the VMI changes.  Zach, can you
>> check that it still works?
>>     

I'm working off the same tree as Jeremy, so I'm not seeing any problems 
or failures to apply cleanly. As long as sched_clock units match (cycles 
vs. ns), it should be ok. And even if they are off, it would be very 
hard to tell by observation.

Zach

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-04-12 15:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-10 23:23 paravirt repo rebased to 2.6.21-rc6-mm1 Jeremy Fitzhardinge
2007-04-10 23:29 ` Zachary Amsden
2007-04-11  0:10   ` Chris Wright
2007-04-10 23:29 ` Zachary Amsden
2007-04-10 23:48 ` Chris Wright
2007-04-12  8:54 ` Chris Wright
2007-04-12 15:40   ` Zachary Amsden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).