amd64 la57_trampoline: disable EFER.LME around setting CR4.LA57

Changing paging mode while LME is set seems to be not allowed.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	jThe FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2024-09-11 03:39:30 +03:00
parent 9a49c98baf
commit b7ea2b69ef
1 changed files with 10 additions and 0 deletions

View File

@ -114,11 +114,21 @@ l1: movl $(3<<3),%eax
andl $~CR0_PG,%eax
movl %eax,%cr0
movl $MSR_EFER,%ecx
rdmsr
andl $~EFER_LME,%eax
wrmsr
movl %cr4,%eax
orl $CR4_LA57,%eax
movl %eax,%cr4
movl %edi,%cr3
rdmsr
orl $EFER_LME,%eax
wrmsr
movl %ebp,%cr0
jmp 1f