This is a note to let you know that I've just added the patch titled arm/arm64: KVM: vgic: Fix error code in kvm_vgic_create() to the 3.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm-arm64-kvm-vgic-fix-error-code-in-kvm_vgic_create.patch and it can be found in the queue-3.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 6b50f54064a02b77a7b990032b80234fee59bcd6 Mon Sep 17 00:00:00 2001 From: Christoffer Dall <christoffer.dall@xxxxxxxxxx> Date: Thu, 6 Nov 2014 11:47:39 +0000 Subject: arm/arm64: KVM: vgic: Fix error code in kvm_vgic_create() From: Christoffer Dall <christoffer.dall@xxxxxxxxxx> commit 6b50f54064a02b77a7b990032b80234fee59bcd6 upstream. If we detect another vCPU is running we just exit and return 0 as if we succesfully created the VGIC, but the VGIC wouldn't actual be created. This shouldn't break in-kernel behavior because the kernel will not observe the failed the attempt to create the VGIC, but userspace could be rightfully confused. Cc: Andre Przywara <andre.przywara@xxxxxxx> Signed-off-by: Christoffer Dall <christoffer.dall@xxxxxxxxxx> Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> Signed-off-by: Shannon Zhao <shannon.zhao@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- virt/kvm/arm/vgic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1611,7 +1611,7 @@ out: int kvm_vgic_create(struct kvm *kvm) { - int i, vcpu_lock_idx = -1, ret = 0; + int i, vcpu_lock_idx = -1, ret; struct kvm_vcpu *vcpu; mutex_lock(&kvm->lock); @@ -1626,6 +1626,7 @@ int kvm_vgic_create(struct kvm *kvm) * vcpu->mutex. By grabbing the vcpu->mutex of all VCPUs we ensure * that no other VCPUs are run while we create the vgic. */ + ret = -EBUSY; kvm_for_each_vcpu(i, vcpu, kvm) { if (!mutex_trylock(&vcpu->mutex)) goto out_unlock; @@ -1633,11 +1634,10 @@ int kvm_vgic_create(struct kvm *kvm) } kvm_for_each_vcpu(i, vcpu, kvm) { - if (vcpu->arch.has_run_once) { - ret = -EBUSY; + if (vcpu->arch.has_run_once) goto out_unlock; - } } + ret = 0; spin_lock_init(&kvm->arch.vgic.lock); kvm->arch.vgic.vctrl_base = vgic_vctrl_base; Patches currently in stable-queue which might be from christoffer.dall@xxxxxxxxxx are queue-3.14/arm-arm64-kvm-ensure-memslots-are-within-kvm_phys_size.patch queue-3.14/arm-arm64-kvm-fix-potential-null-dereference-in.patch queue-3.14/arm64-kvm-fix-unmapping-with-48-bit-vas.patch queue-3.14/arm-arm64-kvm-fix-set_clear_sgi_pend_reg-offset.patch queue-3.14/arm-kvm-strict_mm_typechecks-fix-for-user_mem_abort.patch queue-3.14/arm-arm64-kvm-fix-use-of-wnr-bit-in-kvm_is_write_fault.patch queue-3.14/arm-kvm-fix-cpu-hotplug.patch queue-3.14/arm-arm64-kvm-fix-vttbr_baddr_mask-and-pgd-alloc.patch queue-3.14/arm-arm64-kvm-vgic-fix-error-code-in-kvm_vgic_create.patch queue-3.14/kvm-arm-vgic-plug-irq-injection-race.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html