From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "fujita.tomonori@lab.ntt.co.jp" <fujita.tomonori@lab.ntt.co.jp>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [PATCH 2/5] xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB.
Date: Tue, 31 Jul 2012 14:25:51 -0400 [thread overview]
Message-ID: <20120731182551.GA1559@phenom.dumpdata.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1207311542520.4645@kaball.uk.xensource.com>
On Tue, Jul 31, 2012 at 03:46:04PM +0100, Stefano Stabellini wrote:
> On Tue, 31 Jul 2012, Konrad Rzeszutek Wilk wrote:
> > 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. */
>
> Maybe rewording it would be a good idea:
>
> /* pci_swiotlb_detect_4gb turns on native SWIOTLB if no_iommu == 0
> * (so no iommu=X command line over-writes).
> * Considering that PV guests don't normally have PCI devices it is not
> * useful to us so we set no_iommu to 1 here */
>
commit 21ef55f4ab2b6d63eb0ed86abbc959d31377853b
Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Fri Jul 27 20:16:00 2012 -0400
xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB.
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.
[v1: Rewrite comment per Stefano's suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c
index b6a5340..1c17227 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,15 @@ 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 on native SWIOTLB if no_iommu == 0
+ * (so no iommu=X command line over-writes).
+ * Considering that PV guests do not want the *native SWIOTLB* but
+ * only Xen SWIOTLB it is not useful to us so set no_iommu=1 here.
+ */
+ if (max_pfn > MAX_DMA32_PFN)
+ no_iommu = 1;
+#endif
return xen_swiotlb;
}
next prev parent reply other threads:[~2012-07-31 18:25 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 ` [PATCH 2/5] xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB Konrad Rzeszutek Wilk
2012-07-31 14:46 ` Stefano Stabellini
2012-07-31 18:25 ` Konrad Rzeszutek Wilk [this message]
2012-08-01 10:09 ` [Xen-devel] " 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
-- strict thread matches above, loose matches on Subject: below --
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=20120731182551.GA1559@phenom.dumpdata.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).