Skip to contentSkip to conversation

x86/mm: Remove unneeded TLB flush for in-place encryption

PATCH In review Tom Lendacky 3 participants 4 messages Nov 1, 2017 – Nov 7, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: Remove unneeded TLB flush for in-place encryption

A TLB flush is not required when doing in-place encryption or decryption since the area's pagetable attributes are not being altered. To avoid confusion between what the routine is doing and what is documented in the AMD APM, delete the local_flush_tlb() call.

---
 arch/x86/mm/mem_encrypt.c |    1 -
 1 file changed, 1 deletion(-)
arch/x86/mm/mem_encrypt.c +0 -1
index 16c5f37..53680a9 100644
@@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
 	if (!sme_me_mask)
 		return;
 
-	local_flush_tlb();
 	wbinvd();
 
 	/*
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Tom Lendacky

A TLB flush is not required when doing in-place encryption or decryption since the area's pagetable attributes are not being altered. To avoid confusion between what the routine is doing and what is documented in the AMD APM, delete the local_flush_tlb() call.

---
 arch/x86/mm/mem_encrypt.c |    1 -
 1 file changed, 1 deletion(-)
arch/x86/mm/mem_encrypt.c +0 -0
index 16c5f37..53680a9 100644

arch/x86/mm/mem_encrypt.c static void __init __sme_early_enc_dec(resource_size_t paddr, · line 68

Quoted 7 lines
arch/x86/mm/mem_encrypt.c +0 -1
@@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
 	if (!sme_me_mask)
 		return;
 
-	local_flush_tlb();
 	wbinvd();
 
 	/*
Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#2 lore raw

[tip:x86/mm] x86/mm: Remove unnecessary TLB flush for SME in-place encryption

In reply to Tom Lendacky
x86/mm: Remove unnecessary TLB flush for SME in-place encryption
Commit-ID:  c5e260890d5fd6687287f2b532c738a359a61a82
Gitweb:     https://git.kernel.org/tip/c5e260890d5fd6687287f2b532c738a359a61a82
Author:     Tom Lendacky <[email protected]>
AuthorDate: Wed, 1 Nov 2017 11:54:26 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 7 Nov 2017 12:16:14 +0100

x86/mm: Remove unnecessary TLB flush for SME in-place encryption

A TLB flush is not required when doing in-place encryption or decryption since the area's pagetable attributes are not being altered. To avoid confusion between what the routine is doing and what is documented in the AMD APM, delete the local_flush_tlb() call.

---
 arch/x86/mm/mem_encrypt.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/mm/mem_encrypt.c +0 -1
index 16c5f37..53680a9 100644
@@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
 	if (!sme_me_mask)
 		return;
 
-	local_flush_tlb();
 	wbinvd();
 
 	/*
#3 lore raw
In reply to Tom Lendacky
x86/mm: Remove unneeded TLB flush for in-place encryption
Commit-ID:  f1f31404c2f7fa168445d9c5ccb6a7caa53e2b78
Gitweb:     https://git.kernel.org/tip/f1f31404c2f7fa168445d9c5ccb6a7caa53e2b78
Author:     Tom Lendacky <[email protected]>
AuthorDate: Wed, 1 Nov 2017 11:54:26 -0500
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 7 Nov 2017 13:13:45 +0100

x86/mm: Remove unneeded TLB flush for in-place encryption

A TLB flush is not required when doing in-place encryption or decryption since the area's pagetable attributes are not being altered. To avoid confusion between what the routine is doing and what is documented in the AMD APM, delete the local_flush_tlb() call.

---
 arch/x86/mm/mem_encrypt.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/mm/mem_encrypt.c +0 -1
index 16c5f37..53680a9 100644
@@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
 	if (!sme_me_mask)
 		return;
 
-	local_flush_tlb();
 	wbinvd();
 
 	/*