From: "Purav Saraiya" Subject: Privilege levels in xenolinux Date: Tue, 8 Nov 2005 00:23:10 -0500 (EST) Message-ID: <32907.130.207.114.76.1131427390.squirrel@webmail.cc.gatech.edu> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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