Gautham Kampalapur Shankar, TLS, Chennai
2007-Jun-04 15:05 UTC
[Xen-devel] help to understand is_running _on_xen ?
help to understand is_running _on_xen ? I don''t understand why we check this condition is_running_on_xen ?In all drivers(front & back) code we are checking this condition ?what is this function stands for ? what it does ? DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Petersson, Mats
2007-Jun-04 15:15 UTC
RE: [Xen-devel] help to understand is_running _on_xen ?
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Gautham Kampalapur Shankar, TLS, Chennai > Sent: 04 June 2007 16:05 > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] help to understand is_running _on_xen ? > > > I don''t understand why we check this condition > is_running_on_xen ?In all drivers(front & back) code we are > checking this condition ?what is this function stands for ? > what it does ?If you search for "is_running_on_xen" in the Linux tree, you''ll find that the x86 definition of this is "1" - so any test for this, currently, means that it''s "true". IA64 is different, at least in the exact implementation. I can''t explain this in any othe way than that the plan is to allow for drivers to check if they are running on a native platform or running on top of Xen, and make decisions (such as "not attempt to make hypercalls") based on which case it is - so if we''re not running on Xen, don''t make hypercalls to Xen, because it wont work! -- Mats> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2007-Jun-04 17:53 UTC
Re: [Xen-devel] help to understand is_running _on_xen ?
> > I don''t understand why we check this condition > > is_running_on_xen ?In all drivers(front & back) code we are > > checking this condition ?what is this function stands for ? > > what it does ? > > If you search for "is_running_on_xen" in the Linux tree, you''ll find > that the x86 definition of this is "1" - so any test for this, > currently, means that it''s "true". IA64 is different, at least in the > exact implementation. > > I can''t explain this in any othe way than that the plan is to allow for > drivers to check if they are running on a native platform or running on > top of Xen, and make decisions (such as "not attempt to make > hypercalls") based on which case it is - so if we''re not running on Xen, > don''t make hypercalls to Xen, because it wont work!IA64, at least at one stage (not sure of the current status, since there have been quite a few changes since I read about this), supported "transparent paravirtualisation" whereby the same kernel could run with minimal performance loss both on the native hardware and paravirtualised. The x86 paravirt_ops code for Linux is designed to allow this mode of operation for x86_32 systems also (and presumably, eventually it''ll work for x86_64). It doesn''t make any sense to enable the Xen-aware drivers when not running on Xen - they won''t work as the platform features they require (hypercalls etc) are not present. is_running_on_xen() may be defined to 1 (as in the linux-sparse tree supplied with Xen) if the kernel is only ever intended to run paravirtualised, or if the kernel is capable of transparent paravirtualisation it may call to a function which checks for the presence of Xen and returns nonzero only if Xen is available. HTH, Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel