Re: [PATCH v2 03/11] arm64: gunyah: Add Gunyah hypercalls ABI

From
Dmitry Baryshkov <hidden>
Date
2022-08-04 07:05:15
Also in
linux-arm-msm, linux-devicetree, linux-doc
Reply to
Elliot Berman, 2022-08-03
On Thu, 4 Aug 2022 at 00:15, Elliot Berman [off-list ref] wrote:
Hi Dmitry,

On 8/2/2022 6:34 AM, Dmitry Baryshkov wrote:
quoted
On 02/08/2022 00:12, Elliot Berman wrote:
quoted
Add initial support to perform Gunyah hypercalls. The arm64 ABI for
Gunyah hypercalls generally follows the SMC Calling Convention.
Seeing a c&p (or c&rework) from arm-smccc.h, could you please describe:

1) Why can't you use the existing arm_smccc_1_1_hvc()? I checked, you
don't seem to be getting more than 4 values back.
The Gunyah APIs can return up to 8 values. As you observed though, these
initial patches are only using the first 4 values back. I'd like to use
the larger v1.2 so I don't need to update later.
I'd suggest following the hyperv example here. It uses arm_smccc_1_1
when possible and 1_2 only when required. Note, that if you are using
the 1_2 call all the times, you are somewhat wasting the cpu cycles by
always copying x0...x17 instead of just x0...x3.
quoted
2) If #1 is not possible, why can't you add necessary glue code to the
arm-smccc.h (as your code to support nargs/multiple return values is
generic enough) and use corresponding macro in asm/gunyah.h ?
I think the code here may be considered Gunyah-specific as I am limiting
to 8 arguments and return values. If I add to arm-smccc.h, I would need
to expand out to x17. Does it make sense to add another SMCCC 1.2
interface to arm-smccc.h?
You do not need to handle 8 arguments at this moment, until the moment
you really need this code, I'd suggest postponing this change. And
when you need it, having the generic code is better than having the
gh-specific code.


-- 
With best wishes
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (49 messages) 49 messages, 9 authors, last reply 2022-08-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help