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 target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
arch_dump.c dump: add kernel_gs_base to QEMU CPU state 2018-07-16 16:13:34 +02:00
arch_memory_mapping.c
bpt_helper.c
cc_helper_template.h
cc_helper.c
cpu-qom.h
cpu.c i386: fix '-cpu ?' output for host cpu type 2018-07-06 18:39:19 +02:00
cpu.h target-i386: Add NPT support 2018-07-02 15:41:18 +02:00
excp_helper.c target-i386: Add NPT support 2018-07-02 15:41:18 +02:00
fpu_helper.c
gdbstub.c
hax-all.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
hax-darwin.c Remove unnecessary variables for function return value 2018-05-20 08:48:13 +03:00
hax-darwin.h
hax-i386.h
hax-interface.h
hax-mem.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
hax-windows.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
hax-windows.h
helper.c icount: fix cpu_restore_state_from_tb for non-tb-exit cases 2018-04-11 09:05:22 +10:00
helper.h
hyperv-proto.h i386/kvm: add support for Hyper-V TLB flush 2018-07-02 14:45:23 +02:00
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 target-i386: Add NPT support 2018-07-02 15:41:18 +02:00
Makefile.objs
mem_helper.c target-i386: Add NPT support 2018-07-02 15:41:18 +02:00
misc_helper.c
monitor.c i386/monitor.c: make addresses canonical for "info mem" and "info tlb" 2018-07-02 15:41:18 +02:00
mpx_helper.c
ops_sse_header.h
ops_sse.h
seg_helper.c target-i386: Add NMI interception to SVM 2018-06-28 19:05:36 +02:00
sev_i386.h
sev-stub.c
sev.c target/i386: sev: fix memory leaks 2018-05-09 00:13:39 +02:00
shift_helper_template.h
smm_helper.c
svm_helper.c target-i386: Add NPT support 2018-07-02 15:41:18 +02:00
svm.h target-i386: Add NPT support 2018-07-02 15:41:18 +02:00
TODO
trace-events
translate.c target-i386: Allow interrupt injection after STGI 2018-06-28 19:05:36 +02:00
whp-dispatch.h whpx: commit missing file 2018-06-28 19:05:31 +02:00
whpx-all.c WHPX: register for unrecognized MSR exits 2018-06-28 19:05:36 +02:00
xsave_helper.c