return -ENOSYS for undefined sub-functions
PATCH 1/1 return -ENOSYS for undefined sub-functions
.. in order to provide forward compatibility (allowing unambiguous detection of unimplemented functionality)
Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/mm.c +12 -5
@@ -2134,8 +2134,9 @@ int do_mmuext_op(default :MEM_LOG ("Invalid extended pt command 0x%x" , op.cmd); - okay =0 ; -break ; + rc = -ENOSYS ; + count = i--; +continue ; }if (unlikely (!okay) )
@@ -2151,9 +2152,11 @@ int do_mmuext_op(process_deferred_ops ();/* Add incremental work we have done to the @done output parameter. */ - done += i;if (unlikely (!guest_handle_is_null (pdone)) ) + { + done += i;copy_to_guest (pdone, &done,1 ); + }UNLOCK_BIGLOCK (d);return rc;
@@ -2351,7 +2354,9 @@ int do_mmu_update(default :MEM_LOG ("Invalid page update command %x" , cmd); -break ; + rc = -ENOSYS ; + count = i--; +continue ; }if (unlikely (!okay) )
@@ -2370,9 +2375,11 @@ int do_mmu_update(process_deferred_ops ();/* Add incremental work we have done to the @done output parameter. */ - done += i;if (unlikely (!guest_handle_is_null (pdone)) ) + { + done += i;copy_to_guest (pdone, &done,1 ); + }UNLOCK_BIGLOCK (d);return rc;
xen/arch/x86/oprofile/xenoprof.c +1 -1
@@ -684,7 +684,7 @@ int do_xenoprof_op(int op, XEN_GUEST_HANbreak ;default : - ret = -EINVAL ; + ret = -ENOSYS ; }spin_unlock (&xenoprof_lock);
xen/arch/x86/physdev.c +1 -1
@@ -135,7 +135,7 @@ long do_physdev_op(int cmd, XEN_GUEST_HA }default : - ret = -EINVAL ; + ret = -ENOSYS ;break ; }
xen/arch/x86/x86_32/traps.c +11 -3
@@ -355,7 +355,7 @@ static long register_guest_callback(strubreak ;default : - ret = -EINVAL ; + ret = -ENOSYS ;break ; }
@@ -368,12 +368,20 @@ static long unregister_guest_callback(stswitch ( unreg->type ) { +case CALLBACKTYPE_event: +case CALLBACKTYPE_failsafe: +#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL +case CALLBACKTYPE_sysenter: +#endif + ret = -EINVAL ; +break ; +case CALLBACKTYPE_nmi: ret =unregister_guest_nmi_callback ();break ;default : - ret = -EINVAL ; + ret = -ENOSYS ;break ; }
@@ -412,7 +420,7 @@ long do_callback_op(int cmd, XEN_GUEST_Hbreak ;default : - ret = -EINVAL ; + ret = -ENOSYS ;break ; }
xen/arch/x86/x86_64/traps.c +9 -3
@@ -369,7 +369,7 @@ static long register_guest_callback(strubreak ;default : - ret = -EINVAL ; + ret = -ENOSYS ;break ; }
@@ -382,12 +382,18 @@ static long unregister_guest_callback(stswitch ( unreg->type ) { +case CALLBACKTYPE_event: +case CALLBACKTYPE_failsafe: +case CALLBACKTYPE_syscall: + ret = -EINVAL ; +break ; +case CALLBACKTYPE_nmi: ret =unregister_guest_nmi_callback ();break ;default : - ret = -EINVAL ; + ret = -ENOSYS ;break ; }
@@ -426,7 +432,7 @@ long do_callback_op(int cmd, XEN_GUEST_Hbreak ;default : - ret = -EINVAL ; + ret = -ENOSYS ;break ; }