Merge tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 6 Mar 2019 21:33:11 +0000 (13:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 6 Mar 2019 21:33:11 +0000 (13:33 -0800)
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
  ..

227 files changed:
Documentation/acpi/initrd_table_override.txt
MAINTAINERS
arch/arm/include/asm/kvm_ras.h [new file with mode: 0644]
arch/arm/include/asm/system_misc.h
arch/arm64/include/asm/acpi.h
arch/arm64/include/asm/daifflags.h
arch/arm64/include/asm/fixmap.h
arch/arm64/include/asm/kvm_ras.h [new file with mode: 0644]
arch/arm64/include/asm/system_misc.h
arch/arm64/kernel/acpi.c
arch/arm64/mm/fault.c
drivers/acpi/Kconfig
drivers/acpi/acpi_dbg.c
drivers/acpi/acpi_video.c
drivers/acpi/acpica/acapps.h
drivers/acpi/acpica/accommon.h
drivers/acpi/acpica/acconvert.h
drivers/acpi/acpica/acdebug.h
drivers/acpi/acpica/acdispat.h
drivers/acpi/acpica/acevents.h
drivers/acpi/acpica/acglobal.h
drivers/acpi/acpica/achware.h
drivers/acpi/acpica/acinterp.h
drivers/acpi/acpica/aclocal.h
drivers/acpi/acpica/acmacros.h
drivers/acpi/acpica/acnamesp.h
drivers/acpi/acpica/acobject.h
drivers/acpi/acpica/acopcode.h
drivers/acpi/acpica/acparser.h
drivers/acpi/acpica/acpredef.h
drivers/acpi/acpica/acresrc.h
drivers/acpi/acpica/acstruct.h
drivers/acpi/acpica/actables.h
drivers/acpi/acpica/acutils.h
drivers/acpi/acpica/amlcode.h
drivers/acpi/acpica/amlresrc.h
drivers/acpi/acpica/dbdisply.c
drivers/acpi/acpica/dbexec.c
drivers/acpi/acpica/dbhistry.c
drivers/acpi/acpica/dbnames.c
drivers/acpi/acpica/dbobject.c
drivers/acpi/acpica/dbtest.c
drivers/acpi/acpica/dsargs.c
drivers/acpi/acpica/dscontrol.c
drivers/acpi/acpica/dsdebug.c
drivers/acpi/acpica/dsfield.c
drivers/acpi/acpica/dsinit.c
drivers/acpi/acpica/dsmethod.c
drivers/acpi/acpica/dsobject.c
drivers/acpi/acpica/dsopcode.c
drivers/acpi/acpica/dspkginit.c
drivers/acpi/acpica/dswexec.c
drivers/acpi/acpica/dswload.c
drivers/acpi/acpica/dswload2.c
drivers/acpi/acpica/dswscope.c
drivers/acpi/acpica/dswstate.c
drivers/acpi/acpica/evevent.c
drivers/acpi/acpica/evglock.c
drivers/acpi/acpica/evgpe.c
drivers/acpi/acpica/evgpeblk.c
drivers/acpi/acpica/evgpeinit.c
drivers/acpi/acpica/evgpeutil.c
drivers/acpi/acpica/evhandler.c
drivers/acpi/acpica/evmisc.c
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/evrgnini.c
drivers/acpi/acpica/evxface.c
drivers/acpi/acpica/evxfevnt.c
drivers/acpi/acpica/evxfgpe.c
drivers/acpi/acpica/evxfregn.c
drivers/acpi/acpica/exconcat.c
drivers/acpi/acpica/exconfig.c
drivers/acpi/acpica/exconvrt.c
drivers/acpi/acpica/excreate.c
drivers/acpi/acpica/exdebug.c
drivers/acpi/acpica/exdump.c
drivers/acpi/acpica/exfield.c
drivers/acpi/acpica/exfldio.c
drivers/acpi/acpica/exmisc.c
drivers/acpi/acpica/exmutex.c
drivers/acpi/acpica/exnames.c
drivers/acpi/acpica/exoparg1.c
drivers/acpi/acpica/exoparg2.c
drivers/acpi/acpica/exoparg3.c
drivers/acpi/acpica/exoparg6.c
drivers/acpi/acpica/exprep.c
drivers/acpi/acpica/exregion.c
drivers/acpi/acpica/exresnte.c
drivers/acpi/acpica/exresolv.c
drivers/acpi/acpica/exresop.c
drivers/acpi/acpica/exserial.c
drivers/acpi/acpica/exstore.c
drivers/acpi/acpica/exstoren.c
drivers/acpi/acpica/exstorob.c
drivers/acpi/acpica/exsystem.c
drivers/acpi/acpica/extrace.c
drivers/acpi/acpica/exutils.c
drivers/acpi/acpica/hwacpi.c
drivers/acpi/acpica/hwesleep.c
drivers/acpi/acpica/hwgpe.c
drivers/acpi/acpica/hwsleep.c
drivers/acpi/acpica/hwtimer.c
drivers/acpi/acpica/hwvalid.c
drivers/acpi/acpica/hwxface.c
drivers/acpi/acpica/hwxfsleep.c
drivers/acpi/acpica/nsarguments.c
drivers/acpi/acpica/nsconvert.c
drivers/acpi/acpica/nsdump.c
drivers/acpi/acpica/nsdumpdv.c
drivers/acpi/acpica/nsinit.c
drivers/acpi/acpica/nsload.c
drivers/acpi/acpica/nsparse.c
drivers/acpi/acpica/nspredef.c
drivers/acpi/acpica/nsprepkg.c
drivers/acpi/acpica/nsrepair.c
drivers/acpi/acpica/nsrepair2.c
drivers/acpi/acpica/nsutils.c
drivers/acpi/acpica/nswalk.c
drivers/acpi/acpica/nsxfname.c
drivers/acpi/acpica/psargs.c
drivers/acpi/acpica/psloop.c
drivers/acpi/acpica/psobject.c
drivers/acpi/acpica/psopcode.c
drivers/acpi/acpica/psopinfo.c
drivers/acpi/acpica/psparse.c
drivers/acpi/acpica/psscope.c
drivers/acpi/acpica/pstree.c
drivers/acpi/acpica/psutils.c
drivers/acpi/acpica/pswalk.c
drivers/acpi/acpica/psxface.c
drivers/acpi/acpica/rsdumpinfo.c
drivers/acpi/acpica/rsirq.c
drivers/acpi/acpica/rsserial.c
drivers/acpi/acpica/tbdata.c
drivers/acpi/acpica/tbfadt.c
drivers/acpi/acpica/tbfind.c
drivers/acpi/acpica/tbinstal.c
drivers/acpi/acpica/tbprint.c
drivers/acpi/acpica/tbutils.c
drivers/acpi/acpica/tbxface.c
drivers/acpi/acpica/tbxfload.c
drivers/acpi/acpica/tbxfroot.c
drivers/acpi/acpica/utaddress.c
drivers/acpi/acpica/utalloc.c
drivers/acpi/acpica/utascii.c
drivers/acpi/acpica/utbuffer.c
drivers/acpi/acpica/utcache.c
drivers/acpi/acpica/utcopy.c
drivers/acpi/acpica/utdebug.c
drivers/acpi/acpica/utdecode.c
drivers/acpi/acpica/utdelete.c
drivers/acpi/acpica/uterror.c
drivers/acpi/acpica/uteval.c
drivers/acpi/acpica/utglobal.c
drivers/acpi/acpica/uthex.c
drivers/acpi/acpica/utids.c
drivers/acpi/acpica/utinit.c
drivers/acpi/acpica/utlock.c
drivers/acpi/acpica/utobject.c
drivers/acpi/acpica/utosi.c
drivers/acpi/acpica/utpredef.c
drivers/acpi/acpica/utprint.c
drivers/acpi/acpica/uttrack.c
drivers/acpi/acpica/utuuid.c
drivers/acpi/acpica/utxface.c
drivers/acpi/acpica/utxferror.c
drivers/acpi/acpica/utxfinit.c
drivers/acpi/apei/Kconfig
drivers/acpi/apei/bert.c
drivers/acpi/apei/einj.c
drivers/acpi/apei/erst.c
drivers/acpi/apei/ghes.c
drivers/acpi/apei/hest.c
drivers/acpi/bus.c
drivers/acpi/custom_method.c
drivers/acpi/dptf/Makefile
drivers/acpi/dptf/int340x_thermal.c
drivers/acpi/ec.c
drivers/acpi/ec_sys.c
drivers/acpi/internal.h
drivers/acpi/irq.c
drivers/acpi/pci_link.c
drivers/acpi/pptt.c
drivers/acpi/resource.c
drivers/acpi/tables.c
drivers/acpi/x86/utils.c
drivers/firmware/arm_sdei.c
drivers/firmware/efi/cper.c
drivers/gpio/gpiolib-acpi.c
drivers/platform/x86/sony-laptop.c
drivers/pnp/pnpacpi/rsparser.c
include/acpi/acbuffer.h
include/acpi/acconfig.h
include/acpi/acexcep.h
include/acpi/acnames.h
include/acpi/acoutput.h
include/acpi/acpi.h
include/acpi/acpiosxf.h
include/acpi/acpixf.h
include/acpi/acrestyp.h
include/acpi/actbl.h
include/acpi/actbl1.h
include/acpi/actbl2.h
include/acpi/actbl3.h
include/acpi/actypes.h
include/acpi/acuuid.h
include/acpi/ghes.h
include/acpi/platform/acenv.h
include/acpi/platform/acenvex.h
include/acpi/platform/acgcc.h
include/acpi/platform/acgccex.h
include/acpi/platform/acintel.h
include/acpi/platform/aclinux.h
include/acpi/platform/aclinuxex.h
include/linux/arm_sdei.h
include/linux/initrd.h
tools/power/acpi/common/cmfsize.c
tools/power/acpi/common/getopt.c
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
tools/power/acpi/os_specific/service_layers/osunixdir.c
tools/power/acpi/os_specific/service_layers/osunixmap.c
tools/power/acpi/os_specific/service_layers/osunixxf.c
tools/power/acpi/tools/acpidump/acpidump.h
tools/power/acpi/tools/acpidump/apdump.c
tools/power/acpi/tools/acpidump/apfiles.c
tools/power/acpi/tools/acpidump/apmain.c
virt/kvm/arm/mmu.c

index eb651a6aa28505769a38f68fa253e2a56be3ddef..30437a6db373a1cb449d15c1b98f2552786ebcc6 100644 (file)
@@ -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.
index a3ccc414a1e77e9721f44843b119bf9be61017b0..a419acaa01c507f23ece5978a4f1b065949fb36b 100644 (file)
@@ -331,6 +331,7 @@ ACPI APEI
 M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
 M:     Len Brown <lenb@kernel.org>
 L:     linux-acpi@vger.kernel.org
+R:     James Morse <james.morse@arm.com>
 R:     Tony Luck <tony.luck@intel.com>
 R:     Borislav Petkov <bp@alien8.de>
 F:     drivers/acpi/apei/
diff --git a/arch/arm/include/asm/kvm_ras.h b/arch/arm/include/asm/kvm_ras.h
new file mode 100644 (file)
index 0000000..e957729
--- /dev/null
@@ -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__ */
index 8e76db83c49878209a424d19e0e0f9789c276291..66f6a3ae68d273ba0f08e827b15f27c093cf8867 100644 (file)
@@ -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 */
index 2def77ec14be7ec38b1c62dec4d931ec2f74325d..7628efbe6c12570d704813845a80d11f19aa3379 100644 (file)
@@ -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>
 
@@ -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
index 8d91f2233135c0086509a92fec934dbef7acae89..fa90779fc752f67bd42f11ec1ca29d08a296ff4d 100644 (file)
@@ -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)
index ec1e6d6fa14ccd4c14a735a8732a7a468c709276..f987b8a8f325e03623a7dc3502f7b39031aad504 100644 (file)
@@ -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
diff --git a/arch/arm64/include/asm/kvm_ras.h b/arch/arm64/include/asm/kvm_ras.h
new file mode 100644 (file)
index 0000000..8ac6ee7
--- /dev/null
@@ -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__ */
index 0e2a0ecaf484276427d4ce21cbe135e620d0f6da..32693f34f43172ba25e419b98292609c4bc11373 100644 (file)
@@ -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 */
index 44e3c351e1ea6efe09426697b2ca7a99f3cd6040..803f0494dd3e3b63f15678ca4700258c2e14cb61 100644 (file)
 #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>
 
@@ -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;
+}
index efb7b2cbead529439b987f77494ff9c3cc18b874..e1c84c2e1cab48a4c32eb78ad7e77cec7121a41a 100644 (file)
@@ -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>
@@ -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>
@@ -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);
@@ -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;
@@ -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)
 {
index 90ff0a47c12e0b6f787bf5e9d610e7787da7ad83..4e015c77e48e871c613e2c5fde0611d209223fc7 100644 (file)
@@ -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
index a2dcd62ea32ffb54818a3f16482608f12ee92cc0..4a434c23a1963f4b1b302151aaef1397cbd88844 100644 (file)
@@ -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;
        }
 }
index f0b52266b3ac6c45ea83a7f446513a179d60531b..d73afb562ad9587b828ce9471958dc77046b082b 100644 (file)
@@ -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;
 }
index 5a9c2febc0fb9df68e034137af4c05255a87da61..863ade9add6d60232fa6be8434f4992ec60e2949 100644 (file)
@@ -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.
  *
  *****************************************************************************/
 
@@ -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)"
index 8bc935977d8e92dc541ff011187f9ac27466e9de..54f81eac7ec9d506292cb5ea358171d4117641f5 100644 (file)
@@ -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.
  *
  *****************************************************************************/
 
index 4ebe18826646e8a3f37d264a374af8a2d7a7ce3b..d5478cd4a8576f8f3156e3ac94da58bdce35adfd 100644 (file)
@@ -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.
  *
  *****************************************************************************/
 
index 57d9495e5933a1c410c696249c936466b64e0325..32f2e38c7570c62afc73a49d1992eb3ec3e77791 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acdebug.h - ACPI/AML debugger
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -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 */
index e577f3a40e6a0fbb62f3899f9ed228c346311633..82f81501566b0af1f85daed4a42c159441253252 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acdispat.h - dispatcher (parser to interpreter interface)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index b412aa909907c5a218492a715ad241af6e66d7ba..831660179662ea60a3932ab71f3592e18ba19419 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acevents.h - Event subcomponent prototypes and defines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 87d6eb01beaf5a33e0119be30f11439855ff0f79..d056a1845613bc021a19b7c3609bbf2cff32bedb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acglobal.h - Declarations for global variables
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -164,6 +164,7 @@ ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_global_list);
 ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_ns_node_list);
 ACPI_GLOBAL(u8, acpi_gbl_display_final_mem_stats);
 ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking);
+ACPI_GLOBAL(u8, acpi_gbl_verbose_leak_dump);
 #endif
 
 /*****************************************************************************
index ef99e2fc37f89011a14f38c25c8ad157d8caf849..bcf8f7501db748c0b7df22809f081879c157b776 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: achware.h -- hardware specific interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index c5b2be0b6613e7021609ffbbaadcf5a4a7905323..20706adbc14883f5b98676f901754f408c3057ef 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acinterp.h - Interpreter subcomponent prototypes and defines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 99b0da89910989f8ef53caefd2e64333036a49a0..a2dfbf6b004e219f5a47a8664a8825d61672c174 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: aclocal.h - Internal data types used across the ACPI subsystem
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -802,7 +802,7 @@ struct acpi_comment_addr_node {
 
 /*
  * File node - used for "Include" operator file stack and
- * depdendency tree for the -ca option
+ * dependency tree for the -ca option
  */
 struct acpi_file_node {
        void *file;
index de52cd6e868afa4db0a27401b39ba785e23729cc..283614e82a2028db6dbf2705f3d5cfd1babc09ed 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acmacros.h - C macros for the entire subsystem.
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
 #define ACPI_IS_OCTAL_DIGIT(d)              (((char)(d) >= '0') && ((char)(d) <= '7'))
 
 /*
- * Macors used for the ASL-/ASL+ converter utility
+ * Macros used for the ASL-/ASL+ converter utility
  */
 #ifdef ACPI_ASL_COMPILER
 
index 9bd25f36c6080395ce13b685ca9d3164841f5bad..39812fc4386a4d22de5464f0bb4e68950552fd0f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acnamesp.h - Namespace subcomponent prototypes and defines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ac992b6ebce94878e28b19b7330a5460ed1d9943..b2ef703d7df8b63361b7a00c8e2ddbd497aeadca 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acobject.h - Definition of union acpi_operand_object  (Internal object only)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -239,6 +239,7 @@ struct acpi_object_region_field {
        union acpi_operand_object *region_obj;  /* Containing op_region object */
        u8 *resource_buffer;    /* resource_template for serial regions/fields */
        u16 pin_number_index;   /* Index relative to previous Connection/Template */
+       u8 *internal_pcc_buffer;        /* Internal buffer for fields associated with PCC */
 };
 
 struct acpi_object_bank_field {
index 818eba41361443488a2c8fbf55d551e9ac2f8a5e..9d78134428e33c348166f6d0dd0d945d2dabb6c2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acopcode.h - AML opcode information for the AML parser and interpreter
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ab48196ae55e2fe0cd97b64a352ef61f5942ae52..6e32c97cba6c44176713e13817d07f7ace5b2415 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index d31bb04facb676017387e1f315cab5ba879fc3f4..387163b962a70fcf8a1320cf493bf68604423419 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acpredef - Information table for ACPI predefined methods and objects
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -631,6 +631,21 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
        {{"_MTL", METHOD_0ARGS, /* ACPI 6.0 */
          METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
 
+       {{"_NBS", METHOD_0ARGS, /* ACPI 6.3 */
+         METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
+
+       {{"_NCH", METHOD_0ARGS, /* ACPI 6.3 */
+         METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
+
+       {{"_NIC", METHOD_0ARGS, /* ACPI 6.3 */
+         METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
+
+       {{"_NIG", METHOD_1ARGS(ACPI_TYPE_BUFFER),       /* ACPI 6.3 */
+         METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
+
+       {{"_NIH", METHOD_0ARGS, /* ACPI 6.3 */
+         METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
+
        {{"_NTT", METHOD_0ARGS,
          METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
 
index 59ae8b1a6e40a68a296d0d32b51ba6625c2e07d0..422cd8f2b92e9113d579ae88397914b429a86978 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acresrc.h - Resource Manager function prototypes
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 14be32961b4cae24ff61b731fb05f63802dc6fff..8a4e6b4aaf2c3761ee92adac825c1b0248781fcf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acstruct.h - Internal structs
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 12fac33ce77ee9cc130cd0622d8324e1a84bd1f0..dfbf1dbd4033034280db2768c99ca89377f3b16f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: actables.h - ACPI table management
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 3374d41582b53aaafec4334484f4085de2c4db76..9022537567e9d2cd184d36ae01003c8608d203cc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 6c05355447c16b91b98c833838b6953b1853f2d4..49e412edd7c6795adeb673375d2c3fbd21014b21 100644 (file)
@@ -5,7 +5,7 @@
  *                   Declarations and definitions contained herein are derived
  *                   directly from the ACPI specification.
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index cdb590176e9d3262d30953c8f79019a199282205..7c3bd4ab60fce749bd0f86441e24cb421fd2bf54 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: amlresrc.h - AML resource descriptors
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 9fcb8ec646813d3ad3e119fc805e3b53064cf0c5..30ab62b0fec875d195224bd6b02ac2d9886689a3 100644 (file)
@@ -237,7 +237,7 @@ void acpi_db_decode_and_display_object(char *target, char *output_type)
 
                default:
 
-                       /* Is not a recognizeable object */
+                       /* Is not a recognizable object */
 
                        acpi_os_printf
                            ("Not a known ACPI internal object, descriptor type %2.2X\n",
@@ -647,7 +647,7 @@ void acpi_db_display_object_type(char *object_arg)
  *
  * DESCRIPTION: Display the result of an AML opcode
  *
- * Note: Curently only displays the result object if we are single stepping.
+ * Note: Currently only displays the result object if we are single stepping.
  * However, this output may be useful in other contexts and could be enabled
  * to do so if needed.
  *
index 6abb6b834d97239d64c263521e9f26b40aa3c18b..bb43305cb215e1d9d344927b8ce3c0a673d05ef9 100644 (file)
@@ -160,12 +160,12 @@ acpi_db_execute_method(struct acpi_db_method_info *info,
                }
 
                ACPI_EXCEPTION((AE_INFO, status,
-                               "while executing %s from debugger",
+                               "while executing %s from AML Debugger",
                                info->pathname));
 
                if (status == AE_BUFFER_OVERFLOW) {
                        ACPI_ERROR((AE_INFO,
-                                   "Possible overflow of internal debugger "
+                                   "Possible buffer overflow within AML Debugger "
                                    "buffer (size 0x%X needed 0x%X)",
                                    ACPI_DEBUG_BUFFER_SIZE,
                                    (u32)return_obj->length));
index b0b9a26c7db5ec35de6dd391410c7759b4ce8618..7809bd94a18ddc075e406334afe5ce6ab50d49c5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dbhistry - debugger HISTORY command
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 992bd7b92540d6afff1083164e0f0e237a2f2a08..004d34d9369bbcf6f91c84bce33214be1f23eb7f 100644 (file)
@@ -904,7 +904,7 @@ acpi_db_bus_walk(acpi_handle obj_handle,
  *
  * RETURN:      None
  *
- * DESCRIPTION: Display info about system busses.
+ * DESCRIPTION: Display info about system buses.
  *
  ******************************************************************************/
 
index a1c76bf211227d672e992982a11e3aa24dd8bbcf..d220168dca01a4fadf7df7380ccedc6a9a8cd41f 100644 (file)
@@ -243,7 +243,7 @@ acpi_db_display_internal_object(union acpi_operand_object *obj_desc,
                        acpi_os_printf("[%s] ",
                                       acpi_ut_get_reference_name(obj_desc));
 
-                       /* Decode the refererence */
+                       /* Decode the reference */
 
                        switch (obj_desc->reference.class) {
                        case ACPI_REFCLASS_LOCAL:
index 8a5462439a97058358f3912b7fbc2d88b70b2b42..6db44a5ac7860d1a6a3b7a2df75ca23ade71ccaa 100644 (file)
@@ -10,6 +10,7 @@
 #include "acdebug.h"
 #include "acnamesp.h"
 #include "acpredef.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
 ACPI_MODULE_NAME("dbtest")
@@ -32,6 +33,9 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length);
 
 static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node);
 
+static acpi_status
+acpi_db_test_field_unit_type(union acpi_operand_object *obj_desc);
+
 static acpi_status
 acpi_db_read_from_object(struct acpi_namespace_node *node,
                         acpi_object_type expected_type,
@@ -74,7 +78,7 @@ static struct acpi_db_argument_info acpi_db_test_types[] = {
 static acpi_handle read_handle = NULL;
 static acpi_handle write_handle = NULL;
 
-/* ASL Definitions of the debugger read/write control methods */
+/* ASL Definitions of the debugger read/write control methods. AML below. */
 
 #if 0
 definition_block("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
@@ -227,10 +231,8 @@ static void acpi_db_test_all_objects(void)
  * RETURN:      Status
  *
  * DESCRIPTION: Test one namespace object. Supported types are Integer,
- *              String, Buffer, buffer_field, and field_unit. All other object
- *              types are simply ignored.
- *
- *              Note: Support for Packages is not implemented.
+ *              String, Buffer, Package, buffer_field, and field_unit.
+ *              All other object types are simply ignored.
  *
  ******************************************************************************/
 
@@ -240,7 +242,6 @@ acpi_db_test_one_object(acpi_handle obj_handle,
 {
        struct acpi_namespace_node *node;
        union acpi_operand_object *obj_desc;
-       union acpi_operand_object *region_obj;
        acpi_object_type local_type;
        u32 bit_length = 0;
        u32 byte_length = 0;
@@ -281,18 +282,21 @@ acpi_db_test_one_object(acpi_handle obj_handle,
                break;
 
        case ACPI_TYPE_FIELD_UNIT:
-       case ACPI_TYPE_BUFFER_FIELD:
        case ACPI_TYPE_LOCAL_REGION_FIELD:
        case ACPI_TYPE_LOCAL_INDEX_FIELD:
        case ACPI_TYPE_LOCAL_BANK_FIELD:
 
+               local_type = ACPI_TYPE_FIELD_UNIT;
+               break;
+
+       case ACPI_TYPE_BUFFER_FIELD:
+               /*
+                * The returned object will be a Buffer if the field length
+                * is larger than the size of an Integer (32 or 64 bits
+                * depending on the DSDT version).
+                */
                local_type = ACPI_TYPE_INTEGER;
                if (obj_desc) {
-                       /*
-                        * Returned object will be a Buffer if the field length
-                        * is larger than the size of an Integer (32 or 64 bits
-                        * depending on the DSDT version).
-                        */
                        bit_length = obj_desc->common_field.bit_length;
                        byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
                        if (bit_length > acpi_gbl_integer_bit_width) {
@@ -303,7 +307,7 @@ acpi_db_test_one_object(acpi_handle obj_handle,
 
        default:
 
-               /* Ignore all other types */
+               /* Ignore all non-data types - Methods, Devices, Scopes, etc. */
 
                return (AE_OK);
        }
@@ -314,40 +318,10 @@ acpi_db_test_one_object(acpi_handle obj_handle,
                       acpi_ut_get_type_name(node->type), node->name.ascii);
 
        if (!obj_desc) {
-               acpi_os_printf(" Ignoring, no attached object\n");
+               acpi_os_printf(" No attached sub-object, ignoring\n");
                return (AE_OK);
        }
 
-       /*
-        * Check for unsupported region types. Note: acpi_exec simulates
-        * access to system_memory, system_IO, PCI_Config, and EC.
-        */
-       switch (node->type) {
-       case ACPI_TYPE_LOCAL_REGION_FIELD:
-
-               region_obj = obj_desc->field.region_obj;
-               switch (region_obj->region.space_id) {
-               case ACPI_ADR_SPACE_SYSTEM_MEMORY:
-               case ACPI_ADR_SPACE_SYSTEM_IO:
-               case ACPI_ADR_SPACE_PCI_CONFIG:
-
-                       break;
-
-               default:
-
-                       acpi_os_printf
-                           ("    %s space is not supported in this command [%4.4s]\n",
-                            acpi_ut_get_region_name(region_obj->region.
-                                                    space_id),
-                            region_obj->region.node->name.ascii);
-                       return (AE_OK);
-               }
-               break;
-
-       default:
-               break;
-       }
-
        /* At this point, we have resolved the object to one of the major types */
 
        switch (local_type) {
@@ -371,6 +345,11 @@ acpi_db_test_one_object(acpi_handle obj_handle,
                status = acpi_db_test_package_type(node);
                break;
 
+       case ACPI_TYPE_FIELD_UNIT:
+
+               status = acpi_db_test_field_unit_type(obj_desc);
+               break;
+
        default:
 
                acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
@@ -382,24 +361,8 @@ acpi_db_test_one_object(acpi_handle obj_handle,
 
        if (ACPI_FAILURE(status)) {
                status = AE_OK;
-               goto exit;
-       }
-
-       switch (node->type) {
-       case ACPI_TYPE_LOCAL_REGION_FIELD:
-
-               region_obj = obj_desc->field.region_obj;
-               acpi_os_printf(" (%s)",
-                              acpi_ut_get_region_name(region_obj->region.
-                                                      space_id));
-
-               break;
-
-       default:
-               break;
        }
 
-exit:
        acpi_os_printf("\n");
        return (status);
 }
@@ -444,7 +407,7 @@ acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
                return (status);
        }
 
-       acpi_os_printf(" (%4.4X/%3.3X) %8.8X%8.8X",
+       acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " %8.8X%8.8X",
                       bit_length, ACPI_ROUND_BITS_UP_TO_BYTES(bit_length),
                       ACPI_FORMAT_UINT64(temp1->integer.value));
 
@@ -558,8 +521,9 @@ acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length)
 
        /* Emit a few bytes of the buffer */
 
-       acpi_os_printf(" (%4.4X/%3.3X)", bit_length, temp1->buffer.length);
-       for (i = 0; ((i < 4) && (i < byte_length)); i++) {
+       acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT, bit_length,
+                      temp1->buffer.length);
+       for (i = 0; ((i < 8) && (i < byte_length)); i++) {
                acpi_os_printf(" %2.2X", temp1->buffer.pointer[i]);
        }
        acpi_os_printf("... ");
@@ -665,8 +629,9 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
                return (status);
        }
 
-       acpi_os_printf(" (%4.4X/%3.3X) \"%s\"", (temp1->string.length * 8),
-                      temp1->string.length, temp1->string.pointer);
+       acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " \"%s\"",
+                      (temp1->string.length * 8), temp1->string.length,
+                      temp1->string.pointer);
 
        /* Write a new value */
 
@@ -750,11 +715,78 @@ static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node)
                return (status);
        }
 
-       acpi_os_printf(" %8.8X Elements", temp1->package.count);
+       acpi_os_printf(" %.2X Elements", temp1->package.count);
        acpi_os_free(temp1);
        return (status);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_test_field_unit_type
+ *
+ * PARAMETERS:  obj_desc                - A field unit object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Test read/write on a named field unit.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_db_test_field_unit_type(union acpi_operand_object *obj_desc)
+{
+       union acpi_operand_object *region_obj;
+       u32 bit_length = 0;
+       u32 byte_length = 0;
+       acpi_status status = AE_OK;
+       union acpi_operand_object *ret_buffer_desc;
+
+       /* Supported spaces are memory/io/pci_config */
+
+       region_obj = obj_desc->field.region_obj;
+       switch (region_obj->region.space_id) {
+       case ACPI_ADR_SPACE_SYSTEM_MEMORY:
+       case ACPI_ADR_SPACE_SYSTEM_IO:
+       case ACPI_ADR_SPACE_PCI_CONFIG:
+
+               /* Need the interpreter to execute */
+
+               acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
+               acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+
+               /* Exercise read-then-write */
+
+               status =
+                   acpi_ex_read_data_from_field(NULL, obj_desc,
+                                                &ret_buffer_desc);
+               if (status == AE_OK) {
+                       acpi_ex_write_data_to_field(ret_buffer_desc, obj_desc,
+                                                   NULL);
+                       acpi_ut_remove_reference(ret_buffer_desc);
+               }
+
+               acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+               acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
+
+               bit_length = obj_desc->common_field.bit_length;
+               byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
+
+               acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " [%s]", bit_length,
+                              byte_length,
+                              acpi_ut_get_region_name(region_obj->region.
+                                                      space_id));
+               return (status);
+
+       default:
+
+               acpi_os_printf
+                   ("      %s address space is not supported in this command [%4.4s]",
+                    acpi_ut_get_region_name(region_obj->region.space_id),
+                    region_obj->region.node->name.ascii);
+               return (AE_OK);
+       }
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_db_read_from_object
index 6b15625e80990000263e19f9f2569977d559c7f7..85b34d02233e3e46cf02c0a86e166eafa4334fe0 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: dsargs - Support for execution of dynamic arguments for static
  *                       objects (regions, fields, buffer fields, etc.)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 0da96268deb51bd631b175aae898222829c0bb74..4847f89c678ccae7b340b1b7735f664d7cea17e7 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: dscontrol - Support for execution control opcodes -
  *                          if/else/while/return
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 9d33f0bb28855050b5d67302dd0ad58bc6c66631..0d3e1ced1f5764b1b084be71ba9db0a28c1c1639 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dsdebug - Parser/Interpreter interface - debugging
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 30fe89545d6ab614a32d8d563e2d335dc25613b2..cf4e061bb0f0b1bb2392efcde2f43541194cd569 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dsfield - Dispatcher field routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -518,6 +518,13 @@ acpi_ds_create_field(union acpi_parse_object *op,
        info.region_node = region_node;
 
        status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
+       if (info.region_node->object->region.space_id ==
+           ACPI_ADR_SPACE_PLATFORM_COMM
+           && !(region_node->object->field.internal_pcc_buffer =
+                ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
+                                     length))) {
+               return_ACPI_STATUS(AE_NO_MEMORY);
+       }
        return_ACPI_STATUS(status);
 }
 
index e8de1b0ce2f59bcbe95b2529bec3e05449c15210..a4a24ffe5fae5cca60f156554f0e8af4e18f0713 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dsinit - Object initialization namespace walk
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index c1a4d02fafd5ab2d6114c4f8975696516ae4db5b..f59b4d944f7fa02c1090c798a40e0ddd92d8000e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 6a9cc613adaaae08dd034890557bb6954d9670d4..179129a2deb174fb2348d521f13f7e2980b83376 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dsobject - Dispatcher object management routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 78f9de260d5f1d1e5c60c4cbcafd0ad86e035974..10f32b62608eee5df9e26d60bea0f8f0fb6b2520 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dsopcode - Dispatcher support for regions and fields
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -130,8 +130,8 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
                /* Must have a valid (>0) bit count */
 
                if (bit_count == 0) {
-                       ACPI_ERROR((AE_INFO,
-                                   "Attempt to CreateField of length zero"));
+                       ACPI_BIOS_ERROR((AE_INFO,
+                                        "Attempt to CreateField of length zero"));
                        status = AE_AML_OPERAND_VALUE;
                        goto cleanup;
                }
@@ -194,12 +194,13 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
        /* Entire field must fit within the current length of the buffer */
 
        if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) {
-               ACPI_ERROR((AE_INFO,
-                           "Field [%4.4s] at bit offset/length %u/%u "
-                           "exceeds size of target Buffer (%u bits)",
-                           acpi_ut_get_node_name(result_desc), bit_offset,
-                           bit_count, 8 * (u32)buffer_desc->buffer.length));
                status = AE_AML_BUFFER_LIMIT;
+               ACPI_BIOS_EXCEPTION((AE_INFO, status,
+                                    "Field [%4.4s] at bit offset/length %u/%u "
+                                    "exceeds size of target Buffer (%u bits)",
+                                    acpi_ut_get_node_name(result_desc),
+                                    bit_offset, bit_count,
+                                    8 * (u32)buffer_desc->buffer.length));
                goto cleanup;
        }
 
@@ -355,6 +356,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
        union acpi_operand_object *operand_desc;
        struct acpi_namespace_node *node;
        union acpi_parse_object *next_op;
+       acpi_adr_space_type space_id;
 
        ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op);
 
@@ -367,6 +369,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
        /* next_op points to the op that holds the space_ID */
 
        next_op = op->common.value.arg;
+       space_id = (acpi_adr_space_type)next_op->common.value.integer;
 
        /* next_op points to address op */
 
@@ -402,6 +405,15 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
        obj_desc->region.length = (u32) operand_desc->integer.value;
        acpi_ut_remove_reference(operand_desc);
 
+       /* A zero-length operation region is unusable. Just warn */
+
+       if (!obj_desc->region.length
+           && (space_id < ACPI_NUM_PREDEFINED_REGIONS)) {
+               ACPI_WARNING((AE_INFO,
+                             "Operation Region [%4.4s] has zero length (SpaceId %X)",
+                             node->name.ascii, space_id));
+       }
+
        /*
         * Get the address and save it
         * (at top of stack - 1)
index 584853385268ade419a0f8f034db9f334cae75a5..997faa10f615188a66c7df805d4d90f39281830d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dspkginit - Completion of deferred package initialization
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 1504b93cc5f411427a802b64a27a31880b2ac059..d75aae3045958dfa0f96048fe38f36a08fe3fab9 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: dswexec - Dispatcher method execution callbacks;
  *                        dispatch to interpreter.
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index e2ef09643d50831d531c8e7072d34bc0785758e6..c88fd31208a5ba9ef9057de5f5b8d32c1148012e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dswload - Dispatcher first pass namespace load callbacks
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 9a309f5c4de8a6c6169cb0d287a58fde5a197d2f..935a8e2623e4bfd89b2afb747a9c9346ae699029 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dswload2 - Dispatcher second pass namespace load callbacks
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -24,7 +24,7 @@ ACPI_MODULE_NAME("dswload2")
  * FUNCTION:    acpi_ds_load2_begin_op
  *
  * PARAMETERS:  walk_state      - Current state of the parse tree walk
- *              out_op          - Wher to return op if a new one is created
+ *              out_op          - Where to return op if a new one is created
  *
  * RETURN:      Status
  *
index 7592176a8fa2eba4f3a288575a379c63cae088ef..39acf7b286da83977363e070fc4ddde84b4eff4d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dswscope - Scope stack manipulation
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 4c1ec202d5ab81504e051f302a0b5510dbc9c1e1..de79f835a373759bbe115d0a48ba62856b9176e3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: dswstate - Dispatcher parse tree walk management routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index b3d07cc14d75d7dddc9149207c75b88a5954f01b..9e2f5a05c066eb2b88ce6cf922bb0f422c8952df 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evevent - Fixed Event handling and dispatch
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 1b8a662a14a927775ae2dd83f8cb72b607053824..5c77bee5d31fbd6a84d3c0093f03410fbc9fa6d2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evglock - Global Lock support
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index e10fec99a182eca363167e27e1a6338e42586c09..62d3aa74277b4d03cb4bd1e7d5cee705864bd41b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evgpe - General Purpose Event handling and dispatch
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -801,7 +801,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
                                                              dispatch.handler->
                                                              context);
 
-               /* If requested, clear (if level-triggered) and reenable the GPE */
+               /* If requested, clear (if level-triggered) and re-enable the GPE */
 
                if (return_value & ACPI_REENABLE_GPE) {
                        (void)acpi_ev_finish_gpe(gpe_event_info);
index b253063b09d39c1c3c5bb3c81a375c8cec8756cf..328d1d6123ad6e04c50d8d485dc34ef26020c4e2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evgpeblk - GPE block creation and initialization.
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 1f686750bb1a2f2bef1ea6e6466e118465f27368..c92d2f6ebe014559ba37b60fc7fe8beb6b1ce5c5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evgpeinit - System GPE initialization and update
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 0fb6c70f44ed8198754a8ba44ba0105f7dd7b8e5..917892227e09a14f5a0b9ebbaafe2a964cd2f8f3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evgpeutil - GPE utilities
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 4ed1e67db6be8d3a4c36c9d91597905ce292d209..3ef4e27995f0d12ebccc3a58e99a274c08e11fa9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evhandler - Support for Address Space handlers
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index baadd635b5afb8646f5fb2c616dbf037d4641f69..d45f7639f7ee6d7097f0882c7e1e46f9f998ffdf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evmisc - Miscellaneous event manager support functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 49decca4e08ffeabbc0fc4f421a4ad88015884fe..45dc797df05de208d9d00efb2bf32538fc7c8681 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evregion - Operation Region support
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -250,7 +250,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                /*
                 * For handlers other than the default (supplied) handlers, we must
                 * exit the interpreter because the handler *might* block -- we don't
-                * know what it will do, so we can't hold the lock on the intepreter.
+                * know what it will do, so we can't hold the lock on the interpreter.
                 */
                acpi_ex_exit_interpreter();
        }
index 17df5dacd43cf2c1687c4b0d0cf02c414f1f4706..0b47bbcd2a2391925d2393dcadf12fd992c32971 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evrgnini- ACPI address_space (op_region) init
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -516,25 +516,6 @@ acpi_status acpi_ev_initialize_region(union acpi_operand_object *region_obj)
                                handler_obj = obj_desc->common_notify.handler;
                                break;
 
-                       case ACPI_TYPE_METHOD:
-                               /*
-                                * If we are executing module level code, the original
-                                * Node's object was replaced by this Method object and we
-                                * saved the handler in the method object.
-                                *
-                                * Note: Only used for the legacy MLC support. Will
-                                * be removed in the future.
-                                *
-                                * See acpi_ns_exec_module_code
-                                */
-                               if (!acpi_gbl_execute_tables_as_methods &&
-                                   obj_desc->method.
-                                   info_flags & ACPI_METHOD_MODULE_LEVEL) {
-                                       handler_obj =
-                                           obj_desc->method.dispatch.handler;
-                               }
-                               break;
-
                        default:
 
                                /* Ignore other objects */
index febc332b00ac1313716b96e01c6fc3cc977e3ac3..3df00eb6621bd200850b6c0439b9964d63534238 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evxface - External interfaces for ACPI events
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 970e940bdb17f1dde47763e2913c9c57d815b9f6..e528fe56b75579fed1f41a8a5ceb59351426fb2c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index b2d5f66cc1b055863492567007fee2444bfa1150..30a083902f522115f23642233805a3c7fb11a812 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -669,9 +669,9 @@ ACPI_EXPORT_SYMBOL(acpi_dispatch_gpe)
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Clear and conditionally reenable a GPE. This completes the GPE
+ * DESCRIPTION: Clear and conditionally re-enable a GPE. This completes the GPE
  *              processing. Intended for use by asynchronous host-installed
- *              GPE handlers. The GPE is only reenabled if the enable_for_run bit
+ *              GPE handlers. The GPE is only re-enabled if the enable_for_run bit
  *              is set in the GPE info.
  *
  ******************************************************************************/
index 3b3a25d9f0e6d25717b3a0b6e43d4f79e525ce17..47265b073e6ff48e6519469eebcfe31f0c10a64e 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
  *                         Address Spaces.
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 5e75c510ca2597011bd06a48264c294e4106574f..c7af07566b7b177e12e9e8c902f390432f15b312 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exconcat - Concatenate-type AML operators
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 2373a749215124ab62bfd206643252349192a29e..587aeeeb5070a1dea1bed495e0735af4f8818b1f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 1a70b80cc40619b3d47f3fd8a91398b14571db25..ca2966bacb50eeb1eeecbf9c2ee5aea6b137320d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exconvrt - Object conversion routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -520,7 +520,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
                for (i = 0; i < obj_desc->buffer.length; i++) {
                        if (base == 16) {
 
-                               /* Emit 0x prefix for explict/implicit hex conversion */
+                               /* Emit 0x prefix for explicit/implicit hex conversion */
 
                                *new_buf++ = '0';
                                *new_buf++ = 'x';
index 3304c6b1e8a7fe5d7456d470f09567e7a3f80958..f376fc00064e0c8cfa6f961da08906e225f19b63 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: excreate - Named object creation
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ebbc244039abd7629dc5594903f065ec5765e9fd..b1aeec8cac55090cb952aa3da676a8ff6d3ceca8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exdebug - Support for stores to the AML Debug Object
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index f71dfa1e90e1654fe469d103fcfd41f61ad37974..6526b2deeaada44251d6869f07ae45791650fc6e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exdump - Interpreter debug output routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index e5798f15793a2739a58c5152cd1c09c5da317e20..d3d2dbfba680c18d533caf861eb26a910dbc0db1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exfield - AML execution - field_unit read/write
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -41,6 +41,17 @@ const u8 acpi_protocol_lengths[] = {
        0xFF                    /* F - ATTRIB_RAW_PROCESS_BYTES */
 };
 
+#define PCC_MASTER_SUBSPACE     3
+
+/*
+ * The following macros determine a given offset is a COMD field.
+ * According to the specification, generic subspaces (types 0-2) contains a
+ * 2-byte COMD field at offset 4 and master subspaces (type 3) contains a 4-byte
+ * COMD field starting at offset 12.
+ */
+#define GENERIC_SUBSPACE_COMMAND(a)     (4 == a || a == 5)
+#define MASTER_SUBSPACE_COMMAND(a)      (12 <= a && a <= 15)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ex_get_protocol_buffer_length
@@ -177,6 +188,25 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
 
                status = acpi_ex_read_gpio(obj_desc, buffer);
                goto exit;
+       } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+                  (obj_desc->field.region_obj->region.space_id ==
+                   ACPI_ADR_SPACE_PLATFORM_COMM)) {
+               /*
+                * Reading from a PCC field unit does not require the handler because
+                * it only requires reading from the internal_pcc_buffer.
+                */
+               ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
+                                 "PCC FieldRead bits %u\n",
+                                 obj_desc->field.bit_length));
+
+               memcpy(buffer,
+                      obj_desc->field.region_obj->field.internal_pcc_buffer +
+                      obj_desc->field.base_byte_offset,
+                      (acpi_size)ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.
+                                                             bit_length));
+
+               *ret_buffer_desc = buffer_desc;
+               return AE_OK;
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
@@ -229,6 +259,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 {
        acpi_status status;
        u32 buffer_length;
+       u32 data_length;
        void *buffer;
 
        ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc);
@@ -272,6 +303,44 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
                    acpi_ex_write_serial_bus(source_desc, obj_desc,
                                             result_desc);
                return_ACPI_STATUS(status);
+       } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+                  (obj_desc->field.region_obj->region.space_id ==
+                   ACPI_ADR_SPACE_PLATFORM_COMM)) {
+               /*
+                * According to the spec a write to the COMD field will invoke the
+                * region handler. Otherwise, write to the pcc_internal buffer. This
+                * implementation will use the offsets specified rather than the name
+                * of the field. This is considered safer because some firmware tools
+                * are known to obfiscate named objects.
+                */
+               data_length =
+                   (acpi_size)ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.
+                                                          bit_length);
+               memcpy(obj_desc->field.region_obj->field.internal_pcc_buffer +
+                      obj_desc->field.base_byte_offset,
+                      source_desc->buffer.pointer, data_length);
+
+               if ((obj_desc->field.region_obj->region.address ==
+                    PCC_MASTER_SUBSPACE
+                    && MASTER_SUBSPACE_COMMAND(obj_desc->field.
+                                               base_byte_offset))
+                   || GENERIC_SUBSPACE_COMMAND(obj_desc->field.
+                                               base_byte_offset)) {
+
+                       /* Perform the write */
+
+                       ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
+                                         "PCC COMD field has been written. Invoking PCC handler now.\n"));
+
+                       status =
+                           acpi_ex_access_region(obj_desc, 0,
+                                                 (u64 *)obj_desc->field.
+                                                 region_obj->field.
+                                                 internal_pcc_buffer,
+                                                 ACPI_WRITE);
+                       return_ACPI_STATUS(status);
+               }
+               return (AE_OK);
        }
 
        /* Get a pointer to the data to be written */
index 51699413312849d7f7c4c8f29269128db99197a3..95a0dcb4f7b91accdf9b4f333e1b8e12d246452e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exfldio - Aml Field I/O
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index d91f15cdf3ae6399b03128a3975df8933ef7df91..60e854965af9862775a5dcbfd57b3839b16b15ab 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index c06079774badae1a9bcb8b7e60aec710d53db276..775cd62af5b3d2fc21d42aa8ed42277e15ae67c0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exmutex - ASL Mutex Acquire/Release functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 7eed79dcda83addb3522ad6e54fab8883963bfe8..bd68d66e89f0da0e35d25a0910cbe4fff40f2cac 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exnames - interpreter/scanner name load/execute
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ba9fbae0cf91fe87fb454ff53bfcc25885ed7503..06e35ea0982345fe54a2e3161aa6bdd19366198b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exoparg1 - AML execution - opcodes with 1 argument
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 3a477566ba1b309b7de90dbedc824d335b140a7c..5e4a31a11df4f65198173d4557a870ff899fed26 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -390,10 +390,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
                /* Failure means that the Index was beyond the end of the object */
 
                if (ACPI_FAILURE(status)) {
-                       ACPI_EXCEPTION((AE_INFO, status,
-                                       "Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
-                                       ACPI_FORMAT_UINT64(index),
-                                       (u32)length));
+                       ACPI_BIOS_EXCEPTION((AE_INFO, status,
+                                            "Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
+                                            ACPI_FORMAT_UINT64(index),
+                                            (u32)length));
                        goto cleanup;
                }
 
index 764fa6f924ff5f16d5026442c6246a03c41f5967..a4ebce4179308c6fbd8e97da5413a93c109abed4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exoparg3 - AML execution - opcodes with 3 arguments
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 3941525f3d6b450906db9ecc80adb534f0ab73ca..31385a0b2dab9af77ecf3cc5c5b33dd42272139d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exoparg6 - AML execution - opcodes with 6 arguments
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 738f3c732363a06cd6d246b57eca2855906621e9..728d752f7adcd0e99c0c7f575829470e2284f9bb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exprep - ACPI AML field prep utilities
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 2c58f5e00b1a18ad6c6a354fe77d559159d41264..c08521194b297f2d210bf654e3abf5886d83f9fa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exregion - ACPI default op_region (address space) handlers
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ea4b0fe674f1a830f7dab6aae8ebdd4368bafc61..b223d01e6bf8ef84df483a3e4b6f54968866636d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exresnte - AML Interpreter object resolution
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 5e42c7de46fa8839ca2b7a65a7b196775303a008..36da5c0ef69cf060db4205e30f55a750243bb6c8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exresolv - AML Interpreter object resolution
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index d94190bc59856540e71a57b355722fa17ec20b7e..bdfe4d33b48370f3027febc93fcb01b09c70c53b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exresop - AML Interpreter operand/object resolution
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ec61553c448377ac0f177945bf635ed115829a4f..c5aa4b0deb70b488f394bfdb9e1017de40c5615e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exserial - field_unit support for serial address spaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -21,7 +21,7 @@ ACPI_MODULE_NAME("exserial")
  * FUNCTION:    acpi_ex_read_gpio
  *
  * PARAMETERS:  obj_desc            - The named field to read
- *              buffer              - Where the return data is returnd
+ *              buffer              - Where the return data is returned
  *
  * RETURN:      Status
  *
index 75d5665b7b2f7dc7522ad4c4167f9cc4f1f543fd..7f3c3571c292bba5810df849dcbe74caf821ca3f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exstore - AML Interpreter object store support
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 31cba19652ed3095a65a77f4ae0819a162e99dcc..4e43c8277f0709249962bd35a940b8583060a316 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: exstoren - AML Interpreter object store support,
  *                        Store to Node (namespace object)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 4cd82ff509bc9af703040441ee7eb1abbf52cece..dc9e2b1c1ad95bb476f161d7048e9883fe50d84f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exstorob - AML object store support, store to object
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ec8b5a22cad49d400922805ba84556e5404935a3..a538f7799b7872cb7ac0c69ee9fc981a165f88fc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exsystem - Interface to OS services
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 9bd3fa56b51a1ac716260d3008b0fd3c608b7e9f..db7f93ca539f665499ad07bb2c6d5d256324a742 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: extrace - Support for interpreter execution tracing
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index bd22e27adf9b775422385983ebd7acacacd15d97..75380be1c2ef1e2159f46cb8c951c0fb6514154e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: exutils - interpreter/scanner utilities
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -160,7 +160,7 @@ u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
  * RETURN:      None
  *
  * DESCRIPTION: Obtain the ACPI hardware Global Lock, only if the field
- *              flags specifiy that it is to be obtained before field access.
+ *              flags specify that it is to be obtained before field access.
  *
  ******************************************************************************/
 
index 525e6ea5c11491cf7aa27084bf2a29b0f3564a8d..926f7e080f22134dd4859576ea47f0dc950704ea 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index e0ad3f11142e47b7b919c0092f48a4dfa60b9796..dee3affaca491114b3f393c81ce1d848f8fa9fd8 100644 (file)
@@ -4,7 +4,7 @@
  * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
  *                    extended FADT-V5 sleep registers.
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 2d2e2e41a6851bc0eba051a46832bbf79a40d1a6..565bd3f29f313ce0b8b67293ab8cb414807ca434 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: hwgpe - Low level GPE enable/disable/clear functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index d8b8fc2ff5633e7406c256fc6fff3e0ee6b16f2a..b62db8ec446fa503e1cf62cdd090032b7cb93b74 100644 (file)
@@ -4,7 +4,7 @@
  * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the
  *                   original/legacy sleep/PM registers.
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 5d5e27146fc2167c52616a5424c232e56da06526..2fb9f75d71c54226da6308228c3b880b3af18df8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: hwtimer.c - ACPI Power Management Timer Interface
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 24f9b61aa40492b09f84a45745fe7d40d1645e68..cd576153257c603c3c9886deeef137defc1313de 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: hwvalid - I/O request validation
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 6e39a771a56efb7021bd9f07654b3ca5dbdd8d9c..c4fd971040249cc82bb44af6bf21843aa1b1cabd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: hwxface - Public ACPICA hardware interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 3f22f7dd4556de3820210f7f0800b0950dac112c..abbf9702aa7f231cd62353ee375de7b36a6fae84 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -23,33 +23,6 @@ acpi_hw_set_firmware_waking_vector(struct acpi_table_facs *facs,
                                   acpi_physical_address physical_address64);
 #endif
 
-static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
-
-/*
- * Dispatch table used to efficiently branch to the various sleep
- * functions.
- */
-#define ACPI_SLEEP_FUNCTION_ID         0
-#define ACPI_WAKE_PREP_FUNCTION_ID     1
-#define ACPI_WAKE_FUNCTION_ID          2
-
-/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
-
-static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
-       {ACPI_STRUCT_INIT(legacy_function,
-                         ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep)),
-        ACPI_STRUCT_INIT(extended_function,
-                         acpi_hw_extended_sleep)},
-       {ACPI_STRUCT_INIT(legacy_function,
-                         ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep)),
-        ACPI_STRUCT_INIT(extended_function,
-                         acpi_hw_extended_wake_prep)},
-       {ACPI_STRUCT_INIT(legacy_function,
-                         ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake)),
-        ACPI_STRUCT_INIT(extended_function,
-                         acpi_hw_extended_wake)}
-};
-
 /*
  * These functions are removed for the ACPI_REDUCED_HARDWARE case:
  *      acpi_set_firmware_waking_vector
@@ -209,53 +182,6 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
 
 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
 #endif                         /* !ACPI_REDUCED_HARDWARE */
-/*******************************************************************************
- *
- * FUNCTION:    acpi_hw_sleep_dispatch
- *
- * PARAMETERS:  sleep_state         - Which sleep state to enter/exit
- *              function_id         - Sleep, wake_prep, or Wake
- *
- * RETURN:      Status from the invoked sleep handling function.
- *
- * DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling
- *              function.
- *
- ******************************************************************************/
-static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id)
-{
-       acpi_status status;
-       struct acpi_sleep_functions *sleep_functions =
-           &acpi_sleep_dispatch[function_id];
-
-#if (!ACPI_REDUCED_HARDWARE)
-       /*
-        * If the Hardware Reduced flag is set (from the FADT), we must
-        * use the extended sleep registers (FADT). Note: As per the ACPI
-        * specification, these extended registers are to be used for HW-reduced
-        * platforms only. They are not general-purpose replacements for the
-        * legacy PM register sleep support.
-        */
-       if (acpi_gbl_reduced_hardware) {
-               status = sleep_functions->extended_function(sleep_state);
-       } else {
-               /* Legacy sleep */
-
-               status = sleep_functions->legacy_function(sleep_state);
-       }
-
-       return (status);
-
-#else
-       /*
-        * For the case where reduced-hardware-only code is being generated,
-        * we know that only the extended sleep registers are available
-        */
-       status = sleep_functions->extended_function(sleep_state);
-       return (status);
-
-#endif                         /* !ACPI_REDUCED_HARDWARE */
-}
 
 /*******************************************************************************
  *
@@ -362,7 +288,12 @@ acpi_status acpi_enter_sleep_state(u8 sleep_state)
                return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
        }
 
-       status = acpi_hw_sleep_dispatch(sleep_state, ACPI_SLEEP_FUNCTION_ID);
+#if !ACPI_REDUCED_HARDWARE
+       if (!acpi_gbl_reduced_hardware)
+               status = acpi_hw_legacy_sleep(sleep_state);
+       else
+#endif
+               status = acpi_hw_extended_sleep(sleep_state);
        return_ACPI_STATUS(status);
 }
 
@@ -388,8 +319,12 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
 
        ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep);
 
-       status =
-           acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_PREP_FUNCTION_ID);
+#if !ACPI_REDUCED_HARDWARE
+       if (!acpi_gbl_reduced_hardware)
+               status = acpi_hw_legacy_wake_prep(sleep_state);
+       else
+#endif
+               status = acpi_hw_extended_wake_prep(sleep_state);
        return_ACPI_STATUS(status);
 }
 
@@ -413,7 +348,12 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
 
        ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
 
-       status = acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_FUNCTION_ID);
+#if !ACPI_REDUCED_HARDWARE
+       if (!acpi_gbl_reduced_hardware)
+               status = acpi_hw_legacy_wake(sleep_state);
+       else
+#endif
+               status = acpi_hw_extended_wake(sleep_state);
        return_ACPI_STATUS(status);
 }
 
index b9ede797b654fb057968c985b6b19179132fd862..0e97ed38973ff7be9efcd5ec91efeab2bf61e21c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsarguments - Validation of args for ACPI predefined methods
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index f9527346b0f7e4b3038a5706b8a610cfd744527f..14cbf63f19916c34d48cf1e0bd43ff5ded65b263 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: nsconvert - Object conversions for objects returned by
  *                          predefined methods
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 90ccffcd770b16740d1f35bbe224f07ec83e6dea..15070bd0c28a96596ded36274e258dc3da9594a1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsdump - table dumping routines for debug
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 2b291c500fb0da2ac284cc7f787902df5d431f4e..73e5c83c8c9f8706400b828a7493345a33ffdbba 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsdump - table dumping routines for debug
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index d77257d1c827b39f2efc0576ac8a08b433881d83..19fb8dda870f723650ac377ef671928bbe74310f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsinit - namespace initialization
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 04bc73e82aed3f4160ca6ac2818ee98029b38d1e..35fff5c75da148a506da81fd7b8b1c99610357f1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsload - namespace loading/expanding/contracting procedures
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -75,7 +75,7 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
                /*
                 * On error, delete any namespace objects created by this table.
                 * We cannot initialize these objects, so delete them. There are
-                * a couple of expecially bad cases:
+                * a couple of especially bad cases:
                 * AE_ALREADY_EXISTS - namespace collision.
                 * AE_NOT_FOUND - the target of a Scope operator does not
                 * exist. This target of Scope must already exist in the
index 488ff39d86f799217aec6adcd841bf60fe0fa921..c0b4f7bedfaba3c547638deb68543217c4bf33ad 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsparse - namespace interface to AML parser
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -253,61 +253,19 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
 
        ACPI_FUNCTION_TRACE(ns_parse_table);
 
-       if (acpi_gbl_execute_tables_as_methods) {
-               /*
-                * This case executes the AML table as one large control method.
-                * The point of this is to execute any module-level code in-place
-                * as the table is parsed. Some AML code depends on this behavior.
-                *
-                * It is a run-time option at this time, but will eventually become
-                * the default.
-                *
-                * Note: This causes the table to only have a single-pass parse.
-                * However, this is compatible with other ACPI implementations.
-                */
-               ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
-                                     "%s: **** Start table execution pass\n",
-                                     ACPI_GET_FUNCTION_NAME));
-
-               status = acpi_ns_execute_table(table_index, start_node);
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
-               }
-       } else {
-               /*
-                * AML Parse, pass 1
-                *
-                * In this pass, we load most of the namespace. Control methods
-                * are not parsed until later. A parse tree is not created.
-                * Instead, each Parser Op subtree is deleted when it is finished.
-                * This saves a great deal of memory, and allows a small cache of
-                * parse objects to service the entire parse. The second pass of
-                * the parse then performs another complete parse of the AML.
-                */
-               ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
-
-               status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
-                                                   table_index, start_node);
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
-               }
+       /*
+        * Executes the AML table as one large control method.
+        * The point of this is to execute any module-level code in-place
+        * as the table is parsed. Some AML code depends on this behavior.
+        *
+        * Note: This causes the table to only have a single-pass parse.
+        * However, this is compatible with other ACPI implementations.
+        */
+       ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+                             "%s: **** Start table execution pass\n",
+                             ACPI_GET_FUNCTION_NAME));
 
-               /*
-                * AML Parse, pass 2
-                *
-                * In this pass, we resolve forward references and other things
-                * that could not be completed during the first pass.
-                * Another complete parse of the AML is performed, but the
-                * overhead of this is compensated for by the fact that the
-                * parse objects are all cached.
-                */
-               ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n"));
-               status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2,
-                                                   table_index, start_node);
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
-               }
-       }
+       status = acpi_ns_execute_table(table_index, start_node);
 
        return_ACPI_STATUS(status);
 }
index 29c68b15a64f99f43e16a64dcb85132954b08f6b..2f9d93122d0c2ea59b3103919115c50393b88954 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nspredef - Validation of ACPI predefined methods and objects
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 51523473e7fe5a05723165366004c0790f104497..9a80e3b23496bcff8be5f8c12b83bbf965aa9160 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsprepkg - Validation of package objects for predefined names
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ff2ab8fbec3841a13e8e7ca815aa0d23e99068f2..0aacfa48e20d1889dcd7dcc6be09dc97881e5009 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nsrepair - Repair for objects returned by predefined methods
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index a3bd6280882c3b6684228b7c9f504a4ae4dcedcc..d5804a6d1d6574bae7a08b6623faf2e06fdb99df 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: nsrepair2 - Repair for objects returned by specific
  *                          predefined methods
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index a2bf4b2caa6c2c5077689436c91bd97652b69801..e5cef1edf49faf6b6e3384bc4f7010be79534846 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
  *                        parents and siblings and Scope manipulation
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -350,7 +350,7 @@ acpi_ns_internalize_name(const char *external_name, char **converted_name)
  *
  * FUNCTION:    acpi_ns_externalize_name
  *
- * PARAMETERS:  internal_name_length - Lenth of the internal name below
+ * PARAMETERS:  internal_name_length - Length of the internal name below
  *              internal_name       - Internal representation of name
  *              converted_name_length - Where the length is returned
  *              converted_name      - Where the resulting external name
index e9a061da9bb20c5f0a2734469ee92dee2b8904db..ceea6af79d12135cd00670dcb5cad533beeb3e68 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: nswalk - Functions for walking the ACPI namespace
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index b2915c9cceaf6fe482727d10d8287c8fae7f65bb..de2d3135d6a932ee075dfda8fbfdd177b5bd9d60 100644 (file)
@@ -4,7 +4,7 @@
  * Module Name: nsxfname - Public interfaces to the ACPI subsystem
  *                         ACPI Namespace oriented interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 176d28d60125d9e2804e8af80fcbe41cc9cd51dc..9d9d442cd999785d3624267ba6194ae5a034f8ce 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psargs - Parse AML opcode arguments
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index e00d1af6fa80d17874015937e1768fbf79f0ac9d..207805047bc4dcf11fef3eb44b7de8f467f070c2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psloop - Main AML parse loop
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -32,10 +32,6 @@ static acpi_status
 acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
                      u8 * aml_op_start, union acpi_parse_object *op);
 
-static void
-acpi_ps_link_module_code(union acpi_parse_object *parent_op,
-                        u8 *aml_start, u32 aml_length, acpi_owner_id owner_id);
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ps_get_arguments
@@ -56,7 +52,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
 {
        acpi_status status = AE_OK;
        union acpi_parse_object *arg = NULL;
-       const struct acpi_opcode_info *op_info;
 
        ACPI_FUNCTION_TRACE_PTR(ps_get_arguments, walk_state);
 
@@ -136,96 +131,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
                                  walk_state->arg_count,
                                  walk_state->pass_number));
 
-               /*
-                * This case handles the legacy option that groups all module-level
-                * code blocks together and defers execution until all of the tables
-                * are loaded. Execute all of these blocks at this time.
-                * Execute any module-level code that was detected during the table
-                * load phase.
-                *
-                * Note: this option is deprecated and will be eliminated in the
-                * future. Use of this option can cause problems with AML code that
-                * depends upon in-order immediate execution of module-level code.
-                */
-               if (!acpi_gbl_execute_tables_as_methods &&
-                   (walk_state->pass_number <= ACPI_IMODE_LOAD_PASS2) &&
-                   ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
-                       /*
-                        * We want to skip If/Else/While constructs during Pass1 because we
-                        * want to actually conditionally execute the code during Pass2.
-                        *
-                        * Except for disassembly, where we always want to walk the
-                        * If/Else/While packages
-                        */
-                       switch (op->common.aml_opcode) {
-                       case AML_IF_OP:
-                       case AML_ELSE_OP:
-                       case AML_WHILE_OP:
-                               /*
-                                * Currently supported module-level opcodes are:
-                                * IF/ELSE/WHILE. These appear to be the most common,
-                                * and easiest to support since they open an AML
-                                * package.
-                                */
-                               if (walk_state->pass_number ==
-                                   ACPI_IMODE_LOAD_PASS1) {
-                                       acpi_ps_link_module_code(op->common.
-                                                                parent,
-                                                                aml_op_start,
-                                                                (u32)
-                                                                (walk_state->
-                                                                parser_state.
-                                                                pkg_end -
-                                                                aml_op_start),
-                                                                walk_state->
-                                                                owner_id);
-                               }
-
-                               ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-                                                 "Pass1: Skipping an If/Else/While body\n"));
-
-                               /* Skip body of if/else/while in pass 1 */
-
-                               walk_state->parser_state.aml =
-                                   walk_state->parser_state.pkg_end;
-                               walk_state->arg_count = 0;
-                               break;
-
-                       default:
-                               /*
-                                * Check for an unsupported executable opcode at module
-                                * level. We must be in PASS1, the parent must be a SCOPE,
-                                * The opcode class must be EXECUTE, and the opcode must
-                                * not be an argument to another opcode.
-                                */
-                               if ((walk_state->pass_number ==
-                                    ACPI_IMODE_LOAD_PASS1)
-                                   && (op->common.parent->common.aml_opcode ==
-                                       AML_SCOPE_OP)) {
-                                       op_info =
-                                           acpi_ps_get_opcode_info(op->common.
-                                                                   aml_opcode);
-                                       if ((op_info->class ==
-                                            AML_CLASS_EXECUTE) && (!arg)) {
-                                               ACPI_WARNING((AE_INFO,
-                                                             "Unsupported module-level executable opcode "
-                                                             "0x%.2X at table offset 0x%.4X",
-                                                             op->common.
-                                                             aml_opcode,
-                                                             (u32)
-                                                             (ACPI_PTR_DIFF
-                                                              (aml_op_start,
-                                                               walk_state->
-                                                               parser_state.
-                                                               aml_start) +
-                                                              sizeof(struct
-                                                                     acpi_table_header))));
-                                       }
-                               }
-                               break;
-                       }
-               }
-
                /* Special processing for certain opcodes */
 
                switch (op->common.aml_opcode) {
@@ -300,104 +205,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
        return_ACPI_STATUS(AE_OK);
 }
 
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ps_link_module_code
- *
- * PARAMETERS:  parent_op           - Parent parser op
- *              aml_start           - Pointer to the AML
- *              aml_length          - Length of executable AML
- *              owner_id            - owner_id of module level code
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Wrap the module-level code with a method object and link the
- *              object to the global list. Note, the mutex field of the method
- *              object is used to link multiple module-level code objects.
- *
- * NOTE: In this legacy option, each block of detected executable AML
- * code that is outside of any control method is wrapped with a temporary
- * control method object and placed on a global list below.
- *
- * This function executes the module-level code for all tables only after
- * all of the tables have been loaded. It is a legacy option and is
- * not compatible with other ACPI implementations. See acpi_ns_load_table.
- *
- * This function will be removed when the legacy option is removed.
- *
- ******************************************************************************/
-
-static void
-acpi_ps_link_module_code(union acpi_parse_object *parent_op,
-                        u8 *aml_start, u32 aml_length, acpi_owner_id owner_id)
-{
-       union acpi_operand_object *prev;
-       union acpi_operand_object *next;
-       union acpi_operand_object *method_obj;
-       struct acpi_namespace_node *parent_node;
-
-       ACPI_FUNCTION_TRACE(ps_link_module_code);
-
-       /* Get the tail of the list */
-
-       prev = next = acpi_gbl_module_code_list;
-       while (next) {
-               prev = next;
-               next = next->method.mutex;
-       }
-
-       /*
-        * Insert the module level code into the list. Merge it if it is
-        * adjacent to the previous element.
-        */
-       if (!prev ||
-           ((prev->method.aml_start + prev->method.aml_length) != aml_start)) {
-
-               /* Create, initialize, and link a new temporary method object */
-
-               method_obj = acpi_ut_create_internal_object(ACPI_TYPE_METHOD);
-               if (!method_obj) {
-                       return_VOID;
-               }
-
-               ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-                                 "Create/Link new code block: %p\n",
-                                 method_obj));
-
-               if (parent_op->common.node) {
-                       parent_node = parent_op->common.node;
-               } else {
-                       parent_node = acpi_gbl_root_node;
-               }
-
-               method_obj->method.aml_start = aml_start;
-               method_obj->method.aml_length = aml_length;
-               method_obj->method.owner_id = owner_id;
-               method_obj->method.info_flags |= ACPI_METHOD_MODULE_LEVEL;
-
-               /*
-                * Save the parent node in next_object. This is cheating, but we
-                * don't want to expand the method object.
-                */
-               method_obj->method.next_object =
-                   ACPI_CAST_PTR(union acpi_operand_object, parent_node);
-
-               if (!prev) {
-                       acpi_gbl_module_code_list = method_obj;
-               } else {
-                       prev->method.mutex = method_obj;
-               }
-       } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-                                 "Appending to existing code block: %p\n",
-                                 prev));
-
-               prev->method.aml_length += aml_length;
-       }
-
-       return_VOID;
-}
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ps_parse_loop
index e1fd819a2955e8152d4cf3d878823a6fde7d40fb..98e5c7400e547f3eca5f2a875650b0cdbdaf4be9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psobject - Support for parse objects
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 8d7dc98bad17b50d9224e4802ab8f90046250641..43775c5ce17c535c3f2addb89ec5464be18a7a8b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psopcode - Parser/Interpreter opcode information table
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index f310954eea59b01e502933e88451c59c7452304e..15e7563829f160dff12af9edb2307637420b9d91 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psopinfo - AML opcode information functions and dispatch tables
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 65603473b6cb155258ce4979e46f3ee9d2369c34..9b386530ffbec290c0b2b018fba983f3435c0ea2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psparse - Parser top level AML parse routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -523,12 +523,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        if (status == AE_ABORT_METHOD) {
                                acpi_ns_print_node_pathname(walk_state->
                                                            method_node,
-                                                           "Method aborted:");
+                                                           "Aborting method");
                                acpi_os_printf("\n");
                        } else {
-                               ACPI_ERROR_METHOD
-                                   ("Method parse/execution failed",
-                                    walk_state->method_node, NULL, status);
+                               ACPI_ERROR_METHOD("Aborting method",
+                                                 walk_state->method_node, NULL,
+                                                 status);
                        }
                        acpi_ex_enter_interpreter();
 
index 00c67bc249aa0f6f0d5717500644bce0a59fc62b..f153ca804740ee0363915f71aec8705a2c312730 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psscope - Parser scope stack management routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 64a8329a17f1dd8a8ec77cee8e77e851a27e655e..22d8a2becdd008a47036dd5efa44aa4d61149634 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: pstree - Parser op tree manipulation/traversal/search
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ef8a5805a836eb412f1434cea2a9177e0c84861b..2512f584fa3c268620036d46e855edeedd4e20c1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psutils - Parser miscellaneous utilities (Parser only)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index bd6af8c87d48e4446716868044477a07c9909ca7..cf91841297c2649561be04673b80c09d859e2a07 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: pswalk - Parser routines to walk parsed op tree(s)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 5743b22399a0b4f5518d07f3070b7394c906e81a..ee2ee2c858f2eb3735eb136d85cfb225953f56fb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: psxface - Parser external interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 77a3263169fa87205940a8147edff0e8b7347d14..cafa8134b4c6f25970c395887749b0fbbcbea5ac 100644 (file)
@@ -32,7 +32,7 @@ struct acpi_rsdump_info acpi_rs_dump_irq[7] = {
         acpi_gbl_he_decode},
        {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
         acpi_gbl_ll_decode},
-       {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing",
+       {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.shareable), "Sharing",
         acpi_gbl_shr_decode},
        {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count),
         "Interrupt Count", NULL},
@@ -222,7 +222,7 @@ struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = {
         "Triggering", acpi_gbl_he_decode},
        {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity",
         acpi_gbl_ll_decode},
-       {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing",
+       {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(extended_irq.shareable), "Sharing",
         acpi_gbl_shr_decode},
        {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL,
         NULL},
@@ -255,7 +255,7 @@ struct acpi_rsdump_info acpi_rs_dump_gpio[16] = {
         "ProducerConsumer", acpi_gbl_consume_decode},
        {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig",
         acpi_gbl_ppc_decode},
-       {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharing",
+       {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.shareable), "Sharing",
         acpi_gbl_shr_decode},
        {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction),
         "IoRestriction", acpi_gbl_ior_decode},
@@ -285,7 +285,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_function[10] = {
         "RevisionId", NULL},
        {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.pin_config), "PinConfig",
         acpi_gbl_ppc_decode},
-       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_function.sharable), "Sharing",
+       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_function.shareable), "Sharing",
         acpi_gbl_shr_decode},
        {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.function_number),
         "FunctionNumber", NULL},
@@ -308,7 +308,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_config[11] = {
         NULL},
        {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.producer_consumer),
         "ProducerConsumer", acpi_gbl_consume_decode},
-       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.sharable), "Sharing",
+       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.shareable), "Sharing",
         acpi_gbl_shr_decode},
        {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.pin_config_type),
         "PinConfigType", NULL},
@@ -353,7 +353,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_group_function[9] = {
        {ACPI_RSD_1BITFLAG,
         ACPI_RSD_OFFSET(pin_group_function.producer_consumer),
         "ProducerConsumer", acpi_gbl_consume_decode},
-       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_function.sharable),
+       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_function.shareable),
         "Sharing", acpi_gbl_shr_decode},
        {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.function_number),
         "FunctionNumber", NULL},
@@ -375,7 +375,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_group_config[10] = {
         "RevisionId", NULL},
        {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.producer_consumer),
         "ProducerConsumer", acpi_gbl_consume_decode},
-       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.sharable),
+       {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.shareable),
         "Sharing", acpi_gbl_shr_decode},
        {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.pin_config_type),
         "PinConfigType", NULL},
index 134b67cd48ee876689e0b8f381aeedfc2902f069..b0d970efa072229133ee31e8617ecea50687bb50 100644 (file)
@@ -54,7 +54,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[9] = {
         AML_OFFSET(irq.flags),
         3},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.shareable),
         AML_OFFSET(irq.flags),
         4},
 
@@ -92,7 +92,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[14] = {
         AML_OFFSET(irq.flags),
         3},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.shareable),
         AML_OFFSET(irq.flags),
         4},
 
@@ -139,7 +139,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[14] = {
         ACPI_ACTIVE_HIGH},
 
        {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
-        ACPI_RS_OFFSET(data.irq.sharable),
+        ACPI_RS_OFFSET(data.irq.shareable),
         ACPI_EXCLUSIVE},
 
        /* We can optimize to a 2-byte irq_no_flags() descriptor */
@@ -178,7 +178,7 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[10] = {
         AML_OFFSET(extended_irq.flags),
         2},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.shareable),
         AML_OFFSET(extended_irq.flags),
         3},
 
index d073ebb51f90df0ff5415754c021bd668a1d8006..1b937d88980f3bd92bebdccd5a7ef272b26f867b 100644 (file)
@@ -39,7 +39,7 @@ struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = {
         AML_OFFSET(gpio.flags),
         0},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.shareable),
         AML_OFFSET(gpio.int_flags),
         3},
 
@@ -128,7 +128,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_function[13] = {
         AML_OFFSET(pin_function.revision_id),
         1},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.shareable),
         AML_OFFSET(pin_function.flags),
         0},
 
@@ -518,7 +518,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_config[14] = {
         AML_OFFSET(pin_config.revision_id),
         1},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.shareable),
         AML_OFFSET(pin_config.flags),
         0},
 
@@ -658,7 +658,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[13] = {
         AML_OFFSET(pin_group_function.revision_id),
         1},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.shareable),
         AML_OFFSET(pin_group_function.flags),
         0},
 
@@ -735,7 +735,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[14] = {
         AML_OFFSET(pin_group_config.revision_id),
         1},
 
-       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.shareable),
         AML_OFFSET(pin_group_config.flags),
         0},
 
index 862149c8a208e6fdc3be390bdacfa5aefd44b1c0..0cecd0039acffecc89327e0a2357f624dbd8116e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbdata - Table manager data structure functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 99d325a51816a24fef99b661cd9bb584ad64705a..0041bfba9abcfac2bcf280927220198244cde5d1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbfadt   - FADT table utilities
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -556,7 +556,7 @@ static void acpi_tb_convert_fadt(void)
                                 * 64-bit X length field.
                                 * Note: If the legacy length field is > 0xFF bits, ignore
                                 * this check. (GPE registers can be larger than the
-                                * 64-bit GAS structure can accomodate, 0xFF bits).
+                                * 64-bit GAS structure can accommodate, 0xFF bits).
                                 */
                                if ((ACPI_MUL_8(length) <= ACPI_UINT8_MAX) &&
                                    (address64->bit_width !=
index f00694b1d000f4f52209725fc1806a1571867f0d..951bd8e1c50a6668393cbf5f86e9934f86e9d356 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbfind   - find table
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 5f8e7b561c90b3532757fc653a7660ec4faba570..be6642bf6366ea98232d0d060b72c0cfae6a4428 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbinstal - ACPI table installation and removal
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index e303418a895b2b37872fc441a8e11c6c44ac88cb..9b5df95d881b2444830d2652eeac0bc544bfae74 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbprint - Table output utilities
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index b526096560b5199c80b142d99229356c6356e196..2469e01310e25f450584d512ad089b2bf2b6e710 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbutils - ACPI Table utilities
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index e4d0dc8948cd0a6d3b8249c31afb4ea981261897..36592888f0e7405f945020bce6eab4c3a03db5d4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbxface - ACPI table-oriented external interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -108,7 +108,7 @@ acpi_initialize_tables(struct acpi_table_desc *initial_table_array,
        /*
         * Get the root table (RSDT or XSDT) and extract all entries to the local
         * Root Table Array. This array contains the information of the RSDT/XSDT
-        * in a common, more useable format.
+        * in a common, more usable format.
         */
        status = acpi_tb_parse_root_table(rsdp_address);
        return_ACPI_STATUS(status);
@@ -169,7 +169,7 @@ acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void)
        if (!acpi_gbl_enable_table_validation) {
                /*
                 * Now it's safe to do full table validation. We can do deferred
-                * table initilization here once the flag is set.
+                * table initialization here once the flag is set.
                 */
                acpi_gbl_enable_table_validation = TRUE;
                for (i = 0; i < acpi_gbl_root_table_list.current_table_count;
index 9011297552aff6a848abfe55fa5e5dca0b426dba..1a2592cc3245d5a719599eaba47cf1618b6bb2d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbxfload - Table load/unload external interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -69,23 +69,18 @@ acpi_status ACPI_INIT_FUNCTION acpi_load_tables(void)
                                "While loading namespace from ACPI tables"));
        }
 
-       if (acpi_gbl_execute_tables_as_methods) {
-               /*
-                * If the module-level code support is enabled, initialize the objects
-                * in the namespace that remain uninitialized. This runs the executable
-                * AML that may be part of the declaration of these name objects:
-                *     operation_regions, buffer_fields, Buffers, and Packages.
-                *
-                * Note: The module-level code is optional at this time, but will
-                * become the default in the future.
-                */
-               status = acpi_ns_initialize_objects();
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
-               }
+       /*
+        * Initialize the objects in the namespace that remain uninitialized.
+        * This runs the executable AML that may be part of the declaration of
+        * these name objects:
+        *     operation_regions, buffer_fields, Buffers, and Packages.
+        *
+        */
+       status = acpi_ns_initialize_objects();
+       if (ACPI_SUCCESS(status)) {
+               acpi_gbl_namespace_initialized = TRUE;
        }
 
-       acpi_gbl_namespace_initialized = TRUE;
        return_ACPI_STATUS(status);
 }
 
index 483d0ce5180a7d5e91c5d79d6bf40e52c860dbd7..e2859d09ca2e35e490dc820c5b6c4ad91d1f50c7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: tbxfroot - Find the root ACPI table (RSDT)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index dbabe680ff581d34724d7fe97989702ef045ed02..bb260376bd59573b7b7cbe0ba70e2807d10c0fb7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utaddress - op_region address range check
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 8cbcd7d6bd5e1a8d4b37b24d32a2bcf53d8f6632..d64da4d9e8d06225b73344ba1eeffb6db2460354 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utalloc - local memory allocation routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 04ff61e284f5184a99cd59922bd50255f65ef5c7..79d7426fd7bfbbeb1444f0a3df7319317218b5e3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utascii - Utility ascii functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index fffa6f5ae59e8152e898a61b2e28daca8f0f88d3..61db9967ebe4c461754ac926974195f7cbbcae4b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utbuffer - Buffer dump routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 97d6ec174c28a4b313663f4184e27b54f3366fb1..8533fce7fa937fbfd76ebbe800a53477e4be1b17 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utcache - local cache allocation routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index a872ed7879ca7a938d6ea0ea86fd512cabb381da..1fb8327f3c3be0853cb23a8860a0d974193025e9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utcopy - Internal to external object translation utilities
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index aabdc25effd9881cf68a38ef76a6edd7a74c062f..01b1b36c8a8e2ac5798a633b2da1cd53d283e9d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utdebug - Debug print/trace routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index dad02b821e197d99415f8f117beb18490635f4af..ad9f77eb554ffc7c55af007e75592091d7827c4e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utdecode - Utility decoding routines (value-to-string)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -284,7 +284,7 @@ const char *acpi_ut_get_node_name(void *object)
 
 static const char *acpi_gbl_desc_type_names[] = {
        /* 00 */ "Not a Descriptor",
-       /* 01 */ "Cached",
+       /* 01 */ "Cached Object",
        /* 02 */ "State-Generic",
        /* 03 */ "State-Update",
        /* 04 */ "State-Package",
@@ -295,10 +295,10 @@ static const char *acpi_gbl_desc_type_names[] = {
        /* 09 */ "State-Result",
        /* 10 */ "State-Notify",
        /* 11 */ "State-Thread",
-       /* 12 */ "Walk",
-       /* 13 */ "Parser",
-       /* 14 */ "Operand",
-       /* 15 */ "Node"
+       /* 12 */ "Tree Walk State",
+       /* 13 */ "Parse Tree Op",
+       /* 14 */ "Operand Object",
+       /* 15 */ "Namespace Node"
 };
 
 const char *acpi_ut_get_descriptor_name(void *object)
@@ -430,8 +430,10 @@ static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = {
                                                                /* 0C */ "Reserved (was previously Shutdown Request)",
                                                                /* Reserved in ACPI 6.0 */
        /* 0D */ "System Resource Affinity Update",
-                                                               /* 0E */ "Heterogeneous Memory Attributes Update"
+                                                               /* 0E */ "Heterogeneous Memory Attributes Update",
                                                                /* ACPI 6.2 */
+                                               /* 0F */ "Error Disconnect Recover"
+                                               /* ACPI 6.3 */
 };
 
 static const char *acpi_gbl_device_notify[5] = {
@@ -461,13 +463,13 @@ static const char *acpi_gbl_thermal_notify[5] = {
 const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
 {
 
-       /* 00 - 0D are "common to all object types" (from ACPI Spec) */
+       /* 00 - 0F are "common to all object types" (from ACPI Spec) */
 
        if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
                return (acpi_gbl_generic_notify[notify_value]);
        }
 
-       /* 0E - 7F are reserved */
+       /* 10 - 7F are reserved */
 
        if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
                return ("Reserved");
index 8cc4392c61f33aea636251426e263b7017613498..eee263cb7beb00989e79c4abd662c3bc7a90f3a0 100644 (file)
@@ -257,6 +257,10 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
 
                        acpi_ut_delete_object_desc(second_desc);
                }
+               if (object->field.internal_pcc_buffer) {
+                       ACPI_FREE(object->field.internal_pcc_buffer);
+               }
+
                break;
 
        case ACPI_TYPE_BUFFER_FIELD:
index e474302726926dd0c997c9432da0f9488af65011..075457341bad19bd8c7a4b2a251533e536dda003 100644 (file)
@@ -183,19 +183,19 @@ acpi_ut_prefixed_namespace_error(const char *module_name,
        case AE_ALREADY_EXISTS:
 
                acpi_os_printf(ACPI_MSG_BIOS_ERROR);
-               message = "Failure creating";
+               message = "Failure creating named object";
                break;
 
        case AE_NOT_FOUND:
 
                acpi_os_printf(ACPI_MSG_BIOS_ERROR);
-               message = "Could not resolve";
+               message = "Could not resolve symbol";
                break;
 
        default:
 
                acpi_os_printf(ACPI_MSG_ERROR);
-               message = "Failure resolving";
+               message = "Failure resolving symbol";
                break;
        }
 
@@ -317,7 +317,8 @@ acpi_ut_method_error(const char *module_name,
        }
 
        acpi_ns_print_node_pathname(node, message);
-       acpi_os_printf(", %s", acpi_format_exception(method_status));
+       acpi_os_printf(" due to previous error (%s)",
+                      acpi_format_exception(method_status));
 
        ACPI_MSG_SUFFIX;
        ACPI_MSG_REDIRECT_END;
index c56ae6e058d5426531457874d53a12f053a28fc1..558a9f3b0678228a0e7431ef9410b8b8efa281af 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: uteval - Object evaluation
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index f8c5b49344dfab484e6ec9c0fe3e0012ec2e95d2..b0622ec4bb85edfc5fb8aa70b25f189fbae7b96b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utglobal - Global variables for the ACPI subsystem
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 3d63a9e8da4f3c1e7d0796cb4eefef7ab2e1f08e..b6da135d5f41a8b9c1d15e676bff312662853c02 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: uthex -- Hex/ASCII support functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 70e6bf1107a1909b662b08459defcf071233d390..e805abdd95b8281eea2e3d9161c6d7f64e720a79 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utids - support for device Ids - HID, UID, CID, SUB, CLS
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 0646ed62b35193f90d37c39f51175a8dd7aec041..bc124591320e920ccdf004382a6fa8e4251eda24 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utinit - Common ACPI subsystem initialization
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index d61e01bd01a35d21789f0f81535b2090b83988ba..8b4ff11d617abf91a01244ce63392f8346f6f3a2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utlock - Reader/Writer lock interfaces
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index ae6d8cc18cec790c0112f4e311c0e45c67445428..eee97a9026964c2f748ad418ec7f3f9ecf4e3c40 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utobject - ACPI object create/delete/size/cache routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 902a47463abf992b249ee81e33af0145b5ddc3de..688c61a90725a51635f6cd8998ade2c48736205e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utosi - Support for the _OSI predefined control method
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 65ca9807c2a8b78b1ba8e7f190fcfb42612a3a83..a9f08f43c68518b7f10b5238c2cc603c9a4b0bf4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utpredef - support functions for predefined names
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index a98c334c3bb7585f80851d7b61aba2fada13ae54..5839f2fa7400e19ead38b6f7d1eb23387bffe7fe 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utprint - Formatted printing routines
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 016a6621cc6faca0bbe56665bdef358a2bcbc8b9..8052f7ef5025cfd538fd019d4e736f605238e646 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: uttrack - Memory allocation tracking routines (debug only)
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
@@ -588,6 +588,18 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
                                             acpi_ut_get_descriptor_name
                                             (descriptor));
 
+                                       /* Optional object hex dump */
+
+                                       if (acpi_gbl_verbose_leak_dump) {
+                                               acpi_os_printf("\n");
+                                               acpi_ut_dump_buffer((u8 *)
+                                                                   descriptor,
+                                                                   element->
+                                                                   size,
+                                                                   DB_BYTE_DISPLAY,
+                                                                   0);
+                                       }
+
                                        /* Validate the descriptor type using Type field and length */
 
                                        descriptor_type = 0;    /* Not a valid descriptor type */
index 59ae118092a34cad818e71f201deba088e6363f7..0a7cf800764313cf508c19e25ac00b5a3c2ac9dd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utuuid -- UUID support functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index d2d6cc0651817ee96ac637c007260c1cad79bbb9..f497c4b30e6539c0a83d39c335598f7b6c50de89 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utxface - External interfaces, miscellaneous utility functions
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 6bb85d691fcba1f8514b814831c6fac6a5134a9d..a1ed7fced4db91b7161aee136965996437372f9b 100644 (file)
@@ -185,6 +185,50 @@ acpi_bios_error(const char *module_name,
 
 ACPI_EXPORT_SYMBOL(acpi_bios_error)
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_bios_exception
+ *
+ * PARAMETERS:  module_name         - Caller's module name (for error output)
+ *              line_number         - Caller's line number (for error output)
+ *              status              - Status value to be decoded/formatted
+ *              format              - Printf format string + additional args
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Print an "ACPI Firmware Error" message with module/line/version
+ *              info as well as decoded acpi_status.
+ *
+ ******************************************************************************/
+void ACPI_INTERNAL_VAR_XFACE
+acpi_bios_exception(const char *module_name,
+                   u32 line_number,
+                   acpi_status status, const char *format, ...)
+{
+       va_list arg_list;
+
+       ACPI_MSG_REDIRECT_BEGIN;
+
+       /* For AE_OK, just print the message */
+
+       if (ACPI_SUCCESS(status)) {
+               acpi_os_printf(ACPI_MSG_BIOS_ERROR);
+
+       } else {
+               acpi_os_printf(ACPI_MSG_BIOS_ERROR "%s, ",
+                              acpi_format_exception(status));
+       }
+
+       va_start(arg_list, format);
+       acpi_os_vprintf(format, arg_list);
+       ACPI_MSG_SUFFIX;
+       va_end(arg_list);
+
+       ACPI_MSG_REDIRECT_END;
+}
+
+ACPI_EXPORT_SYMBOL(acpi_bios_exception)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_bios_warning
index e3c60f57c9f0d06762b6813448082289fe7a4a60..9f3b1e3a09de38815e7af3f24d2fee442def8928 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Module Name: utxfinit - External interfaces for ACPICA initialization
  *
- * Copyright (C) 2000 - 2018, Intel Corp.
+ * Copyright (C) 2000 - 2019, Intel Corp.
  *
  *****************************************************************************/
 
index 52ae5438edeb95b786ebccbcf2310fe5521870ed..6b18f8bc7be353403873df2c11ca0b72ef256eb6 100644 (file)
@@ -41,19 +41,9 @@ config ACPI_APEI_PCIEAER
          Turn on this option to enable the corresponding support.
 
 config ACPI_APEI_SEA
-       bool "APEI Synchronous External Abort logging/recovering support"
+       bool
        depends on ARM64 && ACPI_APEI_GHES
        default y
-       help
-         This option should be enabled if the system supports
-         firmware first handling of SEA (Synchronous External Abort).
-         SEA happens with certain faults of data abort or instruction
-         abort synchronous exceptions on ARMv8 systems. If a system
-         supports firmware first handling of SEA, the platform analyzes
-         and handles hardware error notifications from SEA, and it may then
-         form a HW error record for the OS to parse and handle. This
-         option allows the OS to look for such hardware error record, and
-         take appropriate action.
 
 config ACPI_APEI_MEMORY_FAILURE
        bool "APEI memory error recovering support"
index 12771fcf0417df30ed36ddceed49bea7532b9d8e..0d948d0a41afac8e1ad4c29c8b63296a382bea2d 100644 (file)
@@ -42,15 +42,7 @@ static void __init bert_print_all(struct acpi_bert_region *region,
        int remain = region_len;
        u32 estatus_len;
 
-       if (!estatus->block_status)
-               return;
-
-       while (remain > sizeof(struct acpi_bert_region)) {
-               if (cper_estatus_check(estatus)) {
-                       pr_err(FW_BUG "Invalid error record.\n");
-                       return;
-               }
-
+       while (remain >= sizeof(struct acpi_bert_region)) {
                estatus_len = cper_estatus_len(estatus);
                if (remain < estatus_len) {
                        pr_err(FW_BUG "Truncated status block (length: %u).\n",
@@ -58,6 +50,15 @@ static void __init bert_print_all(struct acpi_bert_region *region,
                        return;
                }
 
+               /* No more error records. */
+               if (!estatus->block_status)
+                       return;
+
+               if (cper_estatus_check(estatus)) {
+                       pr_err(FW_BUG "Invalid error record.\n");
+                       return;
+               }
+
                pr_info_once("Error records from previous boot:\n");
 
                cper_estatus_print(KERN_INFO HW_ERR, estatus);
@@ -70,10 +71,6 @@ static void __init bert_print_all(struct acpi_bert_region *region,
                estatus->block_status = 0;
 
                estatus = (void *)estatus + estatus_len;
-               /* No more error records. */
-               if (!estatus->block_status)
-                       return;
-
                remain -= estatus_len;
        }
 }
index fcccbfdbdd1af35956bb86fc4753bb71a1ff8f54..2d4be94f8c00306d2fdeedf0a36314ff6b0310c2 100644 (file)
@@ -644,8 +644,8 @@ static int error_type_set(void *data, u64 val)
        return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(error_type_fops, error_type_get,
-                       error_type_set, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(error_type_fops, error_type_get, error_type_set,
+                        "0x%llx\n");
 
 static int error_inject_set(void *data, u64 val)
 {
@@ -656,8 +656,7 @@ static int error_inject_set(void *data, u64 val)
                error_param3, error_param4);
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL,
-                       error_inject_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(error_inject_fops, NULL, error_inject_set, "%llu\n");
 
 static int einj_check_table(struct acpi_table_einj *einj_tab)
 {
@@ -679,7 +678,6 @@ static int __init einj_init(void)
 {
        int rc;
        acpi_status status;
-       struct dentry *fentry;
        struct apei_exec_context ctx;
 
        if (acpi_disabled) {
@@ -707,25 +705,13 @@ static int __init einj_init(void)
 
        rc = -ENOMEM;
        einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir());
-       if (!einj_debug_dir) {
-               pr_err("Error creating debugfs node.\n");
-               goto err_cleanup;
-       }
 
-       fentry = debugfs_create_file("available_error_type", S_IRUSR,
-                                    einj_debug_dir, NULL,
-                                    &available_error_type_fops);
-       if (!fentry)
-               goto err_cleanup;
-
-       fentry = debugfs_create_file("error_type", S_IRUSR | S_IWUSR,
-                                    einj_debug_dir, NULL, &error_type_fops);
-       if (!fentry)
-               goto err_cleanup;
-       fentry = debugfs_create_file("error_inject", S_IWUSR,
-                                    einj_debug_dir, NULL, &error_inject_fops);
-       if (!fentry)
-               goto err_cleanup;
+       debugfs_create_file("available_error_type", S_IRUSR, einj_debug_dir,
+                           NULL, &available_error_type_fops);
+       debugfs_create_file_unsafe("error_type", 0600, einj_debug_dir,
+                                  NULL, &error_type_fops);
+       debugfs_create_file_unsafe("error_inject", 0200, einj_debug_dir,
+                                  NULL, &error_inject_fops);
 
        apei_resources_init(&einj_resources);
        einj_exec_ctx_init(&ctx);
@@ -750,66 +736,37 @@ static int __init einj_init(void)
        rc = -ENOMEM;
        einj_param = einj_get_parameter_address();
        if ((param_extension || acpi5) && einj_param) {
-               fentry = debugfs_create_x32("flags", S_IRUSR | S_IWUSR,
-                                           einj_debug_dir, &error_flags);
-               if (!fentry)
-                       goto err_unmap;
-               fentry = debugfs_create_x64("param1", S_IRUSR | S_IWUSR,
-                                           einj_debug_dir, &error_param1);
-               if (!fentry)
-                       goto err_unmap;
-               fentry = debugfs_create_x64("param2", S_IRUSR | S_IWUSR,
-                                           einj_debug_dir, &error_param2);
-               if (!fentry)
-                       goto err_unmap;
-               fentry = debugfs_create_x64("param3", S_IRUSR | S_IWUSR,
-                                           einj_debug_dir, &error_param3);
-               if (!fentry)
-                       goto err_unmap;
-               fentry = debugfs_create_x64("param4", S_IRUSR | S_IWUSR,
-                                           einj_debug_dir, &error_param4);
-               if (!fentry)
-                       goto err_unmap;
-
-               fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
-                                           einj_debug_dir, &notrigger);
-               if (!fentry)
-                       goto err_unmap;
+               debugfs_create_x32("flags", S_IRUSR | S_IWUSR, einj_debug_dir,
+                                  &error_flags);
+               debugfs_create_x64("param1", S_IRUSR | S_IWUSR, einj_debug_dir,
+                                  &error_param1);
+               debugfs_create_x64("param2", S_IRUSR | S_IWUSR, einj_debug_dir,
+                                  &error_param2);
+               debugfs_create_x64("param3", S_IRUSR | S_IWUSR, einj_debug_dir,
+                                  &error_param3);
+               debugfs_create_x64("param4", S_IRUSR | S_IWUSR, einj_debug_dir,
+                                  &error_param4);
+               debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
+                                  einj_debug_dir, &notrigger);
        }
 
        if (vendor_dev[0]) {
                vendor_blob.data = vendor_dev;
                vendor_blob.size = strlen(vendor_dev);
-               fentry = debugfs_create_blob("vendor", S_IRUSR,
-                                            einj_debug_dir, &vendor_blob);
-               if (!fentry)
-                       goto err_unmap;
-               fentry = debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
-                                           einj_debug_dir, &vendor_flags);
-               if (!fentry)
-                       goto err_unmap;
+               debugfs_create_blob("vendor", S_IRUSR, einj_debug_dir,
+                                   &vendor_blob);
+               debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
+                                  einj_debug_dir, &vendor_flags);
        }
 
        pr_info("Error INJection is initialized.\n");
 
        return 0;
 
-err_unmap:
-       if (einj_param) {
-               acpi_size size = (acpi5) ?
-                       sizeof(struct set_error_type_with_address) :
-                       sizeof(struct einj_parameter);
-
-               acpi_os_unmap_iomem(einj_param, size);
-               pr_err("Error creating param extension debugfs nodes.\n");
-       }
-       apei_exec_post_unmap_gars(&ctx);
 err_release:
        apei_resources_release(&einj_resources);
 err_fini:
        apei_resources_fini(&einj_resources);
-err_cleanup:
-       pr_err("Error creating primary debugfs nodes.\n");
        debugfs_remove_recursive(einj_debug_dir);
 
        return rc;
index 9953e50667ec17e95752baf99def02193694bfc4..389d88e35ffba87f3726a727efa1bc8e59a5f5a1 100644 (file)
@@ -938,17 +938,17 @@ static struct pstore_info erst_info = {
 };
 
 #define CPER_CREATOR_PSTORE                                            \
-       UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,     \
-               0x64, 0x90, 0xb8, 0x9d)
+       GUID_INIT(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,   \
+                 0x64, 0x90, 0xb8, 0x9d)
 #define CPER_SECTION_TYPE_DMESG                                                \
-       UUID_LE(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54,     \
-               0x94, 0x19, 0xeb, 0x12)
+       GUID_INIT(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54,   \
+                 0x94, 0x19, 0xeb, 0x12)
 #define CPER_SECTION_TYPE_DMESG_Z                                      \
-       UUID_LE(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d,     \
-               0x34, 0xdd, 0xfa, 0xc6)
+       GUID_INIT(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d,   \
+                 0x34, 0xdd, 0xfa, 0xc6)
 #define CPER_SECTION_TYPE_MCE                                          \
-       UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,     \
-               0x04, 0x4a, 0x38, 0xfc)
+       GUID_INIT(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,   \
+                 0x04, 0x4a, 0x38, 0xfc)
 
 struct cper_pstore_record {
        struct cper_record_header hdr;
@@ -1012,7 +1012,7 @@ skip:
                rc = -EIO;
                goto out;
        }
-       if (uuid_le_cmp(rcd->hdr.creator_id, CPER_CREATOR_PSTORE) != 0)
+       if (!guid_equal(&rcd->hdr.creator_id, &CPER_CREATOR_PSTORE))
                goto skip;
 
        record->buf = kmalloc(len, GFP_KERNEL);
@@ -1024,15 +1024,12 @@ skip:
        record->id = record_id;
        record->compressed = false;
        record->ecc_notice_size = 0;
-       if (uuid_le_cmp(rcd->sec_hdr.section_type,
-                       CPER_SECTION_TYPE_DMESG_Z) == 0) {
+       if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG_Z)) {
                record->type = PSTORE_TYPE_DMESG;
                record->compressed = true;
-       } else if (uuid_le_cmp(rcd->sec_hdr.section_type,
-                       CPER_SECTION_TYPE_DMESG) == 0)
+       } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG))
                record->type = PSTORE_TYPE_DMESG;
-       else if (uuid_le_cmp(rcd->sec_hdr.section_type,
-                            CPER_SECTION_TYPE_MCE) == 0)
+       else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE))
                record->type = PSTORE_TYPE_MCE;
        else
                record->type = PSTORE_TYPE_MAX;
index f008ba7c9cedc952852ca1550b0c58a7fece1529..0b5ae91fd0fb5469cabd2d7cf54a6129b2e1b501 100644 (file)
@@ -25,6 +25,7 @@
  * GNU General Public License for more details.
  */
 
+#include <linux/arm_sdei.h>
 #include <linux/kernel.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -33,7 +34,6 @@
 #include <linux/interrupt.h>
 #include <linux/timer.h>
 #include <linux/cper.h>
-#include <linux/kdebug.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
 #include <linux/ratelimit.h>
@@ -42,6 +42,7 @@
 #include <linux/llist.h>
 #include <linux/genalloc.h>
 #include <linux/pci.h>
+#include <linux/pfn.h>
 #include <linux/aer.h>
 #include <linux/nmi.h>
 #include <linux/sched/clock.h>
        ((struct acpi_hest_generic_status *)                            \
         ((struct ghes_estatus_node *)(estatus_node) + 1))
 
+/*
+ *  NMI-like notifications vary by architecture, before the compiler can prune
+ *  unused static functions it needs a value for these enums.
+ */
+#ifndef CONFIG_ARM_SDE_INTERFACE
+#define FIX_APEI_GHES_SDEI_NORMAL      __end_of_fixed_addresses
+#define FIX_APEI_GHES_SDEI_CRITICAL    __end_of_fixed_addresses
+#endif
+
 static inline bool is_hest_type_generic_v2(struct ghes *ghes)
 {
        return ghes->generic->header.type == ACPI_HEST_TYPE_GENERIC_ERROR_V2;
@@ -115,11 +125,10 @@ static DEFINE_MUTEX(ghes_list_mutex);
  * handler, but general ioremap can not be used in atomic context, so
  * the fixmap is used instead.
  *
- * These 2 spinlocks are used to prevent the fixmap entries from being used
+ * This spinlock is used to prevent the fixmap entry from being used
  * simultaneously.
  */
-static DEFINE_RAW_SPINLOCK(ghes_ioremap_lock_nmi);
-static DEFINE_SPINLOCK(ghes_ioremap_lock_irq);
+static DEFINE_SPINLOCK(ghes_notify_lock_irq);
 
 static struct gen_pool *ghes_estatus_pool;
 static unsigned long ghes_estatus_pool_size_request;
@@ -129,82 +138,49 @@ static atomic_t ghes_estatus_cache_alloced;
 
 static int ghes_panic_timeout __read_mostly = 30;
 
-static void __iomem *ghes_ioremap_pfn_nmi(u64 pfn)
+static void __iomem *ghes_map(u64 pfn, enum fixed_addresses fixmap_idx)
 {
        phys_addr_t paddr;
        pgprot_t prot;
 
-       paddr = pfn << PAGE_SHIFT;
+       paddr = PFN_PHYS(pfn);
        prot = arch_apei_get_mem_attribute(paddr);
-       __set_fixmap(FIX_APEI_GHES_NMI, paddr, prot);
+       __set_fixmap(fixmap_idx, paddr, prot);
 
-       return (void __iomem *) fix_to_virt(FIX_APEI_GHES_NMI);
+       return (void __iomem *) __fix_to_virt(fixmap_idx);
 }
 
-static void __iomem *ghes_ioremap_pfn_irq(u64 pfn)
+static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx)
 {
-       phys_addr_t paddr;
-       pgprot_t prot;
-
-       paddr = pfn << PAGE_SHIFT;
-       prot = arch_apei_get_mem_attribute(paddr);
-       __set_fixmap(FIX_APEI_GHES_IRQ, paddr, prot);
-
-       return (void __iomem *) fix_to_virt(FIX_APEI_GHES_IRQ);
-}
+       int _idx = virt_to_fix((unsigned long)vaddr);
 
-static void ghes_iounmap_nmi(void)
-{
-       clear_fixmap(FIX_APEI_GHES_NMI);
+       WARN_ON_ONCE(fixmap_idx != _idx);
+       clear_fixmap(fixmap_idx);
 }
 
-static void ghes_iounmap_irq(void)
+int ghes_estatus_pool_init(int num_ghes)
 {
-       clear_fixmap(FIX_APEI_GHES_IRQ);
-}
+       unsigned long addr, len;
 
-static int ghes_estatus_pool_init(void)
-{
        ghes_estatus_pool = gen_pool_create(GHES_ESTATUS_POOL_MIN_ALLOC_ORDER, -1);
        if (!ghes_estatus_pool)
                return -ENOMEM;
-       return 0;
-}
 
-static void ghes_estatus_pool_free_chunk_page(struct gen_pool *pool,
-                                             struct gen_pool_chunk *chunk,
-                                             void *data)
-{
-       free_page(chunk->start_addr);
-}
-
-static void ghes_estatus_pool_exit(void)
-{
-       gen_pool_for_each_chunk(ghes_estatus_pool,
-                               ghes_estatus_pool_free_chunk_page, NULL);
-       gen_pool_destroy(ghes_estatus_pool);
-}
+       len = GHES_ESTATUS_CACHE_AVG_SIZE * GHES_ESTATUS_CACHE_ALLOCED_MAX;
+       len += (num_ghes * GHES_ESOURCE_PREALLOC_MAX_SIZE);
 
-static int ghes_estatus_pool_expand(unsigned long len)
-{
-       unsigned long i, pages, size, addr;
-       int ret;
+       ghes_estatus_pool_size_request = PAGE_ALIGN(len);
+       addr = (unsigned long)vmalloc(PAGE_ALIGN(len));
+       if (!addr)
+               return -ENOMEM;
 
-       ghes_estatus_pool_size_request += PAGE_ALIGN(len);
-       size = gen_pool_size(ghes_estatus_pool);
-       if (size >= ghes_estatus_pool_size_request)
-               return 0;
-       pages = (ghes_estatus_pool_size_request - size) / PAGE_SIZE;
-       for (i = 0; i < pages; i++) {
-               addr = __get_free_page(GFP_KERNEL);
-               if (!addr)
-                       return -ENOMEM;
-               ret = gen_pool_add(ghes_estatus_pool, addr, PAGE_SIZE, -1);
-               if (ret)
-                       return ret;
-       }
+       /*
+        * New allocation must be visible in all pgd before it can be found by
+        * an NMI allocating from the pool.
+        */
+       vmalloc_sync_all();
 
-       return 0;
+       return gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
 }
 
 static int map_gen_v2(struct ghes *ghes)
@@ -217,6 +193,21 @@ static void unmap_gen_v2(struct ghes *ghes)
        apei_unmap_generic_address(&ghes->generic_v2->read_ack_register);
 }
 
+static void ghes_ack_error(struct acpi_hest_generic_v2 *gv2)
+{
+       int rc;
+       u64 val = 0;
+
+       rc = apei_read(&val, &gv2->read_ack_register);
+       if (rc)
+               return;
+
+       val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
+       val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
+
+       apei_write(val, &gv2->read_ack_register);
+}
+
 static struct ghes *ghes_new(struct acpi_hest_generic *generic)
 {
        struct ghes *ghes;
@@ -289,23 +280,16 @@ static inline int ghes_severity(int severity)
 }
 
 static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
-                                 int from_phys)
+                                 int from_phys,
+                                 enum fixed_addresses fixmap_idx)
 {
        void __iomem *vaddr;
-       unsigned long flags = 0;
-       int in_nmi = in_nmi();
        u64 offset;
        u32 trunk;
 
        while (len > 0) {
                offset = paddr - (paddr & PAGE_MASK);
-               if (in_nmi) {
-                       raw_spin_lock(&ghes_ioremap_lock_nmi);
-                       vaddr = ghes_ioremap_pfn_nmi(paddr >> PAGE_SHIFT);
-               } else {
-                       spin_lock_irqsave(&ghes_ioremap_lock_irq, flags);
-                       vaddr = ghes_ioremap_pfn_irq(paddr >> PAGE_SHIFT);
-               }
+               vaddr = ghes_map(PHYS_PFN(paddr), fixmap_idx);
                trunk = PAGE_SIZE - offset;
                trunk = min(trunk, len);
                if (from_phys)
@@ -315,72 +299,114 @@ static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
                len -= trunk;
                paddr += trunk;
                buffer += trunk;
-               if (in_nmi) {
-                       ghes_iounmap_nmi();
-                       raw_spin_unlock(&ghes_ioremap_lock_nmi);
-               } else {
-                       ghes_iounmap_irq();
-                       spin_unlock_irqrestore(&ghes_ioremap_lock_irq, flags);
-               }
+               ghes_unmap(vaddr, fixmap_idx);
+       }
+}
+
+/* Check the top-level record header has an appropriate size. */
+static int __ghes_check_estatus(struct ghes *ghes,
+                               struct acpi_hest_generic_status *estatus)
+{
+       u32 len = cper_estatus_len(estatus);
+
+       if (len < sizeof(*estatus)) {
+               pr_warn_ratelimited(FW_WARN GHES_PFX "Truncated error status block!\n");
+               return -EIO;
+       }
+
+       if (len > ghes->generic->error_block_length) {
+               pr_warn_ratelimited(FW_WARN GHES_PFX "Invalid error status block length!\n");
+               return -EIO;
+       }
+
+       if (cper_estatus_check_header(estatus)) {
+               pr_warn_ratelimited(FW_WARN GHES_PFX "Invalid CPER header!\n");
+               return -EIO;
        }
+
+       return 0;
 }
 
-static int ghes_read_estatus(struct ghes *ghes, int silent)
+/* Read the CPER block, returning its address, and header in estatus. */
+static int __ghes_peek_estatus(struct ghes *ghes,
+                              struct acpi_hest_generic_status *estatus,
+                              u64 *buf_paddr, enum fixed_addresses fixmap_idx)
 {
        struct acpi_hest_generic *g = ghes->generic;
-       u64 buf_paddr;
-       u32 len;
        int rc;
 
-       rc = apei_read(&buf_paddr, &g->error_status_address);
+       rc = apei_read(buf_paddr, &g->error_status_address);
        if (rc) {
-               if (!silent && printk_ratelimit())
-                       pr_warning(FW_WARN GHES_PFX
+               *buf_paddr = 0;
+               pr_warn_ratelimited(FW_WARN GHES_PFX
 "Failed to read error status block address for hardware error source: %d.\n",
                                   g->header.source_id);
                return -EIO;
        }
-       if (!buf_paddr)
+       if (!*buf_paddr)
                return -ENOENT;
 
-       ghes_copy_tofrom_phys(ghes->estatus, buf_paddr,
-                             sizeof(*ghes->estatus), 1);
-       if (!ghes->estatus->block_status)
+       ghes_copy_tofrom_phys(estatus, *buf_paddr, sizeof(*estatus), 1,
+                             fixmap_idx);
+       if (!estatus->block_status) {
+               *buf_paddr = 0;
                return -ENOENT;
+       }
 
-       ghes->buffer_paddr = buf_paddr;
-       ghes->flags |= GHES_TO_CLEAR;
+       return __ghes_check_estatus(ghes, estatus);
+}
 
-       rc = -EIO;
-       len = cper_estatus_len(ghes->estatus);
-       if (len < sizeof(*ghes->estatus))
-               goto err_read_block;
-       if (len > ghes->generic->error_block_length)
-               goto err_read_block;
-       if (cper_estatus_check_header(ghes->estatus))
-               goto err_read_block;
-       ghes_copy_tofrom_phys(ghes->estatus + 1,
-                             buf_paddr + sizeof(*ghes->estatus),
-                             len - sizeof(*ghes->estatus), 1);
-       if (cper_estatus_check(ghes->estatus))
-               goto err_read_block;
-       rc = 0;
-
-err_read_block:
-       if (rc && !silent && printk_ratelimit())
-               pr_warning(FW_WARN GHES_PFX
-                          "Failed to read error status block!\n");
-       return rc;
+static int __ghes_read_estatus(struct acpi_hest_generic_status *estatus,
+                              u64 buf_paddr, enum fixed_addresses fixmap_idx,
+                              size_t buf_len)
+{
+       ghes_copy_tofrom_phys(estatus, buf_paddr, buf_len, 1, fixmap_idx);
+       if (cper_estatus_check(estatus)) {
+               pr_warn_ratelimited(FW_WARN GHES_PFX
+                                   "Failed to read error status block!\n");
+               return -EIO;
+       }
+
+       return 0;
 }
 
-static void ghes_clear_estatus(struct ghes *ghes)
+static int ghes_read_estatus(struct ghes *ghes,
+                            struct acpi_hest_generic_status *estatus,
+                            u64 *buf_paddr, enum fixed_addresses fixmap_idx)
 {
-       ghes->estatus->block_status = 0;
-       if (!(ghes->flags & GHES_TO_CLEAR))
+       int rc;
+
+       rc = __ghes_peek_estatus(ghes, estatus, buf_paddr, fixmap_idx);
+       if (rc)
+               return rc;
+
+       rc = __ghes_check_estatus(ghes, estatus);
+       if (rc)
+               return rc;
+
+       return __ghes_read_estatus(estatus, *buf_paddr, fixmap_idx,
+                                  cper_estatus_len(estatus));
+}
+
+static void ghes_clear_estatus(struct ghes *ghes,
+                              struct acpi_hest_generic_status *estatus,
+                              u64 buf_paddr, enum fixed_addresses fixmap_idx)
+{
+       estatus->block_status = 0;
+
+       if (!buf_paddr)
                return;
-       ghes_copy_tofrom_phys(ghes->estatus, ghes->buffer_paddr,
-                             sizeof(ghes->estatus->block_status), 0);
-       ghes->flags &= ~GHES_TO_CLEAR;
+
+       ghes_copy_tofrom_phys(estatus, buf_paddr,
+                             sizeof(estatus->block_status), 0,
+                             fixmap_idx);
+
+       /*
+        * GHESv2 type HEST entries introduce support for error acknowledgment,
+        * so only acknowledge the error if this support is present.
+        */
+       if (is_hest_type_generic_v2(ghes))
+               ghes_ack_error(ghes->generic_v2);
 }
 
 static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int sev)
@@ -672,26 +698,13 @@ static void ghes_estatus_cache_add(
        rcu_read_unlock();
 }
 
-static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2)
+static void __ghes_panic(struct ghes *ghes,
+                        struct acpi_hest_generic_status *estatus,
+                        u64 buf_paddr, enum fixed_addresses fixmap_idx)
 {
-       int rc;
-       u64 val = 0;
+       __ghes_print_estatus(KERN_EMERG, ghes->generic, estatus);
 
-       rc = apei_read(&val, &gv2->read_ack_register);
-       if (rc)
-               return rc;
-
-       val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
-       val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
-
-       return apei_write(val, &gv2->read_ack_register);
-}
-
-static void __ghes_panic(struct ghes *ghes)
-{
-       __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
-
-       ghes_clear_estatus(ghes);
+       ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
 
        /* reboot to log the error! */
        if (!panic_timeout)
@@ -701,34 +714,25 @@ static void __ghes_panic(struct ghes *ghes)
 
 static int ghes_proc(struct ghes *ghes)
 {
+       struct acpi_hest_generic_status *estatus = ghes->estatus;
+       u64 buf_paddr;
        int rc;
 
-       rc = ghes_read_estatus(ghes, 0);
+       rc = ghes_read_estatus(ghes, estatus, &buf_paddr, FIX_APEI_GHES_IRQ);
        if (rc)
                goto out;
 
-       if (ghes_severity(ghes->estatus->error_severity) >= GHES_SEV_PANIC) {
-               __ghes_panic(ghes);
-       }
+       if (ghes_severity(estatus->error_severity) >= GHES_SEV_PANIC)
+               __ghes_panic(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ);
 
-       if (!ghes_estatus_cached(ghes->estatus)) {
-               if (ghes_print_estatus(NULL, ghes->generic, ghes->estatus))
-                       ghes_estatus_cache_add(ghes->generic, ghes->estatus);
+       if (!ghes_estatus_cached(estatus)) {
+               if (ghes_print_estatus(NULL, ghes->generic, estatus))
+                       ghes_estatus_cache_add(ghes->generic, estatus);
        }
-       ghes_do_proc(ghes, ghes->estatus);
+       ghes_do_proc(ghes, estatus);
 
 out:
-       ghes_clear_estatus(ghes);
-
-       if (rc == -ENOENT)
-               return rc;
-
-       /*
-        * GHESv2 type HEST entries introduce support for error acknowledgment,
-        * so only acknowledge the error if this support is present.
-        */
-       if (is_hest_type_generic_v2(ghes))
-               return ghes_ack_error(ghes->generic_v2);
+       ghes_clear_estatus(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ);
 
        return rc;
 }
@@ -751,8 +755,11 @@ static void ghes_add_timer(struct ghes *ghes)
 static void ghes_poll_func(struct timer_list *t)
 {
        struct ghes *ghes = from_timer(ghes, t, timer);
+       unsigned long flags;
 
+       spin_lock_irqsave(&ghes_notify_lock_irq, flags);
        ghes_proc(ghes);
+       spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
        if (!(ghes->flags & GHES_EXITING))
                ghes_add_timer(ghes);
 }
@@ -760,9 +767,12 @@ static void ghes_poll_func(struct timer_list *t)
 static irqreturn_t ghes_irq_func(int irq, void *data)
 {
        struct ghes *ghes = data;
+       unsigned long flags;
        int rc;
 
+       spin_lock_irqsave(&ghes_notify_lock_irq, flags);
        rc = ghes_proc(ghes);
+       spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
        if (rc)
                return IRQ_NONE;
 
@@ -773,14 +783,17 @@ static int ghes_notify_hed(struct notifier_block *this, unsigned long event,
                           void *data)
 {
        struct ghes *ghes;
+       unsigned long flags;
        int ret = NOTIFY_DONE;
 
+       spin_lock_irqsave(&ghes_notify_lock_irq, flags);
        rcu_read_lock();
        list_for_each_entry_rcu(ghes, &ghes_hed, list) {
                if (!ghes_proc(ghes))
                        ret = NOTIFY_OK;
        }
        rcu_read_unlock();
+       spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
 
        return ret;
 }
@@ -789,66 +802,20 @@ static struct notifier_block ghes_notifier_hed = {
        .notifier_call = ghes_notify_hed,
 };
 
-#ifdef CONFIG_ACPI_APEI_SEA
-static LIST_HEAD(ghes_sea);
-
-/*
- * Return 0 only if one of the SEA error sources successfully reported an error
- * record sent from the firmware.
- */
-int ghes_notify_sea(void)
-{
-       struct ghes *ghes;
-       int ret = -ENOENT;
-
-       rcu_read_lock();
-       list_for_each_entry_rcu(ghes, &ghes_sea, list) {
-               if (!ghes_proc(ghes))
-                       ret = 0;
-       }
-       rcu_read_unlock();
-       return ret;
-}
-
-static void ghes_sea_add(struct ghes *ghes)
-{
-       mutex_lock(&ghes_list_mutex);
-       list_add_rcu(&ghes->list, &ghes_sea);
-       mutex_unlock(&ghes_list_mutex);
-}
-
-static void ghes_sea_remove(struct ghes *ghes)
-{
-       mutex_lock(&ghes_list_mutex);
-       list_del_rcu(&ghes->list);
-       mutex_unlock(&ghes_list_mutex);
-       synchronize_rcu();
-}
-#else /* CONFIG_ACPI_APEI_SEA */
-static inline void ghes_sea_add(struct ghes *ghes) { }
-static inline void ghes_sea_remove(struct ghes *ghes) { }
-#endif /* CONFIG_ACPI_APEI_SEA */
-
-#ifdef CONFIG_HAVE_ACPI_APEI_NMI
 /*
- * printk is not safe in NMI context.  So in NMI handler, we allocate
- * required memory from lock-less memory allocator
- * (ghes_estatus_pool), save estatus into it, put them into lock-less
- * list (ghes_estatus_llist), then delay printk into IRQ context via
- * irq_work (ghes_proc_irq_work).  ghes_estatus_size_request record
- * required pool size by all NMI error source.
+ * Handlers for CPER records may not be NMI safe. For example,
+ * memory_failure_queue() takes spinlocks and calls schedule_work_on().
+ * In any NMI-like handler, memory from ghes_estatus_pool is used to save
+ * estatus, and added to the ghes_estatus_llist. irq_work_queue() causes
+ * ghes_proc_in_irq() to run in IRQ context where each estatus in
+ * ghes_estatus_llist is processed.
+ *
+ * Memory from the ghes_estatus_pool is also used with the ghes_estatus_cache
+ * to suppress frequent messages.
  */
 static struct llist_head ghes_estatus_llist;
 static struct irq_work ghes_proc_irq_work;
 
-/*
- * NMI may be triggered on any CPU, so ghes_in_nmi is used for
- * having only one concurrent reader.
- */
-static atomic_t ghes_in_nmi = ATOMIC_INIT(0);
-
-static LIST_HEAD(ghes_nmi);
-
 static void ghes_proc_in_irq(struct irq_work *irq_work)
 {
        struct llist_node *llnode, *next;
@@ -905,96 +872,154 @@ static void ghes_print_queued_estatus(void)
        }
 }
 
-/* Save estatus for further processing in IRQ context */
-static void __process_error(struct ghes *ghes)
+static int ghes_in_nmi_queue_one_entry(struct ghes *ghes,
+                                      enum fixed_addresses fixmap_idx)
 {
-#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
-       u32 len, node_len;
+       struct acpi_hest_generic_status *estatus, tmp_header;
        struct ghes_estatus_node *estatus_node;
-       struct acpi_hest_generic_status *estatus;
+       u32 len, node_len;
+       u64 buf_paddr;
+       int sev, rc;
 
-       if (ghes_estatus_cached(ghes->estatus))
-               return;
+       if (!IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG))
+               return -EOPNOTSUPP;
 
-       len = cper_estatus_len(ghes->estatus);
-       node_len = GHES_ESTATUS_NODE_LEN(len);
+       rc = __ghes_peek_estatus(ghes, &tmp_header, &buf_paddr, fixmap_idx);
+       if (rc) {
+               ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
+               return rc;
+       }
 
+       rc = __ghes_check_estatus(ghes, &tmp_header);
+       if (rc) {
+               ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
+               return rc;
+       }
+
+       len = cper_estatus_len(&tmp_header);
+       node_len = GHES_ESTATUS_NODE_LEN(len);
        estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool, node_len);
        if (!estatus_node)
-               return;
+               return -ENOMEM;
 
        estatus_node->ghes = ghes;
        estatus_node->generic = ghes->generic;
        estatus = GHES_ESTATUS_FROM_NODE(estatus_node);
-       memcpy(estatus, ghes->estatus, len);
-       llist_add(&estatus_node->llnode, &ghes_estatus_llist);
-#endif
-}
 
-static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
-{
-       struct ghes *ghes;
-       int sev, ret = NMI_DONE;
+       if (__ghes_read_estatus(estatus, buf_paddr, fixmap_idx, len)) {
+               ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
+               rc = -ENOENT;
+               goto no_work;
+       }
 
-       if (!atomic_add_unless(&ghes_in_nmi, 1, 1))
-               return ret;
+       sev = ghes_severity(estatus->error_severity);
+       if (sev >= GHES_SEV_PANIC) {
+               ghes_print_queued_estatus();
+               __ghes_panic(ghes, estatus, buf_paddr, fixmap_idx);
+       }
 
-       list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
-               if (ghes_read_estatus(ghes, 1)) {
-                       ghes_clear_estatus(ghes);
-                       continue;
-               } else {
-                       ret = NMI_HANDLED;
-               }
+       ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
 
-               sev = ghes_severity(ghes->estatus->error_severity);
-               if (sev >= GHES_SEV_PANIC) {
-                       oops_begin();
-                       ghes_print_queued_estatus();
-                       __ghes_panic(ghes);
-               }
+       /* This error has been reported before, don't process it again. */
+       if (ghes_estatus_cached(estatus))
+               goto no_work;
 
-               if (!(ghes->flags & GHES_TO_CLEAR))
-                       continue;
+       llist_add(&estatus_node->llnode, &ghes_estatus_llist);
+
+       return rc;
+
+no_work:
+       gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node,
+                     node_len);
+
+       return rc;
+}
 
-               __process_error(ghes);
-               ghes_clear_estatus(ghes);
+static int ghes_in_nmi_spool_from_list(struct list_head *rcu_list,
+                                      enum fixed_addresses fixmap_idx)
+{
+       int ret = -ENOENT;
+       struct ghes *ghes;
+
+       rcu_read_lock();
+       list_for_each_entry_rcu(ghes, rcu_list, list) {
+               if (!ghes_in_nmi_queue_one_entry(ghes, fixmap_idx))
+                       ret = 0;
        }
+       rcu_read_unlock();
 
-#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
-       if (ret == NMI_HANDLED)
+       if (IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) && !ret)
                irq_work_queue(&ghes_proc_irq_work);
-#endif
-       atomic_dec(&ghes_in_nmi);
+
        return ret;
 }
 
-static unsigned long ghes_esource_prealloc_size(
-       const struct acpi_hest_generic *generic)
+#ifdef CONFIG_ACPI_APEI_SEA
+static LIST_HEAD(ghes_sea);
+
+/*
+ * Return 0 only if one of the SEA error sources successfully reported an error
+ * record sent from the firmware.
+ */
+int ghes_notify_sea(void)
 {
-       unsigned long block_length, prealloc_records, prealloc_size;
+       static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sea);
+       int rv;
 
-       block_length = min_t(unsigned long, generic->error_block_length,
-                            GHES_ESTATUS_MAX_SIZE);
-       prealloc_records = max_t(unsigned long,
-                                generic->records_to_preallocate, 1);
-       prealloc_size = min_t(unsigned long, block_length * prealloc_records,
-                             GHES_ESOURCE_PREALLOC_MAX_SIZE);
+       raw_spin_lock(&ghes_notify_lock_sea);
+       rv = ghes_in_nmi_spool_from_list(&ghes_sea, FIX_APEI_GHES_SEA);
+       raw_spin_unlock(&ghes_notify_lock_sea);
 
-       return prealloc_size;
+       return rv;
 }
 
-static void ghes_estatus_pool_shrink(unsigned long len)
+static void ghes_sea_add(struct ghes *ghes)
 {
-       ghes_estatus_pool_size_request -= PAGE_ALIGN(len);
+       mutex_lock(&ghes_list_mutex);
+       list_add_rcu(&ghes->list, &ghes_sea);
+       mutex_unlock(&ghes_list_mutex);
 }
 
-static void ghes_nmi_add(struct ghes *ghes)
+static void ghes_sea_remove(struct ghes *ghes)
 {
-       unsigned long len;
+       mutex_lock(&ghes_list_mutex);
+       list_del_rcu(&ghes->list);
+       mutex_unlock(&ghes_list_mutex);
+       synchronize_rcu();
+}
+#else /* CONFIG_ACPI_APEI_SEA */
+static inline void ghes_sea_add(struct ghes *ghes) { }
+static inline void ghes_sea_remove(struct ghes *ghes) { }
+#endif /* CONFIG_ACPI_APEI_SEA */
+
+#ifdef CONFIG_HAVE_ACPI_APEI_NMI
+/*
+ * NMI may be triggered on any CPU, so ghes_in_nmi is used for
+ * having only one concurrent reader.
+ */
+static atomic_t ghes_in_nmi = ATOMIC_INIT(0);
+
+static LIST_HEAD(ghes_nmi);
+
+static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
+{
+       static DEFINE_RAW_SPINLOCK(ghes_notify_lock_nmi);
+       int ret = NMI_DONE;
+
+       if (!atomic_add_unless(&ghes_in_nmi, 1, 1))
+               return ret;
+
+       raw_spin_lock(&ghes_notify_lock_nmi);
+       if (!ghes_in_nmi_spool_from_list(&ghes_nmi, FIX_APEI_GHES_NMI))
+               ret = NMI_HANDLED;
+       raw_spin_unlock(&ghes_notify_lock_nmi);
 
-       len = ghes_esource_prealloc_size(ghes->generic);
-       ghes_estatus_pool_expand(len);
+       atomic_dec(&ghes_in_nmi);
+       return ret;
+}
+
+static void ghes_nmi_add(struct ghes *ghes)
+{
        mutex_lock(&ghes_list_mutex);
        if (list_empty(&ghes_nmi))
                register_nmi_handler(NMI_LOCAL, ghes_notify_nmi, 0, "ghes");
@@ -1004,8 +1029,6 @@ static void ghes_nmi_add(struct ghes *ghes)
 
 static void ghes_nmi_remove(struct ghes *ghes)
 {
-       unsigned long len;
-
        mutex_lock(&ghes_list_mutex);
        list_del_rcu(&ghes->list);
        if (list_empty(&ghes_nmi))
@@ -1016,24 +1039,79 @@ static void ghes_nmi_remove(struct ghes *ghes)
         * freed after NMI handler finishes.
         */
        synchronize_rcu();
-       len = ghes_esource_prealloc_size(ghes->generic);
-       ghes_estatus_pool_shrink(len);
 }
+#else /* CONFIG_HAVE_ACPI_APEI_NMI */
+static inline void ghes_nmi_add(struct ghes *ghes) { }
+static inline void ghes_nmi_remove(struct ghes *ghes) { }
+#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
 
 static void ghes_nmi_init_cxt(void)
 {
        init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
 }
-#else /* CONFIG_HAVE_ACPI_APEI_NMI */
-static inline void ghes_nmi_add(struct ghes *ghes) { }
-static inline void ghes_nmi_remove(struct ghes *ghes) { }
-static inline void ghes_nmi_init_cxt(void) { }
-#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
+
+static int __ghes_sdei_callback(struct ghes *ghes,
+                               enum fixed_addresses fixmap_idx)
+{
+       if (!ghes_in_nmi_queue_one_entry(ghes, fixmap_idx)) {
+               irq_work_queue(&ghes_proc_irq_work);
+
+               return 0;
+       }
+
+       return -ENOENT;
+}
+
+static int ghes_sdei_normal_callback(u32 event_num, struct pt_regs *regs,
+                                     void *arg)
+{
+       static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sdei_normal);
+       struct ghes *ghes = arg;
+       int err;
+
+       raw_spin_lock(&ghes_notify_lock_sdei_normal);
+       err = __ghes_sdei_callback(ghes, FIX_APEI_GHES_SDEI_NORMAL);
+       raw_spin_unlock(&ghes_notify_lock_sdei_normal);
+
+       return err;
+}
+
+static int ghes_sdei_critical_callback(u32 event_num, struct pt_regs *regs,
+                                      void *arg)
+{
+       static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sdei_critical);
+       struct ghes *ghes = arg;
+       int err;
+
+       raw_spin_lock(&ghes_notify_lock_sdei_critical);
+       err = __ghes_sdei_callback(ghes, FIX_APEI_GHES_SDEI_CRITICAL);
+       raw_spin_unlock(&ghes_notify_lock_sdei_critical);
+
+       return err;
+}
+
+static int apei_sdei_register_ghes(struct ghes *ghes)
+{
+       if (!IS_ENABLED(CONFIG_ARM_SDE_INTERFACE))
+               return -EOPNOTSUPP;
+
+       return sdei_register_ghes(ghes, ghes_sdei_normal_callback,
+                                ghes_sdei_critical_callback);
+}
+
+static int apei_sdei_unregister_ghes(struct ghes *ghes)
+{
+       if (!IS_ENABLED(CONFIG_ARM_SDE_INTERFACE))
+               return -EOPNOTSUPP;
+
+       return sdei_unregister_ghes(ghes);
+}
 
 static int ghes_probe(struct platform_device *ghes_dev)
 {
        struct acpi_hest_generic *generic;
        struct ghes *ghes = NULL;
+       unsigned long flags;
 
        int rc = -EINVAL;
 
@@ -1064,6 +1142,13 @@ static int ghes_probe(struct platform_device *ghes_dev)
                        goto err;
                }
                break;
+       case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
+               if (!IS_ENABLED(CONFIG_ARM_SDE_INTERFACE)) {
+                       pr_warn(GHES_PFX "Generic hardware error source: %d notified via SDE Interface is not supported!\n",
+                               generic->header.source_id);
+                       goto err;
+               }
+               break;
        case ACPI_HEST_NOTIFY_LOCAL:
                pr_warning(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n",
                           generic->header.source_id);
@@ -1127,6 +1212,11 @@ static int ghes_probe(struct platform_device *ghes_dev)
        case ACPI_HEST_NOTIFY_NMI:
                ghes_nmi_add(ghes);
                break;
+       case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
+               rc = apei_sdei_register_ghes(ghes);
+               if (rc)
+                       goto err;
+               break;
        default:
                BUG();
        }
@@ -1136,7 +1226,9 @@ static int ghes_probe(struct platform_device *ghes_dev)
        ghes_edac_register(ghes, &ghes_dev->dev);
 
        /* Handle any pending errors right away */
+       spin_lock_irqsave(&ghes_notify_lock_irq, flags);
        ghes_proc(ghes);
+       spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
 
        return 0;
 
@@ -1150,6 +1242,7 @@ err:
 
 static int ghes_remove(struct platform_device *ghes_dev)
 {
+       int rc;
        struct ghes *ghes;
        struct acpi_hest_generic *generic;
 
@@ -1182,6 +1275,11 @@ static int ghes_remove(struct platform_device *ghes_dev)
        case ACPI_HEST_NOTIFY_NMI:
                ghes_nmi_remove(ghes);
                break;
+       case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
+               rc = apei_sdei_unregister_ghes(ghes);
+               if (rc)
+                       return rc;
+               break;
        default:
                BUG();
                break;
@@ -1230,18 +1328,9 @@ static int __init ghes_init(void)
 
        ghes_nmi_init_cxt();
 
-       rc = ghes_estatus_pool_init();
-       if (rc)
-               goto err;
-
-       rc = ghes_estatus_pool_expand(GHES_ESTATUS_CACHE_AVG_SIZE *
-                                     GHES_ESTATUS_CACHE_ALLOCED_MAX);
-       if (rc)
-               goto err_pool_exit;
-
        rc = platform_driver_register(&ghes_platform_driver);
        if (rc)
-               goto err_pool_exit;
+               goto err;
 
        rc = apei_osc_setup();
        if (rc == 0 && osc_sb_apei_support_acked)
@@ -1254,8 +1343,6 @@ static int __init ghes_init(void)
                pr_info(GHES_PFX "Failed to enable APEI firmware first mode.\n");
 
        return 0;
-err_pool_exit:
-       ghes_estatus_pool_exit();
 err:
        return rc;
 }
index b1e9f81ebeea25b58ba6c0f9820ad38b4bc5b9e0..8113ddb14d2870f9266a660466dfd79bccd9f239 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <acpi/apei.h>
+#include <acpi/ghes.h>
 
 #include "apei-internal.h"
 
@@ -53,6 +54,7 @@ static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
        [ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
        [ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
        [ACPI_HEST_TYPE_GENERIC_ERROR_V2] = sizeof(struct acpi_hest_generic_v2),
+       [ACPI_HEST_TYPE_IA32_DEFERRED_CHECK] = -1,
 };
 
 static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
@@ -75,6 +77,11 @@ static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
                mc = (struct acpi_hest_ia_machine_check *)hest_hdr;
                len = sizeof(*mc) + mc->num_hardware_banks *
                        sizeof(struct acpi_hest_ia_error_bank);
+       } else if (hest_type == ACPI_HEST_TYPE_IA32_DEFERRED_CHECK) {
+               struct acpi_hest_ia_deferred_check *mc;
+               mc = (struct acpi_hest_ia_deferred_check *)hest_hdr;
+               len = sizeof(*mc) + mc->num_hardware_banks *
+                       sizeof(struct acpi_hest_ia_error_bank);
        }
        BUG_ON(len == -1);
 
@@ -203,6 +210,11 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count)
        rc = apei_hest_parse(hest_parse_ghes, &ghes_arr);
        if (rc)
                goto err;
+
+       rc = ghes_estatus_pool_init(ghes_count);
+       if (rc)
+               goto err;
+
 out:
        kfree(ghes_arr.ghes_devs);
        return rc;
@@ -251,7 +263,9 @@ void __init acpi_hest_init(void)
                rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
                if (rc)
                        goto err;
-               rc = hest_ghes_dev_register(ghes_count);
+
+               if (ghes_count)
+                       rc = hest_ghes_dev_register(ghes_count);
                if (rc)
                        goto err;
        }
index 147f6c7ea59c80327babafc45726ffb91c3ad70c..6ecbbabf12330c316d3e28cdbef52e72548b6ef3 100644 (file)
@@ -799,10 +799,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
 }
 EXPORT_SYMBOL_GPL(acpi_match_device);
 
+static const void *acpi_of_device_get_match_data(const struct device *dev)
+{
+       struct acpi_device *adev = ACPI_COMPANION(dev);
+       const struct of_device_id *match = NULL;
+
+       if (!acpi_of_match_device(adev, dev->driver->of_match_table, &match))
+               return NULL;
+
+       return match->data;
+}
+
 const void *acpi_device_get_match_data(const struct device *dev)
 {
        const struct acpi_device_id *match;
 
+       if (!dev->driver->acpi_match_table)
+               return acpi_of_device_get_match_data(dev);
+
        match = acpi_match_device(dev->driver->acpi_match_table, dev);
        if (!match)
                return NULL;
index 4451877f83b63932149b0fd4e552129b2b790c18..aa972dc5cb7e03094698bd44a21bf5f5657088d3 100644 (file)
@@ -79,14 +79,8 @@ static const struct file_operations cm_fops = {
 
 static int __init acpi_custom_method_init(void)
 {
-       if (acpi_debugfs_dir == NULL)
-               return -ENOENT;
-
        cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
                                        acpi_debugfs_dir, NULL, &cm_fops);
-       if (cm_dentry == NULL)
-               return -ENODEV;
-
        return 0;
 }
 
diff --git