[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:11:27 +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=Mg8k+cQbJ9xk+PBFxSqw538V6lWlpCSoNTKIOsRlFHU=; b=h4WDnNSsQ2BnqerLQb8mtRm8tF7dWaeNnsHijxYtOJZXM+6FjGEO7z2iAvEzB3QaSpzZaI3WQ5eVDMOKE6UiXWiCgpypFFfFhW6kmZXgDzlaB5x1/ltkzHXJsX5fhA4Gevhs47q0z+XNjAztF220wErphdT72KQtOJizrp6pwePLwRo7kf6YtIo5ajVn5KUMND9haHOoU2ZC+c4SD1+kte5EKIKjb1fcXVp4b9XV39DLyDBSIp8wGqLGKwbXx2zC6ijiruAwh8HxJe+QjNtJlS63mgKi/TxF+T8DuytfD95HA0qoS9RMwlAjJ3bzV08zWFRISNXp0IFCvHa5YCKVXw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZDG1Zv8hsn/NSzPrKVmMOHBWrPQMbglEYYMeD+wWH75gclNHdF9++61IdVYBG1AjEBcYYTGnQaUXRBUqtPQtFnjeJXLeDz1Oj3axmd+352I2lV9NNWoYA+mLuIKuVGvstaxzNZgWXU10zuqEHoVes13Dc8it3uO+X2uWxW+0NwKgSyDr4X/kfbhIvQTuuYUHj8fqbjWcsek339mcu7y9mkK5IGBq9Dt4KQJP7BsYJc4AKRSDTHWnvM16D2+/2tHd1n0C5RiwruJA/rpkvc16UDymG1jcQJSb1XEGAJlIuqO1XEeNsMSJDbJbdWEQABPuJrEZ580iXSklW7n0SC7mig==
  • Authentication-results: esa5.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:11:44 +0000
  • Ironport-sdr: 6KRGf6fQfcTpLhxi8sxknETLHQMa77zL+B9lX76KevOYfZ9VcSMRrgD53kUGRRcldUpGXIhooz 78LoKNiBqd11+eEulVJE3+G0PbhrhXemauUiu9oKWaDrj7r9De1d67s4gPXjcM0o0xRnI1MAHI wqMfswaemvQakdRFzF/7xJS5sl3dBu/l76vv6kxQCauyHtTpCICqDdZijVmlMhmdufy79RsUju GIVZBfB53sA9kagqRlb7Sthg6qdwXX5wGASJ5g1gBh8jqyjJj+vS1UUi9gPWrGJ03wd8tGpbiY /EI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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. 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.

Thanks, Roger.



 


Rackspace

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