[PATCH] KVM: riscv: selftests: Implement kvm_arch_has_default_irqchip

Mayuresh Chitale posted 1 patch 2 months, 1 week ago
tools/testing/selftests/kvm/lib/riscv/processor.c | 5 +++++
1 file changed, 5 insertions(+)
[PATCH] KVM: riscv: selftests: Implement kvm_arch_has_default_irqchip
Posted by Mayuresh Chitale 2 months, 1 week ago
kvm_arch_has_default_irqchip is required for irqfd_test and returns
true if an in-kernel interrupt controller is supported.

Fixes: a133052666bed ("KVM: selftests: Fix irqfd_test for non-x86 architectures")
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
---
 tools/testing/selftests/kvm/lib/riscv/processor.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/kvm/lib/riscv/processor.c b/tools/testing/selftests/kvm/lib/riscv/processor.c
index 51dd455ff52c..067c6b2c15b0 100644
--- a/tools/testing/selftests/kvm/lib/riscv/processor.c
+++ b/tools/testing/selftests/kvm/lib/riscv/processor.c
@@ -566,3 +566,8 @@ unsigned long riscv64_get_satp_mode(void)
 
 	return val;
 }
+
+bool kvm_arch_has_default_irqchip(void)
+{
+	return kvm_check_cap(KVM_CAP_IRQCHIP);
+}
-- 
2.43.0
Re: [PATCH] KVM: riscv: selftests: Implement kvm_arch_has_default_irqchip
Posted by Anup Patel 2 months, 1 week ago
On Thu, Apr 2, 2026 at 3:53 PM Mayuresh Chitale
<mayuresh.chitale@oss.qualcomm.com> wrote:
>
> kvm_arch_has_default_irqchip is required for irqfd_test and returns
> true if an in-kernel interrupt controller is supported.
>
> Fixes: a133052666bed ("KVM: selftests: Fix irqfd_test for non-x86 architectures")
> Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>

Queued this patch for Linux-7.1

Thanks,
Anup

> ---
>  tools/testing/selftests/kvm/lib/riscv/processor.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/lib/riscv/processor.c b/tools/testing/selftests/kvm/lib/riscv/processor.c
> index 51dd455ff52c..067c6b2c15b0 100644
> --- a/tools/testing/selftests/kvm/lib/riscv/processor.c
> +++ b/tools/testing/selftests/kvm/lib/riscv/processor.c
> @@ -566,3 +566,8 @@ unsigned long riscv64_get_satp_mode(void)
>
>         return val;
>  }
> +
> +bool kvm_arch_has_default_irqchip(void)
> +{
> +       return kvm_check_cap(KVM_CAP_IRQCHIP);
> +}
> --
> 2.43.0
>
Re: [PATCH] KVM: riscv: selftests: Implement kvm_arch_has_default_irqchip
Posted by Anup Patel 2 months, 1 week ago
On Thu, Apr 2, 2026 at 3:53 PM Mayuresh Chitale
<mayuresh.chitale@oss.qualcomm.com> wrote:
>
> kvm_arch_has_default_irqchip is required for irqfd_test and returns
> true if an in-kernel interrupt controller is supported.
>
> Fixes: a133052666bed ("KVM: selftests: Fix irqfd_test for non-x86 architectures")
> Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>

LGTM.

Reviewed-by: Anup Patel <anup@brainfault.org>

Thanks,
Anup

> ---
>  tools/testing/selftests/kvm/lib/riscv/processor.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/lib/riscv/processor.c b/tools/testing/selftests/kvm/lib/riscv/processor.c
> index 51dd455ff52c..067c6b2c15b0 100644
> --- a/tools/testing/selftests/kvm/lib/riscv/processor.c
> +++ b/tools/testing/selftests/kvm/lib/riscv/processor.c
> @@ -566,3 +566,8 @@ unsigned long riscv64_get_satp_mode(void)
>
>         return val;
>  }
> +
> +bool kvm_arch_has_default_irqchip(void)
> +{
> +       return kvm_check_cap(KVM_CAP_IRQCHIP);
> +}
> --
> 2.43.0
>