]> git.proxmox.com Git - mirror_qemu.git/commit
i386: hvf: Move Guest LMA reset to macvm_set_cr0()
authorRoman Bolshakov <r.bolshakov@yadro.com>
Tue, 30 Jun 2020 10:28:21 +0000 (13:28 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jul 2020 22:02:19 +0000 (18:02 -0400)
commit82695a1b9c696aaea491e932548f9787adb7d78b
treeb26fc571be21f99a6340ad2a1445215a9f1dfad9
parenta4e26fa8583a215aa61107a623bfa25afd09a860
i386: hvf: Move Guest LMA reset to macvm_set_cr0()

The only useful purpose of hvf_reset_vcpu() is to clear "IA-32e mode
guest" (LMA) VM-Entry control. But it can be moved to macvm_set_cr0()
which is indirectly used by post-init and post-reset to flush emulator
state. That enables clean removal of hvf_reset_vcpu().

LMA is set only if IA32_EFER.LME = 1, according to Intel SDM "9.8.5
Initializing IA-32e Mode" and "9.8.5.4 Switching Out of IA-32e Mode
Operation", otherwise the entry control can be safely cleared.

Cc: Cameron Esfahani <dirty@apple.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20200630102824.77604-7-r.bolshakov@yadro.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/hvf/hvf.c
target/i386/hvf/vmx.h