FreeBSD Bugzilla – Attachment 256204 Details for
Bug 267028
kernel panics when booting with both (zfs,ko or vboxnetflt,ko or acpi_wmi.ko) and amdgpu.ko
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch attempting automatic hwatchpoint assignment
file_267028.txt (text/plain), 3.54 KB, created by
Mark Millard
on 2024-12-27 19:55:38 UTC
(
hide
)
Description:
patch attempting automatic hwatchpoint assignment
Filename:
MIME Type:
Creator:
Mark Millard
Created:
2024-12-27 19:55:38 UTC
Size:
3.54 KB
patch
obsolete
>diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c >index 5271d002fba4..642be2079031 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 volatile char const* modlist_newmod_lookup_name= NULL; // NULL: No problem found. >+static volatile int modlist_newmod_hist_pos= MODLIST_NEWMOD_HIST_SLOTS; // First update will wrap to 0 first. >+static volatile 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,20 @@ modlist_lookup(const char *name, int ver) > { > modlist_t mod; > >+ if (modlist_newmod_hist_pos<MODLIST_NEWMOD_HIST_SLOTS) >+ { >+ 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,12 +1547,42 @@ 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; > TAILQ_INSERT_TAIL(&found_modules, mod, link); >+ >+ if ( 0 < modlist_newmod_hist_pos >+ || modlist_newmod_hist[modlist_newmod_hist_pos-1].modAddr->link.tqe_next != mod >+ ) >+ panic("modlist_newmodule: prior node's tqe_next has bad value."); >+ >+ if ( strcmp(modlist_newmod_hist[modlist_newmod_hist_pos-1].modnameAddr,"amdgpu_raven_mec_bin_fw")==0 >+ || strcmp(modlist_newmod_hist[modlist_newmod_hist_pos-1].modnameAddr,"amdgpu_raven_me_bin_fw")==0 >+ || strcmp(modlist_newmod_hist[modlist_newmod_hist_pos-1].modnameAddr,"amdgpu_raven_mec2_bin_fw")==0 >+ ) >+ db_hwatchpoint_cmd >+ ( (db_expr_t)(void*)&modlist_newmod_hist[modlist_newmod_hist_pos-1].modAddr->link.tqe_next >+ , true >+ , 8 >+ , NULL >+ ); >+ > return (mod); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 267028
:
237279
|
238024
|
238075
|
238668
|
238802
|
238849
|
238850
|
238886
|
239336
|
239752
|
239967
|
240427
|
240591
|
240622
|
240642
|
240643
|
240683
|
240684
|
240729
|
240731
|
241022
|
241027
|
241046
|
241523
|
241741
|
241750
|
255825
|
256016
|
256017
|
256053
|
256054
|
256064
|
256116
|
256119
|
256120
|
256139
|
256160
|
256193
|
256204
|
256207
|
256220
|
256245
|
256279