OcCpuLib: Fix trashing EBX register in AsmReadIntelMicrocodeRevision

This register is callee-preserved in MSABI.
This commit is contained in:
vit9696 2020-05-18 18:58:44 +03:00
parent 74a5326b4a
commit e7989ef64f
2 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,7 @@ ASM_PFX(AsmReadIntelMicrocodeRevision):
; Several Intel CPUs, notably Westmere, require a certain assembly
; sequence to retrieve microcode revision.
; Reference: https://github.com/acidanthera/bugtracker/issues/621.
push ebx
mov ecx, MSR_IA32_BIOS_SIGN_ID
xor eax, eax
xor edx, edx
@ -43,4 +44,5 @@ ASM_PFX(AsmReadIntelMicrocodeRevision):
mov ecx, MSR_IA32_BIOS_SIGN_ID
rdmsr
mov eax, edx
pop ebx
ret

View File

@ -34,6 +34,7 @@ ASM_PFX(AsmReadIntelMicrocodeRevision):
; Several Intel CPUs, notably Westmere, require a certain assembly
; sequence to retrieve microcode revision.
; Reference: https://github.com/acidanthera/bugtracker/issues/621.
push rbx
mov ecx, MSR_IA32_BIOS_SIGN_ID
xor eax, eax
xor edx, edx
@ -43,4 +44,5 @@ ASM_PFX(AsmReadIntelMicrocodeRevision):
mov ecx, MSR_IA32_BIOS_SIGN_ID
rdmsr
mov eax, edx
pop rbx
ret