diff mbox

[v7,06/16] xen: add max possible mfn to struct xen_sysctl_physinfo

Message ID 20170919095852.15785-7-jgross@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jürgen Groß Sept. 19, 2017, 9:58 a.m. UTC
Add the maximum possible mfn to struct xen_sysctl_physinfo in order to
enable Xen tools to size the grant table frame limits for a domU.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sysctl.c         | 1 +
 xen/include/public/sysctl.h | 2 ++
 2 files changed, 3 insertions(+)
diff mbox

Patch

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index a6882d1c9d..22f5d991f6 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -266,6 +266,7 @@  long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         get_outstanding_claims(&pi->free_pages, &pi->outstanding_pages);
         pi->scrub_pages = 0;
         pi->cpu_khz = cpu_khz;
+        pi->max_mfn = get_upper_mfn_bound() - 1;
         arch_do_physinfo(pi);
 
         if ( copy_to_guest(u_sysctl, op, 1) )
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 7830b987da..86b9ced86b 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -108,6 +108,8 @@  struct xen_sysctl_physinfo {
 
     /* XEN_SYSCTL_PHYSCAP_??? */
     uint32_t capabilities;
+
+    uint64_t max_mfn;     /* Largest possible MFN on this host */
 };
 typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_physinfo_t);