From: Paul Mackerras <paulus@ozlabs.org>
To: Michael Ellerman <michael@ellerman.id.au>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
kvm-ppc@vger.kernel.org
Subject: Re: [PATCH v2 3/3] powerpc/mm: Speed up computation of base and actual page size for a HPTE
Date: Thu, 8 Sep 2016 20:08:36 +1000 [thread overview]
Message-ID: <20160908100836.GA4965@fergus.ozlabs.ibm.com> (raw)
In-Reply-To: <20160907061709.GD21443@fergus.ozlabs.ibm.com>
On Wed, Sep 07, 2016 at 04:17:09PM +1000, Paul Mackerras wrote:
> This replaces a 2-D search through an array with a simple 8-bit table
> lookup for determining the actual and/or base page size for a HPT entry.
>
> The encoding in the second doubleword of the HPTE is designed to encode
> the actual and base page sizes without using any more bits than would be
> needed for a 4k page number, by using between 1 and 8 low-order bits of
> the RPN (real page number) field to encode the page sizes. A single
> "large page" bit in the first doubleword indicates that these low-order
> bits are to be interpreted like this.
>
> We can determine the page sizes by using the low-order 8 bits of the RPN
> to look up a 256-entry table. For actual page sizes less than 1MB, some
> of the upper bits of these 8 bits are going to be real address bits, but
> we can cope with that by replicating the entries for those smaller page
> sizes.
>
> While we're at it, let's move the hpte_page_size() and hpte_base_page_size()
> functions from a KVM-specific header to a header for 64-bit HPT systems,
> since this computation doesn't have anything specifically to do with KVM.
>
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> ---
> v2: added more comments as suggested by Aneesh
>
> arch/powerpc/include/asm/book3s/64/mmu-hash.h | 37 ++++++++++++
> arch/powerpc/include/asm/kvm_book3s_64.h | 87 +++------------------------
> arch/powerpc/include/asm/mmu.h | 1 +
> arch/powerpc/mm/hash_native_64.c | 42 +------------
> arch/powerpc/mm/hash_utils_64.c | 55 +++++++++++++++++
This of course touches two maintainers' areas. Michael and Paolo, how
do you want to proceed here? Can this just go through Michael's tree?
Or should I make a topic branch off Linus' tree that you can both
pull, or should I split the patch into two (i.e. everything except the
kvm_book3s_64.h change in the first patch, and the kvm_book3s_64.h
change in the second) and get Michael to put the first one in a topic
branch that I can then pull and apply the second patch onto?
Thanks,
Paul.
next prev parent reply other threads:[~2016-09-08 10:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-02 11:47 [PATCH 1/3] powerpc/mm: Don't alias user region to other regions below PAGE_OFFSET Paul Mackerras
2016-09-02 11:49 ` [PATCH 2/3] powerpc/mm: Preserve CFAR value on SLB miss caused by access to bogus address Paul Mackerras
2016-09-04 11:30 ` Aneesh Kumar K.V
2016-09-07 5:52 ` Paul Mackerras
2016-09-13 12:16 ` [2/3] " Michael Ellerman
2016-09-02 11:50 ` [PATCH 3/3] powerpc/mm: Speed up computation of base and actual page size for a HPTE Paul Mackerras
2016-09-04 11:16 ` Aneesh Kumar K.V
2016-09-05 5:04 ` Aneesh Kumar K.V
2016-09-07 5:07 ` Paul Mackerras
2016-09-07 6:17 ` [PATCH v2 " Paul Mackerras
2016-09-08 10:08 ` Paul Mackerras [this message]
2016-09-08 10:16 ` Paolo Bonzini
2016-09-12 0:58 ` Paul Mackerras
2016-09-12 3:03 ` Michael Ellerman
2016-09-12 9:45 ` Paolo Bonzini
2016-09-02 12:22 ` [PATCH 1/3] powerpc/mm: Don't alias user region to other regions below PAGE_OFFSET Aneesh Kumar K.V
2016-09-03 9:54 ` Paul Mackerras
2016-09-04 11:31 ` Aneesh Kumar K.V
2016-09-08 9:47 ` [1/3] " Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160908100836.GA4965@fergus.ozlabs.ibm.com \
--to=paulus@ozlabs.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).