Skip to content

Commit 5047b09

Browse files
authored
Revert "deepin: Fix kabi for CWF PMU support"
This reverts commit 527ec89.
1 parent 3e321ca commit 5047b09

File tree

4 files changed

+12
-33
lines changed

4 files changed

+12
-33
lines changed

arch/x86/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static int __x86_pmu_event_init(struct perf_event *event)
675675
event->hw.idx = -1;
676676
event->hw.last_cpu = -1;
677677
event->hw.last_tag = ~0ULL;
678-
event->hw_ext->dyn_constraint = ~0ULL;
678+
event->hw.dyn_constraint = ~0ULL;
679679

680680
/* mark unused */
681681
event->hw.extra_reg.idx = EXTRA_REG_NONE;

arch/x86/events/intel/core.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,7 +2927,6 @@ static void intel_pmu_config_acr(int idx, u64 mask, u32 reload)
29272927
static void intel_pmu_enable_acr(struct perf_event *event)
29282928
{
29292929
struct hw_perf_event *hwc = &event->hw;
2930-
struct hw_perf_event_ext *hw_ext = event->hw_ext;
29312930

29322931
if (!is_acr_event_group(event) || !event->attr.config2) {
29332932
/*
@@ -2938,7 +2937,7 @@ static void intel_pmu_enable_acr(struct perf_event *event)
29382937
return;
29392938
}
29402939

2941-
intel_pmu_config_acr(hwc->idx, hw_ext->config1, -hwc->sample_period);
2940+
intel_pmu_config_acr(hwc->idx, hwc->config1, -hwc->sample_period);
29422941
}
29432942

29442943
DEFINE_STATIC_CALL_NULL(intel_pmu_enable_acr_event, intel_pmu_enable_acr);
@@ -2999,7 +2998,7 @@ static void intel_pmu_acr_late_setup(struct cpu_hw_events *cpuc)
29992998
if (i + idx >= cpuc->n_events ||
30002999
!is_acr_event_group(cpuc->event_list[i + idx]))
30013000
return;
3002-
__set_bit(cpuc->assign[i + idx], (unsigned long *)&event->hw_ext->config1);
3001+
__set_bit(cpuc->assign[i + idx], (unsigned long *)&event->hw.config1);
30033002
}
30043003
}
30053004
i = j - 1;
@@ -3845,9 +3844,9 @@ intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
38453844
if (cpuc->excl_cntrs)
38463845
return intel_get_excl_constraints(cpuc, event, idx, c2);
38473846

3848-
if (event->hw_ext->dyn_constraint != ~0ULL) {
3847+
if (event->hw.dyn_constraint != ~0ULL) {
38493848
c2 = dyn_constraint(cpuc, c2, idx);
3850-
c2->idxmsk64 &= event->hw_ext->dyn_constraint;
3849+
c2->idxmsk64 &= event->hw.dyn_constraint;
38513850
c2->weight = hweight64(c2->idxmsk64);
38523851
}
38533852

@@ -4211,7 +4210,7 @@ static bool intel_pmu_is_acr_group(struct perf_event *event)
42114210
static inline void intel_pmu_set_acr_cntr_constr(struct perf_event *event,
42124211
u64 *cause_mask, int *num)
42134212
{
4214-
event->hw_ext->dyn_constraint &= hybrid(event->pmu, acr_cntr_mask64);
4213+
event->hw.dyn_constraint &= hybrid(event->pmu, acr_cntr_mask64);
42154214
*cause_mask |= event->attr.config2;
42164215
*num += 1;
42174216
}
@@ -4220,7 +4219,7 @@ static inline void intel_pmu_set_acr_caused_constr(struct perf_event *event,
42204219
int idx, u64 cause_mask)
42214220
{
42224221
if (test_bit(idx, (unsigned long *)&cause_mask))
4223-
event->hw_ext->dyn_constraint &= hybrid(event->pmu, acr_cause_mask64);
4222+
event->hw.dyn_constraint &= hybrid(event->pmu, acr_cause_mask64);
42244223
}
42254224

42264225
static int intel_pmu_hw_config(struct perf_event *event)
@@ -4286,7 +4285,7 @@ static int intel_pmu_hw_config(struct perf_event *event)
42864285
return -EINVAL;
42874286
if (branch_sample_counters(leader)) {
42884287
num++;
4289-
leader->hw_ext->dyn_constraint &= x86_pmu.lbr_counters;
4288+
leader->hw.dyn_constraint &= x86_pmu.lbr_counters;
42904289
}
42914290
leader->hw.flags |= PERF_X86_EVENT_BRANCH_COUNTERS;
42924291

@@ -4295,7 +4294,7 @@ static int intel_pmu_hw_config(struct perf_event *event)
42954294
return -EINVAL;
42964295
if (branch_sample_counters(sibling)) {
42974296
num++;
4298-
sibling->hw_ext->dyn_constraint &= x86_pmu.lbr_counters;
4297+
sibling->hw.dyn_constraint &= x86_pmu.lbr_counters;
42994298
}
43004299
}
43014300

include/linux/perf_event.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,6 @@ struct hw_perf_event_extra {
150150

151151
static_assert((PERF_EVENT_FLAG_USER_READ_CNT & PERF_EVENT_FLAG_ARCH) == 0);
152152

153-
struct hw_perf_event_ext {
154-
#ifdef CONFIG_PERF_EVENTS
155-
union {
156-
struct {
157-
u64 config1;
158-
u64 dyn_constraint;
159-
};
160-
};
161-
#endif
162-
};
163-
164153
/**
165154
* struct hw_perf_event - performance event hardware details:
166155
*/
@@ -169,7 +158,9 @@ struct hw_perf_event {
169158
union {
170159
struct { /* hardware */
171160
u64 config;
161+
u64 config1;
172162
u64 last_tag;
163+
u64 dyn_constraint;
173164
unsigned long config_base;
174165
unsigned long event_base;
175166
int event_base_rdpmc;
@@ -863,7 +854,7 @@ struct perf_event {
863854
*/
864855
__u32 orig_type;
865856

866-
DEEPIN_KABI_USE(1, struct hw_perf_event_ext *hw_ext)
857+
DEEPIN_KABI_RESERVE(1)
867858
DEEPIN_KABI_RESERVE(2)
868859
DEEPIN_KABI_RESERVE(3)
869860
DEEPIN_KABI_RESERVE(4)

kernel/events/core.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ static DEFINE_MUTEX(pmus_lock);
425425
static struct srcu_struct pmus_srcu;
426426
static cpumask_var_t perf_online_mask;
427427
static struct kmem_cache *perf_event_cache;
428-
static struct kmem_cache *perf_hw_event_cache;
429428

430429
/*
431430
* perf event paranoia level:
@@ -5013,7 +5012,6 @@ static void free_event_rcu(struct rcu_head *head)
50135012
if (event->ns)
50145013
put_pid_ns(event->ns);
50155014
perf_event_free_filter(event);
5016-
kmem_cache_free(perf_hw_event_cache, event->hw_ext);
50175015
kmem_cache_free(perf_event_cache, event);
50185016
}
50195017

@@ -12069,14 +12067,6 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
1206912067
if (!event)
1207012068
return ERR_PTR(-ENOMEM);
1207112069

12072-
event->hw_ext = kmem_cache_alloc_node(perf_hw_event_cache,
12073-
GFP_KERNEL | __GFP_ZERO,
12074-
node);
12075-
if (!event->hw_ext) {
12076-
kmem_cache_free(perf_event_cache, event);
12077-
return ERR_PTR(-ENOMEM);
12078-
}
12079-
1208012070
/*
1208112071
* Single events are their own group leaders, with an
1208212072
* empty sibling list:
@@ -13939,7 +13929,6 @@ void __init perf_event_init(void)
1393913929
WARN(ret, "hw_breakpoint initialization failed with: %d", ret);
1394013930

1394113931
perf_event_cache = KMEM_CACHE(perf_event, SLAB_PANIC);
13942-
perf_hw_event_cache = KMEM_CACHE(hw_perf_event_ext, SLAB_PANIC);
1394313932

1394413933
/*
1394513934
* Build time assertion that we keep the data_head at the intended

0 commit comments

Comments
 (0)