From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com,
Ian Campbell <Ian.Campbell@citrix.com>,
Arnd Bergmann <arnd@arndb.de>,
"xen.org" <ian.jackson@eu.citrix.com>,
Andre Przywara <andre.przywara@calxeda.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Olof Johansson <olof@lixom.net>,
linux-arm-kernel@lists.infradead.org
Subject: Re: Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] [xen-unstable test] 21486: tolerable FAIL - PUSHED))
Date: Tue, 12 Nov 2013 15:16:42 +0000 [thread overview]
Message-ID: <20131112151642.GO16735@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.02.1311121449550.26077@kaball.uk.xensource.com>
On Tue, Nov 12, 2013 at 03:00:40PM +0000, Stefano Stabellini wrote:
> On Tue, 12 Nov 2013, Arnd Bergmann wrote:
> > > Or is this a lost fight and should we find a workaround (see below if we
> > > are curious) to make the start of memory look the same?
> >
> > I don't see what hack you are referring to, can you elaborate?
>
> The hack would be mapping dom0 memory at the same start address as it
> would be on the native platform but allocating its memory contiguously
> at an offset.
>
> For example having dom0 psedo-physical memory start at 0x80000000 (as it
> would expect) and end at 0x88000000 (because let's sat that we only give
> 128MB of memory to dom0). The actual physical memory would be allocated
> contiguously from 0xA0000000. The swiotlb-xen code in Linux would be
> made aware of the offset 0xA0000000-0x80000000 via device tree and
> would calculate the right physical address to use for dma operations.
> Today swiotlb-xen assumes that pseudo-phisical addresses correspond to
> physical addresses for dom0.
First, let's get something right here. Conceptually, DMA addresses have
_never_ been the same as physical addresses in the kernel (with the
exception of DMA masks being interpreted strangely.)
Physical addresses have always been what's required to be programmed into
things like the MMU to gain access to RAM. We have virt_to_phys() etc
for translations of this nature for lowmem, and kmap() etc for highmem.
DMA addresses have always been the value which you program into the DMA
controller for it to be able to access RAM. These use the DMA API to
obtain the DMA address. Behind the DMA API, we have dma_to_virt() and
virt_to_dma() etc which do the appropriate translation for this.
Of course, for virtualisation, replacing the DMA ops is probably the
better solution to deal with this, where you can hook into the mapping/
unmapping/coherent functions and return the correct DMA addresses.
Remember though - anything which assumes virtual_address =
phys_to_virt(dma_addr_t) is basically violating the conceptual model
here, and should be fixed.
next prev parent reply other threads:[~2013-11-12 15:16 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 6:52 [xen-unstable test] 21486: tolerable FAIL - PUSHED xen.org
2013-11-06 9:52 ` Xen osstest on Calxeda midway progress (Was: Re: [xen-unstable test] 21486: tolerable FAIL - PUSHED) Ian Campbell
2013-11-06 11:14 ` Stefano Stabellini
2013-11-06 11:19 ` Ian Campbell
2013-11-06 19:40 ` Stefano Stabellini
2013-11-06 19:57 ` Andre Przywara
2013-11-07 11:14 ` Ian Campbell
2013-11-11 18:42 ` Stefano Stabellini
2013-11-12 9:53 ` Ian Campbell
2013-11-12 12:25 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] [xen-unstable test] 21486: tolerable FAIL - PUSHED)) Stefano Stabellini
2013-11-12 13:20 ` Russell King - ARM Linux
2013-11-12 14:38 ` Ian Campbell
2013-11-12 14:44 ` Russell King - ARM Linux
2013-11-12 14:52 ` Ian Campbell
2013-11-12 15:24 ` Michal Simek
2013-11-12 15:39 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: " Russell King - ARM Linux
2013-11-12 15:40 ` Michal Simek
2013-11-12 13:37 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] " Arnd Bergmann
2013-11-12 14:35 ` Julien Grall
2013-11-12 14:40 ` Ian Campbell
2013-11-12 18:39 ` Arnd Bergmann
2013-11-12 18:47 ` Stefano Stabellini
2013-11-12 20:08 ` Arnd Bergmann
2013-11-13 10:50 ` Ian Campbell
2013-11-13 17:33 ` Stefano Stabellini
2013-11-13 19:42 ` Arnd Bergmann
2013-11-14 15:24 ` Stefano Stabellini
2013-11-12 14:41 ` Russell King - ARM Linux
2013-11-12 14:52 ` [Xen-devel] Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: " Julien Grall
2013-11-12 14:57 ` Ian Campbell
2013-11-12 15:24 ` Julien Grall
2013-11-12 15:32 ` Ian Campbell
2013-11-13 12:57 ` Julien Grall
2013-11-12 15:00 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] " Stefano Stabellini
2013-11-12 15:16 ` Russell King - ARM Linux [this message]
2013-11-12 13:58 ` Xen osstest on Calxeda midway progress (Was: Re: [xen-unstable test] 21486: tolerable FAIL - PUSHED) Julien Grall
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=20131112151642.GO16735@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=Ian.Campbell@citrix.com \
--cc=andre.przywara@calxeda.com \
--cc=arnd@arndb.de \
--cc=ian.jackson@eu.citrix.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=olof@lixom.net \
--cc=stefano.stabellini@citrix.com \
--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).