diff mbox

[1/2] ppc/xics: Fix stale irq->status bits after get

Message ID 20170427063153.GB11487@tungsten.ozlabs.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sam Bobroff April 27, 2017, 6:31 a.m. UTC
ics_get_kvm_state() "or"s set bits into irq->status but does not mask
out clear bits.

Correct this by initializing the IRQ status to zero before adding bits
to it.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
 hw/intc/xics_kvm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Gibson May 1, 2017, 6:13 a.m. UTC | #1
On Thu, Apr 27, 2017 at 04:31:53PM +1000, Sam Bobroff wrote:
> ics_get_kvm_state() "or"s set bits into irq->status but does not mask
> out clear bits.
> 
> Correct this by initializing the IRQ status to zero before adding bits
> to it.
> 
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>

This definitely looks like a bugfix, applied to ppc-for-2.10.

> ---
>  hw/intc/xics_kvm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> index 42e0e0ef84..03c1fc77cb 100644
> --- a/hw/intc/xics_kvm.c
> +++ b/hw/intc/xics_kvm.c
> @@ -213,6 +213,7 @@ static void ics_get_kvm_state(ICSState *ics)
>              irq->priority = irq->saved_priority;
>          }
>  
> +        irq->status = 0;
>          if (state & KVM_XICS_PENDING) {
>              if (state & KVM_XICS_LEVEL_SENSITIVE) {
>                  irq->status |= XICS_STATUS_ASSERTED;
diff mbox

Patch

diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index 42e0e0ef84..03c1fc77cb 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -213,6 +213,7 @@  static void ics_get_kvm_state(ICSState *ics)
             irq->priority = irq->saved_priority;
         }
 
+        irq->status = 0;
         if (state & KVM_XICS_PENDING) {
             if (state & KVM_XICS_LEVEL_SENSITIVE) {
                 irq->status |= XICS_STATUS_ASSERTED;