Bug 1204696

Summary: Expose PM system states in fw_cfg file on Q35
Product: Red Hat Enterprise Linux 7 Reporter: Amit Shah <amit.shah>
Component: qemu-kvm-rhevAssignee: Laszlo Ersek <lersek>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: amit.shah, areis, huding, juzhang, lersek, virt-maint, xfu, xwei, yama
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.3.0-11.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-04 16:32:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1227278    

Description Amit Shah 2015-03-23 11:37:14 UTC
Description of problem:
During the review of patches for bug  , Laszlo noted piix4 exposes PM system states in the fw_cfg file /etc/system-states but q35 does not.  q35 should expose those states too.

Justification, from Laszlo's email:

The information in the ACPI table is perfectly suitable for operating systems (which have full-blown AML interpreters), but enabling/disabling  S3 may strongly influence firmware behavior too.

OVMF is such a firmware. The enabled vs. disabled state of S3 makes an important difference for the OVMF memory map, from the PEI phase forward, plus it decides whether several DXE drivers related to S3 are loaded or not. It's easy to key this off the simple format of "etc/system-states", and practically impossible to retrieve from AML.

Comment 1 Laszlo Ersek 2015-03-23 11:40:46 UTC
(In reply to Amit Shah from comment #0)
> Description of problem:
> During the review of patches for bug  ,

It was bug 1170533.

Comment 3 Laszlo Ersek 2015-04-29 13:40:22 UTC
Posted http://thread.gmane.org/gmane.comp.emulators.qemu/333285

Comment 5 Laszlo Ersek 2015-05-15 12:11:50 UTC
Now part of Paolo's patchset at
http://thread.gmane.org/gmane.comp.emulators.qemu/335589

Comment 6 Laszlo Ersek 2015-06-05 19:31:24 UTC
Upstream commits:

1  9a10bbb hw/acpi: acpi_pm1_cnt_init(): take "disable_s3" and "disable_s4"
2  e3845e7 hw/acpi: move "etc/system-states" fw_cfg file from PIIX4 to core
3  6e7d824 hw/acpi: piix4_pm_init(): take fw_cfg object no more

Comment 7 Laszlo Ersek 2015-06-17 13:51:53 UTC
How to test:

-------------
CODE=/usr/share/OVMF/OVMF_CODE.fd
TMPL=/usr/share/OVMF/OVMF_VARS.fd

cp $TMPL vars.fd

/usr/libexec/qemu-kvm \
  -nodefaults \
  -M q35 \
  -drive if=pflash,readonly,format=raw,file=$CODE \
  -drive if=pflash,format=raw,file=vars.fd \
  -debugcon file:debug.log \
  -global isa-debugcon.iobase=0x402 \
  -chardev stdio,signal=off,mux=on,id=char0 \
  -mon chardev=char0,mode=readline,default \
  -serial chardev:char0 \
  -global ICH9-LPC.disable_s3=0
-------------

Once the edk2 setup utility appears on the serial console, switch to the QEMU monitor with [C-a c], and exit qemu with "quit".

Then the "debug.log" file must contain the following line:

-------------
S3 support was detected on QEMU
-------------

Comment 10 Miroslav Rezanina 2015-07-17 08:57:18 UTC
Fix included in qemu-kvm-rhev-2.3.0-11.el7

Comment 12 Yanhui Ma 2015-07-29 04:38:41 UTC
verify the bug according to comment 7 

host info:
3.10.0-297.el7.x86_64
qemu-kvm-rhev-2.3.0-13.el7.x86_64

steps:
1.install ovmf-20150414-2.gitc9e5618.el7 in host

2.cp /usr/share/OVMF/OVMF_VARS.fd /home

3./usr/libexec/qemu-kvm -nodefaults -M q35 -drive if=pflash,readonly,format=raw,file=/usr/share/OVMF/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/vars.fd -debugcon file:debug.log -global isa-debugcon.iobase=0x402 -chardev stdio,signal=off,mux=on,id=char0 -mon chardev=char0,mode=readline,default -serial chardev:char0 -global ICH9-LPC.disable_s3=0

4.Once the edk2 setup utility appears on the serial console, switch to the QEMU monitor with [C-a c], and exit qemu with "quit".

results:
The "debug.log" file contains the following line:

-------------
S3 support was detected on QEMU
-------------


Based on the above, I think the bug has been fixed.

Comment 13 juzhang 2015-07-29 10:18:41 UTC
According to comment12, set this issue as verified.

Comment 15 errata-xmlrpc 2015-12-04 16:32:24 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.

https://rhn.redhat.com/errata/RHBA-2015-2546.html