android_kernel_motorola_sm6375/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Paolo Bonzini ace0fdf796 x86/cpu/intel: Detect TME keyid bits before setting MTRR mask registers
commit 6890cb1ace350b4386c8aee1343dc3b3ddd214da upstream.

MKTME repurposes the high bit of physical address to key id for encryption
key and, even though MAXPHYADDR in CPUID[0x80000008] remains the same,
the valid bits in the MTRR mask register are based on the reduced number
of physical address bits.

detect_tme() in arch/x86/kernel/cpu/intel.c detects TME and subtracts
it from the total usable physical bits, but it is called too late.
Move the call to early_init_intel() so that it is called in setup_arch(),
before MTRRs are setup.

This fixes boot on TDX-enabled systems, which until now only worked with
"disable_mtrr_cleanup".  Without the patch, the values written to the
MTRRs mask registers were 52-bit wide (e.g. 0x000fffff_80000800) and
the writes failed; with the patch, the values are 46-bit wide, which
matches the reduced MAXPHYADDR that is shown in /proc/cpuinfo.

Reported-by: Zixi Chen <zixchen@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/20240131230902.1867092-3-pbonzini%40redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-06 14:36:10 +00:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:19:25 +02:00
arc ARC: fix spare error 2024-01-25 14:34:20 -08:00
arm ARM: ep93xx: Add terminator to gpiod_lookup_table 2024-03-01 13:13:36 +01:00
arm64 arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node 2024-03-01 13:13:35 +01:00
c6x
csky
h8300
hexagon
ia64 arch, mm: remove stale mentions of DISCONIGMEM 2024-02-23 08:25:13 +01:00
m68k m68k: Fix invalid .section syntax 2023-09-23 10:59:38 +02:00
microblaze
mips mips: Fix max_mapnr being uninitialized on early stages 2024-02-23 08:25:13 +01:00
nds32 arch, mm: remove stale mentions of DISCONIGMEM 2024-02-23 08:25:13 +01:00
nios2
openrisc
parisc parisc/firmware: Fix F-extend for PDC addresses 2024-02-23 08:24:48 +01:00
powerpc powerpc/lib: Validate size for vector operations 2024-02-23 08:24:54 +01:00
riscv
s390 s390: use the correct count for __iowrite64_copy() 2024-03-01 13:13:37 +01:00
sh sh: bios: Revive earlyprintk support 2023-11-20 10:30:13 +01:00
sparc sparc/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
um um: net: Fix return type of uml_net_start_xmit() 2024-02-23 08:25:02 +01:00
unicore32
x86 x86/cpu/intel: Detect TME keyid bits before setting MTRR mask registers 2024-03-06 14:36:10 +00:00
xtensa arch, mm: remove stale mentions of DISCONIGMEM 2024-02-23 08:25:13 +01:00
.gitignore
Kconfig