ia64/xen-unstable

changeset 6397:b74c15e4dd4f

Print status of Flush Filter on AMD64 processors during
Xen boot. Also provide a new boot parameter:
amd_flush_filter=on : Forcibly enable the Filter
amd_flush_filter=off : Forcibly disable the Filter

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Aug 24 16:15:42 2005 +0000 (2005-08-24)
parents d1ac7c6ffb63
children 237dc67887cc fa0754a9f64f
files xen/arch/x86/cpu/amd.c
line diff
     1.1 --- a/xen/arch/x86/cpu/amd.c	Wed Aug 24 15:49:27 2005 +0000
     1.2 +++ b/xen/arch/x86/cpu/amd.c	Wed Aug 24 16:15:42 2005 +0000
     1.3 @@ -9,6 +9,20 @@
     1.4  
     1.5  #include "cpu.h"
     1.6  
     1.7 +/*
     1.8 + * amd_flush_filter={on,off}. Forcibly Enable or disable the TLB flush
     1.9 + * filter on AMD 64-bit processors.
    1.10 + */
    1.11 +static int flush_filter_force;
    1.12 +static void flush_filter(char *s)
    1.13 +{
    1.14 +	if (!strcmp(s, "off"))
    1.15 +		flush_filter_force = -1;
    1.16 +	if (!strcmp(s, "on"))
    1.17 +		flush_filter_force = 1;
    1.18 +}
    1.19 +custom_param("amd_flush_filter", flush_filter);
    1.20 +
    1.21  #define num_physpages 0
    1.22  
    1.23  /*
    1.24 @@ -192,6 +206,21 @@ static void __init init_amd(struct cpuin
    1.25  		break;
    1.26  	}
    1.27  
    1.28 +	if (c->x86 == 15) {
    1.29 +		rdmsr(MSR_K7_HWCR, l, h);
    1.30 +		printk(KERN_INFO "CPU%d: AMD Flush Filter %sabled",
    1.31 +		       smp_processor_id(), (l & (1<<6)) ? "dis" : "en");
    1.32 +		if ((flush_filter_force > 0) && (l & (1<<6))) {
    1.33 +			l &= ~(1<<6);
    1.34 +			printk(" -> Forcibly enabled");
    1.35 +		} else if ((flush_filter_force < 0) && !(l & (1<<6))) {
    1.36 +			l |= 1<<6;
    1.37 +			printk(" -> Forcibly disabled");
    1.38 +		}
    1.39 +		wrmsr(MSR_K7_HWCR, l, h);
    1.40 +		printk("\n");
    1.41 +	}
    1.42 +
    1.43  	display_cacheinfo(c);
    1.44  
    1.45  	if (cpuid_eax(0x80000000) >= 0x80000008) {