[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Privilege levels in xenolinux


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Purav Saraiya" <purav@xxxxxxxxxxxxx>
  • Date: Tue, 8 Nov 2005 00:23:10 -0500 (EST)
  • Delivery-date: Tue, 08 Nov 2005 05:23:18 +0000
  • Importance: Normal
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.