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

Re: [PATCH 04/12] xen/x86: modify hvm_memory_op() prototype


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 18 Oct 2021 14:31:40 +0200
  • 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=jfqe/YEfxCbwvfLVoWy/0S77ziqucFehXqYss2BRZPw=; b=JDr5+Gz9fa3midXW5wK28c7OJTdrvt0mrYxJZ15xYPBOnAJT1gm9qVsjH+oGx5Gyx54Q8OyXGRJ+vLLraQSmyVJ0Etu62jdjuqfEBKcnN0LxfSCqyShORdaoeaNQy7bo2sZ1urK6z5+TwviXUn7HIEzi3GAm1FAggDb9KolHL1sRoWabEjlfDGN1QfwmYsTxxf10JmT18dkzhtuUiVp3+YLvh2sr1It5rVNab+9n5386gEftPhsl/aQsp4JH1bCFWKmRgP9mcYglkRJhuPrA62bApo2/4d4EPVSiUoPxiAJAX6obVts4GTyZeunx8fUAmnwnIFjd5js2/ao0C88NfA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VDMTu8QfbEYgUvvtdju0pj1/T8zvk+6TX2O3pc2OgqXAIwFFFXoezytLL9LWW4uuadFbVvZbhiv1RgUWAOPoAb62Do/Xi2G+z4s/louPDBhG+l8llCxgCtbsbD+PcOd/qXcdPawePeLnJH3A6oD9BMsIhDvtSAD/eIcNgZdu/AtZ//HAeblE+89lQxnGVv2/GBxRZEsOIsF4yOMJGn2kRiqQJKiPlmWVIOzs00Nge2tjiWBtPRN1CibeljV8TiX6nk/CrGenY1cHtaS8dhCYm4NxbrDrHQ7o3cMgoxDBnzN/TyE6UkkR2ju52LH2IkqJSwLk/dt2fW1yey0aEWQ18A==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 18 Oct 2021 12:31:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.10.2021 14:51, Juergen Gross wrote:
> hvm_memory_op() should take an unsigned long as cmd, like
> do_memory_op().
> 
> As hvm_memory_op() is basically just calling do_memory_op() (or
> compat_memory_op()) passing through the parameters the cmd parameter
> should have no smaller size than that of the called functions.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Nevertheless ...

> --- a/xen/arch/x86/hvm/hypercall.c
> +++ b/xen/arch/x86/hvm/hypercall.c
> @@ -31,7 +31,7 @@
>  #include <public/hvm/hvm_op.h>
>  #include <public/hvm/params.h>
>  
> -static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
> +static long hvm_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) 
> arg)
>  {
>      long rc;

... I think this would even better be dealt with by splitting the
function into a native one (using unsigned long) and a compat one
(using unsigned int).

Jan




 


Rackspace

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