Linux IOMMU Development
 help / color / mirror / Atom feed
From: Nathan Zimmer <nzimmer@sgi.com>
To: jroedel@suse.de, jan.kiszka@siemens.com
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Nathan Zimmer <nzimmer@sgi.com>, Gary Kroening <gfk@sgi.com>
Subject: [RFC] iommu/vt-d: Use the SIRTP when enabling remapping
Date: Tue,  9 Sep 2014 16:11:36 -0500	[thread overview]
Message-ID: <1410297096-54096-1-git-send-email-nzimmer@sgi.com> (raw)

The previous change (iommu/vt-d: Don't store SIRTP request) to this area
caused a crash in our simulator. In particular is seems that by the time a
UART interrupt is sent through the system, we don't see interrupt remapping
to be enabled.  So the interrupt does not get translated to a logical
interrupt and crashes.

OR'ing the SIRTP request to make sure it is seen but hopefully not sticky.
This seems like a clean fix, at least on our simulator; if you don't agree,
our simulator guy will take a closer look at our iommu model.

Found testing on our simulator, not real hardware.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Gary Kroening <gfk@sgi.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Joerg Roedel <jroedel@suse.de>

---
 drivers/iommu/intel_irq_remapping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index a872874..f586e41 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -455,7 +455,7 @@ static void iommu_set_irq_remapping(struct intel_iommu *iommu, int mode)
 	/* Enable interrupt-remapping */
 	iommu->gcmd |= DMA_GCMD_IRE;
 	iommu->gcmd &= ~DMA_GCMD_CFI;  /* Block compatibility-format MSIs */
-	writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
+	writel(iommu->gcmd | DMA_GCMD_SIRTP, iommu->reg + DMAR_GCMD_REG);
 
 	IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG,
 		      readl, (sts & DMA_GSTS_IRES), sts);
-- 
1.8.2.1

             reply	other threads:[~2014-09-09 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 21:11 Nathan Zimmer [this message]
     [not found] ` <1410297096-54096-1-git-send-email-nzimmer-sJ/iWh9BUns@public.gmane.org>
2014-09-10  6:56   ` [RFC] iommu/vt-d: Use the SIRTP when enabling remapping Jan Kiszka
2014-09-10  7:58     ` Gary Kroening
     [not found]       ` <541004B6.8070800-sJ/iWh9BUns@public.gmane.org>
2014-09-10 20:50         ` Gary Kroening

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410297096-54096-1-git-send-email-nzimmer@sgi.com \
    --to=nzimmer@sgi.com \
    --cc=gfk@sgi.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jan.kiszka@siemens.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox