From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Date: Wed, 26 Sep 2018 11:23:19 +0000 Subject: Re: [RFC PATCH 19/32] KVM: PPC: Book3S HV: Framework and hcall stubs for nested virtualization Message-Id: <20180926112319.GE29799@fergus> List-Id: References: <1537524123-9578-20-git-send-email-paulus@ozlabs.org> In-Reply-To: <1537524123-9578-20-git-send-email-paulus@ozlabs.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Wed, Sep 26, 2018 at 03:19:00PM +1000, David Gibson wrote: > On Fri, Sep 21, 2018 at 08:01:50PM +1000, Paul Mackerras wrote: > > +static void kvmhv_remove_nested(struct kvm_nested_guest *gp) > > +{ > > + struct kvm *kvm = gp->parent; > > + int lpid = gp->l1_lpid; > > + long ref; > > + > > + spin_lock(&kvm->mmu_lock); > > + if (gp = kvm->arch.nested_guests[lpid]) { > > + kvm->arch.nested_guests[lpid] = NULL; > > + while (--lpid >= 0 && !kvm->arch.nested_guests[lpid]) > > + ; > > This only looks correct of gp is the guest of KVM with the highest > l1_lpid. It's not obvious why that would have to be the case. Not obvious because not true. Good catch. :) Paul.