Russell Coker: Kernel issues with Debian Xen and CentOS Kernels
Last time I tried using a Debian 64bit Xen kernel for Dom0 I was unable to get it to work correctly, it continually gave kernel panics when doing any serious disk IO. I’ve just tried to reproduce that problem on a test machine with a single SATA disk and it seems to be working correctly so I guess that it might be related to using software RAID and LVM (LVM is really needed for Xen and RAID is necessary for every serious server IMHO).
To solve this I am now experimenting with using a CentOS kernel on Debian systems.
There are some differences between the kernels that are relevant, the most significant one is the choice of which modules are linked in to the kernel and which ones have to be loaded with modprobe. The Debian choice is to have the drivers blktap blkbk and netbk linked in while the Red Hat / CentOS choice was to have them as modules. Therefore the Debian Xen utilities don’t try and load those modules and therefore when you use the CentOS kernel without them loaded Xen simply doesn’t work.
Error: Device 0 (vif) could not be connected. Hotplug scripts not working.
You will get the above error (after a significant delay) from the command “xm create -c name” if you try and start a DomU that has networking when the driver netbk is not loaded.
XENBUS: Timeout connecting to device: device/vbd/768 (state 3)
You will get the above error (or something similar with a different device number) for every block device from the kernel of the DomU if using one of the Debian 2.6.18 kernels, if using a 2.6.26 kernel then you get “XENBUS: Waiting for devices to initialise“.
Also one issue to note is that when you use a file: block device (IE a regular file) then Xen will use a loopback device (internally it seems to only like block devices). If you are having this problem and you destroy the DomU (or have it abort after trying for 300 seconds) then it will leave the loopback device enabled (it seems that the code for freeing resources in the error path is buggy). I have filed Debian bug report #503044 [1] requesting that the Xen packages change the kernel configuration to allow more loopback devices and Debian bug report #503046 [2] requesting that the resources be freed correctly.
Finally the following messages appear in /var/log/daemon.log if you don’t have the driver blktap installed:
BLKTAPCTRL[2150]: couldn’t find device number for ‘blktap0′
BLKTAPCTRL[2150]: Unable to start blktapctrl It doesn’t seem to cause a problem (in my tests I can’t find something I want to do with Xen that required blktap), but I have loaded the driver - even removing error messages is enough of a benefit. Another issue is that the CentOS kernel packages include a copy of the Xen kernel, so you have a Linux kernel matching the Xen kernel. So of course it is tempting to try and run that CentOS Xen kernel on a Debian system. Unfortunately the Xen utilities in Debian/Lenny don’t match the Xen kernel used for CentOS 5 and you get messages such as the following in /var/log/xen/xend-debug.log: sysctl operation failed — need to rebuild the user-space tool set?
Exception starting xend: (13, ‘Permission denied’) Update: Added a reference to another Debian bug report.
BLKTAPCTRL[2150]: couldn’t find device number for ‘blktap0′
BLKTAPCTRL[2150]: Unable to start blktapctrl It doesn’t seem to cause a problem (in my tests I can’t find something I want to do with Xen that required blktap), but I have loaded the driver - even removing error messages is enough of a benefit. Another issue is that the CentOS kernel packages include a copy of the Xen kernel, so you have a Linux kernel matching the Xen kernel. So of course it is tempting to try and run that CentOS Xen kernel on a Debian system. Unfortunately the Xen utilities in Debian/Lenny don’t match the Xen kernel used for CentOS 5 and you get messages such as the following in /var/log/xen/xend-debug.log: sysctl operation failed — need to rebuild the user-space tool set?
Exception starting xend: (13, ‘Permission denied’) Update: Added a reference to another Debian bug report.
Some drivers in Linux include "firmware" - code that runs on the device the
driver deals with, not the main processors in the system. Most of this is in a
binary or equivalent form, which is probably not the form that it was
originally written in. This makes it non-free by Debian's standards, an issue
which has led to much argument around previous releases and has blown up once
again.
The good news is that kernel developers are making a continuing effort to
separate this from the driver code. I've collected together the patches that
do this and written 2 of my own, which appear to cover all the remaining
sourceless firmware. But I was only able to test one of these drivers (radeon)
- the rest is up to you.
Affected drivers
I’ve prepared a set of experimental packages of 1.5.5. They seem to be working fine, and are ready for some testing from brave users.
I’m not going to upload them soon to Debian experimental, since I want to be able to use that if for some reason I need testing of an urgent 1.4 update before the Lenny release.
Meanwhile, take a look at
I've been meaning to fix
I just wanted to fix some RC bugs till I'll go home, so I looked at the



Sometimes, I m becoming really pestered by the number of issues, especially hardware issues, that remain prominent in the Linux system after so many years. And I m convinced that one of the root causes is the kernel development model. While far to be the only one, you understand a lot when you have a look at it.
The stable API nonsense
To explain the development model, the kernel documentation contains a document written by Greg Kroah-Hartman called
I attended
A busy few hours last night hacking at 
I mostly stayed under a rock during the last weeks: exams season, some
assingments plus one week of much needed [VAC]; ironically in the DebConf 8
secondary hotel.
I'm in a very interesting course on operating systems' programming, it's a new
optative course, and has generated a lot of expectatives: most of the
systems-oriented undergrads in the computer science career are attending. The
downside is that it's *intensive*: we're expected to build from scratch a
minimal operating system, starting from the bootloader. So far my group has
already done a bootloader that understands FAT, and the entry point for the OS,
in which the basic stuff is setup: gate A20, interruptions, protected mode,
GDT, etc.
Also, each group is required to do a presentation of
some systems research topic, and we choose Plan 9 from Bell Labs, that mostly
unknown OS that was meant to be a better UNIX, but never gained popularity. So
I spent many days playing with it, trying to grok quickly what it was about,
and creating a small network of virtual hosts (in Qemu) that could show how it
all fit togheter.
Plan 9 has all the credentials: created in the same lab as UNIX, designed
by the same people, which already learned from past mistakes.
It was started in the late eighties, and it really feels like what the
future was meant to be. Sadly, we're just starting to see a few of it's
revolutionary ideas being applied to other systems: UTF-8,
Nothing spectacular here, except for the weird syntax, it was seen like this
in the Debian box:
And the wornderful thing is that this works as it should (note the remote
address):