From e37576440d15a847008915cd97227e07f45173d4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 30 Jun 2021 13:09:18 +0200 Subject: Kernel: Fix stack alignment on x86_64 These were already properly aligned (as far as I can tell). --- Kernel/Arch/x86/common/Interrupts.cpp | 6 ++---- Kernel/Arch/x86/x86_64/InterruptEntry.cpp | 6 ++---- Kernel/Syscall.cpp | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) (limited to 'Kernel') diff --git a/Kernel/Arch/x86/common/Interrupts.cpp b/Kernel/Arch/x86/common/Interrupts.cpp index 445e923be0..5ddc6ed487 100644 --- a/Kernel/Arch/x86/common/Interrupts.cpp +++ b/Kernel/Arch/x86/common/Interrupts.cpp @@ -152,13 +152,11 @@ asm( \ " pushq %rdi\n" \ " pushq %rsp \n" /* set TrapFrame::regs */ \ " subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n" \ - " subq $0x8, %rsp\n" /* align stack */ \ - " lea 0x8(%rsp), %rdi \n" \ + " movq %rsp, %rdi \n" \ " cld\n" \ " call enter_trap_no_irq \n" \ - " lea 0x8(%rsp), %rdi \n" \ + " movq %rsp, %rdi \n" \ " call " #title "_handler\n" \ - " addq $0x8, %rsp\n" /* undo alignment */\ " jmp common_trap_exit \n"); #endif diff --git a/Kernel/Arch/x86/x86_64/InterruptEntry.cpp b/Kernel/Arch/x86/x86_64/InterruptEntry.cpp index 4e1277b154..4426edbb24 100644 --- a/Kernel/Arch/x86/x86_64/InterruptEntry.cpp +++ b/Kernel/Arch/x86/x86_64/InterruptEntry.cpp @@ -38,13 +38,11 @@ asm( " pushq %rdi\n" " pushq %rsp \n" /* set TrapFrame::regs */ " subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n" - " subq $0x8, %rsp\n" /* align stack */ - " lea 0x8(%rsp), %rdi \n" + " movq %rsp, %rdi \n" " cld\n" " call enter_trap \n" - " lea 0x8(%rsp), %rdi \n" + " movq %rsp, %rdi \n" " call handle_interrupt \n" - " addq $0x8, %rsp\n" /* undo alignment */ ".globl common_trap_exit \n" "common_trap_exit: \n" // another thread may have handled this trap at this point, so don't diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index d316af2dd3..74075d8542 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -74,13 +74,11 @@ NEVER_INLINE void syscall_asm_entry_dummy() " pushq %rdi\n" " pushq %rsp \n" /* set TrapFrame::regs */ " subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n" - " subq $0x8, %rsp\n" /* align stack */ - " lea 0x8(%rsp), %rdi \n" + " movq %rsp, %rdi \n" " cld\n" " call enter_trap_no_irq \n" - " lea 0x8(%rsp), %rdi \n" + " movq %rsp, %rdi \n" " call syscall_handler\n" - " addq $0x8, %rsp\n" /* undo alignment */ " jmp common_trap_exit \n"); #endif // clang-format on -- cgit v1.2.3