The following assembly code is used to set the Descriptors in xenolinux.
Theoretically, for xenolinux we have Descriptor privilege level(DPL) = 1
for all its descriptors. But from the instruction,
"movb %4,5(%2)\n\t" (with the parameter, type =0x82 and 0x89)
it seems that the DPL is set to 0.
How is this possible. Dont we have xenolinux running at privilege level 1?
Am I going wrong somewhere?
#define _set_tssldt_desc(n,addr,limit,type) \
__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
"movw %%ax,2(%2)\n\t" \
"rorl $16,%%eax\n\t" \
"movb %%al,4(%2)\n\t" \
"movb %4,5(%2)\n\t" \
"movb $0,6(%2)\n\t" \
"movb %%ah,7(%2)\n\t" \
"rorl $16,%%eax" \
: "=m"(*(n)) : "a" (addr), "r"(n),
"ir"(limit), "i"(type))
The above inline assembly is called as :
_set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[entry], (int)addr,
offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89);
_set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr,
((size << 3)-1), 0x82);
Thanks for any replies,
Purav
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel