From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: fujita.tomonori@lab.ntt.co.jp, xen-devel@lists.xensource.com,
linux-kernel@vger.kernel.org, stefano.stabellini@eu.citrix.com,
JBeulich@suse.com
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 2/5] xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB.
Date: Tue, 31 Jul 2012 10:00:20 -0400 [thread overview]
Message-ID: <1343743223-30092-3-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1343743223-30092-1-git-send-email-konrad.wilk@oracle.com>
If a PV guest is booted the native SWIOTLB should not be
turned on. It does not help us (we don't have any PCI devices)
and it eats 64MB of good memory. In the case of PV guests
with PCI devices we need the Xen-SWIOTLB one.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/xen/pci-swiotlb-xen.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c
index b6a5340..0d5a214 100644
--- a/arch/x86/xen/pci-swiotlb-xen.c
+++ b/arch/x86/xen/pci-swiotlb-xen.c
@@ -8,6 +8,11 @@
#include <xen/xen.h>
#include <asm/iommu_table.h>
+#ifdef CONFIG_X86_64
+#include <asm/iommu.h>
+#include <asm/dma.h>
+#endif
+
int xen_swiotlb __read_mostly;
static struct dma_map_ops xen_swiotlb_dma_ops = {
@@ -49,6 +54,13 @@ int __init pci_xen_swiotlb_detect(void)
* the 'swiotlb' flag is the only one turning it on. */
swiotlb = 0;
+#ifdef CONFIG_X86_64
+ /* pci_swiotlb_detect_4gb turns native SWIOTLB if no_iommu == 0
+ * (so no iommu=X command line over-writes). So disable the native
+ * SWIOTLB. */
+ if (max_pfn > MAX_DMA32_PFN)
+ no_iommu = 1;
+#endif
return xen_swiotlb;
}
--
1.7.7.6
next prev parent reply other threads:[~2012-07-31 14:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-31 14:00 [PATCH] Xen-SWIOTLB fixes (v2) for 3.7 Konrad Rzeszutek Wilk
2012-07-31 14:00 ` [PATCH 1/5] xen/swiotlb: Simplify the logic Konrad Rzeszutek Wilk
2012-07-31 14:00 ` Konrad Rzeszutek Wilk [this message]
2012-07-31 14:46 ` [PATCH 2/5] xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB Stefano Stabellini
2012-07-31 18:25 ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-08-01 10:09 ` Stefano Stabellini
2012-07-31 14:00 ` [PATCH 3/5] swiotlb: add the late swiotlb initialization function with iotlb memory Konrad Rzeszutek Wilk
2012-07-31 14:00 ` [PATCH 4/5] xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used Konrad Rzeszutek Wilk
2012-07-31 14:00 ` [PATCH 5/5] xen/pcifront: Use Xen-SWIOTLB when initting if required Konrad Rzeszutek Wilk
2012-08-16 15:54 [PATCH] Xen-SWIOTLB fies (v3) for v3.7 Konrad Rzeszutek Wilk
2012-08-16 15:54 ` [PATCH 2/5] xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB Konrad Rzeszutek Wilk
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=1343743223-30092-3-git-send-email-konrad.wilk@oracle.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=stefano.stabellini@eu.citrix.com \
--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).