Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Dec 2024 01:44:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        fs@FreeBSD.org
Subject:   [Bug 267028] kernel panics when booting with both (zfs,ko or vboxnetflt,ko or acpi_wmi.ko) and amdgpu.ko
Message-ID:  <bug-267028-3630-0LgCHRvMXQ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-267028-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-267028-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267028

--- Comment #294 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to George Mitchell from comment #292)

As it looks like those printf lines might be contributing to
problems of themselves, here is an alternate patch that
keeps history internally that I'd be able to examine via
the vmcore.*

Again: Only compile tested.

I doubt there is any reason to keep any kernel , kernel.debug ,
or vmcore.* that is based on the prior patch. Might as well
delete such to get the disk space back.

The below is based on the original, official code, not
on the prior patch.

# 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..fb5697ee5067 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -1515,14 +1515,36 @@ modlist_lookup2(const char *name, const struct
mod_depend *verinfo)
        return (bestmod);
 }

+#define MODLIST_NEWMOD_HIST_SLOTS 256
+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];
+static int modlist_newmod_hist_pos=3D MODLIST_NEWMOD_HIST_SLOTS; // First =
use
will wrap to 0 first.
+
 static modlist_t
 modlist_newmodule(const char *modname, int version, linker_file_t containe=
r)
 {
        modlist_t mod;

        mod =3D malloc(sizeof(struct modlist), M_LINKER, M_NOWAIT | M_ZERO);
+
+       ++modlist_newmod_hist_pos;
+       if (MODLIST_NEWMOD_HIST_SLOTS<=3Dmodlist_newmod_hist_pos)
modlist_newmod_hist_pos=3D 0;
+#undef MODLIST_NEWMOD_HIST_SLOTS
+       modlist_newmod_hist[modlist_newmod_hist_pos].modAddr=3D       mod;
+       modlist_newmod_hist[modlist_newmod_hist_pos].containerAddr=3D conta=
iner;
+       modlist_newmod_hist[modlist_newmod_hist_pos].modnameAddr=3D   modna=
me;
+       modlist_newmod_hist[modlist_newmod_hist_pos].version=3D       versi=
on;
+
        if (mod =3D=3D NULL)
                panic("no memory for module list");
+
+       if (mod < (modlist_t)0xfffff80000000100)
+               panic("modlist_newmodule: mod <
(modlist_t)PHYS_TO_DMAP(0x100)");
+
        mod->container =3D container;
        mod->name =3D modname;
        mod->version =3D version;

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267028-3630-0LgCHRvMXQ>