WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Propose "xen_init()" call first thing in Xen drivers

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] Propose "xen_init()" call first thing in Xen drivers
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 22 Sep 2005 13:02:17 -0500
Cc: "Magenheimer, Dan \(HP Labs Fort Collins\)" <dan.magenheimer@xxxxxx>, Matt Chapman <matthewc@xxxxxxxxxxxxxxx>
Delivery-date: Thu, 22 Sep 2005 18:01:10 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <516F50407E01324991DD6D07B0531AD5695EE8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <516F50407E01324991DD6D07B0531AD5695EE8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8.2
On Wednesday 21 September 2005 16:51, Magenheimer, Dan (HP Labs Fort Collins) 
wrote:
> Here's another patch needed for ia64 in various xen drivers
> that should probably be discussed before the actual patch
> code is attached/applied.
>
> Per previous posts, Xenlinux/ia64 is transparently paravirtualized,
> which means the same bits run on top of Xen as on top of raw
> iron.
>
> To accomplish this, we have to be very careful to avoid doing
> Xen-like things when we are not running on Xen.  The Xen
> drivers tend to do Xen-like things early and often.  To avoid
> the Xen drivers doing nasty things when not running on Xen,
> we have added a single line at the beginning of various
> drivers/xen/xxx xxx_init() routines, namely:
>
>       if (xen_init() < 0) return -ENODEV

I agree that something like this is necessary, though I don't like the "init" 
direction you're going in.

In general, drivers need some way of probing for their (virtual) device, and 
if the device is not present return ENODEV.

[...]
> But wait... on xenlinux/ia64, xen_init does something
> else!  In xenlinux/x86 there was (not sure if it is still
> there) some funky linker stuff to ensure that the drivers
> are linked in the right order as bad things happened
> if they weren't (due to the way init() works on Linux).
> On xenlinux/ia64, xen_init() eliminates this problem with
> a simple static one-shot variable in xen_init; regardless
> of which routine calls xen_init first, xen_init does the
> necessary initialization once.  No linker magic required.

What linker magic exactly? I don't understand the problem.

Could you provide a pointer to the ia64 xen_init() implementation? Just as PCI 
bus initialization takes place before PCI drivers are loaded, any Xen 
initialization should take place before the Xen drivers are loaded. PCI 
drivers do not call any pci_init() function.

-- 
Hollis Blanchard
IBM Linux Technology Center

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>