[PATCH] KVM: arm64: Disable preemption in kvm_arch_hardware_enable()

Oliver Upton oliver.upton at linux.dev
Tue Jul 4 11:54:02 PDT 2023


On Tue, Jul 04, 2023 at 07:32:09PM +0100, Kristina Martsenko wrote:
> On 03/07/2023 17:35, Marc Zyngier wrote:
> > Since 0bf50497f03b ("KVM: Drop kvm_count_lock and instead protect
> > kvm_usage_count with kvm_lock"), hotplugging back a CPU whilst
> > a guest is running results in a number of ugly splats as most
> > of this code expects to run with preemption disabled, which isn't
> > the case anymore.
> > 
> > While the context is preemptable, it isn't migratable, which should
> > be enough. But we have plenty of preemptible() checks all over
> > the place, and our per-CPU accessors also disable preemption.
> > 
> > Since this affects released versions, let's do the easy fix first,
> > disabling preemption in kvm_arch_hardware_enable(). We can always
> > revisit this with a more invasive fix in the future.
> > 
> > Fixes: 0bf50497f03b ("KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock")
> > Reported-by: Kristina Martsenko <kristina.martsenko at arm.com>
> > Tested-by: Kristina Martsenko <kristina.martsenko at arm.com>
> > Signed-off-by: Marc Zyngier <maz at kernel.org>
> > Link: https://lore.kernel.org/r/aeab7562-2d39-e78e-93b1-4711f8cc3fa5@arm.com
> > Cc: stable at vger.kernek.org # v6.3, v6.4
> 
> Typo here, didn't make it to the stable list (kernek.org -> kernel.org)

Thanks for catching this Kristina, I'll fix it up when I apply the
patch. So long as the patch appears in Linus' tree with the correct Cc
it'll find its way to the stable trees.

--
Thanks,
Oliver



More information about the linux-arm-kernel mailing list