All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Paul Durrant <Paul.Durrant@citrix.com>,
	'Stefano Stabellini' <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 5/5] xen: use libxendevicemodel when available
Date: Mon, 6 Mar 2017 09:35:51 +0000	[thread overview]
Message-ID: <31427779196840b3b31171ec9deda91f@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <1636138fa3a948229a4630fe48d5a079@AMSPEX02CL03.citrite.net>

> -----Original Message-----
> From: Qemu-devel [mailto:qemu-devel-
> bounces+paul.durrant=citrix.com@nongnu.org] On Behalf Of Paul Durrant
> Sent: 06 March 2017 09:15
> To: 'Stefano Stabellini' <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> devel@lists.xenproject.org; qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] [PATCH v2 5/5] xen: use libxendevicemodel when
> available
> 
> > -----Original Message-----
> > From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> > Sent: 03 March 2017 20:43
> > To: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Paul Durrant <Paul.Durrant@citrix.com>; xen-
> devel@lists.xenproject.org;
> > qemu-devel@nongnu.org; Anthony Perard <anthony.perard@citrix.com>
> > Subject: RE: [PATCH v2 5/5] xen: use libxendevicemodel when available
> >
> > On Fri, 3 Mar 2017, Stefano Stabellini wrote:
> > > On Fri, 3 Mar 2017, Paul Durrant wrote:
> > > > > -----Original Message-----
> > > > > From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> > > > > Sent: 02 March 2017 22:50
> > > > > To: Paul Durrant <Paul.Durrant@citrix.com>
> > > > > Cc: xen-devel@lists.xenproject.org; qemu-devel@nongnu.org;
> Stefano
> > > > > Stabellini <sstabellini@kernel.org>; Anthony Perard
> > > > > <anthony.perard@citrix.com>
> > > > > Subject: Re: [PATCH v2 5/5] xen: use libxendevicemodel when
> available
> > > > >
> > > > > On Thu, 2 Mar 2017, Paul Durrant wrote:
> > > > > > This patch modifies the wrapper functions in xen_common.h to use
> > the
> > > > > > new xendevicemodel interface if it is available along with
> > compatibility
> > > > > > code to use the old libxenctrl interface if it is not.
> > > > > >
> > > > > > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > > > > > ---
> > > > > > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > > > > > Cc: Anthony Perard <anthony.perard@citrix.com>
> > > > > >
> > > > > > v2:
> > > > > > - Add a compat define for xenforeignmemory_close() since this is
> > now
> > > > > >   used.
> > > > > > ---
> > > > > >  include/hw/xen/xen_common.h | 115
> > > > > +++++++++++++++++++++++++++++++-------------
> > > > > >  xen-common.c                |   8 +++
> > > > > >  2 files changed, 90 insertions(+), 33 deletions(-)
> > > > > >
> > > > > > diff --git a/include/hw/xen/xen_common.h
> > > > > b/include/hw/xen/xen_common.h
> > > > > > index 31cf25f..48444e5 100644
> > > > > > --- a/include/hw/xen/xen_common.h
> > > > > > +++ b/include/hw/xen/xen_common.h
> > > > > > @@ -9,6 +9,7 @@
> > > > > >  #undef XC_WANT_COMPAT_EVTCHN_API
> > > > > >  #undef XC_WANT_COMPAT_GNTTAB_API
> > > > > >  #undef XC_WANT_COMPAT_MAP_FOREIGN_API
> > > > > > +#undef XC_WANT_COMPAT_DEVICEMODEL_API
> > > > > >
> > > > > >  #include <xenctrl.h>
> > > > > >  #include <xenstore.h>
> > > > > > @@ -26,48 +27,95 @@ extern xc_interface *xen_xc;
> > > > > >   * We don't support Xen prior to 4.2.0.
> > > > > >   */
> > > > > >
> > > > > > +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490
> > > > > > +
> > > > > > +typedef xc_interface xendevicemodel_handle;
> > > > > > +
> > > > > > +#define xendevicemodel_open(l, f) xen_xc
> > > > > > +
> > > > > > +#define xendevicemodel_map_io_range_to_ioreq_server \
> > > > > > +    xc_hvm_map_io_range_to_ioreq_server
> > > > > > +#define xendevicemodel_unmap_io_range_from_ioreq_server \
> > > > > > +    xc_hvm_unmap_io_range_from_ioreq_server
> > > > > > +#define xendevicemodel_map_pcidev_to_ioreq_server \
> > > > > > +    xc_hvm_map_pcidev_to_ioreq_server
> > > > > > +#define xendevicemodel_unmap_pcidev_from_ioreq_server \
> > > > > > +    xc_hvm_unmap_pcidev_from_ioreq_server
> > > > > > +#define xendevicemodel_create_ioreq_server \
> > > > > > +    xc_hvm_create_ioreq_server
> > > > > > +#define xendevicemodel_destroy_ioreq_server \
> > > > > > +    xc_hvm_destroy_ioreq_server
> > > > > > +#define xendevicemodel_get_ioreq_server_info \
> > > > > > +    xc_hvm_get_ioreq_server_info
> > > > > > +#define xendevicemodel_set_ioreq_server_state \
> > > > > > +    xc_hvm_set_ioreq_server_state
> > > > > > +#define xendevicemodel_set_pci_intx_level \
> > > > > > +    xc_hvm_set_pci_intx_level
> > > > > > +#define xendevicemodel_set_pci_link_route \
> > > > > > +    xc_hvm_set_pci_link_route
> > > > > > +#define xendevicemodel_set_isa_irq_level \
> > > > > > +    xc_hvm_set_isa_irq_level
> > > > > > +#define xendevicemodel_inject_msi \
> > > > > > +    xc_hvm_inject_msi
> > > > > > +#define xendevicemodel_set_mem_type \
> > > > > > +    xc_hvm_set_mem_type
> > > > > > +#define xendevicemodel_track_dirty_vram \
> > > > > > +    xc_hvm_track_dirty_vram
> > > > > > +#define xendevicemodel_modified_memory \
> > > > > > +    xc_hvm_modified_memory
> > > > >
> > > > > It does build correctly now for Xen < 4.9, however it breaks against
> > > > > xen-unstable:
> > > > >
> > > > >   ERROR: configure test passed without -Werror but failed with -
> Werror.
> > > > >          This is probably a bug in the configure script. The failing command
> > > > >          will be at the bottom of config.log.
> > > > >          You can run configure with --disable-werror to bypass this check.
> > > > >
> > > > > and config.log says:
> > > > >
> > > > >   config-temp/qemu-conf.c: In function 'main':
> > > > >   config-temp/qemu-conf.c:32:3: error: implicit declaration of function
> > > > > 'xc_hvm_set_mem_type' [-Werror=implicit-function-declaration]
> > > > >   config-temp/qemu-conf.c:32:3: error: nested extern declaration of
> > > > > 'xc_hvm_set_mem_type' [-Werror=nested-externs]
> > > > >   config-temp/qemu-conf.c:34:3: error: implicit declaration of function
> > > > > 'xc_hvm_inject_msi' [-Werror=implicit-function-declaration]
> > > > >   config-temp/qemu-conf.c:34:3: error: nested extern declaration of
> > > > > 'xc_hvm_inject_msi' [-Werror=nested-externs]
> > > > >   config-temp/qemu-conf.c:35:3: error: implicit declaration of function
> > > > > 'xc_hvm_create_ioreq_server' [-Werror=implicit-function-
> declaration]
> > > > >   config-temp/qemu-conf.c:35:3: error: nested extern declaration of
> > > > > 'xc_hvm_create_ioreq_server' [-Werror=nested-externs]
> > > > >
> > > > >
> > > > > With -DXC_WANT_COMPAT_DEVICEMODEL_API=1:
> > > > >
> > > > >   In file included from /local/qemu-
> > > > > upstream/include/hw/xen/xen_backend.h:4:0,
> > > > >                    from hw/block/xen_disk.c:27:
> > > > >   /local/qemu-upstream/include/hw/xen/xen_common.h: In function
> > > > > 'xen_set_mem_type':
> > > > >   /local/qemu-upstream/include/hw/xen/xen_common.h:78:5: error:
> > implicit
> > > > > declaration of function 'xc_hvm_set_mem_type' [-Werror=implicit-
> > function-
> > > > > declaration]
> > > > >
> > > >
> > > > Ah... Do you have Anthony's patch?
> > > >
> > > >
> >
> http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=9970e98ace48574701
> > f7e2286fb67090481a3fec
> > > >
> > > > I suspect that may be the problem you're seeing above.
> > >
> > > Yes, I do have it. I am still having build troubles with v5 too. I am
> >
> > I meant v3
> >
> >
> > > attaching my build test script: feel free to use it to test the build of
> > > a single QEMU branch against multiple Xen versions. It requires one Xen
> > > repository checked out and built for each Xen version. I have just
> > > added the Xen 4.9 tests, so they might be wrong somehow, but the
> others
> > > are known to work.
> 
> Your script is lacking Anthony's fix. You need to patch your 4.9 configure
> clause accordingly. I.e. you need -
> I$(XEN_ROOT)/tools/libs/devicemodel/include and -
> L$(XEN_ROOT)/tools/libs/devicemodel in the --extra-cflags.

Sorry, I meant the latter in --extra-ldflags and I notice you do actually have that. It's just the -I that's missing.

  Paul

> 
>   Paul

WARNING: multiple messages have this Message-ID (diff)
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Paul Durrant <Paul.Durrant@citrix.com>,
	'Stefano Stabellini' <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2 5/5] xen: use libxendevicemodel when available
Date: Mon, 6 Mar 2017 09:35:51 +0000	[thread overview]
Message-ID: <31427779196840b3b31171ec9deda91f@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <1636138fa3a948229a4630fe48d5a079@AMSPEX02CL03.citrite.net>

> -----Original Message-----
> From: Qemu-devel [mailto:qemu-devel-
> bounces+paul.durrant=citrix.com@nongnu.org] On Behalf Of Paul Durrant
> Sent: 06 March 2017 09:15
> To: 'Stefano Stabellini' <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> devel@lists.xenproject.org; qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] [PATCH v2 5/5] xen: use libxendevicemodel when
> available
> 
> > -----Original Message-----
> > From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> > Sent: 03 March 2017 20:43
> > To: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Paul Durrant <Paul.Durrant@citrix.com>; xen-
> devel@lists.xenproject.org;
> > qemu-devel@nongnu.org; Anthony Perard <anthony.perard@citrix.com>
> > Subject: RE: [PATCH v2 5/5] xen: use libxendevicemodel when available
> >
> > On Fri, 3 Mar 2017, Stefano Stabellini wrote:
> > > On Fri, 3 Mar 2017, Paul Durrant wrote:
> > > > > -----Original Message-----
> > > > > From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> > > > > Sent: 02 March 2017 22:50
> > > > > To: Paul Durrant <Paul.Durrant@citrix.com>
> > > > > Cc: xen-devel@lists.xenproject.org; qemu-devel@nongnu.org;
> Stefano
> > > > > Stabellini <sstabellini@kernel.org>; Anthony Perard
> > > > > <anthony.perard@citrix.com>
> > > > > Subject: Re: [PATCH v2 5/5] xen: use libxendevicemodel when
> available
> > > > >
> > > > > On Thu, 2 Mar 2017, Paul Durrant wrote:
> > > > > > This patch modifies the wrapper functions in xen_common.h to use
> > the
> > > > > > new xendevicemodel interface if it is available along with
> > compatibility
> > > > > > code to use the old libxenctrl interface if it is not.
> > > > > >
> > > > > > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > > > > > ---
> > > > > > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > > > > > Cc: Anthony Perard <anthony.perard@citrix.com>
> > > > > >
> > > > > > v2:
> > > > > > - Add a compat define for xenforeignmemory_close() since this is
> > now
> > > > > >   used.
> > > > > > ---
> > > > > >  include/hw/xen/xen_common.h | 115
> > > > > +++++++++++++++++++++++++++++++-------------
> > > > > >  xen-common.c                |   8 +++
> > > > > >  2 files changed, 90 insertions(+), 33 deletions(-)
> > > > > >
> > > > > > diff --git a/include/hw/xen/xen_common.h
> > > > > b/include/hw/xen/xen_common.h
> > > > > > index 31cf25f..48444e5 100644
> > > > > > --- a/include/hw/xen/xen_common.h
> > > > > > +++ b/include/hw/xen/xen_common.h
> > > > > > @@ -9,6 +9,7 @@
> > > > > >  #undef XC_WANT_COMPAT_EVTCHN_API
> > > > > >  #undef XC_WANT_COMPAT_GNTTAB_API
> > > > > >  #undef XC_WANT_COMPAT_MAP_FOREIGN_API
> > > > > > +#undef XC_WANT_COMPAT_DEVICEMODEL_API
> > > > > >
> > > > > >  #include <xenctrl.h>
> > > > > >  #include <xenstore.h>
> > > > > > @@ -26,48 +27,95 @@ extern xc_interface *xen_xc;
> > > > > >   * We don't support Xen prior to 4.2.0.
> > > > > >   */
> > > > > >
> > > > > > +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490
> > > > > > +
> > > > > > +typedef xc_interface xendevicemodel_handle;
> > > > > > +
> > > > > > +#define xendevicemodel_open(l, f) xen_xc
> > > > > > +
> > > > > > +#define xendevicemodel_map_io_range_to_ioreq_server \
> > > > > > +    xc_hvm_map_io_range_to_ioreq_server
> > > > > > +#define xendevicemodel_unmap_io_range_from_ioreq_server \
> > > > > > +    xc_hvm_unmap_io_range_from_ioreq_server
> > > > > > +#define xendevicemodel_map_pcidev_to_ioreq_server \
> > > > > > +    xc_hvm_map_pcidev_to_ioreq_server
> > > > > > +#define xendevicemodel_unmap_pcidev_from_ioreq_server \
> > > > > > +    xc_hvm_unmap_pcidev_from_ioreq_server
> > > > > > +#define xendevicemodel_create_ioreq_server \
> > > > > > +    xc_hvm_create_ioreq_server
> > > > > > +#define xendevicemodel_destroy_ioreq_server \
> > > > > > +    xc_hvm_destroy_ioreq_server
> > > > > > +#define xendevicemodel_get_ioreq_server_info \
> > > > > > +    xc_hvm_get_ioreq_server_info
> > > > > > +#define xendevicemodel_set_ioreq_server_state \
> > > > > > +    xc_hvm_set_ioreq_server_state
> > > > > > +#define xendevicemodel_set_pci_intx_level \
> > > > > > +    xc_hvm_set_pci_intx_level
> > > > > > +#define xendevicemodel_set_pci_link_route \
> > > > > > +    xc_hvm_set_pci_link_route
> > > > > > +#define xendevicemodel_set_isa_irq_level \
> > > > > > +    xc_hvm_set_isa_irq_level
> > > > > > +#define xendevicemodel_inject_msi \
> > > > > > +    xc_hvm_inject_msi
> > > > > > +#define xendevicemodel_set_mem_type \
> > > > > > +    xc_hvm_set_mem_type
> > > > > > +#define xendevicemodel_track_dirty_vram \
> > > > > > +    xc_hvm_track_dirty_vram
> > > > > > +#define xendevicemodel_modified_memory \
> > > > > > +    xc_hvm_modified_memory
> > > > >
> > > > > It does build correctly now for Xen < 4.9, however it breaks against
> > > > > xen-unstable:
> > > > >
> > > > >   ERROR: configure test passed without -Werror but failed with -
> Werror.
> > > > >          This is probably a bug in the configure script. The failing command
> > > > >          will be at the bottom of config.log.
> > > > >          You can run configure with --disable-werror to bypass this check.
> > > > >
> > > > > and config.log says:
> > > > >
> > > > >   config-temp/qemu-conf.c: In function 'main':
> > > > >   config-temp/qemu-conf.c:32:3: error: implicit declaration of function
> > > > > 'xc_hvm_set_mem_type' [-Werror=implicit-function-declaration]
> > > > >   config-temp/qemu-conf.c:32:3: error: nested extern declaration of
> > > > > 'xc_hvm_set_mem_type' [-Werror=nested-externs]
> > > > >   config-temp/qemu-conf.c:34:3: error: implicit declaration of function
> > > > > 'xc_hvm_inject_msi' [-Werror=implicit-function-declaration]
> > > > >   config-temp/qemu-conf.c:34:3: error: nested extern declaration of
> > > > > 'xc_hvm_inject_msi' [-Werror=nested-externs]
> > > > >   config-temp/qemu-conf.c:35:3: error: implicit declaration of function
> > > > > 'xc_hvm_create_ioreq_server' [-Werror=implicit-function-
> declaration]
> > > > >   config-temp/qemu-conf.c:35:3: error: nested extern declaration of
> > > > > 'xc_hvm_create_ioreq_server' [-Werror=nested-externs]
> > > > >
> > > > >
> > > > > With -DXC_WANT_COMPAT_DEVICEMODEL_API=1:
> > > > >
> > > > >   In file included from /local/qemu-
> > > > > upstream/include/hw/xen/xen_backend.h:4:0,
> > > > >                    from hw/block/xen_disk.c:27:
> > > > >   /local/qemu-upstream/include/hw/xen/xen_common.h: In function
> > > > > 'xen_set_mem_type':
> > > > >   /local/qemu-upstream/include/hw/xen/xen_common.h:78:5: error:
> > implicit
> > > > > declaration of function 'xc_hvm_set_mem_type' [-Werror=implicit-
> > function-
> > > > > declaration]
> > > > >
> > > >
> > > > Ah... Do you have Anthony's patch?
> > > >
> > > >
> >
> http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=9970e98ace48574701
> > f7e2286fb67090481a3fec
> > > >
> > > > I suspect that may be the problem you're seeing above.
> > >
> > > Yes, I do have it. I am still having build troubles with v5 too. I am
> >
> > I meant v3
> >
> >
> > > attaching my build test script: feel free to use it to test the build of
> > > a single QEMU branch against multiple Xen versions. It requires one Xen
> > > repository checked out and built for each Xen version. I have just
> > > added the Xen 4.9 tests, so they might be wrong somehow, but the
> others
> > > are known to work.
> 
> Your script is lacking Anthony's fix. You need to patch your 4.9 configure
> clause accordingly. I.e. you need -
> I$(XEN_ROOT)/tools/libs/devicemodel/include and -
> L$(XEN_ROOT)/tools/libs/devicemodel in the --extra-cflags.

Sorry, I meant the latter in --extra-ldflags and I notice you do actually have that. It's just the -I that's missing.

  Paul

> 
>   Paul


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

  reply	other threads:[~2017-03-06  9:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 11:09 [Qemu-devel] [PATCH v2 0/5] xen: use new xendevicemodel library Paul Durrant
2017-03-02 11:09 ` Paul Durrant
2017-03-02 11:09 ` [Qemu-devel] [PATCH v2 1/5] xen: make use of xen_xc implicit in xen_common.h inlines Paul Durrant
2017-03-02 11:09   ` Paul Durrant
2017-03-02 11:09 ` [Qemu-devel] [PATCH v2 2/5] xen: rename xen_modified_memory() to xen_hvm_modified_memory() Paul Durrant
2017-03-02 11:09   ` Paul Durrant
2017-03-02 11:09 ` [Qemu-devel] [PATCH v2 3/5] xen: create wrappers for all other uses of xc_hvm_XXX() functions Paul Durrant
2017-03-02 11:09   ` Paul Durrant
2017-03-02 11:09 ` [Qemu-devel] [PATCH v2 4/5] configure: detect presence of libxendevicemodel Paul Durrant
2017-03-02 11:09   ` Paul Durrant
2017-03-02 11:09 ` [Qemu-devel] [PATCH v2 5/5] xen: use libxendevicemodel when available Paul Durrant
2017-03-02 11:09   ` Paul Durrant
2017-03-02 12:10   ` [Qemu-devel] " Anthony PERARD
2017-03-02 12:10     ` Anthony PERARD
2017-03-02 22:49   ` [Qemu-devel] " Stefano Stabellini
2017-03-02 22:49     ` Stefano Stabellini
2017-03-03  9:48     ` [Qemu-devel] " Paul Durrant
2017-03-03  9:48       ` Paul Durrant
2017-03-03 10:38     ` [Qemu-devel] " Paul Durrant
2017-03-03 10:38       ` Paul Durrant
2017-03-03 20:42       ` [Qemu-devel] " Stefano Stabellini
2017-03-03 20:42         ` Stefano Stabellini
2017-03-03 20:43         ` [Qemu-devel] " Stefano Stabellini
2017-03-03 20:43           ` Stefano Stabellini
2017-03-06  9:14           ` [Qemu-devel] " Paul Durrant
2017-03-06  9:14             ` Paul Durrant
2017-03-06  9:35             ` Paul Durrant [this message]
2017-03-06  9:35               ` Paul Durrant
2017-03-06 19:13               ` [Qemu-devel] " Stefano Stabellini
2017-03-06 19:13                 ` Stefano Stabellini
2017-03-07  9:51                 ` [Qemu-devel] " Paul Durrant
2017-03-07  9:51                   ` Paul Durrant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31427779196840b3b31171ec9deda91f@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.