Skip to content

Commit b045b8c

Browse files
committed
Merge tag 'x86_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: "Two fixes: - An objdump checker fix to ignore parenthesized strings in the objdump version - Fix resctrl default monitoring groups reporting when new subgroups get created" * tag 'x86_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/resctrl: Fix default monitoring groups reporting x86/tools: Fix objdump version check again
2 parents 3e763ec + 064855a commit b045b8c

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,14 @@ static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr, unsigned int width)
285285
return chunks >>= shift;
286286
}
287287

288-
static int __mon_event_count(u32 rmid, struct rmid_read *rr)
288+
static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)
289289
{
290290
struct mbm_state *m;
291291
u64 chunks, tval;
292292

293293
tval = __rmid_read(rmid, rr->evtid);
294294
if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) {
295-
rr->val = tval;
296-
return -EINVAL;
295+
return tval;
297296
}
298297
switch (rr->evtid) {
299298
case QOS_L3_OCCUP_EVENT_ID:
@@ -305,12 +304,6 @@ static int __mon_event_count(u32 rmid, struct rmid_read *rr)
305304
case QOS_L3_MBM_LOCAL_EVENT_ID:
306305
m = &rr->d->mbm_local[rmid];
307306
break;
308-
default:
309-
/*
310-
* Code would never reach here because
311-
* an invalid event id would fail the __rmid_read.
312-
*/
313-
return -EINVAL;
314307
}
315308

316309
if (rr->first) {
@@ -361,23 +354,29 @@ void mon_event_count(void *info)
361354
struct rdtgroup *rdtgrp, *entry;
362355
struct rmid_read *rr = info;
363356
struct list_head *head;
357+
u64 ret_val;
364358

365359
rdtgrp = rr->rgrp;
366360

367-
if (__mon_event_count(rdtgrp->mon.rmid, rr))
368-
return;
361+
ret_val = __mon_event_count(rdtgrp->mon.rmid, rr);
369362

370363
/*
371-
* For Ctrl groups read data from child monitor groups.
364+
* For Ctrl groups read data from child monitor groups and
365+
* add them together. Count events which are read successfully.
366+
* Discard the rmid_read's reporting errors.
372367
*/
373368
head = &rdtgrp->mon.crdtgrp_list;
374369

375370
if (rdtgrp->type == RDTCTRL_GROUP) {
376371
list_for_each_entry(entry, head, mon.crdtgrp_list) {
377-
if (__mon_event_count(entry->mon.rmid, rr))
378-
return;
372+
if (__mon_event_count(entry->mon.rmid, rr) == 0)
373+
ret_val = 0;
379374
}
380375
}
376+
377+
/* Report error if none of rmid_reads are successful */
378+
if (ret_val)
379+
rr->val = ret_val;
381380
}
382381

383382
/*

arch/x86/tools/chkobjdump.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ BEGIN {
1010

1111
/^GNU objdump/ {
1212
verstr = ""
13+
gsub(/\(.*\)/, "");
1314
for (i = 3; i <= NF; i++)
1415
if (match($(i), "^[0-9]")) {
1516
verstr = $(i);

0 commit comments

Comments
 (0)