qemu/include
Michael S. Tsirkin 8059feee00 virtio: introduce virtio_map
virtio_map_sg currently fails if one of the entries it's mapping is
contigious in GPA but not HVA address space.  Introduce virtio_map which
handles this by splitting sg entries.

This new API generally turns out to be a good idea since it's harder to
misuse: at least in one case the existing one was used incorrectly.

This will still fail if there's no space left in the sg, but luckily max
queue size in use is currently 256, while max sg size is 1024, so we
should be OK even is all entries happen to cross a single DIMM boundary.

Won't work well with very small DIMM sizes, unfortunately:
e.g. this will fail with 4K DIMMs where a single
request might span a large number of DIMMs.

Let's hope these are uncommon - at least we are not breaking things.

Note: virtio-scsi calls virtio_map_sg on data loaded from network, and
validates input, asserting on failure.  Copy the validating code here -
it will be dropped from virtio-scsi in a follow-up patch.

Reported-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2015-10-29 11:05:24 +02:00
..
block block: Introduce "drained begin/end" API 2015-10-23 18:18:24 +02:00
crypto crypto: introduce new module for handling TLS sessions 2015-09-15 15:07:43 +01:00
disas disas: Add print_insn to disassemble info 2015-07-09 15:20:40 +02:00
exec hw/pci: Introduce pci_requester_id() 2015-10-19 10:13:07 +02:00
fpu
hw virtio: introduce virtio_map 2015-10-29 11:05:24 +02:00
libdecnumber
migration migration: qemu-file more size_t'ifying 2015-09-29 11:33:02 +05:30
monitor hmp: added io apic dump state 2015-09-25 12:04:42 +02:00
net vhost user: add rarp sending after live migration for legacy guest 2015-10-22 14:34:49 +03:00
qapi qapi: Introduce a first class 'any' type 2015-09-21 09:56:49 +02:00
qemu ivshmem series 2015-10-26 11:32:20 +00:00
qom exec.c: Collect AddressSpace related fields into a CPUAddressSpace struct 2015-10-12 18:29:26 +02:00
standard-headers linux-headers: update from kvm/next 2015-10-12 18:29:26 +02:00
sysemu ivshmem series 2015-10-26 11:32:20 +00:00
ui qemu-char: convert spice backend to data-driven creation 2015-10-19 10:13:07 +02:00
config.h
elf.h elf: Update EM_MOXIE definition 2015-09-25 12:04:43 +02:00
glib-compat.h glib-compat: add 2.38/2.40/2.46 asserts 2015-10-19 18:28:06 -05:00
qemu-common.h util - add automated ID generation utility 2015-10-16 15:34:30 +02:00
qemu-io.h
qjson.h
trace-tcg.h
trace.h