Re: [PATCH v4 1/4] RAS/AMD/ATL: Read DRAM hole base early

From: John Allen
Date: Wed Jun 05 2024 - 14:47:52 EST


On Tue, May 28, 2024 at 10:16:59AM +0200, Borislav Petkov wrote:
> On Mon, May 06, 2024 at 03:46:02PM +0000, John Allen wrote:
> > @@ -282,6 +298,11 @@ int get_df_system_info(void)
> >
> > get_num_maps();
> >
> > + if (get_dram_hole_base()) {
> > + pr_warn("amd_atl: Failed to read DRAM hole base");
>
> This thing with the printk prefix "amd_atl: ". Please do a pre-patch
> which adds
>
> #undef pr_fmt
> #define pr_fmt(fmt) "amd_atl: " fmt
>
> to ...atl/internal.h and remove all such string prefixes from the pr_*
> statements in the driver.
>
> > + return -EINVAL;
>
> So this basically says that the driver won't load if it can't read hole
> base. But it did load before - on failure to read that reg, it would
> simply fail translating.
>
> So why is that failure so tragic? Or is it that we absolutely need hole
> base in all circumstances so that loading it is pointless if not?

Yeah, I see your point now. In the case that DF_LEGACY_MMIO_HOLE_EN is
not set, the hole base will not be needed and should not be fatal. I'll
remove the EINVAL return here and check that the hole base was read
successfully before using it in cases where it is needed.

Thanks,
John