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

Re: [PATCH] x86/hypercall: fix gnttab hypercall args conditional build on pvshim


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 8 Jan 2021 16:27:47 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=04DPxEeAK7OgoLFw8g9RfAcnBXKcIXuROiiEpB3c5qA=; b=kn7AYGCjyQZNrzEuTlwsICJveyd9FOKLBd8jdYBgexMdR8tzKVNUqNrvqIKyxeQX/OIB3NK5arIVMmrwZqYj9qEPXKFSibwMLxWJZIRPYAqqOcE63bOisgsEvD83CID0ByxqCwN5Y4rFAyDynA5HVd8iHe94owkGszi6usWelK0ipRtuwpFzLQqslJPxYslDKL0mGDa/I9w3Q8m9d1wXCfqkHAqeml0E4Kgbt4hOhKRn4x/mh5Crn3KC0iwFOZJUAqox6xaM/JO6oIdxzZ0+rpx+31BrCyfHSlzsixyyYe3Vr7e2oXwBCvguYAp+s8eIQQyYMdKP5j/vv9oNfH/kvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QXeojtxEajFykl5Ss1j6J1Wcz4KHbrKnoF3sWIfZ7eU6B2qDYwGVgbgFsw3VAK1zsZI23XOKL7Semt4oR+g1qVKBdhstNA+JTFZwnVuitwu6/M5Ay61vJ3mpvR9B1fSzBcB36S3HylFj7N//zZhUvK+HjPH1leeMMfu+pFJh48Xt6FAcx2h7tM7C2wwzA1bhY6swE9FVxcgNdnRvLlIAY2NcZ8ZxX2+9BPNGwbCqUK/ylOvvvvSGbEEpsEvPHGFWCVGXtBq+GS8O2kIj8f6j+5fPhL7yns8zWYidhORf5p2PKU/c/YrwCeemBoPhgeRcVPJPX7f+BghNr367XOnAUw==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 08 Jan 2021 15:28:00 +0000
  • Ironport-sdr: cMEsxT8r3RSjIkytOcc2/x+V9jiWPvN9l/P/6KHJDGwHa4Sz5erg7RVGczKZrIcJA0wmxMZPYQ YTuuzyROcNaRqC+xHgGZArK4m/q/xHQkbvn6cEfpWRCHwRAijxgZ2MQ1fgUBrIzOiTKkA9mV7O R5lLjmuetnJS4nrrKPENkSsf0jyCn/3ngYTogCTS4Cy4uLp1OfBHr+DxlQh1sT3yEwJ39rX2nY QQQsU7JPTbuKBZ8DGBVGe8drCvpA9PUsUNiJqRllZbiNCDCxKqWvDktZQA/nggqdWoka8Ic05K 0xs=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jan 08, 2021 at 04:24:01PM +0100, Jan Beulich wrote:
> On 08.01.2021 16:11, Roger Pau Monné wrote:
> > On Fri, Jan 08, 2021 at 04:01:52PM +0100, Jan Beulich wrote:
> >> On 08.01.2021 15:41, Roger Pau Monne wrote:
> >>> --- a/xen/arch/x86/hypercall.c
> >>> +++ b/xen/arch/x86/hypercall.c
> >>> @@ -47,7 +47,7 @@ const hypercall_args_t 
> >>> hypercall_args_table[NR_hypercalls] =
> >>>      ARGS(xen_version, 2),
> >>>      ARGS(console_io, 3),
> >>>      ARGS(physdev_op_compat, 1),
> >>> -#ifdef CONFIG_GRANT_TABLE
> >>> +#if defined(CONFIG_GRANT_TABLE) || defined(CONFIG_PV_SHIM)
> >>>      ARGS(grant_table_op, 3),
> >>>  #endif
> >>>      ARGS(vm_assist, 2),
> >>
> >> This is correct when a shim-enabled build runs as shim, but
> >> not when it runs as normal hypervisor. Just like the hypercall
> >> handler gets patched into the hypercall table (in
> >> pv_shim_setup_dom()), the argument count will also want
> >> updating there, I think.
> > 
> > Having the argument count set when the hypercall handler is NULL is
> > fine, as Xen won't get into processing hypercall_args_table if the
> > handler is NULL.
> 
> Oh, good point.
> 
> > While it's true that can be fixed at run time in the
> > same way that we patch the handler it seems more cumbersome, that's
> > why I went for this IMO simpler fix.
> 
> Agreed:
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks.

In fact I'm not sure it's helpful to have any build time conditionals
in hypercall_args_table, but let's leave that for another fix.

Roger.



 


Rackspace

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