linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Remove unneeded TLB flush for in-place encryption
@ 2017-11-01 16:54 Tom Lendacky
  2017-11-02 11:53 ` Borislav Petkov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tom Lendacky @ 2017-11-01 16:54 UTC (permalink / raw)
  To: x86
  Cc: Peter Zijlstra, linux-kernel, Dave Hansen, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, Thomas Gleixner

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.

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
 arch/x86/mm/mem_encrypt.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index 16c5f37..53680a9 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
 	if (!sme_me_mask)
 		return;
 
-	local_flush_tlb();
 	wbinvd();
 
 	/*

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/mm: Remove unneeded TLB flush for in-place encryption
  2017-11-01 16:54 [PATCH] x86/mm: Remove unneeded TLB flush for in-place encryption Tom Lendacky
@ 2017-11-02 11:53 ` Borislav Petkov
  2017-11-07 11:21 ` [tip:x86/mm] x86/mm: Remove unnecessary TLB flush for SME " tip-bot for Tom Lendacky
  2017-11-07 12:18 ` [tip:x86/urgent] x86/mm: Remove unneeded TLB flush for " tip-bot for Tom Lendacky
  2 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2017-11-02 11:53 UTC (permalink / raw)
  To: Tom Lendacky
  Cc: x86, Peter Zijlstra, linux-kernel, Dave Hansen, Ingo Molnar,
	H. Peter Anvin, Thomas Gleixner

On Wed, Nov 01, 2017 at 11:54:26AM -0500, Tom Lendacky wrote:
> 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.
> 
> Suggested-by: Dave Hansen <dave.hansen@intel.com>
> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
>  arch/x86/mm/mem_encrypt.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
> index 16c5f37..53680a9 100644
> --- a/arch/x86/mm/mem_encrypt.c
> +++ b/arch/x86/mm/mem_encrypt.c
> @@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
>  	if (!sme_me_mask)
>  		return;
>  
> -	local_flush_tlb();
>  	wbinvd();
>  
>  	/*

Reviewed-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:x86/mm] x86/mm: Remove unnecessary TLB flush for SME in-place encryption
  2017-11-01 16:54 [PATCH] x86/mm: Remove unneeded TLB flush for in-place encryption Tom Lendacky
  2017-11-02 11:53 ` Borislav Petkov
@ 2017-11-07 11:21 ` tip-bot for Tom Lendacky
  2017-11-07 12:18 ` [tip:x86/urgent] x86/mm: Remove unneeded TLB flush for " tip-bot for Tom Lendacky
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Tom Lendacky @ 2017-11-07 11:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, bp, peterz, thomas.lendacky, mingo, linux-kernel, tglx,
	torvalds, dave.hansen, bp

Commit-ID:  c5e260890d5fd6687287f2b532c738a359a61a82
Gitweb:     https://git.kernel.org/tip/c5e260890d5fd6687287f2b532c738a359a61a82
Author:     Tom Lendacky <thomas.lendacky@amd.com>
AuthorDate: Wed, 1 Nov 2017 11:54:26 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20171101165426.1388.24866.stgit@tlendack-t1.amdoffice.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/mm/mem_encrypt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index 16c5f37..53680a9 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
 	if (!sme_me_mask)
 		return;
 
-	local_flush_tlb();
 	wbinvd();
 
 	/*

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [tip:x86/urgent] x86/mm: Remove unneeded TLB flush for in-place encryption
  2017-11-01 16:54 [PATCH] x86/mm: Remove unneeded TLB flush for in-place encryption Tom Lendacky
  2017-11-02 11:53 ` Borislav Petkov
  2017-11-07 11:21 ` [tip:x86/mm] x86/mm: Remove unnecessary TLB flush for SME " tip-bot for Tom Lendacky
@ 2017-11-07 12:18 ` tip-bot for Tom Lendacky
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Tom Lendacky @ 2017-11-07 12:18 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: thomas.lendacky, tglx, mingo, dave.hansen, peterz, linux-kernel, hpa, bp

Commit-ID:  f1f31404c2f7fa168445d9c5ccb6a7caa53e2b78
Gitweb:     https://git.kernel.org/tip/f1f31404c2f7fa168445d9c5ccb6a7caa53e2b78
Author:     Tom Lendacky <thomas.lendacky@amd.com>
AuthorDate: Wed, 1 Nov 2017 11:54:26 -0500
Committer:  Thomas Gleixner <tglx@linutronix.de>
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.

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Link: https://lkml.kernel.org/r/20171101165426.1388.24866.stgit@tlendack-t1.amdoffice.net

---
 arch/x86/mm/mem_encrypt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index 16c5f37..53680a9 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -63,7 +63,6 @@ static void __init __sme_early_enc_dec(resource_size_t paddr,
 	if (!sme_me_mask)
 		return;
 
-	local_flush_tlb();
 	wbinvd();
 
 	/*

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-07 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01 16:54 [PATCH] x86/mm: Remove unneeded TLB flush for in-place encryption Tom Lendacky
2017-11-02 11:53 ` Borislav Petkov
2017-11-07 11:21 ` [tip:x86/mm] x86/mm: Remove unnecessary TLB flush for SME " tip-bot for Tom Lendacky
2017-11-07 12:18 ` [tip:x86/urgent] x86/mm: Remove unneeded TLB flush for " tip-bot for Tom Lendacky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).