From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: Dheeraj CVR <cvr.dheeraj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [BUGREPORT] Intel X58 Boards don't boot after "iommu/vt-d: Make root entry visible for hardware right after allocation"
Date: Thu, 16 Jun 2016 12:29:14 +0200 [thread overview]
Message-ID: <20160616102914.GA11432@8bytes.org> (raw)
In-Reply-To: <CAH-=PyRBZU95f0XPLZQXyaKLPx+K5iNsQs3ucQRj6BPfj9ERBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Thu, Jun 16, 2016 at 10:26:20AM +0400, Dheeraj CVR wrote:
> I have added some debugging code to see where exactly the hang happens. The
> set_root_entry call works fine without any issues as you have expected.
> However, the hang happens when calling flush_context.
>
> flush_context -> qi_flush_context -> qi_submit_sync
>
> The loop "while (qi->desc_status[wait_index] != QI_DONE) {}" in
> "qi_submit_sync" executes indefinitely and the control doesn't break. Hence, "
> iommu->flush.flush_context()" never returns.
>
> Tested on 2 X58 Motherboards and both hang at the same place with intel_iommu=
> on.
>
> Hope this helps.
Hmm, okay. Yesterday I tried to reproduce the problem on a box in our
test-lab which has the same chipset. The bug didn't show up there, and
one difference to your machine is that is only has one iommu instead of
two.
This brought me to another difference the patch made: Before the patch
QI was enabled on all iommus before the root entry was set and the
caches flushed. With the patch QI is enabled in the same loop that sets
the root entry and tries to flush. Maybe that is the problem on this
chipset.
Can you please try the attached diff? It is just a guess, but maybe that
is the problem.
Thanks,
Joerg
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index a644d0c..0ddbb6a 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3222,11 +3222,6 @@ static int __init init_dmars(void)
}
}
- iommu_flush_write_buffer(iommu);
- iommu_set_root_entry(iommu);
- iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL);
- iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);
-
if (!ecap_pass_through(iommu->ecap))
hw_pass_through = 0;
#ifdef CONFIG_INTEL_IOMMU_SVM
@@ -3235,6 +3230,17 @@ static int __init init_dmars(void)
#endif
}
+ /*
+ * Now that qi is enabled on all iommus, set the root entry and flush
+ * caches.
+ */
+ for_each_active_iommu(iommu, drhd) {
+ iommu_flush_write_buffer(iommu);
+ iommu_set_root_entry(iommu);
+ iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL);
+ iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);
+ }
+
if (iommu_pass_through)
iommu_identity_mapping |= IDENTMAP_ALL;
next prev parent reply other threads:[~2016-06-16 10:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 20:35 [BUGREPORT] Intel X58 Boards don't boot after "iommu/vt-d: Make root entry visible for hardware right after allocation" Dheeraj CVR
[not found] ` <CAH-=PyRpjuKf0XJNyzkVLpggaaYq163AfA84SZ5=DQH2Ys5Lkw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-25 3:19 ` Dheeraj CVR
[not found] ` <CAH-=PyR-6sY1vuzQSfJyh35Q+WqZKD70Ev7vDns+02h8j=m18Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-25 11:01 ` Joerg Roedel
[not found] ` <20160425110151.GE17926-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2016-04-25 11:31 ` Dheeraj CVR
[not found] ` <CAH-=PyTGF76sq7LvQH0-28DoK1dXGUOdnCF6z9shF_CWosWYwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-29 12:41 ` Dheeraj CVR
[not found] ` <CAH-=PyTaR-xH7D4eOnFkB-7gojdZW08yHEPP2Gw2-0GjWTA4dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-15 16:11 ` Joerg Roedel
[not found] ` <20160615161149.GJ13971-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2016-06-16 6:26 ` Dheeraj CVR
[not found] ` <CAH-=PyRBZU95f0XPLZQXyaKLPx+K5iNsQs3ucQRj6BPfj9ERBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-16 10:29 ` Joerg Roedel [this message]
[not found] ` <20160616102914.GA11432-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2016-06-16 16:11 ` Dheeraj CVR
[not found] ` <CAH-=PyREixkSp59v_ErYK6rn0X8KLS29XxVCd9u51Yy6+r2tKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-17 9:01 ` Joerg Roedel
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=20160616102914.GA11432@8bytes.org \
--to=joro-zlv9swrftaidnm+yrofe0a@public.gmane.org \
--cc=cvr.dheeraj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).