All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Satish Kharat <satishkh@cisco.com>,
	Sashiko Bot <sashiko-bot@kernel.org>,
	Oliver Upton <oupton@kernel.org>, Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH v2 1/6] s390/smp: Export arch_smp_send_reschedule() for KVM
Date: Tue, 24 Nov 2026 16:54:11 +0100	[thread overview]
Message-ID: <20261124155411.1489564A75-hca@linux.ibm.com> (raw)
In-Reply-To: <20261119235656.70315-2-seanjc@google.com>

On Thu, Nov 19, 2026 at 03:56:51PM -0800, Sean Christopherson wrote:
> Export arch_smp_send_reschedule() so that KVM can use smp_send_reschedule()
> in common "kick vCPU" code without running afoul of build issues on s390.
> KVM currently uses smp_call_function_many() when kicking multiple vCPUs,
> but several KVM architectures (at least arm64 and x86) kick vCPUs with IRQs
> disabled.  Using SMP function calls with IRQs disabled is unsafe as it can
> lead to two CPUs waiting for each other to respond to the function call,
> i.e. KVM needs to use smp_send_reschedule() to avoid potential deadlock on
> other architectures.
> 
> Alternatively, KVM could go out of its way to avoid smp_send_reschedule()
> on s390, as KVM does when kicking a single vCPU, but given that all modules
> can reach smp_send_reschedule() via kick_process(), forcing KVM to dance
> around s390 adds no practical value and would add non-trivial complexity to
> KVM.
> 
> Note, thanks to s390 now building kvm.ko and kvm-arm64.ko, using
> EXPORT_SYMBOL_FOR_KVM doesn't Just Work.  Exporting the symbol just for KVM
> would also complicate backporting the upcoming fixes to older kernels.  For
> now, keep it simple.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Sean Christopherson <seanjc@google.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 32499cad86f0..39318aa7ab7f 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);

Given that quite a few architectures export this already this is fine.

Acked-by: Heiko Carstens <hca@linux.ibm.com>

  parent reply	other threads:[~2026-11-24 15:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 23:56 [PATCH v2 0/6] KVM: Send reschedule IPIs for non-waiting requests Sean Christopherson
2026-11-19 23:56 ` [PATCH v2 1/6] s390/smp: Export arch_smp_send_reschedule() for KVM Sean Christopherson
2026-11-23 12:39   ` Christian Borntraeger
2026-11-24 15:54   ` Heiko Carstens [this message]
2026-11-26  6:31   ` Christian Borntraeger
2026-11-19 23:56 ` [PATCH v2 2/6] KVM: Add struct and helpers to handle kicking multiple (v)CPUs Sean Christopherson
2026-11-19 23:56 ` [PATCH v2 3/6] KVM: Add dedicated flag to track if multi-vCPU request needs at least one kick Sean Christopherson
2026-11-19 23:56 ` [PATCH v2 4/6] KVM: Don't kick offline CPUs when making a multi-vCPU request Sean Christopherson
2026-11-19 23:56 ` [PATCH v2 5/6] KVM: Send reschedule IPIs instead of SMP function calls for non-waiting requests Sean Christopherson
2026-11-21 15:24   ` Satish Kharat
2026-11-19 23:56 ` [PATCH v2 6/6] KVM: Extract and dedup the kick code to check if a CPU needs an IPI Sean Christopherson
2026-11-27 14:22 ` [PATCH v2 0/6] KVM: Send reschedule IPIs for non-waiting requests Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124155411.1489564A75-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sashiko-bot@kernel.org \
    --cc=satishkh@cisco.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.