From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xensource.com,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 2/2] xen/swiotlb: If user supplied e820_hole=1 in the guest config, enable SWIOTLB.
Date: Thu, 26 Jul 2012 16:43:27 -0400 [thread overview]
Message-ID: <1343335407-5465-3-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1343335407-5465-1-git-send-email-konrad.wilk@oracle.com>
We can detect that the user is using e820_hole=1 by parsing the E820.
If it shows regions other than E820_RAM or E820_RESV then the
user is bent on providing us with a PCI device and forgot
to do 'iommu=soft'. So lets enable it for him/her.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/xen/pci-swiotlb-xen.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c
index 56f373e..9b1aebb 100644
--- a/arch/x86/xen/pci-swiotlb-xen.c
+++ b/arch/x86/xen/pci-swiotlb-xen.c
@@ -74,6 +74,11 @@ int __init pci_xen_swiotlb_detect(void)
if (xen_pv_domain())
swiotlb = 0;
+ /* If it hasn't been activated yet, and it has E820 that looks like
+ * the user supplied e820_hole=1, then turn it on. */
+ if (xen_pv_domain() && !xen_initial_domain() &&
+ !xen_swiotlb && e820_has_acpi())
+ xen_swiotlb = 1;
return xen_swiotlb;
}
--
1.7.7.6
prev parent reply other threads:[~2012-07-26 20:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 20:43 [RFC PATCH] Xen-SWIOTLB fixes (v1) for 3.7 Konrad Rzeszutek Wilk
2012-07-26 20:43 ` [PATCH 1/2] xen/swiotlb: If iommu=soft was not passed in on > 4GB, don't turn it on Konrad Rzeszutek Wilk
2012-07-27 7:27 ` Jan Beulich
2012-07-27 11:06 ` Stefano Stabellini
2012-07-27 17:55 ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-07-30 14:58 ` Stefano Stabellini
2012-07-30 15:10 ` Konrad Rzeszutek Wilk
[not found] ` <50125F0B0200007800090DFB@nat28.tlf.novell.com>
2012-07-27 17:54 ` Konrad Rzeszutek Wilk
[not found] ` <20120727175408.GG17427@andromeda.dapyr.net>
2012-07-30 7:06 ` Jan Beulich
2012-07-26 20:43 ` Konrad Rzeszutek Wilk [this message]
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=1343335407-5465-3-git-send-email-konrad.wilk@oracle.com \
--to=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xensource.com \
/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).