From ad1b9eb8042363b68e1391a02c785b200cde1702 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Wed, 27 Nov 2024 15:59:00 +0800 Subject: [PATCH] LoongArch: KVM: Fix unknown register name 'v0' in asm According to KVM documention for LoongArch, 'v0' should be 'a0'. And 'a0' has been there upstream. Fix follow compile errors with clang-19: In file included from ./include/uapi/linux/kvm_para.h:41: ./arch/loongarch/include/asm/kvm_para.h:44:24: error: unknown register name 'v0' in asm 44 | register long ret asm("v0"); | ^ ./arch/loongarch/include/asm/kvm_para.h:59:24: error: unknown register name 'v0' in asm 59 | register long ret asm("v0"); | ^ ./arch/loongarch/include/asm/kvm_para.h:76:24: error: unknown register name 'v0' in asm 76 | register long ret asm("v0"); | ^ ./arch/loongarch/include/asm/kvm_para.h:94:24: error: unknown register name 'v0' in asm 94 | register long ret asm("v0"); | ^ ./arch/loongarch/include/asm/kvm_para.h:114:24: error: unknown register name 'v0' in asm 114 | register long ret asm("v0"); | ^ ./arch/loongarch/include/asm/kvm_para.h:135:24: error: unknown register name 'v0' in asm 135 | register long ret asm("v0"); | ^ 6 errors generated. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e33bda7ee50c3c20d80f5ca6dc5ca2cd37863518 Signed-off-by: Mingcong Bai Signed-off-by: WangYuli --- arch/loongarch/include/asm/kvm_para.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/loongarch/include/asm/kvm_para.h b/arch/loongarch/include/asm/kvm_para.h index f2c4fa8deba4..3b45564b76f9 100644 --- a/arch/loongarch/include/asm/kvm_para.h +++ b/arch/loongarch/include/asm/kvm_para.h @@ -41,7 +41,7 @@ struct kvm_steal_time { */ static __always_inline long kvm_hypercall(u64 fid) { - register long ret asm("v0"); + register long ret asm("a0"); register unsigned long fun asm("a0") = fid; __asm__ __volatile__( @@ -56,7 +56,7 @@ static __always_inline long kvm_hypercall(u64 fid) static __always_inline long kvm_hypercall1(u64 fid, unsigned long arg0) { - register long ret asm("v0"); + register long ret asm("a0"); register unsigned long fun asm("a0") = fid; register unsigned long a1 asm("a1") = arg0; @@ -73,7 +73,7 @@ static __always_inline long kvm_hypercall1(u64 fid, unsigned long arg0) static __always_inline long kvm_hypercall2(u64 fid, unsigned long arg0, unsigned long arg1) { - register long ret asm("v0"); + register long ret asm("a0"); register unsigned long fun asm("a0") = fid; register unsigned long a1 asm("a1") = arg0; register unsigned long a2 asm("a2") = arg1; @@ -91,7 +91,7 @@ static __always_inline long kvm_hypercall2(u64 fid, static __always_inline long kvm_hypercall3(u64 fid, unsigned long arg0, unsigned long arg1, unsigned long arg2) { - register long ret asm("v0"); + register long ret asm("a0"); register unsigned long fun asm("a0") = fid; register unsigned long a1 asm("a1") = arg0; register unsigned long a2 asm("a2") = arg1; @@ -111,7 +111,7 @@ static __always_inline long kvm_hypercall4(u64 fid, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3) { - register long ret asm("v0"); + register long ret asm("a0"); register unsigned long fun asm("a0") = fid; register unsigned long a1 asm("a1") = arg0; register unsigned long a2 asm("a2") = arg1; @@ -132,7 +132,7 @@ static __always_inline long kvm_hypercall5(u64 fid, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4) { - register long ret asm("v0"); + register long ret asm("a0"); register unsigned long fun asm("a0") = fid; register unsigned long a1 asm("a1") = arg0; register unsigned long a2 asm("a2") = arg1;