From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: PCI Pass-through in Xen ARM: Draft 4 Date: Wed, 2 Sep 2015 16:03:13 +0100 Message-ID: <1441206193.26292.237.camel@citrix.com> References: <55CC668F.80104@caviumnetworks.com> <55E44A67.90507@caviumnetworks.com> <55E570C4020000780009E789@prv-mh.provo.novell.com> <55E6E6BC.6000101@caviumnetworks.com> <55E6F29B.6010205@citrix.com> <1441201603.26292.204.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1441201603.26292.204.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall , Manish Jaggi , Jan Beulich Cc: "Prasun.kapoor@cavium.com" , Vijaya Kumar , Julien Grall , stefano.stabellini@eu.citrix.com, Xen Devel List-Id: xen-devel@lists.xenproject.org On Wed, 2015-09-02 at 14:46 +0100, Ian Campbell wrote: > On Wed, 2015-09-02 at 13:59 +0100, Julien Grall wrote: > > (I'm not caught up on my mail, so just commenting on this one aspect) > > > Anyway, I think this logic should be done in the toolstack and not in > > the hypervisor. Only the toolstack is in charge of the memory layout. > > Xen appears to know the memory layout on ARM because it's statically > > define. > > The domU address space GUEST_* #defines in xen/include/public/arch-arm.h > are really just a convenience used when the toolstack and hypervisor need > to agree on a value and that value happens, right now, to be static. > > The _correct_ interface would be a hypercall (or several) where the > toolstack tells Xen what the values are, but that's code and faff etc so > where the value which the toolstack is static we take a short cut and add > one of these #defines. > > So everyone should just think of every GUEST_FOO in there as being > equivalent to: > struct xen_arch_domainconfig { > //.... other stuff > uint64_t foo; > }; > i.e. passed to XEN_DOMCTL_createdomain during domain build (obviously and > a > field foo in struct arch_domain where Xen stashes the value and uses that > instead of GUEST_FOO etc). > > The actual value of foo would be in tools/libx?/something.h, or decided > at > runtime. > > Obviously for FOO which is a static value that's a pain, hence the > #defines > instead. I forgot to also say, there are some regions which Xen doesn't actually need to know about at all, but which are recorded in arch-arm.h so that the complete memory map is in a single place. GUEST_GNTTAB_* and GUEST_MAGIC_* for example fall into this category. I think the GUEST_BAR_* actually fall into this too, since only the toolstack needs to know those limits, and then tell Xen about specific subsets which are mapped to specific devices etc. Ian.