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

Re: [PATCH] xen/grants: repurpose command line max options


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Mar 2023 17:55:09 +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=hDtnIO33SPjLrOn2eD85FCIXxvvtSiJuPNHVXbgMZAY=; b=Exw1P4P6Z1XHbINUJYRg5IoMC/gC8XwfdZwWxqqVIcwYHO2s8STbDIcnxJg4gUX8oLURQbv6HYXJgNZLols3L7OcqjWLfnWbQ1ZS1zrm6BN92D+8pElFo5NNPdhKyUTCkEsJ0tP4HKCKP23yQ/pPE9TH3avrVYaFlXGjBtqknkNKuSEhzr2Q5S4XzbzSt0CoDq95dfq/3GNLJ0Ca66s0eKSUBoNF67bYvP0o/zyuM+7GBxPTiAqgRLPcX5ZU8JGqLGKBpxZSBm6FirlExkBPGQN2lr6hTons0uVd+sVUF4s8AvJHRL9KtT1swVGsbYxXDfXi+r7lZ50UxuPooKrrRw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JsJT/JtwUHt38nbr/RwKlJgrjqxoGJ21QLUxaTFHzxkNEHWS+zXY+V8ucdyfJIH7LPp0goRcFOEYdf78O9AGt7iTLhqZIWaZ5D7Qg8gxHShKHW0mK+5VRQAiLACX1FhKQElCbM5AZbBvLhd5BOOIbXRqdXhw2fA7YWL66BBs2Z2YSqj2IEi4jBrjGxQEjZK85VS50Y/N9YCynDRW3qqzeBBAkFBepi1TRo4RaWyC8mUyFN0NKh2jREJMZOVrhBXpc15gjvAGxbOfVjC6yqwQQocH71y1adAUWP9ysyTVL1/Krtmw0/r2it9ndhhHF/LjOIJo2eSRLA+fRPj/YnikOw==
  • 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: Mon, 13 Mar 2023 16:55:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.03.2023 13:16, Roger Pau Monne wrote:
> --- a/docs/misc/xen-command-line.pandoc
> +++ b/docs/misc/xen-command-line.pandoc
> @@ -1232,9 +1232,8 @@ The usage of gnttab v2 is not security supported on ARM 
> platforms.
>  
>  > Can be modified at runtime
>  
> -Specify the maximum number of frames which any domain may use as part
> -of its grant table. This value is an upper boundary of the per-domain
> -value settable via Xen tools.
> +Specify the default maximum number of frames which any domain may use as part
> +of its grant table unless a different value is specified at domain creation.
>  
>  Dom0 is using this value for sizing its grant table.

dom0less DomU-s do as well, at the very least, also ...

> @@ -1245,9 +1244,10 @@ Dom0 is using this value for sizing its grant table.
>  
>  > Can be modified at runtime
>  
> -Specify the maximum number of frames to use as part of a domains
> -maptrack array. This value is an upper boundary of the per-domain
> -value settable via Xen tools.
> +Specify the default maximum number of frames to use as part of a domains
> +maptrack array unless a different value is specified at domain creation.
> +
> +Dom0 is using this value for sizing its maptrack array.

... here. And even ordinary DomU-s appear to default to that in the
absence of a specific value in the guest config. IOW at the very least
the info you add should not be misleading. Better would be if the pre-
existing info was adjusted at the same time.

I also wonder about the specific wording down here: While the max grant
table size can indeed be queried, this isn't the case for the maptrack
array. A domain also doesn't need to know its size, so maybe "This value
is used to size all domains' maptrack arrays, unless overridden by their
guest config"?

> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -1956,18 +1956,15 @@ int grant_table_init(struct domain *d, int 
> max_grant_frames,
>          return -EINVAL;
>      }
>  
> -    /* Default to maximum value if no value was specified */
> +    /* Apply defaults if no value was specified */
>      if ( max_grant_frames < 0 )
>          max_grant_frames = opt_max_grant_frames;
>      if ( max_maptrack_frames < 0 )
>          max_maptrack_frames = opt_max_maptrack_frames;
>  
> -    if ( max_grant_frames < INITIAL_NR_GRANT_FRAMES ||
> -         max_grant_frames > opt_max_grant_frames ||
> -         max_maptrack_frames > opt_max_maptrack_frames )
> +    if ( max_grant_frames < INITIAL_NR_GRANT_FRAMES )
>      {
> -        dprintk(XENLOG_INFO, "Bad grant table sizes: grant %u, maptrack 
> %u\n",
> -                max_grant_frames, max_maptrack_frames);
> +        dprintk(XENLOG_INFO, "Bad grant table size %u\n", max_grant_frames);
>          return -EINVAL;
>      }

I think I agree with the relaxation done here, but I also think this not
introducing security concerns wants spelling out in the description: My
understanding is that even in disaggregated environments we assume only
fully privileged entities can create domains.

Jan



 


Rackspace

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