Messages in this thread | ![/](/images/icornerl.gif) | | Date | Thu, 25 Jan 2024 01:57:18 -0800 | From | Andi Kleen <> | Subject | Re: [PATCHv3, RESEND] x86/trampoline: Bypass compat mode in trampoline_start64() if not needed |
| |
> + /* Paging mode is correct proceed in 64-bit mode */ > + > + LOCK_AND_LOAD_REALMODE_ESP lock_rip=1 > + > + movw $__KERNEL_DS, %dx > + movl %edx, %ss > + addl $pa_real_mode_base, %esp > + movl %edx, %ds > + movl %edx, %es > + movl %edx, %fs > + movl %edx, %gs > + > + movl $pa_trampoline_pgd, %eax > + movq %rax, %cr3 > + > + jmpq *tr_start(%rip)
Still think we should add a far jump here so that we run on a defined code segment. It probably doesn't matter since there are likely no IRETs before reloading anyways, but it seems cleaner.
-Andi
| ![\](/images/icornerr.gif) |