Bug 707130

Summary: ACPI description of serial and parallel ports incorrect with -chardev/-device
Product: Red Hat Enterprise Linux 6 Reporter: Paolo Bonzini <pbonzini>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.0CC: armbru, bsarathy, bugproxy, dornelas, gcosta, juzhang, mkenneth, msvoboda, qzhang, rdassen, sforsber, virt-maint
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.175.el6 Doc Type: Bug Fix
Doc Text:
When KVM guests were launched with the "-device isa-serial" option instead of the "-serial" option, serial devices created were not visible by Windows guests. This issue arose because QEMU did not expose these devices in the guests' ACPI tables. With this fix, the guest's ACPI Differentiated System Description Table (DSDT) now properly senses the presence of serial devices and Windows guests can now see them properly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 15:41:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580951, 727896    

Description Paolo Bonzini 2011-05-24 07:10:58 UTC
Description of problem:

Guest1:
/usr/libexec/qemu-kvm -M rhel6.0.0 -enable-kvm -m 500 -nographic -nodefconfig -nodefaults -chardev tty,id=serial0,path=/dev/ttyUSB0 -device isa-serial,chardev=serial0 hd.img

# udevadm info --query path --name /dev/ttyS0
/devices/platform/serial8250/tty/ttyS0
# !! --attribute-walk | grep looking
  looking at device '/devices/platform/serial8250/tty/ttyS0':
  looking at parent device '/devices/platform/serial8250':
  looking at parent device '/devices/platform':

Guest2:
/usr/libexec/qemu-kvm -M rhel6.0.0 -enable-kvm -m 500 -nographic -nodefconfig -nodefaults -serial /dev/ttyUSB0 hd.img

# udevadm info --query path --name /dev/ttyS0
/devices/pnp0/00:05/tty/ttyS0
# !! --attribute-walk | grep looking
  looking at device '/devices/pnp0/00:05/tty/ttyS0':
  looking at parent device '/devices/pnp0/00:05':
  looking at parent device '/devices/pnp0':

As it can be seen in udevadm output, this devices are seen quite differenty in the system (guest1: /devices/platform/serial8250, guest2: =/devices/pnp0).  If using config like for guest2, Windows guests does see devices. In case of config like for guest1 windows does not see this COMs.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.146.el6

How reproducible:
100%

Steps to Reproduce:
1. see above
  
Actual results:
-device isa-serial and -serial produce different udev output.

Expected results:
Both -device isa-serial and -serial show the device as /devices/pnp0/00:06/tty/ttyS0

Additional info:
The difference is in the ACPI description of whether COM1 or COM2 is present.  Array "serial_hds" in QEMU is used to fill in the information, and it is only set if you use -serial (see serial_parse in vl.c).

This is a regression from RHEL5, I think.

Comment 1 Markus Armbruster 2011-05-25 16:11:17 UTC
piix4_pm_initfn() expects the configured serial devices in serial_hds[].  Default serial device and devices created with -serial are there, but not the ones created with -device isa-serial.

Same issue with parallel_hds[], but isa-parallel devices are not supported in RHEL-6.

I believe the bug exists upstream as well.

Comment 2 Paolo Bonzini 2011-05-25 16:23:56 UTC
Yes, it does.

Comment 4 juzhang 2011-06-14 10:59:20 UTC
Can be produced with qemu-kvm-0.12.1.2-2.163.el6.x86_64,marked qa_ack+

1.boot guest with -chardev tty,id=serial0,path=/dev/ttyS0 -device isa-serial,chardev=serial0

In guest
#udevadm info --query path --name /dev/ttyS0/
/devices/platform/serial8250/tty/ttyS0

2.boot guest with -serial /dev/ttyS0

In guest
udevadm info --query path --name /dev/ttyS0/
/devices/pnp0/00:06/tty/ttyS0

Comment 13 Qunfang Zhang 2011-08-11 05:13:59 UTC
Reproduced on qemu-kvm-0.12.1.2-2.172.el6 and verified pass on qemu-kvm-0.12.1.2-2.177.el6.
Steps:
1. Boot guest A with
-chardev tty,id=serial0,path=/dev/ttyS0 -device isa-serial,chardev=serial0
Inside guest:
#udevadm info --query path --name /dev/ttyS0
#!! --attribute-walk | grep looking

2. Boot guest B with
-serial /dev/ttyS0
Inside guest:
#udevadm info --query path --name /dev/ttyS0
#!! --attribute-walk | grep looking

Results:
After fixed, the output of step 1 and step 2 are the same as following:
[root@dhcp-66-82-166 ~]# udevadm info --query path --name /dev/ttyS0
/devices/pnp0/00:06/tty/ttyS0
[root@dhcp-66-82-166 ~]# !! --attribute-walk | grep looking
udevadm info --query path --name /dev/ttyS0 --attribute-walk | grep looking
looking at device '/devices/pnp0/00:06/tty/ttyS0':
looking at parent device '/devices/pnp0/00:06':
looking at parent device '/devices/pnp0':

So, this bug is fixed.

Comment 15 Miroslav Svoboda 2011-08-23 15:05:36 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When KVM guests were configured with the "-serial" option or the "-device isa-serial" option, serial devices created were displayed incorrectly by the system and were not visible by Windows guests. This issue arose because such devices were described incorrectly in the Advanced Configuration and Power Interface (ACPI) Differentiated System Description Table (DSDT). To fix this issue, the code has been modified to report such serial devices in the PCI IDE ISA Xcelerator 4 (PIIX4) configuration space. The system now shows these serial devices correctly and such devices are now registered by ACPI DSDT so Windows systems can now see these devices properly.

Comment 16 Paolo Bonzini 2011-08-23 16:13:36 UTC
Fixed and cleaned up the description; the bug only occurs with "-serial", not
"-device isa-serial".  I omitted the expansion of ACPI, and avoided mentioning
PIIX4 which is just an implementation detail of current versions of QEMU.  In
general, if somebody really cares about how the fix works, they should know at
least what ACPI is, even though perhaps not that the fix involves the DSDT.

Comment 17 Paolo Bonzini 2011-08-23 16:13:37 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When KVM guests were configured with the "-serial" option or the "-device isa-serial" option, serial devices created were displayed incorrectly by the system and were not visible by Windows guests. This issue arose because such devices were described incorrectly in the Advanced Configuration and Power Interface (ACPI) Differentiated System Description Table (DSDT). To fix this issue, the code has been modified to report such serial devices in the PCI IDE ISA Xcelerator 4 (PIIX4) configuration space. The system now shows these serial devices correctly and such devices are now registered by ACPI DSDT so Windows systems can now see these devices properly.+When KVM guests were launched with the "-device isa-serial" option instead of the "-serial" option (as libvirt does in Red Hat Enterprise Linux version 6), serial devices created were not visible by Windows guests. This issue arose because QEMU did not expose these devices in the guest's ACPI tables.  With the fix, the ACPI Differentiated System Description Table (DSDT) will properly sense the presence of serial devices and Windows guests will see them properly.

Comment 18 Miroslav Svoboda 2011-08-23 17:32:41 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When KVM guests were launched with the "-device isa-serial" option instead of the "-serial" option (as libvirt does in Red Hat Enterprise Linux version 6), serial devices created were not visible by Windows guests. This issue arose because QEMU did not expose these devices in the guest's ACPI tables.  With the fix, the ACPI Differentiated System Description Table (DSDT) will properly sense the presence of serial devices and Windows guests will see them properly.+When KVM guests were launched with the "-device isa-serial" option instead of the "-serial" option, serial devices created were not visible by Windows guests. This issue arose because QEMU did not expose these devices in guests' ACPI tables.  With this fix, the guest's ACPI Differentiated System Description Table (DSDT) now properly senses the presence of serial devices and Windows guests can now see them properly.

Comment 19 Miroslav Svoboda 2011-08-23 17:39:35 UTC
I've done several style corrections and reflected the description to the related advisory.

Comment 22 Miroslav Svoboda 2011-08-24 15:33:51 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When KVM guests were launched with the "-device isa-serial" option instead of the "-serial" option, serial devices created were not visible by Windows guests. This issue arose because QEMU did not expose these devices in guests' ACPI tables.  With this fix, the guest's ACPI Differentiated System Description Table (DSDT) now properly senses the presence of serial devices and Windows guests can now see them properly.+When KVM guests were launched with the "-device isa-serial" option instead of the "-serial" option, serial devices created were not visible by Windows guests. This issue arose because QEMU did not expose these devices in the guests' ACPI tables.  With this fix, the guest's ACPI Differentiated System Description Table (DSDT) now properly senses the presence of serial devices and Windows guests can now see them properly.

Comment 23 errata-xmlrpc 2011-12-06 15:41:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1531.html