qemu-patch-raspberry4/include/sysemu
Greg Kurz 41264b385c PPC/KVM: early validation of vcpu id
The KVM API restricts vcpu ids to be < KVM_CAP_MAX_VCPUS. On PowerPC
targets, depending on the number of threads per core in the host and
in the guest, some topologies do generate higher vcpu ids actually.
When this happens, QEMU bails out with the following error:

kvm_init_vcpu failed: Invalid argument

The KVM_CREATE_VCPU ioctl has several EINVAL return paths, so it is
not possible to fully disambiguate.

This patch adds a check in the code that computes vcpu ids, so that
we can detect the error earlier, and print a friendlier message instead
of calling KVM_CREATE_VCPU with an obviously bogus vcpu id.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-05-27 09:40:23 +10:00
..
accel.h accel: make configure_accelerator return void 2016-05-18 15:04:27 +03:00
arch_init.h cpu: Eliminate cpudef_init(), cpudef_setup() 2016-05-23 19:47:37 -03:00
balloon.h Inhibit ballooning during postcopy 2015-11-10 15:00:28 +01:00
block-backend.h block: Make blk_co_preadv/pwritev() public 2016-05-25 19:04:21 +02:00
blockdev.h include: Clean up includes 2016-02-23 12:43:05 +00:00
bt.h sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
char.h Move ParallelIOArg from qemu-common.h to sysemu/char.h 2016-03-22 22:20:16 +01:00
cpus.h include: move CPU-related definitions out of qemu-common.h 2016-05-19 13:08:04 +02:00
device_tree.h device_tree: qemu_fdt_getprop_cell converted to use the error API 2016-02-19 09:42:30 -07:00
dma.h dma-helpers: change BlockBackend to opaque value in DMAIOFunc 2016-05-25 19:04:11 +02:00
dump-arch.h dump: allow target to set the physical base 2016-01-15 14:40:25 +00:00
dump.h DumpState: adding total_size and written_size fields 2016-02-22 18:40:28 +01:00
hostmem.h remove comment for nonexistent structure member 2016-05-18 15:04:26 +03:00
iothread.h Remove various unused functions 2015-05-08 14:11:10 +03:00
kvm.h PPC/KVM: early validation of vcpu id 2016-05-27 09:40:23 +10:00
kvm_int.h kvm-all: add support for multiple address spaces 2015-07-06 17:59:43 +02:00
memory_mapping.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
numa.h include: Clean up includes 2016-02-23 12:43:05 +00:00
os-posix.h osdep: remove use of socket_error() from all code 2016-03-10 17:19:34 +00:00
os-win32.h osdep: remove use of socket_error() from all code 2016-03-10 17:19:34 +00:00
qtest.h include: Clean up includes 2016-02-23 12:43:05 +00:00
replay.h replay: introduce block devices record/replay 2016-03-30 12:15:57 +02:00
rng-random.h rng-random: rename RndRandom to RngRandom 2016-05-23 12:18:43 +05:30
rng.h rng: switch request queue to QSIMPLEQ 2016-03-08 12:54:14 +05:30
seccomp.h include: Clean up includes 2016-02-23 12:43:05 +00:00
sysemu.h migration: convert post-copy to use QIOChannelBuffer 2016-05-26 11:31:34 +05:30
tpm.h TPM: fix build with tpm disabled 2015-06-03 18:19:15 +02:00
tpm_backend.h include: Clean up includes 2016-02-23 12:43:05 +00:00
tpm_backend_int.h Remove various unused functions 2015-05-08 14:11:10 +03:00
watchdog.h watchdog: introduction of get_watchdog_action 2016-01-27 15:34:47 +01:00
xen-mapcache.h include: Clean up includes 2016-02-23 12:43:05 +00:00