Message ID | 56D8764802000078000D8F4A@prv-mh.provo.novell.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 03/03/16 16:37, Jan Beulich wrote: > Make it return an error on bad domain kind or obviously bad GFN range. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
--- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -591,8 +591,11 @@ int32_t hvm_set_mem_pinned_cacheattr( struct hvm_mem_pinned_cacheattr_range *range; int rc = 1; - if ( !is_hvm_domain(d) || gfn_end < gfn_start ) - return 0; + if ( !is_hvm_domain(d) ) + return -EOPNOTSUPP; + + if ( gfn_end < gfn_start || (gfn_start | gfn_end) >> paddr_bits ) + return -EINVAL; if ( type == XEN_DOMCTL_DELETE_MEM_CACHEATTR ) {