Skip to content

Commit d276709

Browse files
committed
Merge tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "These are ACPICA updates including ACPI 6.3 support among other things, APEI updates including the ARM Software Delegated Exception Interface (SDEI) support, ACPI EC driver fixes and cleanups and other assorted improvements. Specifics: - Update the ACPICA code in the kernel to upstream revision 20190215 including ACPI 6.3 support and more: * New predefined methods: _NBS, _NCH, _NIC, _NIH, and _NIG (Erik Schmauss). * Update of the PCC Identifier structure in PDTT (Erik Schmauss). * Support for new Generic Affinity Structure subtable in SRAT (Erik Schmauss). * New PCC operation region support (Erik Schmauss). * Support for GICC statistical profiling for MADT (Erik Schmauss). * New Error Disconnect Recover notification support (Erik Schmauss). * New PPTT Processor Structure Flags fields support (Erik Schmauss). * ACPI 6.3 HMAT updates (Erik Schmauss). * GTDT Revision 3 support (Erik Schmauss). * Legacy module-level code (MLC) support removal (Erik Schmauss). * Update/clarification of messages for control method failures (Bob Moore). * Warning on creation of a zero-length opregion (Bob Moore). * acpiexec option to dump extra info for memory leaks (Bob Moore). * More ACPI error to firmware error conversions (Bob Moore). * Debugger fix (Bob Moore). * Copyrights update (Bob Moore) - Clean up sleep states support code in ACPICA (Christoph Hellwig) - Rework in_nmi() handling in the APEI code and add suppor for the ARM Software Delegated Exception Interface (SDEI) to it (James Morse) - Fix possible out-of-bounds accesses in BERT-related core (Ross Lagerwall) - Fix the APEI code parsing HEST that includes a Deferred Machine Check subtable (Yazen Ghannam) - Use DEFINE_DEBUGFS_ATTRIBUTE for APEI-related debugfs files (YueHaibing) - Switch the APEI ERST code to the new generic UUID API (Andy Shevchenko) - Update the MAINTAINERS entry for APEI (Borislav Petkov) - Fix and clean up the ACPI EC driver (Rafael Wysocki, Zhang Rui) - Fix DMI checks handling in the ACPI backlight driver and add the "Lunch Box" chassis-type check to it (Hans de Goede) - Add support for using ACPI table overrides included in built-in initrd images (Shunyong Yang) - Update ACPI device enumeration to treat the PWM2 device as "always present" on Lenovo Yoga Book (Yauhen Kharuzhy) - Fix up the enumeration of device objects with the PRP0001 device ID (Andy Shevchenko) - Clean up PPTT parsing error messages (John Garry) - Clean up debugfs files creation handling (Greg Kroah-Hartman, Rafael Wysocki) - Clean up the ACPI DPTF Makefile (Masahiro Yamada)" * tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (65 commits) ACPI / bus: Respect PRP0001 when retrieving device match data ACPICA: Update version to 20190215 ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting ACPICA: ACPI 6.3: add GTDT Revision 3 support ACPICA: ACPI 6.3: HMAT updates ACPICA: ACPI 6.3: PPTT add additional fields in Processor Structure Flags ACPICA: ACPI 6.3: add Error Disconnect Recover Notification value ACPICA: ACPI 6.3: MADT: add support for statistical profiling in GICC ACPICA: ACPI 6.3: add PCC operation region support for AML interpreter efi: cper: Fix possible out-of-bounds access ACPI: APEI: Fix possible out-of-bounds access to BERT region ACPICA: ACPI 6.3: SRAT: add Generic Affinity Structure subtable ACPICA: ACPI 6.3: Add Trigger order to PCC Identifier structure in PDTT ACPICA: ACPI 6.3: Adding predefined methods _NBS, _NCH, _NIC, _NIH, and _NIG ACPICA: Update/clarify messages for control method failures ACPICA: Debugger: Fix possible fault with the "test objects" command ACPICA: Interpreter: Emit warning for creation of a zero-length op region ACPICA: Remove legacy module-level code support ACPI / x86: Make PWM2 device always present at Lenovo Yoga Book ACPI / video: Extend chassis-type detection with a "Lunch Box" check ..
2 parents ef80068 + 8167e00 commit d276709

File tree

227 files changed

+1437
-1321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+1437
-1321
lines changed

Documentation/acpi/initrd_table_override.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ upgrade the ACPI execution environment that is defined by the ACPI tables
1414
via upgrading the ACPI tables provided by the BIOS with an instrumented,
1515
modified, more recent version one, or installing brand new ACPI tables.
1616

17+
When building initrd with kernel in a single image, option
18+
ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this
19+
feature to work.
20+
1721
For a full list of ACPI tables that can be upgraded/installed, take a look
1822
at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
1923
drivers/acpi/tables.c.

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ ACPI APEI
331331
M: "Rafael J. Wysocki" <[email protected]>
332332
M: Len Brown <[email protected]>
333333
334+
R: James Morse <[email protected]>
334335
R: Tony Luck <[email protected]>
335336
R: Borislav Petkov <[email protected]>
336337
F: drivers/acpi/apei/

arch/arm/include/asm/kvm_ras.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (C) 2018 - Arm Ltd */
3+
4+
#ifndef __ARM_KVM_RAS_H__
5+
#define __ARM_KVM_RAS_H__
6+
7+
#include <linux/types.h>
8+
9+
static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
10+
{
11+
return -1;
12+
}
13+
14+
#endif /* __ARM_KVM_RAS_H__ */

arch/arm/include/asm/system_misc.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ static inline void harden_branch_predictor(void)
3838

3939
extern unsigned int user_debug;
4040

41-
static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr)
42-
{
43-
return -1;
44-
}
45-
4641
#endif /* !__ASSEMBLY__ */
4742

4843
#endif /* __ASM_ARM_SYSTEM_MISC_H */

arch/arm64/include/asm/acpi.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <asm/cputype.h>
2020
#include <asm/io.h>
21+
#include <asm/ptrace.h>
2122
#include <asm/smp_plat.h>
2223
#include <asm/tlbflush.h>
2324

@@ -110,9 +111,10 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
110111

111112
static inline void arch_fix_phys_package_id(int num, u32 slot) { }
112113
void __init acpi_init_cpus(void);
113-
114+
int apei_claim_sea(struct pt_regs *regs);
114115
#else
115116
static inline void acpi_init_cpus(void) { }
117+
static inline int apei_claim_sea(struct pt_regs *regs) { return -ENOENT; }
116118
#endif /* CONFIG_ACPI */
117119

118120
#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL

arch/arm64/include/asm/daifflags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#define DAIF_PROCCTX 0
2222
#define DAIF_PROCCTX_NOIRQ PSR_I_BIT
23+
#define DAIF_ERRCTX (PSR_I_BIT | PSR_A_BIT)
2324

2425
/* mask/save/unmask/restore all exceptions, including interrupts. */
2526
static inline void local_daif_mask(void)

arch/arm64/include/asm/fixmap.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ enum fixed_addresses {
5555
#ifdef CONFIG_ACPI_APEI_GHES
5656
/* Used for GHES mapping from assorted contexts */
5757
FIX_APEI_GHES_IRQ,
58-
FIX_APEI_GHES_NMI,
58+
FIX_APEI_GHES_SEA,
59+
#ifdef CONFIG_ARM_SDE_INTERFACE
60+
FIX_APEI_GHES_SDEI_NORMAL,
61+
FIX_APEI_GHES_SDEI_CRITICAL,
62+
#endif
5963
#endif /* CONFIG_ACPI_APEI_GHES */
6064

6165
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0

arch/arm64/include/asm/kvm_ras.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (C) 2018 - Arm Ltd */
3+
4+
#ifndef __ARM64_KVM_RAS_H__
5+
#define __ARM64_KVM_RAS_H__
6+
7+
#include <linux/acpi.h>
8+
#include <linux/errno.h>
9+
#include <linux/types.h>
10+
11+
#include <asm/acpi.h>
12+
13+
/*
14+
* Was this synchronous external abort a RAS notification?
15+
* Returns '0' for errors handled by some RAS subsystem, or -ENOENT.
16+
*/
17+
static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
18+
{
19+
/* apei_claim_sea(NULL) expects to mask interrupts itself */
20+
lockdep_assert_irqs_enabled();
21+
22+
return apei_claim_sea(NULL);
23+
}
24+
25+
#endif /* __ARM64_KVM_RAS_H__ */

arch/arm64/include/asm/system_misc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ extern void __show_regs(struct pt_regs *);
4646

4747
extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
4848

49-
int handle_guest_sea(phys_addr_t addr, unsigned int esr);
50-
5149
#endif /* __ASSEMBLY__ */
5250

5351
#endif /* __ASM_SYSTEM_MISC_H */

arch/arm64/kernel/acpi.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
#include <linux/smp.h>
2828
#include <linux/serial_core.h>
2929

30+
#include <acpi/ghes.h>
3031
#include <asm/cputype.h>
3132
#include <asm/cpu_ops.h>
33+
#include <asm/daifflags.h>
3234
#include <asm/pgtable.h>
3335
#include <asm/smp_plat.h>
3436

@@ -256,3 +258,32 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
256258
return __pgprot(PROT_NORMAL_NC);
257259
return __pgprot(PROT_DEVICE_nGnRnE);
258260
}
261+
262+
/*
263+
* Claim Synchronous External Aborts as a firmware first notification.
264+
*
265+
* Used by KVM and the arch do_sea handler.
266+
* @regs may be NULL when called from process context.
267+
*/
268+
int apei_claim_sea(struct pt_regs *regs)
269+
{
270+
int err = -ENOENT;
271+
unsigned long current_flags;
272+
273+
if (!IS_ENABLED(CONFIG_ACPI_APEI_GHES))
274+
return err;
275+
276+
current_flags = arch_local_save_flags();
277+
278+
/*
279+
* SEA can interrupt SError, mask it and describe this as an NMI so
280+
* that APEI defers the handling.
281+
*/
282+
local_daif_restore(DAIF_ERRCTX);
283+
nmi_enter();
284+
err = ghes_notify_sea();
285+
nmi_exit();
286+
local_daif_restore(current_flags);
287+
288+
return err;
289+
}

arch/arm64/mm/fault.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
*/
2020

21+
#include <linux/acpi.h>
2122
#include <linux/extable.h>
2223
#include <linux/signal.h>
2324
#include <linux/mm.h>
@@ -33,6 +34,7 @@
3334
#include <linux/preempt.h>
3435
#include <linux/hugetlb.h>
3536

37+
#include <asm/acpi.h>
3638
#include <asm/bug.h>
3739
#include <asm/cmpxchg.h>
3840
#include <asm/cpufeature.h>
@@ -47,8 +49,6 @@
4749
#include <asm/tlbflush.h>
4850
#include <asm/traps.h>
4951

50-
#include <acpi/ghes.h>
51-
5252
struct fault_info {
5353
int (*fn)(unsigned long addr, unsigned int esr,
5454
struct pt_regs *regs);
@@ -643,19 +643,10 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
643643
inf = esr_to_fault_info(esr);
644644

645645
/*
646-
* Synchronous aborts may interrupt code which had interrupts masked.
647-
* Before calling out into the wider kernel tell the interested
648-
* subsystems.
646+
* Return value ignored as we rely on signal merging.
647+
* Future patches will make this more robust.
649648
*/
650-
if (IS_ENABLED(CONFIG_ACPI_APEI_SEA)) {
651-
if (interrupts_enabled(regs))
652-
nmi_enter();
653-
654-
ghes_notify_sea();
655-
656-
if (interrupts_enabled(regs))
657-
nmi_exit();
658-
}
649+
apei_claim_sea(regs);
659650

660651
if (esr & ESR_ELx_FnV)
661652
siaddr = NULL;
@@ -733,11 +724,6 @@ static const struct fault_info fault_info[] = {
733724
{ do_bad, SIGKILL, SI_KERNEL, "unknown 63" },
734725
};
735726

736-
int handle_guest_sea(phys_addr_t addr, unsigned int esr)
737-
{
738-
return ghes_notify_sea();
739-
}
740-
741727
asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
742728
struct pt_regs *regs)
743729
{

drivers/acpi/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@ config ACPI_TABLE_UPGRADE
357357
initrd, therefore it's safe to say Y.
358358
See Documentation/acpi/initrd_table_override.txt for details
359359

360+
config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
361+
bool "Override ACPI tables from built-in initrd"
362+
depends on ACPI_TABLE_UPGRADE
363+
depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION=""
364+
help
365+
This option provides functionality to override arbitrary ACPI tables
366+
from built-in uncompressed initrd.
367+
368+
See Documentation/acpi/initrd_table_override.txt for details
369+
360370
config ACPI_DEBUG
361371
bool "Debug Statements"
362372
help

drivers/acpi/acpi_dbg.c

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -750,48 +750,36 @@ static const struct acpi_debugger_ops acpi_aml_debugger = {
750750

751751
int __init acpi_aml_init(void)
752752
{
753-
int ret = 0;
754-
755-
if (!acpi_debugfs_dir) {
756-
ret = -ENOENT;
757-
goto err_exit;
758-
}
753+
int ret;
759754

760755
/* Initialize AML IO interface */
761756
mutex_init(&acpi_aml_io.lock);
762757
init_waitqueue_head(&acpi_aml_io.wait);
763758
acpi_aml_io.out_crc.buf = acpi_aml_io.out_buf;
764759
acpi_aml_io.in_crc.buf = acpi_aml_io.in_buf;
760+
765761
acpi_aml_dentry = debugfs_create_file("acpidbg",
766762
S_IFREG | S_IRUGO | S_IWUSR,
767763
acpi_debugfs_dir, NULL,
768764
&acpi_aml_operations);
769-
if (acpi_aml_dentry == NULL) {
770-
ret = -ENODEV;
771-
goto err_exit;
772-
}
773-
ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
774-
if (ret)
775-
goto err_fs;
776-
acpi_aml_initialized = true;
777765

778-
err_fs:
766+
ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
779767
if (ret) {
780768
debugfs_remove(acpi_aml_dentry);
781769
acpi_aml_dentry = NULL;
770+
return ret;
782771
}
783-
err_exit:
784-
return ret;
772+
773+
acpi_aml_initialized = true;
774+
return 0;
785775
}
786776

787777
void __exit acpi_aml_exit(void)
788778
{
789779
if (acpi_aml_initialized) {
790780
acpi_unregister_debugger(&acpi_aml_debugger);
791-
if (acpi_aml_dentry) {
792-
debugfs_remove(acpi_aml_dentry);
793-
acpi_aml_dentry = NULL;
794-
}
781+
debugfs_remove(acpi_aml_dentry);
782+
acpi_aml_dentry = NULL;
795783
acpi_aml_initialized = false;
796784
}
797785
}

drivers/acpi/acpi_video.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,21 +2124,29 @@ static int __init intel_opregion_present(void)
21242124
return opregion;
21252125
}
21262126

2127+
/* Check if the chassis-type indicates there is no builtin LCD panel */
21272128
static bool dmi_is_desktop(void)
21282129
{
21292130
const char *chassis_type;
2131+
unsigned long type;
21302132

21312133
chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
21322134
if (!chassis_type)
21332135
return false;
21342136

2135-
if (!strcmp(chassis_type, "3") || /* 3: Desktop */
2136-
!strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */
2137-
!strcmp(chassis_type, "5") || /* 5: Pizza Box */
2138-
!strcmp(chassis_type, "6") || /* 6: Mini Tower */
2139-
!strcmp(chassis_type, "7") || /* 7: Tower */
2140-
!strcmp(chassis_type, "11")) /* 11: Main Server Chassis */
2137+
if (kstrtoul(chassis_type, 10, &type) != 0)
2138+
return false;
2139+
2140+
switch (type) {
2141+
case 0x03: /* Desktop */
2142+
case 0x04: /* Low Profile Desktop */
2143+
case 0x05: /* Pizza Box */
2144+
case 0x06: /* Mini Tower */
2145+
case 0x07: /* Tower */
2146+
case 0x10: /* Lunch Box */
2147+
case 0x11: /* Main Server Chassis */
21412148
return true;
2149+
}
21422150

21432151
return false;
21442152
}

drivers/acpi/acpica/acapps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Module Name: acapps - common include for ACPI applications/tools
55
*
6-
* Copyright (C) 2000 - 2018, Intel Corp.
6+
* Copyright (C) 2000 - 2019, Intel Corp.
77
*
88
*****************************************************************************/
99

@@ -17,7 +17,7 @@
1717
/* Common info for tool signons */
1818

1919
#define ACPICA_NAME "Intel ACPI Component Architecture"
20-
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2018 Intel Corporation"
20+
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2019 Intel Corporation"
2121

2222
#if ACPI_MACHINE_WIDTH == 64
2323
#define ACPI_WIDTH " (64-bit version)"

drivers/acpi/acpica/accommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Name: accommon.h - Common include files for generation of ACPICA source
55
*
6-
* Copyright (C) 2000 - 2018, Intel Corp.
6+
* Copyright (C) 2000 - 2019, Intel Corp.
77
*
88
*****************************************************************************/
99

drivers/acpi/acpica/acconvert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Module Name: acapps - common include for ACPI applications/tools
55
*
6-
* Copyright (C) 2000 - 2018, Intel Corp.
6+
* Copyright (C) 2000 - 2019, Intel Corp.
77
*
88
*****************************************************************************/
99

drivers/acpi/acpica/acdebug.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Name: acdebug.h - ACPI/AML debugger
55
*
6-
* Copyright (C) 2000 - 2018, Intel Corp.
6+
* Copyright (C) 2000 - 2019, Intel Corp.
77
*
88
*****************************************************************************/
99

@@ -16,7 +16,8 @@
1616
#include "acdisasm.h"
1717
#endif
1818

19-
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
19+
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
20+
#define ACPI_DEBUG_LENGTH_FORMAT " (%.4X bits, %.3X bytes)"
2021

2122
struct acpi_db_command_info {
2223
const char *name; /* Command Name */

0 commit comments

Comments
 (0)