Re: [PATCH 07/11] treewide: Replace the use of mem_encrypt_active() with prot_guest_has()

From
Tom Lendacky via iommu <hidden>
Date
2021-08-09 21:56:01
Also in
amd-gfx, dri-devel, kexec, kvm, linux-efi, linux-fsdevel, linux-s390, linuxppc-dev, lkml, platform-driver-x86
Reply to
Sean Christopherson, 2021-07-30
On 7/30/21 5:34 PM, Sean Christopherson wrote:
On Tue, Jul 27, 2021, Tom Lendacky wrote:
quoted
@@ -451,7 +450,7 @@ void __init mem_encrypt_free_decrypted_mem(void)
 	 * The unused memory range was mapped decrypted, change the encryption
 	 * attribute from decrypted to encrypted before freeing it.
 	 */
-	if (mem_encrypt_active()) {
+	if (sme_me_mask) {
Any reason this uses sme_me_mask?  The helper it calls, __set_memory_enc_dec(),
uses prot_guest_has(PATTR_MEM_ENCRYPT) so I assume it's available?
Probably just a slip on my part. I was debating at one point calling the
helper vs. referencing the variables/functions directly in the
mem_encrypt.c file.

Thanks,
Tom
quoted
 		r = set_memory_encrypted(vaddr, npages);
 		if (r) {
 			pr_warn("failed to free unused decrypted pages\n");
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Thread (43 messages) 43 messages, 9 authors, last reply 2021-08-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help