Skip to contentSkip to conversation

x86/hvm: check against VIOAPIC_LEVEL_TRIG in hvm_gsi_deassert

PATCH In review Roger Pau Monne 3 participants 4 messages Jun 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/hvm: check against VIOAPIC_LEVEL_TRIG in hvm_gsi_deassert

In order to avoid relying on the specific values of VIOAPIC_{LEVEL/EDGE}_TRIG.

No functional change.

---
 xen/arch/x86/hvm/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/irq.c +1 -1
index 6cbea63f4c..6772aec721 100644
@@ -202,7 +202,7 @@ void hvm_gsi_deassert(struct domain *d, unsigned int gsi)
     int trig = vioapic_get_trigger_mode(d, gsi);
     struct hvm_irq *hvm_irq = hvm_domain_irq(d);
 
-    if ( trig <= VIOAPIC_EDGE_TRIG || gsi >= hvm_irq->nr_gsis )
+    if ( trig != VIOAPIC_LEVEL_TRIG || gsi >= hvm_irq->nr_gsis )
     {
         ASSERT(trig == VIOAPIC_EDGE_TRIG && gsi < hvm_irq->nr_gsis);
         return;
Signature · 1 line
2.26.2
#1 lore raw

Forgot to add maintainers.

Quoted 27 lines · Roger Pau Monne

In order to avoid relying on the specific values of VIOAPIC_{LEVEL/EDGE}_TRIG.

No functional change.

---
 xen/arch/x86/hvm/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/irq.c +1 -1
index 6cbea63f4c..6772aec721 100644
@@ -202,7 +202,7 @@ void hvm_gsi_deassert(struct domain *d, unsigned int gsi)
     int trig = vioapic_get_trigger_mode(d, gsi);
     struct hvm_irq *hvm_irq = hvm_domain_irq(d);
 
-    if ( trig <= VIOAPIC_EDGE_TRIG || gsi >= hvm_irq->nr_gsis )
+    if ( trig != VIOAPIC_LEVEL_TRIG || gsi >= hvm_irq->nr_gsis )
     {
         ASSERT(trig == VIOAPIC_EDGE_TRIG && gsi < hvm_irq->nr_gsis);
         return;
Signature · 1 line
2.26.2
#3 lore raw
Quoted 14 lines

-----Original Message-----
From: Jan Beulich <[email protected]>
Sent: 16 June 2020 12:22
To: Roger Pau Monne <[email protected]>
Cc: [email protected]; Wei Liu <[email protected]>; Andrew Cooper <[email protected]>; Paul Durrant <[email protected]>
Subject: Re: [PATCH] x86/hvm: check against VIOAPIC_LEVEL_TRIG in hvm_gsi_deassert

Quoted 5 lines · Roger Pau Monne

In order to avoid relying on the specific values of VIOAPIC_{LEVEL/EDGE}_TRIG.

No functional change.

Quoted 8 lines
Quoted 2 lines

Since the other patch went in, also Cc-ing Paul for a possible release ack.

Sure, it's trivial so...