Skip to content

powerpc: Free up RPAGE_RSV bits in 64K PTE

Ram Pai linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6powerpc: Free up four 64K PTE bits in 4K backed HPTE pagesarch/powerpc/include/asm/book3s/64/hash-4k.h arch/powerpc/include/asm/book3s/64/hash-64k.h arch/powerpc/include/asm/book3s/64/hash.h +2 more+55 -344 replies
2/6powerpc: Free up four 64K PTE bits in 64K backed HPTE pagesarch/powerpc/include/asm/book3s/64/hash-4k.h arch/powerpc/include/asm/book3s/64/hash-64k.h arch/powerpc/include/asm/book3s/64/hash.h +2 more+61 -340 replies
3/6powerpc: capture the PTE format changes in the dump pte reportarch/powerpc/mm/dump_linuxpagetables.c+2 -10 replies
4/6powerpc: introduce pte_set_hash_slot() helperarch/powerpc/include/asm/book3s/64/hash-4k.h arch/powerpc/include/asm/book3s/64/hash-64k.h+40 -00 replies
5/6powerpc: introduce pte_get_hash_gslot() helperarch/powerpc/include/asm/book3s/64/hash.h arch/powerpc/mm/hash_utils_64.c+21 -00 replies
6/6powerpc: use helper functions to get and set hash slotsarch/powerpc/mm/hash64_4k.c arch/powerpc/mm/hash64_64k.c arch/powerpc/mm/hash_utils_64.c +1 more+27 -860 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchAneesh Kumar K.V
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] powerpc: Free up RPAGE_RSV bits in 64K PTE

RPAGE_RSV0..4 pte bits are currently used for hpte slot

tracking. We  need  these bits   for  memory-protection
keys. Luckily these  four bits   are  relatively easier 

to move among all the other candidate bits.

For 64K linux-ptes backed by 4k hptes, these bits
are used for tracking the validity of the slot value
stored in the second-part-of-the-pte. We device a new
mechanism for tracking the validity without using
those bits. The mechanism is explained in the first
patch.

For 64K linux-pte backed by 64K hptes, we simply move
the slot tracking bits to the second-part-of-the-pte.

The above mechanism is also used to free the bits for hugetlb linux-ptes.

Testing:
--------
has survived kernel compilation on multiple platforms p8 powernv hash-mode, p9 powernv hash-mode, p7 powervm, p8-powervm, p8-kvm-guest.

Has survived git-bisect on p8 power-nv with 64K page and 4K page.

History:
-------
This patchset is a spin-off from the memkey patchset.

version v7:
(1) GIX bit reset change moved to the second patch -- noticed by Aneesh.
(2) Separated this patches from memkey patchset
(3) merged a bunch of patches, that used the helper function, into one.
version v6:
(1) No changes related to pte.

version v5:
(1) No changes related to pte.

version v4:
(1) No changes related to pte.

version v3:
(1) split the patches into smaller consumable patches.
(2) A bug fix while invalidating a hpte slot in __hash_page_4K()
-- noticed by Aneesh

version v2:
(1) fixed a bug in 4k hpte backed 64k pte
where page invalidation was not
done correctly, and initialization
of second-part-of-the-pte was not
done correctly if the pte was not
yet Hashed with a hpte.
-- Reported by Aneesh.

version v1: Initial version

Ram Pai (6):
powerpc: Free up four 64K PTE bits in 4K backed HPTE pages
powerpc: Free up four 64K PTE bits in 64K backed HPTE pages
powerpc: capture the PTE format changes in the dump pte report
powerpc: introduce pte_set_hash_slot() helper
powerpc: introduce pte_get_hash_gslot() helper
powerpc: use helper functions to get and set hash slots

 arch/powerpc/include/asm/book3s/64/hash-4k.h  |   20 ++++
 arch/powerpc/include/asm/book3s/64/hash-64k.h |   60 ++++++++----
 arch/powerpc/include/asm/book3s/64/hash.h     |    7 +-
 arch/powerpc/mm/dump_linuxpagetables.c        |    3 +-
 arch/powerpc/mm/hash64_4k.c                   |   14 +--
 arch/powerpc/mm/hash64_64k.c                  |  124 +++++++++++++------------
 arch/powerpc/mm/hash_utils_64.c               |   35 +++++--
 arch/powerpc/mm/hugetlbpage-hash64.c          |   16 +--
 8 files changed, 165 insertions(+), 114 deletions(-)