[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] replace bogus -ENOSYS uses



This doesn't cover all of them, just the ones that I think would most
obviously better be -EINVAL or -EOPNOTSUPP.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -440,7 +440,7 @@ int unmmap_broken_page(struct domain *d,
         return -EINVAL;
 
     if ( !has_hvm_container_domain(d) || !paging_mode_hap(d) )
-        return -ENOSYS;
+        return -EOPNOTSUPP;
 
     rc = -1;
     r_mfn = get_gfn_query(d, gfn, &pt);
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -332,7 +332,7 @@ int mtrr_add_page(unsigned long base, un
        if ((type == MTRR_TYPE_WRCOMB) && !have_wrcomb()) {
                printk(KERN_WARNING
                       "mtrr: your processor doesn't support 
write-combining\n");
-               return -ENOSYS;
+               return -EOPNOTSUPP;
        }
 
        if (!size) {
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5592,7 +5592,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
         break;
 
     case HVMOP_flush_tlbs:
-        rc = guest_handle_is_null(arg) ? hvmop_flush_tlb_all() : -ENOSYS;
+        rc = guest_handle_is_null(arg) ? hvmop_flush_tlb_all() : -EINVAL;
         break;
 
     case HVMOP_track_dirty_vram:
@@ -5832,7 +5832,7 @@ int hvm_debug_op(struct vcpu *v, int32_t
     {
         case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON:
         case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF:
-            rc = -ENOSYS;
+            rc = -EOPNOTSUPP;
             if ( !cpu_has_monitor_trap_flag )
                 break;
             rc = 0;
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3565,7 +3565,7 @@ long do_mmuext_op(
             if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
+                rc = -EOPNOTSUPP;
             }
             else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -353,7 +353,7 @@ int compat_memory_op(unsigned int cmd, X
             struct get_reserved_device_memory grdm;
 
             if ( unlikely(start_extent) )
-                return -ENOSYS;
+                return -EINVAL;
 
             if ( copy_from_guest(&grdm.map, compat, 1) ||
                  !compat_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -621,7 +621,7 @@ int evtchn_fifo_expand_array(const struc
     int rc;
 
     if ( !d->evtchn_fifo )
-        return -ENOSYS;
+        return -EOPNOTSUPP;
 
     spin_lock(&d->event_lock);
     rc = add_page_to_event_array(d, expand_array->array_gfn);
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3025,7 +3025,7 @@ do_grant_table_op(
         return -EINVAL;
 
     if ( (cmd &= GNTTABOP_CMD_MASK) != GNTTABOP_cache_flush && opaque_in )
-        return -ENOSYS;
+        return -EINVAL;
     
     rc = -EFAULT;
     switch ( cmd )
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -937,14 +937,14 @@ long do_memory_op(unsigned long cmd, XEN
 
     case XENMEM_exchange:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         rc = memory_exchange(guest_handle_cast(arg, xen_memory_exchange_t));
         break;
 
     case XENMEM_maximum_ram_page:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         rc = max_page;
         break;
@@ -953,7 +953,7 @@ long do_memory_op(unsigned long cmd, XEN
     case XENMEM_maximum_reservation:
     case XENMEM_maximum_gpfn:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&domid, arg, 1) )
             return -EFAULT;
@@ -1077,7 +1077,7 @@ long do_memory_op(unsigned long cmd, XEN
         struct page_info *page;
 
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
@@ -1114,7 +1114,7 @@ long do_memory_op(unsigned long cmd, XEN
 
     case XENMEM_claim_pages:
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&reservation, arg, 1) )
             return -EFAULT;
@@ -1148,7 +1148,7 @@ long do_memory_op(unsigned long cmd, XEN
         struct vnuma_info tmp;
 
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         /*
          * Guest passes nr_vnodes, number of regions and nr_vcpus thus
@@ -1280,7 +1280,7 @@ long do_memory_op(unsigned long cmd, XEN
         struct get_reserved_device_memory grdm;
 
         if ( unlikely(start_extent) )
-            return -ENOSYS;
+            return -EINVAL;
 
         if ( copy_from_guest(&grdm.map, arg, 1) ||
              !guest_handle_okay(grdm.map.buffer, grdm.map.nr_entries) )


Attachment: replace-bogus-ENOSYS.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.