From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>,
Manish Jaggi <mjaggi@caviumnetworks.com>,
Jan Beulich <JBeulich@suse.com>
Cc: "Prasun.kapoor@cavium.com" <Prasun.kapoor@cavium.com>,
Vijaya Kumar <Vijaya.Kumar@caviumnetworks.com>,
Julien Grall <julien.grall@linaro.org>,
Xen Devel <xen-devel@lists.xen.org>,
stefano.stabellini@eu.citrix.com
Subject: Re: PCI Pass-through in Xen ARM: Draft 4
Date: Wed, 2 Sep 2015 16:03:49 +0100 [thread overview]
Message-ID: <1441206229.26292.238.camel@citrix.com> (raw)
In-Reply-To: <55E6F29B.6010205@citrix.com>
On Wed, 2015-09-02 at 13:59 +0100, Julien Grall wrote:
> On 02/09/15 13:08, Manish Jaggi wrote:
> >
> >
> > On Tuesday 01 September 2015 01:02 PM, Jan Beulich wrote:
> > > > > > On 31.08.15 at 14:36, <mjaggi@caviumnetworks.com> wrote:
> > > > On Thursday 13 August 2015 03:12 PM, Manish Jaggi wrote:
> > > > > 4.2.1 Mapping BAR regions in guest address space
> > > > >
> > > > > -----------------------------------------------------------------
> > > > > ------------
> > > > >
> > > > >
> > > > > When a PCI-EP device is assigned to a domU the toolstack will
> > > > > read
> > > > > the pci
> > > > > configuration space BAR registers. Toolstack allocates a
> > > > > virtual BAR
> > > > > region for each BAR region, from the area reserved in guest
> > > > > address
> > > > > space for
> > > > > mapping BARs referred to as Guest BAR area. This area is
> > > > > defined in
> > > > > public/arch-arm.h
> > > > >
> > > > > /* For 32bit BARs*/
> > > > > #define GUEST_BAR_BASE_32 <<>>
> > > > > #define GUEST_BAR_SIZE_32 <<>>
> > > > >
> > > > > /* For 64bit BARs*/
> > > > > #define GUEST_BAR_BASE_64 <<>>
> > > > > #define GUEST_BAR_SIZE_64 <<>>
> > > > >
> > > > > Toolstack then invokes domctl xc_domain_memory_mapping to map
> > > > > in
> > > > > stage2
> > > > > translation. If a BAR region address is 32b BASE_32 area would
> > > > > be
> > > > > used,
> > > > > otherwise 64b. If a combination of both is required the support
> > > > > is
> > > > > TODO.
> > > > >
> > > > > Toolstack manages these areas and allocate from these area. The
> > > > > allocation
> > > > > and deallocation is done using APIs similar to malloc and free.
> > > > >
> > > > To implement this feature in xl tools there is required to have a
> > > > malloc
> > > > and free from the reserved area.
> > > > Can we have the XEN_DOMCTL_memory_mapping extended with a flag say
> > > > ALLOCATE/FREE_FROM_BAR_AREA.
> > > > When this flag is passed xen would add or remove the stage2 mapping
> > > > for
> > > > the domain.
> > > > This will make use of the code already present in xen.
> > > Above it was said that the tool stack manages this area (including
> > > allocations from it). Why would this require a new hypercall?
> > As a rule xl tools should manage the guest memory map. Now if it does
> > by
> > itself or initiates it is another thing.
> > Allocating an area for PCI BAR and freeing it reserved area would
> > require adding allocator code in xl tools.
> > Since xen already knows about the area (as it is defined in public
> > header file) and there exists code in xen,
>
> Which code? We don't have any code in Xen to find free space in the
> stage-2 table for the PCI region.
I agree, AFAIK there is no such code in Xen.
So, yes, the toolstack should gain code to assign these regions out of the
MMIO window(s) which are set aside for this purpose in arch-arm.h and tell
the other components in the system as necessary.
> 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.
Right, I gave a longer explanation of this in another mail.
Ian.
next prev parent reply other threads:[~2015-09-02 15:03 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 9:42 PCI Pass-through in Xen ARM: Draft 4 Manish Jaggi
2015-08-13 10:37 ` Julien Grall
2015-09-02 15:19 ` Ian Campbell
2015-09-02 15:40 ` Julien Grall
2015-08-13 15:29 ` Jan Beulich
2015-08-13 17:01 ` Ian Campbell
2015-08-14 9:26 ` Jan Beulich
2015-08-14 13:21 ` Stefano Stabellini
2015-08-14 13:58 ` Jan Beulich
2015-08-14 14:03 ` Stefano Stabellini
2015-08-14 14:34 ` Jan Beulich
2015-08-14 14:37 ` Stefano Stabellini
2015-08-14 14:45 ` Julien Grall
2015-08-14 15:15 ` Jan Beulich
2015-08-14 15:24 ` Stefano Stabellini
2015-09-02 14:45 ` Ian Campbell
2015-09-02 14:52 ` Jan Beulich
2015-09-02 15:07 ` Ian Campbell
2015-09-02 14:47 ` Ian Campbell
2015-08-14 15:38 ` Stefano Stabellini
2015-08-14 18:58 ` Jaggi, Manish
2015-08-16 23:59 ` Stefano Stabellini
2015-09-02 14:57 ` Ian Campbell
2015-09-02 15:06 ` Jan Beulich
2015-08-31 12:36 ` Manish Jaggi
2015-09-01 7:32 ` Jan Beulich
2015-09-02 12:08 ` Manish Jaggi
2015-09-02 12:59 ` Julien Grall
2015-09-02 13:46 ` Ian Campbell
2015-09-02 15:03 ` Ian Campbell
2015-09-02 15:03 ` Ian Campbell [this message]
2015-09-01 16:15 ` Stefano Stabellini
2015-09-10 1:12 ` Julien Grall
2015-09-15 18:58 ` Jaggi, Manish
2015-09-15 21:18 ` David Daney
2015-09-16 12:58 ` Julien Grall
2015-09-19 20:24 ` Manish Jaggi
2015-09-19 20:48 ` Julien Grall
2015-09-19 21:51 ` Daney, David
2015-09-21 10:17 ` 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=1441206229.26292.238.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=JBeulich@suse.com \
--cc=Prasun.kapoor@cavium.com \
--cc=Vijaya.Kumar@caviumnetworks.com \
--cc=julien.grall@citrix.com \
--cc=julien.grall@linaro.org \
--cc=mjaggi@caviumnetworks.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/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).