Merge tag 'x86_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / arch / x86 / platform / efi / efi_thunk_64.S
index f2a8eec..25799d7 100644 (file)
@@ -36,6 +36,17 @@ SYM_CODE_START(__efi64_thunk)
        movq    efi_mixed_mode_stack_pa(%rip), %rsp
        push    %rax
 
+       /*
+        * Copy args passed via the stack
+        */
+       subq    $0x24, %rsp
+       movq    0x18(%rax), %rbp
+       movq    0x20(%rax), %rbx
+       movq    0x28(%rax), %rax
+       movl    %ebp, 0x18(%rsp)
+       movl    %ebx, 0x1c(%rsp)
+       movl    %eax, 0x20(%rsp)
+
        /*
         * Calculate the physical address of the kernel text.
         */
@@ -47,7 +58,6 @@ SYM_CODE_START(__efi64_thunk)
        subq    %rax, %rbp
        subq    %rax, %rbx
 
-       subq    $28, %rsp
        movl    %ebx, 0x0(%rsp)         /* return address */
        movl    %esi, 0x4(%rsp)
        movl    %edx, 0x8(%rsp)
@@ -60,7 +70,7 @@ SYM_CODE_START(__efi64_thunk)
        pushq   %rdi                    /* EFI runtime service address */
        lretq
 
-1:     movq    24(%rsp), %rsp
+1:     movq    0x20(%rsp), %rsp
        pop     %rbx
        pop     %rbp
        RET