Skip to content

Commit

Permalink
LoongArch: KVM: Fix unknown register name 'v0' in asm
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 27, 2024
1 parent f90d958 commit ad1b9eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/loongarch/include/asm/kvm_para.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand All @@ -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;

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit ad1b9eb

Please sign in to comment.