Re: [PATCH] RISC-V: Fixup clear_page export when using Zicboz

Sudip Mukherjee
2023-02-24T14:44:32Z

On 24/02/2023 1:58 pm, Ben Dooks wrote:
> When the clear_page() via Zicboz is enabled, the module build
> fails as clear_page() is not marked as a ksym entry. Fix this
> by changing the asm code to use <asm-generic/export.h> to add
> the correct export.
>
> Also remove the weak clear_page() as there's nothing else in
> the build defining this symbol, so just make it the entry when
> the Zicboz is enabled.
>
> Fixes modpost errors such as this:
> ERROR: modpost: "clear_page" [drivers/gpu/drm/ttm/ttm.ko] undefined!
>
> Reported-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> arch/riscv/lib/clear_page.S | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/lib/clear_page.S b/arch/riscv/lib/clear_page.S
> index 7c7fa45b5ab5..4ed5fef52d80 100644
> --- a/arch/riscv/lib/clear_page.S
> +++ b/arch/riscv/lib/clear_page.S
> @@ -6,6 +6,7 @@
> #include <linux/linkage.h>
> #include <asm/asm.h>
> #include <asm/alternative-macros.h>
> +#include <asm-generic/export.h>
> #include <asm/hwcap.h>
> #include <asm/insn-def.h>
> #include <asm/page.h>
> @@ -17,7 +18,7 @@
>
> /* void clear_page(void *page) */
> ENTRY(__clear_page)

Shouldn't this be removed also? Am I missing something?

--
Regards
Sudip