Krish Sadhukhan 690909c6d9 x86/mm/pat: Don't flush cache if hardware enforces cache coherency across encryption domnains
commit 75d1cc0e05af579301ce4e49cf6399be4b4e6e76 upstream.

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
Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-16 13:21:48 +01:00
..
2020-03-25 08:25:58 +01:00
2020-06-22 09:31:08 +02:00
2020-04-01 11:01:59 +02:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2021-01-12 20:16:22 +01:00
2018-10-31 08:54:16 -07:00