Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486AbcDZHpa (ORCPT ); Tue, 26 Apr 2016 03:45:30 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:33346 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226AbcDZHp3 (ORCPT ); Tue, 26 Apr 2016 03:45:29 -0400 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: cornelia.huck@de.ibm.com X-IBM-RcptTo: kvm@vger.kernel.org;linux-kernel@vger.kernel.org Date: Tue, 26 Apr 2016 09:44:58 +0200 From: Cornelia Huck To: Greg Kurz Cc: Paolo Bonzini , james.hogan@imgtec.com, mingo@redhat.com, linux-mips@linux-mips.org, kvm@vger.kernel.org, rkrcmar@redhat.com, linux-kernel@vger.kernel.org, David Hildenbrand , qemu-ppc@nongnu.org, Paul Mackerras , David Gibson Subject: Re: [PATCH v4 1/2] KVM: remove NULL return path for vcpu ids >= KVM_MAX_VCPUS Message-ID: <20160426094458.03685ae5.cornelia.huck@de.ibm.com> In-Reply-To: <146124810201.32509.2946887043729554992.stgit@bahia.huguette.org> References: <146124809455.32509.15232948272580716135.stgit@bahia.huguette.org> <146124810201.32509.2946887043729554992.stgit@bahia.huguette.org> Organization: IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz =?UTF-8?B?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= Dirk Wittkopp Sitz der Gesellschaft: =?UTF-8?B?QsO2Ymxpbmdlbg==?= Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16042607-0041-0000-0000-00001B463072 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 691 Lines: 17 On Thu, 21 Apr 2016 16:15:05 +0200 Greg Kurz wrote: > Commit c896939f7cff ("KVM: use heuristic for fast VCPU lookup by id") added > a return path that prevents vcpu ids to exceed KVM_MAX_VCPUS. This is a > problem for powerpc where vcpu ids can grow up to 8*KVM_MAX_VCPUS. > > This patch simply reverses the logic so that we only try fast path if the > vcpu id can be tried as an index in kvm->vcpus[]. The slow path is not > affected by the change. > > Signed-off-by: Greg Kurz > --- > include/linux/kvm_host.h | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) Reviewed-by: Cornelia Huck