[PATCH] um: Add missing apply_returns()

From: Peter Zijlstra
Date: Thu Jul 14 2022 - 06:20:38 EST


On Wed, Jul 13, 2022 at 01:40:48PM -0700, Randy Dunlap wrote:
>
>
> On 7/13/22 05:33, Stephen Rothwell wrote:
> > Hi all,
> >
> > Changes since 20220712:
> >
>
> UML for x86_64 defconfig:
>
> /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: arch/x86/um/../kernel/module.o: in function `module_finalize':
> module.c:(.text+0x416): undefined reference to `apply_returns'
>
> arch/x86/kernel/alternative.o is not being built for UML.
>

---
Subject: um: Add missing apply_returns()

Implement apply_returns() stub for UM, just like all the other patching
routines.

Fixes: 15e67227c49a ("x86: Undo return-thunk damage")
Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx)
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
arch/um/kernel/um_arch.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 0760e24f2eba..9838967d0b2f 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -432,6 +432,10 @@ void apply_retpolines(s32 *start, s32 *end)
{
}

+void apply_returns(s32 *start, s32 *end)
+{
+}
+
void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
{
}