From: Uli <um@amd64.org>
To: Guy Zana <guy@neocleus.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: How to allocate contiguous RAM in pv guests
Date: Tue, 30 Jan 2007 17:31:40 +0100 [thread overview]
Message-ID: <20070130163139.GA23345@amd64.org> (raw)
In-Reply-To: <9392A06CB0FDC847B3A530B3DC174E7B01E1CF31@mse10be1.mse10.exchange.ms>
On Tue 30.01.07 05:28, Guy Zana wrote:
> Hi,
>
> An idea is to scan the bios e820 table and split a large block to reserve those 64MB.
> Than, you can mark this block as E820_GART or something and add your own allocator next to the xen-heap allocator.
> To map it contigiously, you can use the fixmap from the I/O remapping area.
> Is this what you need?
Yeah, I would have needed something along these lines.
However, I just found out that there's an adaptive mechanism due to
which I don't need to implement anything at all.
Xen will (unless dom0_mem is provided) keep 1/16th of the memory free
and in the heap. For a >4GB system, this is at least 256mb, leaving
enough memory for the aperture. This mechanism is also the reason why I
experienced a case where there wasn't enough memory...that was on a
system with 1GB memory, 1/16th being 64MB. Since the GART is usually
deactivated on systems with less than 4GB RAM, there is no problem at
all.
I'm relieved :)
Thanks for your help,
Uli
>
> Thanks,
> Guy.
>
> > -----Original Message-----
> > From: xen-devel-bounces@lists.xensource.com
> > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Uli
> > Sent: Monday, January 29, 2007 4:55 PM
> > To: xen-devel@lists.xensource.com
> > Subject: [Xen-devel] How to allocate contiguous RAM in pv guests
> >
> > Hi!
> >
> > I'm working on a patch to get the GART as an IOMMU working in
> > linux/dom0.
> > However, the problem I describe below applies equally to the
> > software IOMMU.
> >
> > If the BIOS doesn't setup the aperture it has to be allocated
> > from memory. Therefore, one needs a contiguous memory region,
> > currently 64MB.
> > The software IOMMU always needs a contiguous memory region
> > (same size).
> >
> > In order to do this, the hypercall XENMEM_exchange is given a
> > bunch of mfns and returns a (host physically) contiguous
> > memory region.
> > Unfortunately, the implementation allocates the contiguous
> > memory from the heap first and then returns the discontiguous
> > mfns to it. Therefore, there has to be a (in this case) 64MB
> > chunk of memory in the xen heap available for the call to succeed.
> > I have observed that on most machines exactly one such chunk
> > is available. However, I've also had a machine where this is
> > not the case.
> >
> > It seems to me that using the xen heap is not the right thing to do.
> > The only other option I can think of is scanning dom0's
> > memory for a (host physical) chunk of memory that
> > a) belongs entirely to it and
> > b) is free
> >
> > Once such a chunk is found, one would have to map it
> > contiguously into virtual memory. Actually, the latter is
> > only neccessary for the software IOMMU. The GART aperture
> > doesn't have to be in virtual memory since it is only
> > accessed from devices.
> >
> > Thanks for any suggestions,
> >
> > Uli
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> >
>
prev parent reply other threads:[~2007-01-30 16:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-29 14:54 How to allocate contiguous RAM in pv guests Uli
2007-01-30 10:28 ` Guy Zana
2007-01-30 16:31 ` Uli [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=20070130163139.GA23345@amd64.org \
--to=um@amd64.org \
--cc=guy@neocleus.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.