summary refs log tree commit diff stats
path: root/python/qemu/machine.py
diff options
context:
space:
mode:
authorRoman Bolshakov <r.bolshakov@yadro.com>2020-06-30 13:28:22 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-07-10 18:02:19 -0400
commit5009ef22c6bb21aa741e9e354ccaa97edf56911d (patch)
tree377f9d46cecd66fc60cecd6ed40b8f7395cfa563 /python/qemu/machine.py
parent82695a1b9c696aaea491e932548f9787adb7d78b (diff)
downloadfocaccia-qemu-5009ef22c6bb21aa741e9e354ccaa97edf56911d.tar.gz
focaccia-qemu-5009ef22c6bb21aa741e9e354ccaa97edf56911d.zip
i386: hvf: Don't duplicate register reset
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>
Diffstat (limited to 'python/qemu/machine.py')
0 files changed, 0 insertions, 0 deletions