]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/sev: Treat the contiguous RMP table as a single RMP segment
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 2 Dec 2024 20:50:51 +0000 (14:50 -0600)
committerBorislav Petkov (AMD) <bp@alien8.de>
Sat, 14 Dec 2024 10:40:01 +0000 (11:40 +0100)
commit0f14af0d1d7df0086b1be98d2cea1cad4b8c826f
tree1bda2975f43299edede7666459490ca28ca1535e
parentac517965a5a12d685f1e7a7f77e64503167f87d5
x86/sev: Treat the contiguous RMP table as a single RMP segment

In preparation for support of a segmented RMP table, treat the contiguous
RMP table as a segmented RMP table with a single segment covering all
of memory. By treating a contiguous RMP table as a single segment, much
of the code that initializes and accesses the RMP can be re-used.

Segmented RMP tables can have up to 512 segment entries. Each segment
will have metadata associated with it to identify the segment location,
the segment size, etc. The segment data and the physical address are used
to determine the index of the segment within the table and then the RMP
entry within the segment. For an actual segmented RMP table environment,
much of the segment information will come from a configuration MSR. For
the contiguous RMP, though, much of the information will be statically
defined.

  [ bp: Touchups, explain array_index_nospec() usage. ]

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Reviewed-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Link: https://lore.kernel.org/r/8c40fbc9c5217f0d79b37cf861eff03ab0330bef.1733172653.git.thomas.lendacky@amd.com
arch/x86/virt/svm/sev.c