From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Subject: Re: [PATCH] KVM: PPC: Book3S HV: Replace kvmppc_find_vcpu() with kvm_get_vcpu() Date: Fri, 08 May 2015 19:01:07 +1000 Message-ID: <1431075667.9673.10.camel@ellerman.id.au> References: <1431013779-28910-1-git-send-email-thuth@redhat.com> <20150507230718.GA9410@iris.ozlabs.ibm.com> <20150508101904.509c629a@thh440s> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Paul Mackerras , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, agraf@suse.de, gleb@kernel.org, pbonzini@redhat.com, benh@kernel.crashing.org To: Thomas Huth Return-path: Received: from ozlabs.org ([103.22.144.67]:37471 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750889AbbEHJBK (ORCPT ); Fri, 8 May 2015 05:01:10 -0400 In-Reply-To: <20150508101904.509c629a@thh440s> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2015-05-08 at 10:19 +0200, Thomas Huth wrote: > On Fri, 8 May 2015 09:07:18 +1000 > Paul Mackerras wrote: > > > On Thu, May 07, 2015 at 05:49:39PM +0200, Thomas Huth wrote: > > > Both functions are doing the same thing - looking up the struct > > > kvm_vcpu pointer for a given vCPU ID. > > > > No, kvm_get_vcpu(n) returns the n'th vcpu created, which is often > > but not necessarily the same as the vcpu with id n. In fact, due to > > the way we do threading in HV KVM, it's quite common for userspace to > > create vcpus with ids 0, 8, 16, ..., which means that the n'th vcpu > > created does not have id n (except of course for vcpu 0). A patch adding a comment explaining that subtlety would be welcome from anyone who sent it :) cheers