[PATCH] [1/3] CPA: Don't flush caches on CPUs that support self-snoop - Kernel

This is a discussion on [PATCH] [1/3] CPA: Don't flush caches on CPUs that support self-snoop - Kernel ; 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 --- arch/x86/mm/pageattr.c | 5 ++++- ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH] [1/3] CPA: Don't flush caches on CPUs that support self-snoop

  1. [PATCH] [1/3] CPA: Don't flush caches on CPUs that support self-snoop


    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

    ---
    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
    @@ -60,7 +60,7 @@ static void __cpa_flush_all(void *arg)
    */
    __flush_tlb_all();

    - if (boot_cpu_data.x86_model >= 4)
    + if (!cpu_has_ss && boot_cpu_data.x86_model >= 4)
    wbinvd();
    }

    @@ -91,6 +91,9 @@ static void cpa_flush_range(unsigned lon

    on_each_cpu(__cpa_flush_range, NULL, 1, 1);

    + 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
    @@ -153,6 +153,7 @@
    #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)
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [PATCH] [3/3] CPA: Remove outdated comment in kernel_map_pages and add warning about recursion


    Signed-off-by: Andi Kleen

    ---
    arch/x86/mm/pageattr.c | 5 +----
    1 file changed, 1 insertion(+), 4 deletions(-)

    Index: linux/arch/x86/mm/pageattr.c
    ================================================== =================
    --- linux.orig/arch/x86/mm/pageattr.c
    +++ linux/arch/x86/mm/pageattr.c
    @@ -556,6 +556,7 @@ static int __set_pages_np(struct page *p
    __pgprot(_PAGE_PRESENT));
    }

    +/* This function recurses with unknown maximum depth */
    void kernel_map_pages(struct page *page, int numpages, int enable)
    {
    if (PageHighMem(page))
    @@ -571,10 +572,6 @@ void kernel_map_pages(struct page *page,
    if (!debug_pagealloc_enabled)
    return;

    - /*
    - * The return value is ignored - the calls cannot fail,
    - * large pages are disabled at boot time:
    - */
    if (enable)
    __set_pages_p(page, numpages);
    else
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread