Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74f227b2 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Benjamin Herrenschmidt
Browse files

powerpc: Use encode avpn where we need only avpn values



In all these cases we are doing something similar to

HPTE_V_COMPARE(hpte_v, want_v) which ignores the HPTE_V_LARGE bit

With MPSS support we would need actual page size to set HPTE_V_LARGE
bit and that won't be available in most of these cases. Since we are ignoring
HPTE_V_LARGE bit, use the  avpn value instead. There should not be any change
in behaviour after this patch.

Acked-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 5c1f6ee9
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
	unsigned long hpte_v, want_v;
	int ret = 0;

	want_v = hpte_encode_v(vpn, psize, ssize);
	want_v = hpte_encode_avpn(vpn, psize, ssize);

	DBG_LOW("    update(vpn=%016lx, avpnv=%016lx, group=%lx, newpp=%lx)",
		vpn, want_v & HPTE_V_AVPN, slot, newpp);
@@ -288,7 +288,7 @@ static long native_hpte_find(unsigned long vpn, int psize, int ssize)
	unsigned long want_v, hpte_v;

	hash = hpt_hash(vpn, mmu_psize_defs[psize].shift, ssize);
	want_v = hpte_encode_v(vpn, psize, ssize);
	want_v = hpte_encode_avpn(vpn, psize, ssize);

	/* Bolted mappings are only ever in the primary group */
	slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
@@ -348,7 +348,7 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long vpn,

	DBG_LOW("    invalidate(vpn=%016lx, hash: %lx)\n", vpn, slot);

	want_v = hpte_encode_v(vpn, psize, ssize);
	want_v = hpte_encode_avpn(vpn, psize, ssize);
	native_lock_hpte(hptep);
	hpte_v = hptep->v;

@@ -520,7 +520,7 @@ static void native_flush_hash_range(unsigned long number, int local)
			slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
			slot += hidx & _PTEIDX_GROUP_IX;
			hptep = htab_address + slot;
			want_v = hpte_encode_v(vpn, psize, ssize);
			want_v = hpte_encode_avpn(vpn, psize, ssize);
			native_lock_hpte(hptep);
			hpte_v = hptep->v;
			if (!HPTE_V_COMPARE(hpte_v, want_v) ||
+5 −5
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ static long beat_lpar_hpte_updatepp(unsigned long slot,
	u64 dummy0, dummy1;
	unsigned long want_v;

	want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M);
	want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M);

	DBG_LOW("    update: "
		"avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
@@ -228,7 +228,7 @@ static long beat_lpar_hpte_find(unsigned long vpn, int psize)
	unsigned long want_v, hpte_v;

	hash = hpt_hash(vpn, mmu_psize_defs[psize].shift, MMU_SEGSIZE_256M);
	want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M);
	want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M);

	for (j = 0; j < 2; j++) {
		slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
@@ -283,7 +283,7 @@ static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn,

	DBG_LOW("    inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
		slot, va, psize, local);
	want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M);
	want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M);

	raw_spin_lock_irqsave(&beat_htab_lock, flags);
	dummy1 = beat_lpar_hpte_getword0(slot);
@@ -372,7 +372,7 @@ static long beat_lpar_hpte_updatepp_v3(unsigned long slot,
	unsigned long want_v;
	unsigned long pss;

	want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M);
	want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M);
	pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;

	DBG_LOW("    update: "
@@ -402,7 +402,7 @@ static void beat_lpar_hpte_invalidate_v3(unsigned long slot, unsigned long vpn,

	DBG_LOW("    inval : slot=%lx, vpn=%016lx, psize: %d, local: %d\n",
		slot, vpn, psize, local);
	want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M);
	want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M);
	pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;

	lpar_rc = beat_invalidate_htab_entry3(0, slot, want_v, pss);
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp,
	unsigned long flags;
	long ret;

	want_v = hpte_encode_v(vpn, psize, ssize);
	want_v = hpte_encode_avpn(vpn, psize, ssize);

	spin_lock_irqsave(&ps3_htab_lock, flags);