OSDN Git Service

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)
commit7b84947cadf18f9a7763f281509db1f24073b4af
tree639e0cf44a56bcbd031714cbec988ec51faa82d1
parentbf9a95f9a6481bc6ec98ef7b328c14177eeb3492
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