Tom Lendacky 3dc633cb63 x86/sev: Do RMP memory coverage check after max_pfn has been set
[ Upstream commit 0440feb090790c6243bca85d6a794824e71ff26c ]

The RMP table is probed early in the boot process before max_pfn has been
set, so the logic to check if the RMP covers all of system memory is not
valid.

Move the RMP memory coverage check from snp_probe_rmptable_info() into
snp_rmptable_init(), which is well after max_pfn has been set. Also, fix
the calculation to use PFN_UP instead of PHYS_PFN, in order to compute
the required RMP size properly.

Fixes: 216d106c7ff7 ("x86/sev: Add SEV-SNP host initialization support")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/bec4364c7e34358cc576f01bb197a7796a109169.1718984524.git.thomas.lendacky@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-03 08:59:30 +02:00
..
2024-05-23 19:40:26 -07:00
2024-05-27 16:26:30 -07:00
2024-05-18 12:39:20 -07:00
2024-07-06 18:31:24 -07:00
2024-07-05 12:22:51 -07:00
2024-06-25 15:57:26 +02:00