CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: hannken Date: Fri Mar 3 10:01:31 UTC 2023 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c Log Message: Adapt zfs_netbsd_access() to ACL support. As ZFS itself only handles VREAD, VWRITE, VEXEC and VAPPEND we use kauth_authorize_vnode() to handle VADMIN. >From FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.80 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.81 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.80 Mon Oct 3 16:04:19 2022 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Fri Mar 3 10:01:31 2023 @@ -5169,33 +5169,47 @@ zfs_netbsd_access(void *v) accmode_t a_accmode; kauth_cred_t a_cred; } */ *ap = v; - struct vnode *vp = ap->a_vp; - accmode_t accmode = ap->a_accmode; - mode_t zfs_mode = 0; + vnode_t *vp = ap->a_vp; + znode_t *zp = VTOZ(vp); + accmode_t accmode; kauth_cred_t cred = ap->a_cred; - int error; + int error = 0; /* - * XXX This is really random, especially the left shift by six, - * and it exists only because of randomness in zfs_unix_to_v4 - * and zfs_zaccess_rwx in zfs_acl.c. + * ZFS itself only knowns about VREAD, VWRITE, VEXEC and VAPPEND, */ - if (accmode & VREAD) - zfs_mode |= S_IROTH; - if (accmode & VWRITE) - zfs_mode |= S_IWOTH; - if (accmode & VEXEC) - zfs_mode |= S_IXOTH; - zfs_mode <<= 6; + accmode = ap->a_accmode & (VREAD|VWRITE|VEXEC|VAPPEND); + if (accmode != 0) + error = zfs_access(vp, accmode, 0, cred, NULL); - KASSERT(VOP_ISLOCKED(vp)); - error = zfs_access(vp, zfs_mode, 0, cred, NULL); + /* + * VADMIN has to be handled by kauth_authorize_vnode(). + */ + if (error == 0) { + accmode = ap->a_accmode & ~(VREAD|VWRITE|VEXEC|VAPPEND); + if (accmode != 0) { + error = kauth_authorize_vnode(cred, + KAUTH_ACCESS_ACTION(accmode, vp->v_type, + zp->z_mode & ALLPERMS), vp, NULL, + genfs_can_access(vp, cred, zp->z_uid, + zp->z_gid, zp->z_mode & ALLPERMS, NULL, accmode)); + } + } + + /* + * For VEXEC, ensure that at least one execute bit is set for + * non-directories. + */ + if (error == 0 && (ap->a_accmode & VEXEC) != 0 && vp->v_type != VDIR && + (zp->z_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0) { + error = EACCES; + } /* We expect EACCES as common error. */ if (error == EPERM) error = EACCES; - return (error); + return error; } static int
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: hannken Date: Fri Mar 3 10:01:31 UTC 2023 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c Log Message: Adapt zfs_netbsd_access() to ACL support. As ZFS itself only handles VREAD, VWRITE, VEXEC and VAPPEND we use kauth_authorize_vnode() to handle VADMIN. >From FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/miscfs/genfs
Module Name:src Committed By: hannken Date: Fri Mar 3 10:02:51 UTC 2023 Modified Files: src/sys/miscfs/genfs: genfs_vnops.c Log Message: Fix genfs_can_chtimes() to also handle the condition: If the time pointer is null, then write permission on the file is also sufficient. >From FreeBSD. Should fix PR kern/57246 "NFS group permissions regression" To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 src/sys/miscfs/genfs/genfs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/miscfs/genfs
Module Name:src Committed By: hannken Date: Fri Mar 3 10:02:51 UTC 2023 Modified Files: src/sys/miscfs/genfs: genfs_vnops.c Log Message: Fix genfs_can_chtimes() to also handle the condition: If the time pointer is null, then write permission on the file is also sufficient. >From FreeBSD. Should fix PR kern/57246 "NFS group permissions regression" To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 src/sys/miscfs/genfs/genfs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/miscfs/genfs/genfs_vnops.c diff -u src/sys/miscfs/genfs/genfs_vnops.c:1.219 src/sys/miscfs/genfs/genfs_vnops.c:1.220 --- src/sys/miscfs/genfs/genfs_vnops.c:1.219 Sun Mar 27 17:10:55 2022 +++ src/sys/miscfs/genfs/genfs_vnops.c Fri Mar 3 10:02:51 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: genfs_vnops.c,v 1.219 2022/03/27 17:10:55 christos Exp $ */ +/* $NetBSD: genfs_vnops.c,v 1.220 2023/03/03 10:02:51 hannken Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.219 2022/03/27 17:10:55 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.220 2023/03/03 10:02:51 hannken Exp $"); #include #include @@ -1315,23 +1315,14 @@ genfs_can_chtimes(vnode_t *vp, kauth_cre * will be allowed to set the times [..] to the current * server time. */ - if ((error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred)) != 0) - return (vaflags & VA_UTIMES_NULL) == 0 ? EPERM : EACCES; - - /* Must be owner, or... */ - if (kauth_cred_geteuid(cred) == owner_uid) - return (0); - - /* set the times to the current time, and... */ - if ((vaflags & VA_UTIMES_NULL) == 0) - return (EPERM); + error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred); + if (error != 0 && (vaflags & VA_UTIMES_NULL) != 0) + error = VOP_ACCESS(vp, VWRITE, cred); - /* have write access. */ - error = VOP_ACCESS(vp, VWRITE, cred); if (error) - return (error); + return (vaflags & VA_UTIMES_NULL) == 0 ? EPERM : EACCES; - return (0); + return 0; } /*
CVS commit: src/sys/kern
Module Name:src Committed By: riastradh Date: Fri Mar 3 12:52:50 UTC 2023 Modified Files: src/sys/kern: kern_entropy.c Log Message: entropy(9): Allow changing flags on all entropy sources at once. Entropy sources should all have nonempty names, and this will enable an operator to, for example, disable all but a specific entropy source. XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/kern/kern_entropy.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_entropy.c diff -u src/sys/kern/kern_entropy.c:1.58 src/sys/kern/kern_entropy.c:1.59 --- src/sys/kern/kern_entropy.c:1.58 Wed Mar 1 08:13:54 2023 +++ src/sys/kern/kern_entropy.c Fri Mar 3 12:52:49 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_entropy.c,v 1.58 2023/03/01 08:13:54 riastradh Exp $ */ +/* $NetBSD: kern_entropy.c,v 1.59 2023/03/03 12:52:49 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.58 2023/03/01 08:13:54 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.59 2023/03/03 12:52:49 riastradh Exp $"); #include #include @@ -1634,6 +1634,8 @@ rnd_attach_source(struct krndsource *rs, uint32_t extra[4]; unsigned i = 0; + KASSERTMSG(name[0] != '\0', "rndsource must have nonempty name"); + /* Grab cycle counter to mix extra into the pool. */ extra[i++] = entropy_timer(); @@ -2387,7 +2389,7 @@ entropy_ioctl(unsigned long cmd, void *d if (rndctl->type != 0xff) { if (rs->type != rndctl->type) continue; - } else { + } else if (rndctl->name[0] != '\0') { if (strncmp(rs->name, rndctl->name, n) != 0) continue; }
CVS commit: src/sys/kern
Module Name:src Committed By: riastradh Date: Fri Mar 3 12:52:50 UTC 2023 Modified Files: src/sys/kern: kern_entropy.c Log Message: entropy(9): Allow changing flags on all entropy sources at once. Entropy sources should all have nonempty names, and this will enable an operator to, for example, disable all but a specific entropy source. XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/kern/kern_entropy.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/sys
Module Name:src Committed By: riastradh Date: Fri Mar 3 12:53:04 UTC 2023 Modified Files: src/lib/libc/sys: mremap.2 Log Message: mremap(2): Note MAP_REMAPDUP bug. XXX pullup-10, unless we fix the bug first To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/sys/mremap.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/sys
Module Name:src Committed By: riastradh Date: Fri Mar 3 12:53:04 UTC 2023 Modified Files: src/lib/libc/sys: mremap.2 Log Message: mremap(2): Note MAP_REMAPDUP bug. XXX pullup-10, unless we fix the bug first To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/sys/mremap.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/mremap.2 diff -u src/lib/libc/sys/mremap.2:1.8 src/lib/libc/sys/mremap.2:1.9 --- src/lib/libc/sys/mremap.2:1.8 Wed Mar 1 20:08:41 2023 +++ src/lib/libc/sys/mremap.2 Fri Mar 3 12:53:04 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: mremap.2,v 1.8 2023/03/01 20:08:41 riastradh Exp $ +.\" $NetBSD: mremap.2,v 1.9 2023/03/03 12:53:04 riastradh Exp $ .\" .\" Copyright (c) 2007 Thomas Klausner and Joerg Sonnenberger .\" All rights reserved. @@ -231,3 +231,36 @@ system call appeared in It was based on the code that supports .Fn mremap compatibility for Linux binaries. +.Sh BUGS +If a mapping is created by +.Xr mmap 2 +with +.Dv MAP_PRIVATE +and then duplicated by +.Nm +with +.Dv MAP_REMAPDUP , +calling +.Xr fork 2 +destroys the coupling between the original and duplicate mapping. +Workarounds: +.Bl -dash +.It +Create the original mapping with +.Dv MAP_SHARED . +.It +Use +.Xr minherit 2 +with +.Dv MAP_INHERIT_NONE +on the writable mapping. +.It +Don't use +.Xr fork 2 ; +use +.Xr posix_spawn 2 . +.El +.Pp +See +.%U https://gnats.NetBSD.org/55177 +for details.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:32:27 UTC 2023 Modified Files: src/sys/arch/i386/i386: genassym.cf locore.S Log Message: Revert "x86: Add kthread_fpu_enter/exit support, take two -- forgot i386 bits." kthread_fpu_enter/exit changes broke some hardware, unclear why, to investigate before fixing and reapplying these changes. To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133 src/sys/arch/i386/i386/genassym.cf cvs rdiff -u -r1.193 -r1.194 src/sys/arch/i386/i386/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/i386/genassym.cf diff -u src/sys/arch/i386/i386/genassym.cf:1.132 src/sys/arch/i386/i386/genassym.cf:1.133 --- src/sys/arch/i386/i386/genassym.cf:1.132 Sat Feb 25 18:35:54 2023 +++ src/sys/arch/i386/i386/genassym.cf Fri Mar 3 14:32:27 2023 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.132 2023/02/25 18:35:54 riastradh Exp $ +# $NetBSD: genassym.cf,v 1.133 2023/03/03 14:32:27 riastradh Exp $ # # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -175,7 +175,6 @@ define L_MD_FLAGS offsetof(struct lwp, define L_MD_ASTPENDING offsetof(struct lwp, l_md.md_astpending) define LW_SYSTEM LW_SYSTEM -define LW_SYSTEM_FPU LW_SYSTEM_FPU define MDL_FPU_IN_CPU MDL_FPU_IN_CPU define P_FLAG offsetof(struct proc, p_flag) Index: src/sys/arch/i386/i386/locore.S diff -u src/sys/arch/i386/i386/locore.S:1.193 src/sys/arch/i386/i386/locore.S:1.194 --- src/sys/arch/i386/i386/locore.S:1.193 Wed Mar 1 08:38:50 2023 +++ src/sys/arch/i386/i386/locore.S Fri Mar 3 14:32:27 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.193 2023/03/01 08:38:50 riastradh Exp $ */ +/* $NetBSD: locore.S,v 1.194 2023/03/03 14:32:27 riastradh Exp $ */ /* * Copyright-o-rama! @@ -128,7 +128,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.193 2023/03/01 08:38:50 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.194 2023/03/03 14:32:27 riastradh Exp $"); #include "opt_copy_symtab.h" #include "opt_ddb.h" @@ -1471,7 +1471,7 @@ ENTRY(cpu_switchto) /* Don't bother with the rest if switching to a system process. */ testl $LW_SYSTEM,L_FLAG(%edi) - jnz .Lswitch_system + jnz switch_return #ifndef XENPV /* Restore thread-private %fs/%gs descriptors. */ @@ -1525,21 +1525,6 @@ switch_return: popl %ebx ret -.Lswitch_system: - /* - * If it has LWP_SYSTEM_FPU set, meaning it's running in - * kthread_fpu_enter/exit, we need to restore the FPU state - * and enable FPU instructions with fpu_handle_deferred. - * - * No need to test MDL_FPU_IN_CPU via HANDLE_DEFERRED_FPU -- - * fpu_switch guarantees it is clear, so we can just call - * fpu_handle_deferred unconditionally. - */ - testl $LW_SYSTEM_FPU,L_FLAG(%edi) - jz switch_return - call _C_LABEL(fpu_handle_deferred) - jmp switch_return - .Lcopy_iobitmap: /* Copy I/O bitmap. */ incl _C_LABEL(pmap_iobmp_evcnt)+EV_COUNT
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:32:27 UTC 2023 Modified Files: src/sys/arch/i386/i386: genassym.cf locore.S Log Message: Revert "x86: Add kthread_fpu_enter/exit support, take two -- forgot i386 bits." kthread_fpu_enter/exit changes broke some hardware, unclear why, to investigate before fixing and reapplying these changes. To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133 src/sys/arch/i386/i386/genassym.cf cvs rdiff -u -r1.193 -r1.194 src/sys/arch/i386/i386/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:32:38 UTC 2023 Modified Files: src/sys/arch/x86/x86: fpu.c Log Message: Revert "x86/fpu.c: Sprinkle KNF." kthread_fpu_enter/exit changes broke some hardware, unclear why, to investigate before fixing and reapplying these changes. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:32:38 UTC 2023 Modified Files: src/sys/arch/x86/x86: fpu.c Log Message: Revert "x86/fpu.c: Sprinkle KNF." kthread_fpu_enter/exit changes broke some hardware, unclear why, to investigate before fixing and reapplying these changes. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.83 src/sys/arch/x86/x86/fpu.c:1.84 --- src/sys/arch/x86/x86/fpu.c:1.83 Sat Feb 25 18:28:57 2023 +++ src/sys/arch/x86/x86/fpu.c Fri Mar 3 14:32:38 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.83 2023/02/25 18:28:57 riastradh Exp $ */ +/* $NetBSD: fpu.c,v 1.84 2023/03/03 14:32:38 riastradh Exp $ */ /* * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc. All @@ -96,38 +96,35 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.83 2023/02/25 18:28:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.84 2023/03/03 14:32:38 riastradh Exp $"); #include "opt_multiprocessor.h" #include -#include - +#include #include #include #include +#include #include #include -#include #include -#include #include #include -#include -#include #include +#include #include +#include #include -#include #include - +#include #include #include #ifdef XENPV -#define clts() HYPERVISOR_fpu_taskswitch(0) -#define stts() HYPERVISOR_fpu_taskswitch(1) +#define clts() HYPERVISOR_fpu_taskswitch(0) +#define stts() HYPERVISOR_fpu_taskswitch(1) #endif void fpu_handle_deferred(void); @@ -182,8 +179,7 @@ fpu_save_lwp(struct lwp *l) s = splvm(); if (l->l_md.md_flags & MDL_FPU_IN_CPU) { KASSERT(lwp_can_haz_fpu(l)); - fpu_area_save(area, x86_xsave_features, - !(l->l_proc->p_flag & PK_32)); + fpu_area_save(area, x86_xsave_features, !(l->l_proc->p_flag & PK_32)); l->l_md.md_flags &= ~MDL_FPU_IN_CPU; } splx(s); @@ -196,14 +192,12 @@ fpu_save_lwp(struct lwp *l) void fpu_save(void) { - fpu_save_lwp(curlwp); } void fpuinit(struct cpu_info *ci) { - /* * This might not be strictly necessary since it will be initialized * for each process. However it does no harm. @@ -284,7 +278,6 @@ fpu_errata_amd(void) void fpu_area_save(void *area, uint64_t xsave_features, bool is_64bit) { - switch (x86_fpu_save) { case FPU_SAVE_FSAVE: fnsave(area); @@ -306,7 +299,6 @@ fpu_area_save(void *area, uint64_t xsave void fpu_area_restore(const void *area, uint64_t xsave_features, bool is_64bit) { - clts(); switch (x86_fpu_save) { @@ -331,7 +323,6 @@ void fpu_handle_deferred(void) { struct pcb *pcb = lwp_getpcb(curlwp); - fpu_area_restore(&pcb->pcb_savefpu, x86_xsave_features, !(curlwp->l_proc->p_flag & PK_32)); } @@ -388,7 +379,7 @@ fpu_lwp_abandon(struct lwp *l) splx(s); } -/* - */ +/* -- */ static const union savefpu safe_fpu __aligned(64) = { .sv_xmm = { @@ -437,8 +428,8 @@ fpu_kern_enter(void) ci->ci_kfpu_spl = s; /* - * If we are in a softint and have a pinned lwp, the fpu state - * is that of the pinned lwp, so save it there. + * If we are in a softint and have a pinned lwp, the fpu state is that + * of the pinned lwp, so save it there. */ while ((l->l_pflag & LP_INTR) && (l->l_switchto != NULL)) l = l->l_switchto; @@ -522,7 +513,7 @@ kthread_fpu_exit_md(void) stts(); } -/* - */ +/* -- */ /* * The following table is used to ensure that the FPE_... value @@ -676,7 +667,6 @@ fpudna(struct trapframe *frame) static inline void fpu_xstate_reload(union savefpu *fpu_save, uint64_t xstate) { - /* * Force a reload of the given xstate during the next XRSTOR. */ @@ -875,7 +865,6 @@ process_read_xstate(struct lwp *l, struc int process_verify_xstate(const struct xstate *xstate) { - /* xstate_bv must be a subset of RFBM */ if (xstate->xs_xstate_bv & ~xstate->xs_rfbm) return EINVAL; @@ -905,10 +894,8 @@ process_write_xstate(struct lwp *l, cons /* Convert data into legacy FSAVE format. */ if (x86_fpu_save == FPU_SAVE_FSAVE) { - if (xstate->xs_xstate_bv & XCR0_X87) { - process_xmm_to_s87(&xstate->xs_fxsave, - &fpu_save->sv_87); - } + if (xstate->xs_xstate_bv & XCR0_X87) + process_xmm_to_s87(&xstate->xs_fxsave, &fpu_save->sv_87); return 0; } @@ -941,16 +928,15 @@ process_write_xstate(struct lwp *l, cons /* * Invalid bits in mxcsr or mxcsr_mask will cause faults. */ - fpu_save->sv_xmm.fx_mxcsr_mask = - xstate->xs_fxsave.fx_mxcsr_mask & x86_fpu_mxcsr_mask; + fpu_save->s
CVS commit: src/sys/arch
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:32:48 UTC 2023 Modified Files: src/sys/arch/amd64/amd64: genassym.cf locore.S src/sys/arch/x86/x86: fpu.c Log Message: Revert "x86: Add kthread_fpu_enter/exit support, take two." kthread_fpu_enter/exit changes broke some hardware, unclear why, to investigate before fixing and reapplying these changes. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/arch/amd64/amd64/genassym.cf cvs rdiff -u -r1.217 -r1.218 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.84 -r1.85 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:32:48 UTC 2023 Modified Files: src/sys/arch/amd64/amd64: genassym.cf locore.S src/sys/arch/x86/x86: fpu.c Log Message: Revert "x86: Add kthread_fpu_enter/exit support, take two." kthread_fpu_enter/exit changes broke some hardware, unclear why, to investigate before fixing and reapplying these changes. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/arch/amd64/amd64/genassym.cf cvs rdiff -u -r1.217 -r1.218 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.84 -r1.85 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/genassym.cf diff -u src/sys/arch/amd64/amd64/genassym.cf:1.94 src/sys/arch/amd64/amd64/genassym.cf:1.95 --- src/sys/arch/amd64/amd64/genassym.cf:1.94 Sat Feb 25 18:04:42 2023 +++ src/sys/arch/amd64/amd64/genassym.cf Fri Mar 3 14:32:48 2023 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.94 2023/02/25 18:04:42 riastradh Exp $ +# $NetBSD: genassym.cf,v 1.95 2023/03/03 14:32:48 riastradh Exp $ # # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -166,7 +166,6 @@ define L_MD_FLAGS offsetof(struct lwp, define L_MD_ASTPENDING offsetof(struct lwp, l_md.md_astpending) define LW_SYSTEM LW_SYSTEM -define LW_SYSTEM_FPU LW_SYSTEM_FPU define MDL_IRET MDL_IRET define MDL_COMPAT32 MDL_COMPAT32 define MDL_FPU_IN_CPU MDL_FPU_IN_CPU Index: src/sys/arch/amd64/amd64/locore.S diff -u src/sys/arch/amd64/amd64/locore.S:1.217 src/sys/arch/amd64/amd64/locore.S:1.218 --- src/sys/arch/amd64/amd64/locore.S:1.217 Wed Mar 1 08:38:50 2023 +++ src/sys/arch/amd64/amd64/locore.S Fri Mar 3 14:32:48 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.217 2023/03/01 08:38:50 riastradh Exp $ */ +/* $NetBSD: locore.S,v 1.218 2023/03/03 14:32:48 riastradh Exp $ */ /* * Copyright-o-rama! @@ -1271,7 +1271,7 @@ ENTRY(cpu_switchto) /* Don't bother with the rest if switching to a system process. */ testl $LW_SYSTEM,L_FLAG(%r12) - jnz .Lswitch_system + jnz .Lswitch_return /* Is this process using RAS (restartable atomic sequences)? */ movq L_PROC(%r12),%rdi @@ -1360,21 +1360,6 @@ ENTRY(cpu_switchto) popq %r12 popq %rbx ret - -.Lswitch_system: - /* - * If it has LWP_SYSTEM_FPU set, meaning it's running in - * kthread_fpu_enter/exit, we need to restore the FPU state - * and enable FPU instructions with fpu_handle_deferred. - * - * No need to test MDL_FPU_IN_CPU via HANDLE_DEFERRED_FPU -- - * fpu_switch guarantees it is clear, so we can just call - * fpu_handle_deferred unconditionally. - */ - testl $LW_SYSTEM_FPU,L_FLAG(%r12) - jz .Lswitch_return - callq _C_LABEL(fpu_handle_deferred) - jmp .Lswitch_return END(cpu_switchto) /* Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.84 src/sys/arch/x86/x86/fpu.c:1.85 --- src/sys/arch/x86/x86/fpu.c:1.84 Fri Mar 3 14:32:38 2023 +++ src/sys/arch/x86/x86/fpu.c Fri Mar 3 14:32:48 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.84 2023/03/03 14:32:38 riastradh Exp $ */ +/* $NetBSD: fpu.c,v 1.85 2023/03/03 14:32:48 riastradh Exp $ */ /* * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc. All @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.84 2023/03/03 14:32:38 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.85 2023/03/03 14:32:48 riastradh Exp $"); #include "opt_multiprocessor.h" @@ -107,7 +107,6 @@ __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.84 #include #include #include -#include #include #include @@ -132,35 +131,13 @@ void fpu_switch(struct lwp *, struct lwp uint32_t x86_fpu_mxcsr_mask __read_mostly = 0; -/* - * True if this a thread that is allowed to use the FPU -- either a - * user thread, or a system thread with LW_SYSTEM_FPU enabled. - */ -static inline bool -lwp_can_haz_fpu(struct lwp *l) -{ - - return (l->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) != LW_SYSTEM; -} - -/* - * True if this is a system thread with its own private FPU state. - */ -static inline bool -lwp_system_fpu_p(struct lwp *l) -{ - - return (l->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) == - (LW_SYSTEM|LW_SYSTEM_FPU); -} - static inline union savefpu * fpu_lwp_area(struct lwp *l) { struct pcb *pcb = lwp_getpcb(l); union savefpu *area = &pcb->pcb_savefpu; - KASSERT(lwp_can_haz_fpu(l)); + KASSERT((l->l_flag & LW_SYSTEM) == 0); if (l == curlwp) { fpu_save(); } @@ -178,7 +155,7 @@ fpu_save_lwp(struct lwp *l) s = splvm(); if (l->l_md.md_flags & MDL_FPU_IN_CPU) { - KASSERT(lwp_can_haz_fpu(l)); + KASSERT((l->l_flag & LW_SYSTEM) == 0); fpu_area_save(area, x86_xsave_features, !(l->l_proc->p_flag & PK_32)); l->l_md.md_flags &= ~MDL_FPU_IN_CPU; } @@ -337,7 +314,7 @@ fpu_switch(struct lwp *oldlwp, struct lw cpu_index(ci), ci->ci_ilevel); if (oldlwp->l_md.md_flags & MDL_FPU_IN_CPU) { - KASSERT(lwp_can_haz_fpu(
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:40:00 UTC 2023 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: x86: Call fpuinit_mxcsr_mask only once. No need to call it again and again on the secondary CPUs to compute what should be the same mxcsr mask. (If it's not, we have deeper problems!) To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 src/sys/arch/x86/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:40:00 UTC 2023 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: x86: Call fpuinit_mxcsr_mask only once. No need to call it again and again on the secondary CPUs to compute what should be the same mxcsr mask. (If it's not, we have deeper problems!) To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 src/sys/arch/x86/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.207 src/sys/arch/x86/x86/cpu.c:1.208 --- src/sys/arch/x86/x86/cpu.c:1.207 Sat Feb 25 00:31:40 2023 +++ src/sys/arch/x86/x86/cpu.c Fri Mar 3 14:40:00 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.207 2023/02/25 00:31:40 riastradh Exp $ */ +/* $NetBSD: cpu.c,v 1.208 2023/03/03 14:40:00 riastradh Exp $ */ /* * Copyright (c) 2000-2020 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.207 2023/02/25 00:31:40 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.208 2023/03/03 14:40:00 riastradh Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -701,7 +701,8 @@ cpu_init(struct cpu_info *ci) ci->ci_feat_val[1] = descs[2]; } - if (x86_fpu_save >= FPU_SAVE_FXSAVE) { + if (CPU_IS_PRIMARY(ci) && + x86_fpu_save >= FPU_SAVE_FXSAVE) { fpuinit_mxcsr_mask(); }
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:40:16 UTC 2023 Modified Files: src/sys/arch/x86/x86: fpu.c Log Message: x86/fpu: Align savefpu to 64 bytes in fpuinit_mxcsr_mask. 16 bytes is not enough. (Is this why it never worked on Xen some years back? Got lucky and accidentally had 64-byte alignment on native x86, but not in the call stack in Xen?) XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Fri Mar 3 14:40:16 UTC 2023 Modified Files: src/sys/arch/x86/x86: fpu.c Log Message: x86/fpu: Align savefpu to 64 bytes in fpuinit_mxcsr_mask. 16 bytes is not enough. (Is this why it never worked on Xen some years back? Got lucky and accidentally had 64-byte alignment on native x86, but not in the call stack in Xen?) XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.85 src/sys/arch/x86/x86/fpu.c:1.86 --- src/sys/arch/x86/x86/fpu.c:1.85 Fri Mar 3 14:32:48 2023 +++ src/sys/arch/x86/x86/fpu.c Fri Mar 3 14:40:16 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.85 2023/03/03 14:32:48 riastradh Exp $ */ +/* $NetBSD: fpu.c,v 1.86 2023/03/03 14:40:16 riastradh Exp $ */ /* * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc. All @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.85 2023/03/03 14:32:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.86 2023/03/03 14:40:16 riastradh Exp $"); #include "opt_multiprocessor.h" @@ -188,7 +188,7 @@ void fpuinit_mxcsr_mask(void) { #ifndef XENPV - union savefpu fpusave __aligned(16); + union savefpu fpusave __aligned(64); u_long psl; memset(&fpusave, 0, sizeof(fpusave));
CVS commit: src/share/misc
Module Name:src Committed By: jschauma Date: Fri Mar 3 15:29:49 UTC 2023 Modified Files: src/share/misc: acronyms.comp Log Message: add CMC (Certificate Management over CMS, RFC5272) add CMS (Cryptographic Message Syntax, RFC5652) To generate a diff of this commit: cvs rdiff -u -r1.344 -r1.345 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/misc
Module Name:src Committed By: jschauma Date: Fri Mar 3 15:29:49 UTC 2023 Modified Files: src/share/misc: acronyms.comp Log Message: add CMC (Certificate Management over CMS, RFC5272) add CMS (Cryptographic Message Syntax, RFC5652) To generate a diff of this commit: cvs rdiff -u -r1.344 -r1.345 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.344 src/share/misc/acronyms.comp:1.345 --- src/share/misc/acronyms.comp:1.344 Wed Mar 1 15:45:00 2023 +++ src/share/misc/acronyms.comp Fri Mar 3 15:29:48 2023 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.344 2023/03/01 15:45:00 fcambus Exp $ +$NetBSD: acronyms.comp,v 1.345 2023/03/03 15:29:48 jschauma Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -269,7 +269,9 @@ CM configuration management CMA concert multithread architecture CMC chassis management controller CMC corrected machine check +CMC certificate management over CMS CMS {configuration,content,course} management system +CMS cryptographic message syntax CMI control {management,method} interface CMOS complementary metal-oxide-semiconductor CMP chip multi-processing
CVS commit: [netbsd-10] src/sys/arch/arm/ti
Module Name:src Committed By: martin Date: Fri Mar 3 17:02:43 UTC 2023 Modified Files: src/sys/arch/arm/ti [netbsd-10]: if_cpsw.c Log Message: Pull up following revision(s) (requested by sekiya in ticket #109): sys/arch/arm/ti/if_cpsw.c: revision 1.17 Uncomment and protect sanity checks that would drop into the debugger with a CPSW_DEBUG_DMA define. This handles a condition where checking for DMA_RXEOQ in the received packet results in the console being spammed with "rxeoq" messages, which soon results in a kernel panic. The corresponding Debugger() call for this check was commented out. The TI documentation ("AM335x and AMIC110 Sitara(TM) Processors Technical Reference Manual") documents the EOQ bit thus: (14.3.2.4.1.2.4) This bit is set by the EMAC when the EMAC identifies that a descriptor is the last for a given packet received (also sets the EOP flag), and there are no more descriptors in the receive list (next descriptor pointer is NULL). The software application can use this bit to detect when the EMAC receiver for the corresponding channel has halted. This is useful when the application appends additional free buffer descriptors to an active receive queue. Note that this flag is valid on EOP descriptors only. Moving this check (and the offending printf() ) into a debug #ifdef results in the BeagleBone Green surviving the nightly checks; it would always drop into the debugger before this change. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/arch/arm/ti/if_cpsw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/sys/arch/arm/ti
Module Name:src Committed By: martin Date: Fri Mar 3 17:02:43 UTC 2023 Modified Files: src/sys/arch/arm/ti [netbsd-10]: if_cpsw.c Log Message: Pull up following revision(s) (requested by sekiya in ticket #109): sys/arch/arm/ti/if_cpsw.c: revision 1.17 Uncomment and protect sanity checks that would drop into the debugger with a CPSW_DEBUG_DMA define. This handles a condition where checking for DMA_RXEOQ in the received packet results in the console being spammed with "rxeoq" messages, which soon results in a kernel panic. The corresponding Debugger() call for this check was commented out. The TI documentation ("AM335x and AMIC110 Sitara(TM) Processors Technical Reference Manual") documents the EOQ bit thus: (14.3.2.4.1.2.4) This bit is set by the EMAC when the EMAC identifies that a descriptor is the last for a given packet received (also sets the EOP flag), and there are no more descriptors in the receive list (next descriptor pointer is NULL). The software application can use this bit to detect when the EMAC receiver for the corresponding channel has halted. This is useful when the application appends additional free buffer descriptors to an active receive queue. Note that this flag is valid on EOP descriptors only. Moving this check (and the offending printf() ) into a debug #ifdef results in the BeagleBone Green surviving the nightly checks; it would always drop into the debugger before this change. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/arch/arm/ti/if_cpsw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/ti/if_cpsw.c diff -u src/sys/arch/arm/ti/if_cpsw.c:1.16 src/sys/arch/arm/ti/if_cpsw.c:1.16.4.1 --- src/sys/arch/arm/ti/if_cpsw.c:1.16 Sun Sep 18 15:47:09 2022 +++ src/sys/arch/arm/ti/if_cpsw.c Fri Mar 3 17:02:43 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cpsw.c,v 1.16 2022/09/18 15:47:09 thorpej Exp $ */ +/* $NetBSD: if_cpsw.c,v 1.16.4.1 2023/03/03 17:02:43 martin Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.16 2022/09/18 15:47:09 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.16.4.1 2023/03/03 17:02:43 martin Exp $"); #include #include @@ -95,6 +95,8 @@ __KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v CTASSERT(powerof2(CPSW_NTXDESCS)); CTASSERT(powerof2(CPSW_NRXDESCS)); +#undef CPSW_DEBUG_DMA /* define this for DMA debugging */ + #define CPSW_PAD_LEN (ETHER_MIN_LEN - ETHER_CRC_LEN) #define TXDESC_NEXT(x) cpsw_txdesc_adjust((x), 1) @@ -1181,10 +1183,12 @@ cpsw_rxintr(void *arg) return 1; } +#if defined(CPSW_DEBUG_DMA) if ((dw[3] & (CPDMA_BD_SOP | CPDMA_BD_EOP)) != (CPDMA_BD_SOP | CPDMA_BD_EOP)) { - //Debugger(); + Debugger(); } +#endif bus_dmamap_sync(sc->sc_bdt, dm, 0, dm->dm_mapsize, BUS_DMASYNC_POSTREAD); @@ -1219,10 +1223,12 @@ next: cpsw_rxdesc_paddr(sc, i)); } +#if defined(CPSW_DEBUG_DMA) if (sc->sc_rxeoq) { device_printf(sc->sc_dev, "rxeoq\n"); - //Debugger(); + Debugger(); } +#endif cpsw_write_4(sc, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_RX); @@ -1269,9 +1275,11 @@ cpsw_txintr(void *arg) cpsw_get_txdesc(sc, sc->sc_txhead, &bd); +#if defined(CPSW_DEBUG_DMA) if (dw[2] == 0) { //Debugger(); } +#endif if (ISSET(dw[3], CPDMA_BD_SOP) == 0) goto next;
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Fri Mar 3 17:03:36 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Ticket #109 To generate a diff of this commit: cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-10.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Fri Mar 3 17:03:36 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Ticket #109 To generate a diff of this commit: cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-10.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-10.0 diff -u src/doc/CHANGES-10.0:1.1.2.38 src/doc/CHANGES-10.0:1.1.2.39 --- src/doc/CHANGES-10.0:1.1.2.38 Fri Feb 24 14:16:10 2023 +++ src/doc/CHANGES-10.0 Fri Mar 3 17:03:36 2023 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-10.0,v 1.1.2.38 2023/02/24 14:16:10 martin Exp $ +# $NetBSD: CHANGES-10.0,v 1.1.2.39 2023/03/03 17:03:36 martin Exp $ A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16 until the 10.0 release: @@ -1410,3 +1410,9 @@ sys/external/bsd/drm2/linux/linux_dma_bu drm: Teach dmabuf to handle lseek. [riastradh, ticket #108] +sys/arch/arm/ti/if_cpsw.c 1.17 + + cpsw(4): disable a debug message unless explicit driver + debugging is requested. + [sekiya, ticket #109] +
CVS commit: [netbsd-9] src/sys/arch/arm/ti
Module Name:src Committed By: martin Date: Fri Mar 3 17:04:17 UTC 2023 Modified Files: src/sys/arch/arm/ti [netbsd-9]: if_cpsw.c Log Message: Pull up following revision(s) (requested by sekiya in ticket #1609): sys/arch/arm/ti/if_cpsw.c: revision 1.17 Uncomment and protect sanity checks that would drop into the debugger with a CPSW_DEBUG_DMA define. This handles a condition where checking for DMA_RXEOQ in the received packet results in the console being spammed with "rxeoq" messages, which soon results in a kernel panic. The corresponding Debugger() call for this check was commented out. The TI documentation ("AM335x and AMIC110 Sitara(TM) Processors Technical Reference Manual") documents the EOQ bit thus: (14.3.2.4.1.2.4) This bit is set by the EMAC when the EMAC identifies that a descriptor is the last for a given packet received (also sets the EOP flag), and there are no more descriptors in the receive list (next descriptor pointer is NULL). The software application can use this bit to detect when the EMAC receiver for the corresponding channel has halted. This is useful when the application appends additional free buffer descriptors to an active receive queue. Note that this flag is valid on EOP descriptors only. Moving this check (and the offending printf() ) into a debug #ifdef results in the BeagleBone Green surviving the nightly checks; it would always drop into the debugger before this change. To generate a diff of this commit: cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/arch/arm/ti/if_cpsw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/ti/if_cpsw.c diff -u src/sys/arch/arm/ti/if_cpsw.c:1.6.2.3 src/sys/arch/arm/ti/if_cpsw.c:1.6.2.4 --- src/sys/arch/arm/ti/if_cpsw.c:1.6.2.3 Thu Feb 20 14:36:38 2020 +++ src/sys/arch/arm/ti/if_cpsw.c Fri Mar 3 17:04:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cpsw.c,v 1.6.2.3 2020/02/20 14:36:38 martin Exp $ */ +/* $NetBSD: if_cpsw.c,v 1.6.2.4 2023/03/03 17:04:17 martin Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.6.2.3 2020/02/20 14:36:38 martin Exp $"); +__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.6.2.4 2023/03/03 17:04:17 martin Exp $"); #include #include @@ -95,6 +95,8 @@ __KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v CTASSERT(powerof2(CPSW_NTXDESCS)); CTASSERT(powerof2(CPSW_NRXDESCS)); +#undef CPSW_DEBUG_DMA /* define this for DMA debugging */ + #define CPSW_PAD_LEN (ETHER_MIN_LEN - ETHER_CRC_LEN) #define TXDESC_NEXT(x) cpsw_txdesc_adjust((x), 1) @@ -1159,10 +1161,12 @@ cpsw_rxintr(void *arg) return 1; } +#if defined(CPSW_DEBUG_DMA) if ((dw[3] & (CPDMA_BD_SOP | CPDMA_BD_EOP)) != (CPDMA_BD_SOP | CPDMA_BD_EOP)) { - //Debugger(); + Debugger(); } +#endif bus_dmamap_sync(sc->sc_bdt, dm, 0, dm->dm_mapsize, BUS_DMASYNC_POSTREAD); @@ -1197,10 +1201,12 @@ next: cpsw_rxdesc_paddr(sc, i)); } +#if defined(CPSW_DEBUG_DMA) if (sc->sc_rxeoq) { device_printf(sc->sc_dev, "rxeoq\n"); - //Debugger(); + Debugger(); } +#endif cpsw_write_4(sc, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_RX); @@ -1247,9 +1253,11 @@ cpsw_txintr(void *arg) cpsw_get_txdesc(sc, sc->sc_txhead, &bd); +#if defined(CPSW_DEBUG_DMA) if (dw[2] == 0) { //Debugger(); } +#endif if (ISSET(dw[3], CPDMA_BD_SOP) == 0) goto next;
CVS commit: [netbsd-9] src/sys/arch/arm/ti
Module Name:src Committed By: martin Date: Fri Mar 3 17:04:17 UTC 2023 Modified Files: src/sys/arch/arm/ti [netbsd-9]: if_cpsw.c Log Message: Pull up following revision(s) (requested by sekiya in ticket #1609): sys/arch/arm/ti/if_cpsw.c: revision 1.17 Uncomment and protect sanity checks that would drop into the debugger with a CPSW_DEBUG_DMA define. This handles a condition where checking for DMA_RXEOQ in the received packet results in the console being spammed with "rxeoq" messages, which soon results in a kernel panic. The corresponding Debugger() call for this check was commented out. The TI documentation ("AM335x and AMIC110 Sitara(TM) Processors Technical Reference Manual") documents the EOQ bit thus: (14.3.2.4.1.2.4) This bit is set by the EMAC when the EMAC identifies that a descriptor is the last for a given packet received (also sets the EOP flag), and there are no more descriptors in the receive list (next descriptor pointer is NULL). The software application can use this bit to detect when the EMAC receiver for the corresponding channel has halted. This is useful when the application appends additional free buffer descriptors to an active receive queue. Note that this flag is valid on EOP descriptors only. Moving this check (and the offending printf() ) into a debug #ifdef results in the BeagleBone Green surviving the nightly checks; it would always drop into the debugger before this change. To generate a diff of this commit: cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/arch/arm/ti/if_cpsw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Fri Mar 3 17:05:05 UTC 2023 Modified Files: src/doc [netbsd-9]: CHANGES-9.4 Log Message: Ticket #1609 To generate a diff of this commit: cvs rdiff -u -r1.1.2.54 -r1.1.2.55 src/doc/CHANGES-9.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Fri Mar 3 17:05:05 UTC 2023 Modified Files: src/doc [netbsd-9]: CHANGES-9.4 Log Message: Ticket #1609 To generate a diff of this commit: cvs rdiff -u -r1.1.2.54 -r1.1.2.55 src/doc/CHANGES-9.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-9.4 diff -u src/doc/CHANGES-9.4:1.1.2.54 src/doc/CHANGES-9.4:1.1.2.55 --- src/doc/CHANGES-9.4:1.1.2.54 Fri Feb 24 14:10:25 2023 +++ src/doc/CHANGES-9.4 Fri Mar 3 17:05:04 2023 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.4,v 1.1.2.54 2023/02/24 14:10:25 martin Exp $ +# $NetBSD: CHANGES-9.4,v 1.1.2.55 2023/03/03 17:05:04 martin Exp $ A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4 release: @@ -1260,3 +1260,9 @@ doc/3RDPARTY 1.1912 (manual edit) Import OpenSSL 1.1.1t. [kim, ticket #1608] +sys/arch/arm/ti/if_cpsw.c 1.17 + + cpsw(4): disable a debug message unless explicit driver + debugging is requested. + [sekiya, ticket #1609] +