On Thu, Mar 21, 2013 at 10:11:54AM +0100, Paolo Bonzini wrote:
Il 21/03/2013 10:08, Hu Tao ha scritto:
Signed-off-by: Hu Tao hutao@cn.fujitsu.com
src/acpi-dsdt-isa.dsl | 14 ++++++++++++-- src/acpi.c | 9 +++++++++ 2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl index 87a31b9..43fe719 100644 --- a/src/acpi-dsdt-isa.dsl +++ b/src/acpi-dsdt-isa.dsl @@ -102,7 +102,9 @@ Scope(_SB.PCI0.ISA) {
Device(PEVT) { Name(_HID, "QEMU0001")
OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
ACPI_EXTRACT_NAME_WORD_CONST dsdt_isa_pest
Name(PEST, 0x505)
OperationRegion(PEOR, SystemIO, PEST, 0x01) Field(PEOR, ByteAcc, NoLock, Preserve) { PEPT, 8, }
@@ -126,7 +128,15 @@ Scope(_SB.PCI0.ISA) { }
Name(_CRS, ResourceTemplate() {
IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
IO(Decode16, 0x0505, 0x0505, 0x01, 0x01, IO) })
CreateWordField(_CRS, IO._MIN, IOMN)
CreateWordField(_CRS, IO._MAX, IOMX)
Method(_INI, 0, NotSerialized) {
Store(PEST, IOMN)
Store(PEST, IOMX)
}}
} diff --git a/src/acpi.c b/src/acpi.c index 119d1c1..42fa06e 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -286,11 +286,20 @@ static const struct pci_device_id fadt_init_tbl[] = { PCI_DEVICE_END };
+static void patch_dsdt(void *dsdt) +{
- u8 *dsdt_ptr = dsdt;
- int pvpanic_port = romfile_loadint("etc/pvpanic-port", 0x505);
The default must be 0.
Also, here:
Method(_STA, 0, NotSerialized) {
Store(PEPT, Local0)
If (LEqual(Local0, Zero)) {
Return (0x00)
} Else {
Return (0x0F)
}
}
You must change it to look at PEST instead of PEPT (i.e. do not probe, just see if you have a meaningful address).
Just squash the patches, it's simpler that way probably.
I forgot to add RFC to the title. This patch doesn't work for q35 with custom ioport.
Paolo
- *(u16 *)(dsdt_ptr + *dsdt_isa_pest) = pvpanic_port;
+}
static void fill_dsdt(struct fadt_descriptor_rev1 *fadt, void *dsdt) { if (fadt->dsdt) { free((void *)le32_to_cpu(fadt->dsdt)); }
- patch_dsdt(dsdt); fadt->dsdt = cpu_to_le32((u32)dsdt); fadt->checksum -= checksum(fadt, sizeof(*fadt)); dprintf(1, "ACPI DSDT=%p\n", dsdt);