summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Natapov <gleb@qumranet.com>2008-08-20 16:15:30 +0300
committerAvi Kivity <avi@qumranet.com>2008-09-01 13:23:03 +0300
commit04c154af9b1b5af9edee1cc0afbb3eac4b218531 (patch)
treefbb5ef0578c7e7c0d52f5f82624259be900e53ba
parentd956ae2476209661da5341d2f040d16126882d3c (diff)
kvm: bios: avoid accessing CMOS NVRAM from ACPI AML
The ACPI AML, reads data from CMOS by directly accessing ports 0x70-0x71. This makes windows guest unhappy. It logs error EventID 4 into event log: ACPI BIOS is attempting to read from an illegal IO port address (0x71), which lies in the 0x70 - 0x71 protected address range. This could lead to system instability. Please contact your system vendor for technical assistance. We ignored this error for a long time since there was no any stability issues caused by it, but recently we encountered Windows 2008 reboot problem (one of 10 reboots hangs with ACPI error) that, according to Microsoft, is caused by CMOS access from AML code. Eliminating the access indeed fixed reboot problem. ACPI spec defines a way to read CMOS without accessing IO ports directly, but unfortunately neither Windows XP nor Linux implements this part of the spec (it works in Windows 2008 though). Fix by assigning a fixed PCI region instead of dynamic, removing the need to read the memory size from CMOS NVRAM. Signed-off-by: Avi Kivity <avi@qumranet.com>
-rwxr-xr-xbios/acpi-dsdt.dsl37
1 files changed, 4 insertions, 33 deletions
diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl
index d1bfa2c3..580fff51 100755
--- a/bios/acpi-dsdt.dsl
+++ b/bios/acpi-dsdt.dsl
@@ -67,20 +67,6 @@ DefinitionBlock (
Scope (\)
{
- /* CMOS memory access */
- OperationRegion (CMS, SystemIO, 0x70, 0x02)
- Field (CMS, ByteAcc, NoLock, Preserve)
- {
- CMSI, 8,
- CMSD, 8
- }
- Method (CMRD, 1, NotSerialized)
- {
- Store (Arg0, CMSI)
- Store (CMSD, Local0)
- Return (Local0)
- }
-
/* Debug Output */
OperationRegion (DBG, SystemIO, 0xb044, 0x04)
Field (DBG, DWordAcc, NoLock, Preserve)
@@ -202,9 +188,7 @@ DefinitionBlock (
hotplug_slot(30, 0x001e)
hotplug_slot(31, 0x001f)
- Method (_CRS, 0, NotSerialized)
- {
- Name (MEMP, ResourceTemplate ()
+ Name (_CRS, ResourceTemplate ()
{
WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
0x0000, // Address Space Granularity
@@ -242,25 +226,12 @@ DefinitionBlock (
,, , AddressRangeMemory, TypeStatic)
DWordMemory (ResourceProducer, PosDecode, MinNotFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
- 0x00000000, // Address Range Minimum
+ 0xE0000000, // Address Range Minimum
0xFEBFFFFF, // Address Range Maximum
0x00000000, // Address Translation Offset
- 0x00000000, // Address Length
- ,, MEMF, AddressRangeMemory, TypeStatic)
+ 0x1EC00000, // Address Length
+ ,, , AddressRangeMemory, TypeStatic)
})
- CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MIN, PMIN)
- CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MAX, PMAX)
- CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._LEN, PLEN)
- /* compute available RAM */
- Add(CMRD(0x34), ShiftLeft(CMRD(0x35), 8), Local0)
- ShiftLeft(Local0, 16, Local0)
- Add(Local0, 0x1000000, Local0)
- /* update field of last region */
- Store(Local0, PMIN)
- Subtract (PMAX, PMIN, PLEN)
- Increment (PLEN)
- Return (MEMP)
- }
}
}