Re: [git-pull -tip V2] x86: cpu architecture debug code

From: Jeremy Fitzhardinge
Date: Fri Mar 13 2009 - 03:34:56 EST


Jaswinder Singh Rajput wrote:
Complete diff:
diff --git a/arch/x86/kernel/cpu/cpu_debug.c b/arch/x86/kernel/cpu/cpu_debug.c
index 0bdf4da..08c365a 100755
--- a/arch/x86/kernel/cpu/cpu_debug.c
+++ b/arch/x86/kernel/cpu/cpu_debug.c
@@ -464,19 +464,19 @@ static void print_dt(void *seq)
unsigned long ldt;
/* IDT */
- store_idt((struct desc_ptr *)&dt);
+ native_store_idt((struct desc_ptr *)&dt);
hm, this wont work on Xen then.


Strange it should work for Xen, Are you getting any error.

Xen also uses native_store_idt:
arch/x86/xen/enlighten.c: .store_idt = native_store_idt,

store_idt (and the others) are not used very much, and never in any code path under Xen. They're not really meaningful in Xen, and this code will probably oops if you ran it.

I guess we could do more meaningful implementations of these ops for Xen, now that there's a user.

print_desc_ptr("IDT", seq, dt);
/* GDT */
- store_gdt((struct desc_ptr *)&dt);
+ native_store_gdt((struct desc_ptr *)&dt);
print_desc_ptr("GDT", seq, dt);
/* LDT */
- store_ldt(ldt);
+ asm volatile("sldt %0" : "=m" (ldt));
seq_printf(seq, " LDT\t: %016lx\n", ldt);
/* TR */
- store_tr(ldt);
+ asm volatile("str %0" : "=r" (ldt));
seq_printf(seq, " TR\t: %016lx\n", ldt);
we do have a store_tr() primitive - why open code the assembly?


It is a single line code to avoid further conflicts, so i moved it here.

Definitely a bad idea.

J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/