Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: s390: Enable vCPU kick infrastructure
@ 2026-11-25 16:38 Steffen Eiden
  2026-11-25 16:38 ` [PATCH 1/2] s390: Export arch_smp_send_reschedule Steffen Eiden
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Steffen Eiden @ 2026-11-25 16:38 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Paolo Bonzini,
	Sean Christopherson, Andreas Grapentin, Janosch Frank,
	Claudio Imbrenda
  Cc: linux-s390, kvm, Steffen Eiden

Future extensions to arm on s390 will require the vcpu kick
infrastructure from KVM.

Today that infrastructure is compiled out on s390: Commit 0266c894b51c
("KVM: put back #ifndef CONFIG_S390 around kvm_vcpu_kick") guarded it
with #ifndef CONFIG_S390 for exactly one reason: kvm_vcpu_kick() calls
smp_send_reschedule(), which s390 did not export, and therefore the
s390 KVM module failed to link.

So Patch 1 exports arch_smp_send_reschedule and patch 2 drops the
CONFIG_S390 guards around __kvm_vcpu_kick() and its inline wrappers.

As this is a non-invasive change  and eases the integration of future
code I send it in beforehand. These two patches need to come in before
arm patches which add the sharing of code using this e.g.
vcpu_power_off, vcpu_suspend, ... which will be used in the near future.

Native KVM/s390 is unaffected. It keeps its own wakeup and request
paths and gains no callers of the generic kick. __kvm_vcpu_kick() is
now compiled into the native module but unused; it cannot send an IPI
for a native vCPU anyway, as native s390 never sets vcpu->mode to
IN_GUEST_MODE. Then kvm_request_needs_ipi() declines and the kick
would result in a plain wakeup of a halted vCPU.DITME: cover title for vcpu_kick

	Steffen

---
Steffen Eiden (2):
      s390: Export arch_smp_send_reschedule
      KVM: s390: Enable the generic vCPU kick infrastructure

 arch/s390/kernel/smp.c   | 1 +
 include/linux/kvm_host.h | 4 ----
 virt/kvm/kvm_main.c      | 2 --
 3 files changed, 1 insertion(+), 6 deletions(-)

base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
change-id: 20261125-vcpu_kick-339caf770bb8


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

* [PATCH 1/2] s390: Export arch_smp_send_reschedule
  2026-11-25 16:38 [PATCH 0/2] KVM: s390: Enable vCPU kick infrastructure Steffen Eiden
@ 2026-11-25 16:38 ` Steffen Eiden
  2026-11-26  6:19   ` Christian Borntraeger
  2026-11-25 16:38 ` [PATCH 2/2] KVM: s390: Enable the generic vCPU kick infrastructure Steffen Eiden
  2026-11-25 16:44 ` [PATCH 0/2] KVM: s390: Enable " sashiko-bot
  2 siblings, 1 reply; 5+ messages in thread
From: Steffen Eiden @ 2026-11-25 16:38 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Paolo Bonzini,
	Sean Christopherson, Andreas Grapentin, Janosch Frank,
	Claudio Imbrenda
  Cc: linux-s390, kvm, Steffen Eiden

Export arch_smp_send_reschedule in order to be able to use the generic
vcpu_kick infrastructure which is required for arm on s390 smp support.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
---
 arch/s390/kernel/smp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index f7c262a17c03..14d198789e30 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -531,6 +531,7 @@ void arch_smp_send_reschedule(int cpu)
 {
 	pcpu_ec_call(per_cpu_ptr(&pcpu_devices, cpu), ec_schedule);
 }
+EXPORT_SYMBOL_GPL(arch_smp_send_reschedule);
 
 #ifdef CONFIG_IRQ_WORK
 void arch_irq_work_raise(void)

-- 
2.56.1


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

* [PATCH 2/2] KVM: s390: Enable the generic vCPU kick infrastructure
  2026-11-25 16:38 [PATCH 0/2] KVM: s390: Enable vCPU kick infrastructure Steffen Eiden
  2026-11-25 16:38 ` [PATCH 1/2] s390: Export arch_smp_send_reschedule Steffen Eiden
@ 2026-11-25 16:38 ` Steffen Eiden
  2026-11-25 16:44 ` [PATCH 0/2] KVM: s390: Enable " sashiko-bot
  2 siblings, 0 replies; 5+ messages in thread
From: Steffen Eiden @ 2026-11-25 16:38 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Paolo Bonzini,
	Sean Christopherson, Andreas Grapentin, Janosch Frank,
	Claudio Imbrenda
  Cc: linux-s390, kvm, Steffen Eiden

Drop the #ifndef CONFIG_S390 around __kvm_vcpu_kick() and its inline
wrappers so that arm on s390 can use the vCPU kick infrastructure.

Commit 0266c894b51c ("KVM: put back #ifndef CONFIG_S390 around
kvm_vcpu_kick") added the guard around the kick itself for exactly one
reason: kvm_vcpu_kick() calls smp_send_reschedule(), which s390 did not
export, and so the s390 KVM module failed to link.

KVM for arm64 guests on s390 builds on the shared arm64 KVM code, which
relies on the generic kick infrastructure. s390 will have a user for the
kick infrastructure. Let's activate it.

Native KVM/s390 is unaffected by the guards going away. It keeps its own
wakeup and request paths and gains no callers of the generic kick.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
---
 include/linux/kvm_host.h | 4 ----
 virt/kvm/kvm_main.c      | 2 --
 2 files changed, 6 deletions(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index fe300a22ab0f..aaade63f1b5a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1590,14 +1590,12 @@ void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu);
 void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu);
 bool kvm_vcpu_wake_up(struct kvm_vcpu *vcpu);
 
-#ifndef CONFIG_S390
 void __kvm_vcpu_kick(struct kvm_vcpu *vcpu, int request, bool force);
 
 static inline void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
 {
 	__kvm_vcpu_kick(vcpu, 0, false);
 }
-#endif
 
 int kvm_vcpu_yield_to(struct kvm_vcpu *target);
 void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu, bool yield_to_kernel_mode);
@@ -2331,13 +2329,11 @@ static __always_inline void kvm_make_request(int req, struct kvm_vcpu *vcpu)
 	__kvm_make_request(req, vcpu);
 }
 
-#ifndef CONFIG_S390
 static inline void kvm_make_request_and_kick(int req, struct kvm_vcpu *vcpu)
 {
 	kvm_make_request(req, vcpu);
 	__kvm_vcpu_kick(vcpu, req, false);
 }
-#endif
 
 static inline bool kvm_request_pending(struct kvm_vcpu *vcpu)
 {
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 83e727bf6452..f2499f809fdc 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -3903,7 +3903,6 @@ bool kvm_vcpu_wake_up(struct kvm_vcpu *vcpu)
 }
 EXPORT_SYMBOL_FOR_KVM_INTERNAL(kvm_vcpu_wake_up);
 
-#ifndef CONFIG_S390
 /*
  * Kick a sleeping VCPU, or a guest VCPU in guest mode, into host kernel mode.
  */
@@ -3959,7 +3958,6 @@ void __kvm_vcpu_kick(struct kvm_vcpu *vcpu, int req, bool force)
 	put_cpu();
 }
 EXPORT_SYMBOL_FOR_KVM_INTERNAL(__kvm_vcpu_kick);
-#endif /* !CONFIG_S390 */
 
 int kvm_vcpu_yield_to(struct kvm_vcpu *target)
 {

-- 
2.56.1


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

* Re: [PATCH 0/2] KVM: s390: Enable vCPU kick infrastructure
  2026-11-25 16:38 [PATCH 0/2] KVM: s390: Enable vCPU kick infrastructure Steffen Eiden
  2026-11-25 16:38 ` [PATCH 1/2] s390: Export arch_smp_send_reschedule Steffen Eiden
  2026-11-25 16:38 ` [PATCH 2/2] KVM: s390: Enable the generic vCPU kick infrastructure Steffen Eiden
@ 2026-11-25 16:44 ` sashiko-bot
  2 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-25 16:44 UTC (permalink / raw)
  To: Steffen Eiden
  Cc: linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger

Sashiko has reviewed this 2-patch series and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125-vcpu_kick-v1-0-a203b01ab957@linux.ibm.com

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

* Re: [PATCH 1/2] s390: Export arch_smp_send_reschedule
  2026-11-25 16:38 ` [PATCH 1/2] s390: Export arch_smp_send_reschedule Steffen Eiden
@ 2026-11-26  6:19   ` Christian Borntraeger
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2026-11-26  6:19 UTC (permalink / raw)
  To: Steffen Eiden, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Sven Schnelle, Paolo Bonzini, Sean Christopherson,
	Andreas Grapentin, Janosch Frank, Claudio Imbrenda
  Cc: linux-s390, kvm

Am 25.11.26 um 17:38 schrieb Steffen Eiden:
> Export arch_smp_send_reschedule in order to be able to use the generic
> vcpu_kick infrastructure which is required for arm on s390 smp support.
> 
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
> ---
>   arch/s390/kernel/smp.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
> index f7c262a17c03..14d198789e30 100644
> --- a/arch/s390/kernel/smp.c
> +++ b/arch/s390/kernel/smp.c
> @@ -531,6 +531,7 @@ void arch_smp_send_reschedule(int cpu)
>   {
>   	pcpu_ec_call(per_cpu_ptr(&pcpu_devices, cpu), ec_schedule);
>   }
> +EXPORT_SYMBOL_GPL(arch_smp_send_reschedule);
>   
>   #ifdef CONFIG_IRQ_WORK
>   void arch_irq_work_raise(void)
> 

There is a similar patch from Sean already.

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

end of thread, other threads:[~2026-11-26  6:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 16:38 [PATCH 0/2] KVM: s390: Enable vCPU kick infrastructure Steffen Eiden
2026-11-25 16:38 ` [PATCH 1/2] s390: Export arch_smp_send_reschedule Steffen Eiden
2026-11-26  6:19   ` Christian Borntraeger
2026-11-25 16:38 ` [PATCH 2/2] KVM: s390: Enable the generic vCPU kick infrastructure Steffen Eiden
2026-11-25 16:44 ` [PATCH 0/2] KVM: s390: Enable " sashiko-bot

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