From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Subject: Re: [PATCH] target-ppc: Update slb array with correct index values. Date: Wed, 21 Aug 2013 21:29:31 +0530 Message-ID: <87vc2zkpb0.fsf@linux.vnet.ibm.com> References: <1376245011-20008-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <8810AF54-BB64-4313-AD32-C42608527B38@suse.de> <874nam5ei5.fsf@linux.vnet.ibm.com> <20130821051112.GB14481@iris.ozlabs.ibm.com> <4A3B1A8D-C1DC-41A7-A7ED-95C9FC791BA1@suse.de> <20130821092556.GC14481@iris.ozlabs.ibm.com> <3D410934-51C0-43D3-BC5B-BC3B40D2C8B8@suse.de> Mime-Version: 1.0 Content-Type: text/plain Cc: "kvm-ppc\@vger.kernel.org" , "kvm\@vger.kernel.org list" To: Alexander Graf , Paul Mackerras Return-path: Received: from e28smtp07.in.ibm.com ([122.248.162.7]:54207 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483Ab3HUP7k (ORCPT ); Wed, 21 Aug 2013 11:59:40 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Aug 2013 21:20:34 +0530 In-Reply-To: <3D410934-51C0-43D3-BC5B-BC3B40D2C8B8@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Alexander Graf writes: .... >> >> On HV KVM yes, that would be the end of the list, but PR KVM could >> give you entry 0 containing esid==0 and vsid==0 followed by valid >> entries. Perhaps the best approach is to ignore any entries with >> SLB_ESID_V clear. > > That means we don't clear entries we don't receive from the kernel because they're V=0 but which were V=1 before. Which with the current code is probably already broken. > > So yes, clear all cached entries first (to make sure we have no stale > ones), then loop through all and only add entries with V=1 should fix > everything for PR as well as HV. This is more or less what the patch is doing. The kernel already does memset of all the slb entries. The only difference is we don't depend on the slb index in the return value. Instead we just use the array index as the slb index. Do we really need to make sure the slb index remain same ? -aneesh