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

Commit e7f6706b authored by Suzuki K Poulose's avatar Suzuki K Poulose Committed by Isaac J. Manjarres
Browse files

arm64: capabilities: Add support for checks based on a list of MIDRs



Add helpers for detecting an errata on list of midr ranges
of affected CPUs, with the same work around.

Change-Id: I3f2ef42a19b319ca35fccf715ee14bef85eaf671
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: default avatarDave Martin <dave.martin@arm.com>
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Git-commit: be5b2998
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


[isaacm@codeaurora.org: remove code that is not needed for
 having a way of expressing the list of CPUs that would
 be impacted by erratum 1024718.]
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent f7806105
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -149,6 +149,15 @@ static inline bool is_midr_in_range(u32 midr, struct midr_range const *range)
				 range->rv_min, range->rv_max);
				 range->rv_min, range->rv_max);
}
}


static inline bool
is_midr_in_range_list(u32 midr, struct midr_range const *ranges)
{
	while (ranges->model)
		if (is_midr_in_range(midr, ranges++))
			return true;
	return false;
}

/*
/*
 * The CPU ID never changes at run time, so we might as well tell the
 * The CPU ID never changes at run time, so we might as well tell the
 * compiler that it's constant.  Use this function to read the CPU ID
 * compiler that it's constant.  Use this function to read the CPU ID