Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: KVM: include missing hwcap.h into vcpu_fp
@ 2022-04-08  9:24 Heiko Stuebner
  2022-04-09  3:51 ` Anup Patel
  0 siblings, 1 reply; 2+ messages in thread
From: Heiko Stuebner @ 2022-04-08  9:24 UTC (permalink / raw)
  To: anup, atishp
  Cc: paul.walmsley, palmer, aou, kvm, kvm-riscv, linux-riscv,
	linux-kernel, Heiko Stuebner

vcpu_fp uses the riscv_isa_extension mechanism which gets
defined in hwcap.h but doesn't include that head file.

While it seems to work in most cases, in certain conditions
this can lead to build failures like

../arch/riscv/kvm/vcpu_fp.c: In function ‘kvm_riscv_vcpu_fp_reset’:
../arch/riscv/kvm/vcpu_fp.c:22:13: error: implicit declaration of function ‘riscv_isa_extension_available’ [-Werror=implicit-function-declaration]
   22 |         if (riscv_isa_extension_available(&isa, f) ||
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../arch/riscv/kvm/vcpu_fp.c:22:49: error: ‘f’ undeclared (first use in this function)
   22 |         if (riscv_isa_extension_available(&isa, f) ||

Fix this by simply including the necessary header.

Fixes: 0a86512dc113 ("RISC-V: KVM: Factor-out FP virtualization into separate sources")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/riscv/kvm/vcpu_fp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/kvm/vcpu_fp.c b/arch/riscv/kvm/vcpu_fp.c
index 4449a976e5a6..d4308c512007 100644
--- a/arch/riscv/kvm/vcpu_fp.c
+++ b/arch/riscv/kvm/vcpu_fp.c
@@ -11,6 +11,7 @@
 #include <linux/err.h>
 #include <linux/kvm_host.h>
 #include <linux/uaccess.h>
+#include <asm/hwcap.h>
 
 #ifdef CONFIG_FPU
 void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu *vcpu)
-- 
2.35.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] RISC-V: KVM: include missing hwcap.h into vcpu_fp
  2022-04-08  9:24 [PATCH] RISC-V: KVM: include missing hwcap.h into vcpu_fp Heiko Stuebner
@ 2022-04-09  3:51 ` Anup Patel
  0 siblings, 0 replies; 2+ messages in thread
From: Anup Patel @ 2022-04-09  3:51 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Atish Patra, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	KVM General,
	open list:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv),
	linux-riscv, linux-kernel@vger.kernel.org List

On Fri, Apr 8, 2022 at 2:54 PM Heiko Stuebner <heiko@sntech.de> wrote:
>
> vcpu_fp uses the riscv_isa_extension mechanism which gets
> defined in hwcap.h but doesn't include that head file.
>
> While it seems to work in most cases, in certain conditions
> this can lead to build failures like
>
> ../arch/riscv/kvm/vcpu_fp.c: In function ‘kvm_riscv_vcpu_fp_reset’:
> ../arch/riscv/kvm/vcpu_fp.c:22:13: error: implicit declaration of function ‘riscv_isa_extension_available’ [-Werror=implicit-function-declaration]
>    22 |         if (riscv_isa_extension_available(&isa, f) ||
>       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../arch/riscv/kvm/vcpu_fp.c:22:49: error: ‘f’ undeclared (first use in this function)
>    22 |         if (riscv_isa_extension_available(&isa, f) ||
>
> Fix this by simply including the necessary header.
>
> Fixes: 0a86512dc113 ("RISC-V: KVM: Factor-out FP virtualization into separate sources")
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>

I have queued this for RC fixes.

Thanks,
Anup

> ---
>  arch/riscv/kvm/vcpu_fp.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/kvm/vcpu_fp.c b/arch/riscv/kvm/vcpu_fp.c
> index 4449a976e5a6..d4308c512007 100644
> --- a/arch/riscv/kvm/vcpu_fp.c
> +++ b/arch/riscv/kvm/vcpu_fp.c
> @@ -11,6 +11,7 @@
>  #include <linux/err.h>
>  #include <linux/kvm_host.h>
>  #include <linux/uaccess.h>
> +#include <asm/hwcap.h>
>
>  #ifdef CONFIG_FPU
>  void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu *vcpu)
> --
> 2.35.1
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2022-04-09  3:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-08  9:24 [PATCH] RISC-V: KVM: include missing hwcap.h into vcpu_fp Heiko Stuebner
2022-04-09  3:51 ` Anup Patel

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