x86/HVM: adjust hvm_set_mem_pinned_cacheattr() error indications

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>
This commit is contained in:
Jan Beulich committed 2016-03-04 14:15:26 +01:00
1 parent 96ade6f697
commit 0681fdbd36
1 file changed
+5 -2
+5 -2
View File
@@ -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 )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.