Skip to contentSkip to conversation

target/ppc: Fix build warnings when building with 'disable-tcg'

PATCH Applied Vaibhav Jain 7 participants 15 messages Nov 16, 2022 – Nov 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc: Fix build warnings when building with 'disable-tcg'

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'

---
 target/ppc/cpu_init.c    | 2 ++
 target/ppc/excp_helper.c | 2 ++
 2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +2 -0
index 32e94153d1..cbf0081374 100644
@@ -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)
@@ -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)
 {
target/ppc/excp_helper.c +2 -0
index a05a2ed595..94adcb766b 100644
@@ -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;
@@ -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)
 
Signature · 1 line
2.38.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Vaibhav,

Nice to see some people are still building QEMU at IBM ;-)

Quoted 8 lines · On Wed, 16 Nov 2022 18:47:43 +0530 Vaibhav Jain <[email protected]> wrote:

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>

Quoted 6 lines

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

---

This was introduced by a recent commit.

Fixes 61bd1d29421a ("target/ppc: Convert to tcg_ops restore_state_to_opc")

Vaibhav,

This is serious enough it should get fixed in 7.2. Please fill up an issue as explain in [1].

Cheers,

--
Greg

[1] https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg00137.html

Quoted 44 lines
 target/ppc/cpu_init.c    | 2 ++
 target/ppc/excp_helper.c | 2 ++
 2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +2 -0
index 32e94153d1..cbf0081374 100644
@@ -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)
@@ -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)
 {
target/ppc/excp_helper.c +2 -0
index a05a2ed595..94adcb766b 100644
@@ -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;
@@ -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)
 
#2 lore raw
Quoted 17 lines · Greg Kurz

Hi Vaibhav,

Nice to see some people are still building QEMU at IBM ;-)

Quoted 10 lines · On Wed, 16 Nov 2022 18:47:43 +0530 Vaibhav Jain <[email protected]> wrote:

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'

Interestingly this config isn't covered in .gitlab-ci.d/custom-runners/ubuntu-20.04-s390x.yml.

#3 lore raw
Quoted 16 lines · Philippe Mathieu-Daudé
Quoted 15 lines · Greg Kurz

Hi Vaibhav,

Nice to see some people are still building QEMU at IBM ;-)

Quoted 8 lines · On Wed, 16 Nov 2022 18:47:43 +0530 Vaibhav Jain <[email protected]> wrote:

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>

Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

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

Interestingly this config isn't covered in .gitlab-ci.d/custom-runners/ubuntu-20.04-s390x.yml.

Why should it be tested there? s390x is not ppc64.

If you want to test this, you either have to do it with a cross compiler (in .gitlab-ci.d/crossbuilds.yml) or in .travis.yml on a ppc64 host.

Thomas

#4 lore raw
In reply to Greg Kurz
Quoted 2 lines · Greg Kurz

Hi Vaibhav,

Hey Greg,

Good to see you,

Quoted 1 line

Nice to see some people are still building QEMU at IBM ;-)

Yeah, and will hopefully continue to do this in future :-)

<snip>

Quoted 6 lines
Quoted 3 lines

---

Thanks

Quoted 3 lines

This was introduced by a recent commit.

Fixes 61bd1d29421a ("target/ppc: Convert to tcg_ops restore_state_to_opc")

Thanks again for pointing out the commit that caused this.

Quoted 6 lines

Vaibhav,

This is serious enough it should get fixed in 7.2. Please fill up an issue as explain in [1].

I have raised an issue on gitlab at
https://gitlab.com/qemu-project/qemu/-/issues/1319

Signature · 2 lines
Cheers
~ Vaibhav
#5 lore raw
Quoted 27 lines · Vaibhav Jain
Quoted 2 lines · Greg Kurz

Hi Vaibhav,

Hey Greg,

Good to see you,

Quoted 1 line

Nice to see some people are still building QEMU at IBM ;-)

Yeah, and will hopefully continue to do this in future :-)

<snip>

Quoted 6 lines
Quoted 3 lines

---

Thanks

Quoted 3 lines

This was introduced by a recent commit.

Fixes 61bd1d29421a ("target/ppc: Convert to tcg_ops restore_state_to_opc")

Thanks again for pointing out the commit that caused this.

Quoted 2 lines
Quoted 7 lines
Quoted 4 lines

Vaibhav,

This is serious enough it should get fixed in 7.2. Please fill up an issue as explain in [1].

I have raised an issue on gitlab at
https://gitlab.com/qemu-project/qemu/-/issues/1319

And so,

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/377

Thanks,

C.

Reviewed-by on v1 1/1
#6 lore raw
In reply to Vaibhav Jain
Quoted 31 lines · Vaibhav Jain

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'

---
  target/ppc/cpu_init.c    | 2 ++
  target/ppc/excp_helper.c | 2 ++
  2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +1 -0
index 32e94153d1..cbf0081374 100644
@@ -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)

target/ppc/cpu_init.c static void ppc_restore_state_to_opc(CPUState *cs, · line 7027

Quoted 4 lines
target/ppc/cpu_init.c +1 -0
@@ -7023,6 +7024,7 @@ static void ppc_restore_state_to_opc(CPUState *cs,
 
      cpu->env.nip = data[0];
  }
+#endif /* CONFIG_TCG */

Oops sorry.

Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Quoted 13 lines
target/ppc/excp_helper.c +1 -0
index a05a2ed595..94adcb766b 100644
@@ -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;

target/ppc/excp_helper.c HELPER_HASH(HASHST, env->spr[SPR_HASHKEYR], true) · line 2928

Quoted 4 lines
target/ppc/excp_helper.c +1 -0
@@ -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 */
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")

Hmm this is another fix... You could split your patch in 2, but not a big deal. Regardless:

#7 lore raw

Hi Philippe,

Quoted 4 lines · Philippe Mathieu-Daudé

Oops sorry.

Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")

Thanks for figuring and pointing this out

Quoted 9 lines
Quoted 9 lines
target/ppc/excp_helper.c +0 -0
index a05a2ed595..94adcb766b 100644
@@ -2842,6 +2842,7 @@ void helper_td(CPUPPCState *env, target_ulong arg1, target_ulong arg2,
  #endif
  #endif
 
Quoted 12 lines

target/ppc/excp_helper.c HELPER_HASH(HASHST, env->spr[SPR_HASHKEYR], true) · line 2928

Quoted 9 lines
target/ppc/excp_helper.c +2 -0
+#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;
@@ -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 */
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")

Thanks

Quoted 2 lines

Hmm this is another fix... You could split your patch in 2, but not a big deal. Regardless:

This being a trivial patch, descided against splitting it in 2.

Quoted 1 line

Thanks,

Signature · 2 lines
Cheers
~ Vaibhav
Reviewed-by Greg Kurz Reviewed-by Philippe Mathieu-Daudé Tested-by Kowshik Jois B S on v1 1/1 Applied
#8 lore raw
In reply to Vaibhav Jain

Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:

Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/377

Thanks,

Daniel

Quoted 58 lines · Vaibhav Jain

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'

---
  target/ppc/cpu_init.c    | 2 ++
  target/ppc/excp_helper.c | 2 ++
  2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +2 -0
index 32e94153d1..cbf0081374 100644
@@ -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)
@@ -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)
  {
target/ppc/excp_helper.c +2 -0
index a05a2ed595..94adcb766b 100644
@@ -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;
@@ -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)
 
#9 lore raw

Hi Daniel,

Thanks for quick turnaround on this,

Minor correction to the commit tags below:

Quoted 7 lines · Daniel Henrique Barboza

Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:

Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/377

This should be

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319

Quoted 5 lines
Signature · 2 lines
Cheers
~ Vaibhav
#10 lore raw
Quoted 12 lines · Vaibhav Jain

Hi Daniel,

Thanks for quick turnaround on this,

Minor correction to the commit tags below:

Quoted 3 lines · Daniel Henrique Barboza

Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:

Quoted 7 lines
Quoted 4 lines
Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/377

This should be

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319

Ops! Fixed in tree.

Daniel

Quoted 7 lines
Quoted 6 lines
#11 lore raw
In reply to Daniel Henrique Barboza
Quoted 2 lines · On Thu, 17 Nov 2022 07:11:51 -0300 Daniel Henrique Barboza…

Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:

You are planning a PR before 7.2-rc2, right ?

Quoted 4 lines
Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")

The guard macro also covers the following two, introduced by yet another commit.

HELPER_HASH(HASHSTP, env->spr[SPR_HASHPKEYR], true) HELPER_HASH(HASHCHKP, env->spr[SPR_HASHPKEYR], false)

Fixes 53ae2aeb9407 ("target/ppc: Implement hashstp and hashchkp")
Quoted 1 line
     Resolves: https://gitlab.com/qemu-project/qemu/-/issues/377

Err... I don't see any relation with this issue.

Cedric ?

But this resolves the issue created by Vaibhav for 7.2 :

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319

Quoted 70 lines

Thanks,

Daniel

Quoted 58 lines · Vaibhav Jain

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'

---
  target/ppc/cpu_init.c    | 2 ++
  target/ppc/excp_helper.c | 2 ++
  2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +2 -0
index 32e94153d1..cbf0081374 100644
@@ -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)
@@ -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)
  {
target/ppc/excp_helper.c +2 -0
index a05a2ed595..94adcb766b 100644
@@ -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;
@@ -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)
 
#12 lore raw
Quoted 18 lines · Greg Kurz
Quoted 2 lines · On Thu, 17 Nov 2022 07:11:51 -0300 Daniel Henrique Barboza…

Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:

You are planning a PR before 7.2-rc2, right ?

Quoted 4 lines
Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")

The guard macro also covers the following two, introduced by yet another commit.

   HELPER_HASH(HASHSTP, env->spr[SPR_HASHPKEYR], true)
   HELPER_HASH(HASHCHKP, env->spr[SPR_HASHPKEYR], false)
Quoted 7 lines
Fixes 53ae2aeb9407 ("target/ppc: Implement hashstp and hashchkp")
Quoted 1 line
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/377

Err... I don't see any relation with this issue.

Cedric ?

bad copy paste. Sorry about that.

Quoted 3 lines

But this resolves the issue created by Vaibhav for 7.2 :

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319

yes.

C.

Quoted 72 lines
Quoted 71 lines

Thanks,

Daniel

Quoted 58 lines · Vaibhav Jain

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'

---
   target/ppc/cpu_init.c    | 2 ++
   target/ppc/excp_helper.c | 2 ++
   2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +2 -0
index 32e94153d1..cbf0081374 100644
@@ -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)
@@ -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)
   {
target/ppc/excp_helper.c +2 -0
index a05a2ed595..94adcb766b 100644
@@ -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;
@@ -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)
 
Reviewed-by Greg Kurz Reviewed-by Philippe Mathieu-Daudé Tested-by Kowshik Jois B S
#13 lore raw
In reply to Greg Kurz
Quoted 7 lines · Greg Kurz
Quoted 2 lines · On Thu, 17 Nov 2022 07:11:51 -0300 Daniel Henrique Barboza…

Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:

You are planning a PR before 7.2-rc2, right ?

I'll send it today.

Quoted 6 lines
Quoted 5 lines
Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")
Quoted 6 lines

The guard macro also covers the following two, introduced by yet another commit.

   HELPER_HASH(HASHSTP, env->spr[SPR_HASHPKEYR], true)
   HELPER_HASH(HASHCHKP, env->spr[SPR_HASHPKEYR], false)
Fixes 53ae2aeb9407 ("target/ppc: Implement hashstp and hashchkp")

Added this tag in-tree as well:

Fixes 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Fixes 670f1da374 ("target/ppc: Implement hashst and hashchk")
Fixes 53ae2aeb94 ("target/ppc: Implement hashstp and hashchkp")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319

Daniel

Quoted 82 lines
Quoted 2 lines
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/377

Err... I don't see any relation with this issue.

Cedric ?

But this resolves the issue created by Vaibhav for 7.2 :

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319

Quoted 70 lines

Thanks,

Daniel

Quoted 58 lines · Vaibhav Jain

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'

---
   target/ppc/cpu_init.c    | 2 ++
   target/ppc/excp_helper.c | 2 ++
   2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +2 -0
index 32e94153d1..cbf0081374 100644
@@ -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)
@@ -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)
   {
target/ppc/excp_helper.c +2 -0
index a05a2ed595..94adcb766b 100644
@@ -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;
@@ -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)
 
#14 lore raw
In reply to Vaibhav Jain

Hello Vaibhav,

Thanks for the quick resolution. I have applied and tested the patch. Everything is smooth. Thank you.

Regards,
Kowshik Jois

Quoted 58 lines · Vaibhav Jain

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'

---
  target/ppc/cpu_init.c    | 2 ++
  target/ppc/excp_helper.c | 2 ++
  2 files changed, 4 insertions(+)
target/ppc/cpu_init.c +2 -0
index 32e94153d1..cbf0081374 100644
@@ -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)
@@ -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)
  {
target/ppc/excp_helper.c +2 -0
index a05a2ed595..94adcb766b 100644
@@ -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;
@@ -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)