Lines Matching refs:box

201 static void nhmex_uncore_msr_init_box(struct intel_uncore_box *box)  in nhmex_uncore_msr_init_box()  argument
206 static void nhmex_uncore_msr_exit_box(struct intel_uncore_box *box) in nhmex_uncore_msr_exit_box() argument
211 static void nhmex_uncore_msr_disable_box(struct intel_uncore_box *box) in nhmex_uncore_msr_disable_box() argument
213 unsigned msr = uncore_msr_box_ctl(box); in nhmex_uncore_msr_disable_box()
218 config &= ~((1ULL << uncore_num_counters(box)) - 1); in nhmex_uncore_msr_disable_box()
220 if (uncore_msr_fixed_ctl(box)) in nhmex_uncore_msr_disable_box()
226 static void nhmex_uncore_msr_enable_box(struct intel_uncore_box *box) in nhmex_uncore_msr_enable_box() argument
228 unsigned msr = uncore_msr_box_ctl(box); in nhmex_uncore_msr_enable_box()
233 config |= (1ULL << uncore_num_counters(box)) - 1; in nhmex_uncore_msr_enable_box()
235 if (uncore_msr_fixed_ctl(box)) in nhmex_uncore_msr_enable_box()
241 static void nhmex_uncore_msr_disable_event(struct intel_uncore_box *box, struct perf_event *event) in nhmex_uncore_msr_disable_event() argument
246 static void nhmex_uncore_msr_enable_event(struct intel_uncore_box *box, struct perf_event *event) in nhmex_uncore_msr_enable_event() argument
252 else if (box->pmu->type->event_mask & NHMEX_PMON_CTL_EN_BIT0) in nhmex_uncore_msr_enable_event()
351 static int nhmex_bbox_hw_config(struct intel_uncore_box *box, struct perf_event *event) in nhmex_bbox_hw_config() argument
368 if (box->pmu->pmu_idx == 0) in nhmex_bbox_hw_config()
378 static void nhmex_bbox_msr_enable_event(struct intel_uncore_box *box, struct perf_event *event) in nhmex_bbox_msr_enable_event() argument
442 static int nhmex_sbox_hw_config(struct intel_uncore_box *box, struct perf_event *event) in nhmex_sbox_hw_config() argument
453 if (box->pmu->pmu_idx == 0) in nhmex_sbox_hw_config()
463 static void nhmex_sbox_msr_enable_event(struct intel_uncore_box *box, struct perf_event *event) in nhmex_sbox_msr_enable_event() argument
554 static bool nhmex_mbox_get_shared_reg(struct intel_uncore_box *box, int idx, u64 config) in nhmex_mbox_get_shared_reg() argument
562 er = &box->shared_regs[idx]; in nhmex_mbox_get_shared_reg()
587 er = &box->shared_regs[EXTRA_REG_NHMEX_M_ZDP_CTL_FVC]; in nhmex_mbox_get_shared_reg()
615 static void nhmex_mbox_put_shared_reg(struct intel_uncore_box *box, int idx) in nhmex_mbox_put_shared_reg() argument
620 er = &box->shared_regs[idx]; in nhmex_mbox_put_shared_reg()
626 er = &box->shared_regs[EXTRA_REG_NHMEX_M_ZDP_CTL_FVC]; in nhmex_mbox_put_shared_reg()
670 nhmex_mbox_get_constraint(struct intel_uncore_box *box, struct perf_event *event) in nhmex_mbox_get_constraint() argument
681 if (!uncore_box_is_fake(box) && (reg1->alloc & (0x1 << i))) in nhmex_mbox_get_constraint()
687 if (!nhmex_mbox_get_shared_reg(box, idx[i], in nhmex_mbox_get_constraint()
695 (uncore_box_is_fake(box) || !reg2->alloc) && in nhmex_mbox_get_constraint()
696 !nhmex_mbox_get_shared_reg(box, reg2->idx, reg2->config)) in nhmex_mbox_get_constraint()
705 if (!uncore_box_is_fake(box)) { in nhmex_mbox_get_constraint()
733 nhmex_mbox_put_shared_reg(box, idx[0]); in nhmex_mbox_get_constraint()
735 nhmex_mbox_put_shared_reg(box, idx[1]); in nhmex_mbox_get_constraint()
739 static void nhmex_mbox_put_constraint(struct intel_uncore_box *box, struct perf_event *event) in nhmex_mbox_put_constraint() argument
744 if (uncore_box_is_fake(box)) in nhmex_mbox_put_constraint()
748 nhmex_mbox_put_shared_reg(box, __BITS_VALUE(reg1->idx, 0, 8)); in nhmex_mbox_put_constraint()
750 nhmex_mbox_put_shared_reg(box, __BITS_VALUE(reg1->idx, 1, 8)); in nhmex_mbox_put_constraint()
754 nhmex_mbox_put_shared_reg(box, reg2->idx); in nhmex_mbox_put_constraint()
766 static int nhmex_mbox_hw_config(struct intel_uncore_box *box, struct perf_event *event) in nhmex_mbox_hw_config() argument
768 struct intel_uncore_type *type = box->pmu->type; in nhmex_mbox_hw_config()
785 msr = er->msr + type->msr_offset * box->pmu->pmu_idx; in nhmex_mbox_hw_config()
812 if (box->pmu->pmu_idx == 0) in nhmex_mbox_hw_config()
820 static u64 nhmex_mbox_shared_reg_config(struct intel_uncore_box *box, int idx) in nhmex_mbox_shared_reg_config() argument
827 return box->shared_regs[idx].config; in nhmex_mbox_shared_reg_config()
829 er = &box->shared_regs[EXTRA_REG_NHMEX_M_ZDP_CTL_FVC]; in nhmex_mbox_shared_reg_config()
836 static void nhmex_mbox_msr_enable_event(struct intel_uncore_box *box, struct perf_event *event) in nhmex_mbox_msr_enable_event() argument
846 nhmex_mbox_shared_reg_config(box, idx)); in nhmex_mbox_msr_enable_event()
850 nhmex_mbox_shared_reg_config(box, idx)); in nhmex_mbox_msr_enable_event()
945 static void nhmex_rbox_alter_er(struct intel_uncore_box *box, struct perf_event *event) in nhmex_rbox_alter_er() argument
979 nhmex_rbox_get_constraint(struct intel_uncore_box *box, struct perf_event *event) in nhmex_rbox_get_constraint() argument
990 if (!uncore_box_is_fake(box) && reg1->alloc) in nhmex_rbox_get_constraint()
1002 er = &box->shared_regs[er_idx]; in nhmex_rbox_get_constraint()
1053 if (!uncore_box_is_fake(box)) { in nhmex_rbox_get_constraint()
1055 nhmex_rbox_alter_er(box, event); in nhmex_rbox_get_constraint()
1063 static void nhmex_rbox_put_constraint(struct intel_uncore_box *box, struct perf_event *event) in nhmex_rbox_put_constraint() argument
1069 if (uncore_box_is_fake(box) || !reg1->alloc) in nhmex_rbox_put_constraint()
1078 er = &box->shared_regs[er_idx]; in nhmex_rbox_put_constraint()
1087 static int nhmex_rbox_hw_config(struct intel_uncore_box *box, struct perf_event *event) in nhmex_rbox_hw_config() argument
1112 static void nhmex_rbox_msr_enable_event(struct intel_uncore_box *box, struct perf_event *event) in nhmex_rbox_msr_enable_event() argument
1120 port = idx / 6 + box->pmu->pmu_idx * 4; in nhmex_rbox_msr_enable_event()
1132 uncore_shared_reg_config(box, 2 + (idx / 6) * 5)); in nhmex_rbox_msr_enable_event()