Subject: Re: Xen Internals(Trap handler)
To: Vibhooti Verma <vibhooti_verma@yahoo.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-xen
Date: 03/27/2007 12:32:22
On Mon, Mar 26, 2007 at 09:37:51PM -0700, Vibhooti Verma wrote:
> 
> Thanks Manuel
> Normally Only two rings( 0 --for kernel and 3--for user) are used. So how
> exactly we make use of 3 rings?
> How do we force the guest kernels to run in ring-1 and hypervisor is ring-0.
> How does xen implemt it?

writing to %cs is a privileged instruction, so only the hypervisor can do it
(actually it's possible that increasing the ring level from 1 to 3 is
allowed without traps, so you would save an hypercall in this case -
someone should check the sources for this, or a x86 book :)
As for userland traps , I don't know if they go to the hypervisor at ring 0
and the hypervisor calls the kernel at ring 1, of if they directly falls
in the kernel at ring 1: someone should check the sources for this as well :)
The anserw may be in sys/arch/xen/i386/trap.c, or in one of the assembly
in sys/arch/xen/i386/

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 26 ans d'experience feront toujours la difference
--