WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Privilege levels in xenolinux

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Privilege levels in xenolinux
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
Importance: Normal
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: SquirrelMail/1.4.5
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

<Prev in Thread] Current Thread [Next in Thread>