Skip to content

Commit efc499f

Browse files
committed
Merge branches 'acpi-numa', 'acpi-tables' and 'acpi-osi'
* acpi-numa: ACPI / SRAT: fix SRAT parsing order with both LAPIC and X2APIC present * acpi-tables: ACPI / tables: Fix DSDT override mechanism ACPI / tables: Convert initrd table override to table upgrade mechanism ACPI / x86: Cleanup initrd related code ACPI / tables: Move table override mechanisms to tables.c * acpi-osi: ACPI / osi: Collect _OSI handling into one single file ACPI / osi: Cleanup coding style issues before creating a separate OSI source file ACPI / osi: Cleanup OSI handling code to use bool ACPI / osi: Fix default _OSI(Darwin) support ACPI / osi: Add acpi_osi=!! to allow reverting acpi_osi=! ACPI / osi: Cleanup _OSI("Linux") related code before introducing new support ACPI / osi: Fix an issue that acpi_osi=!* cannot disable ACPICA internal strings Conflicts: drivers/acpi/internal.h
4 parents a6becfb + 702b07f + 7421669 + e5f660e commit efc499f

File tree

12 files changed

+914
-742
lines changed

12 files changed

+914
-742
lines changed

Documentation/acpi/initrd_table_override.txt

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Overriding ACPI tables via initrd
2-
=================================
1+
Upgrading ACPI tables via initrd
2+
================================
33

44
1) Introduction (What is this about)
55
2) What is this for
@@ -9,12 +9,14 @@ Overriding ACPI tables via initrd
99
1) What is this about
1010
---------------------
1111

12-
If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible to
13-
override nearly any ACPI table provided by the BIOS with an instrumented,
14-
modified one.
12+
If the ACPI_TABLE_UPGRADE compile option is true, it is possible to
13+
upgrade the ACPI execution environment that is defined by the ACPI tables
14+
via upgrading the ACPI tables provided by the BIOS with an instrumented,
15+
modified, more recent version one, or installing brand new ACPI tables.
1516

16-
For a full list of ACPI tables that can be overridden, take a look at
17-
the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in drivers/acpi/osl.c
17+
For a full list of ACPI tables that can be upgraded/installed, take a look
18+
at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
19+
drivers/acpi/tables.c.
1820
All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should
1921
be overridable, except:
2022
- ACPI_SIG_RSDP (has a signature of 6 bytes)
@@ -25,17 +27,20 @@ Both could get implemented as well.
2527
2) What is this for
2628
-------------------
2729

28-
Please keep in mind that this is a debug option.
29-
ACPI tables should not get overridden for productive use.
30-
If BIOS ACPI tables are overridden the kernel will get tainted with the
31-
TAINT_OVERRIDDEN_ACPI_TABLE flag.
32-
Complain to your platform/BIOS vendor if you find a bug which is so sever
33-
that a workaround is not accepted in the Linux kernel.
30+
Complain to your platform/BIOS vendor if you find a bug which is so severe
31+
that a workaround is not accepted in the Linux kernel. And this facility
32+
allows you to upgrade the buggy tables before your platform/BIOS vendor
33+
releases an upgraded BIOS binary.
3434

35-
Still, it can and should be enabled in any kernel, because:
36-
- There is no functional change with not instrumented initrds
37-
- It provides a powerful feature to easily debug and test ACPI BIOS table
38-
compatibility with the Linux kernel.
35+
This facility can be used by platform/BIOS vendors to provide a Linux
36+
compatible environment without modifying the underlying platform firmware.
37+
38+
This facility also provides a powerful feature to easily debug and test
39+
ACPI BIOS table compatibility with the Linux kernel by modifying old
40+
platform provided ACPI tables or inserting new ACPI tables.
41+
42+
It can and should be enabled in any kernel because there is no functional
43+
change with not instrumented initrds.
3944

4045

4146
3) How does it work
@@ -50,23 +55,31 @@ iasl -d *.dat
5055
# For example add this statement into a _PRT (PCI Routing Table) function
5156
# of the DSDT:
5257
Store("HELLO WORLD", debug)
58+
# And increase the OEM Revision. For example, before modification:
59+
DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000)
60+
# After modification:
61+
DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001)
5362
iasl -sa dsdt.dsl
5463
# Add the raw ACPI tables to an uncompressed cpio archive.
55-
# They must be put into a /kernel/firmware/acpi directory inside the
56-
# cpio archive.
57-
# The uncompressed cpio archive must be the first.
58-
# Other, typically compressed cpio archives, must be
59-
# concatenated on top of the uncompressed one.
64+
# They must be put into a /kernel/firmware/acpi directory inside the cpio
65+
# archive. Note that if the table put here matches a platform table
66+
# (similar Table Signature, and similar OEMID, and similar OEM Table ID)
67+
# with a more recent OEM Revision, the platform table will be upgraded by
68+
# this table. If the table put here doesn't match a platform table
69+
# (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table
70+
# ID), this table will be appended.
6071
mkdir -p kernel/firmware/acpi
6172
cp dsdt.aml kernel/firmware/acpi
62-
# A maximum of: #define ACPI_OVERRIDE_TABLES 10
63-
# tables are currently allowed (see osl.c):
73+
# A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed
74+
# (see osl.c):
6475
iasl -sa facp.dsl
6576
iasl -sa ssdt1.dsl
6677
cp facp.aml kernel/firmware/acpi
6778
cp ssdt1.aml kernel/firmware/acpi
68-
# Create the uncompressed cpio archive and concatenate the original initrd
69-
# on top:
79+
# The uncompressed cpio archive must be the first. Other, typically
80+
# compressed cpio archives, must be concatenated on top of the uncompressed
81+
# one. Following command creates the uncompressed cpio archive and
82+
# concatenates the original initrd on top:
7083
find kernel | cpio -H newc --create > /boot/instrumented_initrd
7184
cat /boot/initrd >>/boot/instrumented_initrd
7285
# reboot with increased acpi debug level, e.g. boot params:

Documentation/kernel-parameters.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
312312
acpi_osi=!* # remove all strings
313313
acpi_osi=! # disable all built-in OS vendor
314314
strings
315+
acpi_osi=!! # enable all built-in OS vendor
316+
strings
315317
acpi_osi= # disable all strings
316318

317319
'acpi_osi=!' can be used in combination with single or

arch/x86/kernel/setup.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,21 @@ static void __init reserve_initrd(void)
398398

399399
memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
400400
}
401+
402+
static void __init early_initrd_acpi_init(void)
403+
{
404+
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
405+
}
401406
#else
402407
static void __init early_reserve_initrd(void)
403408
{
404409
}
405410
static void __init reserve_initrd(void)
406411
{
407412
}
413+
static void __init early_initrd_acpi_init(void)
414+
{
415+
}
408416
#endif /* CONFIG_BLK_DEV_INITRD */
409417

410418
static void __init parse_setup_data(void)
@@ -1138,9 +1146,7 @@ void __init setup_arch(char **cmdline_p)
11381146

11391147
reserve_initrd();
11401148

1141-
#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
1142-
acpi_initrd_override((void *)initrd_start, initrd_end - initrd_start);
1143-
#endif
1149+
early_initrd_acpi_init();
11441150

11451151
vsmp_init();
11461152

drivers/acpi/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ config ACPI_CUSTOM_DSDT
311311
bool
312312
default ACPI_CUSTOM_DSDT_FILE != ""
313313

314-
config ACPI_INITRD_TABLE_OVERRIDE
315-
bool "ACPI tables override via initrd"
314+
config ACPI_TABLE_UPGRADE
315+
bool "Allow upgrading ACPI tables via initrd"
316316
depends on BLK_DEV_INITRD && X86
317-
default n
317+
default y
318318
help
319-
This option provides functionality to override arbitrary ACPI tables
319+
This option provides functionality to upgrade arbitrary ACPI tables
320320
via initrd. No functional change if no ACPI tables are passed via
321321
initrd, therefore it's safe to say Y.
322322
See Documentation/acpi/initrd_table_override.txt for details

drivers/acpi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ obj-$(CONFIG_ACPI) += acpi.o \
1818
acpica/
1919

2020
# All the builtin files are in the "acpi." module_param namespace.
21-
acpi-y += osl.o utils.o reboot.o
21+
acpi-y += osi.o osl.o utils.o reboot.o
2222
acpi-y += nvs.o
2323

2424
# Power management related files

drivers/acpi/blacklist.c

Lines changed: 5 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Check to see if the given machine has a known bad ACPI BIOS
55
* or if the BIOS is too old.
6-
* Check given machine against acpi_osi_dmi_table[].
6+
* Check given machine against acpi_rev_dmi_table[].
77
*
88
* Copyright (C) 2004 Len Brown <[email protected]>
99
* Copyright (C) 2002 Andy Grover <[email protected]>
@@ -47,7 +47,7 @@ struct acpi_blacklist_item {
4747
u32 is_critical_error;
4848
};
4949

50-
static struct dmi_system_id acpi_osi_dmi_table[] __initdata;
50+
static struct dmi_system_id acpi_rev_dmi_table[] __initdata;
5151

5252
/*
5353
* POLICY: If *anything* doesn't work, put it on the blacklist.
@@ -128,36 +128,12 @@ int __init acpi_blacklisted(void)
128128
}
129129
}
130130

131-
dmi_check_system(acpi_osi_dmi_table);
131+
(void)early_acpi_osi_init();
132+
dmi_check_system(acpi_rev_dmi_table);
132133

133134
return blacklisted;
134135
}
135136
#ifdef CONFIG_DMI
136-
static int __init dmi_enable_osi_linux(const struct dmi_system_id *d)
137-
{
138-
acpi_dmi_osi_linux(1, d); /* enable */
139-
return 0;
140-
}
141-
static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
142-
{
143-
printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
144-
acpi_osi_setup("!Windows 2006");
145-
acpi_osi_setup("!Windows 2006 SP1");
146-
acpi_osi_setup("!Windows 2006 SP2");
147-
return 0;
148-
}
149-
static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
150-
{
151-
printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
152-
acpi_osi_setup("!Windows 2009");
153-
return 0;
154-
}
155-
static int __init dmi_disable_osi_win8(const struct dmi_system_id *d)
156-
{
157-
printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
158-
acpi_osi_setup("!Windows 2012");
159-
return 0;
160-
}
161137
#ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
162138
static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
163139
{
@@ -168,169 +144,7 @@ static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
168144
}
169145
#endif
170146

171-
static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
172-
{
173-
.callback = dmi_disable_osi_vista,
174-
.ident = "Fujitsu Siemens",
175-
.matches = {
176-
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
177-
DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
178-
},
179-
},
180-
{
181-
/*
182-
* There have a NVIF method in MSI GX723 DSDT need call by Nvidia
183-
* driver (e.g. nouveau) when user press brightness hotkey.
184-
* Currently, nouveau driver didn't do the job and it causes there
185-
* have a infinite while loop in DSDT when user press hotkey.
186-
* We add MSI GX723's dmi information to this table for workaround
187-
* this issue.
188-
* Will remove MSI GX723 from the table after nouveau grows support.
189-
*/
190-
.callback = dmi_disable_osi_vista,
191-
.ident = "MSI GX723",
192-
.matches = {
193-
DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
194-
DMI_MATCH(DMI_PRODUCT_NAME, "GX723"),
195-
},
196-
},
197-
{
198-
.callback = dmi_disable_osi_vista,
199-
.ident = "Sony VGN-NS10J_S",
200-
.matches = {
201-
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
202-
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS10J_S"),
203-
},
204-
},
205-
{
206-
.callback = dmi_disable_osi_vista,
207-
.ident = "Sony VGN-SR290J",
208-
.matches = {
209-
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
210-
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"),
211-
},
212-
},
213-
{
214-
.callback = dmi_disable_osi_vista,
215-
.ident = "VGN-NS50B_L",
216-
.matches = {
217-
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
218-
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS50B_L"),
219-
},
220-
},
221-
{
222-
.callback = dmi_disable_osi_vista,
223-
.ident = "VGN-SR19XN",
224-
.matches = {
225-
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
226-
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR19XN"),
227-
},
228-
},
229-
{
230-
.callback = dmi_disable_osi_vista,
231-
.ident = "Toshiba Satellite L355",
232-
.matches = {
233-
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
234-
DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"),
235-
},
236-
},
237-
{
238-
.callback = dmi_disable_osi_win7,
239-
.ident = "ASUS K50IJ",
240-
.matches = {
241-
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
242-
DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
243-
},
244-
},
245-
{
246-
.callback = dmi_disable_osi_vista,
247-
.ident = "Toshiba P305D",
248-
.matches = {
249-
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
250-
DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
251-
},
252-
},
253-
{
254-
.callback = dmi_disable_osi_vista,
255-
.ident = "Toshiba NB100",
256-
.matches = {
257-
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
258-
DMI_MATCH(DMI_PRODUCT_NAME, "NB100"),
259-
},
260-
},
261-
262-
/*
263-
* The wireless hotkey does not work on those machines when
264-
* returning true for _OSI("Windows 2012")
265-
*/
266-
{
267-
.callback = dmi_disable_osi_win8,
268-
.ident = "Dell Inspiron 7737",
269-
.matches = {
270-
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
271-
DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7737"),
272-
},
273-
},
274-
{
275-
.callback = dmi_disable_osi_win8,
276-
.ident = "Dell Inspiron 7537",
277-
.matches = {
278-
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
279-
DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7537"),
280-
},
281-
},
282-
{
283-
.callback = dmi_disable_osi_win8,
284-
.ident = "Dell Inspiron 5437",
285-
.matches = {
286-
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
287-
DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5437"),
288-
},
289-
},
290-
{
291-
.callback = dmi_disable_osi_win8,
292-
.ident = "Dell Inspiron 3437",
293-
.matches = {
294-
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
295-
DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 3437"),
296-
},
297-
},
298-
{
299-
.callback = dmi_disable_osi_win8,
300-
.ident = "Dell Vostro 3446",
301-
.matches = {
302-
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
303-
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3446"),
304-
},
305-
},
306-
{
307-
.callback = dmi_disable_osi_win8,
308-
.ident = "Dell Vostro 3546",
309-
.matches = {
310-
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
311-
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3546"),
312-
},
313-
},
314-
315-
/*
316-
* BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
317-
* Linux ignores it, except for the machines enumerated below.
318-
*/
319-
320-
/*
321-
* Without this this EEEpc exports a non working WMI interface, with
322-
* this it exports a working "good old" eeepc_laptop interface, fixing
323-
* both brightness control, and rfkill not working.
324-
*/
325-
{
326-
.callback = dmi_enable_osi_linux,
327-
.ident = "Asus EEE PC 1015PX",
328-
.matches = {
329-
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
330-
DMI_MATCH(DMI_PRODUCT_NAME, "1015PX"),
331-
},
332-
},
333-
147+
static struct dmi_system_id acpi_rev_dmi_table[] __initdata = {
334148
#ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
335149
/*
336150
* DELL XPS 13 (2015) switches sound between HDA and I2S

0 commit comments

Comments
 (0)