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

[PATCH v2 1/4] x86/vioapic: check IRR before attempting to inject interrupt after EOI


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 15 Jan 2021 15:28:17 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+k3qiWlCgjl2Pt63ZLKagV8c99uNypFBX57XttI3SoU=; b=RRyXtH3Ri21e7O60goz2VmnoG/nT0pl7twZkrEa+QZwci7w42FrIVth+PVZUIm9P7I+QMCB7bgnLbIbta57AFQtufMZ3kjj4NOuRnRVw5M/i9erCshGKWDMaZqCU8D66/hFG1ugxQPVeTEMWELyOmVBaXvrMhRbADGItaC+9uK9qvSCDQzeTWHv3+EfEAUkmQWukB6a5TlWqffQGmCKalm4GzZ8XfhowiBiq7CejED8wQC1hMs0t79IVi1oPx9CVxHYe9f8BmiJaNGOmvSFJ35Oq0KvQFsxXjMCndPHYYEwl08kDxsTt8XWmZpXch+kFtIzD+/5ASchwPr41Ebqtzw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IgpHciDVM8+VgIEzXZAiKxCe4/7Str4arneY43Qt50BnmeAGymxO77fJPDWHlp/9XDOCrqguMvKfuHzZQigcrtbk1AJneld+hP7ZSyOfjnDnhK/kk/YxWUUKVYcxICZIinibgfVHOi4nvhyxQE6k5lU8RbFo8Yj4cKnSHCvqVS2GC+xTMBsxrOwZWs9RzDgrltb4hRVt7H2NGwtLya0qiDsj/q6DI8J18LEp5wdXce9/04w+ZryXJKWMTQBcRzEUsYQhvioPIOQmhry6I51Nz789ABBUvETPtaaUEBKGf41qa3oQkSFyT+F3r2CQiZFeTFFdBihdAsyHv0VHp6Yh5A==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 15 Jan 2021 14:29:05 +0000
  • Ironport-sdr: qhP9+PSfc8bnjA9vdI4fR7FnTzveOWmHAxuTINkpXQ1DYBPRnPOWrhS1j5aKpMdBFGxoS7n+q2 g3dv7g8/FgK7wv9P7Gk0si3Moj/G0V6pXLcOz83SaMNNPrb0ct7ZWLZOzNtRBo97SWor/ZNMcg 4qEz1dndlv/v2eAnPKKzS16NCWukI9ptiZhmCHs30HEUKokGobK20eZm/mNjndiAZkT0RLx1WP mKPXr3JHnDXs8Nepk65HFsoULakZOMJP74wB6K41VfgeQzxyq2+Yr2tMgIn1tEdz+iEKunKWsn Z0E=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In vioapic_update_EOI the irq_lock will be dropped in order to forward
the EOI to the dpci handler, so there's a window between clearing IRR
and checking if the line is asserted where IRR can change behind our
back.

Fix this by checking whether IRR is set before attempting to inject a
new interrupt.

Fixes: 06e3f8f2766 ('vt-d: Do dpci eoi outside of irq_lock.')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index eb6c143f74..804bc77279 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -526,7 +526,7 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
             }
 
             if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-                 !ent->fields.mask &&
+                 !ent->fields.mask && !ent->fields.remote_irr &&
                  hvm_irq->gsi_assert_count[vioapic->base_gsi + pin] )
             {
                 ent->fields.remote_irr = 1;
-- 
2.29.2




 


Rackspace

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