[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21e02dbd-75b0-e5c6-29d8-fc853c72aa01@w6rz.net>
Date: Wed, 8 Jun 2022 21:05:33 -0700
From: Ron Economos <re@...z.net>
To: Heiko Stuebner <heiko@...ech.de>, palmer@...belt.com,
paul.walmsley@...ive.com
Cc: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
wefu@...hat.com, guoren@...nel.org, cmuellner@...ux.com,
philipp.tomsich@...ll.eu, hch@....de
Subject: Re: [PATCH] riscv: don't warn for sifive erratas in modules
On 6/8/22 5:08 AM, Heiko Stuebner wrote:
> The SiFive errata code contains code checking applicable erratas
> vs. actually applied erratas to suggest missing erratas to the
> user when their Kconfig options are not enabled.
>
> In the main kernel image one can be quite sure that all available
> erratas appear at least once, so that check will succeed.
> On the other hand modules can very well not use any errata-relevant
> code, so the newly added module-alternative support may also patch
> the module code, but not touch SiFive-specific erratas at all.
>
> So to restore the original behaviour don't warn when patching
> modules. This will keep the warning if necessary for the main kernel
> image but prevent spurious warnings for modules.
>
> Of course having such a vendor-specific warning may not be needed at
> all, as CONFIG_ERRATA_SIFIVE is selected by CONFIG_SOC_SIFIVE and the
> individual erratas are default-y so disabling them requires
> deliberate action anyway. But for now just restore the old behaviour.
>
> Fixes: a8e910168bba ("riscv: implement module alternatives")
> Reported-by: Ron Economos <re@...z.net>
> Signed-off-by: Heiko Stuebner <heiko@...ech.de>
> ---
> arch/riscv/errata/sifive/errata.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c
> index 672f02b21ce0..1031038423e7 100644
> --- a/arch/riscv/errata/sifive/errata.c
> +++ b/arch/riscv/errata/sifive/errata.c
> @@ -111,6 +111,7 @@ void __init_or_module sifive_errata_patch_func(struct alt_entry *begin,
> cpu_apply_errata |= tmp;
> }
> }
> - if (cpu_apply_errata != cpu_req_errata)
> + if (stage != RISCV_ALTERNATIVES_MODULE &&
> + cpu_apply_errata != cpu_req_errata)
> warn_miss_errata(cpu_req_errata - cpu_apply_errata);
> }
Tested on HiFive Unmatched. Works good and the spurious warning is
suppressed.
Tested-by: Ron Economos <re@...z.net>
Powered by blists - more mailing lists