[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/2] viridian: remove synic poll blocking



This was added to try to ensure a consistent intack from repeated calls to
hvm_vcpu_has_pending_irq(). However there are other ways in which a new
IRR bit could be set between such calls. Hence the poll blocking does not
actually serve any useful purpose, so it may as well be removed to simplify
the code.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
Cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/hvm/viridian/synic.c  | 14 +-------------
 xen/arch/x86/hvm/vlapic.c          | 13 ++++---------
 xen/include/asm-x86/hvm/viridian.h |  3 +--
 3 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/synic.c 
b/xen/arch/x86/hvm/viridian/synic.c
index 0fca5d36e6..2791021bcc 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -346,21 +346,9 @@ void viridian_synic_domain_deinit(const struct domain *d)
 {
 }
 
-void viridian_synic_poll_once(struct vcpu *v)
+void viridian_synic_poll(struct vcpu *v)
 {
-    struct viridian_vcpu *vv = v->arch.hvm.viridian;
-
-    if ( vv->polled )
-        return;
-
     viridian_time_poll_timers(v);
-
-    vv->polled = true;
-}
-
-void viridian_synic_poll_unblock(const struct vcpu *v)
-{
-    v->arch.hvm.viridian->polled = false;
 }
 
 bool viridian_synic_deliver_timer_msg(struct vcpu *v, unsigned int sintx,
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index aab365f80d..24e8e63c4f 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1311,15 +1311,15 @@ int vlapic_has_pending_irq(struct vcpu *v)
      * a synthetic interrupt may be asserted during the poll.
      */
     if ( has_viridian_synic(v->domain) )
-        viridian_synic_poll_once(v);
+        viridian_synic_poll(v);
 
     irr = vlapic_find_highest_irr(vlapic);
     if ( irr == -1 )
-        goto out;
+        return -1;
 
     if ( hvm_funcs.virtual_intr_delivery_enabled &&
          !nestedhvm_vcpu_in_guestmode(v) )
-        goto out;
+        return irr;
 
     /*
      * If APIC assist was set then an EOI may have been avoided.
@@ -1340,13 +1340,9 @@ int vlapic_has_pending_irq(struct vcpu *v)
          (irr & 0xf0) <= (isr & 0xf0) )
     {
         viridian_apic_assist_clear(v);
-        irr = -1;
+        return -1;
     }
 
- out:
-    if ( irr == -1 )
-        viridian_synic_poll_unblock(v);
-
     return irr;
 }
 
@@ -1381,7 +1377,6 @@ int vlapic_ack_pending_irq(struct vcpu *v, int vector, 
bool_t force_ack)
         vlapic_set_vector(vector, &vlapic->regs->data[APIC_ISR]);
 
     vlapic_clear_irr(vector, vlapic);
-    viridian_synic_poll_unblock(v);
 
     return 1;
 }
diff --git a/xen/include/asm-x86/hvm/viridian.h 
b/xen/include/asm-x86/hvm/viridian.h
index 5fe2039978..1bea756a26 100644
--- a/xen/include/asm-x86/hvm/viridian.h
+++ b/xen/include/asm-x86/hvm/viridian.h
@@ -143,8 +143,7 @@ void viridian_apic_assist_clear(const struct vcpu *v);
 
 bool viridian_synic_is_auto_eoi_sint(const struct vcpu *v,
                                      unsigned int vector);
-void viridian_synic_poll_once(struct vcpu *v);
-void viridian_synic_poll_unblock(const struct vcpu *v);
+void viridian_synic_poll(struct vcpu *v);
 void viridian_synic_ack_sint(const struct vcpu *v, unsigned int vector);
 
 #endif /* __ASM_X86_HVM_VIRIDIAN_H__ */
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.