All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: kvm@vger.kernel.org, jasowang@redhat.com, seabios@seabios.org,
	alex williamson <alex.williamson@redhat.com>
Subject: Re: [PATCHv2 0/3] acpi: fix up EJ0 in DSDT
Date: Wed, 28 Sep 2011 07:41:13 -0400 (EDT)	[thread overview]
Message-ID: <d9be709e-ebac-4aa8-b9dc-b27a8fccbad2@zmail05.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <cover.1316690724.git.mst@redhat.com>

----- Original Message -----
> This is a second iteration of the patch.  The patch has been
> significantly reworked to address (offline) comments by Gleb.
> 
> I think the infrastructure created is generic enough
> to be generally useful beyond the specific bug
> that I would like to fix. Specifically it
> will be able to find S3 Name to patch that,
> or process compiled CPU SSDT to avoid the need for
> hardcoded offsets.
> 
> Please comment.
> 
> Main changes:
> 	- tools rewritten in python
> 	- Original ASL retains _EJ0 methods, BIOS patches that to EJ0_
> 	- generic ACP_EXTRACT infrastructure that can match Method
>           and Name Operators
> 	- instead of matching specific method name, insert tags
> 	  in original DSL source and match that to AML


Patch looks good to me.
Acked-by: Amos Kong <akong@redhat.com>

> -----
> 
> 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
> 
> 
> 
> Michael S. Tsirkin (3):
>   acpi: generate and parse mixed asl/aml listing
>   acpi: EJ0 method name patching
>   acpi: remove _RMV
> 
>  Makefile                         |   10 +-
>  src/acpi-dsdt.dsl                |   96 ++++++++-----------
>  src/acpi.c                       |   31 ++++++
>  tools/acpi_extract.py            |  195
>  ++++++++++++++++++++++++++++++++++++++
>  tools/acpi_extract_preprocess.py |   37 +++++++
>  5 files changed, 307 insertions(+), 62 deletions(-)
>  create mode 100755 tools/acpi_extract.py
>  create mode 100755 tools/acpi_extract_preprocess.py
> 
> --
> 1.7.5.53.gc233e
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      parent reply	other threads:[~2011-09-28 11:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 11:37 [PATCHv2 0/3] acpi: fix up EJ0 in DSDT Michael S. Tsirkin
2011-09-22 11:37 ` [PATCHv2 1/3] acpi: generate and parse mixed asl/aml listing Michael S. Tsirkin
2011-09-22 11:37 ` [PATCHv2 2/3] acpi: EJ0 method name patching Michael S. Tsirkin
2011-09-22 11:37 ` [PATCHv2 3/3] acpi: remove _RMV Michael S. Tsirkin
2011-09-23 14:47 ` [PATCHv2 0/3] acpi: fix up EJ0 in DSDT Marcelo Tosatti
2011-09-28 11:41 ` Amos Kong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9be709e-ebac-4aa8-b9dc-b27a8fccbad2@zmail05.collab.prod.int.phx2.redhat.com \
    --to=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.