hwpmc.4 (183267) | hwpmc.4 (208027) |
---|---|
1.\" Copyright (c) 2003-2008 Joseph Koshy 2.\" Copyright (c) 2007 The FreeBSD Foundation 3.\" All rights reserved. 4.\" 5.\" Portions of this software were developed by A. Joseph Koshy under 6.\" sponsorship from the FreeBSD Foundation and Google, Inc. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" | 1.\" Copyright (c) 2003-2008 Joseph Koshy 2.\" Copyright (c) 2007 The FreeBSD Foundation 3.\" All rights reserved. 4.\" 5.\" Portions of this software were developed by A. Joseph Koshy under 6.\" sponsorship from the FreeBSD Foundation and Google, Inc. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" |
29.\" $FreeBSD: head/share/man/man4/hwpmc.4 183267 2008-09-22 14:31:24Z jkoshy $ | 29.\" $FreeBSD: head/share/man/man4/hwpmc.4 208027 2010-05-13 12:07:55Z uqs $ |
30.\" 31.Dd September 22, 2008 32.Dt HWPMC 4 33.Os 34.Sh NAME 35.Nm hwpmc 36.Nd "Hardware Performance Monitoring Counter support" 37.Sh SYNOPSIS --- 407 unchanged lines hidden (view full) --- 445processes. 446.El 447.Pp 448These variables may be set in the kernel environment using 449.Xr kenv 1 450before 451.Nm 452is loaded. | 30.\" 31.Dd September 22, 2008 32.Dt HWPMC 4 33.Os 34.Sh NAME 35.Nm hwpmc 36.Nd "Hardware Performance Monitoring Counter support" 37.Sh SYNOPSIS --- 407 unchanged lines hidden (view full) --- 445processes. 446.El 447.Pp 448These variables may be set in the kernel environment using 449.Xr kenv 1 450before 451.Nm 452is loaded. |
453.Sh SECURITY CONSIDERATIONS 454PMCs may be used to monitor the actual behavior of the system on hardware. 455In situations where this constitutes an undesirable information leak, 456the following options are available: 457.Bl -enum 458.It 459Set the 460.Xr sysctl 8 461tunable 462.Va security.bsd.unprivileged_syspmcs 463to 0. 464This ensures that unprivileged processes cannot allocate system-wide 465PMCs and thus cannot observe the hardware behavior of the system 466as a whole. 467This tunable may also be set at boot time using 468.Xr loader 8 , 469or with 470.Xr kenv 1 471prior to loading the 472.Nm 473driver into the kernel. 474.It 475Set the 476.Xr sysctl 8 477tunable 478.Va security.bsd.unprivileged_proc_debug 479to 0. 480This will ensure that an unprivileged process cannot attach a PMC 481to any process other than itself and thus cannot observe the hardware 482behavior of other processes with the same credentials. 483.El 484.Pp 485System administrators should note that on IA-32 platforms 486.Fx 487makes the content of the IA-32 TSC counter available to all processes 488via the RDTSC instruction. | |
489.Sh IMPLEMENTATION NOTES 490.Ss SMP Symmetry 491The kernel driver requires all physical CPUs in an SMP system to have 492identical performance monitoring counter hardware. 493.Ss Sparse CPU Numbering 494On platforms that sparsely number CPUs and which support hot-plugging 495of CPUs, requests that specify non-existent or disabled CPUs will fail 496with an error. --- 329 unchanged lines hidden (view full) --- 826driver is active. 827.Pp 828On the i386 architecture, the driver requires that the local APIC on the 829CPU be enabled for sampling mode to be supported. 830Many single-processor motherboards keep the APIC disabled in BIOS; on 831such systems 832.Nm 833will not support sampling PMCs. | 453.Sh IMPLEMENTATION NOTES 454.Ss SMP Symmetry 455The kernel driver requires all physical CPUs in an SMP system to have 456identical performance monitoring counter hardware. 457.Ss Sparse CPU Numbering 458On platforms that sparsely number CPUs and which support hot-plugging 459of CPUs, requests that specify non-existent or disabled CPUs will fail 460with an error. --- 329 unchanged lines hidden (view full) --- 790driver is active. 791.Pp 792On the i386 architecture, the driver requires that the local APIC on the 793CPU be enabled for sampling mode to be supported. 794Many single-processor motherboards keep the APIC disabled in BIOS; on 795such systems 796.Nm 797will not support sampling PMCs. |
798.Sh SECURITY CONSIDERATIONS 799PMCs may be used to monitor the actual behavior of the system on hardware. 800In situations where this constitutes an undesirable information leak, 801the following options are available: 802.Bl -enum 803.It 804Set the 805.Xr sysctl 8 806tunable 807.Va security.bsd.unprivileged_syspmcs 808to 0. 809This ensures that unprivileged processes cannot allocate system-wide 810PMCs and thus cannot observe the hardware behavior of the system 811as a whole. 812This tunable may also be set at boot time using 813.Xr loader 8 , 814or with 815.Xr kenv 1 816prior to loading the 817.Nm 818driver into the kernel. 819.It 820Set the 821.Xr sysctl 8 822tunable 823.Va security.bsd.unprivileged_proc_debug 824to 0. 825This will ensure that an unprivileged process cannot attach a PMC 826to any process other than itself and thus cannot observe the hardware 827behavior of other processes with the same credentials. 828.El 829.Pp 830System administrators should note that on IA-32 platforms 831.Fx 832makes the content of the IA-32 TSC counter available to all processes 833via the RDTSC instruction. |
|