All instances using a named parseOp's path field has a type
cast from UINT8* to char*. Changing path's type from UINT8*
to char* eliminates type casting and retains the previous
behavior.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Adds the dual GNU/BSD dual license to the existing Intel license.
Provides all licensing information in each source module.
Affects all ACPICA source modules.
This is to facilitate compiling ACPICA tools as 32-bit programs on 64-bit machines.
To build as 32 bit programs, set the M32 variable to true when running make
Example: make M32=TRUE
Note: if the above results in a compilation error, there is a possibility
that 32-bit libraries may not be installed. If this is the case, run the
following command (on Ubuntu compiling with gcc)
sudo apt-get install g++-multilib libc6-dev-i386
and run make again.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
this option disables test execution and terminates after test suite
compilation and binary comparison.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
This gets rid of slack mode and normal mode within the test suite and replaces
this with opt (optimized) and nopt (non-optimized) modes.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
This adds the capability for ASLTS to exercise the aml disassembler during the
compilation of ASLTS. This is done by comparing aml generated by compiling and
disassembling/recompiling each test case and performing a binary comparison
between the two aml files.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Remove apparently arbitrary restriction on the size of the cache
objects to 16 (in AcpiOsCreateCache). Now, the input object
size must be simply non-zero.
The key feature of this utility is that the original comments within
the input ASL files are preserved during the conversion process, and
included within the converted ASL+ file -- thus creating a transparent
conversion of existing ASL files to ASL+ (ASL 2.0)
The patch adds an ACPICA testing feature that allows external
opcodes to be generated in place. This switch (-oE) doesn't place
an If (0) block around the opcodes since use of this functions is
for compiler/disassemblr testing only and is not intended to be
run through the interpreter. When this switch is used, the
disassembler will output the externals in the same location they
were at in the original ASL code and will not generate a separate
list of externals at the top of the file.
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
In the current IORT template, ID array example is only prepared for the ITS
group node while it is defined in the spec that the ITS group node doesn't
contain the ID array:
Table 11 ITS Group Format
Number of ID mappings:
This field has a value of 0. ITS groups do not have IDs.
In the refined IORT template, ID array(s) is deleted from the ITS group and
are prepared for all other nodes so that after we automatically resets
MappingOffset in the iasl IORT compilation code, MappingOffset can still be
properly set to the developer re-usable values. ACPICA BZ 1340, reported by
Alexei Fedorov, fixed by Lv Zheng.
Link: https://bugs.acpica.org/show_bug.cgi?id=1340
Reported-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
If the IORT template is compiled and then iort.aml binary disassembled to
iort.dsl, SMMUv1 node lists incorrect offset for SMMU_NSgCfgIrpt Interrupt:
[0ECh 0236 8] SMMU_NSgIrpt Interrupt : 0000000000000000
[0ECh 0236 8] SMMU_NSgCfgIrpt Interrupt : 0000000000000000
This is because iasl hasn't implemented SMMU GSI decoding yet.
This patch fixes this issue by preparing structures for decoding IORT SMMU
GSI. ACPICA BZ 1340, reported by Alexei Fedorov, fixed by Lv Zheng.
Link: https://bugs.acpica.org/show_bug.cgi?id=1340
Reported-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
In IORT spec, there are definitions for ItsGroup Node, allowing 0 to be set
for "MappingOffset" of ID array:
Table 11 ITS Group Format
Reference to ID Array:
This field has a value of 0. There is no ID array.
This patch thus resets MappingOffset when MappingCount is 0 to avoid fatals
occuring to the possible buggy OSPMs when they are processing the iasl
compiled IORT table. ACPICA BZ 1340, Reported by Alexei Fedorov, fixed by
Lv Zheng.
Link: https://bugs.acpica.org/show_bug.cgi?id=1340
Reported-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This change is a cleanup and further standardization of the AML
opcode defines in amlcode.h
Improves the readability and maintainability of the source code.
When the single-step mode is used, evaluation is actually split by the
single-step command prompts, so this patch correctly marks the evaluation
segment with interpreter lock release/acquire.
This in return fixes an issue that in the single-step command prompt,
commands requiring to hold the namespace lock (ex. namespace) cannot be
executed. ACPICA BZ 1362, fixed by Lv Zheng.
Link: https://bugs.acpica.org/show_bug.cgi?id=1362
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
On the error return path when AcpiGetObjectInfo fails the allocated
pathname is not free'd leading to a memory leak. Free pathname
to fix this.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
This change fixes two instances where the repair code made an incorrect
assumption about how reference counts are assigned to package objects.
Resolves issues where a warning was issued about a "large reference
count" -- which usually indicates an attempt to delete an object
that has previously been poisoned and released into the object cache.
I found some ACPI operand cache leaks in ACPI early abort cases.
Boot log of ACPI operand cache leak is as follows:
>[ 0.174332] ACPI: Added _OSI(Module Device)
>[ 0.175504] ACPI: Added _OSI(Processor Device)
>[ 0.176010] ACPI: Added _OSI(3.0 _SCP Extensions)
>[ 0.177032] ACPI: Added _OSI(Processor Aggregator Device)
>[ 0.178284] ACPI: SCI (IRQ16705) allocation failed
>[ 0.179352] ACPI Exception: AE_NOT_ACQUIRED, Unable to install
System Control Interrupt handler (20160930/evevent-131)
>[ 0.180008] ACPI: Unable to start the ACPI Interpreter
>[ 0.181125] ACPI Error: Could not remove SCI handler
(20160930/evmisc-281)
>[ 0.184068] kmem_cache_destroy Acpi-Operand: Slab cache still has
objects
>[ 0.185358] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.0-rc3 #2
>[ 0.186820] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
VirtualBox 12/01/2006
>[ 0.188000] Call Trace:
>[ 0.188000] ? dump_stack+0x5c/0x7d
>[ 0.188000] ? kmem_cache_destroy+0x224/0x230
>[ 0.188000] ? acpi_sleep_proc_init+0x22/0x22
>[ 0.188000] ? acpi_os_delete_cache+0xa/0xd
>[ 0.188000] ? acpi_ut_delete_caches+0x3f/0x7b
>[ 0.188000] ? acpi_terminate+0x5/0xf
>[ 0.188000] ? acpi_init+0x288/0x32e
>[ 0.188000] ? __class_create+0x4c/0x80
>[ 0.188000] ? video_setup+0x7a/0x7a
>[ 0.188000] ? do_one_initcall+0x4e/0x1b0
>[ 0.188000] ? kernel_init_freeable+0x194/0x21a
>[ 0.188000] ? rest_init+0x80/0x80
>[ 0.188000] ? kernel_init+0xa/0x100
>[ 0.188000] ? ret_from_fork+0x25/0x30
When early abort is occurred due to invalid ACPI information, Linux kernel
terminates ACPI by calling AcpiTerminate() function. The function calls
AcpiNsTerminate() function to delete namespace data and ACPI operand cache
(AcpiGbl_ModuleCodeList).
But the deletion code in AcpiNsTerminate() function is wrapped in
ACPI_EXEC_APP definition, therefore the code is only executed when the
definition exists. If the define doesn't exist, ACPI operand cache
(AcpiGbl_ModuleCodeList) is leaked, and stack dump is shown in kernel log.
This causes a security threat because the old kernel (<= 4.9) shows memory
locations of kernel functions in stack dump, therefore kernel ASLR can be
neutralized.
To fix ACPI operand leak for enhancing security, I made a patch which
removes the ACPI_EXEC_APP define in AcpiNsTerminate() function for
executing the deletion code unconditionally.
Signed-off-by: Seunghun Han <kkamagui@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>