mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-08 18:57:22 +00:00
x86/mtrr: Remove physical address size calculation
[ Upstream commitf6b980646b] The physical address width calculation in mtrr_bp_init() can easily be replaced with using the already available value x86_phys_bits from struct cpuinfo_x86. The same information source can be used in mtrr/cleanup.c, removing the need to pass that value on to mtrr_cleanup(). In print_mtrr_state() use x86_phys_bits instead of recalculating it from size_or_mask. Move setting of size_or_mask and size_and_mask into a dedicated new function in mtrr/generic.c, enabling to make those 2 variables static, as they are used in generic.c only now. Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Tested-by: Michael Kelley <mikelley@microsoft.com> Link: https://lore.kernel.org/r/20230502120931.20719-2-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Stable-dep-of:c957f1f3c4("x86/hyperv: Set MTRR state when running as SEV-SNP Hyper-V guest") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
29b1da4f90
commit
780091fe14
4 changed files with 29 additions and 64 deletions
Loading…
Add table
Add a link
Reference in a new issue