Module Name: src Committed By: jym Date: Wed Aug 5 20:15:37 UTC 2009
Modified Files: src/sys/arch/amd64/conf: XEN3_DOM0 src/sys/arch/i386/conf: XEN3_DOM0 src/sys/arch/x86/include: cpuvar.h src/sys/arch/x86/x86: x86_machdep.c src/sys/arch/xen/conf: files.compat files.xen Log Message: Add Intel SpeedStep and AMD PowerNow! support in Xen dom0. MSR operations are now compiled in by default. Note that MSR support in Xen depends on its version. rdmsr() should always succeed, but wrmsr() to certain registers can end in a NOOP. In that case, the error will be logged (see xm dmesg). Setting CPU frequency (SpeedStep) requires Xen 3.3 with the option cpufreq="dom0-kernel" passed down to hypervisor during boot. Compiled and tested for SpeedStep under i386 for XEN3_DOM0 and XEN3PAE_DOM0 by j...@. amd64 was tested by Joel Carnat. See also http://mail-index.netbsd.org/port-xen/2009/08/02/msg005213.html . Commit requested by bou...@. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/conf/XEN3_DOM0 cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/include/cpuvar.h cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/x86_machdep.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/xen/conf/files.compat cvs rdiff -u -r1.102 -r1.103 src/sys/arch/xen/conf/files.xen Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/conf/XEN3_DOM0 diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.42 src/sys/arch/amd64/conf/XEN3_DOM0:1.43 --- src/sys/arch/amd64/conf/XEN3_DOM0:1.42 Mon Apr 20 20:50:37 2009 +++ src/sys/arch/amd64/conf/XEN3_DOM0 Wed Aug 5 20:15:36 2009 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.42 2009/04/20 20:50:37 cegger Exp $ +# $NetBSD: XEN3_DOM0,v 1.43 2009/08/05 20:15:36 jym Exp $ include "arch/amd64/conf/std.xen" @@ -18,6 +18,13 @@ #options VM86 # virtual 8086 emulation #options USER_LDT # user-settable LDT; used by WINE +# Enhanced SpeedStep Technology in the Pentium M +options ENHANCED_SPEEDSTEP +#options EST_FREQ_USERWRITE # any user can set frequency + +# AMD PowerNow! and Cool`n'Quiet technology +options POWERNOW_K8 + #options MTRR # memory-type range register syscall support #options CONSDEVNAME="\"xencons\"" Index: src/sys/arch/i386/conf/XEN3_DOM0 diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.18 src/sys/arch/i386/conf/XEN3_DOM0:1.19 --- src/sys/arch/i386/conf/XEN3_DOM0:1.18 Wed Jul 29 13:37:57 2009 +++ src/sys/arch/i386/conf/XEN3_DOM0 Wed Aug 5 20:15:36 2009 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.18 2009/07/29 13:37:57 cegger Exp $ +# $NetBSD: XEN3_DOM0,v 1.19 2009/08/05 20:15:36 jym Exp $ # # XEN3_0: Xen 3.0 domain0 kernel @@ -29,6 +29,16 @@ #options VM86 # virtual 8086 emulation #options USER_LDT # user-settable LDT; used by WINE +# Enhanced SpeedStep Technology in the Pentium M +options ENHANCED_SPEEDSTEP +#options EST_FREQ_USERWRITE # any user can set frequency + +# AMD PowerNow! K7 +options POWERNOW_K7 + +# AMD PowerNow! and Cool`n'Quiet technology +options POWERNOW_K8 + #options MTRR # memory-type range register syscall support #options CONSDEVNAME="\"xencons\"" Index: src/sys/arch/x86/include/cpuvar.h diff -u src/sys/arch/x86/include/cpuvar.h:1.28 src/sys/arch/x86/include/cpuvar.h:1.29 --- src/sys/arch/x86/include/cpuvar.h:1.28 Wed Mar 11 03:34:43 2009 +++ src/sys/arch/x86/include/cpuvar.h Wed Aug 5 20:15:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.28 2009/03/11 03:34:43 yamt Exp $ */ +/* $NetBSD: cpuvar.h,v 1.29 2009/08/05 20:15:36 jym Exp $ */ /*- * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc. @@ -88,8 +88,8 @@ #if defined(_KERNEL_OPT) #include "opt_multiprocessor.h" -#ifndef XEN #include "opt_enhanced_speedstep.h" +#ifndef XEN #include "opt_intel_coretemp.h" #include "opt_intel_odcm.h" #endif Index: src/sys/arch/x86/x86/x86_machdep.c diff -u src/sys/arch/x86/x86/x86_machdep.c:1.32 src/sys/arch/x86/x86/x86_machdep.c:1.33 --- src/sys/arch/x86/x86/x86_machdep.c:1.32 Sat Jun 20 13:10:14 2009 +++ src/sys/arch/x86/x86/x86_machdep.c Wed Aug 5 20:15:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_machdep.c,v 1.32 2009/06/20 13:10:14 cegger Exp $ */ +/* $NetBSD: x86_machdep.c,v 1.33 2009/08/05 20:15:36 jym Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.32 2009/06/20 13:10:14 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.33 2009/08/05 20:15:36 jym Exp $"); #include "opt_modular.h" @@ -130,9 +130,7 @@ void x86_init(void) { -#ifndef XEN msr_cpu_broadcast_initmtx(); -#endif } #ifdef MODULAR Index: src/sys/arch/xen/conf/files.compat diff -u src/sys/arch/xen/conf/files.compat:1.20 src/sys/arch/xen/conf/files.compat:1.21 --- src/sys/arch/xen/conf/files.compat:1.20 Wed Jul 29 12:02:06 2009 +++ src/sys/arch/xen/conf/files.compat Wed Aug 5 20:15:37 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.compat,v 1.20 2009/07/29 12:02:06 cegger Exp $ +# $NetBSD: files.compat,v 1.21 2009/08/05 20:15:37 jym Exp $ # NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp # options for MP configuration through the MP spec @@ -57,15 +57,6 @@ # Intel On Die Temperature sensor defflag opt_intel_coretemp.h XXXINTEL_CORETEMP -# AMD Powernow/Cool`n'Quiet Technology -defflag opt_powernow_k8.h XXPOWERNOW_K8 - -# Intel Enhanced Speedstep -defflag opt_enhanced_speedstep.h XXXENHANCED_SPEEDSTEP -defflag opt_est.h XXXEST_FREQ_USERWRITE - -defflag opt_powernow_k7.h XXXPOWERNOW_K7 - # Multiboot support defflag opt_multiboot.h XXXMULTIBOOT Index: src/sys/arch/xen/conf/files.xen diff -u src/sys/arch/xen/conf/files.xen:1.102 src/sys/arch/xen/conf/files.xen:1.103 --- src/sys/arch/xen/conf/files.xen:1.102 Wed Jul 29 12:02:06 2009 +++ src/sys/arch/xen/conf/files.xen Wed Aug 5 20:15:37 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.xen,v 1.102 2009/07/29 12:02:06 cegger Exp $ +# $NetBSD: files.xen,v 1.103 2009/08/05 20:15:37 jym Exp $ # NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp # NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp @@ -26,6 +26,18 @@ defparam PCI_CONF_MODE +# Intel Enhanced Speedstep +defflag ENHANCED_SPEEDSTEP +defflag opt_est.h EST_FREQ_USERWRITE +file arch/x86/x86/est.c enhanced_speedstep +file arch/x86/x86/intel_busclock.c enhanced_speedstep + +# AMD Powernow/Cool`n'Quiet Technology +defflag opt_powernow_k8.h POWERNOW_K8 +# Powernow common functions +file arch/x86/x86/powernow_k8.c powernow_k8 +file arch/x86/x86/powernow_common.c powernow_k8 | powernow_k7 + file arch/xen/x86/autoconf.c ifdef i386 file arch/i386/i386/aout_machdep.c exec_aout @@ -60,6 +72,11 @@ file crypto/blowfish/arch/i386/bf_enc.S blowfish file crypto/blowfish/arch/i386/bf_cbc.S blowfish + +# AMD PowerNow K7 +defflag POWERNOW_K7 +file arch/i386/i386/powernow_k7.c powernow_k7 + elifdef amd64 file arch/amd64/amd64/busfunc.S file arch/amd64/amd64/cpufunc.S @@ -276,6 +293,8 @@ file arch/xen/x86/cpu.c cpu | vcpu +file arch/x86/x86/msr_ipifuncs.c + # # Compatibility modules #