Skip to contentSkip to conversation

EDAC, skx_edac: Add address translation for non-volatile DIMMs

PATCH New Borislav Petkov 1 participant 1 message Oct 21, 2018 EDAC-core

lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

PATCH v3 1/1 EDAC, skx_edac: Add address translation for non-volatile DIMMs

Quoted 40 lines · Qiuxu Zhuo

Current skx_edac driver doesn't support address translation for non-volatile DIMMs.

The ACPI ADXL DSM method support address translation for both volatile DIMMs and non-volatile DIMMs. So switch skx_edac to use the wrapped ACPI DSM methods, if they are supported and there are non-volatile DIMMs populated on the system.

(The debugfs cleanup and test for ADXL DSM decoding will be added
in later commits).

---

Boris:
Correct the SoB chain.
Change the variable 'nvdimm_count' type from 'int' to 'unsigned int'. Cast some variables of adxl_values[] from 'u64' to 'int in' skx_adxl_decode(). Remove the memory allocation error messages.

Qiuxu:
Use 'struct decoded_addr' pointer as parameter for skx_adxl_decode(). Exit skx_adxl_get() on the error of 'adxl_values' memory allocation.

Pass test:

      Apply the patch on top of Boris' edac-for-4.20-skx-3 branch
      and add the test code as below in debugfs_u64_set():

          struct mce m;
          memset(&m, 0, sizeof(m));
          m.status = MCI_STATUS_ADDRV + 0x90;
          m.status |= BIT_ULL(MCI_STATUS_CEC_SHIFT);
          m.addr = val;
          skx_mce_check_error(NULL, 0, &m);
     
      Decoding via ADXL DSM and via original skx_edac code
      worked well on Skylake-2S + BIOS with ADXL DSM support.
Quoted 3 lines
 drivers/edac/Kconfig    |   1 +
 drivers/edac/skx_edac.c | 193 +++++++++++++++++++++++++++++++++++++---
 2 files changed, 181 insertions(+), 13 deletions(-)

Thanks. Applied and pushed here:

https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/log/?h=edac-for-4.20-skx-3