Re: [PATCH v7 7/7] Documentation: KVM: Add hypercall for LoongArch

From: maobibo
Date: Mon Apr 01 2024 - 21:16:11 EST




On 2024/3/24 上午2:40, WANG Xuerui wrote:
On 3/15/24 16:11, Bibo Mao wrote:
[snip]
+KVM hypercall ABI
+=================
+
+Hypercall ABI on KVM is simple, only one scratch register a0 and at most
+five generic registers used as input parameter. FP register and vector register
+is not used for input register and should not be modified during hypercall.
+Hypercall function can be inlined since there is only one scratch register.

Maybe it's better to describe the list of preserved registers with an expression such as "all non-GPR registers shall remain unmodified after returning from the hypercall", to guard ourselves against future ISA state additions.
Sorry, I do not understand. What is the meaning of "all non-GPR registers"? Can you give an example?

Regards
Bibo Mao

But I still maintain that it's better to promise less here, and only hint on the extensive preservation of context as an implementation detail. It is for not losing our ability to save/restore less in the future, should we decide to do so.