[GIT PULL] x86/mtrr for 6.5

From: Borislav Petkov
Date: Tue Jun 27 2023 - 07:53:28 EST


Hi Linus,

please pull the MTRR cleanup Juergen has been working on for a while
now, for 6.5.

Thx.

---

The following changes since commit ac9a78681b921877518763ba0e89202254349d1b:

Linux 6.4-rc1 (2023-05-07 13:34:35 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tags/x86_mtrr_for_v6.5

for you to fetch changes up to 30d65d1b19850c9bc8c17dba8ebe9be5e0c17054:

x86/xen: Set default memory type for PV guests to WB (2023-06-16 11:22:33 +0200)

----------------------------------------------------------------
- A serious scrubbing of the MTRR code including adding a new map
mechanism in order to look up the memory type of a region easily. Also
address memory range lookup issues like returning an invalid memory
type. Furthermore, this handles the decoupling of PAT from MTRR more
naturally. All work by Juergen Gross

----------------------------------------------------------------
Borislav Petkov (AMD) (1):
x86/mtrr: Unify debugging printing

Juergen Gross (17):
x86/mtrr: Remove physical address size calculation
x86/mtrr: Replace size_or_mask and size_and_mask with a much easier concept
x86/mtrr: Support setting MTRR state for software defined MTRRs
x86/hyperv: Set MTRR state when running as SEV-SNP Hyper-V guest
x86/xen: Set MTRR state when running as Xen PV initial domain
x86/mtrr: Replace vendor tests in MTRR code
x86/mtrr: Have only one set_mtrr() variant
x86/mtrr: Move 32-bit code from mtrr.c to legacy.c
x86/mtrr: Allocate mtrr_value array dynamically
x86/mtrr: Add get_effective_type() service function
x86/mtrr: Construct a memory map with cache modes
x86/mtrr: Add mtrr=debug command line option
x86/mtrr: Use new cache_map in mtrr_type_lookup()
x86/mtrr: Don't let mtrr_type_lookup() return MTRR_TYPE_INVALID
x86/mm: Only check uniform after calling mtrr_type_lookup()
x86/mtrr: Remove unused code
x86/xen: Set default memory type for PV guests to WB

Documentation/admin-guide/kernel-parameters.txt | 4 +
arch/x86/hyperv/ivm.c | 4 +
arch/x86/include/asm/mtrr.h | 51 +-
arch/x86/include/uapi/asm/mtrr.h | 14 +-
arch/x86/kernel/cpu/mtrr/Makefile | 2 +-
arch/x86/kernel/cpu/mtrr/amd.c | 2 +-
arch/x86/kernel/cpu/mtrr/centaur.c | 11 +-
arch/x86/kernel/cpu/mtrr/cleanup.c | 87 ++-
arch/x86/kernel/cpu/mtrr/cyrix.c | 2 +-
arch/x86/kernel/cpu/mtrr/generic.c | 675 ++++++++++++++++--------
arch/x86/kernel/cpu/mtrr/legacy.c | 90 ++++
arch/x86/kernel/cpu/mtrr/mtrr.c | 206 ++------
arch/x86/kernel/cpu/mtrr/mtrr.h | 31 +-
arch/x86/kernel/setup.c | 2 +
arch/x86/mm/pgtable.c | 24 +-
arch/x86/xen/enlighten_pv.c | 54 ++
16 files changed, 777 insertions(+), 482 deletions(-)
create mode 100644 arch/x86/kernel/cpu/mtrr/legacy.c

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette