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

Re: [PATCH for-4.16] tests/resource: set grant version for created domains


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 15 Nov 2021 12:02:53 +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=V7b762wK0IwJcNCb/AgiZcIEIF2l1RXPGW9Slak8UWM=; b=BDF7FPBOXIDppgguDG8EtsLTzeB7YTSApQZK5p9rnN8l0r7sKxrD+0Pv6L6JqxkaEFWlg0yil2wqhO9FydfsDVn/cyt/NubYIViZLlSUK1wGX4VS/xbarNFppM5YrrRhymopqQcS4tZezG1yDi8rkK0bSPLe/CL7iWmToMKC8Dl7qn5NAJs9OU+yqycARzk1c2jdkTWX46O7CF7CSoRflRpu9FFtIVhrhXVePXwvMmHQpjHfIxVqPLrs2kcoXwWnA8PrPXb38qdr6E45krebA1hvhCbWbQ3+cq4LYUMaDzd0UF0XrlMiZlpIG2MGJB6+YgqEpojLm66LBqE4QxX3BA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gTUo6dhY4OuCUFqD6rFBNV/txjklfz9c9XDoTk0rcDTJXl8uxu/nJh00l3Peme+29xpM1RpCwSBW8V2A0mvqVbZXTioGriWrmTkNJl//71SvvsgcYYjM8nN/mxweUS3jETsKVn9V7Wu6YzLNiU8z71vD1tZUFGCWNbgksmvh6yw26pdq4UaTr7CwaNHPqZnOZ8j1necEuT0t+mLWdB4hJzfDFZLNjIt5V8MhNc1h5aXJq3d8ZHhvMwcBUlCAzXQ1ysg5cUyXbuoKDMqsHmQpxUTfSsnZRlr9e90k9ci3a+t/Utwm5hf+nqOWKWJe37G5lOdgwx/tJP9oKLoyXP/AMA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 15 Nov 2021 11:03:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.11.2021 11:51, Roger Pau Monne wrote:
> Set the grant table version for the created domains to use version 1,
> as that's the used by the test cases. Without setting the grant
> version the domains for the tests cannot be created.
> 
> Fixes: 7379f9e10a ('gnttab: allow setting max version per-domain')
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Technically
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

However, two remarks:

> --- a/tools/tests/resource/test-resource.c
> +++ b/tools/tests/resource/test-resource.c
> @@ -120,6 +120,7 @@ static void test_domain_configurations(void)
>              .create = {
>                  .max_vcpus = 2,
>                  .max_grant_frames = 40,
> +                .grant_opts = 1,
>              },
>          },
>          {
> @@ -128,6 +129,7 @@ static void test_domain_configurations(void)
>                  .flags = XEN_DOMCTL_CDF_hvm,
>                  .max_vcpus = 2,
>                  .max_grant_frames = 40,
> +                .grant_opts = 1,
>                  .arch = {
>                      .emulation_flags = XEN_X86_EMU_LAPIC,
>                  },
> @@ -140,6 +142,7 @@ static void test_domain_configurations(void)
>                  .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
>                  .max_vcpus = 2,
>                  .max_grant_frames = 40,
> +                .grant_opts = 1,
>              },
>          },
>  #endif

The literal 1-s here are really odd to read already now. It would get
worse if some flags were specified later on and then used here, ending
in e.g.

                .grant_opts = XEN_DOMCTL_CDG_feature | 1,

Imo there really ought to be a wrapper macro, such that use sites
will at the same time have documented what this 1 is about:

                .grant_opts = XEN_DOMCTL_CDG_version(1),

And then I guess tools/tests/tsx/test-tsx.c needs similar adjustment.

Jan




 


Rackspace

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