Lines Matching refs:hwc
855 static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc) in p4_pmu_clear_cccr_ovf() argument
860 rdmsrl(hwc->config_base, v); in p4_pmu_clear_cccr_ovf()
862 wrmsrl(hwc->config_base, v & ~P4_CCCR_OVF); in p4_pmu_clear_cccr_ovf()
873 rdmsrl(hwc->event_base, v); in p4_pmu_clear_cccr_ovf()
905 struct hw_perf_event *hwc = &event->hw; in p4_pmu_disable_event() local
912 (void)wrmsrl_safe(hwc->config_base, in p4_pmu_disable_event()
913 p4_config_unpack_cccr(hwc->config) & ~P4_CCCR_ENABLE & ~P4_CCCR_OVF & ~P4_CCCR_RESERVED); in p4_pmu_disable_event()
951 struct hw_perf_event *hwc = &event->hw; in p4_pmu_enable_event() local
952 int thread = p4_ht_config_thread(hwc->config); in p4_pmu_enable_event()
953 u64 escr_conf = p4_config_unpack_escr(p4_clear_ht_bit(hwc->config)); in p4_pmu_enable_event()
954 unsigned int idx = p4_config_unpack_event(hwc->config); in p4_pmu_enable_event()
965 WARN_ON_ONCE(p4_is_event_cascaded(hwc->config)); in p4_pmu_enable_event()
966 WARN_ON_ONCE(hwc->idx == 1); in p4_pmu_enable_event()
972 cccr = p4_config_unpack_cccr(hwc->config); in p4_pmu_enable_event()
978 p4_pmu_enable_pebs(hwc->config); in p4_pmu_enable_event()
981 (void)wrmsrl_safe(hwc->config_base, in p4_pmu_enable_event()
1003 struct hw_perf_event *hwc; in p4_pmu_handle_irq() local
1020 hwc = &event->hw; in p4_pmu_handle_irq()
1022 WARN_ON_ONCE(hwc->idx != idx); in p4_pmu_handle_irq()
1025 overflow = p4_pmu_clear_cccr_ovf(hwc); in p4_pmu_handle_irq()
1034 perf_sample_data_init(&data, 0, hwc->last_period); in p4_pmu_handle_irq()
1066 static void p4_pmu_swap_config_ts(struct hw_perf_event *hwc, int cpu) in p4_pmu_swap_config_ts() argument
1073 if (!p4_should_swap_ts(hwc->config, cpu)) in p4_pmu_swap_config_ts()
1081 escr = p4_config_unpack_escr(hwc->config); in p4_pmu_swap_config_ts()
1082 cccr = p4_config_unpack_cccr(hwc->config); in p4_pmu_swap_config_ts()
1095 hwc->config = p4_config_pack_escr(escr); in p4_pmu_swap_config_ts()
1096 hwc->config |= p4_config_pack_cccr(cccr); in p4_pmu_swap_config_ts()
1097 hwc->config |= P4_CONFIG_HT; in p4_pmu_swap_config_ts()
1109 hwc->config = p4_config_pack_escr(escr); in p4_pmu_swap_config_ts()
1110 hwc->config |= p4_config_pack_cccr(cccr); in p4_pmu_swap_config_ts()
1111 hwc->config &= ~P4_CONFIG_HT; in p4_pmu_swap_config_ts()
1211 struct hw_perf_event *hwc; in p4_pmu_schedule_events() local
1223 hwc = &cpuc->event_list[i]->hw; in p4_pmu_schedule_events()
1236 bind = p4_config_get_bind(hwc->config); in p4_pmu_schedule_events()
1241 if (hwc->idx != -1 && !p4_should_swap_ts(hwc->config, cpu)) { in p4_pmu_schedule_events()
1242 cntr_idx = hwc->idx; in p4_pmu_schedule_events()
1244 assign[i] = hwc->idx; in p4_pmu_schedule_events()
1253 config_alias = p4_get_alias_event(hwc->config); in p4_pmu_schedule_events()
1256 hwc->config = config_alias; in p4_pmu_schedule_events()
1276 if (p4_should_swap_ts(hwc->config, cpu)) in p4_pmu_schedule_events()
1277 hwc->idx = -1; in p4_pmu_schedule_events()
1278 p4_pmu_swap_config_ts(hwc, cpu); in p4_pmu_schedule_events()