Skip to content

Commit 5121062

Browse files
committed
Merge tag 'trace-rv-v6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing fixes from Steven Rostedt: "A couple of fixes for Runtime Verification: - A bug caused a kernel panic when reading enabled_monitors was reported. Change callback functions to always use list_head iterators and by doing so, fix the wrong pointer that was leading to the panic. - The rtapp/pagefault monitor relies on the MMU to be present (pagefaults exist) but that was not enforced via kconfig, leading to potential build errors on systems without an MMU. Add that kconfig dependency" * tag 'trace-rv-v6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: rv: Make rtapp/pagefault monitor depends on CONFIG_MMU rv: Fully convert enabled_monitors to use list_head as iterator
2 parents 266ee58 + 3d62f95 commit 5121062

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

kernel/trace/rv/monitors/pagefault/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config RV_MON_PAGEFAULT
55
select RV_LTL_MONITOR
66
depends on RV_MON_RTAPP
77
depends on X86 || RISCV
8+
depends on MMU
89
default y
910
select LTL_MON_EVENTS_ID
1011
bool "pagefault monitor"

kernel/trace/rv/rv.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,31 +501,31 @@ static void *enabled_monitors_next(struct seq_file *m, void *p, loff_t *pos)
501501

502502
list_for_each_entry_continue(mon, &rv_monitors_list, list) {
503503
if (mon->enabled)
504-
return mon;
504+
return &mon->list;
505505
}
506506

507507
return NULL;
508508
}
509509

510510
static void *enabled_monitors_start(struct seq_file *m, loff_t *pos)
511511
{
512-
struct rv_monitor *mon;
512+
struct list_head *head;
513513
loff_t l;
514514

515515
mutex_lock(&rv_interface_lock);
516516

517517
if (list_empty(&rv_monitors_list))
518518
return NULL;
519519

520-
mon = list_entry(&rv_monitors_list, struct rv_monitor, list);
520+
head = &rv_monitors_list;
521521

522522
for (l = 0; l <= *pos; ) {
523-
mon = enabled_monitors_next(m, mon, &l);
524-
if (!mon)
523+
head = enabled_monitors_next(m, head, &l);
524+
if (!head)
525525
break;
526526
}
527527

528-
return mon;
528+
return head;
529529
}
530530

531531
/*

0 commit comments

Comments
 (0)