mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-04 21:47:41 -07:00
hvf_reset_vcpu() duplicates actions performed by x86_cpu_reset(). The
difference is that hvf_reset_vcpu() stores initial values directly to
VMCS while x86_cpu_reset() stores it in CPUX86State and then
cpu_synchronize_all_post_init() or cpu_synchronize_all_post_reset()
flushes CPUX86State into VMCS. That makes hvf_reset_vcpu() a kind of
no-op.
Here's the trace of CPU state modifications during VM start:
hvf_reset_vcpu (resets VMCS)
cpu_synchronize_all_post_init (overwrites VMCS fields written by
hvf_reset_vcpu())
cpu_synchronize_all_states
hvf_reset_vcpu (resets VMCS)
cpu_synchronize_all_post_reset (overwrites VMCS fields written by
hvf_reset_vcpu())
General purpose registers, system registers, segment descriptors, flags
and IP are set by hvf_put_segments() in post-init and post-reset,
therefore it's safe to remove them from hvf_reset_vcpu().
PDPTE initialization can be dropped because Intel SDM (26.3.1.6 Checks
on Guest Page-Directory-Pointer-Table Entries) doesn't require PDPTE to
be clear unless PAE is used: "A VM entry to a guest that does not use
PAE paging does not check the validity of any PDPTEs."
And if PAE is used, PDPTE's are initialized from CR3 in macvm_set_cr0().
Cc: Cameron Esfahani <dirty@apple.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20200630102824.77604-8-r.bolshakov@yadro.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||
|---|---|---|
| .. | ||
| accel.h | ||
| arch_init.h | ||
| balloon.h | ||
| block-backend.h | ||
| blockdev.h | ||
| cpus.h | ||
| cryptodev-vhost-user.h | ||
| cryptodev-vhost.h | ||
| cryptodev.h | ||
| device_tree.h | ||
| dma.h | ||
| dump-arch.h | ||
| dump.h | ||
| hax.h | ||
| hostmem.h | ||
| hvf.h | ||
| hw_accel.h | ||
| iothread.h | ||
| kvm.h | ||
| kvm_int.h | ||
| memory_mapping.h | ||
| numa.h | ||
| os-posix.h | ||
| os-win32.h | ||
| qtest.h | ||
| replay.h | ||
| reset.h | ||
| rng-random.h | ||
| rng.h | ||
| runstate.h | ||
| seccomp.h | ||
| sev.h | ||
| sysemu.h | ||
| tcg.h | ||
| tpm.h | ||
| tpm_backend.h | ||
| tpm_util.h | ||
| vhost-user-backend.h | ||
| watchdog.h | ||
| whpx.h | ||
| xen-mapcache.h | ||
| xen.h | ||