]> Git Repo - J-linux.git/commitdiff
Merge remote-tracking branches 'ras/edac-amd-atl' and 'ras/edac-misc' into edac-updates
authorBorislav Petkov (AMD) <[email protected]>
Mon, 15 Jul 2024 09:59:10 +0000 (11:59 +0200)
committerBorislav Petkov (AMD) <[email protected]>
Mon, 15 Jul 2024 09:59:10 +0000 (11:59 +0200)
* ras/edac-amd-atl:
  RAS/AMD/FMPM: Use atl internal.h for INVALID_SPA
  RAS/AMD/ATL: Implement DF 4.5 NP2 denormalization
  RAS/AMD/ATL: Validate address map when information is gathered
  RAS/AMD/ATL: Expand helpers for adding and removing base and hole
  RAS/AMD/ATL: Read DRAM hole base early
  RAS/AMD/ATL: Add amd_atl pr_fmt() prefix
  RAS/AMD/ATL: Add a missing module description

* ras/edac-misc:
  EDAC: Add missing MODULE_DESCRIPTION() macros
  EDAC/dmc520: Use devm_platform_ioremap_resource()
  EDAC/igen6: Add Intel Arrow Lake-U/H SoCs support
  EDAC, i10nm: make skx_common.o a separate module
  EDAC/skx: Switch to new Intel CPU model defines
  EDAC/sb_edac: Switch to new Intel CPU model defines
  EDAC, pnd2: Switch to new Intel CPU model defines
  EDAC/i10nm: Switch to new Intel CPU model defines
  EDAC/ghes: Add missing newline to pr_info() statement
  RAS/AMD/ATL: Add missing newline to pr_info() statement
  EDAC/thunderx: Remove unused struct error_syndrome

Signed-off-by: Borislav Petkov (AMD) <[email protected]>
1  2 
drivers/ras/amd/atl/core.c

index 7cdf7769c18972d7349cc926057e294bb3fd0d88,f9f760d780c4e91d4f0a30e9edc69439175719ad..4197e10993acaaa0a5097c7f21796ccde418020c
@@@ -49,26 -49,26 +49,26 @@@ static bool legacy_hole_en(struct addr_
        return FIELD_GET(DF_LEGACY_MMIO_HOLE_EN, reg);
  }
  
 -static int add_legacy_hole(struct addr_ctx *ctx)
 +static u64 add_legacy_hole(struct addr_ctx *ctx, u64 addr)
  {
 -      u32 dram_hole_base;
 -      u8 func = 0;
 -
        if (!legacy_hole_en(ctx))
 -              return 0;
 +              return addr;
  
 -      if (df_cfg.rev >= DF4)
 -              func = 7;
 +      if (addr >= df_cfg.dram_hole_base)
 +              addr += (BIT_ULL(32) - df_cfg.dram_hole_base);
  
 -      if (df_indirect_read_broadcast(ctx->node_id, func, 0x104, &dram_hole_base))
 -              return -EINVAL;
 +      return addr;
 +}
  
 -      dram_hole_base &= DF_DRAM_HOLE_BASE_MASK;
 +static u64 remove_legacy_hole(struct addr_ctx *ctx, u64 addr)
 +{
 +      if (!legacy_hole_en(ctx))
 +              return addr;
  
 -      if (ctx->ret_addr >= dram_hole_base)
 -              ctx->ret_addr += (BIT_ULL(32) - dram_hole_base);
 +      if (addr >= df_cfg.dram_hole_base)
 +              addr -= (BIT_ULL(32) - df_cfg.dram_hole_base);
  
 -      return 0;
 +      return addr;
  }
  
  static u64 get_base_addr(struct addr_ctx *ctx)
        return base_addr << DF_DRAM_BASE_LIMIT_LSB;
  }
  
 -static int add_base_and_hole(struct addr_ctx *ctx)
 +u64 add_base_and_hole(struct addr_ctx *ctx, u64 addr)
  {
 -      ctx->ret_addr += get_base_addr(ctx);
 -
 -      if (add_legacy_hole(ctx))
 -              return -EINVAL;
 +      return add_legacy_hole(ctx, addr + get_base_addr(ctx));
 +}
  
 -      return 0;
 +u64 remove_base_and_hole(struct addr_ctx *ctx, u64 addr)
 +{
 +      return remove_legacy_hole(ctx, addr) - get_base_addr(ctx);
  }
  
  static bool late_hole_remove(struct addr_ctx *ctx)
@@@ -125,9 -125,6 +125,9 @@@ unsigned long norm_to_sys_addr(u8 socke
        ctx.inputs.die_id = die_id;
        ctx.inputs.coh_st_inst_id = coh_st_inst_id;
  
 +      if (legacy_hole_en(&ctx) && !df_cfg.dram_hole_base)
 +              return -EINVAL;
 +
        if (determine_node_id(&ctx, socket_id, die_id))
                return -EINVAL;
  
        if (denormalize_address(&ctx))
                return -EINVAL;
  
 -      if (!late_hole_remove(&ctx) && add_base_and_hole(&ctx))
 -              return -EINVAL;
 +      if (!late_hole_remove(&ctx))
 +              ctx.ret_addr = add_base_and_hole(&ctx, ctx.ret_addr);
  
        if (dehash_address(&ctx))
                return -EINVAL;
  
 -      if (late_hole_remove(&ctx) && add_base_and_hole(&ctx))
 -              return -EINVAL;
 +      if (late_hole_remove(&ctx))
 +              ctx.ret_addr = add_base_and_hole(&ctx, ctx.ret_addr);
  
        if (addr_over_limit(&ctx))
                return -EINVAL;
@@@ -209,7 -206,7 +209,7 @@@ static int __init amd_atl_init(void
        __module_get(THIS_MODULE);
        amd_atl_register_decoder(convert_umc_mca_addr_to_sys_addr);
  
-       pr_info("AMD Address Translation Library initialized");
+       pr_info("AMD Address Translation Library initialized\n");
        return 0;
  }
  
@@@ -225,5 -222,4 +225,5 @@@ static void __exit amd_atl_exit(void
  module_init(amd_atl_init);
  module_exit(amd_atl_exit);
  
 +MODULE_DESCRIPTION("AMD Address Translation Library");
  MODULE_LICENSE("GPL");
This page took 0.062388 seconds and 4 git commands to generate.