ACPICA version 20170728 released
by Moore, Robert
28 July 2017. Summary of changes for version 20170728:
This release is available at https://acpica.org/downloads
1) ACPICA kernel-resident subsystem:
Fixed a regression seen with small resource descriptors that could cause an inadvertent AE_AML_NO_RESOURCE_END_TAG exception.
AML interpreter: Implemented a new feature that allows forward references from individual named references within package objects that are contained within blocks of "module-level code". This provides compatibility with other ACPI implementations and supports existing firmware that depends on this feature. Example:
Name (ABCD, 1)
If (ABCD) /* An If() at module-level */
{
Name (PKG1, Package()
{
INT1 /* Forward reference to object INT1 */
})
Name (INT1, 0x1234)
}
AML Interpreter: Fixed a problem with the Alias() operator where aliases to some ASL objects were not handled properly. Objects affected are: Mutex, Event, and OperationRegion.
AML Debugger: Enhanced to properly handle AML Alias objects. These objects have one level of indirection which was not fully supported by the debugger.
Table Manager: Added support to detect and ignore duplicate SSDTs within the XSDT/RSDT. This error in the XSDT has been seen in the field.
EFI and EDK2 support:
Enabled /WX flag for MSVC builds
Added support for AcpiOsStall, AcpiOsSleep, and AcpiOsGetTimer
Added local support for 64-bit multiply and shift operations
Added support to compile acpidump.efi on Windows
Added OSL function stubs for interfaces not used under EFI
Added additional support for the _DMA predefined name. _DMA returns a buffer containing a resource template. This change add support within the resource manager (AcpiWalkResourceBuffer) to walk and parse this list of resource descriptors. Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
2) iASL Compiler/Disassembler and Tools:
iASL: Fixed a problem where the internal input line buffer(s) could overflow if there are very long lines in the input ASL source code file. Implemented buffer management that automatically increases the size of the buffers as necessary.
iASL: Added an option (-vx) to "expect" particular remarks, warnings and errors. If the specified exception is not raised during compilation, the compiler emits an error. This is intended to support the ASL test suite, but may be useful in other contexts.
iASL: Implemented a new predefined macro, __METHOD__, which returns a string containing the name of the current control method that is being compiled.
iASL: Implemented debugger and table compiler support for the SDEI ACPI table (Software Delegated Exception Interface). James Morse <james.morse(a)arm.com>
Unix/Linux makefiles: Added an option to disable compile optimizations. The disable occurs when the NOOPT flag is set to TRUE. theracermaster(a)gmail.com
Acpidump: Added support for multiple DSDT and FACS tables. This can occur when there are different tables for 32-bit versus 64-bit.
Enhanced error reporting for the ASL test suite (ASLTS) by removing unnecessary/verbose text, and emit the actual line number where an error has occurred. These changes are intended to improve the usefulness of the test suite.
4 years, 11 months
[PATCH v4 0/2] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI)
by Shameer Kolothum
On certain HiSilicon platforms (Hip06/Hip07) the GIC ITS and
PCIe RC deviates from the standard implementation and this breaks
PCIe MSI functionality when SMMU is enabled.
The HiSilicon erratum 161010801 describes this limitation of certain
HiSilicon platforms to support the SMMU mappings for MSI transactions.
On these platforms GICv3 ITS translator is presented with the deviceID
by extending the MSI payload data to 64 bits to include the deviceID.
Hence, the PCIe controller on this platforms has to differentiate the
MSI payload against other DMA payload and has to modify the MSI payload.
This basically makes it difficult for this platforms to have a SMMU
translation for MSI.
To implement this quirk, the following changes are incorporated:
1. Added a generic helper function to IORT code to retrieve and
reserve the HW ITS address regions.
2. Modified iommu_dma_get_resv_regions() to reserve the hw msi
regions which means these address regions will not be translated and
will be excluded from iova allocations.
Thanks,
Shameer
Changelog:
v3 --> v4
Rebased on 4.13-rc1.
Addressed comments from Robin, Will and Lorenzo:
-As suggested by Robin, moved the ITS msi reservation into
iommu_dma_get_resv_regions().
-Added its_count != resv region failure case(patch #1).
v2 --> v3
Addressed comments from Lorenzo and Robin:
-Removed dev_is_pci() check in smmuV3 driver.
-Don't treat device not having an ITS mapping as an error in
iort helper function.
v1 --> v2
-patch 2/2: Invoke iort helper fn based on fwnode type(acpi).
RFCv2 -->PATCH
-Incorporated Lorenzo's review comments.
RFC v1 --> RFC v2
Based on Robin's review comments,
-Removed the generic erratum framework.
-Using IORT/MADT tables to retrieve the ITS base addr instead
of vendor specific CSRT table.
Shameer Kolothum (2):
acpi:iort: Add an IORT helper function to reserve HW ITS address
regions for IOMMU drivers
iommu/dma: Add HW MSI address regions reservation for IOMMU drivers
drivers/acpi/arm64/iort.c | 91 ++++++++++++++++++++++++++++++++++++++--
drivers/iommu/dma-iommu.c | 8 +++-
drivers/irqchip/irq-gic-v3-its.c | 3 +-
include/linux/acpi_iort.h | 8 +++-
4 files changed, 104 insertions(+), 6 deletions(-)
--
1.9.1
4 years, 11 months
[PATCH] ResourceMgr: Allow _DMA method in walk resources
by Lorenzo Pieralisi
The _DMA object contains a resource template, this change adds support
for the walk resources function so that ACPI devices containing a _DMA
object can actually parse it to detect DMA ranges for the respective
bus.
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
---
source/components/resources/rsxface.c | 7 ++++---
source/include/acnames.h | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/source/components/resources/rsxface.c b/source/components/resources/rsxface.c
index 5e3f735..2c27eaf 100644
--- a/source/components/resources/rsxface.c
+++ b/source/components/resources/rsxface.c
@@ -796,7 +796,7 @@ ACPI_EXPORT_SYMBOL (AcpiWalkResourceBuffer)
* device we are querying
* Name - Method name of the resources we want.
* (METHOD_NAME__CRS, METHOD_NAME__PRS, or
- * METHOD_NAME__AEI)
+ * METHOD_NAME__AEI or METHOD_NAME__DMA)
* UserFunction - Called for each resource
* Context - Passed to UserFunction
*
@@ -827,12 +827,13 @@ AcpiWalkResources (
if (!DeviceHandle || !UserFunction || !Name ||
(!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) &&
!ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS) &&
- !ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI)))
+ !ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI) &&
+ !ACPI_COMPARE_NAME (Name, METHOD_NAME__DMA)))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Get the _CRS/_PRS/_AEI resource list */
+ /* Get the _CRS/_PRS/_AEI/_DMA resource list */
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer);
diff --git a/source/include/acnames.h b/source/include/acnames.h
index 27b0b97..69f8884 100644
--- a/source/include/acnames.h
+++ b/source/include/acnames.h
@@ -162,6 +162,7 @@
#define METHOD_NAME__CLS "_CLS"
#define METHOD_NAME__CRS "_CRS"
#define METHOD_NAME__DDN "_DDN"
+#define METHOD_NAME__DMA "_DMA"
#define METHOD_NAME__HID "_HID"
#define METHOD_NAME__INI "_INI"
#define METHOD_NAME__PLD "_PLD"
--
2.10.0
4 years, 11 months
[pm:bleeding-edge 91/101] drivers/base/power/opp/of.c:617:45: error: 'cpu_node' undeclared
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head: 3e3a8af78fdb00f2116394b8aa69be9819d5e8b6
commit: c333fb2b766a84b1528ae48a9aabe2f9b689ca64 [91/101] PM / OPP: Fix get sharing CPUs when hotplug is used
config: x86_64-randconfig-x013-201730 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout c333fb2b766a84b1528ae48a9aabe2f9b689ca64
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:13:0,
from include/linux/list.h:8,
from include/linux/kobject.h:20,
from include/linux/device.h:17,
from include/linux/node.h:17,
from include/linux/cpu.h:16,
from drivers/base/power/opp/of.c:16:
drivers/base/power/opp/of.c: In function 'dev_pm_opp_of_get_sharing_cpus':
>> drivers/base/power/opp/of.c:617:45: error: 'cpu_node' undeclared (first use in this function)
pr_err("%pOF: Couldn't find opp node\n", cpu_node);
^
include/linux/printk.h:301:33: note: in definition of macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
drivers/base/power/opp/of.c:617:45: note: each undeclared identifier is reported only once for each function it appears in
pr_err("%pOF: Couldn't find opp node\n", cpu_node);
^
include/linux/printk.h:301:33: note: in definition of macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
In file included from include/linux/ioport.h:12:0,
from include/linux/device.h:16,
from include/linux/node.h:17,
from include/linux/cpu.h:16,
from drivers/base/power/opp/of.c:16:
drivers/base/power/opp/of.c: At top level:
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:390:2: note: in expansion of macro 'if'
if (p_size == (size_t)-1 && q_size == (size_t)-1)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:380:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:378:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:369:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:367:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:358:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:356:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:348:2: note: in expansion of macro 'if'
if (p_size < size || q_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:345:3: note: in expansion of macro 'if'
if (q_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
vim +/cpu_node +617 drivers/base/power/opp/of.c
565
566 /*
567 * Works only for OPP v2 bindings.
568 *
569 * Returns -ENOENT if operating-points-v2 bindings aren't supported.
570 */
571 /**
572 * dev_pm_opp_of_get_sharing_cpus() - Get cpumask of CPUs sharing OPPs with
573 * @cpu_dev using operating-points-v2
574 * bindings.
575 *
576 * @cpu_dev: CPU device for which we do this operation
577 * @cpumask: cpumask to update with information of sharing CPUs
578 *
579 * This updates the @cpumask with CPUs that are sharing OPPs with @cpu_dev.
580 *
581 * Returns -ENOENT if operating-points-v2 isn't present for @cpu_dev.
582 */
583 int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
584 struct cpumask *cpumask)
585 {
586 struct device_node *np, *tmp_np, *cpu_np;
587 int cpu, ret = 0;
588
589 /* Get OPP descriptor node */
590 np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
591 if (!np) {
592 dev_dbg(cpu_dev, "%s: Couldn't find opp node.\n", __func__);
593 return -ENOENT;
594 }
595
596 cpumask_set_cpu(cpu_dev->id, cpumask);
597
598 /* OPPs are shared ? */
599 if (!of_property_read_bool(np, "opp-shared"))
600 goto put_cpu_node;
601
602 for_each_possible_cpu(cpu) {
603 if (cpu == cpu_dev->id)
604 continue;
605
606 cpu_np = of_get_cpu_node(cpu, NULL);
607 if (!cpu_np) {
608 dev_err(cpu_dev, "%s: failed to get cpu%d node\n",
609 __func__, cpu);
610 ret = -ENOENT;
611 goto put_cpu_node;
612 }
613
614 /* Get OPP descriptor node */
615 tmp_np = _opp_of_get_opp_desc_node(cpu_np);
616 if (!tmp_np) {
> 617 pr_err("%pOF: Couldn't find opp node\n", cpu_node);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
4 years, 11 months
[PATCH 1/2] acpi: add missing include in acpi_numa.h
by Ross Zwisler
Right now if a file includes acpi_numa.h and they don't happen to include
linux/numa.h before it, they get the following warning:
./include/acpi/acpi_numa.h:9:5: warning: "MAX_NUMNODES" is not defined [-Wundef]
#if MAX_NUMNODES > 256
^~~~~~~~~~~~
Signed-off-by: Ross Zwisler <ross.zwisler(a)linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
---
These two small fixes were previously part of my HMAT enabling series, but
I thought I'd submit them seperately so they don't get held up while I'm
iterating that series.
---
include/acpi/acpi_numa.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index d4b7294..1e3a74f 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -3,6 +3,7 @@
#ifdef CONFIG_ACPI_NUMA
#include <linux/kernel.h>
+#include <linux/numa.h>
/* Proximity bitmap length */
#if MAX_NUMNODES > 256
--
2.9.4
4 years, 11 months
[pm:bleeding-edge 28829/28830] include/linux/suspend.h:506:2: error: implicit declaration of function '__pm_pr_dbg'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head: 91fa6cb3c35bb4f4f3eaf6422c155461cbad6386
commit: 4615a22a7ae1ad99c2649c9e0e58ec25130179a9 [28829/28830] PM / timekeeping: Print debug messages when requested
config: x86_64-randconfig-x006-201729 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 4615a22a7ae1ad99c2649c9e0e58ec25130179a9
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from drivers/base//power/main.c:32:0:
include/linux/suspend.h:505:0: warning: "pm_pr_dbg" redefined
#define pm_pr_dbg(fmt, ...) \
include/linux/suspend.h:501:0: note: this is the location of the previous definition
#define pm_pr_dbg(defer, fmt, ...) \
drivers/base//power/main.c: In function 'dpm_show_time':
>> include/linux/suspend.h:506:2: error: implicit declaration of function '__pm_pr_dbg' [-Werror=implicit-function-declaration]
__pm_pr_dbg(false, fmt, ##__VA_ARGS__)
^
>> drivers/base//power/main.c:435:2: note: in expansion of macro 'pm_pr_dbg'
pm_pr_dbg("%s%s%s of devices complete after %ld.%03ld msecs\n",
^~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from kernel//power/suspend.c:26:0:
include/linux/suspend.h:505:0: warning: "pm_pr_dbg" redefined
#define pm_pr_dbg(fmt, ...) \
include/linux/suspend.h:501:0: note: this is the location of the previous definition
#define pm_pr_dbg(defer, fmt, ...) \
kernel//power/suspend.c: In function 's2idle_loop':
>> include/linux/suspend.h:506:2: error: implicit declaration of function '__pm_pr_dbg' [-Werror=implicit-function-declaration]
__pm_pr_dbg(false, fmt, ##__VA_ARGS__)
^
>> kernel//power/suspend.c:109:2: note: in expansion of macro 'pm_pr_dbg'
pm_pr_dbg("suspend-to-idle\n");
^~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from kernel//time/timekeeping_debug.c:22:0:
include/linux/suspend.h:505:0: warning: "pm_pr_dbg" redefined
#define pm_pr_dbg(fmt, ...) \
include/linux/suspend.h:501:0: note: this is the location of the previous definition
#define pm_pr_dbg(defer, fmt, ...) \
kernel//time/timekeeping_debug.c: In function 'tk_debug_account_sleep_time':
include/linux/suspend.h:509:2: error: implicit declaration of function '__pm_pr_dbg' [-Werror=implicit-function-declaration]
__pm_pr_dbg(true, fmt, ##__VA_ARGS__)
^
>> kernel//time/timekeeping_debug.c:79:2: note: in expansion of macro 'pm_deferred_pr_dbg'
pm_deferred_pr_dbg("Timekeeping suspended for %lld.%03lu seconds\n",
^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from drivers/base/power/main.c:32:0:
include/linux/suspend.h:505:0: warning: "pm_pr_dbg" redefined
#define pm_pr_dbg(fmt, ...) \
include/linux/suspend.h:501:0: note: this is the location of the previous definition
#define pm_pr_dbg(defer, fmt, ...) \
drivers/base/power/main.c: In function 'dpm_show_time':
>> include/linux/suspend.h:506:2: error: implicit declaration of function '__pm_pr_dbg' [-Werror=implicit-function-declaration]
__pm_pr_dbg(false, fmt, ##__VA_ARGS__)
^
drivers/base/power/main.c:435:2: note: in expansion of macro 'pm_pr_dbg'
pm_pr_dbg("%s%s%s of devices complete after %ld.%03ld msecs\n",
^~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from kernel/power/suspend.c:26:0:
include/linux/suspend.h:505:0: warning: "pm_pr_dbg" redefined
#define pm_pr_dbg(fmt, ...) \
include/linux/suspend.h:501:0: note: this is the location of the previous definition
#define pm_pr_dbg(defer, fmt, ...) \
kernel/power/suspend.c: In function 's2idle_loop':
>> include/linux/suspend.h:506:2: error: implicit declaration of function '__pm_pr_dbg' [-Werror=implicit-function-declaration]
__pm_pr_dbg(false, fmt, ##__VA_ARGS__)
^
kernel/power/suspend.c:109:2: note: in expansion of macro 'pm_pr_dbg'
pm_pr_dbg("suspend-to-idle\n");
^~~~~~~~~
cc1: some warnings being treated as errors
vim +/__pm_pr_dbg +506 include/linux/suspend.h
504
> 505 #define pm_pr_dbg(fmt, ...) \
> 506 __pm_pr_dbg(false, fmt, ##__VA_ARGS__)
507
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
4 years, 11 months
[pm:bleeding-edge 28829/28830] include/linux/suspend.h:505:0: warning: "pm_pr_dbg" redefined
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head: 91fa6cb3c35bb4f4f3eaf6422c155461cbad6386
commit: 4615a22a7ae1ad99c2649c9e0e58ec25130179a9 [28829/28830] PM / timekeeping: Print debug messages when requested
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 4615a22a7ae1ad99c2649c9e0e58ec25130179a9
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
In file included from arch/x86/kernel/asm-offsets.c:12:0:
>> include/linux/suspend.h:505:0: warning: "pm_pr_dbg" redefined
#define pm_pr_dbg(fmt, ...) \
include/linux/suspend.h:501:0: note: this is the location of the previous definition
#define pm_pr_dbg(defer, fmt, ...) \
vim +/pm_pr_dbg +505 include/linux/suspend.h
504
> 505 #define pm_pr_dbg(fmt, ...) \
506 __pm_pr_dbg(false, fmt, ##__VA_ARGS__)
507
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
4 years, 11 months
[PATCHv2 0/2] Make cppc acpi driver aware of pcc subspace ids
by George Cherian
The current cppc acpi driver works with only one pcc subspace id.
It maintains and registers only one pcc channel even if the acpi table has
different pcc subspace ids.
As per ACPI 6.2 spec all PCC registers, for all processors in the same
performance domain (as defined by _PSD), must be defined to be in the same
subspace. The series tries to address the same by making cppc acpi driver
aware of multiple possible pcc subspace ids.
Patch 1 : In preparation to share the MAX_PCC_SUBSPACE definition with cppc acpi
driver
Patch 2 : Make the cppc acpi driver aware of multiple pcc subspace ids.
Changes from v1:
- Add last_cmd_cmpl_time, last_mpar_reset, mpar_count to the cppc_pcc_data to
make it per subspace.
- PCC per subspace dynamic allocation support added instead of static
allocation
- Added a new function pcc_data_alloc, In instances where CPU's with SMT
support same PCC subspace would be used for all CPU's belonging to same
physical core. This function adds the pcc_subspace refcounting and allocates
the cppc_pcc_data per unique subspace idx.
- Added cleanup in acpi_cppc_processor_exit. Free the mbox channel and free
the cppc_pcc_data in case refcount is zero.
George Cherian (2):
mailbox: PCC: Move the MAX_PCC_SUBSPACES definition to header file
ACPI / CPPC: Make cppc acpi driver aware of pcc subspace ids
drivers/acpi/cppc_acpi.c | 228 ++++++++++++++++++++++++++++++-----------------
drivers/mailbox/pcc.c | 1 -
include/acpi/pcc.h | 1 +
3 files changed, 145 insertions(+), 85 deletions(-)
--
2.7.4
4 years, 11 months
[PATCH v3 0/2] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI)
by shameer
On certain HiSilicon platforms (Hip06/Hip07) the GIC ITS and
PCIe RC deviates from the standard implementation and this breaks
PCIe MSI functionality when SMMU is enabled.
The HiSilicon erratum 161010801 describes this limitation of certain
HiSilicon platforms to support the SMMU mappings for MSI transactions.
On these platforms GICv3 ITS translator is presented with the deviceID
by extending the MSI payload data to 64 bits to include the deviceID.
Hence, the PCIe controller on this platforms has to differentiate the
MSI payload against other DMA payload and has to modify the MSI payload.
This basically makes it difficult for this platforms to have a SMMU
translation for MSI.
This patch implements a ACPI table based quirk to reserve the hw msi
regions in the smmu-v3 driver which means these address regions will
not be translated and will be excluded from iova allocations.
To implement this quirk, the following changes are incorporated:
1. Added a generic helper function to IORT code to retrieve and
reserve the HW ITS address regions.
2. Added quirk to SMMUv3 to reserve HW ITS address regions based
on IORT SMMUv3 model.
This is based on the following patches:
1. https://patchwork.kernel.org/patch/9740733/
2. https://patchwork.kernel.org/patch/9730491/
Thanks,
Shameer
Changelog:
v2 --> v3
Addressed comments from Lorenzo and Robin:
-Removed dev_is_pci() check in smmuV3 driver.
-Don't treat device not having an ITS mapping as an error in
iort helper function.
v1 --> v2
-patch 2/2: Invoke iort helper fn based on fwnode type(acpi).
RFCv2 -->PATCH
-Incorporated Lorenzo's review comments.
RFC v1 --> RFC v2
Based on Robin's review comments,
-Removed the generic erratum framework.
-Using IORT/MADT tables to retrieve the ITS base addr instead
of vendor specific CSRT table.
shameer (2):
acpi:iort: Add an IORT helper function to reserve HW ITS address
regions for IOMMU drivers
iommu/arm-smmu-v3:Enable ACPI based HiSilicon erratum 161010801
drivers/acpi/arm64/iort.c | 91 ++++++++++++++++++++++++++++++++++++++--
drivers/iommu/arm-smmu-v3.c | 30 +++++++++++--
drivers/irqchip/irq-gic-v3-its.c | 3 +-
include/linux/acpi_iort.h | 7 +++-
4 files changed, 122 insertions(+), 9 deletions(-)
--
1.9.1
4 years, 11 months
[PATCH V2] acpi: acpica: fix acpi operand cache leak in dswstate.c
by Seunghun Han
I found an ACPI cache leak in ACPI early termination and boot continuing case.
When early termination is occurred due to malicious ACPI table, Linux kernel
terminates ACPI function and continues to boot process. While kernel terminates
ACPI function, kmem_cache_destroy() reports Acpi-Operand cache leak.
Boot log of ACPI operand cache leak is as follows:
>[ 0.585957] ACPI: Added _OSI(Module Device)
>[ 0.587218] ACPI: Added _OSI(Processor Device)
>[ 0.588530] ACPI: Added _OSI(3.0 _SCP Extensions)
>[ 0.589790] ACPI: Added _OSI(Processor Aggregator Device)
>[ 0.591534] ACPI Error: Illegal I/O port address/length above 64K: C806E00000004002/0x2 (20170303/hwvalid-155)
>[ 0.594351] ACPI Exception: AE_LIMIT, Unable to initialize fixed events (20170303/evevent-88)
>[ 0.597858] ACPI: Unable to start the ACPI Interpreter
>[ 0.599162] ACPI Error: Could not remove SCI handler (20170303/evmisc-281)
>[ 0.601836] kmem_cache_destroy Acpi-Operand: Slab cache still has objects
>[ 0.603556] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc5 #26
>[ 0.605159] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
>[ 0.609177] Call Trace:
>[ 0.610063] ? dump_stack+0x5c/0x81
>[ 0.611118] ? kmem_cache_destroy+0x1aa/0x1c0
>[ 0.612632] ? acpi_sleep_proc_init+0x27/0x27
>[ 0.613906] ? acpi_os_delete_cache+0xa/0x10
>[ 0.617986] ? acpi_ut_delete_caches+0x3f/0x7b
>[ 0.619293] ? acpi_terminate+0xa/0x14
>[ 0.620394] ? acpi_init+0x2af/0x34f
>[ 0.621616] ? __class_create+0x4c/0x80
>[ 0.623412] ? video_setup+0x7f/0x7f
>[ 0.624585] ? acpi_sleep_proc_init+0x27/0x27
>[ 0.625861] ? do_one_initcall+0x4e/0x1a0
>[ 0.627513] ? kernel_init_freeable+0x19e/0x21f
>[ 0.628972] ? rest_init+0x80/0x80
>[ 0.630043] ? kernel_init+0xa/0x100
>[ 0.631084] ? ret_from_fork+0x25/0x30
>[ 0.633343] vgaarb: loaded
>[ 0.635036] EDAC MC: Ver: 3.0.0
>[ 0.638601] PCI: Probing PCI hardware
>[ 0.639833] PCI host bridge to bus 0000:00
>[ 0.641031] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
> ... Continue to boot and log is omitted ...
I analyzed this memory leak in detail and found acpi_ds_obj_stack_pop_and_
delete() function miscalculated the top of the stack. acpi_ds_obj_stack_push()
function uses walk_state->operand_index for start position of the top, but
acpi_ds_obj_stack_pop_and_delete() function considers index 0 for it.
Therefore, this causes acpi operand memory leak.
This cache leak causes a security threat because an old kernel (<= 4.9) shows
memory locations of kernel functions in stack dump. Some malicious users
could use this information to neutralize kernel ASLR.
I made a patch to fix ACPI operand cache leak.
Signed-off-by: Seunghun Han <kkamagui(a)gmail.com>
---
Changes since V1: move stack_top into loop and change loop condition.
drivers/acpi/acpica/dswstate.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c
index da111a1..882a3d1 100644
--- a/drivers/acpi/acpica/dswstate.c
+++ b/drivers/acpi/acpica/dswstate.c
@@ -402,7 +402,8 @@ void
acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
struct acpi_walk_state *walk_state)
{
- s32 i;
+ u32 i;
+ s32 stack_top;
union acpi_operand_object *obj_desc;
ACPI_FUNCTION_NAME(ds_obj_stack_pop_and_delete);
@@ -411,7 +412,11 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
return;
}
- for (i = (s32)pop_count - 1; i >= 0; i--) {
+ /* Calculate curruent top of the stack */
+
+ stack_top = (s32)walk_state->num_operands + walk_state->operand_index - 1;
+
+ for (i = 0; i < pop_count ; i++) {
if (walk_state->num_operands == 0) {
return;
}
@@ -419,11 +424,12 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
/* Pop the stack and delete an object if present in this stack entry */
walk_state->num_operands--;
- obj_desc = walk_state->operands[i];
+ obj_desc = walk_state->operands[stack_top];
if (obj_desc) {
- acpi_ut_remove_reference(walk_state->operands[i]);
- walk_state->operands[i] = NULL;
+ acpi_ut_remove_reference(walk_state->operands[stack_top]);
+ walk_state->operands[stack_top] = NULL;
}
+ stack_top--;
}
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
--
2.1.4
4 years, 11 months