x86/mm: Validate memory when changing the C-bit
authorBrijesh Singh <brijesh.singh@amd.com>
Thu, 24 Feb 2022 16:56:01 +0000 (10:56 -0600)
committerBorislav Petkov <bp@suse.de>
Wed, 6 Apr 2022 11:24:53 +0000 (13:24 +0200)
commitdc3f3d2474b80eaee8be89f4c5eb344f10648f42
tree2c72a1701916d2288f5703f123a0f83c2761bc8f
parent9704c07bf9f7682a83aec4e66f2d9154dbd8577f
x86/mm: Validate memory when changing the C-bit

Add the needed functionality to change pages state from shared
to private and vice-versa using the Page State Change VMGEXIT as
documented in the GHCB spec.

Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220307213356.2797205-22-brijesh.singh@amd.com
arch/x86/include/asm/sev-common.h
arch/x86/include/asm/sev.h
arch/x86/include/uapi/asm/svm.h
arch/x86/kernel/sev.c
arch/x86/mm/mem_encrypt_amd.c