virtio: pull headers from linux
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest17 patches 18 repliesIn review
- v217 patches 18 repliesSuperseded
- v1 RFC1 patch 10 repliesSuperseded
Changes in v3 from the cover letter
- rename sys/ to linux/ to address comments by Peter and Paolo
- address comments by Thomas
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | scripts/update-linux-headers.sh: pull virtio hdrsscripts/ | +41 | 0 replies | |
| 2/17 | include: import virtio headers from linux 4.0include/ include/ include/ +11 more | +1249 | 2 replies | |
| 3/17 | virtio: use standard virtio_ring.hhw/ include/ include/ | +2 | 2 replies | |
| 4/17 | virtio: use standard-headershw/ hw/ include/ | +8 | 1 reply | |
| 5/17 | virtio-balloon: use standard headersinclude/ | +2 | 1 reply | |
| 6/17 | virtio-9p: use standard headershw/ | +1 | 1 reply | |
| 7/17 | virtio-blk: switch to standard-headershw/ include/ | +5 | 1 reply | |
| 8/17 | virtio-net, tap: use standard-headersinclude/ include/ | +2 | 1 reply | |
| 9/17 | virtio-rng: use standard-headersinclude/ | +1 | 1 reply | |
| 10/17 | virtio-scsi: use standard-headershw/ include/ | +10 | 4 replies | |
| 11/17 | virtio-serial: switch to standard-headershw/ include/ | +2 | 4 replies | |
| 12/17 | update-linux-headers: use standard-headersscripts/ | +7 | 0 replies | |
| 13/17 | linux-headers: use standard-headerslinux-headers/ linux-headers/ | +2 | 0 replies | |
| 14/17 | virtio-pci: use standard headershw/ | +5 | 0 replies | |
| 15/17 | scripts: add arch specific standard-headersscripts/ | +2 | 0 replies | |
| 16/17 | standard-headers: add s390 virtio headersinclude/ include/ | +85 | 0 replies | |
| 17/17 | s390: use standard headershw/ hw/ | +21 | 0 replies |
Reviews trailers per patch
8 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Thomas Huth | Cornelia Huck | Paolo Bonzini |
|---|---|---|---|
| 1/17 | R-b | ||
| 2/17 | |||
| 3/17 | |||
| 4/17 | R-b | ||
| 5/17 | R-b | ||
| 6/17 | R-b | ||
| 7/17 | R-b | ||
| 8/17 | R-b | ||
| 9/17 | R-b | ||
| 10/17 | A-b | ||
| 11/17 | |||
| 12/17 | |||
| 13/17 | |||
| 14/17 | |||
| 15/17 | |||
| 16/17 | |||
| 17/17 | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [Qemu-devel] [PATCH v3 00/17] virtio: pull headers from linux
This reuses virtio headers from files exported by linux. The current situation is quite messy: for example we have multiple copies of the virtio net packet structure, and the virtio ring structure.
We already use some of them for linux-specific code, reusing more widely gets rid of code duplication.
One of the reasons we didn't do this previously was portability considerations: this patchset addresses this by fixing up headers in question - turns out to be easy to do since they are already quite portable.
One of comments asked about support for functionality missing from linux guests. This patchet addresses this simply by adding code in include/hw/virtio like we did before.
One example of this is VIRTIO_NET_CTRL_GUEST_OFFLOADS command in virtio-net, which is currently only used by windows guests.
The definition was therefore left in include/hw/virtio/virtio-net.h, this approach makes it easy to find functionality that linux guests are missing, which is important e.g. for testing.
Ability to synchronize headers in this way will bring long-term benefits in case bugfixes need to apply to both host and guest.
In particular, this gives us known-good virtio 1.0 headers for free, right now.
This refactoring also better separates between guest ABI and internal qemu functionality, which is a good thing as we need to be extra careful about guest ABI changes.
This might also enable better static checking with sparse, as linux tags virtio headers with correct endian-ness. For now, sparse tags are automatically stripped, for compatibility with existing code.
Some pieces are more widely applicable (outside virtio): e.g. everyone will be able to pull ETH_ALEN from the standard header.
The infrastructure also might be of use for other headers (pci_regs.h)?
s390 patches have been built and smoke-tested by Cornelia.
Tested on linux on x86 and s390 only, with windows and linux guests. Needs windows, osx host testing.
Testing (even just build-test) reports would be very much appreciated.
changes from v2:
- rename sys/ to linux/ to address comments by Peter and Paolo
- address comments by Thomas
Changes from v1:
- add s390 headers (untested)
- add code to check no unexpected linux-specific headers are pulled in by mistake
- add if_ether.h to provide ETH_ALEN for virtio net
- move headers from standard-headers/linux to standard-headers/sys and put them under include so they are on search path
- fix up __leXX
- fix up __attribute__((packed))
Michael S. Tsirkin (17):
scripts/update-linux-headers.sh: pull virtio hdrs
include: import virtio headers from linux 4.0
virtio: use standard virtio_ring.h
virtio: use standard-headers
virtio-balloon: use standard headers
virtio-9p: use standard headers
virtio-blk: switch to standard-headers virtio-net,tap: use standard-headers
virtio-rng: use standard-headers
virtio-scsi: use standard-headers
virtio-serial: switch to standard-headers
update-linux-headers: use standard-headers
linux-headers: use standard-headers
virtio-pci: use standard headers
scripts: add arch specific standard-headers
standard-headers: add s390 virtio headers
s390: use standard headers
hw/9pfs/virtio-9p.h | 18 +-
hw/s390x/s390-virtio-bus.h | 36 ++--
hw/s390x/s390-virtio.h | 7 +-
include/hw/virtio/dataplane/vring.h | 2 +-
include/hw/virtio/virtio-balloon.h | 35 +---
include/hw/virtio/virtio-blk.h | 77 +------
include/hw/virtio/virtio-net.h | 151 +------------
include/hw/virtio/virtio-rng.h | 4 +-
include/hw/virtio/virtio-scsi.h | 120 +----------
include/hw/virtio/virtio-serial.h | 40 +---
include/hw/virtio/virtio.h | 48 +----
include/net/tap.h | 24 +--
include/standard-headers/asm-s390/kvm_virtio.h | 64 ++++++
include/standard-headers/asm-s390/virtio-ccw.h | 21 ++
include/standard-headers/linux/if_ether.h | 1 +
include/standard-headers/linux/types.h | 2 +
include/standard-headers/linux/virtio_9p.h | 44 ++++
include/standard-headers/linux/virtio_balloon.h | 59 ++++++
include/standard-headers/linux/virtio_blk.h | 143 +++++++++++++
include/standard-headers/linux/virtio_config.h | 64 ++++++
include/standard-headers/linux/virtio_console.h | 78 +++++++
include/standard-headers/linux/virtio_ids.h | 43 ++++
include/standard-headers/linux/virtio_net.h | 233 +++++++++++++++++++++
include/standard-headers/linux/virtio_pci.h | 193 +++++++++++++++++
.../linux}/virtio_ring.h | 138 ++++++------
include/standard-headers/linux/virtio_rng.h | 8 +
include/standard-headers/linux/virtio_scsi.h | 164 +++++++++++++++
include/standard-headers/linux/virtio_types.h | 46 ++++
linux-headers/linux/virtio_config.h | 58 +----
linux-headers/linux/virtio_ring.h | 164 +--------------
hw/block/virtio-blk.c | 8 +-
hw/char/virtio-serial-bus.c | 1 +
hw/net/vhost_net.c | 2 +-
hw/scsi/virtio-scsi.c | 1 +
hw/virtio/virtio-pci.c | 54 +----
hw/virtio/virtio.c | 23 +-
scripts/update-linux-headers.sh | 51 ++++-
37 files changed, 1345 insertions(+), 880 deletions(-)
create mode 100644 include/standard-headers/asm-s390/kvm_virtio.h
create mode 100644 include/standard-headers/asm-s390/virtio-ccw.h
create mode 100644 include/standard-headers/linux/if_ether.h
create mode 100644 include/standard-headers/linux/types.h
create mode 100644 include/standard-headers/linux/virtio_9p.h
create mode 100644 include/standard-headers/linux/virtio_balloon.h
create mode 100644 include/standard-headers/linux/virtio_blk.h
create mode 100644 include/standard-headers/linux/virtio_config.h
create mode 100644 include/standard-headers/linux/virtio_console.h
create mode 100644 include/standard-headers/linux/virtio_ids.h
create mode 100644 include/standard-headers/linux/virtio_net.h
create mode 100644 include/standard-headers/linux/virtio_pci.h
rename include/{hw/virtio => standard-headers/linux}/virtio_ring.h (57%)
create mode 100644 include/standard-headers/linux/virtio_rng.h
create mode 100644 include/standard-headers/linux/virtio_scsi.h
create mode 100644 include/standard-headers/linux/virtio_types.hSignature · 1 line
MST