[SOLVED] VT-x and indirect jump cause triple fault
Posted: Thu Jan 11, 2018 12:02 pm
Hi there,
My kernel use a high half setup and every thing seem to work on qemu.
But when I try on a real hardware or on VirtualBox, the CPU reset with a triple fault.
A found that disabling VT-x in VirtualBox fix the issue.
The triple fault occure when I'm jumping into the high half part after enabling paging (as you can see below in AT&T syntax). The triple fault point the jmp instruction.
Any idea why it's happen ? I don't find any informations (but maybe I search in the wrong place) :/
My kernel use a high half setup and every thing seem to work on qemu.
But when I try on a real hardware or on VirtualBox, the CPU reset with a triple fault.
A found that disabling VT-x in VirtualBox fix the issue.
The triple fault occure when I'm jumping into the high half part after enabling paging (as you can see below in AT&T syntax). The triple fault point the jmp instruction.
Any idea why it's happen ? I don't find any informations (but maybe I search in the wrong place) :/
Code: Select all
/****** in the first section located at standard address (virt=phys) for grub *******/
_entry32:
/* Load GDT and clear segments registers */
lgdt GDT32_pointer
ljmp $0x8, $(.Lreset)
.Lreset:
mov $0x10, %edx
mov %edx, %ds
mov %edx, %es
mov %edx, %fs
mov %edx, %gs
mov %edx, %ss
/* Enable stack and reset EFLAGS */
mov $stack_top, %esp
mov %esp, %ebp
pushl $0
popf
/* Save multiboot informations */
push %ebx
push %eax
/* Do the paging initialization */
call init_kernel
/* Install page directory (in %eax because call return into it) */
mov %eax, %cr3
/* Enable paging */
mov %cr0, %eax
or $(1 << 31), %eax
mov %eax, %cr0
/* Jump far into the half-high kernel */
lea _high_entry, %eax
jmp *%eax /* <---------- TRIPLE FAULT with VT-x enabled in VirtualBox */
/****** in a different section linked in high virtual address space *******/
_high_entry:
call kernel_main
_halt:
.Lhang:
cli
hlt
jmp .Lhang