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

Re: [PATCH v2 03/15] xen: harmonize return types of hypercall handlers


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 3 Nov 2021 15:54:31 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tY3d8kMC8nolLW8Ft0h1VvmR9+RaTIzykG2O+FU0kJc=; b=KU7vYQKucpjn8GDcoB37RoO9jE8kDGGVo2HK+96TuC/USIQsDojXEKhzvvTleNuKggvHQqXDjqlwmN/DHeUxS5zCz0/z81vAxs6ek452oQIyK3vUiLyhe+kWSW/6/KkCf9DV7WpczOrnVa1cU3dM+H485C7f3ePGS78Ug2ZIXSiGdP+QJvcBHz6P0PRaZWJNPFMgOHGPIU0GBDwBmLaPIfhXOmElKaGEJgqTWx+YXD9WO4+HbA7Gtg87obhESWvEIUgx+waW/uNDFRg2q3idxG/eXy4RTRjQP1qOku4zo8/3AqYRSj4OQ0kBHI3Ca/0GNhgakzmJCkUb4gzpnoqnog==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RJQ3ihsD7L15W/2Jw9gxMuD6J20l7zvpIURn7GHwpChE2kOqe7iGBd7wdeiTyqHiNee81VI018TaF7TnjwO56P67lHshuNmpSj3VLGnabLyQ1rbrKo/wX1ZKbIvwogbA4AEm2VpwgeptoSs0ky3ZLFz92/jasbvr54sUHAYta3gRLSKUt358ohcEjxpnqWfMQFZIPkWBVH73sEz/qt1SF+w+y1o0UAtI7YUFSp8z4/3EU9hh2NRPdpk5DOkfqaFfa5bg8d1cgI23vW8NCCkq7dWxRvH6gQWAdUIAgABIAoSZkOgIWo75nEx8F/7RvBtl2JGF0gJ71wJWVsNnVLURbA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Christopher Clark <christopher.w.clark@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 03 Nov 2021 14:55:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.11.2021 16:20, Juergen Gross wrote:
> Today most hypercall handlers have a return type of long, while the
> compat ones return an int. There are a few exceptions from that rule,
> however.
> 
> Get rid of the exceptions by letting compat handlers always return int
> and others always return long.
> 
> For the compat hvm case use eax instead of rax for the stored result as
> it should have been from the beginning.
> 
> Additionally move some prototypes to include/asm-x86/hypercall.h
> as they are x86 specific. Move the do_physdev_op() prototype from both
> architecture dependant headers to the common one. Move the
> compat_platform_op() prototype to the common header.
> 
> Switch some non style compliant types (u32, s32, s64) to style compliant
> ones.
> 
> Rename paging_domctl_continuation() to do_paging_domctl_cont() and add
> a matching define for the associated hypercall.
> 
> Make do_callback_op() and compat_callback_op() more similar by adding
> the const attribute to compat_callback_op()'s 2nd parameter.
> 
> Change the type of the cmd parameter for [do|compat]_kexec_op() to
> unsigned int, as this is more appropriate for the compat case.

I continue to have reservations here, but I'll leave ack-ing of this
to the kexec maintainer.

> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one further nit:

> --- a/xen/arch/x86/x86_64/platform_hypercall.c
> +++ b/xen/arch/x86/x86_64/platform_hypercall.c
> @@ -4,10 +4,11 @@
>  
>  EMIT_FILE;
>  
> +#include <xen/hypercall.h>
> +#include <xen/types.h>
>  #include <xen/lib.h>
>  #include <compat/platform.h>

Would have been nice if the addition was done such that the result
was properly sorted; one way to do that would be to simply omit
xen/types.h which already gets included by xen/lib.h (and very
likely always will be).

Also I'm not convinced the do_get_debugreg() hoops are really
useful to retain if one way or another we need to rely on
implementation defined behavior anyway.

Jan




 


Rackspace

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