14010 Commits

Author SHA1 Message Date
Robert Moore
1f1652dad8 Increase total number of possible Owner IDs
From 255 to 4095 possible IDs.
Reported by: Hedi Berriche (hedi.berriche @hpe.com).
2019-07-25 12:50:20 -07:00
Robert Moore
a36cc3f864 Remove more vs2017 temp files 2019-07-16 12:22:58 -07:00
Robert Moore
71b9e3834c Remove additional files that are vs2017 temp files
under v15 subdirectory.
2019-07-16 12:20:37 -07:00
Robert Moore
0de8bb5a80
Merge pull request #480 from SchmErik/iasl-ret-status
iASL: return -1 if AML files were not generated due to compiler errors
2019-07-12 12:07:51 -07:00
Robert Moore
b19227e401
Merge pull request #479 from SchmErik/table-load-init
Table load: exit interpreter before initializing objects
2019-07-12 12:07:41 -07:00
Robert Moore
509bdb3131
Merge pull request #477 from ColinIanKing/master
Debugger: remove redundant assignment on ObjDesc
2019-07-12 12:07:26 -07:00
Erik Schmauss
1ed9f0276c iASL: return -1 if AML files were not generated due to compiler errors
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-07-11 10:58:13 -07:00
Erik Schmauss
73f6372490 Table load: exit interpreter before initializing objects
This prevents re-acquiring the interpreter lock when loading tables

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-07-11 10:02:12 -07:00
Robert Moore
b28401bfae Remove parts of the MSVC2017 build that are temp files
.vs subdirectory.
2019-07-10 13:48:36 -07:00
Robert Moore
8fd3088aa9 Update msvc2017 project file for iASL compiler
Fixes a reference to "msvc" instead of "msvc2017".
2019-07-10 13:32:04 -07:00
Colin Ian King
f530f1acb3 Debugger: remove redundant assignment on ObjDesc
Pointer ObjDesc is being initialized with a value that is never
read and it is being updated later with a new value. The initialization
is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
2019-07-04 13:58:32 +01:00
Robert Moore
450ffd8b9c Update version to 20190703
Version 20190703.
R07_03_19
2019-07-03 10:15:28 -07:00
Robert Moore
3081296b49 Logfile: Changes for version 20190703
Version 20190703.
2019-07-03 10:14:18 -07:00
Robert Moore
945c9c2196 Tools: update project files to msvc2017
Note: this change deprecates the project files found in
msvc9.
2019-07-03 09:34:34 -07:00
Robert Moore
41e8312492
Merge pull request #475 from SchmErik/rafael-gpe
ACPICA: Clear status of GPEs on first direct enable
2019-07-02 09:41:29 -07:00
Robert Moore
67e98d09b3 Merge branch 'master' of ssh://ssh.github.com/acpica/acpica 2019-07-02 09:29:40 -07:00
Robert Moore
49e12510b3 Update for MSVC 2017, no functional changes
eliminates some warnings on MSVC 2017.
2019-07-02 09:27:57 -07:00
Rafael J. Wysocki
7ef6f75cc2 ACPICA: Clear status of GPEs on first direct enable
ACPI GPEs (other than the EC one) can be enabled in two situations.
First, the GPEs with existing _Lxx and _Exx methods are enabled
implicitly by ACPICA during system initialization.  Second, the GPEs
without these methods (like GPEs listed by _PRW objects for wakeup
devices) need to be enabled directly by the code that is going to use
them (e.g. ACPI power management or device drivers).

In the former case, if the status of a given GPE is set to start
with, its handler method (either _Lxx or _Exx) needs to be invoked to
take care of the events (possibly) signaled before the GPE was
enabled. In the latter case, however, the first caller of
acpi_enable_gpe() for a given GPE should not be expected to care
about any events that might be signaled through it earlier.  In that
case, it is better to clear the status of the GPE before enabling it,
to prevent stale events from triggering unwanted actions (like
spurious system resume, for example).

For this reason, modify acpi_ev_add_gpe_reference() to take an
additional boolean argument indicating whether or not the GPE status
needs to be cleared when its reference counter changes from zero to
one and make acpi_enable_gpe() pass TRUE to it through that new
argument.

Fixes: 18996f2db918 ("ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume")
Reported-by: Furquan Shaikh <furquan@google.com>
Tested-by: Furquan Shaikh <furquan@google.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-06-20 16:20:46 -07:00
Robert Moore
c7ef9f3526 Update table load object initialization
Use the common internal "initialize objects" interface
Affects:
Load()
LoadTable()
AcpiLoadTable
2019-06-20 08:03:29 -07:00
Robert Moore
106c72a97f Update for object initialization sequence
1) Do not allow the objects to be initialized twice
2) Only package objects require a deferred initialization
3) Cleanup initialization output
2019-06-04 13:46:30 -07:00
Robert Moore
d8cb42a6f8 acpiexec: Fix a buffer allocate/deallocate issue
For the function AeGlobalAddressRangeCheck.
2019-06-04 07:44:53 -07:00
Robert Moore
7ab9a21d3d
Merge pull request #474 from SchmErik/iasl-index-field
iASL: fix type mismatch on IndexField
2019-05-29 13:18:54 -07:00
Robert Moore
fa068aaecb
Merge pull request #473 from SchmErik/remove-module-level-code
remove legacy module-level code due to deprecation
2019-05-29 13:18:40 -07:00
Robert Moore
6a152fd728
Merge pull request #472 from SchmErik/iasl-special-names
iASL: ensure that _WAK and _PTS are declared only at the root scope
2019-05-29 13:18:23 -07:00
Erik Schmauss
8efcfcafde iASL: fix type mismatch on IndexField
By definition, Index field should be based off of Field units rather
than Operation Regions.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-29 11:24:41 -07:00
Erik Schmauss
9125603c53 iASL: ensure that certain named objects are declared only at the root scope
_WAK, _PTS, _TTS, and _Sx in any other scope will not be invoked by OS.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-20 14:40:55 -07:00
Erik Schmauss
1ca34b1a7b remove legacy module-level code due to deprecation
There have been several places that has been calling functions
regarding module level code blocks. This change removes all old
vestiges in the codebase. This is dead code.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-16 13:48:39 -07:00
Robert Moore
316dc10d9a Update file permission
nsaccess.c
2019-05-15 10:40:19 -07:00
Robert Moore
76658f55d8 Namespace: simplify creation of the initial/default namespace
For the objects that are created by default (_GPE, _SB_, etc)
there is no need to use the heavyweight NsLookup function.
Instead, simply create each object and link it in as the namespace
is built.
2019-05-15 10:00:35 -07:00
Robert Moore
36449fa1dc Update version to 20190509
Version 20190509.
R05_09_19
2019-05-09 13:53:47 -07:00
Robert Moore
c81b5184f4 Logfile: Changes for version 20190509
Version 20190509.
2019-05-09 13:53:10 -07:00
Robert Moore
2e000583b0
Merge pull request #470 from SchmErik/linux-dbg
Linux: move ACPI_DEBUG_DEFAULT flag out of ifndef
2019-05-09 13:46:52 -07:00
Erik Schmauss
c14f17fa0a Linux: move ACPI_DEBUG_DEFAULT flag out of ifndef
This flag should not be included in #ifndef CONFIG_ACPI. It should be
used unconditionally.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-09 13:32:06 -07:00
Robert Moore
a73bac9888
Merge pull request #469 from SchmErik/fwd-ref
Improve forward reference detection
2019-05-09 12:55:10 -07:00
Robert Moore
ee72d6550e iASL: Add buffer overflow analysis for Create Buffer Field ops
Implemented additional buffer overflow analysis for BufferField
declarations. Check if a buffer index argument to a create buffer
field operation is beyond the end of the target buffer.
 *
 *  This affects these AML operators:
 *
 *  AML_CREATE_FIELD_OP
 *  AML_CREATE_BIT_FIELD_OP
 *  AML_CREATE_BYTE_FIELD_OP
 *  AML_CREATE_WORD_FIELD_OP
 *  AML_CREATE_DWORD_FIELD_OP
 *  AML_CREATE_QWORD_FIELD_OP
2019-05-09 12:52:08 -07:00
Erik Schmauss
be7eaf9586 iASL: improve forward reference detection
This change improves forward reference detection for named objects
inside of scopes.

If a parse object has the OP_NOT_FOUND_DURING_LOAD set, it means that
Op is a reference to a named object that is declared later in the AML
bytecode. This is allowed if the reference is inside of a method and
the declaration is outside of a method like so:

DefinitionBlock(...)
{
    Method (TEST)
    {
        Return (NUM0)
    }
    Name (NUM0,0)
}

However, if the declaration and reference are both in the same method
or outside any methods, this is a forward reference and should be
marked as an error because it would result in runtime errors.

DefinitionBlock(...)
{
    Name (BUFF, Buffer (NUM0) {}) // Forward reference
    Name (NUM0, 0x0)

    Method (TEST)
    {
        Local0 = NUM1
        Name (NUM1, 0x1) // Forward reference
        return (Local0)
    }
}

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-07 13:35:52 -07:00
Erik Schmauss
095238f69f iASL: detect forward references for field declarations at root scope
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-06 10:53:08 -07:00
Robert Moore
263015ebba
Merge pull request #467 from SchmErik/iasl-create-field-error
iASL: add buffer overflow analysis for BufferField declarations
2019-05-03 07:24:19 -07:00
Robert Moore
1fcba8c753
Merge pull request #466 from SchmErik/revert-field-fwd-ref
Revert "iASL: Additional forward reference detection (illegal)"
2019-05-03 07:23:54 -07:00
Robert Moore
3fb00a7346
Merge pull request #465 from SchmErik/trivial-message
iASL: clarify error message when scanning file during checksum genera…
2019-05-03 07:23:32 -07:00
Robert Moore
e82934bba0
Merge pull request #464 from SchmErik/gpe-fix
Revert "Events: Clear status of an event before enabling it"
2019-05-03 07:23:07 -07:00
Robert Moore
a76cd1cf9a
Merge pull request #463 from SchmErik/iasl-fix
iASL: stop clearing error log after parsing each file
2019-05-03 07:21:55 -07:00
Erik Schmauss
96fe359802 iASL: add buffer overflow analysis for BufferField declarations
Create___Field declares a BufferField over an existing buffer. This
change adds an additional check to analyze constant values in the
declarations of these buffer fields. This attempt to detect that the
new buffer does not overrun the original source buffer.

There have been 2 more compiler remarks added. One that states that
the starting index of the new buffer field is beyond the end of the
buffer and another message indicating that the this new buffer
extends beyond the end of the source buffer.

We initially thought that this would actually be an error. However,
consider the following case:

Name (BUF0, buffer(0){}) // Create an empty buffer
Name (BUF1, buffer(0x5){0x0,0x1,0x2,0x3,0x4})
BUF0 = BUF1
CreateByteField (BUF0, 0x0, BYTE) // this is valid!

This code runs without issues because BUF0 gets assigned to BUF1. Due
to the lack of usage analysis in iASL, the source buffer can change
throughout table load or a control method execution.

In order to make this analysis check result as an error, we need to
add additional steps to analyze the usage of BUF0 between its
declaration and it's use in CreateByteField.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-02 21:26:44 -07:00
Erik Schmauss
018bc6b4d3 Revert "iASL: Additional forward reference detection (illegal)"
This reverts commit 3132320003b348bcf48274d4e326e496ffc4b23b.

This commit unintentionally emitted AML bytecode with incorrect
package lengths for some ASL code related to Fields and
OperationRegions. This mal-formed AML can cause systems to crash
during boot.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-02 16:03:19 -07:00
Erik Schmauss
6617e101c1 iASL: clarify error message when scanning file during checksum generation
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-05-02 15:03:04 -07:00
Rafael J. Wysocki
0ae256fd7b Revert "Events: Clear status of an event before enabling it"
This reverts ACPICA commit 6c43e1acdf93a04ca32898d1d89d93fde04d121a.

Revert "ACPICA: Clear status of GPEs before enabling them"

Revert commit c8b1917c8987 ("ACPICA: Clear status of GPEs before
enabling them") that causes problems with Thunderbolt controllers
to occur if a dock device is connected at init time (the xhci_hcd
and thunderbolt modules crash which prevents peripherals connected
through them from working).

Commit c8b1917c8987 effectively causes commit ecc1165b8b74 ("ACPICA:
Dispatch active GPEs at init time") to get undone, so the problem
addressed by commit ecc1165b8b74 appears again as a result of it.

Fixes: c8b1917c8987 ("ACPICA: Clear status of GPEs before enabling them")
Link: https://lore.kernel.org/lkml/s5hy33siofw.wl-tiwai@suse.de/T/#u
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1132943
Reported-by: Michael Hirmke <opensuse@mike.franken.de>
Reported-by: Takashi Iwai <tiwai@suse.de>
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-04-30 11:30:16 -07:00
Erik Schmauss
f6fcb7f449 iASL: stop clearing error log after parsing each file
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-23 11:28:18 -07:00
Robert Moore
a18df084aa
Merge pull request #460 from SchmErik/iasl-preprocess-fix
iASL: do not perform static analysis with -P option
2019-04-18 13:24:43 -07:00
Robert Moore
fb681b3557
Merge pull request #461 from SchmErik/iasl-revert
Revert "iASL: use .src file handle only for include file error messages"
2019-04-18 13:24:18 -07:00
Erik Schmauss
30d64aaef1 Revert "iASL: use .src file handle only for include file error messages"
This reverts commit 1eb3ee94b6ab2e231a5f7cdf7ca6388ff886c031.
2019-04-18 12:46:00 -07:00