qemu-e2k/target/i386
Roman Kagan e9688fabc3 hyperv: ensure VP index equal to QEMU cpu_index
Hyper-V identifies vCPUs by Virtual Processor (VP) index which can be
queried by the guest via HV_X64_MSR_VP_INDEX msr.  It is defined by the
spec as a sequential number which can't exceed the maximum number of
vCPUs per VM.

It has to be owned by QEMU in order to preserve it across migration.

However, the initial implementation in KVM didn't allow to set this
msr, and KVM used its own notion of VP index.  Fortunately, the way
vCPUs are created in QEMU/KVM makes it likely that the KVM value is
equal to QEMU cpu_index.

So choose cpu_index as the value for vp_index, and push that to KVM on
kernels that support setting the msr.  On older ones that don't, query
the kernel value and assert that it's in sync with QEMU.

Besides, since handling errors from vCPU init at hotplug time is
impossible, disable vCPU hotplug.

This patch also introduces accessor functions to encapsulate the mapping
between a vCPU and its vp_index.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Message-Id: <20180702134156.13404-3-rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-07-16 16:58:16 +02:00
..
hvf
arch_dump.c
arch_memory_mapping.c
bpt_helper.c
cc_helper_template.h
cc_helper.c
cpu-qom.h
cpu.c
cpu.h
excp_helper.c
fpu_helper.c
gdbstub.c
hax-all.c
hax-darwin.c
hax-darwin.h
hax-i386.h
hax-interface.h
hax-mem.c
hax-windows.c
hax-windows.h
helper.c
helper.h
hyperv-proto.h
hyperv.c hyperv: ensure VP index equal to QEMU cpu_index 2018-07-16 16:58:16 +02:00
hyperv.h hyperv: ensure VP index equal to QEMU cpu_index 2018-07-16 16:58:16 +02:00
int_helper.c
kvm_i386.h hyperv: ensure VP index equal to QEMU cpu_index 2018-07-16 16:58:16 +02:00
kvm-stub.c hyperv: ensure VP index equal to QEMU cpu_index 2018-07-16 16:58:16 +02:00
kvm.c hyperv: ensure VP index equal to QEMU cpu_index 2018-07-16 16:58:16 +02:00
machine.c
Makefile.objs
mem_helper.c
misc_helper.c
monitor.c
mpx_helper.c
ops_sse_header.h
ops_sse.h
seg_helper.c
sev_i386.h
sev-stub.c
sev.c
shift_helper_template.h
smm_helper.c
svm_helper.c
svm.h
TODO
trace-events
translate.c
whp-dispatch.h
whpx-all.c
xsave_helper.c