From 458978e7b8a6d50566fc8b68558f76f6b0465c52 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 15 Sep 2023 00:29:11 +0200 Subject: kern: fix GDT order for 64bit sysret --- src/kernel/arch/amd64/sysenter.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kernel/arch/amd64/sysenter.s') diff --git a/src/kernel/arch/amd64/sysenter.s b/src/kernel/arch/amd64/sysenter.s index 6b6d684..c1af69f 100644 --- a/src/kernel/arch/amd64/sysenter.s +++ b/src/kernel/arch/amd64/sysenter.s @@ -1,6 +1,6 @@ // gdt.h .set SEG_r0code, 1 -.set SEG_r3code, 3 +.set SEG_r3code32, 3 .set SEG_r3data, 4 .set IA32_STAR, 0xC0000081 @@ -15,7 +15,7 @@ sysenter_setup: // the intel docs don't mention the lower 32 bits mov $0, %eax - mov $( ((SEG_r3code << 3 | 3) << 16) | (SEG_r0code << 3) ), %edx + mov $( ((SEG_r3code32 << 3 | 3) << 16) | (SEG_r0code << 3) ), %edx mov $IA32_STAR, %rcx wrmsr -- cgit v1.2.3