From: Matthew Dillon Date: Fri, 27 Apr 2018 06:43:15 +0000 (-0700) Subject: kernel - Add two debug variables to struct globaldata X-Git-Tag: v5.5.0~718 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/c693df0ef073582bd4beb3b72a1cf920348cc418 kernel - Add two debug variables to struct globaldata * Add two debug variables to struct globaldata. These variables can be used in assembly to debug difficult issues and accessed in kgdb or by IPI failure alerts. --- diff --git a/sys/platform/pc64/x86_64/genassym.c b/sys/platform/pc64/x86_64/genassym.c index 073e76b75b..cee837f919 100644 --- a/sys/platform/pc64/x86_64/genassym.c +++ b/sys/platform/pc64/x86_64/genassym.c @@ -207,6 +207,8 @@ ASSYM(MDGLOBALDATA_BASEALLOC_PAGES, MDGLOBALDATA_BASEALLOC_PAGES); ASSYM(GD_PRIVATE_TSS, offsetof(struct mdglobaldata, gd_private_tss)); ASSYM(GD_COMMON_TSS, offsetof(struct privatespace, common_tss)); ASSYM(GD_TRAMPOLINE, offsetof(struct privatespace, trampoline)); +ASSYM(GD_DEBUG1, offsetof(struct mdglobaldata, mi.gd_debug1)); +ASSYM(GD_DEBUG2, offsetof(struct mdglobaldata, mi.gd_debug2)); ASSYM(GD_USER_FS, offsetof(struct mdglobaldata, gd_user_fs)); ASSYM(GD_USER_GS, offsetof(struct mdglobaldata, gd_user_gs)); ASSYM(GD_INTR_NESTING_LEVEL, offsetof(struct mdglobaldata, mi.gd_intr_nesting_level)); diff --git a/sys/platform/pc64/x86_64/global.s b/sys/platform/pc64/x86_64/global.s index d1f40980d2..ce9e61eccb 100644 --- a/sys/platform/pc64/x86_64/global.s +++ b/sys/platform/pc64/x86_64/global.s @@ -49,9 +49,11 @@ * Define layout of the global data. On SMP this lives in * the per-cpu address space, otherwise it's in the data segment. */ - .globl gd_trampoline + .globl gd_trampoline, gd_debug1, gd_debug2 .globl gd_curthread, gd_npxthread, gd_reqflags, gd_common_tss .set gd_trampoline,globaldata + GD_TRAMPOLINE + .set gd_debug1,globaldata + GD_DEBUG1 + .set gd_debug2,globaldata + GD_DEBUG2 .set gd_curthread,globaldata + GD_CURTHREAD .set gd_npxthread,globaldata + GD_NPXTHREAD .set gd_reqflags,globaldata + GD_REQFLAGS diff --git a/sys/sys/globaldata.h b/sys/sys/globaldata.h index 8f66f6f04f..70ae125a06 100644 --- a/sys/sys/globaldata.h +++ b/sys/sys/globaldata.h @@ -199,7 +199,9 @@ struct globaldata { uint32_t gd_loadav_nrunnable; /* pcpu lwps nrunnable */ uint32_t gd_reserved32[1]; struct lock gd_sysctllock; /* sysctl topology lock */ - void *gd_preserved[4]; /* future fields */ + uintptr_t gd_debug1; + uintptr_t gd_debug2; + void *gd_preserved[2]; /* future fields */ /* extended by */ };