git: 9a49c98bafbe - main - amd64 la57_trampoline: stop using %rdx to remember original %cr0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 16 Sep 2024 08:15:05 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=9a49c98bafbea2a896f72defe7d9f2b65a474c41
commit 9a49c98bafbea2a896f72defe7d9f2b65a474c41
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-09-11 00:35:43 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-09-16 08:09:20 +0000
amd64 la57_trampoline: stop using %rdx to remember original %cr0
Store %cr0 in %ebp. %rdx is needed for MSR access.
Sponsored by: Advanced Micro Devices (AMD)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
---
sys/amd64/amd64/locore.S | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S
index a51e5047fe54..86db0f76b22b 100644
--- a/sys/amd64/amd64/locore.S
+++ b/sys/amd64/amd64/locore.S
@@ -93,9 +93,10 @@ ENTRY(btext)
ENTRY(la57_trampoline)
movq %rsp,%r11
movq %rbx,%r10
+ movq %rbp,%r9
leaq la57_trampoline_end(%rip),%rsp
- movq %cr0,%rdx
+ movq %cr0,%rbp
lgdtq la57_trampoline_gdt_desc(%rip)
pushq $(2<<3)
@@ -109,7 +110,7 @@ ENTRY(la57_trampoline)
l1: movl $(3<<3),%eax
movl %eax,%ss
- movl %edx,%eax
+ movl %ebp,%eax
andl $~CR0_PG,%eax
movl %eax,%cr0
@@ -118,7 +119,7 @@ l1: movl $(3<<3),%eax
movl %eax,%cr4
movl %edi,%cr3
- movl %edx,%cr0
+ movl %ebp,%cr0
jmp 1f
1: pushl $(1<<3)
@@ -128,6 +129,7 @@ l1: movl $(3<<3),%eax
l2: movq %r11,%rsp
movq %r10,%rbx
+ movq %r9,%rbp
retq
.p2align 4,0
ENTRY(la57_trampoline_gdt_desc)