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? Is this done by the event channel which is monitored? Have I got my facts right? Thanks a ton. Regards, Anuj Bhatt. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Anuj Bhatt > Sent: 05 April 2007 13:53 > To: xen-users@lists.xensource.com > 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 perform". [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]. -- Mats> > Have I got my facts right? > > Thanks a ton. > > Regards, > Anuj Bhatt. > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi, On 4/5/07, Petersson, Mats <Mats.Petersson@amd.com> wrote:> 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 > perform".Firstly, thanks for the prompt reply. Now, here''s a related doubt. If I insert a USB drive when I''m on a xen host (my dom0). Does the xen guest recognize it like on VMWare. I''ve noticed on VMWare that if a pen drive is inserted it shows up on both, the guest and the host. So this mount is treated via an event channel or a hypercall or both? If it''s recognized on both, is there some way I can only get it identified on the guest? I haven''t tried it yet since I just switched to a new box. Regards, Anuj Bhatt. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: Anuj Bhatt [mailto:anuj.bhatt@gmail.com] > Sent: 05 April 2007 14:24 > To: Petersson, Mats > Cc: xen-users@lists.xensource.com > Subject: Re: [Xen-users] A fundamental doubt. > > Hi, > > On 4/5/07, Petersson, Mats <Mats.Petersson@amd.com> wrote: > > > 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 > > perform". > > Firstly, thanks for the prompt reply. Now, here''s a related doubt. If > I insert a USB drive when I''m on a xen host (my dom0). Does the xen > guest recognize it like on VMWare. I''ve noticed on VMWare that if a > pen drive is inserted it shows up on both, the guest and the host. So > this mount is treated via an event channel or a hypercall or both? If > it''s recognized on both, is there some way I can only get it > identified on the guest? I haven''t tried it yet since I just switched > to a new box.Xen doesn''t automatically export pen-drives (or any other removable media) to the guests. You can manually attach a block-device (e.g. a pen-drive) with "xm block-attach dom location". If you want to share the device, you''ll need to have it in read-only mode, as Xen doesn''t support (as a general rule) multiple writes to the same device. If you do "xm block-attach" there will be both hypercalls and events involved in informing the guest of the new device appearing. -- Mats> > > > Regards, > Anuj Bhatt. > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users