LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: tglx@linutronix.de, mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: [PATCH] [7/8] CPA: Don't flush caches on CPUs that support self-snoop
Date: Mon, 11 Feb 2008 10:50:22 +0100 (CET)	[thread overview]
Message-ID: <20080211095022.7B8C31B41CE@basil.firstfloor.org> (raw)
In-Reply-To: <200802111050.372086035@suse.de>


[2.6.25 candidate I believe]

The specification of SS in the public manuals is a little unclear,
but I got confirmation from Intel that SS implies that there is no cache
flush needed on caching attribute changes.

Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86/mm/pageattr.c       |    5 ++++-
 include/asm-x86/cpufeature.h |    1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

Index: linux/arch/x86/mm/pageattr.c
===================================================================
--- linux.orig/arch/x86/mm/pageattr.c
+++ linux/arch/x86/mm/pageattr.c
@@ -74,7 +74,7 @@ static void __cpa_flush_all(void *arg)
 	 */
 	__flush_tlb_all();
 
-	if (cache && boot_cpu_data.x86_model >= 4)
+	if (!cpu_has_ss && cache && boot_cpu_data.x86_model >= 4)
 		wbinvd();
 }
 
@@ -108,6 +108,9 @@ static void cpa_flush_range(unsigned lon
 	if (!cache)
 		return;
 
+	if (cpu_has_ss)
+		return;
+
 	/*
 	 * We only need to flush on one CPU,
 	 * clflush is a MESI-coherent instruction that
Index: linux/include/asm-x86/cpufeature.h
===================================================================
--- linux.orig/include/asm-x86/cpufeature.h
+++ linux/include/asm-x86/cpufeature.h
@@ -157,6 +157,7 @@ extern const char * const x86_power_flag
 #define cpu_has_mtrr		boot_cpu_has(X86_FEATURE_MTRR)
 #define cpu_has_mmx		boot_cpu_has(X86_FEATURE_MMX)
 #define cpu_has_fxsr		boot_cpu_has(X86_FEATURE_FXSR)
+#define cpu_has_ss		boot_cpu_has(X86_FEATURE_SELFSNOOP)
 #define cpu_has_xmm		boot_cpu_has(X86_FEATURE_XMM)
 #define cpu_has_xmm2		boot_cpu_has(X86_FEATURE_XMM2)
 #define cpu_has_xmm3		boot_cpu_has(X86_FEATURE_XMM3)

  parent reply	other threads:[~2008-02-11  9:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-11  9:50 [PATCH] [0/8] Misc CPA patchkit Andi Kleen
2008-02-11  9:50 ` [PATCH] [1/8] CPA: Remove my copyright notice Andi Kleen
2008-02-12  0:42   ` Thomas Gleixner
2008-02-11  9:50 ` [PATCH] [2/8] CPA: Remove inline from static_protections Andi Kleen
2008-02-11 14:04   ` Ingo Molnar
2008-02-11  9:50 ` [PATCH] [3/8] CPA: Fix some incorrect comments in the debug pagealloc code Andi Kleen
2008-02-11  9:50 ` [PATCH] [4/8] CPA: Ifdef the cpa pool for DEBUG_PAGEALLOC Andi Kleen
2008-02-11  9:50 ` [PATCH] [5/8] CPA: Move pool allocation/free into separate functions Andi Kleen
2008-02-11  9:50 ` [PATCH] [6/8] CPA: Remove BUG_ON for LRU/Compound pages Andi Kleen
2008-02-17 14:07   ` Thomas Gleixner
2008-02-11  9:50 ` Andi Kleen [this message]
2008-02-11 15:04   ` [PATCH] [7/8] CPA: Don't flush caches on CPUs that support self-snoop Arjan van de Ven
2008-02-11 15:12     ` Andi Kleen
2008-02-11 15:21       ` Arjan van de Ven
2008-02-11 15:27         ` Andi Kleen
2008-02-11 17:36           ` Siddha, Suresh B
2008-02-11 17:58             ` Andi Kleen
2008-02-11 19:47               ` Siddha, Suresh B
2008-02-11 20:36                 ` Arjan van de Ven
2008-02-12  8:45                   ` Andi Kleen
2008-02-11  9:50 ` [PATCH] [8/8] CPA: Add statistics about state of direct mapping Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080211095022.7B8C31B41CE@basil.firstfloor.org \
    --to=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH] [7/8] CPA: Don'\''t flush caches on CPUs that support self-snoop' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).