Skip to content

Commit

Permalink
Merge tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  ..
  • Loading branch information
torvalds committed Mar 6, 2019
2 parents ef80068 + 8167e00 commit d276709
Show file tree
Hide file tree
Showing 227 changed files with 1,437 additions and 1,321 deletions.
4 changes: 4 additions & 0 deletions Documentation/acpi/initrd_table_override.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ upgrade the ACPI execution environment that is defined by the ACPI tables
via upgrading the ACPI tables provided by the BIOS with an instrumented,
modified, more recent version one, or installing brand new ACPI tables.

When building initrd with kernel in a single image, option
ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this
feature to work.

For a full list of ACPI tables that can be upgraded/installed, take a look
at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
drivers/acpi/tables.c.
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ ACPI APEI
M: "Rafael J. Wysocki" <[email protected]>
M: Len Brown <[email protected]>
L: [email protected]
R: James Morse <[email protected]>
R: Tony Luck <[email protected]>
R: Borislav Petkov <[email protected]>
F: drivers/acpi/apei/
Expand Down
14 changes: 14 additions & 0 deletions arch/arm/include/asm/kvm_ras.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2018 - Arm Ltd */

#ifndef __ARM_KVM_RAS_H__
#define __ARM_KVM_RAS_H__

#include <linux/types.h>

static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
return -1;
}

#endif /* __ARM_KVM_RAS_H__ */
5 changes: 0 additions & 5 deletions arch/arm/include/asm/system_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ static inline void harden_branch_predictor(void)

extern unsigned int user_debug;

static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
return -1;
}

#endif /* !__ASSEMBLY__ */

#endif /* __ASM_ARM_SYSTEM_MISC_H */
4 changes: 3 additions & 1 deletion arch/arm64/include/asm/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <asm/cputype.h>
#include <asm/io.h>
#include <asm/ptrace.h>
#include <asm/smp_plat.h>
#include <asm/tlbflush.h>

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

static inline void arch_fix_phys_package_id(int num, u32 slot) { }
void __init acpi_init_cpus(void);

int apei_claim_sea(struct pt_regs *regs);
#else
static inline void acpi_init_cpus(void) { }
static inline int apei_claim_sea(struct pt_regs *regs) { return -ENOENT; }
#endif /* CONFIG_ACPI */

#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/include/asm/daifflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#define DAIF_PROCCTX 0
#define DAIF_PROCCTX_NOIRQ PSR_I_BIT
#define DAIF_ERRCTX (PSR_I_BIT | PSR_A_BIT)

/* mask/save/unmask/restore all exceptions, including interrupts. */
static inline void local_daif_mask(void)
Expand Down
6 changes: 5 additions & 1 deletion arch/arm64/include/asm/fixmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ enum fixed_addresses {
#ifdef CONFIG_ACPI_APEI_GHES
/* Used for GHES mapping from assorted contexts */
FIX_APEI_GHES_IRQ,
FIX_APEI_GHES_NMI,
FIX_APEI_GHES_SEA,
#ifdef CONFIG_ARM_SDE_INTERFACE
FIX_APEI_GHES_SDEI_NORMAL,
FIX_APEI_GHES_SDEI_CRITICAL,
#endif
#endif /* CONFIG_ACPI_APEI_GHES */

#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
Expand Down
25 changes: 25 additions & 0 deletions arch/arm64/include/asm/kvm_ras.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2018 - Arm Ltd */

#ifndef __ARM64_KVM_RAS_H__
#define __ARM64_KVM_RAS_H__

#include <linux/acpi.h>
#include <linux/errno.h>
#include <linux/types.h>

#include <asm/acpi.h>

/*
* Was this synchronous external abort a RAS notification?
* Returns '0' for errors handled by some RAS subsystem, or -ENOENT.
*/
static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
/* apei_claim_sea(NULL) expects to mask interrupts itself */
lockdep_assert_irqs_enabled();

return apei_claim_sea(NULL);
}

#endif /* __ARM64_KVM_RAS_H__ */
2 changes: 0 additions & 2 deletions arch/arm64/include/asm/system_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ extern void __show_regs(struct pt_regs *);

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

int handle_guest_sea(phys_addr_t addr, unsigned int esr);

#endif /* __ASSEMBLY__ */

#endif /* __ASM_SYSTEM_MISC_H */
31 changes: 31 additions & 0 deletions arch/arm64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
#include <linux/smp.h>
#include <linux/serial_core.h>

#include <acpi/ghes.h>
#include <asm/cputype.h>
#include <asm/cpu_ops.h>
#include <asm/daifflags.h>
#include <asm/pgtable.h>
#include <asm/smp_plat.h>

Expand Down Expand Up @@ -256,3 +258,32 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
return __pgprot(PROT_NORMAL_NC);
return __pgprot(PROT_DEVICE_nGnRnE);
}

/*
* Claim Synchronous External Aborts as a firmware first notification.
*
* Used by KVM and the arch do_sea handler.
* @regs may be NULL when called from process context.
*/
int apei_claim_sea(struct pt_regs *regs)
{
int err = -ENOENT;
unsigned long current_flags;

if (!IS_ENABLED(CONFIG_ACPI_APEI_GHES))
return err;

current_flags = arch_local_save_flags();

/*
* SEA can interrupt SError, mask it and describe this as an NMI so
* that APEI defers the handling.
*/
local_daif_restore(DAIF_ERRCTX);
nmi_enter();
err = ghes_notify_sea();
nmi_exit();
local_daif_restore(current_flags);

return err;
}
24 changes: 5 additions & 19 deletions arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <linux/acpi.h>
#include <linux/extable.h>
#include <linux/signal.h>
#include <linux/mm.h>
Expand All @@ -33,6 +34,7 @@
#include <linux/preempt.h>
#include <linux/hugetlb.h>

#include <asm/acpi.h>
#include <asm/bug.h>
#include <asm/cmpxchg.h>
#include <asm/cpufeature.h>
Expand All @@ -47,8 +49,6 @@
#include <asm/tlbflush.h>
#include <asm/traps.h>

#include <acpi/ghes.h>

struct fault_info {
int (*fn)(unsigned long addr, unsigned int esr,
struct pt_regs *regs);
Expand Down Expand Up @@ -643,19 +643,10 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
inf = esr_to_fault_info(esr);

/*
* Synchronous aborts may interrupt code which had interrupts masked.
* Before calling out into the wider kernel tell the interested
* subsystems.
* Return value ignored as we rely on signal merging.
* Future patches will make this more robust.
*/
if (IS_ENABLED(CONFIG_ACPI_APEI_SEA)) {
if (interrupts_enabled(regs))
nmi_enter();

ghes_notify_sea();

if (interrupts_enabled(regs))
nmi_exit();
}
apei_claim_sea(regs);

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

int handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
return ghes_notify_sea();
}

asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
struct pt_regs *regs)
{
Expand Down
10 changes: 10 additions & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,16 @@ config ACPI_TABLE_UPGRADE
initrd, therefore it's safe to say Y.
See Documentation/acpi/initrd_table_override.txt for details

config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
bool "Override ACPI tables from built-in initrd"
depends on ACPI_TABLE_UPGRADE
depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION=""
help
This option provides functionality to override arbitrary ACPI tables
from built-in uncompressed initrd.

See Documentation/acpi/initrd_table_override.txt for details

config ACPI_DEBUG
bool "Debug Statements"
help
Expand Down
30 changes: 9 additions & 21 deletions drivers/acpi/acpi_dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,48 +750,36 @@ static const struct acpi_debugger_ops acpi_aml_debugger = {

int __init acpi_aml_init(void)
{
int ret = 0;

if (!acpi_debugfs_dir) {
ret = -ENOENT;
goto err_exit;
}
int ret;

/* Initialize AML IO interface */
mutex_init(&acpi_aml_io.lock);
init_waitqueue_head(&acpi_aml_io.wait);
acpi_aml_io.out_crc.buf = acpi_aml_io.out_buf;
acpi_aml_io.in_crc.buf = acpi_aml_io.in_buf;

acpi_aml_dentry = debugfs_create_file("acpidbg",
S_IFREG | S_IRUGO | S_IWUSR,
acpi_debugfs_dir, NULL,
&acpi_aml_operations);
if (acpi_aml_dentry == NULL) {
ret = -ENODEV;
goto err_exit;
}
ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
if (ret)
goto err_fs;
acpi_aml_initialized = true;

err_fs:
ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
if (ret) {
debugfs_remove(acpi_aml_dentry);
acpi_aml_dentry = NULL;
return ret;
}
err_exit:
return ret;

acpi_aml_initialized = true;
return 0;
}

void __exit acpi_aml_exit(void)
{
if (acpi_aml_initialized) {
acpi_unregister_debugger(&acpi_aml_debugger);
if (acpi_aml_dentry) {
debugfs_remove(acpi_aml_dentry);
acpi_aml_dentry = NULL;
}
debugfs_remove(acpi_aml_dentry);
acpi_aml_dentry = NULL;
acpi_aml_initialized = false;
}
}
Expand Down
20 changes: 14 additions & 6 deletions drivers/acpi/acpi_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,21 +2124,29 @@ static int __init intel_opregion_present(void)
return opregion;
}

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

chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
if (!chassis_type)
return false;

if (!strcmp(chassis_type, "3") || /* 3: Desktop */
!strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */
!strcmp(chassis_type, "5") || /* 5: Pizza Box */
!strcmp(chassis_type, "6") || /* 6: Mini Tower */
!strcmp(chassis_type, "7") || /* 7: Tower */
!strcmp(chassis_type, "11")) /* 11: Main Server Chassis */
if (kstrtoul(chassis_type, 10, &type) != 0)
return false;

switch (type) {
case 0x03: /* Desktop */
case 0x04: /* Low Profile Desktop */
case 0x05: /* Pizza Box */
case 0x06: /* Mini Tower */
case 0x07: /* Tower */
case 0x10: /* Lunch Box */
case 0x11: /* Main Server Chassis */
return true;
}

return false;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/acapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Module Name: acapps - common include for ACPI applications/tools
*
* Copyright (C) 2000 - 2018, Intel Corp.
* Copyright (C) 2000 - 2019, Intel Corp.
*
*****************************************************************************/

Expand All @@ -17,7 +17,7 @@
/* Common info for tool signons */

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

#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH " (64-bit version)"
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/accommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Name: accommon.h - Common include files for generation of ACPICA source
*
* Copyright (C) 2000 - 2018, Intel Corp.
* Copyright (C) 2000 - 2019, Intel Corp.
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acconvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Module Name: acapps - common include for ACPI applications/tools
*
* Copyright (C) 2000 - 2018, Intel Corp.
* Copyright (C) 2000 - 2019, Intel Corp.
*
*****************************************************************************/

Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Name: acdebug.h - ACPI/AML debugger
*
* Copyright (C) 2000 - 2018, Intel Corp.
* Copyright (C) 2000 - 2019, Intel Corp.
*
*****************************************************************************/

Expand All @@ -16,7 +16,8 @@
#include "acdisasm.h"
#endif

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

struct acpi_db_command_info {
const char *name; /* Command Name */
Expand Down
Loading

0 comments on commit d276709

Please sign in to comment.