mirror of https://github.com/l4ka/pistachio.git
- Clear LDTR contents during initialization
This commit is contained in:
parent
16ebb49836
commit
c8871cf853
|
@ -180,6 +180,8 @@ void SECTION(SEC_INIT) setup_gdt(x86_tss_t &tss, cpuid_t cpuid)
|
|||
#else
|
||||
"mov %0, %%fs \n" /* default without tracebuffer */
|
||||
#endif
|
||||
"xor %%eax, %%eax \n" /* */
|
||||
"lldt %%ax \n" /* clear LDTR */
|
||||
:
|
||||
:
|
||||
#if defined(CONFIG_X86_SMALL_SPACES)
|
||||
|
@ -188,6 +190,7 @@ void SECTION(SEC_INIT) setup_gdt(x86_tss_t &tss, cpuid_t cpuid)
|
|||
"r"(X86_UDS),
|
||||
#endif
|
||||
"r"(X86_KDS), "r"(X86_UTCBS), "r"(X86_TBS)
|
||||
: "eax"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -239,11 +239,15 @@ void SECTION(SEC_INIT) setup_gdt(x86_tss_t &tss, cpuid_t cpuid)
|
|||
#else
|
||||
"mov %0, %%fs \n\t" // no tracebuffer
|
||||
#endif
|
||||
"pushq %3 \n\t" // new CS
|
||||
"xor %%rax, %%rax \n" //
|
||||
"lldt %%ax \n" // clear LDTR
|
||||
"pushq %3 \n\t" // new CS
|
||||
"pushq $1f \n\t" // new IP
|
||||
"lretq \n\t"
|
||||
"1: \n\t"
|
||||
: /* No Output */ : "r" (0), "r" (X86_UTCBS), "r" (X86_TBS), "r" ((u64_t) X86_KCS)
|
||||
: /* No Output */
|
||||
: "r" (0), "r" (X86_UTCBS), "r" (X86_TBS), "r" ((u64_t) X86_KCS)
|
||||
: "rax"
|
||||
);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue