All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.16] tests/resource: set grant version for created domains
@ 2021-11-15 10:51 Roger Pau Monne
  2021-11-15 11:02 ` Jan Beulich
  2021-11-16 14:40 ` Ian Jackson
  0 siblings, 2 replies; 5+ messages in thread
From: Roger Pau Monne @ 2021-11-15 10:51 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne, Wei Liu, Andrew Cooper, Ian Jackson

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@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Ian Jackson <iwj@xenproject.org>

This patch only modifies a test, so it should be safe to commit as
it's not going to cause any changes to the hypervisor or the tools.
Worse that could happen is it makes the test even more broken, but
it's already unusable.
---
 tools/tests/resource/test-resource.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/tests/resource/test-resource.c b/tools/tests/resource/test-resource.c
index 988f96f7c1..658dd52aed 100644
--- 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
-- 
2.33.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH for-4.16] tests/resource: set grant version for created domains
  2021-11-15 10:51 [PATCH for-4.16] tests/resource: set grant version for created domains Roger Pau Monne
@ 2021-11-15 11:02 ` Jan Beulich
  2021-11-15 11:22   ` Roger Pau Monné
  2021-11-16 14:40 ` Ian Jackson
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2021-11-15 11:02 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: Wei Liu, Andrew Cooper, Ian Jackson, xen-devel

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@citrix.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Technically
Reviewed-by: Jan Beulich <jbeulich@suse.com>

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-4.16] tests/resource: set grant version for created domains
  2021-11-15 11:02 ` Jan Beulich
@ 2021-11-15 11:22   ` Roger Pau Monné
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monné @ 2021-11-15 11:22 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Wei Liu, Andrew Cooper, Ian Jackson, xen-devel

On Mon, Nov 15, 2021 at 12:02:53PM +0100, Jan Beulich wrote:
> 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@citrix.com>
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Technically
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> 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),

OK. I better add one now before we start gaining more of those.

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

Yes, and the python bindings will also need an adjustment.

Thanks, Roger.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-4.16] tests/resource: set grant version for created domains
  2021-11-15 10:51 [PATCH for-4.16] tests/resource: set grant version for created domains Roger Pau Monne
  2021-11-15 11:02 ` Jan Beulich
@ 2021-11-16 14:40 ` Ian Jackson
  2021-11-16 16:32   ` Jan Beulich
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2021-11-16 14:40 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel, Wei Liu, Andrew Cooper

Roger Pau Monne writes ("[PATCH for-4.16] tests/resource: set grant version for created domains"):
> 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@citrix.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Release-Acked-by: Ian Jackson <iwj@xenproject.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-4.16] tests/resource: set grant version for created domains
  2021-11-16 14:40 ` Ian Jackson
@ 2021-11-16 16:32   ` Jan Beulich
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2021-11-16 16:32 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Wei Liu, Andrew Cooper, Roger Pau Monne

On 16.11.2021 15:40, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH for-4.16] tests/resource: set grant version for created domains"):
>> 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@citrix.com>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Release-Acked-by: Ian Jackson <iwj@xenproject.org>

I was meaning to commit this, but you've replied to the singleton v1
patch which is now in the middle of a 4-patch series. I can't very
well assume (silently) that you've meant your ack to apply to that
series - please clarify.

Jan



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-16 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 10:51 [PATCH for-4.16] tests/resource: set grant version for created domains Roger Pau Monne
2021-11-15 11:02 ` Jan Beulich
2021-11-15 11:22   ` Roger Pau Monné
2021-11-16 14:40 ` Ian Jackson
2021-11-16 16:32   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.