All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation
@ 2020-02-05 11:24 Paul Durrant
  2020-02-05 11:27 ` Wei Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Paul Durrant @ 2020-02-05 11:24 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Paul Durrant, Ian Jackson,
	Jan Beulich, Anthony PERARD, Roger Pau Monné

An assertion in libxl__domain_make():

'soft_reset || *domid == INVALID_DOMID'

does not hold true for stub domain creation, where soft_reset is false
but the passed in domid == 0. This is easily fixed by changing the
initializer in libxl__spawn_stub_dm().

NOTE: The comment for XEN_DOMCTL_createdomain in domctl.h is changed to
      reflect reality.

Fixes: 75259239d85d ("libxl_create: make 'soft reset' explicit")
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Roger Pau Monné <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>

An example of the assertion failure can be seen at:

http://logs.test-lab.xenproject.org/osstest/logs/146726/test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm/10.ts-debian-hvm-install.log
---
 tools/libxl/libxl_dm.c      | 2 +-
 xen/include/public/domctl.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index f758daf3b6..3b1da90167 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2127,7 +2127,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
         goto out;
     }
 
-    sdss->pvqemu.guest_domid = 0;
+    sdss->pvqemu.guest_domid = INVALID_DOMID;
 
     libxl_domain_create_info_init(&dm_config->c_info);
     dm_config->c_info.type = LIBXL_DOMAIN_TYPE_PV;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 2bb7397923..fec6f6fdd1 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -42,7 +42,8 @@
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
- * If it is specified as zero, an id is auto-allocated and returned.
+ * If it is specified as an invalid value (0 or >= DOMID_FIRST_RESERVED),
+ * an id is auto-allocated and returned.
  */
 /* XEN_DOMCTL_createdomain */
 struct xen_domctl_createdomain {
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation
  2020-02-05 11:24 [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation Paul Durrant
@ 2020-02-05 11:27 ` Wei Liu
  2020-02-05 11:29 ` Jan Beulich
  2020-02-05 11:29 ` Anthony PERARD
  2 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2020-02-05 11:27 UTC (permalink / raw)
  To: Paul Durrant
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Jan Beulich,
	Anthony PERARD, xen-devel, Roger Pau Monné

On Wed, Feb 05, 2020 at 11:24:12AM +0000, Paul Durrant wrote:
> An assertion in libxl__domain_make():
> 
> 'soft_reset || *domid == INVALID_DOMID'
> 
> does not hold true for stub domain creation, where soft_reset is false
> but the passed in domid == 0. This is easily fixed by changing the
> initializer in libxl__spawn_stub_dm().
> 
> NOTE: The comment for XEN_DOMCTL_createdomain in domctl.h is changed to
>       reflect reality.
> 
> Fixes: 75259239d85d ("libxl_create: make 'soft reset' explicit")
> Signed-off-by: Paul Durrant <pdurrant@amazon.com>

Acked-by: Wei Liu <wl@xen.org>

I will wait until end of today in case others want to comment on the
domctl.h change.

I will also carry over Anthony's ack from v1 while committing.

Wei.

> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wl@xen.org>
> Cc: Anthony PERARD <anthony.perard@citrix.com>
> Cc: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Julien Grall <julien@xen.org>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> 
> An example of the assertion failure can be seen at:
> 
> http://logs.test-lab.xenproject.org/osstest/logs/146726/test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm/10.ts-debian-hvm-install.log
> ---
>  tools/libxl/libxl_dm.c      | 2 +-
>  xen/include/public/domctl.h | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index f758daf3b6..3b1da90167 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -2127,7 +2127,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
>          goto out;
>      }
>  
> -    sdss->pvqemu.guest_domid = 0;
> +    sdss->pvqemu.guest_domid = INVALID_DOMID;
>  
>      libxl_domain_create_info_init(&dm_config->c_info);
>      dm_config->c_info.type = LIBXL_DOMAIN_TYPE_PV;
> diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
> index 2bb7397923..fec6f6fdd1 100644
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -42,7 +42,8 @@
>  
>  /*
>   * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
> - * If it is specified as zero, an id is auto-allocated and returned.
> + * If it is specified as an invalid value (0 or >= DOMID_FIRST_RESERVED),
> + * an id is auto-allocated and returned.
>   */
>  /* XEN_DOMCTL_createdomain */
>  struct xen_domctl_createdomain {
> -- 
> 2.20.1
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation
  2020-02-05 11:24 [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation Paul Durrant
  2020-02-05 11:27 ` Wei Liu
@ 2020-02-05 11:29 ` Jan Beulich
  2020-02-05 11:29 ` Anthony PERARD
  2 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2020-02-05 11:29 UTC (permalink / raw)
  To: Paul Durrant
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Anthony PERARD,
	xen-devel, Roger Pau Monné

On 05.02.2020 12:24, Paul Durrant wrote:
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -42,7 +42,8 @@
>  
>  /*
>   * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
> - * If it is specified as zero, an id is auto-allocated and returned.
> + * If it is specified as an invalid value (0 or >= DOMID_FIRST_RESERVED),
> + * an id is auto-allocated and returned.
>   */
>  /* XEN_DOMCTL_createdomain */
>  struct xen_domctl_createdomain {

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


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation
  2020-02-05 11:24 [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation Paul Durrant
  2020-02-05 11:27 ` Wei Liu
  2020-02-05 11:29 ` Jan Beulich
@ 2020-02-05 11:29 ` Anthony PERARD
  2020-02-05 11:43   ` Wei Liu
  2 siblings, 1 reply; 5+ messages in thread
From: Anthony PERARD @ 2020-02-05 11:29 UTC (permalink / raw)
  To: Paul Durrant
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Jan Beulich,
	xen-devel, Roger Pau Monné

On Wed, Feb 05, 2020 at 11:24:12AM +0000, Paul Durrant wrote:
> NOTE: The comment for XEN_DOMCTL_createdomain in domctl.h is changed to
>       reflect reality.

Surely, this change deserve to be in its own patch, isn't it?

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation
  2020-02-05 11:29 ` Anthony PERARD
@ 2020-02-05 11:43   ` Wei Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2020-02-05 11:43 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Paul Durrant, Ian Jackson,
	Jan Beulich, xen-devel, Roger Pau Monné

On Wed, Feb 05, 2020 at 11:29:30AM +0000, Anthony PERARD wrote:
> On Wed, Feb 05, 2020 at 11:24:12AM +0000, Paul Durrant wrote:
> > NOTE: The comment for XEN_DOMCTL_createdomain in domctl.h is changed to
> >       reflect reality.
> 
> Surely, this change deserve to be in its own patch, isn't it?

Ideally I would want that too. But this patch is trivial so I'm not too
fussed either way.

Wei.

> 
> -- 
> Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2020-02-05 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 11:24 [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation Paul Durrant
2020-02-05 11:27 ` Wei Liu
2020-02-05 11:29 ` Jan Beulich
2020-02-05 11:29 ` Anthony PERARD
2020-02-05 11:43   ` Wei Liu

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.