From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/swiotlb: If iommu=soft was not passed in on > 4GB, don't turn it on.
Date: Mon, 30 Jul 2012 15:58:02 +0100 [thread overview]
Message-ID: <alpine.DEB.2.02.1207301551250.4645@kaball.uk.xensource.com> (raw)
In-Reply-To: <20120727175546.GH17427@andromeda.dapyr.net>
On Fri, 27 Jul 2012, Konrad Rzeszutek Wilk wrote:
> On Fri, Jul 27, 2012 at 12:06:27PM +0100, Stefano Stabellini wrote:
> > On Thu, 26 Jul 2012, Konrad Rzeszutek Wilk wrote:
> > > If we boot a 64-bit guest with more than 4GB memory, the SWIOTLB
> > > gets turned on:
> > > PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
> > > software IO TLB [mem 0xfb43d000-0xff43cfff] (64MB) mapped at [ffff8800fb43d000-ffff8800ff43cfff]
> > >
> > > which is OK if we had PCI devices, but not if we did not. In a PV
> > > guest the SWIOTLB ends up asking the hypervisor for precious lowmem
> > > memory - and 64MB of it per guest. On a 32GB machine, this limits the
> > > amount of guests that are 4GB to start due to lowmem exhaustion.
> > >
> > > What we do is detect whether the user supplied e820_hole=1
> > > parameter, which is used to construct an E820 that is similar to
> > > the machine - so that the PCI regions do not overlap with RAM regions.
> > > We check for that by looking at the E820 and seeing if it diverges
> > > from the standard - and if so (and if iommu=soft was not turned on),
> > > we disable the check pci_swiotlb_detect_4gb code.
> >
> > What kind of paramter is it?
> > Is it a Linux cmdline paramter? Or maybe a Xen toolstack parameter?
>
> Its a guest config option.
Is this option turned on by default if the VM config file contains one
or more PCI devices statically assigned to the VM?
If this option is not specified, is it going to be impossible to
dynamically passthrough a PCI devices after the VM is booted?
> > Surely there must be a better way to let Linux know if this paramter has
> > been turned on than looking for ACPI entries in the E820.
>
> I am all open for suggestions. The best way I can think of is to have
> some early_init variant of XenBus-detect-this-backend-parameter. Can
> one unhook an "old" XenBus and reset with the full-fledged XenBus
> init later on?
Assuming that the xen swiotlb is only useful for PCI passthrough devices
in PV guests, we could write few wrappers for the current xen_swiotlb
functions like this:
xen_swiotlb_alloc_coherent_new(..)
{
if (xen_initial_domain() || (xen_pv_domain() && a_pci_device_is_assigned()))
xen_swiotlb_alloc_coherent();
else
return __get_free_pages();
}
do you think it would work?
This way it would be far more flexible.
next prev parent reply other threads:[~2012-07-30 14:58 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 ` [Xen-devel] " Jan Beulich
2012-07-27 17:54 ` Konrad Rzeszutek Wilk
2012-07-30 7:06 ` 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 [this message]
2012-07-30 15:10 ` Konrad Rzeszutek Wilk
2012-07-26 20:43 ` [PATCH 2/2] xen/swiotlb: If user supplied e820_hole=1 in the guest config, enable 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=alpine.DEB.2.02.1207301551250.4645@kaball.uk.xensource.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=konrad@darnok.org \
--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
all inboxes | Powered by JetHome®