qemu-e2k/target-i386
Chao Peng 494e95e910 target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data
KVM_GET_SUPPORTED_CPUID ioctl is called frequently when initializing
CPU. Depends on CPU features and CPU count, the number of calls can be
extremely high which slows down QEMU booting significantly. In our
testing, we saw 5922 calls with switches:

    -cpu SandyBridge -smp 6,sockets=6,cores=1,threads=1

This ioctl takes more than 100ms, which is almost half of the total
QEMU startup time.

While for most cases the data returned from two different invocations
are not changed, that means, we can cache the data to avoid trapping
into kernel for the second time. To make sure the cache safe one
assumption is desirable: the ioctl is stateless. This is not true for
CPUID leaves in general (such as CPUID leaf 0xD, whose value depends
on guest XCR0 and IA32_XSS) but it is true of KVM_GET_SUPPORTED_CPUID,
which runs before there is a value for XCR0 and IA32_XSS.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Message-Id: <1465784487-23482-1-git-send-email-chao.p.peng@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-06-16 18:39:04 +02:00
..
arch_dump.c
arch_memory_mapping.c
bpt_helper.c cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc() 2016-06-09 15:55:02 +01:00
cc_helper_template.h
cc_helper.c
cpu-qom.h target-i386: make cpu-qom.h not target specific 2016-05-19 13:08:04 +02:00
cpu.c target-i386: Consolidate calls of object_property_parse() in x86_cpu_parse_featurestr 2016-06-14 16:17:09 -03:00
cpu.h target-i386: Implement CPUID[0xB] (Extended Topology Enumeration) 2016-06-14 16:17:08 -03:00
excp_helper.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
fpu_helper.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
gdbstub.c qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
helper.c target-i386: Move user-mode exception actions out of user-exec.c 2016-06-09 15:55:02 +01:00
helper.h target-i386: implement PKE for TCG 2016-03-24 14:01:08 +01:00
hyperv.c event-notifier: Add "is_external" parameter 2016-04-22 16:43:56 +02:00
hyperv.h
int_helper.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
kvm_i386.h
kvm-stub.c qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
kvm.c target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data 2016-06-16 18:39:04 +02:00
machine.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
Makefile.objs
mem_helper.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
misc_helper.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
monitor.c
mpx_helper.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
ops_sse_header.h
ops_sse.h
seg_helper.c target-i386: Add comment about do_interrupt_user() next_eip argument 2016-06-09 15:55:02 +01:00
shift_helper_template.h
smm_helper.c
svm_helper.c cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
svm.h
TODO
translate.c target-*: dfilter support for in_asm 2016-06-05 09:26:24 -07:00