mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] LoongArch: KVM: add a return kvm_own_lasx() stub
@ 2023-12-27  1:06 Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2023-12-27  1:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Bibo Mao, Tianrui Zhao, Huacai Chen, WANG Xuerui,
	kvm, loongarch, Stephen Rothwell

The stub for kvm_own_lasx() when CONFIG_CPU_HAS_LASX is not defined
should have a return value since it returns an int, so add
"return -EINVAL;" to the stub. Fixes the build error:

In file included from ../arch/loongarch/include/asm/kvm_csr.h:12,
                 from ../arch/loongarch/kvm/interrupt.c:8:
../arch/loongarch/include/asm/kvm_vcpu.h: In function 'kvm_own_lasx':
../arch/loongarch/include/asm/kvm_vcpu.h:73:39: error: no return statement in function returning non-void [-Werror=return-type]
   73 | static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }

Fixes: 118e10cd893d ("LoongArch: KVM: Add LASX (256bit SIMD) support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Tianrui Zhao <zhaotianrui@loongson.cn>
Cc: Huacai Chen <chenhuacai@loongson.cn>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: kvm@vger.kernel.org
Cc: loongarch@lists.linux.dev
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/loongarch/include/asm/kvm_vcpu.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/arch/loongarch/include/asm/kvm_vcpu.h b/arch/loongarch/include/asm/kvm_vcpu.h
--- a/arch/loongarch/include/asm/kvm_vcpu.h
+++ b/arch/loongarch/include/asm/kvm_vcpu.h
@@ -70,7 +70,7 @@ int kvm_own_lasx(struct kvm_vcpu *vcpu);
 void kvm_save_lasx(struct loongarch_fpu *fpu);
 void kvm_restore_lasx(struct loongarch_fpu *fpu);
 #else
-static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
+static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { return -EINVAL; }
 static inline void kvm_save_lasx(struct loongarch_fpu *fpu) { }
 static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { }
 #endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] LoongArch: KVM: add a return kvm_own_lasx() stub
  2023-12-27  1:11 ` Huacai Chen
@ 2023-12-27  1:15   ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2023-12-27  1:15 UTC (permalink / raw)
  To: Huacai Chen
  Cc: linux-kernel, Bibo Mao, Tianrui Zhao, Huacai Chen, WANG Xuerui,
	kvm, loongarch, Stephen Rothwell



On 12/26/23 17:11, Huacai Chen wrote:
> Hi, Randy,
> 
> Could you please fix kvm_own_lsx() together?
> 

Sure will. Thanks.

> Huacai
> 
> On Wed, Dec 27, 2023 at 9:07 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> The stub for kvm_own_lasx() when CONFIG_CPU_HAS_LASX is not defined
>> should have a return value since it returns an int, so add
>> "return -EINVAL;" to the stub. Fixes the build error:
>>
>> In file included from ../arch/loongarch/include/asm/kvm_csr.h:12,
>>                  from ../arch/loongarch/kvm/interrupt.c:8:
>> ../arch/loongarch/include/asm/kvm_vcpu.h: In function 'kvm_own_lasx':
>> ../arch/loongarch/include/asm/kvm_vcpu.h:73:39: error: no return statement in function returning non-void [-Werror=return-type]
>>    73 | static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
>>
>> Fixes: 118e10cd893d ("LoongArch: KVM: Add LASX (256bit SIMD) support")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Bibo Mao <maobibo@loongson.cn>
>> Cc: Tianrui Zhao <zhaotianrui@loongson.cn>
>> Cc: Huacai Chen <chenhuacai@loongson.cn>
>> Cc: WANG Xuerui <kernel@xen0n.name>
>> Cc: kvm@vger.kernel.org
>> Cc: loongarch@lists.linux.dev
>> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
>> ---


-- 
#Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] LoongArch: KVM: add a return kvm_own_lasx() stub
  2023-12-27  1:07 Randy Dunlap
@ 2023-12-27  1:11 ` Huacai Chen
  2023-12-27  1:15   ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Huacai Chen @ 2023-12-27  1:11 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Bibo Mao, Tianrui Zhao, Huacai Chen, WANG Xuerui,
	kvm, loongarch, Stephen Rothwell

Hi, Randy,

Could you please fix kvm_own_lsx() together?

Huacai

On Wed, Dec 27, 2023 at 9:07 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> The stub for kvm_own_lasx() when CONFIG_CPU_HAS_LASX is not defined
> should have a return value since it returns an int, so add
> "return -EINVAL;" to the stub. Fixes the build error:
>
> In file included from ../arch/loongarch/include/asm/kvm_csr.h:12,
>                  from ../arch/loongarch/kvm/interrupt.c:8:
> ../arch/loongarch/include/asm/kvm_vcpu.h: In function 'kvm_own_lasx':
> ../arch/loongarch/include/asm/kvm_vcpu.h:73:39: error: no return statement in function returning non-void [-Werror=return-type]
>    73 | static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
>
> Fixes: 118e10cd893d ("LoongArch: KVM: Add LASX (256bit SIMD) support")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Bibo Mao <maobibo@loongson.cn>
> Cc: Tianrui Zhao <zhaotianrui@loongson.cn>
> Cc: Huacai Chen <chenhuacai@loongson.cn>
> Cc: WANG Xuerui <kernel@xen0n.name>
> Cc: kvm@vger.kernel.org
> Cc: loongarch@lists.linux.dev
> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  arch/loongarch/include/asm/kvm_vcpu.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -- a/arch/loongarch/include/asm/kvm_vcpu.h b/arch/loongarch/include/asm/kvm_vcpu.h
> --- a/arch/loongarch/include/asm/kvm_vcpu.h
> +++ b/arch/loongarch/include/asm/kvm_vcpu.h
> @@ -70,7 +70,7 @@ int kvm_own_lasx(struct kvm_vcpu *vcpu);
>  void kvm_save_lasx(struct loongarch_fpu *fpu);
>  void kvm_restore_lasx(struct loongarch_fpu *fpu);
>  #else
> -static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
> +static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { return -EINVAL; }
>  static inline void kvm_save_lasx(struct loongarch_fpu *fpu) { }
>  static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { }
>  #endif
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] LoongArch: KVM: add a return kvm_own_lasx() stub
@ 2023-12-27  1:07 Randy Dunlap
  2023-12-27  1:11 ` Huacai Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2023-12-27  1:07 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Bibo Mao, Tianrui Zhao, Huacai Chen, WANG Xuerui,
	kvm, loongarch, Stephen Rothwell

The stub for kvm_own_lasx() when CONFIG_CPU_HAS_LASX is not defined
should have a return value since it returns an int, so add
"return -EINVAL;" to the stub. Fixes the build error:

In file included from ../arch/loongarch/include/asm/kvm_csr.h:12,
                 from ../arch/loongarch/kvm/interrupt.c:8:
../arch/loongarch/include/asm/kvm_vcpu.h: In function 'kvm_own_lasx':
../arch/loongarch/include/asm/kvm_vcpu.h:73:39: error: no return statement in function returning non-void [-Werror=return-type]
   73 | static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }

Fixes: 118e10cd893d ("LoongArch: KVM: Add LASX (256bit SIMD) support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Tianrui Zhao <zhaotianrui@loongson.cn>
Cc: Huacai Chen <chenhuacai@loongson.cn>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: kvm@vger.kernel.org
Cc: loongarch@lists.linux.dev
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/loongarch/include/asm/kvm_vcpu.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/arch/loongarch/include/asm/kvm_vcpu.h b/arch/loongarch/include/asm/kvm_vcpu.h
--- a/arch/loongarch/include/asm/kvm_vcpu.h
+++ b/arch/loongarch/include/asm/kvm_vcpu.h
@@ -70,7 +70,7 @@ int kvm_own_lasx(struct kvm_vcpu *vcpu);
 void kvm_save_lasx(struct loongarch_fpu *fpu);
 void kvm_restore_lasx(struct loongarch_fpu *fpu);
 #else
-static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
+static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { return -EINVAL; }
 static inline void kvm_save_lasx(struct loongarch_fpu *fpu) { }
 static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { }
 #endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-27  1:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27  1:06 [PATCH] LoongArch: KVM: add a return kvm_own_lasx() stub Randy Dunlap
2023-12-27  1:07 Randy Dunlap
2023-12-27  1:11 ` Huacai Chen
2023-12-27  1:15   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®