powerpc64/pseries: Fix hypervisor call with extra arguments

Some hypervisor calls, such as H_SEND_LOGICAL_LAN, take more arguments than
are traditionally passed in registers.  The HCALL ABI will accept these
arguments in r11 and r12.  With ELFv2 ABI, these arguments are 2
double-words lower than ELFv1 ABI, as two double-words in the stack frame
are no longer used, and therefore removed from the frame.  Fix the offsets
for loading the registers for the HCALL.  This fixes the phyp_llan driver
with ELFv2 kernel.

Submitted by:	alfredo.junior_eldorado.org.br
Differential Revision:	https://reviews.freebsd.org/D20008
This commit is contained in:
Justin Hibbits 2019-04-23 03:05:26 +00:00
parent 89a0487c97
commit ba5189f7be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346589

View File

@ -36,8 +36,13 @@
ASENTRY(phyp_hcall)
mflr %r0
std %r0,16(%r1)
#if defined(_CALL_ELF) && _CALL_ELF == 2
ld %r11,96(%r1) /* Last couple args into volatile regs*/
ld %r12,104(%r1)
#else
ld %r11,112(%r1) /* Last couple args into volatile regs*/
ld %r12,120(%r1)
#endif
hc /* invoke the hypervisor */
ld %r0,16(%r1)
mtlr %r0