]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: shifted-by-one hidx value
authorRam Pai <linuxram@us.ibm.com>
Mon, 6 Nov 2017 08:50:49 +0000 (00:50 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 20 Dec 2017 07:57:23 +0000 (18:57 +1100)
commitb35d7af3889411c90e793a9ed036a133f5bd71d4
tree639e0cf44a56bcbd031714cbec988ec51faa82d1
parentc76651f420126e29548658445ae27c0fd4dd571f
powerpc: shifted-by-one hidx value

0xf is considered invalid hidx value. It indicates absence of a backing
HPTE. A PTE is initialized to 0xf either
a) when it is new it is newly allocated to hold 4k-backing-HPTE
or
b) Any time it gets demoted to a 4k-backing-HPTE

This patch shifts the representation by one-modulo-0xf; i.e hidx 0 is
represented as 1, 1 as 2,... , and 0xf as 0. This convention lets us
initialize the secondary-part of the PTE to all zeroes. PTEs are anyway
zero'd when allocated. We do not have to zero them again; thus saving on
the initialization.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/hash-64k.h