Mailing List Archive

Using Serial Port /dev/ttyS0 in domU
Hi Xen users,

Has anyone managed to use /dev/ttyS0 in domU successfully?

I tried to add next strings in the VM configuration file without any
success.

--------------------------------------
irqs = [ 3, 4 ]
ioports = [ "02f8-02ff", "03f8-03ff" ]
--------------------------------------

This is how part of the configuration looks from xl using -d flag using
only one serial port ttyS0:
------------------------------
"ioports": [
{
"first": 1016,
"number": 8
}
],
"irqs": [
4
],
------------------------------

Using PV domU I'm getting IRQ conflicts with already existing
(callfunc0) and (debug0) with errors like:
------------------------------------------------------------------------------------------
root@pv-domU:~# screen /dev/ttyS0 115200
[ 41.158942] genirq: Flags mismatch irq 4. 00000080 (ttyS0) vs.
00000c00 (debug0)
root@pv-domU:~# screen /dev/ttyS1 115200
[ 79.547305] genirq: Flags mismatch irq 3. 00000080 (ttyS1) vs.
0002cc00 (callfunc0)
------------------------------------------------------------------------------------------
root@domU:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
0: 9975 0 0 0 xen-percpu -virq
timer0
1: 0 0 0 0 xen-percpu -ipi
spinlock0
2: 3133 0 0 0 xen-percpu -ipi
resched0
3: 1053 0 0 0 xen-percpu -ipi
callfunc0
4: 0 0 0 0 xen-percpu -virq
debug0
5: 155 0 0 0 xen-percpu -ipi
callfuncsingle0
...
------------------------------------------------------------------------------------------

In HVM domU I don't even see IRQs in the list
----------------------------------------------------------------------------------
root@mon:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
0: 20 0 0 0 IO-APIC 2-edge
timer
1: 59 0 0 0 xen-pirq
1-ioapic-edge i8042
6: 3 0 0 0 xen-pirq
6-ioapic-edge floppy
8: 2 0 0 0 xen-pirq
8-ioapic-edge rtc0
9: 0 0 0 0 xen-pirq
9-ioapic-level acpi
12: 1308 0 0 0 xen-pirq
12-ioapic-edge i8042
14: 0 1386 0 0 IO-APIC 14-edge
ata_piix
15: 0 0 0 0 IO-APIC 15-edge
ata_piix
48: 32872 0 0 0 xen-percpu -virq
timer0
.....
----------------------------------------------------------------------------------

Is it even supported? Did I miss anything?

--
Konstantin
Re: Using Serial Port /dev/ttyS0 in domU [ In reply to ]
Hi again,

On 2022-09-14 15:14, Konstantin wrote:
> Has anyone managed to use /dev/ttyS0 in domU successfully?
>
> I tried to add next strings in the VM configuration file without any
> success.
>
> --------------------------------------
> irqs = [ 3, 4 ]
> ioports = [ "02f8-02ff", "03f8-03ff" ]
> --------------------------------------

Looks like I've managed to connect to /dev/ttyS0 serial port
using an additional configuration line below
-------------------------
serial = [ "/dev/ttyS0" ]
-------------------------

Previously used irqs and ioports configuration lines can be deleted.

Seems like it is working in HVM only which is totally fine for me.

--
Konstantin