All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] acpi: fix up EJ0 in DSDT
@ 2011-09-21 12:44 Michael S. Tsirkin
  2011-09-21 12:44 ` [PATCH 1/4] acpi: generate mixed asl/aml listing Michael S. Tsirkin
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Michael S. Tsirkin @ 2011-09-21 12:44 UTC (permalink / raw)
  To: Amos Kong
  Cc: Kevin O'Connor, seabios, Gleb Natapov, kvm, jasowang,
	alex williamson, Marcelo Tosatti

Here's a bug: guest thinks it can eject VGA device and ISA bridge.

[root@dhcp74-172 ~]#lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 PCI bridge: Red Hat, Inc. Device 0001
00:04.0 Ethernet controller: Qumranet, Inc. Virtio network device
00:05.0 SCSI storage controller: Qumranet, Inc. Virtio block device
01:00.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03)

[root@dhcp74-172 ~]# ls /sys/bus/pci/slots/1/
adapter  address  attention  latch  module  power
[root@dhcp74-172 ~]# ls /sys/bus/pci/slots/2/
adapter  address  attention  latch  module  power

[root@dhcp74-172 ~]# echo 0 > /sys/bus/pci/slots/2/power 
[root@dhcp74-172 ~]# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:03.0 PCI bridge: Red Hat, Inc. Device 0001
00:04.0 Ethernet controller: Qumranet, Inc. Virtio network device
00:05.0 SCSI storage controller: Qumranet, Inc. Virtio block device
01:00.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03)

This is wrong because slots 1 and 2 are marked as not hotpluggable
in qemu.

The reason is that our acpi tables declare both _RMV with value 0,
and _EJ0 method for these slots. What happens in this case
is undocumented by ACPI spec, so linux ignores _RMV,
and windows seems to ignore _EJ0.

The correct way to suppress hotplug is not to have _EJ0,
so this is what this patch does: it probes PIIX and
modifies DSDT to match.

With these patches applied, we get:

[root@dhcp74-172 ~]# ls /sys/bus/pci/slots/1/
address
[root@dhcp74-172 ~]# ls /sys/bus/pci/slots/2/
address

I had to add a bit of compile-time infrastructure to handle the
runtime patching in a simple way. I expect that
it will be possible to reuse it if we need to
patch other methods in the future.

Michael S. Tsirkin (4):
  acpi: generate mixed asl/aml listing
  acpi: add aml/asl parsing script
  acpi: EJ0 method name patching
  acpi: remove _RMV

 Makefile          |   10 ++--
 src/acpi-dsdt.dsl |   58 +++--------------------
 src/acpi.c        |   11 ++++
 src/find_ej0.pl   |  136 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/splitdsl.pl   |   16 ++++++
 5 files changed, 176 insertions(+), 55 deletions(-)
 create mode 100755 src/find_ej0.pl
 create mode 100755 src/splitdsl.pl

-- 
1.7.5.53.gc233e

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-09-27 15:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 12:44 [PATCH 0/4] acpi: fix up EJ0 in DSDT Michael S. Tsirkin
2011-09-21 12:44 ` [PATCH 1/4] acpi: generate mixed asl/aml listing Michael S. Tsirkin
2011-09-21 12:47   ` Michael S. Tsirkin
2011-09-21 12:44 ` [PATCH 2/4] acpi: add aml/asl parsing script Michael S. Tsirkin
2011-09-21 14:27   ` Gleb Natapov
2011-09-21 15:46     ` Michael S. Tsirkin
2011-09-21 18:10   ` Michael S. Tsirkin, Kevin O'Connor
2011-09-21 12:44 ` [PATCH 3/4] acpi: EJ0 method name patching Michael S. Tsirkin
2011-09-21 12:44 ` [PATCH 4/4] acpi: remove _RMV Michael S. Tsirkin
2011-09-22  4:35 ` [PATCH 0/4] acpi: fix up EJ0 in DSDT Kevin O'Connor
2011-09-22  6:09   ` Michael S. Tsirkin
2011-09-22 12:39     ` Kevin O'Connor
2011-09-26  4:40     ` Kevin O'Connor
2011-09-26  7:03       ` [SeaBIOS] " Rudolf Marek
2011-09-26  7:04       ` Michael S. Tsirkin
2011-09-26 11:36         ` Marcelo Tosatti
2011-09-26 13:13           ` Michael S. Tsirkin
2011-09-27  0:04         ` Kevin O'Connor
2011-09-27 13:04           ` Michael S. Tsirkin
2011-09-27 15:23             ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.