Commit 301cf77e authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86/orc: Make the is_callthunk() definition depend on CONFIG_BPF_JIT=y



Recent commit:

  02012623 Revert "x86/orc: Make it callthunk aware"

Made the only user of is_callthunk() depend on CONFIG_BPF_JIT=y, while
the definition of the helper function is unconditional.

Move is_callthunk() inside the #ifdef block.

Addresses this build failure:

   arch/x86/kernel/callthunks.c:296:13: error: ‘is_callthunk’ defined but not used [-Werror=unused-function]

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
parent b4c96ef0
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -293,6 +293,7 @@ void *callthunks_translate_call_dest(void *dest)
	return target ? : dest;
	return target ? : dest;
}
}


#ifdef CONFIG_BPF_JIT
static bool is_callthunk(void *addr)
static bool is_callthunk(void *addr)
{
{
	unsigned int tmpl_size = SKL_TMPL_SIZE;
	unsigned int tmpl_size = SKL_TMPL_SIZE;
@@ -306,7 +307,6 @@ static bool is_callthunk(void *addr)
	return !bcmp((void *)(dest - tmpl_size), tmpl, tmpl_size);
	return !bcmp((void *)(dest - tmpl_size), tmpl, tmpl_size);
}
}


#ifdef CONFIG_BPF_JIT
int x86_call_depth_emit_accounting(u8 **pprog, void *func)
int x86_call_depth_emit_accounting(u8 **pprog, void *func)
{
{
	unsigned int tmpl_size = SKL_TMPL_SIZE;
	unsigned int tmpl_size = SKL_TMPL_SIZE;