Bug 15817

Summary: Linux should accept Memory24, Memory32, Memory32Fixed PCI host bridge windows
Product: ACPI Reporter: Bjorn Helgaas (bjorn.helgaas)
Component: Config-OtherAssignee: Bjorn Helgaas (bjorn.helgaas)
Status: CLOSED CODE_FIX    
Severity: normal CC: lenb
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.34-rc3 Subsystem:
Regression: No Bisected commit-id:
Attachments: Windows/QEMU summary info
Memory24 parsing
Memory32 parsing
Memory32Fixed parsing

Description Bjorn Helgaas 2010-04-20 19:06:22 UTC
Code in arch/x86/pci/acpi.c parses PCI host bridge _CRS descriptors to learn the windows forwarded to the PCI bus.  We currently only look at 16-, 32-, and 64-bit Address Space Descriptors.

By experimenting with Windows Server 2008 R2 in a qemu environment, I learned that Windows also accepts Memory24, Memory32, and Memory32Fixed descriptors.  Linux should be changed to accept them also.

These experiments are based on SeaBIOS (http://www.coreboot.org/SeaBIOS) as of commit c35e1e50c3.  The attached DSDT patches and Windows screenshots show the results.
Comment 1 Bjorn Helgaas 2010-04-20 19:08:13 UTC
Created attachment 26065 [details]
Windows/QEMU summary info
Comment 2 Bjorn Helgaas 2010-04-20 19:10:56 UTC
Created attachment 26066 [details]
Memory24 parsing

Windows accepts the Memory24 descriptor shown below.  This is for the legacy VGA MMIO area, since Memory24 doesn't have enough bits to describe the other MMIO apertures.

-                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
-                    0x00000000,         // Address Space Granularity
-                    0x000A0000,         // Address Range Minimum
-                    0x000BFFFF,         // Address Range Maximum
-                    0x00000000,         // Address Translation Offset
-                    0x00020000,         // Address Length
-                    ,, , AddressRangeMemory, TypeStatic)
+               Memory24(ReadWrite, 0x0A00, 0x0A00, 0x0000, 0x0200,)
Comment 3 Bjorn Helgaas 2010-04-20 19:21:48 UTC
Created attachment 26067 [details]
Memory32 parsing

Note that this Memory32 descriptor is for the window [mem 0xe0000000-0xefffffff], which does NOT include the addresses where BIOS leaves the VGA and NIC PCI devices.  The BIOS left those devices here:

  [mem 0xf0000000-0xf1ffffff] VGA
  [mem 0xf2000000-0xf2000fff] VGA
  [mem 0xf2020000-0xf20200ff] 8139C+ NIC

and Windows moved them into the Memory32-described aperture, so they now appear at:

  [mem 0xec000000-0xedffffff] VGA
  [mem 0xefffe000-0xefffefff] VGA
  [mem 0xefffff00-0xefffffff] 8139C+ NIC

This suggests that Windows treats this Memory32 descriptor as a valid PCI host bridge aperture.

-                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
-                    0x00000000,         // Address Space Granularity
-                    0xE0000000,         // Address Range Minimum
-                    0xFEBFFFFF,         // Address Range Maximum
-                    0x00000000,         // Address Translation Offset
-                    0x1EC00000,         // Address Length
-                    ,, , AddressRangeMemory, TypeStatic)
+                Memory32(ReadWrite, 0xE0000000, 0xE0000000, 0x1, 0x10000000,)
Comment 4 Bjorn Helgaas 2010-04-20 19:25:42 UTC
Created attachment 26068 [details]
Memory32Fixed parsing

Windows appears to treat this Memory32Fixed descriptor just like the Memory32 descriptor in the previous attachment, including moving the PCI devices into the window in exactly the same way.

-                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
-                    0x00000000,         // Address Space Granularity
-                    0xE0000000,         // Address Range Minimum
-                    0xFEBFFFFF,         // Address Range Maximum
-                    0x00000000,         // Address Translation Offset
-                    0x1EC00000,         // Address Length
-                    ,, , AddressRangeMemory, TypeStatic)
+                Memory32Fixed (ReadWrite, 0xE0000000, 0x10000000,)
Comment 5 Bjorn Helgaas 2010-05-05 22:39:24 UTC
A patch adding support for Memory24, Memory32, and Memory32Fixed descriptors (for the x86 pci_root driver) is upstream:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=66528fdd45b082bf7c74687d72ae08afa4a446f8
Comment 6 Len Brown 2010-09-29 01:59:40 UTC
66528fdd45b082bf7c74687d72ae08afa4a446f8
commit 66528fdd45b082bf7c74687d72ae08afa4a446f8
Author: Bjorn Helgaas <bjorn.helgaas@hp.com>
Date:   Tue Apr 20 13:52:41 2010 -0600

    x86/PCI: parse additional host bridge window resource types

shipped in v2.6.34-rc3-410-g66528fd

closed