[Bug 267028] kernel panics when booting with both (zfs,ko or vboxnetflt,ko or acpi_wmi.ko) and amdgpu.ko
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Dec 2024 04:27:56 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267028
--- Comment #297 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Mark Millard from comment #294)
Updated patch that does some checking of the
stages between which the odd value shows up:
# git -C /usr/alt-src diff sys/kern/kern_linker.c
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 5271d002fba4..2f94d2cca356 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -1475,6 +1475,18 @@ sys_kldsym(struct thread *td, struct kldsym_args *uap)
return (error);
}
+#define MODLIST_NEWMOD_HIST_SLOTS 256
+static char const* modlist_newmod_lookup_name= NULL;
// NULL: No problem found.
+static int modlist_newmod_hist_pos=
MODLIST_NEWMOD_HIST_SLOTS; // First use will wrap to 0 first.
+static int modlist_newmod_tqe_next_changed_at=
MODLIST_NEWMOD_HIST_SLOTS; // I.E.: No such found.
+static modlist_t modlist_newmod_tqe_next_newvalue= NULL;
// NULL: No such found.
+static struct modlist_newmod_hist_type {
+ modlist_t modAddr;
+ linker_file_t containerAddr;
+ char const* modnameAddr;
+ int version;
+} modlist_newmod_hist[MODLIST_NEWMOD_HIST_SLOTS];
+
/*
* Preloaded module support
*/
@@ -1484,6 +1496,17 @@ modlist_lookup(const char *name, int ver)
{
modlist_t mod;
+ int modlist_newmod_rescan_start_at = 0;
+ if (16 <= modlist_newmod_hist_pos) modlist_newmod_rescan_start_at=
modlist_newmod_hist_pos-16;
+ for (int scan_pos= modlist_newmod_rescan_start_at;
scan_pos<modlist_newmod_hist_pos; ++scan_pos)
+ if(modlist_newmod_hist[scan_pos].modAddr->link.tqe_next !=
modlist_newmod_hist[scan_pos+1].modAddr)
+ {
+ modlist_newmod_lookup_name= name;
+ modlist_newmod_tqe_next_changed_at= scan_pos;
+ modlist_newmod_tqe_next_newvalue=
modlist_newmod_hist[scan_pos].modAddr->link.tqe_next;
+ panic("modlist_lookup: a prior tqe_next changed!");
+ }
+
TAILQ_FOREACH(mod, &found_modules, link) {
if (strcmp(mod->name, name) == 0 &&
(ver == 0 || mod->version == ver))
@@ -1521,8 +1544,21 @@ modlist_newmodule(const char *modname, int version,
linker_file_t container)
modlist_t mod;
mod = malloc(sizeof(struct modlist), M_LINKER, M_NOWAIT | M_ZERO);
+
+ ++modlist_newmod_hist_pos;
+ if (MODLIST_NEWMOD_HIST_SLOTS<=modlist_newmod_hist_pos)
modlist_newmod_hist_pos= 0;
+#undef MODLIST_NEWMOD_HIST_SLOTS
+ modlist_newmod_hist[modlist_newmod_hist_pos].modAddr= mod;
+ modlist_newmod_hist[modlist_newmod_hist_pos].containerAddr= container;
+ modlist_newmod_hist[modlist_newmod_hist_pos].modnameAddr= modname;
+ modlist_newmod_hist[modlist_newmod_hist_pos].version= version;
+
if (mod == NULL)
panic("no memory for module list");
+
+ if (mod < (modlist_t)0xfffff80000000100)
+ panic("modlist_newmodule: mod <
(modlist_t)PHYS_TO_DMAP(0x100)");
+
mod->container = container;
mod->name = modname;
mod->version = version;
--
You are receiving this mail because:
You are on the CC list for the bug.