Module Name:    src
Committed By:   maxv
Date:           Sat Feb 18 14:36:32 UTC 2017

Modified Files:
        src/sys/arch/i386/conf: ALL GENERIC NET4501
        src/sys/arch/i386/include: pmc.h
        src/sys/arch/x86/x86: sys_machdep.c

Log Message:
There is currently an ugly mix between the PERFCTRS subsystem (MI), and
i386's own PMC interface (MD). Stop using PERFCTRS and use PMC instead.
While here remove some unused flags, which are wrong on the latest CPUs
anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.411 -r1.412 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1147 -r1.1148 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/i386/conf/NET4501
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/include/pmc.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/x86/x86/sys_machdep.c

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/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.411 src/sys/arch/i386/conf/ALL:1.412
--- src/sys/arch/i386/conf/ALL:1.411	Thu Jan 12 05:24:36 2017
+++ src/sys/arch/i386/conf/ALL	Sat Feb 18 14:36:32 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.411 2017/01/12 05:24:36 ryo Exp $
+# $NetBSD: ALL,v 1.412 2017/02/18 14:36:32 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.411 $"
+#ident		"ALL-$Revision: 1.412 $"
 
 maxusers	64		# estimated number of users
 
@@ -40,8 +40,7 @@ viac7temp*	at cpu?		# VIA C7 temperature
 vmt0		at cpu0		# VMware Tools
 
 options 	MTRR		# memory-type range register syscall support
-# doesn't work with MP just yet..
-options 	PERFCTRS	# performance-monitoring counters support
+options 	PMC		# performance-monitoring counters support
 
 options 	MULTIBOOT	# Multiboot support (see multiboot(8))
 

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1147 src/sys/arch/i386/conf/GENERIC:1.1148
--- src/sys/arch/i386/conf/GENERIC:1.1147	Fri Feb 17 12:10:40 2017
+++ src/sys/arch/i386/conf/GENERIC	Sat Feb 18 14:36:32 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1147 2017/02/17 12:10:40 maxv Exp $
+# $NetBSD: GENERIC,v 1.1148 2017/02/18 14:36:32 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1147 $"
+#ident		"GENERIC-$Revision: 1.1148 $"
 
 maxusers	64		# estimated number of users
 
@@ -42,7 +42,7 @@ viac7temp*	at cpu?		# VIA C7 temperature
 vmt0		at cpu0		# VMware Tools
 
 options 	MTRR		# memory-type range register syscall support
-#options 	PERFCTRS	# performance-monitoring counters support
+#options 	PMC		# performance-monitoring counters support
 
 options 	MULTIBOOT	# Multiboot support (see multiboot(8))
 

Index: src/sys/arch/i386/conf/NET4501
diff -u src/sys/arch/i386/conf/NET4501:1.89 src/sys/arch/i386/conf/NET4501:1.90
--- src/sys/arch/i386/conf/NET4501:1.89	Fri Aug 21 01:52:08 2015
+++ src/sys/arch/i386/conf/NET4501	Sat Feb 18 14:36:32 2017
@@ -1,4 +1,4 @@
-# $NetBSD: NET4501,v 1.89 2015/08/21 01:52:08 uebayasi Exp $
+# $NetBSD: NET4501,v 1.90 2017/02/18 14:36:32 maxv Exp $
 #
 # NET4501 -- kernel configuration for a Soekris Engineering net4501
 # single-board computer.
@@ -10,7 +10,7 @@ include 	"arch/i386/conf/std.i386"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"NET4501-$Revision: 1.89 $"
+#ident 		"NET4501-$Revision: 1.90 $"
 
 maxusers	32		# estimated number of users
 
@@ -24,7 +24,7 @@ makeoptions	COPTS="-Os"
 #options 	USER_LDT	# user-settable LDT; used by WINE
 
 #options 	MTRR		# memory-type range register syscall support
-#options 	PERFCTRS	# performance-monitoring counters support
+#options 	PMC		# performance-monitoring counters support
 
 # delay between "rebooting ..." message and hardware reset, in milliseconds
 #options 	CPURESET_DELAY=2000

Index: src/sys/arch/i386/include/pmc.h
diff -u src/sys/arch/i386/include/pmc.h:1.9 src/sys/arch/i386/include/pmc.h:1.10
--- src/sys/arch/i386/include/pmc.h:1.9	Fri Feb 17 12:10:40 2017
+++ src/sys/arch/i386/include/pmc.h	Sat Feb 18 14:36:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmc.h,v 1.9 2017/02/17 12:10:40 maxv Exp $	*/
+/*	$NetBSD: pmc.h,v 1.10 2017/02/18 14:36:32 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -52,17 +52,9 @@
  * Each PMC event on the x86 is associated with a processor unit.  We
  * encode the unit in the upper 16 bits of the event ID.
  */
-#define	__PMC_EVID_EVENT_MASK	0x0000ffff
-#define	__PMC_EVID_UNIT_MASK	0xffff0000
-
 #define	__PMC_UNIT(x)		((x) << 16)
-#define	__PMC_GET_UNIT(x)	(((x) & __PMC_EVID_UNIT_MASK) >> 16)
-#define	__PMC_GET_EVENT(x)	((x) & __PMC_EVID_EVENT_MASK)
 
 #if defined(_KERNEL)
-/*
- * LEGACY PMC support
- */
 struct x86_pmc_info_args;
 struct x86_pmc_startstop_args;
 struct x86_pmc_read_args;
@@ -73,28 +65,6 @@ int sys_pmc_startstop(struct lwp *, stru
     register_t *);
 int sys_pmc_read(struct lwp *, struct x86_pmc_read_args *,
     register_t *);
-/* END LEGACY PMC SUPPORT */
-
-#define pmc_md_fork(p1,p2)
-#define pmc_get_num_counters()			(0)
-#define pmc_get_counter_type(c)			(0)
-#define pmc_save_context(p)
-#define pmc_restore_context(p)
-#define pmc_enable_counter(p,c)
-#define pmc_disable_counter(p,c)
-#define pmc_accumulate(p1,p2)
-#define pmc_process_exit(p1)
-#define pmc_counter_isconfigured(p,c)		(0)
-#define pmc_counter_isrunning(p,c)		(0)
-#define pmc_start_profiling(c,f)		(0)
-#define pmc_stop_profiling(c)			(0)
-#define pmc_alloc_kernel_counter(c,f)		(0)
-#define pmc_free_kernel_counter(c)		(0)
-#define pmc_configure_counter(p,c,f)		(0)
-#define pmc_get_counter_value(p,c,f,pv)		(0)
-
-#define PMC_ENABLED(p)		(0)
-
 #endif /* _KERNEL */
 
 #endif /* _I386_PMC_H_ */

Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.33 src/sys/arch/x86/x86/sys_machdep.c:1.34
--- src/sys/arch/x86/x86/sys_machdep.c:1.33	Fri Feb 17 12:10:40 2017
+++ src/sys/arch/x86/x86/sys_machdep.c	Sat Feb 18 14:36:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.33 2017/02/17 12:10:40 maxv Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.34 2017/02/18 14:36:32 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,10 +30,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.33 2017/02/17 12:10:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.34 2017/02/18 14:36:32 maxv Exp $");
 
 #include "opt_mtrr.h"
-#include "opt_perfctrs.h"
 #include "opt_user_ldt.h"
 #include "opt_compat_netbsd.h"
 #ifdef i386
@@ -85,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_machdep.
  */
 #undef	USER_LDT
 /* Need to be checked. */
-#undef	PERFCTRS
+#undef	PMC
 #undef	IOPERM
 #else
 #if defined(XEN)
@@ -99,7 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_machdep.
 #include <machine/vm86.h>
 #endif
 
-#ifdef PERFCTRS
+#ifdef PMC
 #include <machine/pmc.h>
 #endif
 
@@ -847,7 +846,7 @@ sys_sysarch(struct lwp *l, const struct 
 		break;
 #endif
 
-#ifdef PERFCTRS
+#ifdef PMC
 	case X86_PMC_INFO:
 		error = sys_pmc_info(l, SCARG(uap, parms), retval);
 		break;

Reply via email to