diff mbox series

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

Message ID 20221116131743.658708-1-vaibhav@linux.ibm.com
State New
Headers show
Series target/ppc: Fix build warnings when building with 'disable-tcg' | expand

Commit Message

Vaibhav Jain Nov. 16, 2022, 1:17 p.m. UTC
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>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
---
 target/ppc/cpu_init.c    | 2 ++
 target/ppc/excp_helper.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Greg Kurz Nov. 16, 2022, 3:20 p.m. UTC | #1
Hi Vaibhav,

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

On Wed, 16 Nov 2022 18:47:43 +0530
Vaibhav Jain <vaibhav@linux.ibm.com> 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'
> 
> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

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

>  target/ppc/cpu_init.c    | 2 ++
>  target/ppc/excp_helper.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 32e94153d1..cbf0081374 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -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)
>  {
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index a05a2ed595..94adcb766b 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -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)
>
Philippe Mathieu-Daudé Nov. 16, 2022, 3:27 p.m. UTC | #2
On 16/11/22 14:17, Vaibhav Jain 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'
> 
> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
>   target/ppc/cpu_init.c    | 2 ++
>   target/ppc/excp_helper.c | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 32e94153d1..cbf0081374 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -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 */

Oops sorry.

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

> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index a05a2ed595..94adcb766b 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -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 */

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:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Philippe Mathieu-Daudé Nov. 16, 2022, 3:30 p.m. UTC | #3
On 16/11/22 16:20, Greg Kurz wrote:
> Hi Vaibhav,
> 
> Nice to see some people are still building QEMU at IBM ;-)
> 
> On Wed, 16 Nov 2022 18:47:43 +0530
> Vaibhav Jain <vaibhav@linux.ibm.com> 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.
Vaibhav Jain Nov. 17, 2022, 2:13 a.m. UTC | #4
Greg Kurz <groug@kaod.org> writes:

> Hi Vaibhav,
>
Hey Greg,

Good to see you,

> Nice to see some people are still building QEMU at IBM ;-)
Yeah, and will hopefully continue to do this in future :-)

<snip>
>> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
>> ---
>
> Reviewed-by: Greg Kurz <groug@kaod.org>
>
Thanks

> 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.

>
>
> 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
Vaibhav Jain Nov. 17, 2022, 2:23 a.m. UTC | #5
Hi Philippe,

Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
> Oops sorry.
>
> Fixes: 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")
Thanks for figuring and pointing this out

>
>> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
>> index a05a2ed595..94adcb766b 100644
>> --- a/target/ppc/excp_helper.c
>> +++ b/target/ppc/excp_helper.c
>> @@ -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 */
>
> Fixes: 670f1da374 ("target/ppc: Implement hashst and hashchk")
>
Thanks

> 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.


> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thanks,
Cédric Le Goater Nov. 17, 2022, 6:49 a.m. UTC | #6
On 11/17/22 03:13, Vaibhav Jain wrote:
> Greg Kurz <groug@kaod.org> writes:
> 
>> Hi Vaibhav,
>>
> Hey Greg,
> 
> Good to see you,
> 
>> Nice to see some people are still building QEMU at IBM ;-)
> Yeah, and will hopefully continue to do this in future :-)
> 
> <snip>
>>> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>>> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
>>> ---
>>
>> Reviewed-by: Greg Kurz <groug@kaod.org>
>>
> Thanks
> 
>> 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.
> 
>>
>>
>> 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.
Kowshik Jois B S Nov. 17, 2022, 7:34 a.m. UTC | #7
Hello Vaibhav,

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

Regards,
Kowshik Jois

On 16/11/22 18:47, Vaibhav Jain 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'
>
> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
>   target/ppc/cpu_init.c    | 2 ++
>   target/ppc/excp_helper.c | 2 ++
>   2 files changed, 4 insertions(+)
>
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 32e94153d1..cbf0081374 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -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)
>   {
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index a05a2ed595..94adcb766b 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -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)
>
Thomas Huth Nov. 17, 2022, 8:24 a.m. UTC | #8
On 16/11/2022 16.30, Philippe Mathieu-Daudé wrote:
> On 16/11/22 16:20, Greg Kurz wrote:
>> Hi Vaibhav,
>>
>> Nice to see some people are still building QEMU at IBM ;-)
>>
>> On Wed, 16 Nov 2022 18:47:43 +0530
>> Vaibhav Jain <vaibhav@linux.ibm.com> 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.

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
Daniel Henrique Barboza Nov. 17, 2022, 10:11 a.m. UTC | #9
Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:


     Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
     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
     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>


Thanks,


Daniel

On 11/16/22 10:17, Vaibhav Jain 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'
> 
> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
>   target/ppc/cpu_init.c    | 2 ++
>   target/ppc/excp_helper.c | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 32e94153d1..cbf0081374 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -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)
>   {
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index a05a2ed595..94adcb766b 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -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)
>
Vaibhav Jain Nov. 17, 2022, 10:35 a.m. UTC | #10
Hi Daniel,

Thanks for quick turnaround on this,

Minor correction to the commit tags below:

Daniel Henrique Barboza <danielhb413@gmail.com> writes:

> Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:
>
>
>      Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>      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

>      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>
>
Greg Kurz Nov. 17, 2022, 10:50 a.m. UTC | #11
On Thu, 17 Nov 2022 07:11:51 -0300
Daniel Henrique Barboza <danielhb413@gmail.com> wrote:

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

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

> 
>      Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>      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")

>      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

>      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>
> 
> 
> Thanks,
> 
> 
> Daniel
> 
> On 11/16/22 10:17, Vaibhav Jain 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'
> > 
> > Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
> > Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> > ---
> >   target/ppc/cpu_init.c    | 2 ++
> >   target/ppc/excp_helper.c | 2 ++
> >   2 files changed, 4 insertions(+)
> > 
> > diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> > index 32e94153d1..cbf0081374 100644
> > --- a/target/ppc/cpu_init.c
> > +++ b/target/ppc/cpu_init.c
> > @@ -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)
> >   {
> > diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> > index a05a2ed595..94adcb766b 100644
> > --- a/target/ppc/excp_helper.c
> > +++ b/target/ppc/excp_helper.c
> > @@ -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)
> >
Cédric Le Goater Nov. 17, 2022, 1:08 p.m. UTC | #12
On 11/17/22 11:50, Greg Kurz wrote:
> On Thu, 17 Nov 2022 07:11:51 -0300
> Daniel Henrique Barboza <danielhb413@gmail.com> wrote:
> 
>> Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:
>>
> 
> You are planning a PR before 7.2-rc2, right ?
> 
>>
>>       Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>>       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")
> 
>>       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.

  
> But this resolves the issue created by Vaibhav for 7.2 :
> 
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319

yes.

C.

> 
>>       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>
>>
>>
>> Thanks,
>>
>>
>> Daniel
>>
>> On 11/16/22 10:17, Vaibhav Jain 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'
>>>
>>> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>>> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
>>> ---
>>>    target/ppc/cpu_init.c    | 2 ++
>>>    target/ppc/excp_helper.c | 2 ++
>>>    2 files changed, 4 insertions(+)
>>>
>>> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
>>> index 32e94153d1..cbf0081374 100644
>>> --- a/target/ppc/cpu_init.c
>>> +++ b/target/ppc/cpu_init.c
>>> @@ -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)
>>>    {
>>> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
>>> index a05a2ed595..94adcb766b 100644
>>> --- a/target/ppc/excp_helper.c
>>> +++ b/target/ppc/excp_helper.c
>>> @@ -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)
>>>    
>
Daniel Henrique Barboza Nov. 17, 2022, 2:23 p.m. UTC | #13
On 11/17/22 07:35, Vaibhav Jain wrote:
> 
> Hi Daniel,
> 
> Thanks for quick turnaround on this,
> 
> Minor correction to the commit tags below:
> 
> Daniel Henrique Barboza <danielhb413@gmail.com> writes:
> 
>> Queued in gitlab.com/danielhb/qemu/tree/ppc-next with the following tags:
>>
>>
>>       Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>>       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

> 
>>       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>
>>
>
Daniel Henrique Barboza Nov. 17, 2022, 2:27 p.m. UTC | #14
On 11/17/22 07:50, Greg Kurz wrote:
> On Thu, 17 Nov 2022 07:11:51 -0300
> Daniel Henrique Barboza <danielhb413@gmail.com> wrote:
> 
>> 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.

> 
>>
>>       Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>>       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")


Added this tag in-tree as well:


     Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
     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
     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>


Daniel

> 
>>       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
> 
>>       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>
>>
>>
>> Thanks,
>>
>>
>> Daniel
>>
>> On 11/16/22 10:17, Vaibhav Jain 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'
>>>
>>> Reported-by: Kowshik Jois B S <kowsjois@linux.ibm.com>
>>> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
>>> ---
>>>    target/ppc/cpu_init.c    | 2 ++
>>>    target/ppc/excp_helper.c | 2 ++
>>>    2 files changed, 4 insertions(+)
>>>
>>> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
>>> index 32e94153d1..cbf0081374 100644
>>> --- a/target/ppc/cpu_init.c
>>> +++ b/target/ppc/cpu_init.c
>>> @@ -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)
>>>    {
>>> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
>>> index a05a2ed595..94adcb766b 100644
>>> --- a/target/ppc/excp_helper.c
>>> +++ b/target/ppc/excp_helper.c
>>> @@ -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)
>>>    
>
diff mbox series

Patch

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 32e94153d1..cbf0081374 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -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)
 {
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index a05a2ed595..94adcb766b 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -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)