xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tamas K Lengyel <tklengyel@sec.in.tum.de>
To: xen-devel@lists.xen.org
Cc: tim@xen.org, dgdegra@tycho.nsa.gov,
	Julien Grall <julien.grall@linaro.org>,
	stefano.stabellini@citrix.com, ian.campbell@citrix.com
Subject: [PATCH for-4.5 v12 2/3] xen/arm: Implement domain_get_maximum_gpfn
Date: Mon, 29 Sep 2014 17:55:12 +0200	[thread overview]
Message-ID: <1412006113-31551-3-git-send-email-tklengyel@sec.in.tum.de> (raw)
In-Reply-To: <1412006113-31551-1-git-send-email-tklengyel@sec.in.tum.de>

From: Julien Grall <julien.grall@linaro.org>

The function domain_get_maximum_gpfn is returning the maximum gpfn ever
mapped in the guest. We can use d->arch.p2m.max_mapped_gfn for this purpose.

We use this in xenaccess as to avoid the user attempting to set page
permissions on pages which don't exist for the domain, as a non-arch specific
sanity check.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c5b48ef..439cb01 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -971,7 +971,7 @@ int page_is_ram_type(unsigned long mfn, unsigned long mem_type)
 
 unsigned long domain_get_maximum_gpfn(struct domain *d)
 {
-    return -ENOSYS;
+    return d->arch.p2m.max_mapped_gfn;
 }
 
 void share_xen_page_with_guest(struct page_info *page,
-- 
2.1.0

  parent reply	other threads:[~2014-09-29 15:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 15:55 [PATCH for-4.5 v12 0/3] Refactoring for future mem_event and mem_access support on ARM Tamas K Lengyel
2014-09-29 15:55 ` [PATCH for-4.5 v12 1/3] xen/xsm: Wrap mem_access blocks into HAS_MEM_ACCESS ifdefs Tamas K Lengyel
2014-09-29 15:55 ` Tamas K Lengyel [this message]
2014-09-29 15:55 ` [PATCH for-4.5 v12 3/3] xen/arm: Add p2m_set_permission and p2m_shatter_page helpers Tamas K Lengyel
2014-10-01 10:59 ` [PATCH for-4.5 v12 0/3] Refactoring for future mem_event and mem_access support on ARM Ian Campbell
2014-10-02 15:50   ` Konrad Rzeszutek Wilk
2014-10-06 13:50     ` Ian Campbell

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=1412006113-31551-3-git-send-email-tklengyel@sec.in.tum.de \
    --to=tklengyel@sec.in.tum.de \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --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).