14047 Commits

Author SHA1 Message Date
Erik Schmauss
65e878d88c iASL: add null check for file search functionality 2019-04-02 17:40:29 -07:00
Erik Schmauss
7ed23f3f8e iASL: perform middle and back-end only for ASL files
The data table compiler and disassembler can go to clean up at this
point.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 17:40:17 -07:00
Erik Schmauss
57972e2f7b don't close files that point to stderr or stdout 2019-04-02 17:09:37 -07:00
Erik Schmauss
94173b172e iASL: correctly resolve field unit externals
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 17:09:37 -07:00
Erik Schmauss
8c7e732f98 iASL: emit error on unresolved external when compiling multiple tables
This error is added because this can lead to unresolved references
during table load and control method execution. This warning helps
the user detect these issues during compilation rather than runtime.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 17:09:37 -07:00
Erik Schmauss
7586a625f9 Namespace: add check to avoid null pointer dereference
Some ACPICA userspace tools call AcpiUtSubsystemShutdown() during
cleanup and dereference a null pointer when cleaning up the
namespace.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 17:09:37 -07:00
Erik Schmauss
997f6ca123 iASL: perform analysis and code generation after parsing all tables
Performing parse tree analysis on all definition blocks
simultaneously results in more effective namespace cross-reference.
This enables iASL static analysis to determine unresolved external
declarations and namespace collisions during compilation.

In order to take advantage of this, compile definition blocks
with the following command:

iasl dsdt.asl ssdt1.asl ssdt2.asl ...

*** Changes related to multiple files:

Keep track of all files in a global list that is persistent
throughout compilation of both files. This is done in order to
compile multiple ASL files in the same namespace and parse tree.

This also resulted in moving the file handle assignment for the -vi
option during file initialization rather than commandline processing.

As each definition block is parsed, it is connected as a sibling node
to the previous definiton block.

*** Changes related to iASL error reporting:

Also, more error messages were added by replacing the fprintf to
stderr with AslError. By doing so, an error can be logged properly
and AML output files will be cleaned if there is a compiler error.

Adds the ability to print the correct source line by logging the .src
filename in each error node. This is necessary for errors that point
to an include file.

New iASL error: emitting an error when compiling duplicate files.

Ignore max error count when compiling with -f because
compilation needs to continue.

Fix parser error path to correctly abort compilation rather
than trying to proceed with more compilation.

*** Changes related to codegen behavior:

Seek to the end of the AML output file after codegen in case multiple
definition blocks need to be encoded in the same AML file. This makes
other parts of the codebase a little more convinent since it doesn't
have to seek to the correct place in the AML.

*** Misc changes:

Remove a call to ACPI_FREE. We should never be calling ACPI_FREE in
memory allocated in caches.

Display compilation summaries for multiple input files. Files that
have parser errors are reported as having parser errors. The summary
is based on the global file list.

Encapsulate global variables in global file nodes used for summary
reporting.

Final cleanup functions for iASL has been consolidated to the main()
function for simplicity.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 17:09:37 -07:00
Erik Schmauss
fbff97048d iASL: getting rid of unnecessary code, no functional change intended
This seems to be an old vestige resulting from some sort of
restructuring in iASL. These code snippsets are redundant. In
general, iASL needs to do the following:

1.) open all files before starting compilation or disassembly
2.) limit calling AslDoDisassembly() to only two places: for AML
    disassembly and ASL/ASL+ converter

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 17:09:37 -07:00
Furquan Shaikh
6c43e1acdf Events: Clear status of an event before enabling it
Commit 18996f2db918 ("ACPICA: Events: Stop unconditionally
clearing ACPI IRQs during suspend/resume") was added to stop clearing
of event status bits unconditionally on suspend and resume paths. This
was done because of an issue
reported (https://bugzilla.kernel.org/show_bug.cgi?id=196249) where
lid status stays closed even on resume (which happens because event
status bits are cleared unconditionally on resume). Though this change
fixed the issue on suspend path, it introduced regressions on several
resume paths.

First regression was reported and fixed on S5 path by the following
change: commit fa85015c0d95 ("ACPICA: Clear status of all events when
entering S5"). Next regression was reported and fixed on all legacy
sleep paths by the commit f317c7dc12b7 ("ACPICA: Clear status of all
events when entering sleep states"). However, regression still exists
on S0ix sleep path since it does not follow the legacy sleep path.

In case of S0ix, events are enabled as part of device suspend path. If
status bits for the events are set when they are enabled, it could
result in premature wake from S0ix. This change ensures that status is
cleared for any event that is being enabled so that any stale events
are cleared out.

Signed-off-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-04-02 15:07:00 -07:00
Robert Moore
802ec363be Update version to 20190329
Version 20190329.
R03_29_19
2019-03-29 08:14:57 -07:00
Robert Moore
1a8b736af1 Logfile: Changes for version 20190329
Version 20190329.
2019-03-29 08:14:19 -07:00
Robert Moore
c4af4c0ead
Merge pull request #455 from SchmErik/linux-debug-output
Linux: use different debug default than ACPICA
2019-03-21 07:11:29 -07:00
Robert Moore
6eb9ae03a5
Merge pull request #454 from SchmErik/iasl-fix-ww
iASL: fix ww option by using the correct variable to index the array
2019-03-21 07:11:14 -07:00
Robert Moore
605e5d515b
Merge pull request #453 from SchmErik/pcc-spelling-mistake
utilities: fix spelling of PCC to PlatformCommChannel
2019-03-21 07:10:59 -07:00
Robert Moore
d3720d1fc0
Merge pull request #452 from SchmErik/address-range-list-fix
Address range list fix
2019-03-21 07:10:44 -07:00
Robert Moore
5a94af3272
Merge pull request #451 from SchmErik/iasl-acpi-rev
iASL: update supported ACPI specification revision
2019-03-21 07:10:27 -07:00
Erik Schmauss
6090371571 Linux: use different debug default than ACPICA
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-03-15 10:26:15 -07:00
Erik Schmauss
e9afe231cb iASL: fix ww option by using the correct variable to index the array
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-03-13 16:51:15 -07:00
Erik Schmauss
5e5c349e73 utilities: fix spelling of PCC to PlatformCommChannel
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-03-13 16:18:05 -07:00
Erik Schmauss
b233720031 Namespace: remove address node from global list after method termination
ASL OperationRegions declare a range of addresses that it uses. In a
perfect world, the range of addresses should be used exclusively by
the AML interpreter. The OS can use this information to decide which
drivers to load so that the AML interpreter and device drivers use
different regions of memory.

During table load, the address information is added to a global
address range list. Each node in this list contains an address range
as well as a namespace node of the OperationRegion. This list is
deleted at ACPI shutdown.

Unfortunately, ASL OperationRegions can be declared inside of control
methods. Although this is not recommended, modern firmware contains
such code. New module level code changes unintentionally removed the
functionality of adding and removing nodes to the global address
range list.

A few months ago, support for adding addresses has been re-
implemented. However, the removal of the address range list was
missed and resulted in some systems to crash due to the address list
containing bogus namespace nodes from OperationRegions declared in
control methods. In order to fix the crash, this change removes
dynamic OperationRegions after control method termination.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=202475

Reported-by: Michael J Gruber <mjg@fedoraproject.org>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-03-13 15:42:20 -07:00
Erik Schmauss
0f055ccd60 acpiexec: add address list check for dynamic OperagionRegions
There is no mechanism to test proper removal of the global address
list entry added by OperationRegions declared inside of control
methods. In the worst case, there can be a dangling pointer in the
address list and cause systems to crash. This change adds a sanity
check to traverse each element of the global address list before to
ensure that all namespace nodes in the global address list are valid.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-03-13 14:35:11 -07:00
Erik Schmauss
b757af5e4e iASL: update supported ACPI specification revision
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-03-11 11:22:39 -07:00
Robert Moore
01f9848222
Merge pull request #449 from SchmErik/pcc-fix-01
PCC operation region: fix if statement by correctly checking the SpaceId
2019-02-26 13:26:18 -08:00
Erik Schmauss
111934c313 ASLTS: adding PCC operation region tests
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-22 17:21:06 -08:00
Erik Schmauss
edd910317b PCC operation region: fix if statement by correctly checking the SpaceId
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-22 16:11:20 -08:00
Robert Moore
158b3583cd Test suite: makefile changes for new iASL error
Checks for illegal forward references, must be ignored
by some of the tests.
2019-02-22 10:38:46 -08:00
Robert Moore
4a6a10b5a7 Revert "Test suite: Update makefiles for new iASL error"
This reverts commit 65f57d734ce7036b8f8e081346835e3dd3c95979.

Some issues with these changes.
2019-02-22 09:49:17 -08:00
Robert Moore
65f57d734c Test suite: Update makefiles for new iASL error
iASL now detects illegal forward references.
This error must be ignored by some tests.
Makefiles updated.
2019-02-22 08:21:59 -08:00
Robert Moore
24870bd9e7 Rename nameseg length macro/define for clarity
ACPI_NAME_SIZE changed to ACPI_NAMESEG_SIZE
This clarifies that this is the length of an individual
nameseg, not the length of a generic namestring/namepath.
Improves understanding of the code.
2019-02-22 07:46:57 -08:00
Robert Moore
92ec0935f2 Rename nameseg compare macro for clarity
ACPI_COMPARE_NAME changed to ACPI_COMPARE_NAMESEG
This clarifies (1) this is a compare on 4-byte namesegs, not
a generic compare. Improves understanding of the code.
2019-02-22 07:33:55 -08:00
Robert Moore
19c18d3157 Rename nameseg copy macro for clarity
ACPI_MOVE_NAME changed to ACPI_COPY_NAMESEG
This clarifies (1) this is a copy operation, and
(2) it operates on ACPI NameSegs.
Improves understanding of the code.
2019-02-22 07:17:52 -08:00
Robert Moore
3132320003 iASL: Additional forward reference detection (illegal)
Now detect and emit error upon detection of a forward reference
from a Field to an Operation Region. This will fail at runtime
if allowed to pass the compiler.
2019-02-22 07:07:18 -08:00
Robert Moore
95147faefe iASL: Remove some uses of strncopy, replace with memmove
strncpy can overwrite buffers if the code is not careful.
In the case of generating a module/table header, memcpy
is a better implementation.
2019-02-22 07:03:16 -08:00
Robert Moore
fcd68aea5d Disassembler: Improve generation of resource pathnames
Improve code that generates resource descriptor and resource
tag pathnames. The original code used a bunch of str* C library
functions that caused warnings on some compilers.
2019-02-22 06:58:48 -08:00
Robert Moore
5719c9ef13
Merge pull request #448 from ColinIanKing/master
utdecode: fix missing comma in array declaration AcpiGbl_GenericNotify
2019-02-19 10:53:50 -08:00
Colin Ian King
113286a937 utdecode: fix missing comma in array declaration AcpiGbl_GenericNotify
There is a missing comma between strings on the array declaration. Fix
this by adding the missing comma.

Fixes: 205ac8fc7210 ("ACPI 6.3: add Error Disconnect Recover Notification value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
2019-02-18 16:53:02 +00:00
Robert Moore
e66a8468f8 Update version to 20190215
Version 20190215
R02_15_19
2019-02-15 09:36:06 -08:00
Robert Moore
caac614666 Logfile: Changes for version 20190215
Version 20190215
2019-02-15 09:35:09 -08:00
Robert Moore
a3c2251a16
Merge pull request #447 from SchmErik/spell-check
Trivial: fix spelling mistakes
2019-02-15 06:57:42 -08:00
Erik Schmauss
ff5a9c5437 Trivial: fix spelling mistakes
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-14 15:14:57 -08:00
Robert Moore
0c9876c5c9 Detabify a few source files, no functional change
Removed 16 tabs.
2019-02-14 14:02:49 -08:00
Robert Moore
1d914224b9 acpiexec: Add a cast to eliminate warning on VC
In some cases, VC is pickier than gcc.
2019-02-14 13:52:31 -08:00
Robert Moore
703281c033
Merge pull request #445 from SchmErik/acpi63v3
ACPI 6.3 updates
2019-02-14 13:24:08 -08:00
Erik Schmauss
55500e3426 iasl: templates: update GTDT (Rev 3)
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-13 13:22:14 -08:00
Erik Schmauss
2cd926fdf3 ACPI 6.3: add GTDT Revision 3 support
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-13 13:22:14 -08:00
Erik Schmauss
5c1310089f iASL: templates: update HMAT
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-13 13:22:14 -08:00
Erik Schmauss
a216e8ca9f ACPI 6.3: HMAT updates
This change reserves several field to be reserved as well as rename
subtable 0 to "memory proximity domain attributes"

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-13 13:22:14 -08:00
Erik Schmauss
ed187488d1 ACPI 6.3: NFIT: change field name, no functional change
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-13 13:22:14 -08:00
Erik Schmauss
9cef114ce6 ACPI 6.3: MADT: add online capable flag
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-13 13:22:14 -08:00
Erik Schmauss
c736ea34ad ACPI 6.3: PPTT add additional fields in Processor Structure Flags
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2019-02-13 13:22:14 -08:00