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

Re: [PATCH] xen: add option to disable GNTTABOP_transfer


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Feb 2022 10:10:10 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=/NmLh7X+2qGQ0pCnHnLln80ApoN23mns1vRmFb2h8Ww=; b=cTz0BkG9rdegUwcEvfMxn24HFJveRYT7NAjoApfXP6hc64w0+AGG7Z8pSdG2mGKnMk9pedTY+X3aIbTPqXoE3l3W4jbaK1A5l38GKUEIbfo5ou5eop2SNJyY0Phv/L30ubL8xE9O5tPLtjIA3gZ6eZ30gYgO/0hzz/JoiGicoqVu+irBUf7V8g5aWR2zNB4gQ/saA1DSA8sO4wgYQdJGwgzL497H2t87USRicG1UcCBR1BbHN2DNmLFqvcPWdUQNLt7qRlXrr04P/M7za7bC/0OyeqJvdsfOkJpUI27gCRSuuwmW0aEwBtc479sb8Mu4cui7eX0AhiXc8ET8KTWwXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itxHsIE9hu8Egw/OVj2gqQAgl3Up5WK6edV3z8N6YoZXxXMliiRMlre/laKWqfea5Fc23an8dCwSv9ESBYkOaSzUlfSsKKaHBqFbBDQ0Y0ZU1JoAtLAaC9QuozSY1I8NG5dNZECNga/n/VA+rllHUDXwqWtClI/pEBtDFN7QQ89qZFeLEm/ImbtGPeKMFXJ8g4PGnet1SRaojvPJ2an8rPBaTElJTYiYqREoRW78y4060T/l6sl9W6+9RmjJ7bBvxU+v1pPUTf2KVDMAXQFwB5vGNEOv4nTliDCVg5IGaZcatY/wi0pag9QJTkWJqJJ1R7VGuVPZQAsBxV9oeqci8w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 03 Feb 2022 09:10:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.02.2022 10:02, Juergen Gross wrote:
> The grant table operation GNTTABOP_transfer is meant to be used in
> PV device backends, and it hasn't been used in Linux since the old
> Xen-o-Linux days.

Kind of unusual spelling of XenoLinux ;-)

> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -181,6 +181,7 @@ static int parse_gnttab_max_maptrack_frames(const char 
> *arg)
>  
>  unsigned int __read_mostly opt_gnttab_max_version = GNTTAB_MAX_VERSION;
>  static bool __read_mostly opt_transitive_grants = true;
> +static bool __read_mostly opt_grant_transfer = true;

If this was conditional upon PV (with a #define to false in the
opposite case), it could be __ro_after_init right away, while at
the same time allowing the compiler to eliminate gnttab_transfer().

> @@ -204,6 +205,8 @@ static int __init parse_gnttab(const char *s)
>          }
>          else if ( (val = parse_boolean("transitive", s, ss)) >= 0 )
>              opt_transitive_grants = val;
> +        else if ( (val = parse_boolean("transfer", s, ss)) >= 0 )
> +            opt_grant_transfer = val;
>          else
>              rc = -EINVAL;

To possibly save a further roundtrip: If the PV dependency was added
above, I'd like to ask to follow the model of parse_iommu_param()
here and use "#ifndef opt_grant_transfer" around the added code in
favor of "#ifdef CONFIG_PV".

> @@ -2233,6 +2236,9 @@ gnttab_transfer(
>      unsigned int max_bitsize;
>      struct active_grant_entry *act;
>  
> +    if ( !opt_grant_transfer )
> +        return -ENOSYS;

-EOPNOTSUPP please.

Jan




 


Rackspace

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