* [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs
@ 2022-04-01 19:16 Richard Henderson
2022-04-01 21:44 ` Cédric Le Goater
2022-04-04 6:52 ` Cédric Le Goater
0 siblings, 2 replies; 6+ messages in thread
From: Richard Henderson @ 2022-04-01 19:16 UTC (permalink / raw)
To: qemu-devel; +Cc: danielhb413, clg, david
Coverity warns that we shift a 32-bit value by N, and then
accumulate it into a 64-bit type (target_ulong on ppc64).
The ccr is always 8 * 4-bit fields, and thus is always a
32-bit quantity; narrow the type to avoid the warning.
Fixes: Coverity CID 1487223
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/ppc/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c
index ec0b9c0df3..ce5a4682cd 100644
--- a/linux-user/ppc/signal.c
+++ b/linux-user/ppc/signal.c
@@ -229,7 +229,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)
{
target_ulong msr = env->msr;
int i;
- target_ulong ccr = 0;
+ uint32_t ccr = 0;
/* In general, the kernel attempts to be intelligent about what it
needs to save for Altivec/FP/SPE registers. We don't care that
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs
2022-04-01 19:16 [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs Richard Henderson
@ 2022-04-01 21:44 ` Cédric Le Goater
2022-04-04 6:52 ` Cédric Le Goater
1 sibling, 0 replies; 6+ messages in thread
From: Cédric Le Goater @ 2022-04-01 21:44 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: danielhb413, david
On 4/1/22 21:16, Richard Henderson wrote:
> Coverity warns that we shift a 32-bit value by N, and then
> accumulate it into a 64-bit type (target_ulong on ppc64).
>
> The ccr is always 8 * 4-bit fields, and thus is always a
> 32-bit quantity; narrow the type to avoid the warning.
>
> Fixes: Coverity CID 1487223
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> linux-user/ppc/signal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c
> index ec0b9c0df3..ce5a4682cd 100644
> --- a/linux-user/ppc/signal.c
> +++ b/linux-user/ppc/signal.c
> @@ -229,7 +229,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)
> {
> target_ulong msr = env->msr;
> int i;
> - target_ulong ccr = 0;
> + uint32_t ccr = 0;
>
> /* In general, the kernel attempts to be intelligent about what it
> needs to save for Altivec/FP/SPE registers. We don't care that
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs
2022-04-01 19:16 [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs Richard Henderson
2022-04-01 21:44 ` Cédric Le Goater
@ 2022-04-04 6:52 ` Cédric Le Goater
2022-04-04 8:41 ` Peter Maydell
1 sibling, 1 reply; 6+ messages in thread
From: Cédric Le Goater @ 2022-04-04 6:52 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: danielhb413, david
On 4/1/22 21:16, Richard Henderson wrote:
> Coverity warns that we shift a 32-bit value by N, and then
> accumulate it into a 64-bit type (target_ulong on ppc64).
>
> The ccr is always 8 * 4-bit fields, and thus is always a
> 32-bit quantity; narrow the type to avoid the warning.
>
> Fixes: Coverity CID 1487223
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> linux-user/ppc/signal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Queued for ppc-7.0
Thanks,
C.
>
> diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c
> index ec0b9c0df3..ce5a4682cd 100644
> --- a/linux-user/ppc/signal.c
> +++ b/linux-user/ppc/signal.c
> @@ -229,7 +229,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)
> {
> target_ulong msr = env->msr;
> int i;
> - target_ulong ccr = 0;
> + uint32_t ccr = 0;
>
> /* In general, the kernel attempts to be intelligent about what it
> needs to save for Altivec/FP/SPE registers. We don't care that
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs
2022-04-04 6:52 ` Cédric Le Goater
@ 2022-04-04 8:41 ` Peter Maydell
2022-04-04 9:09 ` Cédric Le Goater
0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2022-04-04 8:41 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: danielhb413, Richard Henderson, qemu-devel, david
On Mon, 4 Apr 2022 at 07:55, Cédric Le Goater <clg@kaod.org> wrote:
>
> On 4/1/22 21:16, Richard Henderson wrote:
> > Coverity warns that we shift a 32-bit value by N, and then
> > accumulate it into a 64-bit type (target_ulong on ppc64).
> >
> > The ccr is always 8 * 4-bit fields, and thus is always a
> > 32-bit quantity; narrow the type to avoid the warning.
> >
> > Fixes: Coverity CID 1487223
> > Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> > ---
> > linux-user/ppc/signal.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Queued for ppc-7.0
NB that this is only suppressing a coverity warning, not
correcting any incorrect behaviour, so if you don't have
anything else you were planning to send for 7.0 it could
also wait til 7.1.
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs
2022-04-04 8:41 ` Peter Maydell
@ 2022-04-04 9:09 ` Cédric Le Goater
2022-04-04 9:25 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: Cédric Le Goater @ 2022-04-04 9:09 UTC (permalink / raw)
To: Peter Maydell; +Cc: danielhb413, Richard Henderson, qemu-devel, david
On 4/4/22 10:41, Peter Maydell wrote:
> On Mon, 4 Apr 2022 at 07:55, Cédric Le Goater <clg@kaod.org> wrote:
>>
>> On 4/1/22 21:16, Richard Henderson wrote:
>>> Coverity warns that we shift a 32-bit value by N, and then
>>> accumulate it into a 64-bit type (target_ulong on ppc64).
>>>
>>> The ccr is always 8 * 4-bit fields, and thus is always a
>>> 32-bit quantity; narrow the type to avoid the warning.
>>>
>>> Fixes: Coverity CID 1487223
>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>> linux-user/ppc/signal.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Queued for ppc-7.0
>
> NB that this is only suppressing a coverity warning, not
> correcting any incorrect behaviour, so if you don't have
> anything else you were planning to send for 7.0 it could
> also wait til 7.1.
I have a couple of small fixes in :
https://github.com/legoater/qemu/commits/ppc-for-upstream
linux-user/ppc: Narrow type of ccr in save_user_regs
ppc/pnv: Fix number of registers in the PCIe controller on POWER9
hw/ppc: free env->tb_env in spapr_unrealize_vcpu()
Nothing critical indeed. So these can wait 7.1 ?
Thanks,
C.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs
2022-04-04 9:09 ` Cédric Le Goater
@ 2022-04-04 9:25 ` Peter Maydell
0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2022-04-04 9:25 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: danielhb413, Richard Henderson, qemu-devel, david
On Mon, 4 Apr 2022 at 10:09, Cédric Le Goater <clg@kaod.org> wrote:
>
> On 4/4/22 10:41, Peter Maydell wrote:
> > On Mon, 4 Apr 2022 at 07:55, Cédric Le Goater <clg@kaod.org> wrote:
> >>
> >> On 4/1/22 21:16, Richard Henderson wrote:
> >>> Coverity warns that we shift a 32-bit value by N, and then
> >>> accumulate it into a 64-bit type (target_ulong on ppc64).
> >>>
> >>> The ccr is always 8 * 4-bit fields, and thus is always a
> >>> 32-bit quantity; narrow the type to avoid the warning.
> >>>
> >>> Fixes: Coverity CID 1487223
> >>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> >>> ---
> >>> linux-user/ppc/signal.c | 2 +-
> >>> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> Queued for ppc-7.0
> >
> > NB that this is only suppressing a coverity warning, not
> > correcting any incorrect behaviour, so if you don't have
> > anything else you were planning to send for 7.0 it could
> > also wait til 7.1.
>
> I have a couple of small fixes in :
>
> https://github.com/legoater/qemu/commits/ppc-for-upstream
>
> linux-user/ppc: Narrow type of ccr in save_user_regs
> ppc/pnv: Fix number of registers in the PCIe controller on POWER9
> hw/ppc: free env->tb_env in spapr_unrealize_vcpu()
>
> Nothing critical indeed. So these can wait 7.1 ?
Up to you -- they're all small enough to be OK going into
7.0, and the other two are fixing real bugs.
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-04 9:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01 19:16 [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs Richard Henderson
2022-04-01 21:44 ` Cédric Le Goater
2022-04-04 6:52 ` Cédric Le Goater
2022-04-04 8:41 ` Peter Maydell
2022-04-04 9:09 ` Cédric Le Goater
2022-04-04 9:25 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.