Skip to content

Commit

Permalink
target/ppc: Fix build warnings when building with 'disable-tcg'
Browse files Browse the repository at this point in the history
Kowshik reported that building qemu with GCC 12.2.1 for 'ppc64-softmmu'
target is failing due to following build warnings:

<snip>
 ../target/ppc/cpu_init.c:7018:13: error: 'ppc_restore_state_to_opc' defined but not used [-Werror=unused-function]
 7018 | static void ppc_restore_state_to_opc(CPUState *cs,
<snip>

Fix this by wrapping these function definitions in 'ifdef CONFIG_TCG' so that
they are only defined if qemu is compiled with '--enable-tcg'

Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
Fixes: 61bd1d2 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes: 670f1da ("target/ppc: Implement hashst and hashchk")
Fixes: 53ae2ae ("target/ppc: Implement hashstp and hashchkp")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Kowshik Jois B S <kowsjois@linux.vnet.ibm.com>
Message-Id: <20221116131743.658708-1-vaibhav@linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
  • Loading branch information
vaibhav92 authored and danielhb committed Nov 17, 2022
1 parent 2c83112 commit 049b4ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions target/ppc/cpu_init.c
Expand Up @@ -7015,6 +7015,7 @@ static vaddr ppc_cpu_get_pc(CPUState *cs)
return cpu->env.nip;
}

#ifdef CONFIG_TCG
static void ppc_restore_state_to_opc(CPUState *cs,
const TranslationBlock *tb,
const uint64_t *data)
Expand All @@ -7023,6 +7024,7 @@ static void ppc_restore_state_to_opc(CPUState *cs,

cpu->env.nip = data[0];
}
#endif /* CONFIG_TCG */

static bool ppc_cpu_has_work(CPUState *cs)
{
Expand Down
2 changes: 2 additions & 0 deletions target/ppc/excp_helper.c
Expand Up @@ -2842,6 +2842,7 @@ void helper_td(CPUPPCState *env, target_ulong arg1, target_ulong arg2,
#endif
#endif

#ifdef CONFIG_TCG
static uint32_t helper_SIMON_LIKE_32_64(uint32_t x, uint64_t key, uint32_t lane)
{
const uint16_t c = 0xfffc;
Expand Down Expand Up @@ -2924,6 +2925,7 @@ HELPER_HASH(HASHST, env->spr[SPR_HASHKEYR], true)
HELPER_HASH(HASHCHK, env->spr[SPR_HASHKEYR], false)
HELPER_HASH(HASHSTP, env->spr[SPR_HASHPKEYR], true)
HELPER_HASH(HASHCHKP, env->spr[SPR_HASHPKEYR], false)
#endif /* CONFIG_TCG */

#if !defined(CONFIG_USER_ONLY)

Expand Down

0 comments on commit 049b4ad

Please sign in to comment.