hwpmc_core.c (263446) | hwpmc_core.c (267062) |
---|---|
1/*- 2 * Copyright (c) 2008 Joseph Koshy 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Intel Core PMCs. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Joseph Koshy 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Intel Core PMCs. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_core.c 263446 2014-03-20 20:51:08Z hiren $"); | 32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_core.c 267062 2014-06-04 16:06:38Z kib $"); |
33 34#include <sys/param.h> 35#include <sys/bus.h> 36#include <sys/pmc.h> 37#include <sys/pmckern.h> 38#include <sys/systm.h> 39 40#include <machine/intr_machdep.h> --- 1975 unchanged lines hidden (view full) --- 2016 if (ev == PMC_EV_IAP_EVENT_0FH_01H || ev == PMC_EV_IAP_EVENT_0FH_80H) { 2017 model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); 2018 if (core_cputype == PMC_CPU_INTEL_COREI7 && model != 0x2E) 2019 return (EINVAL); 2020 } 2021 2022 switch (core_cputype) { 2023 case PMC_CPU_INTEL_COREI7: | 33 34#include <sys/param.h> 35#include <sys/bus.h> 36#include <sys/pmc.h> 37#include <sys/pmckern.h> 38#include <sys/systm.h> 39 40#include <machine/intr_machdep.h> --- 1975 unchanged lines hidden (view full) --- 2016 if (ev == PMC_EV_IAP_EVENT_0FH_01H || ev == PMC_EV_IAP_EVENT_0FH_80H) { 2017 model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); 2018 if (core_cputype == PMC_CPU_INTEL_COREI7 && model != 0x2E) 2019 return (EINVAL); 2020 } 2021 2022 switch (core_cputype) { 2023 case PMC_CPU_INTEL_COREI7: |
2024 case PMC_CPU_INTEL_NEHALEM_EX: |
|
2024 if (iap_event_corei7_ok_on_counter(ev, ri) == 0) 2025 return (EINVAL); 2026 break; 2027 case PMC_CPU_INTEL_SANDYBRIDGE: 2028 case PMC_CPU_INTEL_SANDYBRIDGE_XEON: 2029 case PMC_CPU_INTEL_IVYBRIDGE: 2030 case PMC_CPU_INTEL_IVYBRIDGE_XEON: 2031 case PMC_CPU_INTEL_HASWELL: 2032 if (iap_event_sb_sbx_ib_ibx_ok_on_counter(ev, ri) == 0) 2033 return (EINVAL); 2034 break; 2035 case PMC_CPU_INTEL_WESTMERE: | 2025 if (iap_event_corei7_ok_on_counter(ev, ri) == 0) 2026 return (EINVAL); 2027 break; 2028 case PMC_CPU_INTEL_SANDYBRIDGE: 2029 case PMC_CPU_INTEL_SANDYBRIDGE_XEON: 2030 case PMC_CPU_INTEL_IVYBRIDGE: 2031 case PMC_CPU_INTEL_IVYBRIDGE_XEON: 2032 case PMC_CPU_INTEL_HASWELL: 2033 if (iap_event_sb_sbx_ib_ibx_ok_on_counter(ev, ri) == 0) 2034 return (EINVAL); 2035 break; 2036 case PMC_CPU_INTEL_WESTMERE: |
2037 case PMC_CPU_INTEL_WESTMERE_EX: |
|
2036 if (iap_event_westmere_ok_on_counter(ev, ri) == 0) 2037 return (EINVAL); 2038 break; 2039 default: 2040 if (iap_event_ok_on_counter(ev, ri) == 0) 2041 return (EINVAL); 2042 } 2043 --- 137 unchanged lines hidden (view full) --- 2181 if (a->pm_md.pm_iap.pm_iap_rsp != 0) { 2182 if (ev != PMC_EV_IAP_EVENT_B7H_01H && 2183 ev != PMC_EV_IAP_EVENT_BBH_01H) 2184 return (EINVAL); 2185 if (core_cputype == PMC_CPU_INTEL_COREI7 && 2186 ev == PMC_EV_IAP_EVENT_BBH_01H) 2187 return (EINVAL); 2188 if ((core_cputype == PMC_CPU_INTEL_COREI7 || | 2038 if (iap_event_westmere_ok_on_counter(ev, ri) == 0) 2039 return (EINVAL); 2040 break; 2041 default: 2042 if (iap_event_ok_on_counter(ev, ri) == 0) 2043 return (EINVAL); 2044 } 2045 --- 137 unchanged lines hidden (view full) --- 2183 if (a->pm_md.pm_iap.pm_iap_rsp != 0) { 2184 if (ev != PMC_EV_IAP_EVENT_B7H_01H && 2185 ev != PMC_EV_IAP_EVENT_BBH_01H) 2186 return (EINVAL); 2187 if (core_cputype == PMC_CPU_INTEL_COREI7 && 2188 ev == PMC_EV_IAP_EVENT_BBH_01H) 2189 return (EINVAL); 2190 if ((core_cputype == PMC_CPU_INTEL_COREI7 || |
2189 core_cputype == PMC_CPU_INTEL_WESTMERE) && | 2191 core_cputype == PMC_CPU_INTEL_WESTMERE || 2192 core_cputype == PMC_CPU_INTEL_NEHALEM_EX || 2193 core_cputype == PMC_CPU_INTEL_WESTMERE_EX) && |
2190 a->pm_md.pm_iap.pm_iap_rsp & ~IA_OFFCORE_RSP_MASK_I7WM) 2191 return (EINVAL); 2192 else if ((core_cputype == PMC_CPU_INTEL_SANDYBRIDGE || 2193 core_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || 2194 core_cputype == PMC_CPU_INTEL_IVYBRIDGE || 2195 core_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON) && 2196 a->pm_md.pm_iap.pm_iap_rsp & ~IA_OFFCORE_RSP_MASK_SBIB) 2197 return (EINVAL); --- 559 unchanged lines hidden --- | 2194 a->pm_md.pm_iap.pm_iap_rsp & ~IA_OFFCORE_RSP_MASK_I7WM) 2195 return (EINVAL); 2196 else if ((core_cputype == PMC_CPU_INTEL_SANDYBRIDGE || 2197 core_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || 2198 core_cputype == PMC_CPU_INTEL_IVYBRIDGE || 2199 core_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON) && 2200 a->pm_md.pm_iap.pm_iap_rsp & ~IA_OFFCORE_RSP_MASK_SBIB) 2201 return (EINVAL); --- 559 unchanged lines hidden --- |