qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-tricore: fix depositing bits from PCXI into ICR
@ 2015-06-24 12:01 Paolo Bonzini
  2015-06-25 14:53 ` Bastian Koppelmann
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2015-06-24 12:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Bastian Koppelmann

Spotted by Coverity, because (env->PCXI & MASK_PCXI_PCPN) >> 24
is always zero.  The immediately preceding assignment is also
wrong though.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-tricore/op_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c
index 10ed541..53edbda 100644
--- a/target-tricore/op_helper.c
+++ b/target-tricore/op_helper.c
@@ -2545,10 +2545,10 @@ void helper_rfm(CPUTriCoreState *env)
     env->PC = (env->gpr_a[11] & ~0x1);
     /* ICR.IE = PCXI.PIE; */
     env->ICR = (env->ICR & ~MASK_ICR_IE) |
-               ((env->PCXI & ~MASK_PCXI_PIE) >> 15);
+               ((env->PCXI & MASK_PCXI_PIE) >> 15);
     /* ICR.CCPN = PCXI.PCPN; */
     env->ICR = (env->ICR & ~MASK_ICR_CCPN) |
-               ((env->PCXI & ~MASK_PCXI_PCPN) >> 24);
+               ((env->PCXI & MASK_PCXI_PCPN) >> 24);
     /* {PCXI, PSW, A[10], A[11]} = M(DCX, 4 * word); */
     env->PCXI = cpu_ldl_data(env, env->DCX);
     psw_write(env, cpu_ldl_data(env, env->DCX+4));
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] target-tricore: fix depositing bits from PCXI into ICR
  2015-06-24 12:01 [Qemu-devel] [PATCH] target-tricore: fix depositing bits from PCXI into ICR Paolo Bonzini
@ 2015-06-25 14:53 ` Bastian Koppelmann
  0 siblings, 0 replies; 2+ messages in thread
From: Bastian Koppelmann @ 2015-06-25 14:53 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial

On 06/24/2015 02:01 PM, Paolo Bonzini wrote:
> Spotted by Coverity, because (env->PCXI & MASK_PCXI_PCPN) >> 24
> is always zero.  The immediately preceding assignment is also
> wrong though.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target-tricore/op_helper.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c
> index 10ed541..53edbda 100644
> --- a/target-tricore/op_helper.c
> +++ b/target-tricore/op_helper.c
> @@ -2545,10 +2545,10 @@ void helper_rfm(CPUTriCoreState *env)
>       env->PC = (env->gpr_a[11] & ~0x1);
>       /* ICR.IE = PCXI.PIE; */
>       env->ICR = (env->ICR & ~MASK_ICR_IE) |
> -               ((env->PCXI & ~MASK_PCXI_PIE) >> 15);
> +               ((env->PCXI & MASK_PCXI_PIE) >> 15);
>       /* ICR.CCPN = PCXI.PCPN; */
>       env->ICR = (env->ICR & ~MASK_ICR_CCPN) |
> -               ((env->PCXI & ~MASK_PCXI_PCPN) >> 24);
> +               ((env->PCXI & MASK_PCXI_PCPN) >> 24);
>       /* {PCXI, PSW, A[10], A[11]} = M(DCX, 4 * word); */
>       env->PCXI = cpu_ldl_data(env, env->DCX);
>       psw_write(env, cpu_ldl_data(env, env->DCX+4));
Thanks, applied it to my tricore-next branch.

Cheers,
Bastian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-25 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24 12:01 [Qemu-devel] [PATCH] target-tricore: fix depositing bits from PCXI into ICR Paolo Bonzini
2015-06-25 14:53 ` Bastian Koppelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).