Skip to content

Commit

Permalink
parisc: Fix argument pointer in real64_call_asm()
Browse files Browse the repository at this point in the history
commit 6e3220b upstream.

Fix the argument pointer (ap) to point to real-mode memory
instead of virtual memory.

It's interesting that this issue hasn't shown up earlier, as this could
have happened with any 64-bit PDC ROM code.

I just noticed it because I suddenly faced a HPMC while trying to execute
the 64-bit STI ROM code of an Visualize-FXe graphics card for the STI
text console.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
hdeller authored and gregkh committed May 11, 2023
1 parent 756a535 commit 409042e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/parisc/kernel/real2.S
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,6 @@ ENTRY_CFI(real64_call_asm)
/* save fn */
copy %arg2, %r31

/* set up the new ap */
ldo 64(%arg1), %r29

/* load up the arg registers from the saved arg area */
/* 32-bit calling convention passes first 4 args in registers */
ldd 0*REG_SZ(%arg1), %arg0 /* note overwriting arg0 */
Expand All @@ -249,7 +246,9 @@ ENTRY_CFI(real64_call_asm)
ldd 7*REG_SZ(%arg1), %r19
ldd 1*REG_SZ(%arg1), %arg1 /* do this one last! */

/* set up real-mode stack and real-mode ap */
tophys_r1 %sp
ldo -16(%sp), %r29 /* Reference param save area */

b,l rfi_virt2real,%r2
nop
Expand Down

0 comments on commit 409042e

Please sign in to comment.