Commit 5121062e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 266ee584 3d62f95b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ config RV_MON_PAGEFAULT
	select RV_LTL_MONITOR
	depends on RV_MON_RTAPP
	depends on X86 || RISCV
	depends on MMU
	default y
	select LTL_MON_EVENTS_ID
	bool "pagefault monitor"
+6 −6
Original line number Diff line number Diff line
@@ -501,7 +501,7 @@ static void *enabled_monitors_next(struct seq_file *m, void *p, loff_t *pos)

	list_for_each_entry_continue(mon, &rv_monitors_list, list) {
		if (mon->enabled)
			return mon;
			return &mon->list;
	}

	return NULL;
@@ -509,7 +509,7 @@ static void *enabled_monitors_next(struct seq_file *m, void *p, loff_t *pos)

static void *enabled_monitors_start(struct seq_file *m, loff_t *pos)
{
	struct rv_monitor *mon;
	struct list_head *head;
	loff_t l;

	mutex_lock(&rv_interface_lock);
@@ -517,15 +517,15 @@ static void *enabled_monitors_start(struct seq_file *m, loff_t *pos)
	if (list_empty(&rv_monitors_list))
		return NULL;

	mon = list_entry(&rv_monitors_list, struct rv_monitor, list);
	head = &rv_monitors_list;

	for (l = 0; l <= *pos; ) {
		mon = enabled_monitors_next(m, mon, &l);
		if (!mon)
		head = enabled_monitors_next(m, head, &l);
		if (!head)
			break;
	}

	return mon;
	return head;
}

/*