OSDN Git Service

x86: Add support for changing memory encryption attribute in early boot
authorBrijesh Singh <brijesh.singh@amd.com>
Fri, 20 Oct 2017 14:30:56 +0000 (09:30 -0500)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 7 Nov 2017 14:35:59 +0000 (15:35 +0100)
commitdfaaec9033b80d71056e21cda920752e55f2c514
tree8727323aa0bed2e59bdf35e52d14daac34e4730f
parent606b21d4a6498c23632a4693c81b7b24feedd038
x86: Add support for changing memory encryption attribute in early boot

Some KVM-specific custom MSRs share the guest physical address with the
hypervisor in early boot. When SEV is active, the shared physical address
must be mapped with memory encryption attribute cleared so that both
hypervisor and guest can access the data.

Add APIs to change the memory encryption attribute in early boot code.

Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Tested-by: Borislav Petkov <bp@suse.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: kvm@vger.kernel.org
Cc: Borislav Petkov <bp@alien8.de>
Link: https://lkml.kernel.org/r/20171020143059.3291-15-brijesh.singh@amd.com
arch/x86/include/asm/mem_encrypt.h
arch/x86/mm/mem_encrypt.c