Index: conf.c =================================================================== RCS file: /cvs/src/sys/arch/sparc64/sparc64/conf.c,v diff -u -p -r1.90 conf.c --- conf.c 11 Jun 2024 09:21:32 -0000 1.90 +++ conf.c 25 May 2025 21:58:41 -0000 @@ -110,6 +110,7 @@ cdev_decl(pci); #include "ksyms.h" #include "kstat.h" +#include "llt.h" #include "hotplug.h" #include "vscsi.h" @@ -180,7 +181,8 @@ struct cdevsw cdevsw[] = cdev_notdef(), /* 28 */ cdev_notdef(), /* 29 */ cdev_dt_init(NDT,dt), /* 30: dynamic tracer */ - cdev_notdef(), /* 31 */ + cdev_lltrace_init(NLLT,lltrace), + /* 31: lltrace */ cdev_notdef(), /* 32 */ cdev_notdef(), /* 33 */ cdev_notdef(), /* 34 */ Index: intr.c =================================================================== RCS file: /cvs/src/sys/arch/sparc64/sparc64/intr.c,v diff -u -p -r1.71 intr.c --- intr.c 12 May 2025 04:49:19 -0000 1.71 +++ intr.c 25 May 2025 21:58:41 -0000 @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -79,6 +80,8 @@ intr_handler(struct trapframe *tf, struc #ifdef MULTIPROCESSOR int need_lock; + LLTRACE(lltrace_intr_enter, LLTRACE_INTR_T_HW, ih->ih_number); + if (ih->ih_mpsafe) need_lock = 0; else @@ -88,12 +91,17 @@ intr_handler(struct trapframe *tf, struc KERNEL_LOCK(); #endif ci->ci_idepth++; + LLTRACE(lltrace_fn_enter, ih->ih_fun); rc = (*ih->ih_fun)(ih->ih_arg ? ih->ih_arg : tf); + LLTRACE(lltrace_fn_leave, ih->ih_fun); ci->ci_idepth--; #ifdef MULTIPROCESSOR if (need_lock) KERNEL_UNLOCK(); #endif + + LLTRACE(lltrace_intr_leave, LLTRACE_INTR_T_HW, ih->ih_number); + return rc; } @@ -112,7 +120,9 @@ intr_list_handler(void *arg) sparc_wrpr(pil, ih->ih_pil, 0); ci->ci_handled_intr_level = ih->ih_pil; + LLTRACE_CPU(ci, lltrace_fn_enter, ih->ih_fun); rv = ih->ih_fun(ih->ih_arg); + LLTRACE_CPU(ci, lltrace_fn_leave, ih->ih_fun); if (rv) { ih->ih_count.ec_count++; claimed = 1; Index: ipifuncs.c =================================================================== RCS file: /cvs/src/sys/arch/sparc64/sparc64/ipifuncs.c,v diff -u -p -r1.22 ipifuncs.c --- ipifuncs.c 14 Apr 2024 19:08:09 -0000 1.22 +++ ipifuncs.c 25 May 2025 21:58:41 -0000 @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -74,6 +75,8 @@ sun4u_send_ipi(int itid, void (*func)(vo KASSERT((u_int64_t)func > MAXINTNUM); + LLTRACE(lltrace_ipi, itid); + /* * UltraSPARC-IIIi CPUs select the BUSY/NACK pair based on the * lower two bits of the ITID. @@ -127,6 +130,8 @@ sun4v_send_ipi(int itid, void (*func)(vo u_int64_t s; int err, i; + LLTRACE(lltrace_ipi, itid); + s = intr_disable(); stha(ci->ci_cpuset, ASI_PHYS_CACHED, itid); @@ -154,6 +159,8 @@ sun4v_send_ipi(int itid, void (*func)(vo void sparc64_broadcast_ipi(void (*func)(void), u_int64_t arg0, u_int64_t arg1) { + LLTRACE(lltrace_ipi, ~0x0); + if (CPU_ISSUN4V) sun4v_broadcast_ipi(func, arg0, arg1); else @@ -180,6 +187,8 @@ sun4v_broadcast_ipi(void (*func)(void), struct cpu_info *ci = curcpu(); paddr_t cpuset = ci->ci_cpuset; int err, i, ncpus = 0; + + LLTRACE(lltrace_ipi, ~0x0); for (ci = cpus; ci != NULL; ci = ci->ci_next) { if (ci->ci_cpuid == cpu_number()) Index: machdep.c =================================================================== RCS file: /cvs/src/sys/arch/sparc64/sparc64/machdep.c,v diff -u -p -r1.218 machdep.c --- machdep.c 22 May 2024 05:51:49 -0000 1.218 +++ machdep.c 25 May 2025 21:58:41 -0000 @@ -991,12 +991,20 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b buflen -= incr; vaddr += incr; - if (i > 0 && pa == (segs[i - 1].ds_addr + - segs[i - 1].ds_len) && ((segs[i - 1].ds_len + incr) - < map->_dm_maxsegsz)) { - /* Hey, waddyaknow, they're contiguous */ - segs[i - 1].ds_len += incr; - continue; + if (i > 0) { + bus_dma_segment_t *pseg = &segs[i - 1]; + if (pa == pseg->ds_addr + pseg->ds_len) { + /* waddyaknow, they're contiguous */ + long nlen = pseg->ds_len + incr; + if (nlen <= map->_dm_maxsegsz) { + pseg->ds_len = nlen; + continue; + } + pseg->ds_len = map->_dm_maxsegsz; + + pa = pseg->ds_addr + map->_dm_maxsegsz; + incr = nlen - map->_dm_maxsegsz; + } } segs[i].ds_addr = pa; segs[i].ds_len = incr;