From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xen.org
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com,
george.dunlap@citrix.com, tim@xen.org,
Julien Grall <julien.grall@arm.com>,
shannon.zhao@linaro.org
Subject: [for-4.7 1/2] xen: XENMEM_add_physmap_batch: Mark 'foreign_id' as reserved for dev_mmio
Date: Wed, 25 May 2016 12:41:18 +0100 [thread overview]
Message-ID: <1464176479-14669-2-git-send-email-julien.grall@arm.com> (raw)
In-Reply-To: <1464176479-14669-1-git-send-email-julien.grall@arm.com>
The field 'foreign_id' is not used when the space is dev_mmio. As the
space is not yet part of the stable ABI, the field is marked as reserved
for future use.
The value should always be 0, other values will return -ENOSYS.
Note that the code would need some rework (such as renaming the field
'foreign_id' to a generic name), however the release of Xen 4.7 is
really close. The rework will be done for the next release.
Signed-off-by: Julien Grall <julien.grall@arm.com>
---
xen/arch/arm/mm.c | 4 ++++
xen/common/memory.c | 6 ++++--
xen/include/public/memory.h | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b46e23e..83edfa1 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1143,6 +1143,10 @@ int xenmem_add_to_physmap_one(
break;
}
case XENMAPSPACE_dev_mmio:
+ /* The field 'foreign_domid' is reserved for future use */
+ if ( foreign_domid )
+ return -ENOSYS;
+
rc = map_dev_mmio_region(d, gpfn, 1, idx);
return rc;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 644f81a..6bc52ac 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -639,9 +639,11 @@ static int xenmem_add_to_physmap(struct domain *d,
{
unsigned int done = 0;
long rc = 0;
+ /* The field 'foreign_id' should be 0 when mapping MMIO. */
+ domid_t inv = (xatp->space != XENMAPSPACE_dev_mmio) ? DOMID_INVALID : 0;
if ( xatp->space != XENMAPSPACE_gmfn_range )
- return xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
+ return xenmem_add_to_physmap_one(d, xatp->space, inv,
xatp->idx, xatp->gpfn);
if ( xatp->size < start )
@@ -658,7 +660,7 @@ static int xenmem_add_to_physmap(struct domain *d,
while ( xatp->size > done )
{
- rc = xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
+ rc = xenmem_add_to_physmap_one(d, xatp->space, inv,
xatp->idx, xatp->gpfn);
if ( rc < 0 )
break;
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index fe52ee1..b023046 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -259,7 +259,7 @@ struct xen_add_to_physmap_batch {
/* Number of pages to go through */
uint16_t size;
- domid_t foreign_domid; /* IFF gmfn_foreign */
+ domid_t foreign_domid; /* IFF gmfn_foreign. Should be 0 for other spaces. */
/* Indexes into space being mapped. */
XEN_GUEST_HANDLE(xen_ulong_t) idxs;
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-05-25 11:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 11:41 [for-4.7 0/2] xen: Julien Grall
2016-05-25 11:41 ` Julien Grall [this message]
2016-05-25 13:12 ` [for-4.7 1/2] xen: XENMEM_add_physmap_batch: Mark 'foreign_id' as reserved for dev_mmio Jan Beulich
2016-05-25 14:04 ` Wei Liu
2016-05-25 14:28 ` Julien Grall
2016-05-25 11:41 ` [for-4.7 2/2] xen/arm: Document the behavior of XENMAPSPACE_dev_mmio Julien Grall
2016-05-25 13:14 ` Jan Beulich
2016-05-25 14:43 ` Julien Grall
2016-05-25 14:53 ` Jan Beulich
2016-05-26 9:18 ` Stefano Stabellini
2016-05-26 9:28 ` Julien Grall
2016-05-25 11:42 ` xen: XENMEM_add_physmap_batch: Mark 'foreign_is' as reserved for dev_mmio (WAS Re: [for-4.7 0/2] xen:) 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=1464176479-14669-2-git-send-email-julien.grall@arm.com \
--to=julien.grall@arm.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=shannon.zhao@linaro.org \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@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).