Skip to contentSkip to conversation

xen/arm: vGICv3: Restore the interrupt state correctly

PATCH In review Ayan Kumar Halder 5 participants 5 messages Oct 27, 2022 – Oct 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: vGICv3: Restore the interrupt state correctly

As "spin_lock_irqsave(&v->arch.vgic.lock, flags)" saves the current interrupt state in "flags", "spin_unlock_irqrestore(&v->arch.vgic.lock, flags)" should be used to restore the saved interrupt state.

Fixes fe7fa1332dabd9ce4 ("ARM: vGICv3: handle virtual LPI pending and property tables")
---
 xen/arch/arm/vgic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/vgic-v3.c +1 -1
index d0e265634e..015446be17 100644
@@ -582,7 +582,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
             write_atomic(&v->arch.vgic.rdist_pendbase, reg);
         }
 
-        spin_unlock_irqrestore(&v->arch.vgic.lock, false);
+        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 
         return 1;
     }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

On Thu, 27 Oct 2022 20:09:13 +0100
Ayan Kumar Halder <[email protected]> wrote:

Hi,

Quoted 6 lines

As "spin_lock_irqsave(&v->arch.vgic.lock, flags)" saves the current interrupt state in "flags", "spin_unlock_irqrestore(&v->arch.vgic.lock, flags)" should be used to restore the saved interrupt state.

Fixes fe7fa1332dabd9ce4 ("ARM: vGICv3: handle virtual LPI pending and property tables")

Thanks for fixing this!

Cheers,
Andre

Quoted 17 lines
---
 xen/arch/arm/vgic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/vgic-v3.c +1 -1
index d0e265634e..015446be17 100644
@@ -582,7 +582,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
             write_atomic(&v->arch.vgic.rdist_pendbase, reg);
         }
 
-        spin_unlock_irqrestore(&v->arch.vgic.lock, false);
+        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 
         return 1;
     }
Reviewed-by on v1 1/1
#4 lore raw
In reply to Ayan Kumar Halder

Hi Ayan,

Quoted 8 lines · Ayan Kumar Halder

As "spin_lock_irqsave(&v->arch.vgic.lock, flags)" saves the current interrupt state in "flags", "spin_unlock_irqrestore(&v->arch.vgic.lock, flags)" should be used to restore the saved interrupt state.

Fixes fe7fa1332dabd9ce4 ("ARM: vGICv3: handle virtual LPI pending and property tables")

This is definitely a bug fix candidate for 4.17 !!

Cheers
Bertrand

Quoted 20 lines

---
xen/arch/arm/vgic-v3.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/vgic-v3.c +1 -1
index d0e265634e..015446be17 100644
@@ -582,7 +582,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
            write_atomic(&v->arch.vgic.rdist_pendbase, reg);
        }
 
-        spin_unlock_irqrestore(&v->arch.vgic.lock, false);
+        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 
        return 1;
    }
Signature · 1 line
2.17.1
Acked-by
#2 lore raw
In reply to Andre Przywara

Hi,

Quoted 9 lines · Andre Przywara

On Thu, 27 Oct 2022 20:09:13 +0100
Ayan Kumar Halder <[email protected]> wrote:

Hi,

Quoted 4 lines

As "spin_lock_irqsave(&v->arch.vgic.lock, flags)" saves the current interrupt state in "flags", "spin_unlock_irqrestore(&v->arch.vgic.lock, flags)" should be used to restore the saved interrupt state.

Quoted 6 lines
Quoted 2 lines
Fixes fe7fa1332dabd9ce4 ("ARM: vGICv3: handle virtual LPI pending and property tables")

Thanks for fixing this!

Henry, this is fixing a bug in the ITS. The feature is at the moment experiement and the code is not used by other subystem, so technically not necessary for 4.17. But if you still accept any bug fix (I know we are close to the release), then I would like to request to include. It should be risk free.

Cheers,

Cheers,

Signature · 1 line
Julien Grall
#3 lore raw

Hi Julien,

Quoted 33 lines

-----Original Message-----
From: Julien Grall <[email protected]>
Sent: Friday, October 28, 2022 4:56 PM
To: Andre Przywara <[email protected]>; Ayan Kumar Halder <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Bertrand Marquis <[email protected]>; Henry Wang <[email protected]>
Subject: [for-4.17] Re: [XEN v1] xen/arm: vGICv3: Restore the interrupt state correctly

Hi,

Quoted 6 lines · Andre Przywara

On Thu, 27 Oct 2022 20:09:13 +0100
Ayan Kumar Halder <[email protected]> wrote:

Hi,

Quoted 1 line

As "spin_lock_irqsave(&v->arch.vgic.lock, flags)" saves the current

interrupt

Quoted 1 line
Quoted 1 line

state in "flags", "spin_unlock_irqrestore(&v->arch.vgic.lock, flags)" should

be

Quoted 3 lines
Quoted 3 lines

used to restore the saved interrupt state.

Fixes fe7fa1332dabd9ce4 ("ARM: vGICv3: handle virtual LPI pending and

property tables")

Quoted 5 lines
Quoted 1 line

Thanks for fixing this!

Quoted 7 lines

Henry, this is fixing a bug in the ITS. The feature is at the moment experiement and the code is not used by other subystem, so technically not necessary for 4.17. But if you still accept any bug fix (I know we are close to the release), then I would like to request to include. It should be risk free.

Yeah, of course.

Kind regards,
Henry

Quoted 7 lines

Cheers,

Cheers,

--
Julien Grall