[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/4] x86/vioapic: issue EOI to dpci when switching pin to edge trigger mode
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Fri, 15 Jan 2021 15:28:18 +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=DFvWd/zDJt973ue1xatUuG3pwJ3lvWSkD+oWWiLPwAQ=; b=k4mveOk/9K9Nznu3Xd3dMPRKSSCIP/HQp19H5Kp5yylO5jjqF+klSC69paRL1xsszOs37BkFwx+YF6uDqeWuEQssxtCYgrXc3mGkGaN6AekojmlBVGCmgdmyqmHrybHLu96+pSgC5UGjfi1E0r48I1sRc7mkEERGAq03FpFBeKeWlKcaRk3fW+m7s9NjsAxiGAj1nKkNrcVgv09jQsP1kdiZtyeuAuJpWCBJ9AbpD/W7LDrkRqr4ckOh9/aDVXkcLbIKwV5y1VxfrUQjITtJFb98d/TluZRonfUHjc+dDCLDG+EpneOAZIcKChrdUCmlyUoBl9PkPstWSBp8q14Jlw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mPcOXW0qfL6K/d5shopyIJhcooUcBrczgEbENmywb86FvOgw/sk0ydN/VyKH6YbR+4xK1dFUNa/S4pNg6GC5XmlJgQlecvU/TmhGtY9gTY09S7s2UnvhHqopdmwA4A6PzJnZPOtX5k0f+1TZyVOPr1njFT43AIUVI267Ly5UMOFHN7o5mn7TpPak+2lU9RmLUQ9w1bbz0kj3ht9HNmoWBt7vrwQ1LF9k4AX2khKIFzeejMfSpR3KU8MoP6FRbjFbs+6VBGaMpE0kbGUkzl4iUY5GGIV2qX9767nnggk6ozcMBNdsccgrjOztbiIunLkwwYkuOaO4M1swcraYPW7KTA==
- Authentication-results: esa5.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:12 +0000
- Ironport-sdr: 5hEWHygDBfgTQmbeNIYq3wHO7uxyFEwhybhCJM1/sqQl3tY442ir4I1XmXODTa7JcatzZ95nCR t5rfifUtDtGCTxFgnehvWspHxpjOMpFfnyokwXkKJqgzB2Mm7wFL5q/MHJNS+zeV5F9+lczFwD ZfZYGPelCqJDWA3gKSeKcfFDmcLHTxn+jlLhcM8M36kLg4ybuCU8qX5J0Jtf8YK5crtTdsWAUB DmApZoTb6btXiDV6AwSrw7oow3aMxTly0W6VJNAekIitfcxGXmfylTLgVw3RjtUsHTQDH6refu FJk=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
When an IO-APIC pin is switched from level to edge trigger mode the
IRR bit is cleared, so it can be used as a way to EOI an interrupt at
the IO-APIC level.
Such EOI however does not get forwarded to the dpci code like it's
done for the local APIC initiated EOI. This change adds the code in
order to notify dpci of such EOI, so that dpci and the interrupt
controller are in sync.
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
xen/arch/x86/hvm/vioapic.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 804bc77279..dc35347afa 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -268,6 +268,17 @@ static void vioapic_write_redirent(
spin_unlock(&d->arch.hvm.irq_lock);
+ if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG &&
+ ent.fields.remote_irr && is_iommu_enabled(d) )
+ /*
+ * Since IRR has been cleared and further interrupts can be
+ * injected also attempt to deassert any virtual line of passed
+ * through devices using this pin. Switching a pin from level to
+ * trigger mode can be used as a way to EOI an interrupt at the
+ * IO-APIC level.
+ */
+ hvm_dpci_eoi(d, gsi);
+
if ( is_hardware_domain(d) && unmasked )
{
/*
--
2.29.2
|