]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
x86/mm/pat: Don't flush cache if hardware enforces cache coherency across encryption...
authorKrish Sadhukhan <krish.sadhukhan@oracle.com>
Thu, 17 Sep 2020 21:20:37 +0000 (21:20 +0000)
committerBorislav Petkov <bp@suse.de>
Fri, 18 Sep 2020 08:47:00 +0000 (10:47 +0200)
commit75d1cc0e05af579301ce4e49cf6399be4b4e6e76
tree9f5f5e8e3cc8d5a99a4a0ff93d0fac01b5ac0812
parent5866e9205b47a983a77ebc8654949f696342f2ab
x86/mm/pat: Don't flush cache if hardware enforces cache coherency across encryption domnains

In some hardware implementations, coherency between the encrypted and
unencrypted mappings of the same physical page is enforced. In such a
system, it is not required for software to flush the page from all CPU
caches in the system prior to changing the value of the C-bit for the
page. So check that bit before flushing the cache.

 [ bp: Massage commit message. ]

Suggested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200917212038.5090-3-krish.sadhukhan@oracle.com
arch/x86/mm/pat/set_memory.c