[Qemu-devel] [PULL 0/21] Please pull xen-20170421-tag for 2.10

Stefano Stabellini posted 21 patches 6 years, 11 months ago
Only 1 patches received!
MAINTAINERS                                  |   1 +
Makefile.target                              |   6 -
configure                                    | 164 +++++----
default-configs/i386-softmmu.mak             |   1 -
default-configs/x86_64-softmmu.mak           |   1 -
hw/9pfs/9p.h                                 |   6 +
hw/9pfs/Makefile.objs                        |   1 +
hw/9pfs/virtio-9p-device.c                   |   6 +-
hw/9pfs/xen-9p-backend.c                     | 443 ++++++++++++++++++++++++
hw/block/xen_blkif.h                         |   2 +-
hw/block/xen_disk.c                          |   2 +-
hw/i386/xen/Makefile.objs                    |   2 +-
hw/i386/xen/trace-events                     |  17 +
xen-hvm.c => hw/i386/xen/xen-hvm.c           |  59 ++--
xen-mapcache.c => hw/i386/xen/xen-mapcache.c |   2 +-
hw/i386/xen/xen_platform.c                   |   2 +-
hw/usb/xen-usb.c                             |   2 +-
hw/xen/Makefile.objs                         |   2 +-
hw/xen/trace-events                          |   1 +
xen-common.c => hw/xen/xen-common.c          |  11 +
hw/xen/xen_backend.c                         |   5 +-
include/exec/ram_addr.h                      |   4 +-
include/hw/xen/io/ring.h                     | 482 +++++++++++++++++++++++++++
include/hw/xen/xen.h                         |   3 +-
include/hw/xen/xen_backend.h                 |   5 +-
include/hw/xen/xen_common.h                  | 345 +++++++++++++++----
qemu-options.hx                              |   7 +
stubs/Makefile.objs                          |   2 +
xen-common-stub.c => stubs/xen-common.c      |   0
xen-hvm-stub.c => stubs/xen-hvm.c            |   2 +-
trace-events                                 |  16 -
vl.c                                         |   8 +
32 files changed, 1417 insertions(+), 193 deletions(-)
create mode 100644 hw/9pfs/xen-9p-backend.c
rename xen-hvm.c => hw/i386/xen/xen-hvm.c (96%)
rename xen-mapcache.c => hw/i386/xen/xen-mapcache.c (99%)
rename xen-common.c => hw/xen/xen-common.c (91%)
create mode 100644 include/hw/xen/io/ring.h
rename xen-common-stub.c => stubs/xen-common.c (100%)
rename xen-hvm-stub.c => stubs/xen-hvm.c (94%)
[Qemu-devel] [PULL 0/21] Please pull xen-20170421-tag for 2.10
Posted by Stefano Stabellini 6 years, 11 months ago
The following changes since commit 55a19ad8b2d0797e3a8fe90ab99a9bb713824059:

  Update version for v2.9.0-rc1 release (2017-03-21 17:13:29 +0000)

are available in the git repository at:

  git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-20170421-tag

for you to fetch changes up to b0d48550a2d10f0fa8c30a7cc3ff5a1cbda8d4c4:

  move xen-mapcache.c to hw/i386/xen/ (2017-04-21 12:41:29 -0700)

----------------------------------------------------------------
Xen 2017/04/21

----------------------------------------------------------------
Anthony Xu (3):
      move xen-common.c to hw/xen/
      move xen-hvm.c to hw/i386/xen/
      move xen-mapcache.c to hw/i386/xen/

Juergen Gross (2):
      xen: use 5 digit xen versions
      configure: use pkg-config for obtaining xen version

Paul Durrant (7):
      xen: make use of xen_xc implicit in xen_common.h inlines
      xen: rename xen_modified_memory() to xen_hvm_modified_memory()
      xen: create wrappers for all other uses of xc_hvm_XXX() functions
      configure: detect presence of libxendevicemodel
      xen: use libxendevicemodel when available
      xen: use libxendevice model to restrict operations
      xen: additionally restrict xenforeignmemory operations

Stefano Stabellini (9):
      xen: import ring.h from xen
      9p: introduce a type for the 9p header
      xen/9pfs: introduce Xen 9pfs backend
      xen/9pfs: connect to the frontend
      xen/9pfs: receive requests from the frontend
      xen/9pfs: implement in/out_iov_from_pdu and vmarshal/vunmarshal
      xen/9pfs: send responses back to the frontend
      xen/9pfs: build and register Xen 9pfs backend
      add xen-9p-backend to MAINTAINERS under Xen

 MAINTAINERS                                  |   1 +
 Makefile.target                              |   6 -
 configure                                    | 164 +++++----
 default-configs/i386-softmmu.mak             |   1 -
 default-configs/x86_64-softmmu.mak           |   1 -
 hw/9pfs/9p.h                                 |   6 +
 hw/9pfs/Makefile.objs                        |   1 +
 hw/9pfs/virtio-9p-device.c                   |   6 +-
 hw/9pfs/xen-9p-backend.c                     | 443 ++++++++++++++++++++++++
 hw/block/xen_blkif.h                         |   2 +-
 hw/block/xen_disk.c                          |   2 +-
 hw/i386/xen/Makefile.objs                    |   2 +-
 hw/i386/xen/trace-events                     |  17 +
 xen-hvm.c => hw/i386/xen/xen-hvm.c           |  59 ++--
 xen-mapcache.c => hw/i386/xen/xen-mapcache.c |   2 +-
 hw/i386/xen/xen_platform.c                   |   2 +-
 hw/usb/xen-usb.c                             |   2 +-
 hw/xen/Makefile.objs                         |   2 +-
 hw/xen/trace-events                          |   1 +
 xen-common.c => hw/xen/xen-common.c          |  11 +
 hw/xen/xen_backend.c                         |   5 +-
 include/exec/ram_addr.h                      |   4 +-
 include/hw/xen/io/ring.h                     | 482 +++++++++++++++++++++++++++
 include/hw/xen/xen.h                         |   3 +-
 include/hw/xen/xen_backend.h                 |   5 +-
 include/hw/xen/xen_common.h                  | 345 +++++++++++++++----
 qemu-options.hx                              |   7 +
 stubs/Makefile.objs                          |   2 +
 xen-common-stub.c => stubs/xen-common.c      |   0
 xen-hvm-stub.c => stubs/xen-hvm.c            |   2 +-
 trace-events                                 |  16 -
 vl.c                                         |   8 +
 32 files changed, 1417 insertions(+), 193 deletions(-)
 create mode 100644 hw/9pfs/xen-9p-backend.c
 rename xen-hvm.c => hw/i386/xen/xen-hvm.c (96%)
 rename xen-mapcache.c => hw/i386/xen/xen-mapcache.c (99%)
 rename xen-common.c => hw/xen/xen-common.c (91%)
 create mode 100644 include/hw/xen/io/ring.h
 rename xen-common-stub.c => stubs/xen-common.c (100%)
 rename xen-hvm-stub.c => stubs/xen-hvm.c (94%)

Re: [Qemu-devel] [PULL 0/21] Please pull xen-20170421-tag for 2.10
Posted by Peter Maydell 6 years, 11 months ago
On 21 April 2017 at 21:14, Stefano Stabellini <sstabellini@kernel.org> wrote:
> The following changes since commit 55a19ad8b2d0797e3a8fe90ab99a9bb713824059:
>
>   Update version for v2.9.0-rc1 release (2017-03-21 17:13:29 +0000)
>
> are available in the git repository at:
>
>   git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-20170421-tag
>
> for you to fetch changes up to b0d48550a2d10f0fa8c30a7cc3ff5a1cbda8d4c4:
>
>   move xen-mapcache.c to hw/i386/xen/ (2017-04-21 12:41:29 -0700)
>
> ----------------------------------------------------------------
> Xen 2017/04/21
>
> ----------------------------------------------------------------

Hi; I'm afraid this doesn't build with clang:


  CC      hw/9pfs/xen-9p-backend.o
/home/petmay01/linaro/qemu-for-merges/hw/9pfs/xen-9p-backend.c:21:1:
error: unused fun
ction 'xen_9pfs_get_ring_ptr' [-Werror,-Wunused-function]
DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);
^
/home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:469:79:
note: expanded
from macro 'DEFINE_XEN_FLEX_RING_AND_INTF'
};                                                                            \
                                                                              ^
/home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:387:30:
note: expanded from macro '\
DEFINE_XEN_FLEX_RING'
static inline unsigned char *name##_get_ring_ptr(unsigned char *buf,          \
                             ^
<scratch space>:151:1: note: expanded from here
xen_9pfs_get_ring_ptr
^
/home/petmay01/linaro/qemu-for-merges/hw/9pfs/xen-9p-backend.c:21:1:
error: unused function 'xen_9pfs_write_packet'
[-Werror,-Wunused-function]
/home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:469:79:
note: expanded from macro 'DEFINE_XEN_FLEX_RING_AND_INTF'
};                                                                            \
                                                                              ^
/home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:412:20:
note: expanded from macro '\
DEFINE_XEN_FLEX_RING'
static inline void name##_write_packet(unsigned char *buf,                    \
                   ^
<scratch space>:155:1: note: expanded from here
xen_9pfs_write_packet
^
2 errors generated.
/home/petmay01/linaro/qemu-for-merges/rules.mak:69: recipe for target
'hw/9pfs/xen-9p-backend.o' failed


Clang requires that functions, even inline functions, defined in .c files
must be used.

thanks
-- PMM

Re: [Qemu-devel] [PULL 0/21] Please pull xen-20170421-tag for 2.10
Posted by Stefano Stabellini 6 years, 11 months ago
On Mon, 24 Apr 2017, Peter Maydell wrote:
> On 21 April 2017 at 21:14, Stefano Stabellini <sstabellini@kernel.org> wrote:
> > The following changes since commit 55a19ad8b2d0797e3a8fe90ab99a9bb713824059:
> >
> >   Update version for v2.9.0-rc1 release (2017-03-21 17:13:29 +0000)
> >
> > are available in the git repository at:
> >
> >   git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-20170421-tag
> >
> > for you to fetch changes up to b0d48550a2d10f0fa8c30a7cc3ff5a1cbda8d4c4:
> >
> >   move xen-mapcache.c to hw/i386/xen/ (2017-04-21 12:41:29 -0700)
> >
> > ----------------------------------------------------------------
> > Xen 2017/04/21
> >
> > ----------------------------------------------------------------
> 
> Hi; I'm afraid this doesn't build with clang:
> 
> 
>   CC      hw/9pfs/xen-9p-backend.o
> /home/petmay01/linaro/qemu-for-merges/hw/9pfs/xen-9p-backend.c:21:1:
> error: unused fun
> ction 'xen_9pfs_get_ring_ptr' [-Werror,-Wunused-function]
> DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);
> ^
> /home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:469:79:
> note: expanded
> from macro 'DEFINE_XEN_FLEX_RING_AND_INTF'
> };                                                                            \
>                                                                               ^
> /home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:387:30:
> note: expanded from macro '\
> DEFINE_XEN_FLEX_RING'
> static inline unsigned char *name##_get_ring_ptr(unsigned char *buf,          \
>                              ^
> <scratch space>:151:1: note: expanded from here
> xen_9pfs_get_ring_ptr
> ^
> /home/petmay01/linaro/qemu-for-merges/hw/9pfs/xen-9p-backend.c:21:1:
> error: unused function 'xen_9pfs_write_packet'
> [-Werror,-Wunused-function]
> /home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:469:79:
> note: expanded from macro 'DEFINE_XEN_FLEX_RING_AND_INTF'
> };                                                                            \
>                                                                               ^
> /home/petmay01/linaro/qemu-for-merges/include/hw/xen/io/ring.h:412:20:
> note: expanded from macro '\
> DEFINE_XEN_FLEX_RING'
> static inline void name##_write_packet(unsigned char *buf,                    \
>                    ^
> <scratch space>:155:1: note: expanded from here
> xen_9pfs_write_packet
> ^
> 2 errors generated.
> /home/petmay01/linaro/qemu-for-merges/rules.mak:69: recipe for target
> 'hw/9pfs/xen-9p-backend.o' failed
> 
> 
> Clang requires that functions, even inline functions, defined in .c files
> must be used.

Thank you for finding this issue. Given that ring.h is synced from Xen,
I think it makes sense to leave as is. I'll fix it as follow:

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 7e962aa..9c7f41a 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -13,12 +13,9 @@
 #include "hw/hw.h"
 #include "hw/9pfs/9p.h"
 #include "hw/xen/xen_backend.h"
-#include "hw/xen/io/ring.h"
+#include "hw/9pfs/xen-9pfs.h"
 #include "qemu/config-file.h"
 #include "fsdev/qemu-fsdev.h"
-#include <xen/io/protocols.h>
-
-DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);
 
 #define VERSIONS "1"
 #define MAX_RINGS 8
diff --git a/hw/9pfs/xen-9pfs.h b/hw/9pfs/xen-9pfs.h
new file mode 100644
index 0000000..18f0ec0
--- /dev/null
+++ b/hw/9pfs/xen-9pfs.h
@@ -0,0 +1,14 @@
+/*
+ * Xen 9p backend
+ *
+ * Copyright Aporeto 2017
+ *
+ * Authors:
+ *  Stefano Stabellini <stefano@aporeto.com>
+ *
+ */
+
+#include <xen/io/protocols.h>
+#include "hw/xen/io/ring.h"
+
+DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);

Re: [Qemu-devel] [PULL 0/21] Please pull xen-20170421-tag for 2.10
Posted by Peter Maydell 6 years, 11 months ago
On 24 April 2017 at 22:25, Stefano Stabellini <sstabellini@kernel.org> wrote:
> diff --git a/hw/9pfs/xen-9pfs.h b/hw/9pfs/xen-9pfs.h
> new file mode 100644
> index 0000000..18f0ec0
> --- /dev/null
> +++ b/hw/9pfs/xen-9pfs.h
> @@ -0,0 +1,14 @@
> +/*
> + * Xen 9p backend
> + *
> + * Copyright Aporeto 2017
> + *
> + * Authors:
> + *  Stefano Stabellini <stefano@aporeto.com>
> + *
> + */

Trivial file, but I prefer it if we have a brief license
statement in every file, just to be clear (it might
accumulate more code later).

> +
> +#include <xen/io/protocols.h>
> +#include "hw/xen/io/ring.h"
> +
> +DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);

Is it worth a comment to dissuade people from thinking they can
inline the file back into xen-9p-backend.c ?

thanks
-- PMM

Re: [Qemu-devel] [PULL 0/21] Please pull xen-20170421-tag for 2.10
Posted by Stefano Stabellini 6 years, 11 months ago
On Mon, 24 Apr 2017, Peter Maydell wrote:
> On 24 April 2017 at 22:25, Stefano Stabellini <sstabellini@kernel.org> wrote:
> > diff --git a/hw/9pfs/xen-9pfs.h b/hw/9pfs/xen-9pfs.h
> > new file mode 100644
> > index 0000000..18f0ec0
> > --- /dev/null
> > +++ b/hw/9pfs/xen-9pfs.h
> > @@ -0,0 +1,14 @@
> > +/*
> > + * Xen 9p backend
> > + *
> > + * Copyright Aporeto 2017
> > + *
> > + * Authors:
> > + *  Stefano Stabellini <stefano@aporeto.com>
> > + *
> > + */
> 
> Trivial file, but I prefer it if we have a brief license
> statement in every file, just to be clear (it might
> accumulate more code later).

Sure

> > +
> > +#include <xen/io/protocols.h>
> > +#include "hw/xen/io/ring.h"
> > +
> > +DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);
> 
> Is it worth a comment to dissuade people from thinking they can
> inline the file back into xen-9p-backend.c ?

Thanks for the quick review! Here you go:


diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 7e962aa..9c7f41a 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -13,12 +13,9 @@
 #include "hw/hw.h"
 #include "hw/9pfs/9p.h"
 #include "hw/xen/xen_backend.h"
-#include "hw/xen/io/ring.h"
+#include "hw/9pfs/xen-9pfs.h"
 #include "qemu/config-file.h"
 #include "fsdev/qemu-fsdev.h"
-#include <xen/io/protocols.h>
-
-DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);
 
 #define VERSIONS "1"
 #define MAX_RINGS 8
diff --git a/hw/9pfs/xen-9pfs.h b/hw/9pfs/xen-9pfs.h
new file mode 100644
index 0000000..6e33d77
--- /dev/null
+++ b/hw/9pfs/xen-9pfs.h
@@ -0,0 +1,21 @@
+/*
+ * Xen 9p backend
+ *
+ * Copyright Aporeto 2017
+ *
+ * Authors:
+ *  Stefano Stabellini <stefano@aporeto.com>
+ *
+ * This work is licensed under the terms of the GNU GPL version 2.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include <xen/io/protocols.h>
+#include "hw/xen/io/ring.h"
+
+/*
+ * Do not merge into xen-9p-backend.c: clang doesn't allow unused static
+ * inline functions in c files.
+ */
+DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);

Re: [Qemu-devel] [PULL 0/21] Please pull xen-20170421-tag for 2.10
Posted by Greg Kurz 6 years, 11 months ago
On Mon, 24 Apr 2017 16:44:53 -0700 (PDT)
Stefano Stabellini <sstabellini@kernel.org> wrote:

> On Mon, 24 Apr 2017, Peter Maydell wrote:
> > On 24 April 2017 at 22:25, Stefano Stabellini <sstabellini@kernel.org> wrote:  
> > > diff --git a/hw/9pfs/xen-9pfs.h b/hw/9pfs/xen-9pfs.h
> > > new file mode 100644
> > > index 0000000..18f0ec0
> > > --- /dev/null
> > > +++ b/hw/9pfs/xen-9pfs.h
> > > @@ -0,0 +1,14 @@
> > > +/*
> > > + * Xen 9p backend
> > > + *
> > > + * Copyright Aporeto 2017
> > > + *
> > > + * Authors:
> > > + *  Stefano Stabellini <stefano@aporeto.com>
> > > + *
> > > + */  
> > 
> > Trivial file, but I prefer it if we have a brief license
> > statement in every file, just to be clear (it might
> > accumulate more code later).  
> 
> Sure
> 
> > > +
> > > +#include <xen/io/protocols.h>
> > > +#include "hw/xen/io/ring.h"
> > > +
> > > +DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);  
> > 
> > Is it worth a comment to dissuade people from thinking they can
> > inline the file back into xen-9p-backend.c ?  
> 
> Thanks for the quick review! Here you go:
> 
> 
> diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
> index 7e962aa..9c7f41a 100644
> --- a/hw/9pfs/xen-9p-backend.c
> +++ b/hw/9pfs/xen-9p-backend.c
> @@ -13,12 +13,9 @@
>  #include "hw/hw.h"
>  #include "hw/9pfs/9p.h"
>  #include "hw/xen/xen_backend.h"
> -#include "hw/xen/io/ring.h"
> +#include "hw/9pfs/xen-9pfs.h"
>  #include "qemu/config-file.h"
>  #include "fsdev/qemu-fsdev.h"
> -#include <xen/io/protocols.h>
> -
> -DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);
>  
>  #define VERSIONS "1"
>  #define MAX_RINGS 8
> diff --git a/hw/9pfs/xen-9pfs.h b/hw/9pfs/xen-9pfs.h
> new file mode 100644
> index 0000000..6e33d77
> --- /dev/null
> +++ b/hw/9pfs/xen-9pfs.h
> @@ -0,0 +1,21 @@
> +/*
> + * Xen 9p backend
> + *
> + * Copyright Aporeto 2017
> + *
> + * Authors:
> + *  Stefano Stabellini <stefano@aporeto.com>
> + *
> + * This work is licensed under the terms of the GNU GPL version 2.

"version 2 or later" maybe ?

> + * See the COPYING file in the top-level directory.
> + *
> + */
> +
> +#include <xen/io/protocols.h>
> +#include "hw/xen/io/ring.h"
> +
> +/*
> + * Do not merge into xen-9p-backend.c: clang doesn't allow unused static
> + * inline functions in c files.
> + */
> +DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs);