From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Subject: Re: [PATCH 3/3] powerpc/mm: Speed up computation of base and actual page size for a HPTE Date: Mon, 05 Sep 2016 10:34:16 +0530 Message-ID: <877farq6nj.fsf@linux.vnet.ibm.com> References: <20160902114759.GA12433@fergus.ozlabs.ibm.com> <20160902115055.GC12433@fergus.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Paul Mackerras , linuxppc-dev@lists.ozlabs.org Return-path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59574 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752060AbcIEFEZ (ORCPT ); Mon, 5 Sep 2016 01:04:25 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8552rQ7147426 for ; Mon, 5 Sep 2016 01:04:24 -0400 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0b-001b2d01.pphosted.com with ESMTP id 258buyafrf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 05 Sep 2016 01:04:24 -0400 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 4 Sep 2016 23:04:23 -0600 In-Reply-To: <20160902115055.GC12433@fergus.ozlabs.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: > +static void init_hpte_page_sizes(void) > +{ > + long int ap, bp; > + long int shift, penc; > + > + for (bp = 0; bp < MMU_PAGE_COUNT; ++bp) { > + if (!mmu_psize_defs[bp].shift) > + continue; /* not a supported page size */ > + for (ap = bp; ap < MMU_PAGE_COUNT; ++ap) { > + penc = mmu_psize_defs[bp].penc[ap]; > + if (penc == -1) > + continue; > + shift = mmu_psize_defs[ap].shift - LP_SHIFT; > + if (shift <= 0) > + continue; /* should never happen */ > + while (penc < (1 << LP_BITS)) { > + hpte_page_sizes[penc] = (ap << 4) | bp; > + penc += 1 << shift; > + } > + } > + } > +} > + Going through this again, it is confusing . How are we differentiating between the below penc values 0000 000z >=8KB (z = 1) 0000 zzzz >=64KB (zzzz = 0001) Those are made up 'z' values. -aneesh