Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48da330

Browse files
committed
Merge tag 'perf-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Thomas Gleixner: "A single fix for the x86 perf sysfs interfaces which used kobject attributes instead of device attributes and therefore making clang's control flow integrity checker upset"* tag 'perf-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86: fix sysfs type mismatches
2 parents855cf1e +ebd19fc commit48da330

File tree

4 files changed

+12
-24
lines changed

4 files changed

+12
-24
lines changed

‎arch/x86/events/intel/cstate.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@
107107
MODULE_LICENSE("GPL");
108108

109109
#defineDEFINE_CSTATE_FORMAT_ATTR(_var,_name,_format)\
110-
static ssize_t __cstate_##_var##_show(structkobject *kobj,\
111-
structkobj_attribute *attr,\
110+
static ssize_t __cstate_##_var##_show(structdevice *dev,\
111+
structdevice_attribute *attr,\
112112
char *page)\
113113
{\
114114
BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE);\
115115
return sprintf(page, _format "\n");\
116116
}\
117-
static structkobj_attribute format_attr_##_var =\
117+
static structdevice_attribute format_attr_##_var =\
118118
__ATTR(_name, 0444, __cstate_##_var##_show, NULL)
119119

120120
staticssize_tcstate_get_attr_cpumask(structdevice*dev,

‎arch/x86/events/intel/uncore.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ struct pci2phy_map *__find_pci2phy_map(int segment)
9494
returnmap;
9595
}
9696

97-
ssize_tuncore_event_show(structkobject*kobj,
98-
structkobj_attribute*attr,char*buf)
97+
ssize_tuncore_event_show(structdevice*dev,
98+
structdevice_attribute*attr,char*buf)
9999
{
100100
structuncore_event_desc*event=
101101
container_of(attr,structuncore_event_desc,attr);

‎arch/x86/events/intel/uncore.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ struct intel_uncore_box {
157157
#defineUNCORE_BOX_FLAG_CFL8_CBOX_MSR_OFFS2
158158

159159
structuncore_event_desc {
160-
structkobj_attributeattr;
160+
structdevice_attributeattr;
161161
constchar*config;
162162
};
163163

@@ -179,8 +179,8 @@ struct pci2phy_map {
179179
structpci2phy_map*__find_pci2phy_map(intsegment);
180180
intuncore_pcibus_to_physid(structpci_bus*bus);
181181

182-
ssize_tuncore_event_show(structkobject*kobj,
183-
structkobj_attribute*attr,char*buf);
182+
ssize_tuncore_event_show(structdevice*dev,
183+
structdevice_attribute*attr,char*buf);
184184

185185
staticinlinestructintel_uncore_pmu*dev_to_uncore_pmu(structdevice*dev)
186186
{
@@ -201,14 +201,14 @@ extern int __uncore_max_dies;
201201
}
202202

203203
#defineDEFINE_UNCORE_FORMAT_ATTR(_var,_name,_format)\
204-
static ssize_t __uncore_##_var##_show(structkobject *kobj,\
205-
structkobj_attribute *attr,\
204+
static ssize_t __uncore_##_var##_show(structdevice *dev,\
205+
structdevice_attribute *attr,\
206206
char *page)\
207207
{\
208208
BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE);\
209209
return sprintf(page, _format "\n");\
210210
}\
211-
static structkobj_attribute format_attr_##_var =\
211+
static structdevice_attribute format_attr_##_var =\
212212
__ATTR(_name, 0444, __uncore_##_var##_show, NULL)
213213

214214
staticinlinebooluncore_pmc_fixed(intidx)

‎arch/x86/events/rapl.c‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,6 @@ static const char *const rapl_domain_names[NR_RAPL_DOMAINS] __initconst = {
9393
* any other bit is reserved
9494
*/
9595
#defineRAPL_EVENT_MASK0xFFULL
96-
97-
#defineDEFINE_RAPL_FORMAT_ATTR(_var,_name,_format)\
98-
static ssize_t __rapl_##_var##_show(struct kobject *kobj,\
99-
struct kobj_attribute *attr,\
100-
char *page)\
101-
{\
102-
BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE);\
103-
return sprintf(page, _format "\n");\
104-
}\
105-
static struct kobj_attribute format_attr_##_var =\
106-
__ATTR(_name, 0444, __rapl_##_var##_show, NULL)
107-
10896
#defineRAPL_CNTR_WIDTH 32
10997

11098
#defineRAPL_EVENT_ATTR_STR(_name,v,str)\
@@ -441,7 +429,7 @@ static struct attribute_group rapl_pmu_events_group = {
441429
.attrs=attrs_empty,
442430
};
443431

444-
DEFINE_RAPL_FORMAT_ATTR(event,event,"config:0-7");
432+
PMU_FORMAT_ATTR(event,"config:0-7");
445433
staticstructattribute*rapl_formats_attr[]= {
446434
&format_attr_event.attr,
447435
NULL,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp