Index: sys/dev/hwpmc/hwpmc_amd.c =================================================================== --- sys/dev/hwpmc/hwpmc_amd.c +++ sys/dev/hwpmc/hwpmc_amd.c @@ -600,8 +600,6 @@ if((ri >= 12 && ri < 16) && !(a->pm_md.pm_amd.pm_amd_sub_class == PMC_AMD_SUB_CLASS_DATA_FABRIC)) return EINVAL; - if ((pd->pd_caps & caps) != caps) - return EPERM; if (strlen(pmc_cpuid) != 0) { pm->pm_md.pm_amd.pm_amd_evsel = a->pm_md.pm_amd.pm_amd_config; Index: sys/dev/hwpmc/hwpmc_arm64.c =================================================================== --- sys/dev/hwpmc/hwpmc_arm64.c +++ sys/dev/hwpmc/hwpmc_arm64.c @@ -164,7 +164,7 @@ arm64_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - uint32_t caps, config; + uint32_t config; struct arm64_cpu *pac; enum pmc_event pe; @@ -175,7 +175,6 @@ pac = arm64_pcpu[cpu]; - caps = a->pm_caps; if (a->pm_class != PMC_CLASS_ARMV8) { return (EINVAL); } Index: sys/dev/hwpmc/hwpmc_armv7.c =================================================================== --- sys/dev/hwpmc/hwpmc_armv7.c +++ sys/dev/hwpmc/hwpmc_armv7.c @@ -141,7 +141,6 @@ struct armv7_cpu *pac; enum pmc_event pe; uint32_t config; - uint32_t caps; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] illegal CPU value %d", __LINE__, cpu)); @@ -150,7 +149,6 @@ pac = armv7_pcpu[cpu]; - caps = a->pm_caps; if (a->pm_class != PMC_CLASS_ARMV7) return (EINVAL); pe = a->pm_ev; Index: sys/dev/hwpmc/hwpmc_core.c =================================================================== --- sys/dev/hwpmc/hwpmc_core.c +++ sys/dev/hwpmc/hwpmc_core.c @@ -236,10 +236,7 @@ if (ri < 0 || ri > core_iaf_npmc) return (EINVAL); - caps = a->pm_caps; - - if (a->pm_class != PMC_CLASS_IAF || - (caps & IAF_PMC_CAPS) != caps) + if (a->pm_class != PMC_CLASS_IAF) return (EINVAL); iap = &a->pm_md.pm_iap; @@ -275,6 +272,7 @@ if (config & IAP_INT) flags |= IAF_PMI; + caps = a->pm_caps; if (caps & PMC_CAP_INTERRUPT) flags |= IAF_PMI; if (caps & PMC_CAP_SYSTEM) @@ -742,7 +740,6 @@ const struct pmc_op_pmcallocate *a) { uint8_t ev; - uint32_t caps; const struct pmc_md_iap_op_pmcallocate *iap; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -753,10 +750,6 @@ if (a->pm_class != PMC_CLASS_IAP) return (EINVAL); - /* check requested capabilities */ - caps = a->pm_caps; - if ((IAP_PMC_CAPS & caps) != caps) - return (EPERM); iap = &a->pm_md.pm_iap; ev = IAP_EVSEL_GET(iap->pm_iap_config); Index: sys/dev/hwpmc/hwpmc_tsc.c =================================================================== --- sys/dev/hwpmc/hwpmc_tsc.c +++ sys/dev/hwpmc/hwpmc_tsc.c @@ -83,12 +83,6 @@ if (a->pm_class != PMC_CLASS_TSC) return (EINVAL); - if ((pm->pm_caps & TSC_CAPS) == 0) - return (EINVAL); - - if ((pm->pm_caps & ~TSC_CAPS) != 0) - return (EPERM); - if (a->pm_ev != PMC_EV_TSC_TSC || a->pm_mode != PMC_MODE_SC) return (EINVAL); Index: sys/dev/hwpmc/hwpmc_uncore.c =================================================================== --- sys/dev/hwpmc/hwpmc_uncore.c +++ sys/dev/hwpmc/hwpmc_uncore.c @@ -189,7 +189,7 @@ ucf_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - uint32_t caps, flags; + uint32_t flags; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[uncore,%d] illegal CPU %d", __LINE__, cpu)); @@ -199,10 +199,7 @@ if (ri < 0 || ri > uncore_ucf_npmc) return (EINVAL); - caps = a->pm_caps; - - if (a->pm_class != PMC_CLASS_UCF || - (caps & UCF_PMC_CAPS) != caps) + if (a->pm_class != PMC_CLASS_UCF) return (EINVAL); flags = UCF_EN; @@ -522,7 +519,6 @@ const struct pmc_op_pmcallocate *a) { uint8_t ev; - uint32_t caps; const struct pmc_md_ucp_op_pmcallocate *ucp; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -533,11 +529,6 @@ if (a->pm_class != PMC_CLASS_UCP) return (EINVAL); - /* check requested capabilities */ - caps = a->pm_caps; - if ((UCP_PMC_CAPS & caps) != caps) - return (EPERM); - ucp = &a->pm_md.pm_ucp; ev = UCP_EVSEL(ucp->pm_ucp_config); switch (uncore_cputype) {