legacy virtio support for cross-endian targets
Status from this message: Applied, thanks everyone.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v9 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/22 | virtio-net: byteswap virtio-net headerhw/ | +17 | 0 replies | |
| 2/22 | virtio-serial: don't migrate the config spacehw/ | +6 | 1 reply | |
| 3/22 | virtio: introduce device specific migration callshw/ hw/ hw/ +5 more | +21 | 0 replies | |
| 4/22 | virtio-net: implement per-device migration callshw/ | +16 | 0 replies | |
| 5/22 | virtio-blk: implement per-device migration callshw/ | +16 | 0 replies | |
| 6/22 | virtio-serial: implement per-device migration callshw/ | +20 | 0 replies | |
| 7/22 | virtio-balloon: implement per-device migration callshw/ | +14 | 0 replies | |
| 8/22 | virtio-rng: implement per-device migration callshw/ | +7 | 0 replies | |
| 9/22 | virtio: add subsections to the migration streamhw/ | +19 | 0 replies | |
| 10/22 | exec: introduce target_words_bigendian() helperexec.c hw/ include/ | +8 | 0 replies | |
| 11/22 | cpu: introduce CPUClass::virtio_is_big_endian()include/ qom/ | +7 | 0 replies | |
| 12/22 | virtio: add endian-ambivalent support to VirtIODevicehw/ hw/ include/ | +101 | 0 replies | |
| 13/22 | virtio: memory accessors for endian-ambivalent targetsinclude/ | +170 | 0 replies | |
| 14/22 | virtio: allow byte swapping for vringhw/ | +48 | 0 replies | |
| 15/22 | virtio-net: use virtio wrappers to access headershw/ | +17 | 0 replies | |
| 16/22 | virtio-balloon: use virtio wrappers to access page frame numbershw/ | +5 | 0 replies | |
| 17/22 | virtio-blk: use virtio wrappers to access headershw/ | +21 | 0 replies | |
| 18/22 | virtio-scsi: use virtio wrappers to access headershw/ | +20 | 0 replies | |
| 19/22 | virtio-serial-bus: use virtio wrappers to access headershw/ | +31 | 0 replies | |
| 20/22 | virtio-9p: use virtio wrappers to access headershw/ | +2 | 0 replies | |
| 21/22 | target-ppc: enable virtio endian ambivalent supporttarget-ppc/ target-ppc/ | +17 | 0 replies | |
| 22/22 | vhost-net: disable when cross-endianhw/ | +19 | 1 reply |
Reviews trailers per patch
17 of 22 patches have a Reviewed-by or Acked-by.
| Patch | Michael S. Tsirkin | Alexander Graf | Thomas Huth | Anthony Liguori | Amit Shah |
|---|---|---|---|---|---|
| 1/22 | |||||
| 2/22 | R-b | R-b | |||
| 3/22 | R-b | ||||
| 4/22 | R-b | ||||
| 5/22 | R-b | ||||
| 6/22 | R-b | ||||
| 7/22 | R-b | ||||
| 8/22 | R-b | ||||
| 9/22 | R-b | ||||
| 10/22 | |||||
| 11/22 | |||||
| 12/22 | |||||
| 13/22 | R-b | ||||
| 14/22 | R-b | R-b | |||
| 15/22 | R-b | ||||
| 16/22 | R-b | R-b | |||
| 17/22 | R-b | R-b | |||
| 18/22 | R-b | R-b | |||
| 19/22 | R-b | R-b | |||
| 20/22 | R-b | ||||
| 21/22 | R-b | ||||
| 22/22 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets
The current legacy virtio devices have a fundamental flaw: they all share data between host and guest with guest endianness ordering. This is ok for nearly all architectures that have fixed endianness. Unfortunately, it breaks for recent PPC64 and ARM targets that can change endianness at runtime. The virtio-1.0 specification fixes the issue by enforcing little-endian ordering. It may take some time though until the code for 1.0 gets available and supported, and all the users can migrate. There have been discussions for some monthes about supporting such oddity: now we have little-endian PPC64 distros available, it is worth to propose something.
This patch set brings legacy virtio support for cross-endian targets. The rationale is that we add a new device_endianness property to VirtIODevice. This property is used as a runtime indicator to decide wether we should do little-endian or big-endian conversion, as opposed to the compile time choice we have now with TARGTE_WORDS_BIGENDIAN. The choice was made to sample the device endianness out of the endianness mode of the guest CPU that does the reset. It is an evil but logical consequence of the initial flaw in the virtio specification, and it was agreed that the concept would be a good common base for ARM and PPC64 enablement at least. Please note also that this new property is state and must be preserved across migrations.
There are several parts in the serie:
- patches 1 and 2 are simple fixes
- patches 3 to 9 introduce VMState based subsections in the virtio migration code. This is needed because we introduce a new property in VirtIODevice that we want to migrate without ruining compatibility efforts
- patches 10 to 13 bring virtio device endianness and memory accessors to be used by the virtio code
- patches 14 to 20 wire the new memory accessors everywhere accross the virtio code
- patch 21 is the PPC64 enablement
- patch 22 is a follow-up workaround to disable vhost-net acceleration in the case the host and guest have different endianness, because it is not supported for the moment
Changes since v8 are provided in each patch.
Cheers.
---
Alexander Graf (1):
virtio-serial: don't migrate the config space
Cédric Le Goater (1):
virtio-net: byteswap virtio-net header
Greg Kurz (14):
virtio: introduce device specific migration calls
virtio-net: implement per-device migration calls
virtio-blk: implement per-device migration calls
virtio-serial: implement per-device migration calls
virtio-balloon: implement per-device migration calls
virtio-rng: implement per-device migration calls
virtio: add subsections to the migration stream
exec: introduce target_words_bigendian() helper
cpu: introduce CPUClass::virtio_is_big_endian()
virtio: add endian-ambivalent support to VirtIODevice
virtio: memory accessors for endian-ambivalent targets
virtio-9p: use virtio wrappers to access headers
target-ppc: enable virtio endian ambivalent support
vhost-net: disable when cross-endian
Rusty Russell (6):
virtio: allow byte swapping for vring
virtio-net: use virtio wrappers to access headers
virtio-balloon: use virtio wrappers to access page frame numbers
virtio-blk: use virtio wrappers to access headers
virtio-scsi: use virtio wrappers to access headers
virtio-serial-bus: use virtio wrappers to access headers
exec.c | 8 - hw/9pfs/virtio-9p-device.c | 3 - hw/block/virtio-blk.c | 62 ++++++----- hw/char/virtio-serial-bus.c | 94 ++++++++++------ hw/net/vhost_net.c | 19 +++ hw/net/virtio-net.c | 56 +++++++--- hw/scsi/virtio-scsi.c | 40 ++++--- hw/virtio/virtio-balloon.c | 33 +++--- hw/virtio/virtio-pci.c | 11 +- hw/virtio/virtio-rng.c | 12 +- hw/virtio/virtio.c | 216 ++++++++++++++++++++++++++++--------- include/hw/virtio/virtio-access.h | 170 +++++++++++++++++++++++++++++ include/hw/virtio/virtio.h | 17 +++ include/qom/cpu.h | 1 qom/cpu.c | 6 + target-ppc/cpu.h | 2 target-ppc/translate_init.c | 15 +++ 17 files changed, 583 insertions(+), 182 deletions(-) create mode 100644 include/hw/virtio/virtio-access.h
--
Greg