From: Marcelo Tosatti <mtosatti@redhat.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Andre Przywara <andre.przywara@arm.com>,
"christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
"n.nikolaev@virtualopensystems.com"
<n.nikolaev@virtualopensystems.com>,
"eric.auger@linaro.org" <eric.auger@linaro.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 06/12] KVM: mark kvm->buses as empty once they were destroyed
Date: Thu, 26 Mar 2015 22:31:51 -0300 [thread overview]
Message-ID: <20150327013151.GA2882@amt.cnet> (raw)
In-Reply-To: <5512EBB9.2050304@arm.com>
On Wed, Mar 25, 2015 at 05:09:13PM +0000, Marc Zyngier wrote:
> On 23/03/15 15:58, Andre Przywara wrote:
> > In kvm_destroy_vm() we call kvm_io_bus_destroy() pretty early,
> > especially before calling kvm_arch_destroy_vm(). To avoid
> > unregistering devices from the already destroyed bus, let's mark
> > the bus with NULL to let other users know it has been destroyed
> > already.
> > This avoids a crash on a VM shutdown with the VGIC using the
> > kvm_io_bus later (the unregistering is in there to be able to roll
> > back a faulting init).
> >
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>
> That seems sensible, but I don't see why nobody else hits that. What are
> we doing differently?
>
> Otherwise,
>
> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
>
> Paolo, Marcelo, can we have your Ack on this?
>
> Thanks,
>
> M.
>
> > ---
> > virt/kvm/kvm_main.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 8c7ab0b..6f164eb 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -604,8 +604,10 @@ static void kvm_destroy_vm(struct kvm *kvm)
> > list_del(&kvm->vm_list);
> > spin_unlock(&kvm_lock);
> > kvm_free_irq_routing(kvm);
> > - for (i = 0; i < KVM_NR_BUSES; i++)
> > + for (i = 0; i < KVM_NR_BUSES; i++) {
> > kvm_io_bus_destroy(kvm->buses[i]);
> > + kvm->buses[i] = NULL;
> > + }
> > kvm_coalesced_mmio_free(kvm);
> > #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
> > mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm);
> >
>
>
> --
> Jazz is not dead. It just smells funny...
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
WARNING: multiple messages have this Message-ID (diff)
From: mtosatti@redhat.com (Marcelo Tosatti)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 06/12] KVM: mark kvm->buses as empty once they were destroyed
Date: Thu, 26 Mar 2015 22:31:51 -0300 [thread overview]
Message-ID: <20150327013151.GA2882@amt.cnet> (raw)
In-Reply-To: <5512EBB9.2050304@arm.com>
On Wed, Mar 25, 2015 at 05:09:13PM +0000, Marc Zyngier wrote:
> On 23/03/15 15:58, Andre Przywara wrote:
> > In kvm_destroy_vm() we call kvm_io_bus_destroy() pretty early,
> > especially before calling kvm_arch_destroy_vm(). To avoid
> > unregistering devices from the already destroyed bus, let's mark
> > the bus with NULL to let other users know it has been destroyed
> > already.
> > This avoids a crash on a VM shutdown with the VGIC using the
> > kvm_io_bus later (the unregistering is in there to be able to roll
> > back a faulting init).
> >
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>
> That seems sensible, but I don't see why nobody else hits that. What are
> we doing differently?
>
> Otherwise,
>
> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
>
> Paolo, Marcelo, can we have your Ack on this?
>
> Thanks,
>
> M.
>
> > ---
> > virt/kvm/kvm_main.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 8c7ab0b..6f164eb 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -604,8 +604,10 @@ static void kvm_destroy_vm(struct kvm *kvm)
> > list_del(&kvm->vm_list);
> > spin_unlock(&kvm_lock);
> > kvm_free_irq_routing(kvm);
> > - for (i = 0; i < KVM_NR_BUSES; i++)
> > + for (i = 0; i < KVM_NR_BUSES; i++) {
> > kvm_io_bus_destroy(kvm->buses[i]);
> > + kvm->buses[i] = NULL;
> > + }
> > kvm_coalesced_mmio_free(kvm);
> > #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
> > mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm);
> >
>
>
> --
> Jazz is not dead. It just smells funny...
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
next prev parent reply other threads:[~2015-03-27 1:31 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 15:58 [PATCH v2 00/12] KVM: arm/arm64: move VGIC MMIO to kvm_io_bus Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-23 15:58 ` [PATCH v2 01/12] KVM: Redesign kvm_io_bus_ API to pass VCPU structure to the callbacks Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 16:56 ` Marc Zyngier
2015-03-25 16:56 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 02/12] KVM: move iodev.h from virt/kvm/ to include/kvm Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:00 ` Marc Zyngier
2015-03-25 17:00 ` Marc Zyngier
2015-03-25 21:41 ` Marcelo Tosatti
2015-03-25 21:41 ` Marcelo Tosatti
2015-03-23 15:58 ` [PATCH v2 03/12] KVM: arm/arm64: remove now unneeded include directory from Makefile Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:00 ` Marc Zyngier
2015-03-25 17:00 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 04/12] KVM: x86: " Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:01 ` Marc Zyngier
2015-03-25 17:01 ` Marc Zyngier
2015-03-25 21:41 ` Marcelo Tosatti
2015-03-25 21:41 ` Marcelo Tosatti
2015-03-23 15:58 ` [PATCH v2 05/12] KVM: arm/arm64: rename struct kvm_mmio_range to vgic_io_range Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:02 ` Marc Zyngier
2015-03-25 17:02 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 06/12] KVM: mark kvm->buses as empty once they were destroyed Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:09 ` Marc Zyngier
2015-03-25 17:09 ` Marc Zyngier
2015-03-25 21:59 ` Marcelo Tosatti
2015-03-25 21:59 ` Marcelo Tosatti
2015-03-26 12:41 ` Andre Przywara
2015-03-26 12:41 ` Andre Przywara
2015-03-27 1:31 ` Marcelo Tosatti [this message]
2015-03-27 1:31 ` Marcelo Tosatti
2015-03-27 2:10 ` Chen, Tiejun
2015-03-27 2:10 ` Chen, Tiejun
2015-03-23 15:58 ` [PATCH v2 07/12] KVM: arm/arm64: simplify vgic_find_range() and callers Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:13 ` Marc Zyngier
2015-03-25 17:13 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 08/12] KVM: arm/arm64: implement kvm_io_bus MMIO handling for the VGIC Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:18 ` Marc Zyngier
2015-03-25 17:18 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 09/12] KVM: arm/arm64: prepare GICv2 emulation to be handled by kvm_io_bus Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:21 ` Marc Zyngier
2015-03-25 17:21 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 10/12] KVM: arm/arm64: prepare GICv3 emulation to use kvm_io_bus MMIO handling Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:36 ` Marc Zyngier
2015-03-25 17:36 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 11/12] KVM: arm/arm64: rework MMIO abort handling to use KVM MMIO bus Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-23 21:43 ` Nikolay Nikolaev
2015-03-23 21:43 ` Nikolay Nikolaev
2015-03-24 16:03 ` [PATCH] KVM: arm/arm64: fix MMIO handling on userland induced accesses Andre Przywara
2015-03-24 16:03 ` Andre Przywara
2015-03-25 17:37 ` Marc Zyngier
2015-03-25 17:37 ` Marc Zyngier
2015-03-23 15:58 ` [PATCH v2 12/12] KVM: arm/arm64: remove now obsolete VGIC specific MMIO handling code Andre Przywara
2015-03-23 15:58 ` Andre Przywara
2015-03-25 17:36 ` Marc Zyngier
2015-03-25 17:36 ` Marc Zyngier
2015-03-27 9:33 ` Marc Zyngier
2015-03-27 9:33 ` Marc Zyngier
2015-03-23 21:50 ` [PATCH v2 00/12] KVM: arm/arm64: move VGIC MMIO to kvm_io_bus Nikolay Nikolaev
2015-03-23 21:50 ` Nikolay Nikolaev
2015-03-24 10:10 ` Marc Zyngier
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=20150327013151.GA2882@amt.cnet \
--to=mtosatti@redhat.com \
--cc=andre.przywara@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=eric.auger@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=n.nikolaev@virtualopensystems.com \
--cc=pbonzini@redhat.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.