diff --git a/src/system/kernel/Jamfile b/src/system/kernel/Jamfile index 3e405b859f..7964320883 100644 --- a/src/system/kernel/Jamfile +++ b/src/system/kernel/Jamfile @@ -75,21 +75,6 @@ KernelMergeObject kernel_core.o : : $(TARGET_KERNEL_PIC_CCFLAGS) ; -if $(HAIKU_GCC_VERSION_$(TARGET_PACKAGING_ARCH)[1]) >= 7 - && ( $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 ) { - # With the rtl-stv1 pass on these files, the kernel panics towards the end - # of the boot process with a "General Protection Exception", see - # https://dev.haiku-os.org/ticket/14160. The pass itself vectorizes - # a significant number of otherwise-scalar operations, which may be why - # disabling it fixes the problem. - # - # At time of writing, GCC does not seem to have a way to disable - # vectorization as a result of optimization without disabling - # FPU usage altogether, which of course is not what we want and - # breaks when using libstdc++'s headers anyway. - ObjectC++Flags commpage.o signal.o thread.o : -fdisable-rtl-stv1 ; -} - # Generate the header defining macros for C++ structure sizes. local kernelC++StructSizesHeader = [ FGristFiles kernel_c++_struct_sizes.h ] ; TARGET_HDRS_$(TARGET_PACKAGING_ARCH) on $(kernelC++StructSizesHeader) diff --git a/src/system/kernel/arch/x86/64/interrupts.S b/src/system/kernel/arch/x86/64/interrupts.S index 47d886934f..3672c1ca0b 100644 --- a/src/system/kernel/arch/x86/64/interrupts.S +++ b/src/system/kernel/arch/x86/64/interrupts.S @@ -343,6 +343,9 @@ FUNCTION(x86_64_syscall_entry): movq %rsp, %gs:ARCH_THREAD_user_rsp movq %gs:ARCH_THREAD_syscall_rsp, %rsp + // The following pushes de-align the stack by 8 bytes, so account for that first. + sub $8, %rsp + // Set up an iframe on the stack (R11 = saved RFLAGS, RCX = saved RIP). push $USER_DATA_SELECTOR // ss push %gs:ARCH_THREAD_user_rsp // rsp @@ -357,7 +360,6 @@ FUNCTION(x86_64_syscall_entry): // Frame pointer is the iframe. movq %rsp, %rbp - andq $~15, %rsp // Preserve call number (R14 is callee-save), get thread pointer. movq %rax, %r14