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

RE: [Xen-users] A fundamental doubt.

  • To: "Anuj Bhatt" <anuj.bhatt@xxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
  • Date: Thu, 5 Apr 2007 15:09:55 +0200
  • Delivery-date: Thu, 05 Apr 2007 06:09:05 -0700
  • List-id: Xen user discussion <xen-users.lists.xensource.com>
  • Thread-index: Acd3gXGhkYND3pNzSzino1cXDfvyZQAACqVA
  • Thread-topic: [Xen-users] A fundamental doubt.


> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Anuj Bhatt
> Sent: 05 April 2007 13:53
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-users] A fundamental doubt.
> Hi,
> I read an article on the ring architecture of Xen which is based on
> the protection ring architecture of x86. It said that the host kernel
> as well as the guest xenified kernels run in ring1 and xen on ring0.
> Since xen is in ring0 and hypercalls are basically calls made from
> user space to kernel space(in this case ring1) how does one block
> calls from reaching to dom0 from an event that has occurred from domU?

No, hypercalls are "kernel-mode to hypervisor", so from Ring1 to Ring0,
and Xen knows which guest is which - Dom0 isn't any different from any
other guest other than having a special flag to say "I'm Dom0"
(Actually, the flag says "I'm privileged", but it amounts to the same
thing at the moment). This is comparable to a "regular" user (DomU) and
the "root" user (Dom0) in any Unix. The OS only sees a difference
between root and regular users in special cases where the root user is
allowed to do certain things that regular users would be prevented from
doing (such as killing a process that the user isn't owner of - root can
do this, but a regular user can only kill owned processes). Similarly,
Dom0 can do things like create/destroy domains, but DomU can't. 

To explain a bit further about hypercalls - generally, hypercalls are
part of system calls, for example, if a system call allocates 1MB of
memory, a hypercall would be used to write the 256 page-table entries
into the page-table [this is an example, it may actually not work
exactly that way - but it gives an idea of how hypercalls are used]. 

It is not possible for user-mode applications to perform hypercalls
directly - they have to be done in kernel-space.

> Is this done by the event channel which is monitored?

Event channels are used to communicate between domains, such as Dom0
telling DomU that the disk-read it just asked for is completed, or from
DomU to Dom0 to say "I've got another disk operation I would like you to

[And to be more technical about things, only 32-bit Xen uses Ring1 for
kernel-space. In 64-bit mode, the kernel uses Ring3, but it has a
different page-table mapping so that user-mode apps can't access the
kernel spac]. 

> Have I got my facts right?
> Thanks a ton.
> Regards,
> Anuj Bhatt.
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users

Xen-users mailing list



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