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

Commit faf78829 authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman
Browse files

powerpc/mm: Add a parameter to disable 1TB segs



This patch adds the kernel command line parameter "no_tb_segs" which
forces the kernel to use 256MB rather than 1TB segments. Forcing the use
of 256MB segments makes it considerably easier to test code that depends
on an SLB miss occurring.

Suggested-by: default avatarMichael Neuling <mikey@neuling.org>
Suggested-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 79901024
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -920,6 +920,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
	dhash_entries=	[KNL]
	dhash_entries=	[KNL]
			Set number of hash buckets for dentry cache.
			Set number of hash buckets for dentry cache.


	disable_1tb_segments [PPC]
			Disables the use of 1TB hash page table segments. This
			causes the kernel to fall back to 256MB segments which
			can be useful when debugging issues that require an SLB
			miss to occur.

	disable=	[IPV6]
	disable=	[IPV6]
			See Documentation/networking/ipv6.txt.
			See Documentation/networking/ipv6.txt.


+15 −0
Original line number Original line Diff line number Diff line
@@ -317,6 +317,15 @@ int htab_remove_mapping(unsigned long vstart, unsigned long vend,
	return ret;
	return ret;
}
}


static bool disable_1tb_segments = false;

static int __init parse_disable_1tb_segments(char *p)
{
	disable_1tb_segments = true;
	return 0;
}
early_param("disable_1tb_segments", parse_disable_1tb_segments);

static int __init htab_dt_scan_seg_sizes(unsigned long node,
static int __init htab_dt_scan_seg_sizes(unsigned long node,
					 const char *uname, int depth,
					 const char *uname, int depth,
					 void *data)
					 void *data)
@@ -335,6 +344,12 @@ static int __init htab_dt_scan_seg_sizes(unsigned long node,
	for (; size >= 4; size -= 4, ++prop) {
	for (; size >= 4; size -= 4, ++prop) {
		if (be32_to_cpu(prop[0]) == 40) {
		if (be32_to_cpu(prop[0]) == 40) {
			DBG("1T segment support detected\n");
			DBG("1T segment support detected\n");

			if (disable_1tb_segments) {
				DBG("1T segments disabled by command line\n");
				break;
			}

			cur_cpu_spec->mmu_features |= MMU_FTR_1T_SEGMENT;
			cur_cpu_spec->mmu_features |= MMU_FTR_1T_SEGMENT;
			return 1;
			return 1;
		}
		}