ACPICA version 20170531 released
by Moore, Robert
31 May 2017. Summary of changes for version 20170531:
This release is available at https://acpica.org/downloads
0) ACPI 6.2 support:
The ACPI specification version 6.2 has been released and is available at
http://uefi.org/specifications
This version of ACPICA fully supports the ACPI 6.2 specification. Changes are summarized below.
New ACPI tables (Table Compiler/Disassembler/Templates):
HMAT (Heterogeneous Memory Attributes Table)
WSMT (Windows SMM Security Mitigation Table)
PPTT (Processor Properties Topology Table)
New subtables for existing ACPI tables:
HEST (New subtable, Arch-deferred machine check)
SRAT (New subtable, Arch-specific affinity structure)
PCCT (New subtables, Extended PCC subspaces (types 3 and 4))
Simple updates for existing ACPI tables:
BGRT (two new flag bits)
HEST (New bit defined for several subtables, GHES_ASSIST)
New Resource Descriptors and Resource macros (Compiler/Disassembler):
PinConfig()
PinFunction()
PinGroup()
PinGroupConfig()
PinGroupFunction()
New type for hardware error notification (section 18.3.2.9)
New predefined names/methods (Compiler/Interpreter):
_HMA (Heterogeneous Memory Attributes)
_LSI (Label Storage Information)
_LSR (Label Storage Read)
_LSW (Label Storage Write)
ASL grammar/macro changes (Compiler):
For() ASL macro, implemented with the AML while operator
Extensions to Concatenate operator
Support for multiple definition blocks in same ASL file
Clarification for Buffer operator
Allow executable AML code underneath all scopes (Devices, etc.)
Clarification/change for the _OSI return value
ASL grammar update for reference operators
Allow a zero-length string for AML filename in DefinitionBlock
Miscellaneous:
New device object notification value
Remove a notify value (0x0C) for graceful shutdown
New UUIDs for processor/cache properties and physical package property
New _HID, ACPI0014 (Wireless Power Calibration Device)
1) ACPICA kernel-resident subsystem:
Added support to disable ACPI events on hardware-reduced platforms. Eliminates error messages of the form "Could not enable fixed event". Lv Zheng
Fixed a problem using Device/Thermal objects with the ObjectType and DerefOf ASL operators. This support had not been fully/properly implemented.
Fixed a problem where if a Buffer object containing a resource template was longer than the actual resource template, an error was generated -- even though the AML is legal. This case has been seen in the field.
Fixed a problem with the header definition of the MADT PCAT_COMPAT flag. The values for DUAL_PIC and MULTIPLE_APIC were reversed.
Added header file changes for the TPM2 ACPI table. Update to new version of the TCG specification. Adds a new TPM2 subtable for ARM SMC.
Exported the external interfaces AcpiAcquireMutex and AcpiReleaseMutex. These interfaces are intended to be used only in conjunction with the predefined _DLM method (Device Lock Method). "This object appears in a device scope when AML access to the device must be synchronized with the OS environment".
Example Code and Data Size: These are the sizes for the OS-independent
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
debug version of the code includes the debug output trace mechanism and
has a much larger code and data size.
Current Release:
Non-Debug Version: 143.1K Code, 60.0K Data, 203.1K Total
Debug Version: 204.0K Code, 84.3K Data, 288.3K Total
Previous Release:
Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total
Debug Version: 207.5K Code, 82.7K Data, 290.2K Total
2) iASL Compiler/Disassembler and Tools:
iASL: Fixed a problem where an External() declaration could not refer to a Field Unit. Erik Schmauss.
Disassembler: Improved support for the Switch/Case operators. This feature will disassemble AML code back to the original Switch operators when possible, instead of an If..Else sequence. David Box
iASL and disassembler: Improved the handling of multiple extraneous parentheses for both ASL input and disassembled ASL output.
Improved the behavior of the iASL compiler and disassembler to detect improper use of external declarations
Disassembler: Now aborts immediately upon detection of an unknown AML opcode. The AML parser has no real way to recover from this, and can result in the creation of an ill-formed parse tree that causes errors later during the disassembly.
All tools: Fixed a problem where the Unix application OSL did not handle control-c correctly. For example, a control-c could incorrectly wake the debugger.
AcpiExec: Improved the Control-C handling and added a handler for segmentation faults (SIGSEGV). Supports both Windows and Unix-like environments.
Reduced the verbosity of the generic unix makefiles. Previously, each compilation displayed the full set of compiler options. This has been eliminated as the options are easily inspected within the makefiles. Each compilation now results in a single line of output.
3 years, 9 months
Re: [Devel] [PATCH] acpi: configfs: Unload SSDT on configfs entry removal
by Moore, Robert
> -----Original Message-----
> From: rjwysocki(a)gmail.com [mailto:rjwysocki@gmail.com] On Behalf Of
> Rafael J. Wysocki
> Sent: Tuesday, May 30, 2017 2:42 PM
> To: Moore, Robert <robert.moore(a)intel.com>; Jan Kiszka
> <jan.kiszka(a)siemens.com>
> Cc: Mika Westerberg <mika.westerberg(a)linux.intel.com>; Rafael J. Wysocki
> <rjw(a)rjwysocki.net>; Len Brown <lenb(a)kernel.org>; Zheng, Lv
> <lv.zheng(a)intel.com>; linux-acpi(a)vger.kernel.org; Linux Kernel Mailing
> List <linux-kernel(a)vger.kernel.org>; devel(a)acpica.org
> Subject: Re: [PATCH] acpi: configfs: Unload SSDT on configfs entry
> removal
>
> On Tue, May 30, 2017 at 11:16 PM, Moore, Robert <robert.moore(a)intel.com>
> wrote:
> >
> >
> >> -----Original Message-----
> >> From: Jan Kiszka [mailto:jan.kiszka@siemens.com]
> >> Sent: Monday, May 29, 2017 5:53 AM
> >> To: Mika Westerberg <mika.westerberg(a)linux.intel.com>
> >> Cc: Rafael J. Wysocki <rjw(a)rjwysocki.net>; Len Brown
> >> <lenb(a)kernel.org>; Zheng, Lv <lv.zheng(a)intel.com>;
> >> linux-acpi(a)vger.kernel.org; Linux Kernel Mailing List
> >> <linux-kernel(a)vger.kernel.org>; devel(a)acpica.org; Moore, Robert
> >> <robert.moore(a)intel.com>
> >> Subject: Re: [PATCH] acpi: configfs: Unload SSDT on configfs entry
> >> removal
> >>
> >> On 2017-05-29 14:47, Mika Westerberg wrote:
> >> > On Mon, May 29, 2017 at 01:33:29PM +0200, Jan Kiszka wrote:
> >> >> Enhance acpi_load_table to also return the table index. Use that
> >> >> index to unload the table again when the corresponding directory
> >> >> in configfs gets removed. This allows to change SSDTs without
> >> >> rebooting
> >> the system.
> >> >> It also allows to destroy devices again that a dynamically loaded
> >> >> SSDT created.
> >> >>
> >> >> This is widely similar to the DT overlay behavior.
> >> >>
> >> >> Signed-off-by: Jan Kiszka <jan.kiszka(a)siemens.com>
> >> >> ---
> >> >>
> >> >> Can someone explain to me why an unloaded table still sticks
> >> >> around in sysfs and why we cannot release its ID and rather have
> >> >> to use a new one when loading a modified version?
> >> >
> >> > IIRC ACPICA relies the fact that SSDTs are never unloaded. Bob
> >> > (CC'd) can correct me if I got it wrong.
> >>
> >
> >
> > [Moore, Robert]
> >
> > I'm not entirely sure what the table manager code looks like at this
> time, but ACPICA does in fact support table unloading.
> >
> > It is a rather dangerous thing to do, however -- unless you are
> careful about it. Basically, all handles that reference the table to be
> unloaded will go bad.
>
> Right.
>
> Linux should handle that in theory, but the code in there is mostly very
> lightly tested AFAICS.
>
[Moore, Robert]
The load/unload functionality works with the current table interfaces. For example, the AML debugger supports both Load and Unload commands:
Load <Input Filename> Load ACPI table from a file
Unload <Namepath> Unload an ACPI table via namespace object
- load ssdt.aml
Input file ssdt.aml, Length 0x3A (58) bytes
ACPI: Host-directed Dynamic ACPI Table Load:
ACPI: SSDT 0x00000000004A1B18 00003A (v02 Intel _SSDT_01 00000001 INTL 20170303)
ACPI Exec: Table Event INSTALL, [SSDT] 004A1B18
ACPI Exec: Table Event LOAD, [SSDT] 004A1B18
- unload _T32
ACPI Exec: Table Event UNLOAD, [SSDT] 004A1B18
Parent of [_T32] (004A1028) unloaded and uninstalled
> >> OK... Is that standard-driven or just a limitation of this
> >> implementation?
> >>
> >> Is there an upper limit of tables? I'm thinking of lengthy
> >> development sessions that play with tables, loading and unloading
> modified versions.
> >>
> >
> > [Moore, Robert]
> >
> > I think that the maximum number of loaded ACPI tables is 255 at any
> given time. However, things are cleaned up after an unload such that
> repeated load/unload cycles should not consume resources.
>
> I'm not sure if this is going to work seamlessly right away, but it
> certainly can be made work.
>
> That said, the change as proposed would be an API modification forcing
> all of the OSes using ACPICA to change (or to carry out-of-the-tree
> patches), so not nice.
>
> What about adding a separate version of acpi_load_table() returning an
> index (or an error on failures) instead of the status and leaving the
> existing acpi_load_table() as is?
>
> Thanks,
> Rafael
3 years, 9 months
Re: [Devel] [PATCH] acpi: configfs: Unload SSDT on configfs entry removal
by Moore, Robert
> -----Original Message-----
> From: Jan Kiszka [mailto:jan.kiszka@siemens.com]
> Sent: Monday, May 29, 2017 5:53 AM
> To: Mika Westerberg <mika.westerberg(a)linux.intel.com>
> Cc: Rafael J. Wysocki <rjw(a)rjwysocki.net>; Len Brown <lenb(a)kernel.org>;
> Zheng, Lv <lv.zheng(a)intel.com>; linux-acpi(a)vger.kernel.org; Linux Kernel
> Mailing List <linux-kernel(a)vger.kernel.org>; devel(a)acpica.org; Moore,
> Robert <robert.moore(a)intel.com>
> Subject: Re: [PATCH] acpi: configfs: Unload SSDT on configfs entry
> removal
>
> On 2017-05-29 14:47, Mika Westerberg wrote:
> > On Mon, May 29, 2017 at 01:33:29PM +0200, Jan Kiszka wrote:
> >> Enhance acpi_load_table to also return the table index. Use that
> >> index to unload the table again when the corresponding directory in
> >> configfs gets removed. This allows to change SSDTs without rebooting
> the system.
> >> It also allows to destroy devices again that a dynamically loaded
> >> SSDT created.
> >>
> >> This is widely similar to the DT overlay behavior.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka(a)siemens.com>
> >> ---
> >>
> >> Can someone explain to me why an unloaded table still sticks around
> >> in sysfs and why we cannot release its ID and rather have to use a
> >> new one when loading a modified version?
> >
> > IIRC ACPICA relies the fact that SSDTs are never unloaded. Bob (CC'd)
> > can correct me if I got it wrong.
>
[Moore, Robert]
I'm not entirely sure what the table manager code looks like at this time, but ACPICA does in fact support table unloading.
It is a rather dangerous thing to do, however -- unless you are careful about it. Basically, all handles that reference the table to be unloaded will go bad.
> OK... Is that standard-driven or just a limitation of this
> implementation?
>
> Is there an upper limit of tables? I'm thinking of lengthy development
> sessions that play with tables, loading and unloading modified versions.
>
[Moore, Robert]
I think that the maximum number of loaded ACPI tables is 255 at any given time. However, things are cleaned up after an unload such that repeated load/unload cycles should not consume resources.
> Jan
>
> --
> Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence
> Center Embedded Linux
3 years, 9 months
Help needed for "ACPI Error: No handler for Region [ECOR]" (using my own OSL)
by Devin Steffler
Hello,
I am working on an OSL for QNX. I am getting some errors printed out
during AcpiInitializeObjects but only in one out of three laptops that I am
testing. A Dell and ASUS laptop do not have the errors but a Lenovo laptop
does. I am able to read battery status (_BST) on the Dell and ASUS laptops
but not on the Lenovo laptop.
The ACPICA version I am using is 20170303.
Some questions I have are:
- Is this the correct mailing list for this email?
- Does this appear to be a bug in ACPICA, in my OSL, or somewhere else
(maybe the laptop BIOS)?
- Should I raise a bug for this?
- Would you provide any recommendations to help me troubleshoot this?
- What other information should I provide?
This is the output during ACPI initialization on the problematic laptop
(from my OSL):
------------------------------------------------------------------------------------------------
ACPI: RSDP 0x00000000000F0120 000024 (v02 LENOVO)
ACPI: XSDT 0x00000000D7FD2188 0000CC (v01 LENOVO TP-R00 00000000 PTEC
00000002)
ACPI: FACP 0x00000000D7FF7000 0000F4 (v05 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: DSDT 0x00000000D7FDE000 011451 (v02 LENOVO TP-R00 00000420 INTL
20141107)
ACPI: FACS 0x00000000D7FA2000 000040
ACPI: UEFI 0x00000000D7FB9000 000042 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: SSDT 0x00000000D7FF8000 004E0A (v02 LENOVO SaSsdt 00003000 INTL
20141107)
ACPI: ASF! 0x00000000D7FF6000 0000A5 (v32 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: ECDT 0x00000000D7FF5000 000052 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: HPET 0x00000000D7FF4000 000038 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: LPIT 0x00000000D7FF3000 000094 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: APIC 0x00000000D7FF2000 0000BC (v03 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: MCFG 0x00000000D7FF1000 00003C (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: WDAT 0x00000000D7FF0000 000134 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: SSDT 0x00000000D7FDC000 001AFC (v01 LENOVO SataAhci 00001000 INTL
20141107)
ACPI: DBGP 0x00000000D7FDB000 000034 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: DBG2 0x00000000D7FDA000 000054 (v00 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: BOOT 0x00000000D7FD9000 000028 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: BATB 0x00000000D7FD8000 000046 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: SLIC 0x00000000D7FD7000 000176 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: SSDT 0x00000000D7FD6000 000E58 (v02 LENOVO CpuSsdt 00003000 INTL
20141107)
ACPI: SSDT 0x00000000D7FD5000 0003D9 (v02 LENOVO CtdpB 00001000 INTL
20141107)
ACPI: MSDM 0x00000000D7FD4000 000055 (v03 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: FPDT 0x00000000D7FD3000 000044 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: UEFI 0x00000000D7FA0000 00012A (v01 LENOVO TP-R00 00000420 PTEC
00000002)
Initializing Namespace objects:
Table [DSDT: TP-R00 ] (id 01) - 2757 Objects with 76 Devices, 40
Regions, 510 Methods (140/370/24 Serial/Non/Cvt)
Table [SSDT: SaSsdt ] (id 02) - 552 Objects with 18 Devices, 20
Regions, 131 Methods (41/90/7 Serial/Non/Cvt)
Table [SSDT: SataAhci] (id 03) - 183 Objects with 8 Devices, 0
Regions, 34 Methods (25/9/5 Serial/Non/Cvt)
Table [SSDT: CpuSsdt ] (id 04) - 114 Objects with 0 Devices, 3
Regions, 29 Methods (13/16/13 Serial/Non/Cvt)
Table [SSDT: CtdpB ] (id 05) - 33 Objects with 0 Devices, 1
Regions, 5 Methods (2/3/1 Serial/Non/Cvt)
ACPI: 5 ACPI AML tables successfully acquired and loaded
Completing Region/Field/Buffer/Package initialization:
Initialized 63/64 Regions 71/71 Fields 88/88 Buffers 83/83 Packages
(3648 nodes)
evxfevnt-0218 Enable : Transition to ACPI mode successful
Initializing General Purpose Events (GPEs):
Initialized GPE 00 to 7F [_GPE] 16 regs on interrupt 0x9 (SCI)
Initializing Device/Processor/Thermal objects and executing _INI/_STA
methods:
ACPI Error: No handler for Region [ECOR] (80da130) [EmbeddedControl]
(20170303/evregion-291)
ACPI Error: Region EmbeddedControl (ID=3) has no handler
(20170303/exfldio-431)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPC.EC.AC._PSR] (Node
80d0c30), AE_NOT_EXIST (20170303/psparse-668)
ACPI Error: Method parse/execution failed [\_SB._INI] (Node 80e4f50),
AE_NOT_EXIST (20170303/psparse-668)
ACPI Error: No handler for Region [ECOR] (80da130) [EmbeddedControl]
(20170303/evregion-291)
ACPI Error: Region EmbeddedControl (ID=3) has no handler
(20170303/exfldio-431)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPC.EC._INI] (Node
80d00d0), AE_NOT_EXIST (20170303/psparse-668)
ACPI Exception: AE_NOT_EXIST, during \_SB.PCI0.LPC.EC._INI execution
(20170303/nsinit-807)
Executed 13 _INI methods requiring 1 _STA executions (examined 113
objects)
------------------------------------------------------------------------------------------------
This is the output from calling AcpiEvaluateObject for the control method
"\_SB.PCI0.LPC.EC.BAT0._BST", which returns with AE_NOT_EXIST:
------------------------------------------------------------------------------------------------
ACPI Error: No handler for Region [ECOR] (80da130) [EmbeddedControl]
(20170303/evregion-291)
ACPI Error: Region EmbeddedControl (ID=3) has no handler
(20170303/exfldio-431)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPC.EC.BAT0._BST]
(Node 80d0b70), AE_NOT_EXIST (20170303/psparse-668)
------------------------------------------------------------------------------------------------
This is the output from executing the control method using acpiexec:
------------------------------------------------------------------------------------------------
# ./acpiexec *.dat
Intel ACPI Component Architecture
AML Execution/Debug Utility version 20170303
Copyright (c) 2000 - 2017 Intel Corporation
Input file apic.dat, Length 0xBC (188) bytes
Input file asf!.dat, Length 0xA5 (165) bytes
Input file batb.dat, Length 0x46 (70) bytes
Input file boot.dat, Length 0x28 (40) bytes
Input file dbg2.dat, Length 0x54 (84) bytes
Input file dbgp.dat, Length 0x34 (52) bytes
Input file dsdt.dat, Length 0x11451 (70737) bytes
Input file ecdt.dat, Length 0x52 (82) bytes
Input file facp.dat, Length 0xF4 (244) bytes
Input file facs.dat, Length 0x40 (64) bytes
Input file fpdt.dat, Length 0x44 (68) bytes
Input file hpet.dat, Length 0x38 (56) bytes
Input file lpit.dat, Length 0x94 (148) bytes
Input file mcfg.dat, Length 0x3C (60) bytes
Input file msdm.dat, Length 0x55 (85) bytes
Input file slic.dat, Length 0x176 (374) bytes
Input file ssdt1.dat, Length 0x4E0A (19978) bytes
Input file ssdt2.dat, Length 0x1AFC (6908) bytes
Input file ssdt3.dat, Length 0xE58 (3672) bytes
Input file ssdt4.dat, Length 0x3D9 (985) bytes
Input file uefi1.dat, Length 0x42 (66) bytes
Input file uefi2.dat, Length 0x12A (298) bytes
Input file wdat.dat, Length 0x134 (308) bytes
Input file xsdt.dat, Length 0xCC (204) bytes
ACPI: RSDP 0x00000000080DBCE0 000024 (v02 Intel )
ACPI: XSDT 0x00000000080E78C8 0000E4 (v00 Intel AcpiExec 00001001 INTL
20170303)
ACPI: FACP 0x00000000080EA550 0000F4 (v05 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: DSDT 0x00000000080EF020 011451 (v02 LENOVO TP-R00 00000420 INTL
20141107)
ACPI: FACS 0x00000000080DBD20 000040
ACPI: APIC 0x00000000080EA708 0000BC (v03 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: ASF! 0x00000000080EA650 0000A5 (v32 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: BATB 0x00000000080E30A8 000046 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: BOOT 0x00000000080E01D8 000028 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: DBG2 0x00000000080E21F0 000054 (v00 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: DBGP 0x00000000080E12D8 000034 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: ECDT 0x00000000080E2258 000052 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: FACS 0x00000000080E1320 000040
ACPI: FPDT 0x00000000080E3100 000044 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: HPET 0x00000000080E1368 000038 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: LPIT 0x00000000080EA4B0 000094 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: MCFG 0x00000000080E13B0 00003C (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: MSDM 0x00000000080E22C0 000055 (v03 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: SLIC 0x00000000080EA328 000176 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: SSDT 0x0000000008101020 004E0A (v02 LENOVO SaSsdt 00003000 INTL
20141107)
ACPI: SSDT 0x00000000080E8820 001AFC (v01 LENOVO SataAhci 00001000 INTL
20141107)
ACPI: SSDT 0x00000000080E79B8 000E58 (v02 LENOVO CpuSsdt 00003000 INTL
20141107)
ACPI: SSDT 0x00000000080EA7D0 0003D9 (v02 LENOVO CtdpB 00001000 INTL
20141107)
ACPI: UEFI 0x00000000080E3158 000042 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: UEFI 0x00000000080E7470 00012A (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: WDAT 0x00000000080E7330 000134 (v01 LENOVO TP-R00 00000420 PTEC
00000002)
ACPI: XSDT 0x00000000080E7230 0000CC (v01 LENOVO TP-R00 00000000 PTEC
00000002)
Initializing General Purpose Events (GPEs):
Initialized GPE 00 to 7F [_GPE] 16 regs on interrupt 0x9 (SCI)
Initializing Namespace objects:
Table [DSDT: TP-R00 ] (id 01) - 2757 Objects with 76 Devices, 40
Regions, 510 Methods (140/370/24 Serial/Non/Cvt)
Table [SSDT: SaSsdt ] (id 02) - 552 Objects with 18 Devices, 20
Regions, 131 Methods (41/90/7 Serial/Non/Cvt)
Table [SSDT: SataAhci] (id 03) - 183 Objects with 8 Devices, 0
Regions, 34 Methods (25/9/5 Serial/Non/Cvt)
Table [SSDT: CpuSsdt ] (id 04) - 114 Objects with 0 Devices, 3
Regions, 29 Methods (13/16/13 Serial/Non/Cvt)
Table [SSDT: CtdpB ] (id 05) - 33 Objects with 0 Devices, 1
Regions, 5 Methods (2/3/1 Serial/Non/Cvt)
ACPI: 5 ACPI AML tables successfully acquired and loaded
Completing Region/Field/Buffer/Package initialization:
Initialized 63/64 Regions 71/71 Fields 88/88 Buffers 83/83 Packages
(3648 nodes)
Initializing Device/Processor/Thermal objects and executing _INI/_STA
methods:
[AcpiExec] Exception AE_AML_INFINITE_LOOP during execution of method [SMI_]
Opcode [While] @44
[SMI_] @00034 #00A2: While (
No Local Variables are initialized for method [SMI_]
Initialized Arguments for Method [SMI_]: (0 arguments defined for method
invocation)
Arg0: 81ecc40 <Obj> Integer 0000000000000009
Arg1: 81eca38 <Obj> Integer 0000000000000001
Arg2: 81ecbd8 <Obj> Integer 0000000000000000
Arg3: 81ec9d0 <Obj> Integer 0000000000000000
Arg4: 81ecb08 <Obj> Integer 0000000000000000
ACPI Error: Method parse/execution failed [\SMI] (Node 814de40),
AE_AML_INFINITE_LOOP (20170303/psparse-668)
ACPI Error: Method parse/execution failed [\WGSV] (Node 814e978),
AE_AML_INFINITE_LOOP (20170303/psparse-668)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPC.EC.HKEY.WGIN]
(Node 8143810), AE_AML_INFINITE_LOOP (20170303/psparse-668)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPC.EC._INI] (Node
8121ae0), AE_AML_INFINITE_LOOP (20170303/psparse-668)
ACPI Exception: AE_AML_INFINITE_LOOP, during \_SB.PCI0.LPC.EC._INI
execution (20170303/nsinit-807)
Executed 14 _INI methods requiring 1 _STA executions (examined 113
objects)
- execute \_SB.PCI0.LPC.EC.BAT0._BST
Evaluating \_SB.PCI0.LPC.EC.BAT0._BST
0x4 Outstanding allocations after evaluation of \_SB.PCI0.LPC.EC.BAT0._BST
Evaluation of \_SB.PCI0.LPC.EC.BAT0._BST returned object 80eaff0, external
buffer length 78
[Package] Contains 4 Elements:
[Integer] = 0000000000000004
[Integer] = 0000000000000000
[Integer] = 0000000000000000
[Integer] = 0000000000000000
- q
------------------------------------------------------------------------------------------------
Note: I tried running Linux on the Lenovo laptop and it can read the
battery status ok.
Thank you,
Devin
3 years, 9 months
Re: [Devel] [PATCH] acpi: acpica: dbfileio: Use strlcpy to Copy a C-string into a sized buffer
by Moore, Robert
I'm not sure that strlcpy is portable.
Bob
> -----Original Message-----
> From: Karim Eshapa [mailto:karim.eshapa@gmail.com]
> Sent: Tuesday, May 23, 2017 4:26 PM
> To: Moore, Robert <robert.moore(a)intel.com>
> Cc: Zheng, Lv <lv.zheng(a)intel.com>; Wysocki, Rafael J
> <rafael.j.wysocki(a)intel.com>; lenb(a)kernel.org; linux-
> acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org;
> Karim Eshapa <karim.eshapa(a)gmail.com>
> Subject: [PATCH] acpi: acpica: dbfileio: Use strlcpy to Copy a C-string
> into a sized buffer
>
> Use strlcpy with sized buffer instead of strncpy to avoid non NUL-
> terminated source strings problems.
>
> Signed-off-by: Karim Eshapa <karim.eshapa(a)gmail.com>
> ---
> drivers/acpi/acpica/dbfileio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpica/dbfileio.c
> b/drivers/acpi/acpica/dbfileio.c index 4d81ea2..f0f22f1 100644
> --- a/drivers/acpi/acpica/dbfileio.c
> +++ b/drivers/acpi/acpica/dbfileio.c
> @@ -99,7 +99,7 @@ void acpi_db_open_debug_file(char *name)
> }
>
> acpi_os_printf("Debug output file %s opened\n", name);
> - strncpy(acpi_gbl_db_debug_filename, name,
> + strlcpy(acpi_gbl_db_debug_filename, name,
> sizeof(acpi_gbl_db_debug_filename));
> acpi_gbl_db_output_to_file = TRUE;
> }
> --
> 2.7.4
3 years, 9 months
Re: [Devel] [RFC PATCH v2 0/5] ACPICA: Tables: Add deferred verification support
by Zheng, Lv
Hi, Hans
> From: Hans de Goede [mailto:hdegoede@redhat.com]
> Subject: Re: [RFC PATCH v2 0/5] ACPICA: Tables: Add deferred verification support
>
> Hi,
>
> On 16-05-17 09:13, Lv Zheng wrote:
> > On linux, we can not verify ACPI tables before installing them into the
> > global table list in early stage due to the number of slot limitations for
> > early ioremap. This leaves a problem that we cannot detect duplicated
> > tables in early stage, causing unwanted error messages seen when the
> > duplicated tables are failed to be loaded [link #1].
> >
> > This patchset as ACPICA PR [link #2] adds support to verify tables in
> > acpi_reallocate_root_tables() which is invoked after installing tables in
> > early stage, being ready for late ioremap and beofre loading table in late
> > stage. If duplicated tables are detected, acpi_reallocate_root_tables()
> > stops installing them to the final reallocated global table list.
> >
> > In v1 patchset [link #3], problems can be seen for dynamic loading tables
> > which are allocated as virtuall allocated tables. Such tables are
> > incremented in the global table list as the sanity check done in install
> > step only compares the table addresses while the virtual allocated
> > addresses are not stable.
> > In v2 patchset, we follow original design discussion made in ACPICA devel
> > mailing list, implements deferred table verification so that duplicate
> > tables are still can be detected in install step rather than in load step.
> > Also we removed table signature check according to verified windows
> > behavior [link #4] and reported issues [link #5].
> >
> > Link: http://www.spinics.net/lists/linux-acpi/msg72215.html [#1]
> > Link: https://github.com//acpica/acpica/pull/265 [#2]
> > Link: http://www.spinics.net/lists/linux-acpi/msg72589.html [#3]
> > Link: https://github.com//acpica/acpica/pull/121 [#4]
> > https://bugzilla.kernel.org/show_bug.cgi?id=118601 [#5]
> >
> > Lv Zheng (5):
> > ACPICA: Tables: Cleanup table handler invokers
> > ACPICA: Tables: Do not validate signature for dynamic table load
> > ACPICA: Tables: Change table duplication check to be related to
> > acpi_gbl_verify_table_checksum
> > ACPICA: Tables: Combine checksum/duplication verification together
> > ACPICA: Tables: Add deferred table verification support
>
> I've tested these patches and can confirm that they fix the ACPI
> errors on the system which started this all.
>
> Note I've tested "v2" of the patch-set, I was on the Cc for the
> cover letter for v3, but I did not receive the actual patches,
> if you want me test v3 please send me the patches (or point
> me to a git branch with them).
What I added is:
*table_index = i;
In acpi_tb_install_standard_table().
Without this line, Load a table 2nd time after the 1st time Load/Unload will fail.
Other changes are not functional. I'm sorry for that mistake.
Testing v2 can be sufficient as what v3 improves is not strictly related to your issue.
And we can ensure the v3 improvement's quality locally while for your issue I cannot.
So it's OK if you don't do any further testing, but if you want to try:
You can reach the code via the following git repository:
https://github.com/zetalog/linux/
They are top 5 commits in acpica-tables2 branch:
https://github.com/zetalog/linux/commits/acpica-tables2
# git remote add linux-acpica https://github.com/zetalog/linux/
# git fetch linux-acpica
# git checkout acpica-tables2
Thanks and best regards
Lv
3 years, 9 months
[RFC PATCH v3 0/5] ACPICA: Tables: Add deferred verification support
by Lv Zheng
On linux, we can not verify ACPI tables before installing them into the
global table list in early stage due to the number of slot limitations for
early ioremap. This leaves a problem that we cannot detect duplicated
tables in early stage, causing unwanted error messages seen when the
duplicated tables are failed to be loaded [link #1].
This patchset as ACPICA PR [link #2] adds support to verify tables in
acpi_reallocate_root_tables() which is invoked after installing tables in
early stage, being ready for late ioremap and beofre loading table in late
stage. If duplicated tables are detected, acpi_reallocate_root_tables()
stops installing them to the final reallocated global table list.
In v1 patchset [link #3], problems can be seen for dynamic loading tables
which are allocated as virtuall allocated tables. Such tables are
incremented in the global table list as the sanity check done in install
step only compares the table addresses while the virtual allocated
addresses are not stable.
In v2 patchset, we follow original design discussion made in ACPICA devel
mailing list, implements deferred table verification so that duplicate
tables are still can be detected in install step rather than in load step.
Also we removed table signature check according to verified windows
behavior [link #4] and reported issues [link #5].
In v3 patchset, one serious problem is detected around returning
AE_CTRL_TERMINATE for duplicate tables. The problem is detected by ASLTS.
Also it contains small improvements. ACPICA pull request [link #2] is
also updated.
Link: http://www.spinics.net/lists/linux-acpi/msg72215.html [#1]
Link: https://github.com//acpica/acpica/pull/265 [#2]
Link: http://www.spinics.net/lists/linux-acpi/msg72589.html [#3]
Link: https://github.com//acpica/acpica/pull/121 [#4]
https://bugzilla.kernel.org/show_bug.cgi?id=118601 [#5]
Lv Zheng (5):
ACPICA: Tables: Cleanup table handler invokers
ACPICA: Tables: Do not validate signature for dynamic table load
ACPICA: Tables: Change table duplication check to be related to
acpi_gbl_verify_table_checksum
ACPICA: Tables: Combine checksum/duplication verification together
ACPICA: Tables: Add deferred table verification support
drivers/acpi/acpica/actables.h | 5 +-
drivers/acpi/acpica/tbdata.c | 228 ++++++++++++++++++++++++++++++++++++-----
drivers/acpi/acpica/tbinstal.c | 161 ++++-------------------------
drivers/acpi/acpica/tbxface.c | 33 +++++-
drivers/acpi/acpica/tbxfload.c | 2 +-
drivers/acpi/bus.c | 3 -
drivers/acpi/tables.c | 4 +-
include/acpi/acpixf.h | 15 +--
include/acpi/actbl.h | 1 +
9 files changed, 270 insertions(+), 182 deletions(-)
--
2.7.4
3 years, 9 months
Re: [Devel] Devel Digest, Vol 77, Issue 2
by Alexei Fedorov
Re: [PATCH] ACPI: SPCR: Use access width to determine mmio
usage (Zheng, Lv)
Hi Zheng,
> + switch (table->serial_port.access_width) {
> + default:
> + pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
> + case ACPI_ACCESS_SIZE_BYTE:
> + iotype = "mmio";
> + break;
> + case ACPI_ACCESS_SIZE_WORD:
> + iotype = "mmio16";
> + break;
> + case ACPI_ACCESS_SIZE_DWORD:
> + iotype = "mmio32";
> + break;
> + }
> + } else
> + iotype = "io";
Why there's no code for ACPI_ACCESS_SIZE_QWORD?
Regards,
Alexei.
________________________________
From: Devel <devel-bounces(a)acpica.org> on behalf of devel-request(a)acpica.org <devel-request(a)acpica.org>
Sent: 16 May 2017 08:13:53
To: devel(a)acpica.org
Subject: Devel Digest, Vol 77, Issue 2
Send Devel mailing list submissions to
devel(a)acpica.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.acpica.org/mailman/listinfo/devel
or, via email, send a message with subject or body 'help' to
devel-request(a)acpica.org
You can reach the person managing the list at
devel-owner(a)acpica.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Devel digest..."
Today's Topics:
1. Re: [PATCH] ACPI: SPCR: Use access width to determine mmio
usage (Zheng, Lv)
2. [RFC PATCH v2 0/5] ACPICA: Tables: Add deferred verification
support (Lv Zheng)
3. [RFC PATCH v2 1/5] ACPICA: Tables: Cleanup table handler
invokers (Lv Zheng)
4. [RFC PATCH v2 2/5] ACPICA: Tables: Do not validate signature
for dynamic table load (Lv Zheng)
5. [RFC PATCH v2 3/5] ACPICA: Tables: Change table duplication
check to be related to acpi_gbl_verify_table_checksum (Lv Zheng)
6. [RFC PATCH v2 4/5] ACPICA: Tables: Combine
checksum/duplication verification together (Lv Zheng)
----------------------------------------------------------------------
Message: 1
Date: Fri, 5 May 2017 03:09:34 +0000
From: "Zheng, Lv" <lv.zheng(a)intel.com>
To: Jon Mason <jon.mason(a)broadcom.com>, Rafael Wysocki
<rjw(a)rjwysocki.net>, Len Brown <lenb(a)kernel.org>, "Moore, Robert"
<robert.moore(a)intel.com>
Cc: "linux-acpi(a)vger.kernel.org" <linux-acpi(a)vger.kernel.org>,
"linux-kernel(a)vger.kernel.org" <linux-kernel(a)vger.kernel.org>,
"devel(a)acpica.org" <devel(a)acpica.org>,
"bcm-kernel-feedback-list(a)broadcom.com"
<bcm-kernel-feedback-list(a)broadcom.com>
Subject: Re: [Devel] [PATCH] ACPI: SPCR: Use access width to determine
mmio usage
Message-ID:
<1AE640813FDE7649BE1B193DEA596E886CE9DCBC(a)SHSMSX101.ccr.corp.intel.com>
Content-Type: text/plain; charset="gb2312"
Hi,
> From: Jon Mason [mailto:jon.mason@broadcom.com]
> Sent: Thursday, May 4, 2017 11:06 PM
> Subject: [PATCH] ACPI: SPCR: Use access width to determine mmio usage
>
> The current SPCR code does not check the access width of the mmio, and
> uses a default of 8bit register accesses. This prevents devices that
> only do 16 or 32bit register accesses from working. By simply checking
> this field and setting the mmio string appropriately, this issue can be
> corrected. To prevent any legacy issues, the code will default to 8bit
> accesses if the value is anything but 16 or 32.
>
> Signed-off-by: Jon Mason <jon.mason(a)broadcom.com>
> ---
> drivers/acpi/spcr.c | 18 ++++++++++++++++--
> include/acpi/acrestyp.h | 7 +++++++
> 2 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
> index 01c9466..11233f6 100644
> --- a/drivers/acpi/spcr.c
> +++ b/drivers/acpi/spcr.c
> @@ -74,8 +74,22 @@ int __init parse_spcr(bool earlycon)
> goto done;
> }
>
> - iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ?
> - "mmio" : "io";
> + if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
> + switch (table->serial_port.access_width) {
> + default:
> + pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
> + case ACPI_ACCESS_SIZE_BYTE:
> + iotype = "mmio";
> + break;
> + case ACPI_ACCESS_SIZE_WORD:
> + iotype = "mmio16";
> + break;
> + case ACPI_ACCESS_SIZE_DWORD:
> + iotype = "mmio32";
> + break;
> + }
> + } else
> + iotype = "io";
>
> switch (table->interface_type) {
> case ACPI_DBG2_ARM_SBSA_32BIT:
> diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
> index f0f7403..781cb55 100644
> --- a/include/acpi/acrestyp.h
> +++ b/include/acpi/acrestyp.h
> @@ -372,6 +372,13 @@ struct acpi_resource_generic_register {
> u64 address;
> };
>
> +/* Generic Address Space Access Sizes */
> +#define ACPI_ACCESS_SIZE_UNDEFINED 0
> +#define ACPI_ACCESS_SIZE_BYTE 1
> +#define ACPI_ACCESS_SIZE_WORD 2
> +#define ACPI_ACCESS_SIZE_DWORD 3
> +#define ACPI_ACCESS_SIZE_QWORD 4
> +
> struct acpi_resource_gpio {
> u8 revision_id;
> u8 connection_type;
Please don't define this.
It's possible to calculate 8/16/32/64 from the access width value.
Try:
1 << (access_width + 2?
Thanks
Lv
------------------------------
Message: 2
Date: Tue, 16 May 2017 15:13:08 +0800
From: Lv Zheng <lv.zheng(a)intel.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki(a)intel.com>, Len Brown
<len.brown(a)intel.com>, Robert Moore <robert.moore(a)intel.com>, Lv Zheng
<lv.zheng(a)intel.com>, "David E . Box" <david.e.box(a)intel.com>
Cc: Lv Zheng <zetalog(a)gmail.com>, linux-acpi(a)vger.kernel.org,
devel(a)acpica.org, Hans de Goede <hdegoede(a)redhat.com>
Subject: [Devel] [RFC PATCH v2 0/5] ACPICA: Tables: Add deferred
verification support
Message-ID: <cover.1494916766.git.lv.zheng(a)intel.com>
On linux, we can not verify ACPI tables before installing them into the
global table list in early stage due to the number of slot limitations for
early ioremap. This leaves a problem that we cannot detect duplicated
tables in early stage, causing unwanted error messages seen when the
duplicated tables are failed to be loaded [link #1].
This patchset as ACPICA PR [link #2] adds support to verify tables in
acpi_reallocate_root_tables() which is invoked after installing tables in
early stage, being ready for late ioremap and beofre loading table in late
stage. If duplicated tables are detected, acpi_reallocate_root_tables()
stops installing them to the final reallocated global table list.
In v1 patchset [link #3], problems can be seen for dynamic loading tables
which are allocated as virtuall allocated tables. Such tables are
incremented in the global table list as the sanity check done in install
step only compares the table addresses while the virtual allocated
addresses are not stable.
In v2 patchset, we follow original design discussion made in ACPICA devel
mailing list, implements deferred table verification so that duplicate
tables are still can be detected in install step rather than in load step.
Also we removed table signature check according to verified windows
behavior [link #4] and reported issues [link #5].
Link: http://www.spinics.net/lists/linux-acpi/msg72215.html [#1]
Link: https://github.com//acpica/acpica/pull/265 [#2]
Link: http://www.spinics.net/lists/linux-acpi/msg72589.html [#3]
Link: https://github.com//acpica/acpica/pull/121 [#4]
https://bugzilla.kernel.org/show_bug.cgi?id=118601 [#5]
Lv Zheng (5):
ACPICA: Tables: Cleanup table handler invokers
ACPICA: Tables: Do not validate signature for dynamic table load
ACPICA: Tables: Change table duplication check to be related to
acpi_gbl_verify_table_checksum
ACPICA: Tables: Combine checksum/duplication verification together
ACPICA: Tables: Add deferred table verification support
drivers/acpi/acpica/actables.h | 5 +-
drivers/acpi/acpica/tbdata.c | 222 ++++++++++++++++++++++++++++++++++++-----
drivers/acpi/acpica/tbinstal.c | 161 ++++--------------------------
drivers/acpi/acpica/tbxface.c | 36 ++++++-
drivers/acpi/acpica/tbxfload.c | 2 +-
drivers/acpi/bus.c | 3 -
drivers/acpi/tables.c | 4 +-
include/acpi/acpixf.h | 15 +--
include/acpi/actbl.h | 1 +
9 files changed, 266 insertions(+), 183 deletions(-)
--
2.7.4
------------------------------
Message: 3
Date: Tue, 16 May 2017 15:13:17 +0800
From: Lv Zheng <lv.zheng(a)intel.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki(a)intel.com>, Len Brown
<len.brown(a)intel.com>, Robert Moore <robert.moore(a)intel.com>, Lv Zheng
<lv.zheng(a)intel.com>, "David E . Box" <david.e.box(a)intel.com>
Cc: Lv Zheng <zetalog(a)gmail.com>, linux-acpi(a)vger.kernel.org,
devel(a)acpica.org, Hans de Goede <hdegoede(a)redhat.com>
Subject: [Devel] [RFC PATCH v2 1/5] ACPICA: Tables: Cleanup table
handler invokers
Message-ID:
<c8a48e0379ed9d06d50844b4d7ac59ac8fb6e7d7.1494916766.git.lv.zheng(a)intel.com>
Recently, we allows the table mutex to be held in both early and late stage
APIs. This patch further cleans up the related code to reduce redundant
code related to acpi_gbl_table_handler. Lv Zheng.
Tested-by: Hans de Goede <hdegoede(a)redhat.com>
Signed-off-by: Lv Zheng <lv.zheng(a)intel.com>
---
drivers/acpi/acpica/actables.h | 2 ++
drivers/acpi/acpica/tbdata.c | 43 ++++++++++++++++++++++++++++--------------
drivers/acpi/acpica/tbinstal.c | 8 ++------
3 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index c8da453..89ed31b 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -132,6 +132,8 @@ acpi_tb_install_and_load_table(acpi_physical_address address,
acpi_status acpi_tb_unload_table(u32 table_index);
+void acpi_tb_notify_table(u32 event, void *table);
+
void acpi_tb_terminate(void);
acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index);
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 27c5c27..42ea044 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -818,13 +818,9 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node)
acpi_ev_update_gpes(owner_id);
}
- /* Invoke table handler if present */
-
- if (acpi_gbl_table_handler) {
- (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table,
- acpi_gbl_table_handler_context);
- }
+ /* Invoke table handler */
+ acpi_tb_notify_table(ACPI_TABLE_EVENT_LOAD, table);
return_ACPI_STATUS(status);
}
@@ -892,15 +888,11 @@ acpi_status acpi_tb_unload_table(u32 table_index)
return_ACPI_STATUS(AE_NOT_EXIST);
}
- /* Invoke table handler if present */
+ /* Invoke table handler */
- if (acpi_gbl_table_handler) {
- status = acpi_get_table_by_index(table_index, &table);
- if (ACPI_SUCCESS(status)) {
- (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD,
- table,
- acpi_gbl_table_handler_context);
- }
+ status = acpi_get_table_by_index(table_index, &table);
+ if (ACPI_SUCCESS(status)) {
+ acpi_tb_notify_table(ACPI_TABLE_EVENT_UNLOAD, table);
}
/* Delete the portion of the namespace owned by this table */
@@ -914,3 +906,26 @@ acpi_status acpi_tb_unload_table(u32 table_index)
acpi_tb_set_table_loaded_flag(table_index, FALSE);
return_ACPI_STATUS(status);
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_notify_table
+ *
+ * PARAMETERS: event - Table event
+ * table - Validated table pointer
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Notify a table event to the users.
+ *
+ ******************************************************************************/
+
+void acpi_tb_notify_table(u32 event, void *table)
+{
+ /* Invoke table handler if present */
+
+ if (acpi_gbl_table_handler) {
+ (void)acpi_gbl_table_handler(event, table,
+ acpi_gbl_table_handler_context);
+ }
+}
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 4620f3c..ee74515 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -306,14 +306,10 @@ acpi_tb_install_standard_table(acpi_physical_address address,
acpi_tb_install_table_with_override(&new_table_desc, override,
table_index);
- /* Invoke table handler if present */
+ /* Invoke table handler */
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
- if (acpi_gbl_table_handler) {
- (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_INSTALL,
- new_table_desc.pointer,
- acpi_gbl_table_handler_context);
- }
+ acpi_tb_notify_table(ACPI_TABLE_EVENT_INSTALL, new_table_desc.pointer);
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
unlock_and_exit:
--
2.7.4
------------------------------
Message: 4
Date: Tue, 16 May 2017 15:13:26 +0800
From: Lv Zheng <lv.zheng(a)intel.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki(a)intel.com>, Len Brown
<len.brown(a)intel.com>, Robert Moore <robert.moore(a)intel.com>, Lv Zheng
<lv.zheng(a)intel.com>, "David E . Box" <david.e.box(a)intel.com>
Cc: Lv Zheng <zetalog(a)gmail.com>, linux-acpi(a)vger.kernel.org,
devel(a)acpica.org, Hans de Goede <hdegoede(a)redhat.com>
Subject: [Devel] [RFC PATCH v2 2/5] ACPICA: Tables: Do not validate
signature for dynamic table load
Message-ID:
<f07bb8cfeda364698adad9bc15d54c9b2ac8b366.1494916766.git.lv.zheng(a)intel.com>
Windows seems to allow arbitrary table signatures for Load/load_table
opcodes:
ACPI BIOS Error (bug): Table has invalid signature [PRAD] (0x44415250)
So this patch removes dynamic load signature checks. However we need to
find a way to avoid table loading against tables like MADT. This is not
covered by this commit.
This Windows behavior has been validated on link #1. An end user bug
report can also be found on link #2.
This patch also includes simple cleanup for static load signature check
code. Reported by Ye Xiaolong, Fixed by Lv Zheng.
Link: https://github.com/acpica/acpica/pull/121 [#1]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=118601 [#2]
Reported-by: Ye Xiaolong <xiaolong.ye(a)intel.com>
Signed-off-by: Lv Zheng <lv.zheng(a)intel.com>
---
drivers/acpi/acpica/tbinstal.c | 28 ----------------------------
drivers/acpi/acpica/tbxfload.c | 2 +-
2 files changed, 1 insertion(+), 29 deletions(-)
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index ee74515..9d21296 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -222,34 +222,6 @@ acpi_tb_install_standard_table(acpi_physical_address address,
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
if (reload) {
- /*
- * Validate the incoming table signature.
- *
- * 1) Originally, we checked the table signature for "SSDT" or "PSDT".
- * 2) We added support for OEMx tables, signature "OEM".
- * 3) Valid tables were encountered with a null signature, so we just
- * gave up on validating the signature, (05/2008).
- * 4) We encountered non-AML tables such as the MADT, which caused
- * interpreter errors and kernel faults. So now, we once again allow
- * only "SSDT", "OEMx", and now, also a null signature. (05/2011).
- */
- if ((new_table_desc.signature.ascii[0] != 0x00) &&
- (!ACPI_COMPARE_NAME
- (&new_table_desc.signature, ACPI_SIG_SSDT))
- && (strncmp(new_table_desc.signature.ascii, "OEM", 3))) {
- ACPI_BIOS_ERROR((AE_INFO,
- "Table has invalid signature [%4.4s] (0x%8.8X), "
- "must be SSDT or OEMx",
- acpi_ut_valid_nameseg(new_table_desc.
- signature.
- ascii) ?
- new_table_desc.signature.
- ascii : "????",
- new_table_desc.signature.integer));
-
- status = AE_BAD_SIGNATURE;
- goto unlock_and_exit;
- }
/* Check if table is already registered */
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index b71ce3b..d81f442 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -206,7 +206,7 @@ acpi_status acpi_tb_load_namespace(void)
for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) {
table = &acpi_gbl_root_table_list.tables[i];
- if (!acpi_gbl_root_table_list.tables[i].address ||
+ if (!table->address ||
(!ACPI_COMPARE_NAME(table->signature.ascii, ACPI_SIG_SSDT)
&& !ACPI_COMPARE_NAME(table->signature.ascii,
ACPI_SIG_PSDT)
--
2.7.4
------------------------------
Message: 5
Date: Tue, 16 May 2017 15:13:39 +0800
From: Lv Zheng <lv.zheng(a)intel.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki(a)intel.com>, Len Brown
<len.brown(a)intel.com>, Robert Moore <robert.moore(a)intel.com>, Lv Zheng
<lv.zheng(a)intel.com>, "David E . Box" <david.e.box(a)intel.com>
Cc: Lv Zheng <zetalog(a)gmail.com>, linux-acpi(a)vger.kernel.org,
devel(a)acpica.org, Hans de Goede <hdegoede(a)redhat.com>
Subject: [Devel] [RFC PATCH v2 3/5] ACPICA: Tables: Change table
duplication check to be related to acpi_gbl_verify_table_checksum
Message-ID:
<579de00f5d54e128b04bba5ae627afd0f132c528.1494916766.git.lv.zheng(a)intel.com>
acpi_gbl_verify_table_checksum is used to avoid validating (mapping) an entire
table in OS boot stage. 2nd "Reload" check in acpi_tb_install_standard_table()
is prepared for the same purpose. So this patch combines them together
using a renamed acpi_gbl_enable_table_validation flag. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng(a)intel.com>
---
drivers/acpi/acpica/tbdata.c | 4 ++--
drivers/acpi/acpica/tbinstal.c | 2 +-
drivers/acpi/acpica/tbxface.c | 8 ++++++++
drivers/acpi/bus.c | 2 +-
drivers/acpi/tables.c | 4 ++--
include/acpi/acpixf.h | 15 ++++++++-------
6 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 42ea044..e81355b 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -338,7 +338,7 @@ void acpi_tb_invalidate_table(struct acpi_table_desc *table_desc)
acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc)
{
- if (!table_desc->pointer && !acpi_gbl_verify_table_checksum) {
+ if (!table_desc->pointer && !acpi_gbl_enable_table_validation) {
/*
* Only validates the header of the table.
* Note that Length contains the size of the mapping after invoking
@@ -394,7 +394,7 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature)
/* Verify the checksum */
- if (acpi_gbl_verify_table_checksum) {
+ if (acpi_gbl_enable_table_validation) {
status =
acpi_tb_verify_checksum(table_desc->pointer,
table_desc->length);
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 9d21296..f7bc362 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -221,7 +221,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
- if (reload) {
+ if (acpi_gbl_enable_table_validation) {
/* Check if table is already registered */
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index 010b1c43..b0dc841 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -194,6 +194,14 @@ 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.
+ */
+ acpi_gbl_enable_table_validation = TRUE;
+ }
+
acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE;
status = acpi_tb_resize_root_table_list();
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 34fbe02..c26342f 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1010,7 +1010,7 @@ void __init acpi_early_init(void)
printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
/* It's safe to verify table checksums during late stage */
- acpi_gbl_verify_table_checksum = TRUE;
+ acpi_gbl_enable_table_validation = TRUE;
/* enable workarounds, unless strict ACPI spec. compliance */
if (!acpi_strict)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 0dae722..b5cc09c 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -740,10 +740,10 @@ int __init acpi_table_init(void)
if (acpi_verify_table_checksum) {
pr_info("Early table checksum verification enabled\n");
- acpi_gbl_verify_table_checksum = TRUE;
+ acpi_gbl_enable_table_validation = TRUE;
} else {
pr_info("Early table checksum verification disabled\n");
- acpi_gbl_verify_table_checksum = FALSE;
+ acpi_gbl_enable_table_validation = FALSE;
}
status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 15c86ce..88a1de8 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -160,13 +160,14 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
/*
- * Whether or not to verify the table checksum before installation. Set
- * this to TRUE to verify the table checksum before install it to the table
- * manager. Note that enabling this option causes errors to happen in some
- * OSPMs during early initialization stages. Default behavior is to do such
- * verification.
- */
-ACPI_INIT_GLOBAL(u8, acpi_gbl_verify_table_checksum, TRUE);
+ * Whether or not to validate (map) an entire table to verify
+ * checksum/duplication in early stage before install. Set this to TRUE to
+ * allow early table validation before install it to the table manager.
+ * Note that enabling this option causes errors to happen in some OSPMs
+ * during early initialization stages. Default behavior is to allow such
+ * validation.
+ */
+ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_table_validation, TRUE);
/*
* Optionally enable output from the AML Debug Object.
--
2.7.4
------------------------------
Message: 6
Date: Tue, 16 May 2017 15:13:48 +0800
From: Lv Zheng <lv.zheng(a)intel.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki(a)intel.com>, Len Brown
<len.brown(a)intel.com>, Robert Moore <robert.moore(a)intel.com>, Lv Zheng
<lv.zheng(a)intel.com>, "David E . Box" <david.e.box(a)intel.com>
Cc: Lv Zheng <zetalog(a)gmail.com>, linux-acpi(a)vger.kernel.org,
devel(a)acpica.org, Hans de Goede <hdegoede(a)redhat.com>
Subject: [Devel] [RFC PATCH v2 4/5] ACPICA: Tables: Combine
checksum/duplication verification together
Message-ID:
<eef9d0a56bb7bd7383dda740042b583fa58103c7.1494916766.git.lv.zheng(a)intel.com>
They are all mechanism used to verify if a table is qualified to be
installed and controlled by acpi_gbl_enable_table_validation, so combine
them together. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng(a)intel.com>
---
drivers/acpi/acpica/actables.h | 3 +-
drivers/acpi/acpica/tbdata.c | 148 +++++++++++++++++++++++++++++++++++++++--
drivers/acpi/acpica/tbinstal.c | 124 ++++++----------------------------
3 files changed, 165 insertions(+), 110 deletions(-)
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index 89ed31b..84a3ceb 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -76,7 +76,8 @@ void acpi_tb_release_temp_table(struct acpi_table_desc *table_desc);
acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc);
acpi_status
-acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature);
+acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc,
+ char *signature, u32 *table_index);
u8 acpi_tb_is_table_loaded(u32 table_index);
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index e81355b..2dee2cd 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -50,6 +50,57 @@
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME("tbdata")
+/* Local prototypes */
+static acpi_status
+acpi_tb_check_duplication(struct acpi_table_desc *table_desc, u32 *table_index);
+
+static u8
+acpi_tb_compare_tables(struct acpi_table_desc *table_desc, u32 table_index);
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_compare_tables
+ *
+ * PARAMETERS: table_desc - Table 1 descriptor to be compared
+ * table_index - Index of table 2 to be compared
+ *
+ * RETURN: TRUE if both tables are identical.
+ *
+ * DESCRIPTION: This function compares a table with another table that has
+ * already been installed in the root table list.
+ *
+ ******************************************************************************/
+
+static u8
+acpi_tb_compare_tables(struct acpi_table_desc *table_desc, u32 table_index)
+{
+ acpi_status status = AE_OK;
+ u8 is_identical;
+ struct acpi_table_header *table;
+ u32 table_length;
+ u8 table_flags;
+
+ status =
+ acpi_tb_acquire_table(&acpi_gbl_root_table_list.tables[table_index],
+ &table, &table_length, &table_flags);
+ if (ACPI_FAILURE(status)) {
+ return (FALSE);
+ }
+
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ is_identical = (u8)((table_desc->length != table_length ||
+ memcmp(table_desc->pointer, table, table_length)) ?
+ FALSE : TRUE);
+
+ /* Release the acquired table */
+
+ acpi_tb_release_table(table, table_length, table_flags);
+ return (is_identical);
+}
+
/*******************************************************************************
*
* FUNCTION: acpi_tb_init_table_descriptor
@@ -64,6 +115,7 @@ ACPI_MODULE_NAME("tbdata")
* DESCRIPTION: Initialize a new table descriptor
*
******************************************************************************/
+
void
acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc,
acpi_physical_address address,
@@ -354,12 +406,78 @@ acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc)
return (acpi_tb_validate_table(table_desc));
}
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_check_duplication
+ *
+ * PARAMETERS: table_desc - Table descriptor
+ * table_index - Where the table index is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Avoid installing duplicated tables. However table override and
+ * user aided dynamic table load is allowed, thus comparing the
+ * address of the table is not sufficient, and checking the entire
+ * table content is required.
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_tb_check_duplication(struct acpi_table_desc *table_desc, u32 *table_index)
+{
+ u32 i;
+
+ ACPI_FUNCTION_TRACE(tb_check_duplication);
+
+ /* Check if table is already registered */
+
+ for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) {
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ if (!acpi_tb_compare_tables(table_desc, i)) {
+ continue;
+ }
+
+ /*
+ * Note: the current mechanism does not unregister a table if it is
+ * dynamically unloaded. The related namespace entries are deleted,
+ * but the table remains in the root table list.
+ *
+ * The assumption here is that the number of different tables that
+ * will be loaded is actually small, and there is minimal overhead
+ * in just keeping the table in case it is needed again.
+ *
+ * If this assumption changes in the future (perhaps on large
+ * machines with many table load/unload operations), tables will
+ * need to be unregistered when they are unloaded, and slots in the
+ * root table list should be reused when empty.
+ */
+ if (acpi_gbl_root_table_list.tables[i].flags &
+ ACPI_TABLE_IS_LOADED) {
+
+ /* Table is still loaded, this is an error */
+
+ return_ACPI_STATUS(AE_ALREADY_EXISTS);
+ } else {
+ *table_index = i;
+ return_ACPI_STATUS(AE_CTRL_TERMINATE);
+ }
+ }
+
+ /* Indicate no duplication to the caller */
+
+ return_ACPI_STATUS(AE_OK);
+}
+
/******************************************************************************
*
* FUNCTION: acpi_tb_verify_temp_table
*
* PARAMETERS: table_desc - Table descriptor
* signature - Table signature to verify
+ * table_index - Where the table index is returned
*
* RETURN: Status
*
@@ -369,7 +487,8 @@ acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc)
*****************************************************************************/
acpi_status
-acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature)
+acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc,
+ char *signature, u32 *table_index)
{
acpi_status status = AE_OK;
@@ -392,9 +511,10 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature)
goto invalidate_and_exit;
}
- /* Verify the checksum */
-
if (acpi_gbl_enable_table_validation) {
+
+ /* Verify the checksum */
+
status =
acpi_tb_verify_checksum(table_desc->pointer,
table_desc->length);
@@ -411,9 +531,29 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature)
goto invalidate_and_exit;
}
+
+ /* Avoid duplications */
+
+ if (table_index) {
+ status =
+ acpi_tb_check_duplication(table_desc, table_index);
+ if (ACPI_FAILURE(status) && status != AE_CTRL_TERMINATE) {
+ ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY,
+ "%4.4s 0x%8.8X%8.8X"
+ " Table is duplicated",
+ acpi_ut_valid_nameseg
+ (table_desc->signature.
+ ascii) ? table_desc->signature.
+ ascii : "????",
+ ACPI_FORMAT_UINT64(table_desc->
+ address)));
+
+ goto invalidate_and_exit;
+ }
+ }
}
- return_ACPI_STATUS(AE_OK);
+ return_ACPI_STATUS(status);
invalidate_and_exit:
acpi_tb_invalidate_table(table_desc);
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index f7bc362..9404801 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -48,54 +48,6 @@
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME("tbinstal")
-/* Local prototypes */
-static u8
-acpi_tb_compare_tables(struct acpi_table_desc *table_desc, u32 table_index);
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_tb_compare_tables
- *
- * PARAMETERS: table_desc - Table 1 descriptor to be compared
- * table_index - Index of table 2 to be compared
- *
- * RETURN: TRUE if both tables are identical.
- *
- * DESCRIPTION: This function compares a table with another table that has
- * already been installed in the root table list.
- *
- ******************************************************************************/
-
-static u8
-acpi_tb_compare_tables(struct acpi_table_desc *table_desc, u32 table_index)
-{
- acpi_status status = AE_OK;
- u8 is_identical;
- struct acpi_table_header *table;
- u32 table_length;
- u8 table_flags;
-
- status =
- acpi_tb_acquire_table(&acpi_gbl_root_table_list.tables[table_index],
- &table, &table_length, &table_flags);
- if (ACPI_FAILURE(status)) {
- return (FALSE);
- }
-
- /*
- * Check for a table match on the entire table length,
- * not just the header.
- */
- is_identical = (u8)((table_desc->length != table_length ||
- memcmp(table_desc->pointer, table, table_length)) ?
- FALSE : TRUE);
-
- /* Release the acquired table */
-
- acpi_tb_release_table(table, table_length, table_flags);
- return (is_identical);
-}
-
/*******************************************************************************
*
* FUNCTION: acpi_tb_install_table_with_override
@@ -112,7 +64,6 @@ acpi_tb_compare_tables(struct acpi_table_desc *table_desc, u32 table_index)
* table array.
*
******************************************************************************/
-
void
acpi_tb_install_table_with_override(struct acpi_table_desc *new_table_desc,
u8 override, u32 *table_index)
@@ -210,67 +161,28 @@ acpi_tb_install_standard_table(acpi_physical_address address,
goto release_and_exit;
}
- /* Validate and verify a table before installation */
-
- status = acpi_tb_verify_temp_table(&new_table_desc, NULL);
- if (ACPI_FAILURE(status)) {
- goto release_and_exit;
- }
-
/* Acquire the table lock */
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
- if (acpi_gbl_enable_table_validation) {
-
- /* Check if table is already registered */
-
- for (i = 0; i < acpi_gbl_root_table_list.current_table_count;
- ++i) {
- /*
- * Check for a table match on the entire table length,
- * not just the header.
- */
- if (!acpi_tb_compare_tables(&new_table_desc, i)) {
- continue;
- }
+ /* Validate and verify a table before installation */
+ status = acpi_tb_verify_temp_table(&new_table_desc, NULL, &i);
+ if (ACPI_FAILURE(status)) {
+ if (status == AE_CTRL_TERMINATE) {
/*
- * Note: the current mechanism does not unregister a table if it is
- * dynamically unloaded. The related namespace entries are deleted,
- * but the table remains in the root table list.
- *
- * The assumption here is that the number of different tables that
- * will be loaded is actually small, and there is minimal overhead
- * in just keeping the table in case it is needed again.
- *
- * If this assumption changes in the future (perhaps on large
- * machines with many table load/unload operations), tables will
- * need to be unregistered when they are unloaded, and slots in the
- * root table list should be reused when empty.
+ * Table was unloaded, allow it to be reloaded.
+ * As we are going to return AE_OK to the caller, we should
+ * take the responsibility of freeing the input descriptor.
+ * Refill the input descriptor to ensure
+ * acpi_tb_install_table_with_override() can be called again to
+ * indicate the re-installation.
*/
- if (acpi_gbl_root_table_list.tables[i].flags &
- ACPI_TABLE_IS_LOADED) {
-
- /* Table is still loaded, this is an error */
-
- status = AE_ALREADY_EXISTS;
- goto unlock_and_exit;
- } else {
- /*
- * Table was unloaded, allow it to be reloaded.
- * As we are going to return AE_OK to the caller, we should
- * take the responsibility of freeing the input descriptor.
- * Refill the input descriptor to ensure
- * acpi_tb_install_table_with_override() can be called again to
- * indicate the re-installation.
- */
- acpi_tb_uninstall_table(&new_table_desc);
- (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
- *table_index = i;
- return_ACPI_STATUS(AE_OK);
- }
+ acpi_tb_uninstall_table(&new_table_desc);
+ (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
+ return_ACPI_STATUS(AE_OK);
}
+ goto unlock_and_exit;
}
/* Add the table to the global root table list */
@@ -350,9 +262,11 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
finish_override:
- /* Validate and verify a table before overriding */
-
- status = acpi_tb_verify_temp_table(&new_table_desc, NULL);
+ /*
+ * Validate and verify a table before overriding, no nested table
+ * duplication check as it's too complicated and unnecessary.
+ */
+ status = acpi_tb_verify_temp_table(&new_table_desc, NULL, NULL);
if (ACPI_FAILURE(status)) {
return;
}
--
2.7.4
------------------------------
Subject: Digest Footer
_______________________________________________
Devel mailing list
Devel(a)acpica.org
https://lists.acpica.org/mailman/listinfo/devel
------------------------------
End of Devel Digest, Vol 77, Issue 2
************************************
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
3 years, 9 months
[RFC PATCH v2 0/5] ACPICA: Tables: Add deferred verification support
by Lv Zheng
On linux, we can not verify ACPI tables before installing them into the
global table list in early stage due to the number of slot limitations for
early ioremap. This leaves a problem that we cannot detect duplicated
tables in early stage, causing unwanted error messages seen when the
duplicated tables are failed to be loaded [link #1].
This patchset as ACPICA PR [link #2] adds support to verify tables in
acpi_reallocate_root_tables() which is invoked after installing tables in
early stage, being ready for late ioremap and beofre loading table in late
stage. If duplicated tables are detected, acpi_reallocate_root_tables()
stops installing them to the final reallocated global table list.
In v1 patchset [link #3], problems can be seen for dynamic loading tables
which are allocated as virtuall allocated tables. Such tables are
incremented in the global table list as the sanity check done in install
step only compares the table addresses while the virtual allocated
addresses are not stable.
In v2 patchset, we follow original design discussion made in ACPICA devel
mailing list, implements deferred table verification so that duplicate
tables are still can be detected in install step rather than in load step.
Also we removed table signature check according to verified windows
behavior [link #4] and reported issues [link #5].
Link: http://www.spinics.net/lists/linux-acpi/msg72215.html [#1]
Link: https://github.com//acpica/acpica/pull/265 [#2]
Link: http://www.spinics.net/lists/linux-acpi/msg72589.html [#3]
Link: https://github.com//acpica/acpica/pull/121 [#4]
https://bugzilla.kernel.org/show_bug.cgi?id=118601 [#5]
Lv Zheng (5):
ACPICA: Tables: Cleanup table handler invokers
ACPICA: Tables: Do not validate signature for dynamic table load
ACPICA: Tables: Change table duplication check to be related to
acpi_gbl_verify_table_checksum
ACPICA: Tables: Combine checksum/duplication verification together
ACPICA: Tables: Add deferred table verification support
drivers/acpi/acpica/actables.h | 5 +-
drivers/acpi/acpica/tbdata.c | 222 ++++++++++++++++++++++++++++++++++++-----
drivers/acpi/acpica/tbinstal.c | 161 ++++--------------------------
drivers/acpi/acpica/tbxface.c | 36 ++++++-
drivers/acpi/acpica/tbxfload.c | 2 +-
drivers/acpi/bus.c | 3 -
drivers/acpi/tables.c | 4 +-
include/acpi/acpixf.h | 15 +--
include/acpi/actbl.h | 1 +
9 files changed, 266 insertions(+), 183 deletions(-)
--
2.7.4
3 years, 9 months
Re: [Devel] [PATCH] ACPI: SPCR: Use access width to determine mmio usage
by Zheng, Lv
Hi,
> From: Jon Mason [mailto:jon.mason@broadcom.com]
> Sent: Thursday, May 4, 2017 11:06 PM
> Subject: [PATCH] ACPI: SPCR: Use access width to determine mmio usage
>
> The current SPCR code does not check the access width of the mmio, and
> uses a default of 8bit register accesses. This prevents devices that
> only do 16 or 32bit register accesses from working. By simply checking
> this field and setting the mmio string appropriately, this issue can be
> corrected. To prevent any legacy issues, the code will default to 8bit
> accesses if the value is anything but 16 or 32.
>
> Signed-off-by: Jon Mason <jon.mason(a)broadcom.com>
> ---
> drivers/acpi/spcr.c | 18 ++++++++++++++++--
> include/acpi/acrestyp.h | 7 +++++++
> 2 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
> index 01c9466..11233f6 100644
> --- a/drivers/acpi/spcr.c
> +++ b/drivers/acpi/spcr.c
> @@ -74,8 +74,22 @@ int __init parse_spcr(bool earlycon)
> goto done;
> }
>
> - iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ?
> - "mmio" : "io";
> + if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
> + switch (table->serial_port.access_width) {
> + default:
> + pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
> + case ACPI_ACCESS_SIZE_BYTE:
> + iotype = "mmio";
> + break;
> + case ACPI_ACCESS_SIZE_WORD:
> + iotype = "mmio16";
> + break;
> + case ACPI_ACCESS_SIZE_DWORD:
> + iotype = "mmio32";
> + break;
> + }
> + } else
> + iotype = "io";
>
> switch (table->interface_type) {
> case ACPI_DBG2_ARM_SBSA_32BIT:
> diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
> index f0f7403..781cb55 100644
> --- a/include/acpi/acrestyp.h
> +++ b/include/acpi/acrestyp.h
> @@ -372,6 +372,13 @@ struct acpi_resource_generic_register {
> u64 address;
> };
>
> +/* Generic Address Space Access Sizes */
> +#define ACPI_ACCESS_SIZE_UNDEFINED 0
> +#define ACPI_ACCESS_SIZE_BYTE 1
> +#define ACPI_ACCESS_SIZE_WORD 2
> +#define ACPI_ACCESS_SIZE_DWORD 3
> +#define ACPI_ACCESS_SIZE_QWORD 4
> +
> struct acpi_resource_gpio {
> u8 revision_id;
> u8 connection_type;
Please don't define this.
It's possible to calculate 8/16/32/64 from the access width value.
Try:
1 << (access_width + 2)
Thanks
Lv
3 years, 10 months