|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Propose "xen_init()" call first thing in Xen drivers
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
|
|
|
|
|