[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC PATCH v2 17/23] xics_kvm: Don't enable KVM_CAP_IRQ_X
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [RFC PATCH v2 17/23] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled |
Date: |
Thu, 26 Mar 2015 12:46:05 +1100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Mar 25, 2015 at 02:42:24PM +0530, Bharata B Rao wrote:
> On Wed, Mar 25, 2015 at 04:24:39PM +1100, David Gibson wrote:
> > On Mon, Mar 23, 2015 at 07:05:58PM +0530, Bharata B Rao wrote:
> > > When supporting CPU hot removal by parking the vCPU fd and reusing
> > > it during hotplug again, there can be cases where we try to reenable
> > > KVM_CAP_IRQ_XICS CAP for the vCPU for which it was already enabled.
> > > Introduce a boolean member in ICPState to track this and don't
> > > reenable the CAP if it was already enabled earlier.
> > >
> > > This change allows CPU hot removal to work for sPAPR.
> > >
> > > Signed-off-by: Bharata B Rao <address@hidden>
> >
> > Why does double enabling the capability cause problems? I would have
> > expected it to be unnecessary, but harmless.
>
> We are reusing the vCPU here w/o closing its fd.
>
> As things stand currently, enabling this cap again will result in
> kernel trying to create and associate ICP with this vCPU and that
> fails since there is already an ICP associated with it.
>
> Ref: arch/powerpc/kvm/book3s_xics.c:kvmppc_xics_connect_vcpu() kernel code.
Ah, right. Sounds like a kernel bug - I would expect enabling a
capability to be idempotent. But since the bug's there, we have to
work around it now, so ok.
> So this patch will ensure that we don't renable this cap.
>
> Regards,
> Bharata.
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
pgpOV4e4CRKVN.pgp
Description: PGP signature
- Re: [Qemu-ppc] [RFC PATCH v2 14/23] cpus: Convert cpu_index into a bitmap, (continued)
- [Qemu-ppc] [RFC PATCH v2 18/23] xics_kvm: Add cpu_destroy method to XICS, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 19/23] spapr: CPU hot unplug support, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 20/23] spapr: Remove vCPU objects after CPU hot unplug, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 21/23] spapr: Initialize hotplug memory address space, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 22/23] spapr: Support ibm, dynamic-reconfiguration-memory, Bharata B Rao, 2015/03/23