All of lore.kernel.org
 help / color / mirror / Atom feed
* xen_emul_unplug on xen 4.1, HVM guest 2.6.38
@ 2011-10-26 13:17 Alex Bligh
  2011-10-26 13:49 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 26+ messages in thread
From: Alex Bligh @ 2011-10-26 13:17 UTC (permalink / raw)
  To: xen-devel; +Cc: Alex Bligh

I am running Xen 4 and want users to be able to install arbitrary HVM
images. We want both PV and emulated drivers to appear. The reason
for this is for compatibility with images that were prepared for
Xen 3.3, which assume emulated devices exist at boot time (particularly
for running the boot loader).

If I do not specify on the boot line xen_emul_unplug=never, then
under some guest OS's (e.g. Ubuntu Natty (2.6.38)), the domU kernel
unplugs the non-PV devices, which is undesirable in my application.

I cannot arbitrarily change the kernel command line because it is
in effect set by the user's image.

Therefore what I need to do is prevent Xen4 offering the facility
to unplug the devices in the first place. Setting "(unpluggable 0)"
in the config for the emulated NICs and disks does not appear
to prevent them getting unplugged; what may be happening is that
domU tries to unplug them (but fails) but still doesn't use them.
Is there a way to signal from dom0 that the kernel really shouldn't
unplug this stuff.

-- 
Alex Bligh

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: xen_emul_unplug on xen 4.1, HVM guest 2.6.38
@ 2011-10-26 17:43 Alex Bligh
  2011-10-27  9:27 ` Ian Campbell
  0 siblings, 1 reply; 26+ messages in thread
From: Alex Bligh @ 2011-10-26 17:43 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, Alex Bligh, Konrad Rzeszutek Wilk

Ian,

> I'm a bit fuzzy on the details but I'm not sure what this has to do with
> the host, the device naming and behaviour on unplug are kernel side
> things, I'd expect that if /dev/sdaX as /boot worked on 3.3 it'll work
> on 4.1 too. (I believe you that it doesn't work, I'm just wondering
> aloud what I'm missing).
>
> Can you give us the specifics of a setup which fails, e.g. a complete
> guest cfg file, the kernel version, command line options, /etc/fstab,
> dmesg etc.

I am not avoiding answering your question (I will get you this) but
what is /meant/ to happen in the following scenario:

* Install on recent kernel (e.g. 2.6.37) running on Xen 3.3
* No fancy boot options, xen_emul_unplug not set
* No XEN_IOPORT_MAGIC implemented, so check_platform_magic()
  returns an error
* Therefore xen_platform_pci_unplug=0
* Therefore blkfront etc. don't init (probe returns
  -ENODEV)
* Therefore OS boots with root=/dev/sda

Now Xen 3.3 is upgraded to Xen 4
* Kernel boots, and XEN_IOPORT_MAGIC now exists
* Therefore unplug occurs, and xen_platform_pci_unplug is non zero
* Therefore blkfront etc. inits, and PV drivers start
* OS still boots with root=/dev/sda

Are the PV devices meant to appear as /dev/sdX rather than /dev/xvdX?
If so, how in the code does this happen? If not, won't the boot fail?

> Hmm, yes I think the special treatment of XEN_IOPORT_MAGIC mismatch on
> the kernel side is what I was missing.
>
> It might make sense to have a guest level config option which disables
> these magic ports, i.e. makes them return 0xffff like they would have
> done in 3.3 (I think 0xffff is what you'll get from an invalid port in
> general).

Actually I don't think this will work. If we do this,
xen_plaftofm_pci_unplug will still be zero (as it's only set on exit
of the function after a successful unplug), and that's enough to
prevent blkfront and xenbus_probe_frontend from doing anything useful,
so will effectively disable PV drivers even where they should be enabled.

>> Out of interest, with a default guest Ubuntu Natty install CD, using the
>> default Xen 4.1 settings, we are seeing the guest (a) unplugging the
>> emulated devices (fine), then (b) failing to find the emulated devices,
>> and (c) the install failing. Is that to be expected?
>
> Sounds like an Ubuntu bug to me, but I don't follow Ubuntu closely
> enough to know if it is known or not.

We will investigate further. Currently we can't seem to get /any/
distro using PV drivers, and only old ones using emulated drivers.

-- 
Alex Bligh

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2011-10-27 14:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-26 13:17 xen_emul_unplug on xen 4.1, HVM guest 2.6.38 Alex Bligh
2011-10-26 13:49 ` Konrad Rzeszutek Wilk
2011-10-26 14:12   ` Pasi Kärkkäinen
2011-10-26 14:47     ` Alex Bligh
2011-10-26 14:56       ` Ian Campbell
2011-10-26 15:59         ` Pasi Kärkkäinen
2011-10-26 16:22           ` Ian Campbell
2011-10-26 16:25         ` Alex Bligh
2011-10-26 16:43           ` Ian Campbell
2011-10-27  8:02             ` Stefan Bader
2011-10-27 13:42               ` Stefano Stabellini
2011-10-27 13:45                 ` Stefan Bader
2011-10-27 14:08                   ` Stefano Stabellini
2011-10-27 14:13                     ` Stefan Bader
2011-10-27 14:25                       ` Stefano Stabellini
2011-10-27 14:46                         ` Stefan Bader
2011-10-27 13:48                 ` Stefan Bader
2011-10-27 14:09                   ` Stefano Stabellini
2011-10-26 15:54       ` Pasi Kärkkäinen
  -- strict thread matches above, loose matches on Subject: below --
2011-10-26 17:43 Alex Bligh
2011-10-27  9:27 ` Ian Campbell
2011-10-27 13:13   ` Konrad Rzeszutek Wilk
2011-10-27 13:27     ` Stefano Stabellini
2011-10-27 13:35     ` Ian Campbell
2011-10-27 13:18   ` Alex Bligh
2011-10-27 13:35     ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.