From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"Tim (Xen.org)" <tim@xen.org>
Subject: Re: [PATCH v4 1/6] xen: improve changes to xen_add_to_physmap
Date: Wed, 19 Sep 2012 14:55:13 +0100 [thread overview]
Message-ID: <1348062913.14977.132.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1209191408460.29232@kaball.uk.xensource.com>
> > mfn = maddr >> PAGE_SHIFT;
> > - if (x && x--) {
> > - printk("Mapping dom%d mfn 0x%lx to dom%d mfn 0x%"PRIpaddr"\n",
> > - od->domain_id, mfn, d->domain_id, xatp->gpfn);
> > - }
>
> why remove the printk here?
It's debug junk which crept in from somewhere else, I'll clean it up in
the original patch which added it before posting this stuff properly.
> > diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
> > index b2adfbe..1cc7a80 100644
> > --- a/xen/include/public/memory.h
> > +++ b/xen/include/public/memory.h
> > @@ -198,6 +198,15 @@ struct xen_machphys_mapping {
> > typedef struct xen_machphys_mapping xen_machphys_mapping_t;
> > DEFINE_XEN_GUEST_HANDLE(xen_machphys_mapping_t);
> >
> > +/* Source mapping space. */
> > +/* ` enum phys_map_space { */
> > +#define XENMAPSPACE_shared_info 0 /* shared info page */
> > +#define XENMAPSPACE_grant_table 1 /* grant table page */
> > +#define XENMAPSPACE_gmfn 2 /* GMFN */
> > +#define XENMAPSPACE_gmfn_range 3 /* GMFN range */
> > +#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom */
> > +/* ` } */
> > /*
> > * Sets the GPFN at which a particular page appears in the specified guest's
> > * pseudophysical address space.
> > @@ -211,26 +220,40 @@ struct xen_add_to_physmap {
> > /* Number of pages to go through for gmfn_range */
> > uint16_t size;
> >
> > - /* Source mapping space. */
> > -#define XENMAPSPACE_shared_info 0 /* shared info page */
> > -#define XENMAPSPACE_grant_table 1 /* grant table page */
> > -#define XENMAPSPACE_gmfn 2 /* GMFN */
> > -#define XENMAPSPACE_gmfn_range 3 /* GMFN range */
> > -#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another guest */
> > - uint16_t space;
> > + uint16_t space; /* => enum phys_map_space */
> > domid_t foreign_domid; /* IFF gmfn_foreign */
>
> I don't like very much that you have a uint16_t in the struct that
> actually represents a union
Actually, the foreign_domid can go from here, since it is entirely
replaced with the xatp_range stuff. IOW XENMAPSPACE_gmfn_foreign will
only be valid with the add_to_physmap_range version of this interface.
This is just a left over (and it's convenient during the transition
period).
>
>
> > #define XENMAPIDX_grant_table_status 0x80000000
> >
> > - /* Index into source mapping space. */
> > + /* Index into space being mapped. */
> > xen_ulong_t idx;
> >
> > - /* GPFN where the source mapping page should appear. */
> > + /* GPFN in domid where the source mapping page should appear. */
> > xen_pfn_t gpfn;
> > };
> > typedef struct xen_add_to_physmap xen_add_to_physmap_t;
> > DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
> >
> > +/* A batched version of add_to_physmap. */
> > +#define XENMEM_add_to_physmap_range 23
> > +struct xen_add_to_physmap_range {
> > + /* Which domain to change the mapping for. */
> > + domid_t domid;
> > + uint16_t space; /* => enum phys_map_space */
> > +
> > + /* Number of pages to go through */
> > + uint16_t size;
> > + domid_t foreign_domid; /* IFF gmfn_foreign */
> > +
> > + /* Indexes into space being mapped. */
> > + XEN_GUEST_HANDLE(xen_ulong_t) idxs;
> > +
> > + /* GPFN in domdwhere the source mapping page should appear. */
> ^ domid where
Thanks.
>
> > + XEN_GUEST_HANDLE(xen_pfn_t) gpfns;
> > +};
> > +typedef struct xen_add_to_physmap_range xen_add_to_physmap_range_t;
> > +DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_range_t);
> > +
> > /*
> > * Unmaps the page appearing at a particular GPFN from the specified guest's
> > * pseudophysical address space.
> > diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
> > index b2f6c50..9425520 100644
> > --- a/xen/include/public/xen.h
> > +++ b/xen/include/public/xen.h
> > @@ -51,6 +51,7 @@ DEFINE_XEN_GUEST_HANDLE(void);
> >
> > DEFINE_XEN_GUEST_HANDLE(uint64_t);
> > DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
> > +DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
> > #endif
>
> You shouldn't need that: xen_ulong_t is already defined in arch-arm.h
> (and arch-x86/xen.h)
The type is, but the guest handle is not.
Ian.
next prev parent reply other threads:[~2012-09-19 13:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 11:07 [PATCH v4 0/6] ARM hypercall ABI: 64 bit ready Stefano Stabellini
2012-08-22 11:08 ` [PATCH v4 1/6] xen: improve changes to xen_add_to_physmap Stefano Stabellini
2012-09-14 12:59 ` Ian Campbell
2012-09-14 13:17 ` Ian Campbell
2012-09-14 13:47 ` Ian Campbell
2012-09-14 13:56 ` Ian Campbell
2012-09-14 14:27 ` Jan Beulich
2012-09-14 15:44 ` Stefano Stabellini
2012-09-14 15:52 ` Ian Campbell
2012-09-14 15:54 ` Stefano Stabellini
2012-09-14 23:09 ` Mukesh Rathor
2012-09-14 23:07 ` Mukesh Rathor
2012-09-17 10:54 ` Stefano Stabellini
2012-09-19 13:03 ` Ian Campbell
2012-09-19 13:09 ` Ian Campbell
2012-09-19 13:20 ` Stefano Stabellini
2012-09-19 13:50 ` Ian Campbell
2012-09-19 13:17 ` Stefano Stabellini
2012-09-19 13:55 ` Ian Campbell [this message]
2012-08-22 11:08 ` [PATCH v4 2/6] xen: xen_ulong_t substitution Stefano Stabellini
2012-08-22 11:08 ` [PATCH v4 3/6] xen: change the limit of nr_extents to UINT_MAX >> MEMOP_EXTENT_SHIFT Stefano Stabellini
2012-08-22 11:08 ` [PATCH v4 4/6] xen: introduce XEN_GUEST_HANDLE_PARAM Stefano Stabellini
2012-10-03 13:35 ` Ian Campbell
2012-10-05 9:13 ` Ian Campbell
2012-10-09 14:10 ` Stefano Stabellini
2012-08-22 11:08 ` [PATCH v4 5/6] xen: replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when appropriate Stefano Stabellini
2012-08-22 11:08 ` [PATCH v4 6/6] xen: more substitutions Stefano Stabellini
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=1348062913.14977.132.camel@zakaz.uk.xensource.com \
--to=ian.campbell@citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=tim@xen.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;
as well as URLs for NNTP newsgroup(s).