[QEMU] Fix QEMU boot issue in nested virtualization env
Is is reported that SBL QEMU target crashes when running in nested virtualization env. For example, run QEMU with KVM flag inside Ubuntu running on Windows Virtual Box. After debug, it turned out somehow the KVM generated exception for instruction "movd mm0, eax" at the very beginning. This was used to save the CPU BIST info. If it is moved to be after switching to FLAT32 mode, then everything goes well. This patch moved the BIST saving into later stage in the boot in order to address the KVM crash issue. This fixed #1469. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
parent
12a4402ee8
commit
e75725ef11
|
@ -35,7 +35,5 @@ EarlyInit16:
|
||||||
;
|
;
|
||||||
; ESP - Initial value of the EAX register (BIST: Built-in Self Test)
|
; ESP - Initial value of the EAX register (BIST: Built-in Self Test)
|
||||||
;
|
;
|
||||||
movd mm0, eax
|
|
||||||
|
|
||||||
OneTimeCallRet EarlyInit16
|
OneTimeCallRet EarlyInit16
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@ TransitionFromReal16To32BitFlat:
|
||||||
mov ds, bx
|
mov ds, bx
|
||||||
mov bx, ADDR16_OF(gdtr)
|
mov bx, ADDR16_OF(gdtr)
|
||||||
o32 lgdt [cs:bx]
|
o32 lgdt [cs:bx]
|
||||||
|
mov ebx, eax ; save BIST to EBX
|
||||||
mov eax, cr0
|
mov eax, cr0
|
||||||
and eax, SEC_DEFAULT_CR0_MASK
|
and eax, SEC_DEFAULT_CR0_MASK
|
||||||
or eax, SEC_DEFAULT_CR0
|
or eax, SEC_DEFAULT_CR0
|
||||||
|
@ -120,5 +121,6 @@ jumpTo32BitAndLandHere:
|
||||||
mov fs, ax
|
mov fs, ax
|
||||||
mov gs, ax
|
mov gs, ax
|
||||||
mov ss, ax
|
mov ss, ax
|
||||||
|
movd mm0, ebx ; save BIST to MM0
|
||||||
OneTimeCallRet TransitionFromReal16To32BitFlat
|
OneTimeCallRet TransitionFromReal16To32BitFlat
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue