Re: [RFC PATCH 18/35] Support gdt/idt/ldt handling on Xen.

Andi Kleen
2006-03-22T15:05:09Z

On Wednesday 22 March 2006 07:30, Chris Wright wrote:

>
> -#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8))
> -#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8))
> -
> -#define load_gdt(dtr) __asm__ __volatile("lgdt %0"::"m" (*dtr))
> -#define load_idt(dtr) __asm__ __volatile("lidt %0"::"m" (*dtr))
> -#define load_tr(tr) __asm__ __volatile("ltr %0"::"mr" (tr))
> -#define load_ldt(ldt) __asm__ __volatile("lldt %0"::"mr" (ldt))
> -
> -#define store_gdt(dtr) __asm__ ("sgdt %0":"=m" (*dtr))
> -#define store_idt(dtr) __asm__ ("sidt %0":"=m" (*dtr))
> -#define store_tr(tr) __asm__ ("str %0":"=mr" (tr))
> -#define store_ldt(ldt) __asm__ ("sldt %0":"=mr" (ldt))

These are all very infrequent except perhaps LLDT. I suspect trapping would
work too. But ok.

> -#define _set_tssldt_desc(n,addr,limit,type) \

[...]

Why are you moving these? Xen should just be parsing the same structures
as the hardware, shouldn't it?

-Andi