qemu/include/hw
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
..
acpi hw/arm/virt: Add gic-version option to virt machine 2015-09-24 01:29:37 +01:00
arm hw/arm/virt: Add gic-version option to virt machine 2015-09-24 01:29:37 +01:00
audio
block BlockConf: Call backend functions to detect geometry and blocksizes 2015-03-10 14:02:22 +01:00
char i.MX: Split UART emulator in a header file and a source file 2015-08-13 11:26:19 +01:00
cpu icc_bus: drop the unused files 2015-10-02 16:22:02 -03:00
cris
gpio i.MX: Add GPIO device 2015-09-14 14:39:49 +01:00
i2c i.MX: Add I2C controller emulator 2015-09-07 10:39:30 +01:00
i386 target-i386: Disable cache info passthrough by default 2015-10-23 12:59:27 -02:00
input
intc arm_gic_kvm: Disable live migration if not supported 2015-10-27 12:00:50 +00:00
ipack
isa i8257: remove cpu_request_exit irq 2015-09-09 15:34:53 +02:00
kvm
lm32 hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() 2015-02-18 11:58:50 +01:00
m68k
mem memhp: extend address auto assignment to support gaps 2015-10-02 17:04:32 +03:00
mips net/dp8393x: QOM'ify 2015-06-11 10:13:30 +01:00
misc ivshmem: add check on protocol version in QEMU 2015-10-24 18:03:18 +02:00
net i.MX: Add FEC Ethernet Emulator 2015-09-07 10:39:30 +01:00
nvram Implement fw_cfg DMA interface 2015-10-19 15:26:53 +02:00
pci msix: add VMSTATE_MSIX_TEST 2015-10-24 18:02:48 +02:00
pci-host spapr_pci: Allow PCI host bridge DMA window to be configured 2015-10-23 10:38:10 +11:00
ppc spapr_iommu: Provide a function to switch a TCE table to allowing VFIO 2015-10-23 10:38:10 +11:00
s390x s390/sclp: store the increment_size in the sclp device 2015-09-07 16:10:44 +02:00
scsi esp: Do not overwrite ESP_TCHI after reset 2014-11-12 10:27:03 +01:00
sh4
smbios smbios: add smbios 3.0 support 2015-09-07 10:39:28 +01:00
sparc QOM infrastructure fixes and device conversions 2015-03-02 13:20:43 +00:00
timer hpet: remove muldiv64() 2015-09-25 14:56:05 +02:00
tricore target-tricore: Add board for systemmode 2014-09-01 14:49:20 +01:00
unicore32
usb usb: move ehci register defines to header file 2014-06-02 16:28:59 +02:00
vfio vfio: Record host IOMMU's available IO page sizes 2015-10-05 12:38:41 -06:00
virtio virtio: introduce virtio_map 2015-10-29 11:05:24 +02:00
watchdog s390x/watchdog: introduce diag288 watchdog device 2015-06-11 17:45:49 +02:00
xen xen-2015-09-10 2015-09-10 18:25:52 +01:00
boards.h machine: Eliminate QEMUMachine and qemu_register_machine() 2015-09-19 16:40:30 +02:00
bt.h
compat.h pc: Introduce pc-*-2.5 machine classes 2015-09-24 13:42:00 +03:00
devices.h
elf_ops.h elf: Update EM_MOXIE definition 2015-09-25 12:04:43 +02:00
empty_slot.h
fw-path-provider.h
hotplug.h misc: Fix new typos in comments 2015-01-15 10:44:13 +03:00
hw.h bootdevice: move code about bootorder from vl.c to bootdevice.c 2014-12-22 14:39:20 +08:00
ide.h
irq.h irq: Remove qemu_irq_intercept_out 2014-10-23 16:41:25 +02:00
loader.h vl: move rom_load_all after machine init done 2015-07-07 11:03:16 +02:00
nmi.h nmi: Implement inject_nmi() for non-monitor context use 2015-06-11 17:45:50 +02:00
pcmcia.h hmp: Remove "info pcmcia" 2014-10-24 12:19:11 +01:00
platform-bus.h sysbus: Add new platform bus helper device 2014-11-04 23:26:14 +01:00
ptimer.h
qdev-core.h qdev: Protect device-list-properties against broken devices 2015-10-09 15:25:57 +02:00
qdev-dma.h
qdev-properties.h qdev: fix 64 bit properties 2015-07-13 14:42:24 +03:00
qdev.h
sd.h hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
ssi.h
stream.h
sysbus.h sysbus: add irq_routing_notifier 2015-07-06 12:15:14 -06:00
usb.h usb: Remove unused functions 2015-04-30 16:05:48 +03:00