public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* [PATCH v9 0/8] powerpc: Free up RPAGE_RSV bits
@ 2017-11-06  8:50 Ram Pai
  2017-11-06  8:50 ` [PATCH v9 1/8] powerpc: introduce pte_set_hidx() helper Ram Pai
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Ram Pai @ 2017-11-06  8:50 UTC (permalink / raw)
  To: mpe
  Cc: linuxppc-dev, benh, paulus, khandual, aneesh.kumar, bsingharora,
	hbabu, mhocko, bauerman, ebiederm, linuxram

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.

For 4k linux-PTE, we have only 3 free bits available. We swizzle
around the bits and release RPAGE_RSV{2,3,4} for memory protection
keys.

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

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

version v10:
	(1) hidx value is rotated by one to save
		initialization of the secondary-PTE.
	(2) comments are not anymore right justified.
		-- comment by mpe

version v9:
	(1) rearranged the patch order. First the helper
	routines are defined followed by the
	patches that make use of the helpers.

version v8:
	(1) an additional patch added to free up
	RSV{2,3,4} on 4K linux-PTE.

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 (8):
  powerpc: introduce pte_set_hidx() helper
  powerpc: introduce pte_get_hash_gslot() helper
  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: shifted-by-one hidx value
  powerpc: Swizzle around 4K PTE bits to free up bit 5 and bit 6
  powerpc: use helper functions to get and set hash slots
  powerpc: capture the PTE format changes in the dump pte report

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-01-17 13:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06  8:50 [PATCH v9 0/8] powerpc: Free up RPAGE_RSV bits Ram Pai
2017-11-06  8:50 ` [PATCH v9 1/8] powerpc: introduce pte_set_hidx() helper Ram Pai
2018-01-17 13:30   ` [v9,1/8] " Michael Ellerman
2017-11-06  8:50 ` [PATCH v9 2/8] powerpc: introduce pte_get_hash_gslot() helper Ram Pai
2017-11-06  8:50 ` [PATCH v9 3/8] powerpc: Free up four 64K PTE bits in 4K backed HPTE pages Ram Pai
2017-11-06  8:50 ` [PATCH v9 4/8] powerpc: Free up four 64K PTE bits in 64K " Ram Pai
2017-11-06  8:50 ` [PATCH v9 5/8] powerpc: shifted-by-one hidx value Ram Pai
2017-11-06  8:50 ` [PATCH v9 6/8] powerpc: Swizzle around 4K PTE bits to free up bit 5 and bit 6 Ram Pai
2017-11-06  8:50 ` [PATCH v9 7/8] powerpc: use helper functions to get and set hash slots Ram Pai
2017-11-06  8:50 ` [PATCH v9 8/8] powerpc: capture the PTE format changes in the dump pte report Ram Pai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox