aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/mm.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-03-04 10:16:04 +0100
committerJan Beulich <jbeulich@suse.com>2013-03-04 10:16:04 +0100
commit7ffc9779aa5120c5098d938cb88f69a1dda9a0fe (patch)
tree14fafc8697f4eccf496d2592990da17e6080ca71 /xen/arch/x86/mm.c
parent53decd322157e922cac2988e07da6d39538c8033 (diff)
downloadxen-7ffc9779aa5120c5098d938cb88f69a1dda9a0fe.tar.gz
xen-7ffc9779aa5120c5098d938cb88f69a1dda9a0fe.tar.bz2
xen-7ffc9779aa5120c5098d938cb88f69a1dda9a0fe.zip
x86: make certain memory sub-ops return valid values
When a domain's shared info field "max_pfn" is zero, domain_get_maximum_gpfn() so far returned ULONG_MAX, which do_memory_op() in turn converted to -1 (i.e. -EPERM). Make the former always return a sensible number (i.e. zero if the field was zero) and have the latter no longer truncate return values. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/arch/x86/mm.c')
-rw-r--r--xen/arch/x86/mm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 7d5c25b841..d00d9a2a70 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -433,7 +433,7 @@ unsigned long domain_get_maximum_gpfn(struct domain *d)
if ( is_hvm_domain(d) )
return p2m_get_hostp2m(d)->max_mapped_pfn;
/* NB. PV guests specify nr_pfns rather than max_pfn so we adjust here. */
- return arch_get_max_pfn(d) - 1;
+ return (arch_get_max_pfn(d) ?: 1) - 1;
}
void share_xen_page_with_guest(