Skip to content

Commit 40c3472

Browse files
committed
Revert "acpi/gpex: Inform os to keep firmware resource map"
This reverts commit 0cf8882. Which this commit, with aarch64 when using efi PCI devices with IO ports do not work. The reason is that EFI creates I/O port mappings below 0x1000 (in fact, at 0). However Linux, for legacy reasons, does not support I/O ports <= 0x1000 on PCI, so the I/O assignment created by EFI is rejected. EFI creates the mappings primarily for itself, and up until DSM #5 started to be enforced, all PCI resource allocations that existed at boot were ignored by Linux and recreated from scratch. Also, the commit in question looks dubious - it seems unlikely that Linux would fail to create a resource tree. What does happen is that BARs get moved around, which may cause trouble in some cases: for instance, Linux had to add special code to the EFI framebuffer driver to copy with framebuffer BARs being relocated. DSM #5 has a long history of debate and misinterpretation. Link: https://lore.kernel.org/r/[email protected]/ Fixes: 0cf8882 ("acpi/gpex: Inform os to keep firmware resource map") Reported-by: Guenter Roeck <[email protected]> Suggested-by: Ard Biesheuvel <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 5cd4a8d commit 40c3472

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

hw/pci-host/gpex-acpi.c

+2-18
Original file line numberDiff line numberDiff line change
@@ -112,26 +112,10 @@ static void acpi_dsdt_add_pci_osc(Aml *dev)
112112
UUID = aml_touuid("E5C937D0-3553-4D7A-9117-EA4D19C3434D");
113113
ifctx = aml_if(aml_equal(aml_arg(0), UUID));
114114
ifctx1 = aml_if(aml_equal(aml_arg(2), aml_int(0)));
115-
uint8_t byte_list[] = {
116-
0x1 << 0 /* support for functions other than function 0 */ |
117-
0x1 << 5 /* support for function 5 */
118-
};
119-
buf = aml_buffer(ARRAY_SIZE(byte_list), byte_list);
115+
uint8_t byte_list[1] = {1};
116+
buf = aml_buffer(1, byte_list);
120117
aml_append(ifctx1, aml_return(buf));
121118
aml_append(ifctx, ifctx1);
122-
123-
/*
124-
* PCI Firmware Specification 3.1
125-
* 4.6.5. _DSM for Ignoring PCI Boot Configurations
126-
*/
127-
/* Arg2: Function Index: 5 */
128-
ifctx1 = aml_if(aml_equal(aml_arg(2), aml_int(5)));
129-
/*
130-
* 0 - The operating system must not ignore the PCI configuration that
131-
* firmware has done at boot time.
132-
*/
133-
aml_append(ifctx1, aml_return(aml_int(0)));
134-
aml_append(ifctx, ifctx1);
135119
aml_append(method, ifctx);
136120

137121
byte_list[0] = 0;

0 commit comments

Comments
 (0)