diff options
author | Michael Kelley <[email protected]> | 2023-03-08 18:40:05 -0800 |
---|---|---|
committer | Borislav Petkov (AMD) <[email protected]> | 2023-03-27 09:23:21 +0200 |
commit | c7b5254bd802ee3868f1c59333545272dc700d6d (patch) | |
tree | ebecf38fb6074e6984b192fa56c6fb4f6a0d2af9 /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf | |
parent | d33ddc92db8a61416473ff3d7f1c621c50733dc0 (diff) |
x86/mm: Handle decryption/re-encryption of bss_decrypted consistently
sme_postprocess_startup() decrypts the bss_decrypted section when
sme_me_mask is non-zero.
mem_encrypt_free_decrypted_mem() re-encrypts the unused portion based
on CC_ATTR_MEM_ENCRYPT.
In a Hyper-V guest VM using vTOM, these conditions are not equivalent
as sme_me_mask is always zero when using vTOM. Consequently,
mem_encrypt_free_decrypted_mem() attempts to re-encrypt memory that was
never decrypted.
So check sme_me_mask in mem_encrypt_free_decrypted_mem() too.
Hyper-V guests using vTOM don't need the bss_decrypted section to be
decrypted, so skipping the decryption/re-encryption doesn't cause a
problem.
Signed-off-by: Michael Kelley <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Reviewed-by: Tom Lendacky <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf')
0 files changed, 0 insertions, 0 deletions