All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-10-03 23:57 ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-03 23:57 UTC (permalink / raw)
  To: kvm
  Cc: Alexey Kardashevskiy, linux-arm-kernel, kvmarm, kvm-riscv,
	Paolo Bonzini, Anup Patel, kvm-ppc, Nicholas Piggin,
	Marc Zyngier

When introduced, IRQFD resampling worked on POWER8 with XICS. However
KVM on POWER9 has never implemented it - the compatibility mode code
("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
XIVE mode does not handle INTx in KVM at all.

This moved the capability support advertising to platforms and stops
advertising it on XIVE, i.e. POWER9 and later.

This should cause no behavioural change for other architectures.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Marc Zyngier <maz@kernel.org>
---
Changes:
v4:
* removed incorrect clause about changing behavoir on MIPS and RISCV

v3:
* removed all ifdeferry
* removed the capability for MIPS and RISCV
* adjusted the commit log about MIPS and RISCV

v2:
* removed ifdef for ARM64.
---
 arch/arm64/kvm/arm.c       | 1 +
 arch/powerpc/kvm/powerpc.c | 6 ++++++
 arch/s390/kvm/kvm-s390.c   | 1 +
 arch/x86/kvm/x86.c         | 1 +
 virt/kvm/kvm_main.c        | 1 -
 5 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 2ff0ef62abad..d2daa4d375b5 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VCPU_ATTRIBUTES:
 	case KVM_CAP_PTP_KVM:
 	case KVM_CAP_ARM_SYSTEM_SUSPEND:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index fb1490761c87..908ce8bd91c9 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		break;
 #endif
 
+#ifdef CONFIG_HAVE_KVM_IRQFD
+	case KVM_CAP_IRQFD_RESAMPLE:
+		r = !xive_enabled();
+		break;
+#endif
+
 	case KVM_CAP_PPC_ALLOC_HTAB:
 		r = hv_enabled;
 		break;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index edfd4bbd0cba..7521adadb81b 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_SET_GUEST_DEBUG:
 	case KVM_CAP_S390_DIAG318:
 	case KVM_CAP_S390_MEM_OP_EXTENSION:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 43a6a7efc6ec..2d6c5a8fdf14 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VAPIC:
 	case KVM_CAP_ENABLE_CAP:
 	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_EXIT_HYPERCALL:
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 584a5bab3af3..05cf94013f02 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
 #endif
 #ifdef CONFIG_HAVE_KVM_IRQFD
 	case KVM_CAP_IRQFD:
-	case KVM_CAP_IRQFD_RESAMPLE:
 #endif
 	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
 	case KVM_CAP_CHECK_EXTENSION_VM:
-- 
2.37.3


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

* [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-10-03 23:57 ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-03 23:57 UTC (permalink / raw)
  To: kvm
  Cc: Alexey Kardashevskiy, kvm-ppc, Nicholas Piggin, kvm-riscv,
	Marc Zyngier, Paolo Bonzini, kvmarm, linux-arm-kernel

When introduced, IRQFD resampling worked on POWER8 with XICS. However
KVM on POWER9 has never implemented it - the compatibility mode code
("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
XIVE mode does not handle INTx in KVM at all.

This moved the capability support advertising to platforms and stops
advertising it on XIVE, i.e. POWER9 and later.

This should cause no behavioural change for other architectures.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Marc Zyngier <maz@kernel.org>
---
Changes:
v4:
* removed incorrect clause about changing behavoir on MIPS and RISCV

v3:
* removed all ifdeferry
* removed the capability for MIPS and RISCV
* adjusted the commit log about MIPS and RISCV

v2:
* removed ifdef for ARM64.
---
 arch/arm64/kvm/arm.c       | 1 +
 arch/powerpc/kvm/powerpc.c | 6 ++++++
 arch/s390/kvm/kvm-s390.c   | 1 +
 arch/x86/kvm/x86.c         | 1 +
 virt/kvm/kvm_main.c        | 1 -
 5 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 2ff0ef62abad..d2daa4d375b5 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VCPU_ATTRIBUTES:
 	case KVM_CAP_PTP_KVM:
 	case KVM_CAP_ARM_SYSTEM_SUSPEND:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index fb1490761c87..908ce8bd91c9 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		break;
 #endif
 
+#ifdef CONFIG_HAVE_KVM_IRQFD
+	case KVM_CAP_IRQFD_RESAMPLE:
+		r = !xive_enabled();
+		break;
+#endif
+
 	case KVM_CAP_PPC_ALLOC_HTAB:
 		r = hv_enabled;
 		break;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index edfd4bbd0cba..7521adadb81b 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_SET_GUEST_DEBUG:
 	case KVM_CAP_S390_DIAG318:
 	case KVM_CAP_S390_MEM_OP_EXTENSION:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 43a6a7efc6ec..2d6c5a8fdf14 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VAPIC:
 	case KVM_CAP_ENABLE_CAP:
 	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_EXIT_HYPERCALL:
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 584a5bab3af3..05cf94013f02 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
 #endif
 #ifdef CONFIG_HAVE_KVM_IRQFD
 	case KVM_CAP_IRQFD:
-	case KVM_CAP_IRQFD_RESAMPLE:
 #endif
 	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
 	case KVM_CAP_CHECK_EXTENSION_VM:
-- 
2.37.3

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-10-03 23:57 ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-03 23:57 UTC (permalink / raw)
  To: kvm
  Cc: Alexey Kardashevskiy, linux-arm-kernel, kvmarm, kvm-riscv,
	Paolo Bonzini, Anup Patel, kvm-ppc, Nicholas Piggin,
	Marc Zyngier

When introduced, IRQFD resampling worked on POWER8 with XICS. However
KVM on POWER9 has never implemented it - the compatibility mode code
("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
XIVE mode does not handle INTx in KVM at all.

This moved the capability support advertising to platforms and stops
advertising it on XIVE, i.e. POWER9 and later.

This should cause no behavioural change for other architectures.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Marc Zyngier <maz@kernel.org>
---
Changes:
v4:
* removed incorrect clause about changing behavoir on MIPS and RISCV

v3:
* removed all ifdeferry
* removed the capability for MIPS and RISCV
* adjusted the commit log about MIPS and RISCV

v2:
* removed ifdef for ARM64.
---
 arch/arm64/kvm/arm.c       | 1 +
 arch/powerpc/kvm/powerpc.c | 6 ++++++
 arch/s390/kvm/kvm-s390.c   | 1 +
 arch/x86/kvm/x86.c         | 1 +
 virt/kvm/kvm_main.c        | 1 -
 5 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 2ff0ef62abad..d2daa4d375b5 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VCPU_ATTRIBUTES:
 	case KVM_CAP_PTP_KVM:
 	case KVM_CAP_ARM_SYSTEM_SUSPEND:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index fb1490761c87..908ce8bd91c9 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		break;
 #endif
 
+#ifdef CONFIG_HAVE_KVM_IRQFD
+	case KVM_CAP_IRQFD_RESAMPLE:
+		r = !xive_enabled();
+		break;
+#endif
+
 	case KVM_CAP_PPC_ALLOC_HTAB:
 		r = hv_enabled;
 		break;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index edfd4bbd0cba..7521adadb81b 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_SET_GUEST_DEBUG:
 	case KVM_CAP_S390_DIAG318:
 	case KVM_CAP_S390_MEM_OP_EXTENSION:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 43a6a7efc6ec..2d6c5a8fdf14 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VAPIC:
 	case KVM_CAP_ENABLE_CAP:
 	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_EXIT_HYPERCALL:
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 584a5bab3af3..05cf94013f02 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
 #endif
 #ifdef CONFIG_HAVE_KVM_IRQFD
 	case KVM_CAP_IRQFD:
-	case KVM_CAP_IRQFD_RESAMPLE:
 #endif
 	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
 	case KVM_CAP_CHECK_EXTENSION_VM:
-- 
2.37.3


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

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

* [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-10-03 23:57 ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-03 23:57 UTC (permalink / raw)
  To: kvm
  Cc: Alexey Kardashevskiy, linux-arm-kernel, kvmarm, kvm-riscv,
	Paolo Bonzini, Anup Patel, kvm-ppc, Nicholas Piggin,
	Marc Zyngier

When introduced, IRQFD resampling worked on POWER8 with XICS. However
KVM on POWER9 has never implemented it - the compatibility mode code
("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
XIVE mode does not handle INTx in KVM at all.

This moved the capability support advertising to platforms and stops
advertising it on XIVE, i.e. POWER9 and later.

This should cause no behavioural change for other architectures.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Marc Zyngier <maz@kernel.org>
---
Changes:
v4:
* removed incorrect clause about changing behavoir on MIPS and RISCV

v3:
* removed all ifdeferry
* removed the capability for MIPS and RISCV
* adjusted the commit log about MIPS and RISCV

v2:
* removed ifdef for ARM64.
---
 arch/arm64/kvm/arm.c       | 1 +
 arch/powerpc/kvm/powerpc.c | 6 ++++++
 arch/s390/kvm/kvm-s390.c   | 1 +
 arch/x86/kvm/x86.c         | 1 +
 virt/kvm/kvm_main.c        | 1 -
 5 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 2ff0ef62abad..d2daa4d375b5 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VCPU_ATTRIBUTES:
 	case KVM_CAP_PTP_KVM:
 	case KVM_CAP_ARM_SYSTEM_SUSPEND:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index fb1490761c87..908ce8bd91c9 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		break;
 #endif
 
+#ifdef CONFIG_HAVE_KVM_IRQFD
+	case KVM_CAP_IRQFD_RESAMPLE:
+		r = !xive_enabled();
+		break;
+#endif
+
 	case KVM_CAP_PPC_ALLOC_HTAB:
 		r = hv_enabled;
 		break;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index edfd4bbd0cba..7521adadb81b 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_SET_GUEST_DEBUG:
 	case KVM_CAP_S390_DIAG318:
 	case KVM_CAP_S390_MEM_OP_EXTENSION:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_SET_GUEST_DEBUG2:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 43a6a7efc6ec..2d6c5a8fdf14 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_VAPIC:
 	case KVM_CAP_ENABLE_CAP:
 	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
+	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
 	case KVM_CAP_EXIT_HYPERCALL:
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 584a5bab3af3..05cf94013f02 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
 #endif
 #ifdef CONFIG_HAVE_KVM_IRQFD
 	case KVM_CAP_IRQFD:
-	case KVM_CAP_IRQFD_RESAMPLE:
 #endif
 	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
 	case KVM_CAP_CHECK_EXTENSION_VM:
-- 
2.37.3

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2022-10-03 23:57 ` Alexey Kardashevskiy
  (?)
  (?)
@ 2022-10-27  7:38   ` Alexey Kardashevskiy
  -1 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-27  7:38 UTC (permalink / raw)
  To: kvm
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini, Anup Patel,
	kvm-ppc, Nicholas Piggin, Marc Zyngier

Paolo, ping?


On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
> When introduced, IRQFD resampling worked on POWER8 with XICS. However
> KVM on POWER9 has never implemented it - the compatibility mode code
> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> XIVE mode does not handle INTx in KVM at all.
> 
> This moved the capability support advertising to platforms and stops
> advertising it on XIVE, i.e. POWER9 and later.
> 
> This should cause no behavioural change for other architectures.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---
> Changes:
> v4:
> * removed incorrect clause about changing behavoir on MIPS and RISCV
> 
> v3:
> * removed all ifdeferry
> * removed the capability for MIPS and RISCV
> * adjusted the commit log about MIPS and RISCV
> 
> v2:
> * removed ifdef for ARM64.
> ---
>   arch/arm64/kvm/arm.c       | 1 +
>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>   arch/s390/kvm/kvm-s390.c   | 1 +
>   arch/x86/kvm/x86.c         | 1 +
>   virt/kvm/kvm_main.c        | 1 -
>   5 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 2ff0ef62abad..d2daa4d375b5 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VCPU_ATTRIBUTES:
>   	case KVM_CAP_PTP_KVM:
>   	case KVM_CAP_ARM_SYSTEM_SUSPEND:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index fb1490761c87..908ce8bd91c9 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   		break;
>   #endif
>   
> +#ifdef CONFIG_HAVE_KVM_IRQFD
> +	case KVM_CAP_IRQFD_RESAMPLE:
> +		r = !xive_enabled();
> +		break;
> +#endif
> +
>   	case KVM_CAP_PPC_ALLOC_HTAB:
>   		r = hv_enabled;
>   		break;
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index edfd4bbd0cba..7521adadb81b 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_SET_GUEST_DEBUG:
>   	case KVM_CAP_S390_DIAG318:
>   	case KVM_CAP_S390_MEM_OP_EXTENSION:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 43a6a7efc6ec..2d6c5a8fdf14 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VAPIC:
>   	case KVM_CAP_ENABLE_CAP:
>   	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_EXIT_HYPERCALL:
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 584a5bab3af3..05cf94013f02 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>   #endif
>   #ifdef CONFIG_HAVE_KVM_IRQFD
>   	case KVM_CAP_IRQFD:
> -	case KVM_CAP_IRQFD_RESAMPLE:
>   #endif
>   	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>   	case KVM_CAP_CHECK_EXTENSION_VM:

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-10-27  7:38   ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-27  7:38 UTC (permalink / raw)
  To: kvm
  Cc: kvm-ppc, Nicholas Piggin, kvm-riscv, Marc Zyngier, Paolo Bonzini,
	kvmarm, linux-arm-kernel

Paolo, ping?


On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
> When introduced, IRQFD resampling worked on POWER8 with XICS. However
> KVM on POWER9 has never implemented it - the compatibility mode code
> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> XIVE mode does not handle INTx in KVM at all.
> 
> This moved the capability support advertising to platforms and stops
> advertising it on XIVE, i.e. POWER9 and later.
> 
> This should cause no behavioural change for other architectures.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---
> Changes:
> v4:
> * removed incorrect clause about changing behavoir on MIPS and RISCV
> 
> v3:
> * removed all ifdeferry
> * removed the capability for MIPS and RISCV
> * adjusted the commit log about MIPS and RISCV
> 
> v2:
> * removed ifdef for ARM64.
> ---
>   arch/arm64/kvm/arm.c       | 1 +
>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>   arch/s390/kvm/kvm-s390.c   | 1 +
>   arch/x86/kvm/x86.c         | 1 +
>   virt/kvm/kvm_main.c        | 1 -
>   5 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 2ff0ef62abad..d2daa4d375b5 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VCPU_ATTRIBUTES:
>   	case KVM_CAP_PTP_KVM:
>   	case KVM_CAP_ARM_SYSTEM_SUSPEND:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index fb1490761c87..908ce8bd91c9 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   		break;
>   #endif
>   
> +#ifdef CONFIG_HAVE_KVM_IRQFD
> +	case KVM_CAP_IRQFD_RESAMPLE:
> +		r = !xive_enabled();
> +		break;
> +#endif
> +
>   	case KVM_CAP_PPC_ALLOC_HTAB:
>   		r = hv_enabled;
>   		break;
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index edfd4bbd0cba..7521adadb81b 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_SET_GUEST_DEBUG:
>   	case KVM_CAP_S390_DIAG318:
>   	case KVM_CAP_S390_MEM_OP_EXTENSION:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 43a6a7efc6ec..2d6c5a8fdf14 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VAPIC:
>   	case KVM_CAP_ENABLE_CAP:
>   	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_EXIT_HYPERCALL:
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 584a5bab3af3..05cf94013f02 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>   #endif
>   #ifdef CONFIG_HAVE_KVM_IRQFD
>   	case KVM_CAP_IRQFD:
> -	case KVM_CAP_IRQFD_RESAMPLE:
>   #endif
>   	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>   	case KVM_CAP_CHECK_EXTENSION_VM:

-- 
Alexey
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-10-27  7:38   ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-27  7:38 UTC (permalink / raw)
  To: kvm
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini, Anup Patel,
	kvm-ppc, Nicholas Piggin, Marc Zyngier

Paolo, ping?


On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
> When introduced, IRQFD resampling worked on POWER8 with XICS. However
> KVM on POWER9 has never implemented it - the compatibility mode code
> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> XIVE mode does not handle INTx in KVM at all.
> 
> This moved the capability support advertising to platforms and stops
> advertising it on XIVE, i.e. POWER9 and later.
> 
> This should cause no behavioural change for other architectures.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---
> Changes:
> v4:
> * removed incorrect clause about changing behavoir on MIPS and RISCV
> 
> v3:
> * removed all ifdeferry
> * removed the capability for MIPS and RISCV
> * adjusted the commit log about MIPS and RISCV
> 
> v2:
> * removed ifdef for ARM64.
> ---
>   arch/arm64/kvm/arm.c       | 1 +
>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>   arch/s390/kvm/kvm-s390.c   | 1 +
>   arch/x86/kvm/x86.c         | 1 +
>   virt/kvm/kvm_main.c        | 1 -
>   5 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 2ff0ef62abad..d2daa4d375b5 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VCPU_ATTRIBUTES:
>   	case KVM_CAP_PTP_KVM:
>   	case KVM_CAP_ARM_SYSTEM_SUSPEND:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index fb1490761c87..908ce8bd91c9 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   		break;
>   #endif
>   
> +#ifdef CONFIG_HAVE_KVM_IRQFD
> +	case KVM_CAP_IRQFD_RESAMPLE:
> +		r = !xive_enabled();
> +		break;
> +#endif
> +
>   	case KVM_CAP_PPC_ALLOC_HTAB:
>   		r = hv_enabled;
>   		break;
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index edfd4bbd0cba..7521adadb81b 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_SET_GUEST_DEBUG:
>   	case KVM_CAP_S390_DIAG318:
>   	case KVM_CAP_S390_MEM_OP_EXTENSION:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 43a6a7efc6ec..2d6c5a8fdf14 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VAPIC:
>   	case KVM_CAP_ENABLE_CAP:
>   	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_EXIT_HYPERCALL:
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 584a5bab3af3..05cf94013f02 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>   #endif
>   #ifdef CONFIG_HAVE_KVM_IRQFD
>   	case KVM_CAP_IRQFD:
> -	case KVM_CAP_IRQFD_RESAMPLE:
>   #endif
>   	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>   	case KVM_CAP_CHECK_EXTENSION_VM:

-- 
Alexey

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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-10-27  7:38   ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-10-27  7:38 UTC (permalink / raw)
  To: kvm
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini, Anup Patel,
	kvm-ppc, Nicholas Piggin, Marc Zyngier

Paolo, ping?


On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
> When introduced, IRQFD resampling worked on POWER8 with XICS. However
> KVM on POWER9 has never implemented it - the compatibility mode code
> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> XIVE mode does not handle INTx in KVM at all.
> 
> This moved the capability support advertising to platforms and stops
> advertising it on XIVE, i.e. POWER9 and later.
> 
> This should cause no behavioural change for other architectures.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---
> Changes:
> v4:
> * removed incorrect clause about changing behavoir on MIPS and RISCV
> 
> v3:
> * removed all ifdeferry
> * removed the capability for MIPS and RISCV
> * adjusted the commit log about MIPS and RISCV
> 
> v2:
> * removed ifdef for ARM64.
> ---
>   arch/arm64/kvm/arm.c       | 1 +
>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>   arch/s390/kvm/kvm-s390.c   | 1 +
>   arch/x86/kvm/x86.c         | 1 +
>   virt/kvm/kvm_main.c        | 1 -
>   5 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 2ff0ef62abad..d2daa4d375b5 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VCPU_ATTRIBUTES:
>   	case KVM_CAP_PTP_KVM:
>   	case KVM_CAP_ARM_SYSTEM_SUSPEND:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index fb1490761c87..908ce8bd91c9 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   		break;
>   #endif
>   
> +#ifdef CONFIG_HAVE_KVM_IRQFD
> +	case KVM_CAP_IRQFD_RESAMPLE:
> +		r = !xive_enabled();
> +		break;
> +#endif
> +
>   	case KVM_CAP_PPC_ALLOC_HTAB:
>   		r = hv_enabled;
>   		break;
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index edfd4bbd0cba..7521adadb81b 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_SET_GUEST_DEBUG:
>   	case KVM_CAP_S390_DIAG318:
>   	case KVM_CAP_S390_MEM_OP_EXTENSION:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_SET_GUEST_DEBUG2:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 43a6a7efc6ec..2d6c5a8fdf14 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>   	case KVM_CAP_VAPIC:
>   	case KVM_CAP_ENABLE_CAP:
>   	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
> +	case KVM_CAP_IRQFD_RESAMPLE:
>   		r = 1;
>   		break;
>   	case KVM_CAP_EXIT_HYPERCALL:
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 584a5bab3af3..05cf94013f02 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>   #endif
>   #ifdef CONFIG_HAVE_KVM_IRQFD
>   	case KVM_CAP_IRQFD:
> -	case KVM_CAP_IRQFD_RESAMPLE:
>   #endif
>   	case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>   	case KVM_CAP_CHECK_EXTENSION_VM:

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2022-10-27  7:38   ` Alexey Kardashevskiy
  (?)
  (?)
@ 2022-12-06  4:39     ` Alexey Kardashevskiy
  -1 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-12-06  4:39 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kvm, kvm-ppc, Nicholas Piggin, kvm-riscv, Marc Zyngier, kvmarm,
	linux-arm-kernel

Paolo, ping? :)


On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
> Paolo, ping?
> 
> 
> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>> KVM on POWER9 has never implemented it - the compatibility mode code
>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>> XIVE mode does not handle INTx in KVM at all.
>>
>> This moved the capability support advertising to platforms and stops
>> advertising it on XIVE, i.e. POWER9 and later.
>>
>> This should cause no behavioural change for other architectures.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>> Acked-by: Marc Zyngier <maz@kernel.org>
>> ---
>> Changes:
>> v4:
>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>
>> v3:
>> * removed all ifdeferry
>> * removed the capability for MIPS and RISCV
>> * adjusted the commit log about MIPS and RISCV
>>
>> v2:
>> * removed ifdef for ARM64.
>> ---
>>   arch/arm64/kvm/arm.c       | 1 +
>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>   arch/x86/kvm/x86.c         | 1 +
>>   virt/kvm/kvm_main.c        | 1 -
>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>> index 2ff0ef62abad..d2daa4d375b5 100644
>> --- a/arch/arm64/kvm/arm.c
>> +++ b/arch/arm64/kvm/arm.c
>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>       case KVM_CAP_PTP_KVM:
>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> index fb1490761c87..908ce8bd91c9 100644
>> --- a/arch/powerpc/kvm/powerpc.c
>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>           break;
>>   #endif
>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>> +        r = !xive_enabled();
>> +        break;
>> +#endif
>> +
>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>           r = hv_enabled;
>>           break;
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index edfd4bbd0cba..7521adadb81b 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_SET_GUEST_DEBUG:
>>       case KVM_CAP_S390_DIAG318:
>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>> *kvm, long ext)
>>       case KVM_CAP_VAPIC:
>>       case KVM_CAP_ENABLE_CAP:
>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_EXIT_HYPERCALL:
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 584a5bab3af3..05cf94013f02 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -4447,7 +4447,6 @@ static long 
>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>   #endif
>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>       case KVM_CAP_IRQFD:
>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>   #endif
>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>       case KVM_CAP_CHECK_EXTENSION_VM:
> 

-- 
Alexey
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-12-06  4:39     ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-12-06  4:39 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Paolo, ping? :)


On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
> Paolo, ping?
> 
> 
> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>> KVM on POWER9 has never implemented it - the compatibility mode code
>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>> XIVE mode does not handle INTx in KVM at all.
>>
>> This moved the capability support advertising to platforms and stops
>> advertising it on XIVE, i.e. POWER9 and later.
>>
>> This should cause no behavioural change for other architectures.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>> Acked-by: Marc Zyngier <maz@kernel.org>
>> ---
>> Changes:
>> v4:
>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>
>> v3:
>> * removed all ifdeferry
>> * removed the capability for MIPS and RISCV
>> * adjusted the commit log about MIPS and RISCV
>>
>> v2:
>> * removed ifdef for ARM64.
>> ---
>>   arch/arm64/kvm/arm.c       | 1 +
>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>   arch/x86/kvm/x86.c         | 1 +
>>   virt/kvm/kvm_main.c        | 1 -
>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>> index 2ff0ef62abad..d2daa4d375b5 100644
>> --- a/arch/arm64/kvm/arm.c
>> +++ b/arch/arm64/kvm/arm.c
>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>       case KVM_CAP_PTP_KVM:
>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> index fb1490761c87..908ce8bd91c9 100644
>> --- a/arch/powerpc/kvm/powerpc.c
>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>           break;
>>   #endif
>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>> +        r = !xive_enabled();
>> +        break;
>> +#endif
>> +
>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>           r = hv_enabled;
>>           break;
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index edfd4bbd0cba..7521adadb81b 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_SET_GUEST_DEBUG:
>>       case KVM_CAP_S390_DIAG318:
>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>> *kvm, long ext)
>>       case KVM_CAP_VAPIC:
>>       case KVM_CAP_ENABLE_CAP:
>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_EXIT_HYPERCALL:
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 584a5bab3af3..05cf94013f02 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -4447,7 +4447,6 @@ static long 
>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>   #endif
>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>       case KVM_CAP_IRQFD:
>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>   #endif
>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>       case KVM_CAP_CHECK_EXTENSION_VM:
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-12-06  4:39     ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-12-06  4:39 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Paolo, ping? :)


On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
> Paolo, ping?
> 
> 
> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>> KVM on POWER9 has never implemented it - the compatibility mode code
>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>> XIVE mode does not handle INTx in KVM at all.
>>
>> This moved the capability support advertising to platforms and stops
>> advertising it on XIVE, i.e. POWER9 and later.
>>
>> This should cause no behavioural change for other architectures.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>> Acked-by: Marc Zyngier <maz@kernel.org>
>> ---
>> Changes:
>> v4:
>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>
>> v3:
>> * removed all ifdeferry
>> * removed the capability for MIPS and RISCV
>> * adjusted the commit log about MIPS and RISCV
>>
>> v2:
>> * removed ifdef for ARM64.
>> ---
>>   arch/arm64/kvm/arm.c       | 1 +
>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>   arch/x86/kvm/x86.c         | 1 +
>>   virt/kvm/kvm_main.c        | 1 -
>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>> index 2ff0ef62abad..d2daa4d375b5 100644
>> --- a/arch/arm64/kvm/arm.c
>> +++ b/arch/arm64/kvm/arm.c
>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>       case KVM_CAP_PTP_KVM:
>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> index fb1490761c87..908ce8bd91c9 100644
>> --- a/arch/powerpc/kvm/powerpc.c
>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>           break;
>>   #endif
>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>> +        r = !xive_enabled();
>> +        break;
>> +#endif
>> +
>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>           r = hv_enabled;
>>           break;
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index edfd4bbd0cba..7521adadb81b 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_SET_GUEST_DEBUG:
>>       case KVM_CAP_S390_DIAG318:
>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>> *kvm, long ext)
>>       case KVM_CAP_VAPIC:
>>       case KVM_CAP_ENABLE_CAP:
>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_EXIT_HYPERCALL:
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 584a5bab3af3..05cf94013f02 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -4447,7 +4447,6 @@ static long 
>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>   #endif
>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>       case KVM_CAP_IRQFD:
>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>   #endif
>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>       case KVM_CAP_CHECK_EXTENSION_VM:
> 

-- 
Alexey

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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2022-12-06  4:39     ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2022-12-06  4:39 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kvm, kvm-ppc, Nicholas Piggin, kvm-riscv, Marc Zyngier, kvmarm,
	linux-arm-kernel

Paolo, ping? :)


On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
> Paolo, ping?
> 
> 
> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>> KVM on POWER9 has never implemented it - the compatibility mode code
>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>> XIVE mode does not handle INTx in KVM at all.
>>
>> This moved the capability support advertising to platforms and stops
>> advertising it on XIVE, i.e. POWER9 and later.
>>
>> This should cause no behavioural change for other architectures.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>> Acked-by: Marc Zyngier <maz@kernel.org>
>> ---
>> Changes:
>> v4:
>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>
>> v3:
>> * removed all ifdeferry
>> * removed the capability for MIPS and RISCV
>> * adjusted the commit log about MIPS and RISCV
>>
>> v2:
>> * removed ifdef for ARM64.
>> ---
>>   arch/arm64/kvm/arm.c       | 1 +
>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>   arch/x86/kvm/x86.c         | 1 +
>>   virt/kvm/kvm_main.c        | 1 -
>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>> index 2ff0ef62abad..d2daa4d375b5 100644
>> --- a/arch/arm64/kvm/arm.c
>> +++ b/arch/arm64/kvm/arm.c
>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>       case KVM_CAP_PTP_KVM:
>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> index fb1490761c87..908ce8bd91c9 100644
>> --- a/arch/powerpc/kvm/powerpc.c
>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>           break;
>>   #endif
>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>> +        r = !xive_enabled();
>> +        break;
>> +#endif
>> +
>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>           r = hv_enabled;
>>           break;
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index edfd4bbd0cba..7521adadb81b 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>> long ext)
>>       case KVM_CAP_SET_GUEST_DEBUG:
>>       case KVM_CAP_S390_DIAG318:
>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_SET_GUEST_DEBUG2:
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>> *kvm, long ext)
>>       case KVM_CAP_VAPIC:
>>       case KVM_CAP_ENABLE_CAP:
>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>           r = 1;
>>           break;
>>       case KVM_CAP_EXIT_HYPERCALL:
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 584a5bab3af3..05cf94013f02 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -4447,7 +4447,6 @@ static long 
>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>   #endif
>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>       case KVM_CAP_IRQFD:
>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>   #endif
>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>       case KVM_CAP_CHECK_EXTENSION_VM:
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2022-12-06  4:39     ` Alexey Kardashevskiy
  (?)
  (?)
@ 2023-01-02  0:43       ` Alexey Kardashevskiy
  -1 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-01-02  0:43 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Paolo, ping?


On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
> Paolo, ping? :)
> 
> 
> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>> Paolo, ping?
>>
>>
>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>> XIVE mode does not handle INTx in KVM at all.
>>>
>>> This moved the capability support advertising to platforms and stops
>>> advertising it on XIVE, i.e. POWER9 and later.
>>>
>>> This should cause no behavioural change for other architectures.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>> ---
>>> Changes:
>>> v4:
>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>
>>> v3:
>>> * removed all ifdeferry
>>> * removed the capability for MIPS and RISCV
>>> * adjusted the commit log about MIPS and RISCV
>>>
>>> v2:
>>> * removed ifdef for ARM64.
>>> ---
>>>   arch/arm64/kvm/arm.c       | 1 +
>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>   arch/x86/kvm/x86.c         | 1 +
>>>   virt/kvm/kvm_main.c        | 1 -
>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>> --- a/arch/arm64/kvm/arm.c
>>> +++ b/arch/arm64/kvm/arm.c
>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>       case KVM_CAP_PTP_KVM:
>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>> index fb1490761c87..908ce8bd91c9 100644
>>> --- a/arch/powerpc/kvm/powerpc.c
>>> +++ b/arch/powerpc/kvm/powerpc.c
>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>           break;
>>>   #endif
>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>> +        r = !xive_enabled();
>>> +        break;
>>> +#endif
>>> +
>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>           r = hv_enabled;
>>>           break;
>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>> index edfd4bbd0cba..7521adadb81b 100644
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>       case KVM_CAP_S390_DIAG318:
>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>> --- a/arch/x86/kvm/x86.c
>>> +++ b/arch/x86/kvm/x86.c
>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>       case KVM_CAP_VAPIC:
>>>       case KVM_CAP_ENABLE_CAP:
>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_EXIT_HYPERCALL:
>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>> index 584a5bab3af3..05cf94013f02 100644
>>> --- a/virt/kvm/kvm_main.c
>>> +++ b/virt/kvm/kvm_main.c
>>> @@ -4447,7 +4447,6 @@ static long 
>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>   #endif
>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>       case KVM_CAP_IRQFD:
>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>   #endif
>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-01-02  0:43       ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-01-02  0:43 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kvm, kvm-ppc, Nicholas Piggin, kvm-riscv, Marc Zyngier, kvmarm,
	linux-arm-kernel

Paolo, ping?


On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
> Paolo, ping? :)
> 
> 
> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>> Paolo, ping?
>>
>>
>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>> XIVE mode does not handle INTx in KVM at all.
>>>
>>> This moved the capability support advertising to platforms and stops
>>> advertising it on XIVE, i.e. POWER9 and later.
>>>
>>> This should cause no behavioural change for other architectures.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>> ---
>>> Changes:
>>> v4:
>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>
>>> v3:
>>> * removed all ifdeferry
>>> * removed the capability for MIPS and RISCV
>>> * adjusted the commit log about MIPS and RISCV
>>>
>>> v2:
>>> * removed ifdef for ARM64.
>>> ---
>>>   arch/arm64/kvm/arm.c       | 1 +
>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>   arch/x86/kvm/x86.c         | 1 +
>>>   virt/kvm/kvm_main.c        | 1 -
>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>> --- a/arch/arm64/kvm/arm.c
>>> +++ b/arch/arm64/kvm/arm.c
>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>       case KVM_CAP_PTP_KVM:
>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>> index fb1490761c87..908ce8bd91c9 100644
>>> --- a/arch/powerpc/kvm/powerpc.c
>>> +++ b/arch/powerpc/kvm/powerpc.c
>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>           break;
>>>   #endif
>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>> +        r = !xive_enabled();
>>> +        break;
>>> +#endif
>>> +
>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>           r = hv_enabled;
>>>           break;
>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>> index edfd4bbd0cba..7521adadb81b 100644
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>       case KVM_CAP_S390_DIAG318:
>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>> --- a/arch/x86/kvm/x86.c
>>> +++ b/arch/x86/kvm/x86.c
>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>       case KVM_CAP_VAPIC:
>>>       case KVM_CAP_ENABLE_CAP:
>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_EXIT_HYPERCALL:
>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>> index 584a5bab3af3..05cf94013f02 100644
>>> --- a/virt/kvm/kvm_main.c
>>> +++ b/virt/kvm/kvm_main.c
>>> @@ -4447,7 +4447,6 @@ static long 
>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>   #endif
>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>       case KVM_CAP_IRQFD:
>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>   #endif
>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>
> 

-- 
Alexey
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-01-02  0:43       ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-01-02  0:43 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Paolo, ping?


On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
> Paolo, ping? :)
> 
> 
> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>> Paolo, ping?
>>
>>
>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>> XIVE mode does not handle INTx in KVM at all.
>>>
>>> This moved the capability support advertising to platforms and stops
>>> advertising it on XIVE, i.e. POWER9 and later.
>>>
>>> This should cause no behavioural change for other architectures.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>> ---
>>> Changes:
>>> v4:
>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>
>>> v3:
>>> * removed all ifdeferry
>>> * removed the capability for MIPS and RISCV
>>> * adjusted the commit log about MIPS and RISCV
>>>
>>> v2:
>>> * removed ifdef for ARM64.
>>> ---
>>>   arch/arm64/kvm/arm.c       | 1 +
>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>   arch/x86/kvm/x86.c         | 1 +
>>>   virt/kvm/kvm_main.c        | 1 -
>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>> --- a/arch/arm64/kvm/arm.c
>>> +++ b/arch/arm64/kvm/arm.c
>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>       case KVM_CAP_PTP_KVM:
>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>> index fb1490761c87..908ce8bd91c9 100644
>>> --- a/arch/powerpc/kvm/powerpc.c
>>> +++ b/arch/powerpc/kvm/powerpc.c
>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>           break;
>>>   #endif
>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>> +        r = !xive_enabled();
>>> +        break;
>>> +#endif
>>> +
>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>           r = hv_enabled;
>>>           break;
>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>> index edfd4bbd0cba..7521adadb81b 100644
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>       case KVM_CAP_S390_DIAG318:
>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>> --- a/arch/x86/kvm/x86.c
>>> +++ b/arch/x86/kvm/x86.c
>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>       case KVM_CAP_VAPIC:
>>>       case KVM_CAP_ENABLE_CAP:
>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_EXIT_HYPERCALL:
>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>> index 584a5bab3af3..05cf94013f02 100644
>>> --- a/virt/kvm/kvm_main.c
>>> +++ b/virt/kvm/kvm_main.c
>>> @@ -4447,7 +4447,6 @@ static long 
>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>   #endif
>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>       case KVM_CAP_IRQFD:
>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>   #endif
>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>
> 

-- 
Alexey

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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-01-02  0:43       ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-01-02  0:43 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Paolo, ping?


On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
> Paolo, ping? :)
> 
> 
> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>> Paolo, ping?
>>
>>
>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>> XIVE mode does not handle INTx in KVM at all.
>>>
>>> This moved the capability support advertising to platforms and stops
>>> advertising it on XIVE, i.e. POWER9 and later.
>>>
>>> This should cause no behavioural change for other architectures.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>> ---
>>> Changes:
>>> v4:
>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>
>>> v3:
>>> * removed all ifdeferry
>>> * removed the capability for MIPS and RISCV
>>> * adjusted the commit log about MIPS and RISCV
>>>
>>> v2:
>>> * removed ifdef for ARM64.
>>> ---
>>>   arch/arm64/kvm/arm.c       | 1 +
>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>   arch/x86/kvm/x86.c         | 1 +
>>>   virt/kvm/kvm_main.c        | 1 -
>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>> --- a/arch/arm64/kvm/arm.c
>>> +++ b/arch/arm64/kvm/arm.c
>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>       case KVM_CAP_PTP_KVM:
>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>> index fb1490761c87..908ce8bd91c9 100644
>>> --- a/arch/powerpc/kvm/powerpc.c
>>> +++ b/arch/powerpc/kvm/powerpc.c
>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>           break;
>>>   #endif
>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>> +        r = !xive_enabled();
>>> +        break;
>>> +#endif
>>> +
>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>           r = hv_enabled;
>>>           break;
>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>> index edfd4bbd0cba..7521adadb81b 100644
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, 
>>> long ext)
>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>       case KVM_CAP_S390_DIAG318:
>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>> --- a/arch/x86/kvm/x86.c
>>> +++ b/arch/x86/kvm/x86.c
>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>> *kvm, long ext)
>>>       case KVM_CAP_VAPIC:
>>>       case KVM_CAP_ENABLE_CAP:
>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>           r = 1;
>>>           break;
>>>       case KVM_CAP_EXIT_HYPERCALL:
>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>> index 584a5bab3af3..05cf94013f02 100644
>>> --- a/virt/kvm/kvm_main.c
>>> +++ b/virt/kvm/kvm_main.c
>>> @@ -4447,7 +4447,6 @@ static long 
>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>   #endif
>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>       case KVM_CAP_IRQFD:
>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>   #endif
>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2023-01-02  0:43       ` Alexey Kardashevskiy
  (?)
@ 2023-02-28  6:17         ` Alexey Kardashevskiy
  -1 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-02-28  6:17 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Anyone, ping?

On 02/01/2023 11:43, Alexey Kardashevskiy wrote:
> Paolo, ping?
> 
> 
> On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
>> Paolo, ping? :)
>>
>>
>> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>>> Paolo, ping?
>>>
>>>
>>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>>> XIVE mode does not handle INTx in KVM at all.
>>>>
>>>> This moved the capability support advertising to platforms and stops
>>>> advertising it on XIVE, i.e. POWER9 and later.
>>>>
>>>> This should cause no behavioural change for other architectures.
>>>>
>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>>> ---
>>>> Changes:
>>>> v4:
>>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>>
>>>> v3:
>>>> * removed all ifdeferry
>>>> * removed the capability for MIPS and RISCV
>>>> * adjusted the commit log about MIPS and RISCV
>>>>
>>>> v2:
>>>> * removed ifdef for ARM64.
>>>> ---
>>>>   arch/arm64/kvm/arm.c       | 1 +
>>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>>   arch/x86/kvm/x86.c         | 1 +
>>>>   virt/kvm/kvm_main.c        | 1 -
>>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>>> --- a/arch/arm64/kvm/arm.c
>>>> +++ b/arch/arm64/kvm/arm.c
>>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>>       case KVM_CAP_PTP_KVM:
>>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>> index fb1490761c87..908ce8bd91c9 100644
>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>           break;
>>>>   #endif
>>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>> +        r = !xive_enabled();
>>>> +        break;
>>>> +#endif
>>>> +
>>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>>           r = hv_enabled;
>>>>           break;
>>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>>> index edfd4bbd0cba..7521adadb81b 100644
>>>> --- a/arch/s390/kvm/kvm-s390.c
>>>> +++ b/arch/s390/kvm/kvm-s390.c
>>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>>       case KVM_CAP_S390_DIAG318:
>>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>>> --- a/arch/x86/kvm/x86.c
>>>> +++ b/arch/x86/kvm/x86.c
>>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_VAPIC:
>>>>       case KVM_CAP_ENABLE_CAP:
>>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_EXIT_HYPERCALL:
>>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>>> index 584a5bab3af3..05cf94013f02 100644
>>>> --- a/virt/kvm/kvm_main.c
>>>> +++ b/virt/kvm/kvm_main.c
>>>> @@ -4447,7 +4447,6 @@ static long 
>>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>>   #endif
>>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>>       case KVM_CAP_IRQFD:
>>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>>   #endif
>>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>>
>>
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-02-28  6:17         ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-02-28  6:17 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Anyone, ping?

On 02/01/2023 11:43, Alexey Kardashevskiy wrote:
> Paolo, ping?
> 
> 
> On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
>> Paolo, ping? :)
>>
>>
>> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>>> Paolo, ping?
>>>
>>>
>>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>>> XIVE mode does not handle INTx in KVM at all.
>>>>
>>>> This moved the capability support advertising to platforms and stops
>>>> advertising it on XIVE, i.e. POWER9 and later.
>>>>
>>>> This should cause no behavioural change for other architectures.
>>>>
>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>>> ---
>>>> Changes:
>>>> v4:
>>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>>
>>>> v3:
>>>> * removed all ifdeferry
>>>> * removed the capability for MIPS and RISCV
>>>> * adjusted the commit log about MIPS and RISCV
>>>>
>>>> v2:
>>>> * removed ifdef for ARM64.
>>>> ---
>>>>   arch/arm64/kvm/arm.c       | 1 +
>>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>>   arch/x86/kvm/x86.c         | 1 +
>>>>   virt/kvm/kvm_main.c        | 1 -
>>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>>> --- a/arch/arm64/kvm/arm.c
>>>> +++ b/arch/arm64/kvm/arm.c
>>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>>       case KVM_CAP_PTP_KVM:
>>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>> index fb1490761c87..908ce8bd91c9 100644
>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>           break;
>>>>   #endif
>>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>> +        r = !xive_enabled();
>>>> +        break;
>>>> +#endif
>>>> +
>>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>>           r = hv_enabled;
>>>>           break;
>>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>>> index edfd4bbd0cba..7521adadb81b 100644
>>>> --- a/arch/s390/kvm/kvm-s390.c
>>>> +++ b/arch/s390/kvm/kvm-s390.c
>>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>>       case KVM_CAP_S390_DIAG318:
>>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>>> --- a/arch/x86/kvm/x86.c
>>>> +++ b/arch/x86/kvm/x86.c
>>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_VAPIC:
>>>>       case KVM_CAP_ENABLE_CAP:
>>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_EXIT_HYPERCALL:
>>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>>> index 584a5bab3af3..05cf94013f02 100644
>>>> --- a/virt/kvm/kvm_main.c
>>>> +++ b/virt/kvm/kvm_main.c
>>>> @@ -4447,7 +4447,6 @@ static long 
>>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>>   #endif
>>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>>       case KVM_CAP_IRQFD:
>>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>>   #endif
>>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>>
>>
> 

-- 
Alexey

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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-02-28  6:17         ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-02-28  6:17 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier, kvm

Anyone, ping?

On 02/01/2023 11:43, Alexey Kardashevskiy wrote:
> Paolo, ping?
> 
> 
> On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
>> Paolo, ping? :)
>>
>>
>> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>>> Paolo, ping?
>>>
>>>
>>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>>> XIVE mode does not handle INTx in KVM at all.
>>>>
>>>> This moved the capability support advertising to platforms and stops
>>>> advertising it on XIVE, i.e. POWER9 and later.
>>>>
>>>> This should cause no behavioural change for other architectures.
>>>>
>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>>> ---
>>>> Changes:
>>>> v4:
>>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>>
>>>> v3:
>>>> * removed all ifdeferry
>>>> * removed the capability for MIPS and RISCV
>>>> * adjusted the commit log about MIPS and RISCV
>>>>
>>>> v2:
>>>> * removed ifdef for ARM64.
>>>> ---
>>>>   arch/arm64/kvm/arm.c       | 1 +
>>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>>   arch/x86/kvm/x86.c         | 1 +
>>>>   virt/kvm/kvm_main.c        | 1 -
>>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>>> --- a/arch/arm64/kvm/arm.c
>>>> +++ b/arch/arm64/kvm/arm.c
>>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>>       case KVM_CAP_PTP_KVM:
>>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>> index fb1490761c87..908ce8bd91c9 100644
>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>           break;
>>>>   #endif
>>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>> +        r = !xive_enabled();
>>>> +        break;
>>>> +#endif
>>>> +
>>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>>           r = hv_enabled;
>>>>           break;
>>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>>> index edfd4bbd0cba..7521adadb81b 100644
>>>> --- a/arch/s390/kvm/kvm-s390.c
>>>> +++ b/arch/s390/kvm/kvm-s390.c
>>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>>       case KVM_CAP_S390_DIAG318:
>>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>>> --- a/arch/x86/kvm/x86.c
>>>> +++ b/arch/x86/kvm/x86.c
>>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>> *kvm, long ext)
>>>>       case KVM_CAP_VAPIC:
>>>>       case KVM_CAP_ENABLE_CAP:
>>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>           r = 1;
>>>>           break;
>>>>       case KVM_CAP_EXIT_HYPERCALL:
>>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>>> index 584a5bab3af3..05cf94013f02 100644
>>>> --- a/virt/kvm/kvm_main.c
>>>> +++ b/virt/kvm/kvm_main.c
>>>> @@ -4447,7 +4447,6 @@ static long 
>>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>>   #endif
>>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>>       case KVM_CAP_IRQFD:
>>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>>   #endif
>>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>>
>>
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2023-02-28  6:17         ` Alexey Kardashevskiy
  (?)
@ 2023-03-07  0:24           ` Alexey Kardashevskiy
  -1 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-03-07  0:24 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Paolo Bonzini, Nicholas Piggin, Marc Zyngier, kvm

Sean, can you help please with this? Thanks,


On 28/02/2023 17:17, Alexey Kardashevskiy wrote:
> Anyone, ping?
> 
> On 02/01/2023 11:43, Alexey Kardashevskiy wrote:
>> Paolo, ping?
>>
>>
>> On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
>>> Paolo, ping? :)
>>>
>>>
>>> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>>>> Paolo, ping?
>>>>
>>>>
>>>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>>>> XIVE mode does not handle INTx in KVM at all.
>>>>>
>>>>> This moved the capability support advertising to platforms and stops
>>>>> advertising it on XIVE, i.e. POWER9 and later.
>>>>>
>>>>> This should cause no behavioural change for other architectures.
>>>>>
>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>>>> ---
>>>>> Changes:
>>>>> v4:
>>>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>>>
>>>>> v3:
>>>>> * removed all ifdeferry
>>>>> * removed the capability for MIPS and RISCV
>>>>> * adjusted the commit log about MIPS and RISCV
>>>>>
>>>>> v2:
>>>>> * removed ifdef for ARM64.
>>>>> ---
>>>>>   arch/arm64/kvm/arm.c       | 1 +
>>>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>>>   arch/x86/kvm/x86.c         | 1 +
>>>>>   virt/kvm/kvm_main.c        | 1 -
>>>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>>>> --- a/arch/arm64/kvm/arm.c
>>>>> +++ b/arch/arm64/kvm/arm.c
>>>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>>>       case KVM_CAP_PTP_KVM:
>>>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>>> index fb1490761c87..908ce8bd91c9 100644
>>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>           break;
>>>>>   #endif
>>>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>> +        r = !xive_enabled();
>>>>> +        break;
>>>>> +#endif
>>>>> +
>>>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>>>           r = hv_enabled;
>>>>>           break;
>>>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>>>> index edfd4bbd0cba..7521adadb81b 100644
>>>>> --- a/arch/s390/kvm/kvm-s390.c
>>>>> +++ b/arch/s390/kvm/kvm-s390.c
>>>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>>>       case KVM_CAP_S390_DIAG318:
>>>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>>>> --- a/arch/x86/kvm/x86.c
>>>>> +++ b/arch/x86/kvm/x86.c
>>>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_VAPIC:
>>>>>       case KVM_CAP_ENABLE_CAP:
>>>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_EXIT_HYPERCALL:
>>>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>>>> index 584a5bab3af3..05cf94013f02 100644
>>>>> --- a/virt/kvm/kvm_main.c
>>>>> +++ b/virt/kvm/kvm_main.c
>>>>> @@ -4447,7 +4447,6 @@ static long 
>>>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>>>   #endif
>>>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>>>       case KVM_CAP_IRQFD:
>>>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>   #endif
>>>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>>>
>>>
>>
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-07  0:24           ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-03-07  0:24 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Paolo Bonzini, Nicholas Piggin, Marc Zyngier, kvm

Sean, can you help please with this? Thanks,


On 28/02/2023 17:17, Alexey Kardashevskiy wrote:
> Anyone, ping?
> 
> On 02/01/2023 11:43, Alexey Kardashevskiy wrote:
>> Paolo, ping?
>>
>>
>> On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
>>> Paolo, ping? :)
>>>
>>>
>>> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>>>> Paolo, ping?
>>>>
>>>>
>>>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>>>> XIVE mode does not handle INTx in KVM at all.
>>>>>
>>>>> This moved the capability support advertising to platforms and stops
>>>>> advertising it on XIVE, i.e. POWER9 and later.
>>>>>
>>>>> This should cause no behavioural change for other architectures.
>>>>>
>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>>>> ---
>>>>> Changes:
>>>>> v4:
>>>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>>>
>>>>> v3:
>>>>> * removed all ifdeferry
>>>>> * removed the capability for MIPS and RISCV
>>>>> * adjusted the commit log about MIPS and RISCV
>>>>>
>>>>> v2:
>>>>> * removed ifdef for ARM64.
>>>>> ---
>>>>>   arch/arm64/kvm/arm.c       | 1 +
>>>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>>>   arch/x86/kvm/x86.c         | 1 +
>>>>>   virt/kvm/kvm_main.c        | 1 -
>>>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>>>> --- a/arch/arm64/kvm/arm.c
>>>>> +++ b/arch/arm64/kvm/arm.c
>>>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>>>       case KVM_CAP_PTP_KVM:
>>>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>>> index fb1490761c87..908ce8bd91c9 100644
>>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>           break;
>>>>>   #endif
>>>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>> +        r = !xive_enabled();
>>>>> +        break;
>>>>> +#endif
>>>>> +
>>>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>>>           r = hv_enabled;
>>>>>           break;
>>>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>>>> index edfd4bbd0cba..7521adadb81b 100644
>>>>> --- a/arch/s390/kvm/kvm-s390.c
>>>>> +++ b/arch/s390/kvm/kvm-s390.c
>>>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>>>       case KVM_CAP_S390_DIAG318:
>>>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>>>> --- a/arch/x86/kvm/x86.c
>>>>> +++ b/arch/x86/kvm/x86.c
>>>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_VAPIC:
>>>>>       case KVM_CAP_ENABLE_CAP:
>>>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_EXIT_HYPERCALL:
>>>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>>>> index 584a5bab3af3..05cf94013f02 100644
>>>>> --- a/virt/kvm/kvm_main.c
>>>>> +++ b/virt/kvm/kvm_main.c
>>>>> @@ -4447,7 +4447,6 @@ static long 
>>>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>>>   #endif
>>>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>>>       case KVM_CAP_IRQFD:
>>>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>   #endif
>>>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>>>
>>>
>>
> 

-- 
Alexey

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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-07  0:24           ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-03-07  0:24 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Paolo Bonzini, Nicholas Piggin, Marc Zyngier, kvm

Sean, can you help please with this? Thanks,


On 28/02/2023 17:17, Alexey Kardashevskiy wrote:
> Anyone, ping?
> 
> On 02/01/2023 11:43, Alexey Kardashevskiy wrote:
>> Paolo, ping?
>>
>>
>> On 06/12/2022 15:39, Alexey Kardashevskiy wrote:
>>> Paolo, ping? :)
>>>
>>>
>>> On 27/10/2022 18:38, Alexey Kardashevskiy wrote:
>>>> Paolo, ping?
>>>>
>>>>
>>>> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
>>>>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>>>>> KVM on POWER9 has never implemented it - the compatibility mode code
>>>>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>>>>> XIVE mode does not handle INTx in KVM at all.
>>>>>
>>>>> This moved the capability support advertising to platforms and stops
>>>>> advertising it on XIVE, i.e. POWER9 and later.
>>>>>
>>>>> This should cause no behavioural change for other architectures.
>>>>>
>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>>>>> Acked-by: Marc Zyngier <maz@kernel.org>
>>>>> ---
>>>>> Changes:
>>>>> v4:
>>>>> * removed incorrect clause about changing behavoir on MIPS and RISCV
>>>>>
>>>>> v3:
>>>>> * removed all ifdeferry
>>>>> * removed the capability for MIPS and RISCV
>>>>> * adjusted the commit log about MIPS and RISCV
>>>>>
>>>>> v2:
>>>>> * removed ifdef for ARM64.
>>>>> ---
>>>>>   arch/arm64/kvm/arm.c       | 1 +
>>>>>   arch/powerpc/kvm/powerpc.c | 6 ++++++
>>>>>   arch/s390/kvm/kvm-s390.c   | 1 +
>>>>>   arch/x86/kvm/x86.c         | 1 +
>>>>>   virt/kvm/kvm_main.c        | 1 -
>>>>>   5 files changed, 9 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>>>>> index 2ff0ef62abad..d2daa4d375b5 100644
>>>>> --- a/arch/arm64/kvm/arm.c
>>>>> +++ b/arch/arm64/kvm/arm.c
>>>>> @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_VCPU_ATTRIBUTES:
>>>>>       case KVM_CAP_PTP_KVM:
>>>>>       case KVM_CAP_ARM_SYSTEM_SUSPEND:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>>> index fb1490761c87..908ce8bd91c9 100644
>>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>           break;
>>>>>   #endif
>>>>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>> +        r = !xive_enabled();
>>>>> +        break;
>>>>> +#endif
>>>>> +
>>>>>       case KVM_CAP_PPC_ALLOC_HTAB:
>>>>>           r = hv_enabled;
>>>>>           break;
>>>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>>>> index edfd4bbd0cba..7521adadb81b 100644
>>>>> --- a/arch/s390/kvm/kvm-s390.c
>>>>> +++ b/arch/s390/kvm/kvm-s390.c
>>>>> @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_SET_GUEST_DEBUG:
>>>>>       case KVM_CAP_S390_DIAG318:
>>>>>       case KVM_CAP_S390_MEM_OP_EXTENSION:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_SET_GUEST_DEBUG2:
>>>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>>>> index 43a6a7efc6ec..2d6c5a8fdf14 100644
>>>>> --- a/arch/x86/kvm/x86.c
>>>>> +++ b/arch/x86/kvm/x86.c
>>>>> @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm 
>>>>> *kvm, long ext)
>>>>>       case KVM_CAP_VAPIC:
>>>>>       case KVM_CAP_ENABLE_CAP:
>>>>>       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
>>>>> +    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>           r = 1;
>>>>>           break;
>>>>>       case KVM_CAP_EXIT_HYPERCALL:
>>>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>>>> index 584a5bab3af3..05cf94013f02 100644
>>>>> --- a/virt/kvm/kvm_main.c
>>>>> +++ b/virt/kvm/kvm_main.c
>>>>> @@ -4447,7 +4447,6 @@ static long 
>>>>> kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
>>>>>   #endif
>>>>>   #ifdef CONFIG_HAVE_KVM_IRQFD
>>>>>       case KVM_CAP_IRQFD:
>>>>> -    case KVM_CAP_IRQFD_RESAMPLE:
>>>>>   #endif
>>>>>       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
>>>>>       case KVM_CAP_CHECK_EXTENSION_VM:
>>>>
>>>
>>
> 

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2022-10-03 23:57 ` Alexey Kardashevskiy
  (?)
@ 2023-03-15 17:16   ` Sean Christopherson
  -1 siblings, 0 replies; 31+ messages in thread
From: Sean Christopherson @ 2023-03-15 17:16 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini,
	Anup Patel, kvm-ppc, Nicholas Piggin, Marc Zyngier,
	Michael Ellerman, Christian Borntraeger, Janosch Frank,
	Claudio Imbrenda

+Michael and KVM s390 maintainers

On Tue, Oct 04, 2022, Alexey Kardashevskiy wrote:
> When introduced, IRQFD resampling worked on POWER8 with XICS. However
> KVM on POWER9 has never implemented it - the compatibility mode code
> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> XIVE mode does not handle INTx in KVM at all.
> 
> This moved the capability support advertising to platforms and stops
> advertising it on XIVE, i.e. POWER9 and later.
> 
> This should cause no behavioural change for other architectures.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---

If no one objects, I'll grab this for 6.4 and route it through kvm-x86/generic.

> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index fb1490761c87..908ce8bd91c9 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>                 break;
>  #endif
>
> +#ifdef CONFIG_HAVE_KVM_IRQFD
> +       case KVM_CAP_IRQFD_RESAMPLE:
> +               r = !xive_enabled();
> +               break;
> +#endif

@PPC folks, do you want to avoid the #ifdef?  If so, I can tweak to this when
applying.

	case KVM_CAP_IRQFD_RESAMPLE:
		r = IS_ENABLED(CONFIG_HAVE_KVM_IRQFD) && !xive_enabled();
		break;

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-15 17:16   ` Sean Christopherson
  0 siblings, 0 replies; 31+ messages in thread
From: Sean Christopherson @ 2023-03-15 17:16 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini,
	Anup Patel, kvm-ppc, Nicholas Piggin, Marc Zyngier,
	Michael Ellerman, Christian Borntraeger, Janosch Frank,
	Claudio Imbrenda

+Michael and KVM s390 maintainers

On Tue, Oct 04, 2022, Alexey Kardashevskiy wrote:
> When introduced, IRQFD resampling worked on POWER8 with XICS. However
> KVM on POWER9 has never implemented it - the compatibility mode code
> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> XIVE mode does not handle INTx in KVM at all.
> 
> This moved the capability support advertising to platforms and stops
> advertising it on XIVE, i.e. POWER9 and later.
> 
> This should cause no behavioural change for other architectures.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---

If no one objects, I'll grab this for 6.4 and route it through kvm-x86/generic.

> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index fb1490761c87..908ce8bd91c9 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>                 break;
>  #endif
>
> +#ifdef CONFIG_HAVE_KVM_IRQFD
> +       case KVM_CAP_IRQFD_RESAMPLE:
> +               r = !xive_enabled();
> +               break;
> +#endif

@PPC folks, do you want to avoid the #ifdef?  If so, I can tweak to this when
applying.

	case KVM_CAP_IRQFD_RESAMPLE:
		r = IS_ENABLED(CONFIG_HAVE_KVM_IRQFD) && !xive_enabled();
		break;

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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-15 17:16   ` Sean Christopherson
  0 siblings, 0 replies; 31+ messages in thread
From: Sean Christopherson @ 2023-03-15 17:16 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini,
	Anup Patel, kvm-ppc, Nicholas Piggin, Marc Zyngier,
	Michael Ellerman, Christian Borntraeger, Janosch Frank,
	Claudio Imbrenda

+Michael and KVM s390 maintainers

On Tue, Oct 04, 2022, Alexey Kardashevskiy wrote:
> When introduced, IRQFD resampling worked on POWER8 with XICS. However
> KVM on POWER9 has never implemented it - the compatibility mode code
> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> XIVE mode does not handle INTx in KVM at all.
> 
> This moved the capability support advertising to platforms and stops
> advertising it on XIVE, i.e. POWER9 and later.
> 
> This should cause no behavioural change for other architectures.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---

If no one objects, I'll grab this for 6.4 and route it through kvm-x86/generic.

> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index fb1490761c87..908ce8bd91c9 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>                 break;
>  #endif
>
> +#ifdef CONFIG_HAVE_KVM_IRQFD
> +       case KVM_CAP_IRQFD_RESAMPLE:
> +               r = !xive_enabled();
> +               break;
> +#endif

@PPC folks, do you want to avoid the #ifdef?  If so, I can tweak to this when
applying.

	case KVM_CAP_IRQFD_RESAMPLE:
		r = IS_ENABLED(CONFIG_HAVE_KVM_IRQFD) && !xive_enabled();
		break;

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2023-03-15 17:16   ` Sean Christopherson
  (?)
@ 2023-03-28  4:30     ` Alexey Kardashevskiy
  -1 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-03-28  4:30 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini,
	Anup Patel, kvm-ppc, Nicholas Piggin, Marc Zyngier,
	Michael Ellerman, Christian Borntraeger, Janosch Frank,
	Claudio Imbrenda



On 16/03/2023 04:16, Sean Christopherson wrote:
> +Michael and KVM s390 maintainers
> 
> On Tue, Oct 04, 2022, Alexey Kardashevskiy wrote:
>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>> KVM on POWER9 has never implemented it - the compatibility mode code
>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>> XIVE mode does not handle INTx in KVM at all.
>>
>> This moved the capability support advertising to platforms and stops
>> advertising it on XIVE, i.e. POWER9 and later.
>>
>> This should cause no behavioural change for other architectures.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>> Acked-by: Marc Zyngier <maz@kernel.org>
>> ---
> 
> If no one objects, I'll grab this for 6.4 and route it through kvm-x86/generic.
> >> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> index fb1490761c87..908ce8bd91c9 100644
>> --- a/arch/powerpc/kvm/powerpc.c
>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>>                  break;
>>   #endif
>>
>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>> +       case KVM_CAP_IRQFD_RESAMPLE:
>> +               r = !xive_enabled();
>> +               break;
>> +#endif
> 
> @PPC folks, do you want to avoid the #ifdef?  If so, I can tweak to this when
> applying.


I am not PPC folks anymore (this is just my backlog) but I do not see 
why not (get rid of ifdef), it is just that file uses #ifdef lot more 
than IS_ENABLED. Thanks,


> 	case KVM_CAP_IRQFD_RESAMPLE:
> 		r = IS_ENABLED(CONFIG_HAVE_KVM_IRQFD) && !xive_enabled();
> 		break;

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-28  4:30     ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-03-28  4:30 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini,
	Anup Patel, kvm-ppc, Nicholas Piggin, Marc Zyngier,
	Michael Ellerman, Christian Borntraeger, Janosch Frank,
	Claudio Imbrenda



On 16/03/2023 04:16, Sean Christopherson wrote:
> +Michael and KVM s390 maintainers
> 
> On Tue, Oct 04, 2022, Alexey Kardashevskiy wrote:
>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>> KVM on POWER9 has never implemented it - the compatibility mode code
>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>> XIVE mode does not handle INTx in KVM at all.
>>
>> This moved the capability support advertising to platforms and stops
>> advertising it on XIVE, i.e. POWER9 and later.
>>
>> This should cause no behavioural change for other architectures.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>> Acked-by: Marc Zyngier <maz@kernel.org>
>> ---
> 
> If no one objects, I'll grab this for 6.4 and route it through kvm-x86/generic.
> >> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> index fb1490761c87..908ce8bd91c9 100644
>> --- a/arch/powerpc/kvm/powerpc.c
>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>>                  break;
>>   #endif
>>
>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>> +       case KVM_CAP_IRQFD_RESAMPLE:
>> +               r = !xive_enabled();
>> +               break;
>> +#endif
> 
> @PPC folks, do you want to avoid the #ifdef?  If so, I can tweak to this when
> applying.


I am not PPC folks anymore (this is just my backlog) but I do not see 
why not (get rid of ifdef), it is just that file uses #ifdef lot more 
than IS_ENABLED. Thanks,


> 	case KVM_CAP_IRQFD_RESAMPLE:
> 		r = IS_ENABLED(CONFIG_HAVE_KVM_IRQFD) && !xive_enabled();
> 		break;

-- 
Alexey

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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-28  4:30     ` Alexey Kardashevskiy
  0 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2023-03-28  4:30 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Paolo Bonzini,
	Anup Patel, kvm-ppc, Nicholas Piggin, Marc Zyngier,
	Michael Ellerman, Christian Borntraeger, Janosch Frank,
	Claudio Imbrenda



On 16/03/2023 04:16, Sean Christopherson wrote:
> +Michael and KVM s390 maintainers
> 
> On Tue, Oct 04, 2022, Alexey Kardashevskiy wrote:
>> When introduced, IRQFD resampling worked on POWER8 with XICS. However
>> KVM on POWER9 has never implemented it - the compatibility mode code
>> ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
>> XIVE mode does not handle INTx in KVM at all.
>>
>> This moved the capability support advertising to platforms and stops
>> advertising it on XIVE, i.e. POWER9 and later.
>>
>> This should cause no behavioural change for other architectures.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Acked-by: Nicholas Piggin <npiggin@gmail.com>
>> Acked-by: Marc Zyngier <maz@kernel.org>
>> ---
> 
> If no one objects, I'll grab this for 6.4 and route it through kvm-x86/generic.
> >> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> index fb1490761c87..908ce8bd91c9 100644
>> --- a/arch/powerpc/kvm/powerpc.c
>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>>                  break;
>>   #endif
>>
>> +#ifdef CONFIG_HAVE_KVM_IRQFD
>> +       case KVM_CAP_IRQFD_RESAMPLE:
>> +               r = !xive_enabled();
>> +               break;
>> +#endif
> 
> @PPC folks, do you want to avoid the #ifdef?  If so, I can tweak to this when
> applying.


I am not PPC folks anymore (this is just my backlog) but I do not see 
why not (get rid of ifdef), it is just that file uses #ifdef lot more 
than IS_ENABLED. Thanks,


> 	case KVM_CAP_IRQFD_RESAMPLE:
> 		r = IS_ENABLED(CONFIG_HAVE_KVM_IRQFD) && !xive_enabled();
> 		break;

-- 
Alexey

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
  2022-10-27  7:38   ` Alexey Kardashevskiy
  (?)
@ 2023-03-31 15:19     ` Paolo Bonzini
  -1 siblings, 0 replies; 31+ messages in thread
From: Paolo Bonzini @ 2023-03-31 15:19 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier

On Thu, Oct 27, 2022 at 9:38 AM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>
> Paolo, ping?

Queued, thanks (the automated message used the wrong reply but this is
the patch I applied).

Paolo

>
> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
> > When introduced, IRQFD resampling worked on POWER8 with XICS. However
> > KVM on POWER9 has never implemented it - the compatibility mode code
> > ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> > XIVE mode does not handle INTx in KVM at all.
> >
> > This moved the capability support advertising to platforms and stops
> > advertising it on XIVE, i.e. POWER9 and later.
> >
> > This should cause no behavioural change for other architectures.
> >
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Acked-by: Nicholas Piggin <npiggin@gmail.com>
> > Acked-by: Marc Zyngier <maz@kernel.org>
> > ---
> > Changes:
> > v4:
> > * removed incorrect clause about changing behavoir on MIPS and RISCV
> >
> > v3:
> > * removed all ifdeferry
> > * removed the capability for MIPS and RISCV
> > * adjusted the commit log about MIPS and RISCV
> >
> > v2:
> > * removed ifdef for ARM64.
> > ---
> >   arch/arm64/kvm/arm.c       | 1 +
> >   arch/powerpc/kvm/powerpc.c | 6 ++++++
> >   arch/s390/kvm/kvm-s390.c   | 1 +
> >   arch/x86/kvm/x86.c         | 1 +
> >   virt/kvm/kvm_main.c        | 1 -
> >   5 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> > index 2ff0ef62abad..d2daa4d375b5 100644
> > --- a/arch/arm64/kvm/arm.c
> > +++ b/arch/arm64/kvm/arm.c
> > @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_VCPU_ATTRIBUTES:
> >       case KVM_CAP_PTP_KVM:
> >       case KVM_CAP_ARM_SYSTEM_SUSPEND:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_SET_GUEST_DEBUG2:
> > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> > index fb1490761c87..908ce8bd91c9 100644
> > --- a/arch/powerpc/kvm/powerpc.c
> > +++ b/arch/powerpc/kvm/powerpc.c
> > @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >               break;
> >   #endif
> >
> > +#ifdef CONFIG_HAVE_KVM_IRQFD
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> > +             r = !xive_enabled();
> > +             break;
> > +#endif
> > +
> >       case KVM_CAP_PPC_ALLOC_HTAB:
> >               r = hv_enabled;
> >               break;
> > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> > index edfd4bbd0cba..7521adadb81b 100644
> > --- a/arch/s390/kvm/kvm-s390.c
> > +++ b/arch/s390/kvm/kvm-s390.c
> > @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_SET_GUEST_DEBUG:
> >       case KVM_CAP_S390_DIAG318:
> >       case KVM_CAP_S390_MEM_OP_EXTENSION:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_SET_GUEST_DEBUG2:
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index 43a6a7efc6ec..2d6c5a8fdf14 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_VAPIC:
> >       case KVM_CAP_ENABLE_CAP:
> >       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_EXIT_HYPERCALL:
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 584a5bab3af3..05cf94013f02 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
> >   #endif
> >   #ifdef CONFIG_HAVE_KVM_IRQFD
> >       case KVM_CAP_IRQFD:
> > -     case KVM_CAP_IRQFD_RESAMPLE:
> >   #endif
> >       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
> >       case KVM_CAP_CHECK_EXTENSION_VM:
>
> --
> Alexey
>


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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-31 15:19     ` Paolo Bonzini
  0 siblings, 0 replies; 31+ messages in thread
From: Paolo Bonzini @ 2023-03-31 15:19 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier

On Thu, Oct 27, 2022 at 9:38 AM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>
> Paolo, ping?

Queued, thanks (the automated message used the wrong reply but this is
the patch I applied).

Paolo

>
> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
> > When introduced, IRQFD resampling worked on POWER8 with XICS. However
> > KVM on POWER9 has never implemented it - the compatibility mode code
> > ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> > XIVE mode does not handle INTx in KVM at all.
> >
> > This moved the capability support advertising to platforms and stops
> > advertising it on XIVE, i.e. POWER9 and later.
> >
> > This should cause no behavioural change for other architectures.
> >
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Acked-by: Nicholas Piggin <npiggin@gmail.com>
> > Acked-by: Marc Zyngier <maz@kernel.org>
> > ---
> > Changes:
> > v4:
> > * removed incorrect clause about changing behavoir on MIPS and RISCV
> >
> > v3:
> > * removed all ifdeferry
> > * removed the capability for MIPS and RISCV
> > * adjusted the commit log about MIPS and RISCV
> >
> > v2:
> > * removed ifdef for ARM64.
> > ---
> >   arch/arm64/kvm/arm.c       | 1 +
> >   arch/powerpc/kvm/powerpc.c | 6 ++++++
> >   arch/s390/kvm/kvm-s390.c   | 1 +
> >   arch/x86/kvm/x86.c         | 1 +
> >   virt/kvm/kvm_main.c        | 1 -
> >   5 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> > index 2ff0ef62abad..d2daa4d375b5 100644
> > --- a/arch/arm64/kvm/arm.c
> > +++ b/arch/arm64/kvm/arm.c
> > @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_VCPU_ATTRIBUTES:
> >       case KVM_CAP_PTP_KVM:
> >       case KVM_CAP_ARM_SYSTEM_SUSPEND:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_SET_GUEST_DEBUG2:
> > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> > index fb1490761c87..908ce8bd91c9 100644
> > --- a/arch/powerpc/kvm/powerpc.c
> > +++ b/arch/powerpc/kvm/powerpc.c
> > @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >               break;
> >   #endif
> >
> > +#ifdef CONFIG_HAVE_KVM_IRQFD
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> > +             r = !xive_enabled();
> > +             break;
> > +#endif
> > +
> >       case KVM_CAP_PPC_ALLOC_HTAB:
> >               r = hv_enabled;
> >               break;
> > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> > index edfd4bbd0cba..7521adadb81b 100644
> > --- a/arch/s390/kvm/kvm-s390.c
> > +++ b/arch/s390/kvm/kvm-s390.c
> > @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_SET_GUEST_DEBUG:
> >       case KVM_CAP_S390_DIAG318:
> >       case KVM_CAP_S390_MEM_OP_EXTENSION:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_SET_GUEST_DEBUG2:
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index 43a6a7efc6ec..2d6c5a8fdf14 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_VAPIC:
> >       case KVM_CAP_ENABLE_CAP:
> >       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_EXIT_HYPERCALL:
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 584a5bab3af3..05cf94013f02 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
> >   #endif
> >   #ifdef CONFIG_HAVE_KVM_IRQFD
> >       case KVM_CAP_IRQFD:
> > -     case KVM_CAP_IRQFD_RESAMPLE:
> >   #endif
> >       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
> >       case KVM_CAP_CHECK_EXTENSION_VM:
>
> --
> Alexey
>


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

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

* Re: [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent
@ 2023-03-31 15:19     ` Paolo Bonzini
  0 siblings, 0 replies; 31+ messages in thread
From: Paolo Bonzini @ 2023-03-31 15:19 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kvm, linux-arm-kernel, kvmarm, kvm-riscv, Anup Patel, kvm-ppc,
	Nicholas Piggin, Marc Zyngier

On Thu, Oct 27, 2022 at 9:38 AM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>
> Paolo, ping?

Queued, thanks (the automated message used the wrong reply but this is
the patch I applied).

Paolo

>
> On 04/10/2022 10:57, Alexey Kardashevskiy wrote:
> > When introduced, IRQFD resampling worked on POWER8 with XICS. However
> > KVM on POWER9 has never implemented it - the compatibility mode code
> > ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native
> > XIVE mode does not handle INTx in KVM at all.
> >
> > This moved the capability support advertising to platforms and stops
> > advertising it on XIVE, i.e. POWER9 and later.
> >
> > This should cause no behavioural change for other architectures.
> >
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Acked-by: Nicholas Piggin <npiggin@gmail.com>
> > Acked-by: Marc Zyngier <maz@kernel.org>
> > ---
> > Changes:
> > v4:
> > * removed incorrect clause about changing behavoir on MIPS and RISCV
> >
> > v3:
> > * removed all ifdeferry
> > * removed the capability for MIPS and RISCV
> > * adjusted the commit log about MIPS and RISCV
> >
> > v2:
> > * removed ifdef for ARM64.
> > ---
> >   arch/arm64/kvm/arm.c       | 1 +
> >   arch/powerpc/kvm/powerpc.c | 6 ++++++
> >   arch/s390/kvm/kvm-s390.c   | 1 +
> >   arch/x86/kvm/x86.c         | 1 +
> >   virt/kvm/kvm_main.c        | 1 -
> >   5 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> > index 2ff0ef62abad..d2daa4d375b5 100644
> > --- a/arch/arm64/kvm/arm.c
> > +++ b/arch/arm64/kvm/arm.c
> > @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_VCPU_ATTRIBUTES:
> >       case KVM_CAP_PTP_KVM:
> >       case KVM_CAP_ARM_SYSTEM_SUSPEND:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_SET_GUEST_DEBUG2:
> > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> > index fb1490761c87..908ce8bd91c9 100644
> > --- a/arch/powerpc/kvm/powerpc.c
> > +++ b/arch/powerpc/kvm/powerpc.c
> > @@ -593,6 +593,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >               break;
> >   #endif
> >
> > +#ifdef CONFIG_HAVE_KVM_IRQFD
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> > +             r = !xive_enabled();
> > +             break;
> > +#endif
> > +
> >       case KVM_CAP_PPC_ALLOC_HTAB:
> >               r = hv_enabled;
> >               break;
> > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> > index edfd4bbd0cba..7521adadb81b 100644
> > --- a/arch/s390/kvm/kvm-s390.c
> > +++ b/arch/s390/kvm/kvm-s390.c
> > @@ -577,6 +577,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_SET_GUEST_DEBUG:
> >       case KVM_CAP_S390_DIAG318:
> >       case KVM_CAP_S390_MEM_OP_EXTENSION:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_SET_GUEST_DEBUG2:
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index 43a6a7efc6ec..2d6c5a8fdf14 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -4395,6 +4395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> >       case KVM_CAP_VAPIC:
> >       case KVM_CAP_ENABLE_CAP:
> >       case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
> > +     case KVM_CAP_IRQFD_RESAMPLE:
> >               r = 1;
> >               break;
> >       case KVM_CAP_EXIT_HYPERCALL:
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 584a5bab3af3..05cf94013f02 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -4447,7 +4447,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
> >   #endif
> >   #ifdef CONFIG_HAVE_KVM_IRQFD
> >       case KVM_CAP_IRQFD:
> > -     case KVM_CAP_IRQFD_RESAMPLE:
> >   #endif
> >       case KVM_CAP_IOEVENTFD_ANY_LENGTH:
> >       case KVM_CAP_CHECK_EXTENSION_VM:
>
> --
> Alexey
>

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

end of thread, other threads:[~2023-03-31 15:21 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03 23:57 [PATCH kernel v4] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE support platform dependent Alexey Kardashevskiy
2022-10-03 23:57 ` Alexey Kardashevskiy
2022-10-03 23:57 ` Alexey Kardashevskiy
2022-10-03 23:57 ` Alexey Kardashevskiy
2022-10-27  7:38 ` Alexey Kardashevskiy
2022-10-27  7:38   ` Alexey Kardashevskiy
2022-10-27  7:38   ` Alexey Kardashevskiy
2022-10-27  7:38   ` Alexey Kardashevskiy
2022-12-06  4:39   ` Alexey Kardashevskiy
2022-12-06  4:39     ` Alexey Kardashevskiy
2022-12-06  4:39     ` Alexey Kardashevskiy
2022-12-06  4:39     ` Alexey Kardashevskiy
2023-01-02  0:43     ` Alexey Kardashevskiy
2023-01-02  0:43       ` Alexey Kardashevskiy
2023-01-02  0:43       ` Alexey Kardashevskiy
2023-01-02  0:43       ` Alexey Kardashevskiy
2023-02-28  6:17       ` Alexey Kardashevskiy
2023-02-28  6:17         ` Alexey Kardashevskiy
2023-02-28  6:17         ` Alexey Kardashevskiy
2023-03-07  0:24         ` Alexey Kardashevskiy
2023-03-07  0:24           ` Alexey Kardashevskiy
2023-03-07  0:24           ` Alexey Kardashevskiy
2023-03-31 15:19   ` Paolo Bonzini
2023-03-31 15:19     ` Paolo Bonzini
2023-03-31 15:19     ` Paolo Bonzini
2023-03-15 17:16 ` Sean Christopherson
2023-03-15 17:16   ` Sean Christopherson
2023-03-15 17:16   ` Sean Christopherson
2023-03-28  4:30   ` Alexey Kardashevskiy
2023-03-28  4:30     ` Alexey Kardashevskiy
2023-03-28  4:30     ` Alexey Kardashevskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.