Re: [PATCH] KVM: Loongarch: Remove undefined a6 argument comment for kvm_hypercall

From: maobibo
Date: Fri Jul 26 2024 - 02:50:53 EST




On 2024/7/26 下午2:32, Huacai Chen wrote:
On Fri, Jul 26, 2024 at 11:35 AM maobibo <maobibo@xxxxxxxxxxx> wrote:



On 2024/7/26 上午10:55, Huacai Chen wrote:
On Fri, Jul 26, 2024 at 9:49 AM maobibo <maobibo@xxxxxxxxxxx> wrote:



On 2024/7/25 下午9:48, Dandan Zhang wrote:
The kvm_hypercall set for LoongArch is limited to a1-a5.
The mention of a6 in the comment is undefined that needs to be rectified.

Signed-off-by: Wentao Guan <guanwentao@xxxxxxxxxxxxx>
Signed-off-by: Dandan Zhang <zhangdandan@xxxxxxxxxxxxx>
---
arch/loongarch/include/asm/kvm_para.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/loongarch/include/asm/kvm_para.h b/arch/loongarch/include/asm/kvm_para.h
index 335fb86778e2..43ec61589e6c 100644
--- a/arch/loongarch/include/asm/kvm_para.h
+++ b/arch/loongarch/include/asm/kvm_para.h
@@ -39,9 +39,9 @@ struct kvm_steal_time {
* Hypercall interface for KVM hypervisor
*
* a0: function identifier
- * a1-a6: args
+ * a1-a5: args
* Return value will be placed in a0.
- * Up to 6 arguments are passed in a1, a2, a3, a4, a5, a6.
+ * Up to 5 arguments are passed in a1, a2, a3, a4, a5.
*/
static __always_inline long kvm_hypercall0(u64 fid)
{


Dandan,

Nice catch. In future hypercall abi may expand such as the number of
input register and output register, or async hypercall function if there
is really such requirement.

Anyway the modification is deserved and it is enough to use now, thanks
for doing it.

Reviewed-by: Bibo Mao <maobibo@xxxxxxxxxxx>
Maybe it is better to implement kvm_hypercall6() than remove a6 now?
That is one option also. The main reason is that there is no such
requirement in near future :(, I prefer to removing the annotation and
keeping it clean.
I don't like removing something and then adding it back again, so if
kvm_hypercall6() is needed in future, it is better to add it now.
I do not see the requirement by now.

At the same time I just suggest you care about LoongArch kernel and catch up the gap, just go forward rather than go around. Is it responsibility of maintainer to catch future direction?

Thanks for merging LoongArch KVM code at beginning, and I think I can merge LoongArch kvm kernel to KVM tree directly just like KVM x86/ARM64/RISCV.

Regards
Bibo


Huacai

Regards
Bibo Mao

Huacai