ACPI / adxl: Address translation interface using ACPI DSM
Luck, Tony
maintainerPATCH 1/3 ACPI / adxl: Address translation interface using ACPI DSM
Some new servers provide an interface so that the OS can ask the BIOS to translate a system physical address to a memory address (socket, memory controller, channel, rank, dimm, etc.). This is useful for EDAC drivers that want to take the address of an error reported in a machine check bank and let the user know which DIMM may need to be replaced.
Specification for this interface is available at:
https://cdrdv2.intel.com/v1/dl/getContent/603354
[Based on earlier code by Qiuxu Zhuo <[email protected]>]
---
Comments addressed since last version:
Rafael:
Added URL for specification (to commit & header comment) Fixed NULL error return from error case of adxl_dsm()
Boris:
Added sanity check on number of address components (also added check that number of values returned by
decode operation matches number of strings)
g/pr_debug/s//pr_info/
Added "." at end of sentences in comments Make return from adxl_get_component_names() immutable
drivers/acpi/Kconfig | 10 ++ drivers/acpi/Makefile | 3 + drivers/acpi/acpi_adxl.c | 199 +++++++++++++++++++++++++++++++++++++++ include/linux/adxl.h | 25 +++++ 4 files changed, 237 insertions(+) create mode 100644 drivers/acpi/acpi_adxl.c create mode 100644 include/linux/adxl.h
drivers/acpi/Kconfig +10 -0
@@ -498,6 +498,16 @@ config ACPI_EXTLOG driver adds support for that functionality with corresponding tracepoint which carries that information to userspace. +config ACPI_ADXL + bool "Physical address to DIMM address translation" + def_bool n + help + Enable interface that calls into BIOS using a DSM (device + specific method) to convert system physical addresses + to DIMM (socket, channel, rank, dimm, etc.). + Only available on some servers. + Used by newer EDAC drivers. + menuconfig PMIC_OPREGION bool "PMIC (Power Management Integrated Circuit) operation region support" help
drivers/acpi/Makefile +3 -0
@@ -61,6 +61,9 @@ acpi-$(CONFIG_ACPI_LPIT) += acpi_lpit.o acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o acpi-$(CONFIG_ACPI_WATCHDOG) += acpi_watchdog.o +# Address translation +acpi-$(CONFIG_ACPI_ADXL) += acpi_adxl.o + # These are (potentially) separate modules # IPMI may be used by other drivers, so it has to initialise before them
drivers/acpi/acpi_adxl.c new file +199 -0
199 lines not on this page · raw message
include/linux/adxl.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Address translation interface via ACPI DSM. +* Copyright (C) 2018 Intel Corporation +*/ + +#ifndef _LINUX_ADXL_H +#define _LINUX_ADXL_H + +#ifdef CONFIG_ACPI_ADXL +const char *const *adxl_get_component_names (void ); +int adxl_decode (u64 addr,u64 component_values[]); +#else +static inline const char *const *adxl_get_component_names (void ) +{ +return NULL ; +} + +static inline int adxl_decode (u64 addr,u64 component_values[]) +{ +return -EOPNOTSUPP ; +} +#endif + +#endif /* _LINUX_ADXL_H */