Hello
Can anyone share a known working config for xen which would transfer a serial interface ( add-on card preferably, mine uses e880-e887 : 0000:03:05.0 / ec00-ec07 : 0000:03:05.0 ) to a DomU ? I've been trying with the stock packages from Centos 5.5 ( fully updated) and also with gitco's 3.4.3 but after 2 days of googling and testing we still fail to access the serial interface from DomU. No matter what we've tried, - in DomU there is no reference to any kind of serial ports in /proc/{interrupts,ioports} - the test program which accesses ttyS0 fails ( it works just fine in dom0) even after manually loading parport_serial in DomU
/dev/ttyS{0..3} do get created by default, if that matters.
Here is the content of the config file, after the last attempt (which uses gitco's xen, but we failed similarly with the stock packages):
name = "testr" uuid = "57baf51a-e293-fa35-9f2e-056a1c0e322a" maxmem = 512 memory = 512 vcpus = 1 bootloader = "/usr/bin/pygrub" on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" vfb = [ "type=vnc,vncunused=1,keymap=en-us" ] disk = [ "tap:aio:/var/lib/xen/images/testr,xvda,w" ] vif = [ "mac=00:16:36:0c:aa:1a,bridge=xenbr0,script=vif-bridge" ] irq = [11 ] ioports = [ "ec00-ec07","e080-e08f" ] // we also tried to pass all the IO ports referenced in lspci -vvv
[root@Dom0]#lspci -vvv 03:05.0 Communication controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01) Subsystem: LSI Logic / Symbios Logic 1P2S Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium
TAbort- <TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 11 Region 0: I/O ports at ec00 [size=8] Region 1: I/O ports at e880 [size=8] Region 2: I/O ports at e800 [size=8] Region 3: I/O ports at e480 [size=8] Region 4: I/O ports at e400 [size=8] Region 5: I/O ports at e080 [size=16]
[root@Dom0 ~]# dmesg | grep ttyS
[root@Dom0 ~]# cat /etc/modprobe.d/blacklist #[...] blacklist 8250 blacklist 8250_pnp blacklist serial_core blacklist parport_serial blacklist 8250_pci
[root@Dom0 ~]# grep xen /etc/grub.conf title CentOS (2.6.18-194.el5xen) kernel /xen.gz-3.4.3 module /vmlinuz-2.6.18-194.el5xen ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.18-194.el5xen.img title CentOS (2.6.18-194.8.1.el5xen) kernel /xen.gz-3.4.3 module /vmlinuz-2.6.18-194.8.1.el5xen ro root=/dev/VolGroup00/LogVol00 xencons=off module /initrd-2.6.18-194.8.1.el5xen.img
[root@Dom0 ~]# uname -a Linux Dom0 3 2.6.18-194.8.1.el5xen #1 SMP Thu Jul 1 19:41:05 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
sniff from the boot messages in tge DomU:
XENBUS: Device with no driver: device/vbd/51712 XENBUS: Device with no driver: device/vif/0 XENBUS: Device with no driver: device/ioports/0 XENBUS: Device with no driver: device/ioports/1 XENBUS: Device with no driver: device/ioports/2 XENBUS: Device with no driver: device/ioports/3 XENBUS: Device with no driver: device/ioports/4 XENBUS: Device with no driver: device/ioports/5 XENBUS: Device with no driver: device/irq/0 XENBUS: Device with no driver: device/console/0
[root@DomU ~]# cat /proc/interrupts CPU0 256: 7433 Dynamic-irq timer0 257: 0 Dynamic-irq resched0 258: 0 Dynamic-irq callfunc0 259: 554 Dynamic-irq xenbus 260: 705 Dynamic-irq xencons 261: 802 Dynamic-irq xenfb 262: 0 Dynamic-irq xenkbd 263: 6607 Dynamic-irq blkif 264: 8959 Dynamic-irq eth0 NMI: 0 LOC: 0 ERR: 0 MIS: 0
[root@DomU ~]# cat /proc/ioports 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-0060 : keyboard 0064-0064 : keyboard 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu
[root@DomU ~]# lsmod Module Size Used by 8250_pnp 43969 0 parport_serial 41153 0 8250_pci 56257 1 parport_serial 8250 86057 2 8250_pnp,8250_pci serial_core 56385 1 8250 [...]
[root@DomU ~]# uname -a Linux DomU 2.6.18-194.8.1.el5xen #1 SMP Thu Jul 1 19:41:05 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
TIA
manuel
Le Thu, 05 Aug 2010 16:31:21 +0300, Manuel Wolfshant wolfy@nobugconsulting.ro a écrit :
Hello
Can anyone share a known working config for xen which would
transfer a serial interface ( add-on card preferably, mine uses e880-e887 : 0000:03:05.0 / ec00-ec07 : 0000:03:05.0 ) to a DomU ?
Sorry, only the on-board standard serial port here :
## dom0 : /etc/xen/omega name = "omega" kernel = "/boot/vmlinuz-2.6.18-128.1.6.el5xen" ramdisk = "/boot/initrd-2.6.18-128.1.6.el5xen.img" memory = 256 vif = [ 'mac=AA:00:AC:10:01:0f, bridge=xenbr1' ] disk = ['file:/var/lib/xen/images/omega.img,sda1,w' ] # serial port : irq = [ 4 ] ioports = [ "3f8-3ff" ] # root = "/dev/sda1 ro" extra = "fastboot"
## domU : /etc/rc.local # but should be in /etc/udev/somewhere modprobe -a serial_core 8250 chown root:ups /dev/ttyS0
## domU : ls /lib/modules/2.6.18-128.1.6.el5xen/kernel/drivers/serial/ 8250.ko 8250_pci.ko 8250_pnp.ko jsm serial_core.ko serial_cs.ko
## domU : lsmod | egrep '(serial|8250)' 8250 35685 2 serial_core 24641 1 8250
## domU : dmesg | grep -i serial Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[root@Dom0 ~]# dmesg | grep ttyS
Xen virtual console successfully installed as ttyS0 (from /var/log/dmesg, the output of dmesg is full of messages from iptables)
[root@Dom0 ~]# cat /etc/modprobe.d/blacklist #[...]
blacklist 8250 blacklist 8250_pnp blacklist serial_core
[root@Dom0 ~]# grep xen /etc/grub.conf
title CentOS (2.6.18-194.8.1.el5xen) kernel /boot/xen.gz-2.6.18-194.8.1.el5 dom0_mem=256M vga=mode-0x307 noreboot dom0_vcpus_pin dom0_max_vcpus=1 xencons=tty module /boot/vmlinuz-2.6.18-194.8.1.el5xen ro root=LABEL=/ module /boot/initrd-2.6.18-194.8.1.el5xen.img # (not up-to-date because I am lazy...)
sniff from the boot messages in tge DomU:
XENBUS: Device with no driver: device/vbd/2049 XENBUS: Device with no driver: device/vif/0 # ( nothing more )
[root@DomU ~]# cat /proc/interrupts CPU0
4: 82698953 Phys-irq serial
[root@DomU ~]# cat /proc/ioports
03f8-03ff : serial
[root@DomU ~]# lsmod Module Size Used by 8250_pnp 43969 0 parport_serial 41153 0 8250_pci 56257 1 parport_serial 8250 86057 2 8250_pnp,8250_pci serial_core 56385 1 8250 [...]
Good (for a standard serial port) but useless without a port.
This domU has been created from an image from http://stacklet.com/. I had no problem at all.
Good luck,
On 08/05/2010 04:31 PM, Manuel Wolfshant wrote:
Hello
Can anyone share a known working config for xen which would
transfer a serial interface ( add-on card preferably, mine uses e880-e887 : 0000:03:05.0 / ec00-ec07 : 0000:03:05.0 ) to a DomU ?
[...]
Replying to myself: the very same config works OK when using the onboard interface, i.e. using
irq = [ 4 ] ioports = [ "3f8-3ff" ]
Is it a known bug / feature that add-on ports are not transferred to DomU ?
Le Fri, 06 Aug 2010 12:52:00 +0300, Manuel Wolfshant wolfy@nobugconsulting.ro a écrit :
On 08/05/2010 04:31 PM, Manuel Wolfshant wrote:
Hello
Can anyone share a known working config for xen which would
transfer a serial interface ( add-on card preferably, mine uses e880-e887 : 0000:03:05.0 / ec00-ec07 : 0000:03:05.0 ) to a DomU ?
[...]
Replying to myself: the very same config works OK when using the onboard interface, i.e. using
irq = [ 4 ] ioports = [ "3f8-3ff" ]
Is it a known bug / feature that add-on ports are not transferred to DomU ?
Are you sure your expansion board is based on the "classical" UART (8250 or 16550) ? Many add-on cards require specific modules.
This will not work on dom0 if the serial port is already shared, but you can try it when no domU is running :
$ for x in 0 1 2 3 4 ; do setserial /dev/ttyS$x ; done /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 /dev/ttyS4: No such file or directory # (this machine has only one physical port)
My 2 cents,
On 08/06/2010 04:24 PM, Philippe Naudin wrote:
Are you sure your expansion board is based on the "classical" UART (8250 or 16550) ? Many add-on cards require specific modules.
Let's say I am 99% sure. It behaves exactly as a 16550, is listed in dmesg as 0000:03:05.0: ttyS0 at I/O 0xec00 (irq = 21) is a 16550A 0000:03:05.0: ttyS1 at I/O 0xe880 (irq = 21) is a 16550A and it works perfectly from Dom0. The only problem I face is transferring it to DomU.
This will not work on dom0 if the serial port is already shared, but you can try it when no domU is running :
$ for x in 0 1 2 3 4 ; do setserial /dev/ttyS$x ; done /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 /dev/ttyS4: No such file or directory
I did not mention in the first message, but both serial interfaces from the card are perfectly usable from Dom0, from a standard kernel and from Windows ( the computer was previously used to monitor some industrial equipments, without adding any special drivers).
[root@Dom0 ~]# for x in 0 1 2 3 4 ; do setserial /dev/ttyS$x ; done /dev/ttyS0, UART: 16550A, Port: 0xec00, IRQ: 21 /dev/ttyS1, UART: 16550A, Port: 0xe880, IRQ: 21 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 /dev/ttyS4: No such file or directory
What I am not 100% sure is that we correctly blacklist all the modules related to serial interfaces in Dom0. But OTOH exactly the same config ( modulo ports / irq ) works with the onboard interface.
manuel
Le Fri, 06 Aug 2010 17:37:14 +0300, Manuel Wolfshant wolfy@nobugconsulting.ro a écrit :
On 08/06/2010 04:24 PM, Philippe Naudin wrote:
Are you sure your expansion board is based on the "classical" UART (8250 or 16550) ? Many add-on cards require specific modules.
Let's say I am 99% sure. It behaves exactly as a 16550, is listed in dmesg as 0000:03:05.0: ttyS0 at I/O 0xec00 (irq = 21) is a 16550A 0000:03:05.0: ttyS1 at I/O 0xe880 (irq = 21) is a 16550A and it works perfectly from Dom0. The only problem I face is transferring it to DomU.
This will not work on dom0 if the serial port is already shared, but you can try it when no domU is running :
$ for x in 0 1 2 3 4 ; do setserial /dev/ttyS$x ; done /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 /dev/ttyS4: No such file or directory
I did not mention in the first message, but both serial interfaces from the card are perfectly usable from Dom0, from a standard kernel and from Windows ( the computer was previously used to monitor some industrial equipments, without adding any special drivers).
[root@Dom0 ~]# for x in 0 1 2 3 4 ; do setserial /dev/ttyS$x ; done /dev/ttyS0, UART: 16550A, Port: 0xec00, IRQ: 21 /dev/ttyS1, UART: 16550A, Port: 0xe880, IRQ: 21 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 /dev/ttyS4: No such file or directory
What I am not 100% sure is that we correctly blacklist all the
modules related to serial interfaces in Dom0. But OTOH exactly the same config ( modulo ports / irq ) works with the onboard interface.
Yes, quite surprising ...
And when you start the domU, is there any ttyS available for the dom0 ? In this case, with ttyS0 in use by a domU, I have on dom0 : $ for x in 0 1 2 3 4 ; do setserial /dev/ttyS$x ; done Cannot get serial info: Invalid argument /dev/ttyS1: No such device or address /dev/ttyS2: No such device or address /dev/ttyS3: No such device or address /dev/ttyS4: No such file or directory
And in domU : $ for x in 0 1 2 3 4 ; do setserial /dev/ttyS$x ; done /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 /dev/ttyS4: No such file or directory
One more thing to check : in your initial post, the serial port was on IRQ 11, now setserial see them on IRQ 21. When the domU is in use, the IRQ must be free in dom0 (you have shown the /proc/interrupts of domU, but not the one from dom0). Maybe irq = [11, 21] can help ?
Good luck, or week-end at least,