]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: arm/arm64: GICv4: Prevent userspace from changing doorbell affinity
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 27 Oct 2017 14:28:53 +0000 (15:28 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 10 Nov 2017 08:45:02 +0000 (09:45 +0100)
commitd3d83f7fef9dfa8bf5a279497dcaa3dd690bce2f
treec13c5b6350df78d55e2f663cd7b8c5f6b0c1c053
parentbd94e7aea40387524b1d6c76b09785f5c3319116
KVM: arm/arm64: GICv4: Prevent userspace from changing doorbell affinity

We so far allocate the doorbell interrupts without taking any
special measure regarding the affinity of these interrupts. We
simply move them around as required when the vcpu gets scheduled
on a different CPU.

But that's counting without userspace (and the evil irqbalance) that
can try and move the VPE interrupt around, causing the ITS code
to emit VMOVP commands and remap the doorbell to another redistributor.
Worse, this can happen while the vcpu is running, causing all kind
of trouble if the VPE is already resident, and we end-up in UNPRED
territory.

So let's take a definitive action and prevent userspace from messing
with us. This is just a matter of adding IRQ_NO_BALANCING to the
set of flags we already have, letting the kernel in sole control
of the affinity.

Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/vgic/vgic-v4.c