[PATCH] [6/7] Add noclflush option

From: Andi Kleen
Date: Fri Jan 18 2008 - 12:29:25 EST



To disable CLFLUSH usage, especially in change_page_attr().

Ingo asked for this.

Signed-off-by: Andi Kleen <ak@xxxxxxx>

---
Documentation/kernel-parameters.txt | 2 ++
arch/x86/kernel/cpu/common.c | 7 +++++++
arch/x86/kernel/setup_64.c | 7 +++++++
3 files changed, 16 insertions(+)

Index: linux/arch/x86/kernel/cpu/common.c
===================================================================
--- linux.orig/arch/x86/kernel/cpu/common.c
+++ linux/arch/x86/kernel/cpu/common.c
@@ -542,6 +542,13 @@ void __cpuinit detect_ht(struct cpuinfo_
}
#endif

+static __init int setup_noclflush(char *arg)
+{
+ setup_clear_cpu_cap(X86_FEATURE_CLFLSH);
+ return 1;
+}
+__setup("noclflush", setup_noclflush);
+
void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
{
char *vendor = NULL;
Index: linux/arch/x86/kernel/setup_64.c
===================================================================
--- linux.orig/arch/x86/kernel/setup_64.c
+++ linux/arch/x86/kernel/setup_64.c
@@ -1042,6 +1042,13 @@ void __cpuinit identify_cpu(struct cpuin
}
}

+static __init int setup_noclflush(char *arg)
+{
+ setup_clear_cpu_cap(X86_FEATURE_CLFLSH);
+ return 1;
+}
+__setup("noclflush", setup_noclflush);
+
void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
{
if (c->x86_model_id[0])
Index: linux/Documentation/kernel-parameters.txt
===================================================================
--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -1173,6 +1173,8 @@ and is between 256 and 4096 characters.
register save and restore. The kernel will only save
legacy floating-point registers on task switch.

+ noclflush [BUGS=X86] Don't use the CLFLUSH instruction
+
nohlt [BUGS=ARM]

no-hlt [BUGS=X86-32] Tells the kernel that the hlt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/