qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 5feeb7: xen-block: support feature-large-sect


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 5feeb7: xen-block: support feature-large-sector-size
Date: Mon, 01 Jul 2019 05:44:58 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 5feeb718d7914c3c921cc811a5844488a5644ea6
      
https://github.com/qemu/qemu/commit/5feeb718d7914c3c921cc811a5844488a5644ea6
  Author: Paul Durrant <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M hw/block/dataplane/xen-block.c
    M hw/block/dataplane/xen-block.h
    M hw/block/xen-block.c

  Log Message:
  -----------
  xen-block: support feature-large-sector-size

A recent Xen commit [1] clarified the semantics of sector based quantities
used in the blkif protocol such that it is now safe to create a xen-block
device with a logical_block_size != 512, as long as the device only
connects to a frontend advertizing 'feature-large-block-size'.

This patch modifies xen-block accordingly. It also uses a stack variable
for the BlockBackend in xen_block_realize() to avoid repeated dereferencing
of the BlockConf pointer, and changes the parameters of
xen_block_dataplane_create() so that the BlockBackend pointer and sector
size are passed expicitly rather than implicitly via the BlockConf.

These modifications have been tested against a recent Windows PV XENVBD
driver [2] using a xen-disk device with a 4kB logical block size.

[1] 
http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=67e1c050e36b2c9900cca83618e56189effbad98
[2] https://winpvdrvbuild.xenproject.org:8080/job/XENVBD-master/126

Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>
[Edited error message]
Signed-off-by: Anthony PERARD <address@hidden>


  Commit: c0b336ea19a93801ee2333be525d0473d28a10f8
      
https://github.com/qemu/qemu/commit/c0b336ea19a93801ee2333be525d0473d28a10f8
  Author: Paul Durrant <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M hw/xen/xen-bus.c
    M include/hw/xen/xen-bus.h

  Log Message:
  -----------
  xen-bus: use a separate fd for each event channel

To better support use of IOThread-s it will be necessary to be able to set
the AioContext for each XenEventChannel and hence it is necessary to open a
separate handle to libxenevtchan for each channel.

This patch stops using NotifierList for event channel callbacks, replacing
that construct by a list of complete XenEventChannel structures. Each of
these now has a xenevtchn_handle pointer in place of the single pointer
previously held in the XenDevice structure. The individual handles are
opened/closed in xen_device_bind/unbind_event_channel(), replacing the
single open/close in xen_device_realize/unrealize().

NOTE: This patch does not add an AioContext parameter to
      xen_device_bind_event_channel(). That will be done in a subsequent
      patch.

Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Anthony PERARD <address@hidden>


  Commit: 83361a8a1f932cfac8ae4a5b86e935ad6ab1c528
      
https://github.com/qemu/qemu/commit/83361a8a1f932cfac8ae4a5b86e935ad6ab1c528
  Author: Paul Durrant <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M hw/block/dataplane/xen-block.c
    M hw/xen/xen-bus.c
    M include/hw/xen/xen-bus.h

  Log Message:
  -----------
  xen-bus: allow AioContext to be specified for each event channel

This patch adds an AioContext parameter to xen_device_bind_event_channel()
and then uses aio_set_fd_handler() to set the callback rather than
qemu_set_fd_handler().

Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>
[Call aio_set_fd_handler() with is_external=true]
Signed-off-by: Anthony PERARD <address@hidden>


  Commit: 345f42b4be9f9975ff3f7f3e95acae4f67c74f89
      
https://github.com/qemu/qemu/commit/345f42b4be9f9975ff3f7f3e95acae4f67c74f89
  Author: Paul Durrant <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M hw/block/dataplane/xen-block.c
    M hw/xen/xen-bus.c
    M include/hw/xen/xen-bus.h

  Log Message:
  -----------
  xen-bus / xen-block: add support for event channel polling

This patch introduces a poll callback for event channel fd-s and uses
this to invoke the channel callback function.

To properly support polling, it is necessary for the event channel callback
function to return a boolean saying whether it has done any useful work or
not. Thus xen_block_dataplane_event() is modified to directly invoke
xen_block_handle_requests() and the latter only returns true if it actually
processes any requests. This also means that the call to qemu_bh_schedule()
is moved into xen_block_complete_aio(), which is more intuitive since the
only reason for doing a deferred poll of the shared ring should be because
there were previously insufficient resources to fully complete a previous
poll.

Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Anthony PERARD <address@hidden>


  Commit: 34fbbc164fded65341f9fc299b118c90925d5b1f
      
https://github.com/qemu/qemu/commit/34fbbc164fded65341f9fc299b118c90925d5b1f
  Author: Anthony PERARD <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M hw/i386/xen/xen-hvm.c

  Log Message:
  -----------
  xen: Avoid VLA

Avoid using a variable length array.

We allocate the `dirty_bitmap' buffer only once when we start tracking
for dirty bits.

Signed-off-by: Anthony PERARD <address@hidden>
Reviewed-by: Paul Durrant <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>


  Commit: 6e8d4593536a59832dbbecce540498f69b75b644
      
https://github.com/qemu/qemu/commit/6e8d4593536a59832dbbecce540498f69b75b644
  Author: Anthony PERARD <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M hw/i386/xen/xen-hvm.c
    M hw/i386/xen/xen-mapcache.c

  Log Message:
  -----------
  xen: Drop includes of xen/hvm/params.h

xen-mapcache.c doesn't needs params.h.

xen-hvm.c uses defines available in params.h but so is xen_common.h
which is included before. HVM_PARAM_* flags are only needed to make
xc_hvm_param_{get,set} calls so including only xenctrl.h, which is
where the definition the function is, should be enough.
(xenctrl.h does include params.h)

Signed-off-by: Anthony PERARD <address@hidden>
Reviewed-by: Paul Durrant <address@hidden>
Message-Id: <address@hidden>


  Commit: d1744bd3218daa820744c14572058491e4854399
      
https://github.com/qemu/qemu/commit/d1744bd3218daa820744c14572058491e4854399
  Author: Anthony PERARD <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M include/hw/xen/io/ring.h

  Log Message:
  -----------
  Revert xen/io/ring.h of "Clean up a few header guard symbols"

This reverts changes to include/hw/xen/io/ring.h from commit
37677d7db39a3c250ad661d00fb7c3b59d047b1f.

Following 37677d7db3 "Clean up a few header guard symbols", QEMU start
to fail to build:

In file included from ~/xen/tools/../tools/include/xen/io/blkif.h:31:0,
                 from ~/xen/tools/qemu-xen-dir/hw/block/xen_blkif.h:5,
                 from ~/xen/tools/qemu-xen-dir/hw/block/xen-block.c:22:
~/xen/tools/../tools/include/xen/io/ring.h:68:0: error: "__CONST_RING_SIZE" 
redefined [-Werror]
 #define __CONST_RING_SIZE(_s, _sz) \

In file included from ~/xen/tools/qemu-xen-dir/hw/block/xen_blkif.h:4:0,
                 from ~/xen/tools/qemu-xen-dir/hw/block/xen-block.c:22:
~/xen/tools/qemu-xen-dir/include/hw/xen/io/ring.h:66:0: note: this is the 
location of the previous definition
 #define __CONST_RING_SIZE(_s, _sz) \

The issue is that some public xen headers have been imported (by
f65eadb639 "xen: import ring.h from xen") but not all. With the change
in the guards symbole, the ring.h header start to be imported twice.

Signed-off-by: Anthony PERARD <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Reviewed-by: Paul Durrant <address@hidden>
Message-Id: <address@hidden>


  Commit: a3434a2d56aee3018f4a0f55c7e0f0cda11f3d9e
      
https://github.com/qemu/qemu/commit/a3434a2d56aee3018f4a0f55c7e0f0cda11f3d9e
  Author: Anthony PERARD <address@hidden>
  Date:   2019-06-24 (Mon, 24 Jun 2019)

  Changed paths:
    M hw/9pfs/xen-9pfs.h
    M hw/block/xen_blkif.h
    M hw/char/xen_console.c
    M hw/display/xenfb.c
    M hw/net/xen_nic.c
    M hw/usb/xen-usb.c
    M hw/xen/xen-legacy-backend.c
    A include/hw/xen/interface/grant_table.h
    A include/hw/xen/interface/io/blkif.h
    A include/hw/xen/interface/io/console.h
    A include/hw/xen/interface/io/fbif.h
    A include/hw/xen/interface/io/kbdif.h
    A include/hw/xen/interface/io/netif.h
    A include/hw/xen/interface/io/protocols.h
    A include/hw/xen/interface/io/ring.h
    A include/hw/xen/interface/io/usbif.h
    A include/hw/xen/interface/io/xenbus.h
    R include/hw/xen/io/ring.h
    M include/hw/xen/xen_common.h

  Log Message:
  -----------
  xen: Import other xen/io/*.h

A Xen public header have been imported into QEMU (by
f65eadb639 "xen: import ring.h from xen"), but there are other header
that depends on ring.h which come from the system when building QEMU.

This patch resolves the issue of having headers from the system
importing a different copie of ring.h.

This patch is prompt by the build issue described in the previous
patch: 'Revert xen/io/ring.h of "Clean up a few header guard symbols"'

ring.h and the new imported headers are moved to
"include/hw/xen/interface" as those describe interfaces with a guest.

The imported headers are cleaned up a bit while importing them: some
part of the file that QEMU doesn't use are removed (description
of how to make hypercall in grant_table.h have been removed).

Other cleanup:
- xen-mapcache.c and xen-legacy-backend.c don't need grant_table.h.
- xenfb.c doesn't need event_channel.h.

Signed-off-by: Anthony PERARD <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Reviewed-by: Paul Durrant <address@hidden>
Message-Id: <address@hidden>


  Commit: ab67678a59e31d30b0f8587cdc245f93c2e56fef
      
https://github.com/qemu/qemu/commit/ab67678a59e31d30b0f8587cdc245f93c2e56fef
  Author: Peter Maydell <address@hidden>
  Date:   2019-07-01 (Mon, 01 Jul 2019)

  Changed paths:
    M hw/9pfs/xen-9pfs.h
    M hw/block/dataplane/xen-block.c
    M hw/block/dataplane/xen-block.h
    M hw/block/xen-block.c
    M hw/block/xen_blkif.h
    M hw/char/xen_console.c
    M hw/display/xenfb.c
    M hw/i386/xen/xen-hvm.c
    M hw/i386/xen/xen-mapcache.c
    M hw/net/xen_nic.c
    M hw/usb/xen-usb.c
    M hw/xen/xen-bus.c
    M hw/xen/xen-legacy-backend.c
    A include/hw/xen/interface/grant_table.h
    A include/hw/xen/interface/io/blkif.h
    A include/hw/xen/interface/io/console.h
    A include/hw/xen/interface/io/fbif.h
    A include/hw/xen/interface/io/kbdif.h
    A include/hw/xen/interface/io/netif.h
    A include/hw/xen/interface/io/protocols.h
    A include/hw/xen/interface/io/ring.h
    A include/hw/xen/interface/io/usbif.h
    A include/hw/xen/interface/io/xenbus.h
    R include/hw/xen/io/ring.h
    M include/hw/xen/xen-bus.h
    M include/hw/xen/xen_common.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190624' into 
staging

Xen queue

* Fix build
* xen-block: support feature-large-sector-size
* xen-block: Support IOThread polling for PV shared rings
* Avoid usage of a VLA
* Cleanup Xen headers usage

# gpg: Signature made Mon 24 Jun 2019 16:30:32 BST
# gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg:                issuer "address@hidden"
# gpg: Good signature from "Anthony PERARD <address@hidden>" [marginal]
# gpg:                 aka "Anthony PERARD <address@hidden>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
#      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF

* remotes/aperard/tags/pull-xen-20190624:
  xen: Import other xen/io/*.h
  Revert xen/io/ring.h of "Clean up a few header guard symbols"
  xen: Drop includes of xen/hvm/params.h
  xen: Avoid VLA
  xen-bus / xen-block: add support for event channel polling
  xen-bus: allow AioContext to be specified for each event channel
  xen-bus: use a separate fd for each event channel
  xen-block: support feature-large-sector-size

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/7fec76a02267...ab67678a59e3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]