lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 31 Jul 2012 14:25:51 -0400
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	Stefano Stabellini <stefano.stabellini@...citrix.com>
Cc:	"fujita.tomonori@....ntt.co.jp" <fujita.tomonori@....ntt.co.jp>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"JBeulich@...e.com" <JBeulich@...e.com>
Subject: Re: [Xen-devel] [PATCH 2/5] xen/swiotlb: With more than 4GB on
 64-bit, disable the native SWIOTLB.

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@...cle.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@...cle.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@...cle.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;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ