From owner-svn-src-all@freebsd.org Sun Jun 14 00:10:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E26C34671A; Sun, 14 Jun 2020 00:10:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kvx941ghz4dRn; Sun, 14 Jun 2020 00:10:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B33D23366; Sun, 14 Jun 2020 00:10:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E0ALSL065082; Sun, 14 Jun 2020 00:10:21 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E0AILw065070; Sun, 14 Jun 2020 00:10:18 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006140010.05E0AILw065070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 14 Jun 2020 00:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362158 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/msdosfs fs/nfs fs/nfsserver fs/unionfs kern nlm sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/msdosfs fs/nfs fs/nfsserver fs/unionfs kern nlm sys ufs/ffs X-SVN-Commit-Revision: 362158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 00:10:21 -0000 Author: rmacklem Date: Sun Jun 14 00:10:18 2020 New Revision: 362158 URL: https://svnweb.freebsd.org/changeset/base/362158 Log: Fix export_args ex_flags field so that is 64bits, the same as mnt_flags. Since mnt_flags was upgraded to 64bits there has been a quirk in "struct export_args", since it hold a copy of mnt_flags in ex_flags, which is an "int" (32bits). This happens to currently work, since all the flag bits used in ex_flags are defined in the low order 32bits. However, new export flags cannot be defined. Also, ex_anon is a "struct xucred", which limits it to 16 additional groups. This patch revises "struct export_args" to make ex_flags 64bits and replaces ex_anon with ex_uid, ex_ngroups and ex_groups (which points to a groups list, so it can be malloc'd up to NGROUPS in size. This requires that the VFS_CHECKEXP() arguments change, so I also modified the last "secflavors" argument to be an array pointer, so that the secflavors could be copied in VFS_CHECKEXP() while the export entry is locked. (Without this patch VFS_CHECKEXP() returns a pointer to the secflavors array and then it is used after being unlocked, which is potentially a problem if the exports entry is changed. In practice this does not occur when mountd is run with "-S", but I think it is worth fixing.) This patch also deleted the vfs_oexport_conv() function, since do_mount_update() does the conversion, as required by the old vfs_cmount() calls. Reviewed by: kib, freqlabs Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25088 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/nfs/nfsdport.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/unionfs/union_vfsops.c head/sys/kern/vfs_export.c head/sys/kern/vfs_init.c head/sys/kern/vfs_mount.c head/sys/nlm/nlm_prot_impl.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Jun 14 00:10:18 2020 (r362158) @@ -101,8 +101,8 @@ static int zfs_root(vfs_t *vfsp, int flags, vnode_t ** static int zfs_statfs(vfs_t *vfsp, struct statfs *statp); static int zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **vpp); static int zfs_sync(vfs_t *vfsp, int waitfor); -static int zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp, - struct ucred **credanonp, int *numsecflavors, int **secflavors); +static int zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, uint64_t *extflagsp, + struct ucred **credanonp, int *numsecflavors, int *secflavors); static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp); static void zfs_objset_close(zfsvfs_t *zfsvfs); static void zfs_freevfs(vfs_t *vfsp); @@ -2268,8 +2268,8 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t ** } static int -zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp, - struct ucred **credanonp, int *numsecflavors, int **secflavors) +zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, uint64_t *extflagsp, + struct ucred **credanonp, int *numsecflavors, int *secflavors) { zfsvfs_t *zfsvfs = vfsp->vfs_data; Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Jun 14 00:10:18 2020 (r362158) @@ -101,16 +101,14 @@ static int cd9660_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct iso_args args; - struct export_args exp; int error; error = copyin(data, &args, sizeof args); if (error) return (error); - vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &exp, sizeof(exp)); + ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); ma = mount_argsu(ma, "cs_disk", args.cs_disk, 64); ma = mount_argsu(ma, "cs_local", args.cs_local, 64); ma = mount_argf(ma, "ssector", "%u", args.ssector); Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Jun 14 00:10:18 2020 (r362158) @@ -190,7 +190,6 @@ static int msdosfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct msdosfs_args args; - struct export_args exp; int error; if (data == NULL) @@ -198,10 +197,9 @@ msdosfs_cmount(struct mntarg *ma, void *data, uint64_t error = copyin(data, &args, sizeof args); if (error) return (error); - vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &exp, sizeof(exp)); + ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mask", "%d", args.mask); Modified: head/sys/fs/nfs/nfsdport.h ============================================================================== --- head/sys/fs/nfs/nfsdport.h Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/fs/nfs/nfsdport.h Sun Jun 14 00:10:18 2020 (r362158) @@ -54,7 +54,7 @@ * needs to be returned by nfsd_fhtovp(). */ struct nfsexstuff { - int nes_exflag; /* export flags */ + uint64_t nes_exflag; /* export flags */ int nes_numsecflavor; /* # of security flavors */ int nes_secflavors[MAXSECFLAVORS]; /* and the flavors */ }; Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/fs/nfs/nfsport.h Sun Jun 14 00:10:18 2020 (r362158) @@ -1081,6 +1081,11 @@ struct nfsex_args { struct export_args export; }; +struct nfsex_oldargs { + char *fspec; + struct o2export_args export; +}; + /* * These export flags should be defined, but there are no bits left. * Maybe a separate mnt_exflag field could be added or the mnt_flag Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 14 00:10:18 2020 (r362158) @@ -3056,10 +3056,10 @@ int nfsvno_checkexp(struct mount *mp, struct sockaddr *nam, struct nfsexstuff *exp, struct ucred **credp) { - int i, error, *secflavors; + int error; error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp, - &exp->nes_numsecflavor, &secflavors); + &exp->nes_numsecflavor, exp->nes_secflavors); if (error) { if (nfs_rootfhset) { exp->nes_exflag = 0; @@ -3071,10 +3071,6 @@ nfsvno_checkexp(struct mount *mp, struct sockaddr *nam printf("nfsvno_checkexp: numsecflavors out of range\n"); exp->nes_numsecflavor = 0; error = EACCES; - } else { - /* Copy the security flavors. */ - for (i = 0; i < exp->nes_numsecflavor; i++) - exp->nes_secflavors[i] = secflavors[i]; } NFSEXITCODE(error); return (error); @@ -3088,7 +3084,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct int lktype, struct vnode **vpp, struct nfsexstuff *exp, struct ucred **credp) { - int i, error, *secflavors; + int error; *credp = NULL; exp->nes_numsecflavor = 0; @@ -3098,7 +3094,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct error = ESTALE; if (nam && !error) { error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp, - &exp->nes_numsecflavor, &secflavors); + &exp->nes_numsecflavor, exp->nes_secflavors); if (error) { if (nfs_rootfhset) { exp->nes_exflag = 0; @@ -3113,10 +3109,6 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct exp->nes_numsecflavor = 0; error = EACCES; vput(*vpp); - } else { - /* Copy the security flavors. */ - for (i = 0; i < exp->nes_numsecflavor; i++) - exp->nes_secflavors[i] = secflavors[i]; } } NFSEXITCODE(error); @@ -3415,10 +3407,11 @@ int nfsvno_v4rootexport(struct nfsrv_descript *nd) { struct ucred *credanon; - int exflags, error = 0, numsecflavor, *secflavors, i; + int error = 0, numsecflavor, secflavors[MAXSECFLAVORS], i; + uint64_t exflags; error = vfs_stdcheckexp(&nfsv4root_mnt, nd->nd_nam, &exflags, - &credanon, &numsecflavor, &secflavors); + &credanon, &numsecflavor, secflavors); if (error) { error = NFSERR_PROGUNAVAIL; goto out; @@ -3656,8 +3649,9 @@ static int nfssvc_srvcall(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) { struct nfsex_args export; + struct nfsex_oldargs oexp; struct file *fp = NULL; - int stablefd, len; + int stablefd, i, len; struct nfsd_clid adminrevoke; struct nfsd_dumplist dumplist; struct nfsd_dumpclients *dumpclients; @@ -3667,6 +3661,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u vnode_t vp; int error = EINVAL, igotlock; struct proc *procp; + gid_t *grps; static int suspend_nfsd = 0; if (uap->flag & NFSSVC_PUBLICFH) { @@ -3676,11 +3671,71 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u &nfs_pubfh.nfsrvfh_data, sizeof (fhandle_t)); if (!error) nfs_pubfhset = 1; - } else if (uap->flag & NFSSVC_V4ROOTEXPORT) { + } else if ((uap->flag & (NFSSVC_V4ROOTEXPORT | NFSSVC_NEWSTRUCT)) == + (NFSSVC_V4ROOTEXPORT | NFSSVC_NEWSTRUCT)) { error = copyin(uap->argp,(caddr_t)&export, sizeof (struct nfsex_args)); - if (!error) - error = nfsrv_v4rootexport(&export, cred, p); + if (!error) { + grps = NULL; + if (export.export.ex_ngroups > NGROUPS_MAX || + export.export.ex_ngroups < 0) + error = EINVAL; + else if (export.export.ex_ngroups > 0) { + grps = malloc(export.export.ex_ngroups * + sizeof(gid_t), M_TEMP, M_WAITOK); + error = copyin(export.export.ex_groups, grps, + export.export.ex_ngroups * sizeof(gid_t)); + export.export.ex_groups = grps; + } else + export.export.ex_groups = NULL; + if (!error) + error = nfsrv_v4rootexport(&export, cred, p); + free(grps, M_TEMP); + } + } else if ((uap->flag & (NFSSVC_V4ROOTEXPORT | NFSSVC_NEWSTRUCT)) == + NFSSVC_V4ROOTEXPORT) { + error = copyin(uap->argp,(caddr_t)&oexp, + sizeof (struct nfsex_oldargs)); + if (!error) { + memset(&export.export, 0, sizeof(export.export)); + export.export.ex_flags = (uint64_t)oexp.export.ex_flags; + export.export.ex_root = oexp.export.ex_root; + export.export.ex_uid = oexp.export.ex_anon.cr_uid; + export.export.ex_ngroups = + oexp.export.ex_anon.cr_ngroups; + export.export.ex_groups = NULL; + if (export.export.ex_ngroups > XU_NGROUPS || + export.export.ex_ngroups < 0) + error = EINVAL; + else if (export.export.ex_ngroups > 0) { + export.export.ex_groups = malloc( + export.export.ex_ngroups * sizeof(gid_t), + M_TEMP, M_WAITOK); + for (i = 0; i < export.export.ex_ngroups; i++) + export.export.ex_groups[i] = + oexp.export.ex_anon.cr_groups[i]; + } + export.export.ex_addr = oexp.export.ex_addr; + export.export.ex_addrlen = oexp.export.ex_addrlen; + export.export.ex_mask = oexp.export.ex_mask; + export.export.ex_masklen = oexp.export.ex_masklen; + export.export.ex_indexfile = oexp.export.ex_indexfile; + export.export.ex_numsecflavors = + oexp.export.ex_numsecflavors; + if (export.export.ex_numsecflavors >= MAXSECFLAVORS || + export.export.ex_numsecflavors < 0) + error = EINVAL; + else { + for (i = 0; i < export.export.ex_numsecflavors; + i++) + export.export.ex_secflavors[i] = + oexp.export.ex_secflavors[i]; + } + export.fspec = oexp.fspec; + if (error == 0) + error = nfsrv_v4rootexport(&export, cred, p); + free(export.export.ex_groups, M_TEMP); + } } else if (uap->flag & NFSSVC_NOPUBLICFH) { nfs_pubfhset = 0; error = 0; Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/fs/unionfs/union_vfsops.c Sun Jun 14 00:10:18 2020 (r362158) @@ -461,8 +461,8 @@ unionfs_fhtovp(struct mount *mp, struct fid *fidp, int } static int -unionfs_checkexp(struct mount *mp, struct sockaddr *nam, int *extflagsp, - struct ucred **credanonp, int *numsecflavors, int **secflavors) +unionfs_checkexp(struct mount *mp, struct sockaddr *nam, uint64_t *extflagsp, + struct ucred **credanonp, int *numsecflavors, int *secflavors) { return (EOPNOTSUPP); } Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/kern/vfs_export.c Sun Jun 14 00:10:18 2020 (r362158) @@ -79,7 +79,7 @@ static struct netcred *vfs_export_lookup(struct mount */ struct netcred { struct radix_node netc_rnodes[2]; - int netc_exflags; + uint64_t netc_exflags; struct ucred *netc_anon; int netc_numsecflavors; int netc_secflavors[MAXSECFLAVORS]; @@ -118,18 +118,12 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); /* - * XXX: This routine converts from a `struct xucred' - * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This + * XXX: This routine converts from a uid plus gid list + * to a `struct ucred' (np->netc_anon). This * operation is questionable; for example, what should be done * with fields like cr_uidinfo and cr_prison? Currently, this * routine does not touch them (leaves them as NULL). */ - if (argp->ex_anon.cr_version != XUCRED_VERSION) { - vfs_mount_error(mp, "ex_anon.cr_version: %d != %d", - argp->ex_anon.cr_version, XUCRED_VERSION); - return (EINVAL); - } - if (argp->ex_addrlen == 0) { if (mp->mnt_flag & MNT_DEFEXPORTED) { vfs_mount_error(mp, @@ -139,9 +133,9 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * np = &nep->ne_defexported; np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); - np->netc_anon->cr_uid = argp->ex_anon.cr_uid; - crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, - argp->ex_anon.cr_groups); + np->netc_anon->cr_uid = argp->ex_uid; + crsetgroups(np->netc_anon, argp->ex_ngroups, + argp->ex_groups); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; @@ -218,9 +212,9 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * } np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); - np->netc_anon->cr_uid = argp->ex_anon.cr_uid; - crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, - argp->ex_anon.cr_groups); + np->netc_anon->cr_uid = argp->ex_uid; + crsetgroups(np->netc_anon, argp->ex_ngroups, + argp->ex_groups); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; @@ -512,8 +506,8 @@ vfs_export_lookup(struct mount *mp, struct sockaddr *n */ int -vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, int *extflagsp, - struct ucred **credanonp, int *numsecflavors, int **secflavors) +vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, uint64_t *extflagsp, + struct ucred **credanonp, int *numsecflavors, int *secflavors) { struct netcred *np; @@ -534,8 +528,9 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam KASSERT(*numsecflavors < MAXSECFLAVORS, ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); } - if (secflavors) - *secflavors = np->netc_secflavors; + if (secflavors && np->netc_numsecflavors > 0) + memcpy(secflavors, np->netc_secflavors, np->netc_numsecflavors * + sizeof(int)); lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); return (0); } Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/kern/vfs_init.c Sun Jun 14 00:10:18 2020 (r362158) @@ -268,8 +268,8 @@ vfs_fhtovp_sigdefer(struct mount *mp, struct fid *fidp } static int -vfs_checkexp_sigdefer(struct mount *mp, struct sockaddr *nam, int *exflg, - struct ucred **credp, int *numsecflavors, int **secflavors) +vfs_checkexp_sigdefer(struct mount *mp, struct sockaddr *nam, uint64_t *exflg, + struct ucred **credp, int *numsecflavors, int *secflavors) { int prev_stops, rc; Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/kern/vfs_mount.c Sun Jun 14 00:10:18 2020 (r362158) @@ -1041,11 +1041,13 @@ vfs_domount_update( ) { struct export_args export; + struct o2export_args o2export; struct vnode *rootvp; void *bufp; struct mount *mp; - int error, export_error, len; + int error, export_error, i, len; uint64_t flag; + gid_t *grps; ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) != 0, ("MNT_UPDATE should be here")); @@ -1128,11 +1130,66 @@ vfs_domount_update( /* Assume that there is only 1 ABI for each length. */ switch (len) { case (sizeof(struct oexport_args)): - bzero(&export, sizeof(export)); + bzero(&o2export, sizeof(o2export)); + o2export.ex_numsecflavors = 1; + o2export.ex_secflavors[0] = AUTH_SYS; /* FALLTHROUGH */ + case (sizeof(o2export)): + bcopy(bufp, &o2export, len); + export.ex_flags = (uint64_t)o2export.ex_flags; + export.ex_root = o2export.ex_root; + export.ex_uid = o2export.ex_anon.cr_uid; + export.ex_groups = NULL; + export.ex_ngroups = o2export.ex_anon.cr_ngroups; + if (export.ex_ngroups > 0) { + if (export.ex_ngroups <= XU_NGROUPS) { + export.ex_groups = malloc( + export.ex_ngroups * sizeof(gid_t), + M_TEMP, M_WAITOK); + for (i = 0; i < export.ex_ngroups; i++) + export.ex_groups[i] = + o2export.ex_anon.cr_groups[i]; + } else + export_error = EINVAL; + } else if (export.ex_ngroups < 0) + export_error = EINVAL; + export.ex_addr = o2export.ex_addr; + export.ex_addrlen = o2export.ex_addrlen; + export.ex_mask = o2export.ex_mask; + export.ex_masklen = o2export.ex_masklen; + export.ex_indexfile = o2export.ex_indexfile; + export.ex_numsecflavors = o2export.ex_numsecflavors; + if (export.ex_numsecflavors < MAXSECFLAVORS) { + for (i = 0; i < export.ex_numsecflavors; i++) + export.ex_secflavors[i] = + o2export.ex_secflavors[i]; + } else + export_error = EINVAL; + if (export_error == 0) + export_error = vfs_export(mp, &export); + free(export.ex_groups, M_TEMP); + break; case (sizeof(export)): bcopy(bufp, &export, len); - export_error = vfs_export(mp, &export); + grps = NULL; + if (export.ex_ngroups > 0) { + if (export.ex_ngroups <= NGROUPS_MAX) { + grps = malloc(export.ex_ngroups * + sizeof(gid_t), M_TEMP, M_WAITOK); + export_error = copyin(export.ex_groups, + grps, export.ex_ngroups * + sizeof(gid_t)); + if (export_error == 0) + export.ex_groups = grps; + } else + export_error = EINVAL; + } else if (export.ex_ngroups == 0) + export.ex_groups = NULL; + else + export_error = EINVAL; + if (export_error == 0) + export_error = vfs_export(mp, &export); + free(grps, M_TEMP); break; default: export_error = EINVAL; @@ -2344,24 +2401,4 @@ kernel_vmount(int flags, ...) error = kernel_mount(ma, flags); return (error); -} - -/* - * Convert the old export args format into new export args. - * - * The old export args struct does not have security flavors. Otherwise, the - * structs are identical. The default security flavor 'sys' is applied when - * the given args export the filesystem. - */ -void -vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp) -{ - - bcopy(oexp, exp, sizeof(*oexp)); - if (exp->ex_flags & MNT_EXPORTED) { - exp->ex_numsecflavors = 1; - exp->ex_secflavors[0] = AUTH_SYS; - } else { - exp->ex_numsecflavors = 0; - } } Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/nlm/nlm_prot_impl.c Sun Jun 14 00:10:18 2020 (r362158) @@ -1735,7 +1735,8 @@ static int nlm_get_vfs_state(struct nlm_host *host, struct svc_req *rqstp, fhandle_t *fhp, struct vfs_state *vs, accmode_t accmode) { - int error, exflags; + int error; + uint64_t exflags; struct ucred *cred = NULL, *credanon = NULL; memset(vs, 0, sizeof(*vs)); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/sys/mount.h Sun Jun 14 00:10:18 2020 (r362158) @@ -499,10 +499,10 @@ struct oexport_args { }; /* - * Export arguments for local filesystem mount calls. + * Not quite so old export arguments with 32bit ex_flags and xucred ex_anon. */ #define MAXSECFLAVORS 5 -struct export_args { +struct o2export_args { int ex_flags; /* export related flags */ uid_t ex_root; /* mapping for root uid */ struct xucred ex_anon; /* mapping for anonymous user */ @@ -516,6 +516,25 @@ struct export_args { }; /* + * Export arguments for local filesystem mount calls. + */ +#define MAXSECFLAVORS 5 +struct export_args { + uint64_t ex_flags; /* export related flags */ + uid_t ex_root; /* mapping for root uid */ + uid_t ex_uid; /* mapping for anonymous user */ + int ex_ngroups; + gid_t *ex_groups; + struct sockaddr *ex_addr; /* net address to which exported */ + u_char ex_addrlen; /* and the net address length */ + struct sockaddr *ex_mask; /* mask of valid bits in saddr */ + u_char ex_masklen; /* and the smask length */ + char *ex_indexfile; /* index file for WebNFS URLs */ + int ex_numsecflavors; /* security flavor count */ + int ex_secflavors[MAXSECFLAVORS]; /* list of security flavors */ +}; + +/* * Structure holding information for a publicly exported filesystem * (WebNFS). Currently the specs allow just for one such filesystem. */ @@ -694,8 +713,8 @@ typedef int vfs_vget_t(struct mount *mp, ino_t ino, in typedef int vfs_fhtovp_t(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp); typedef int vfs_checkexp_t(struct mount *mp, struct sockaddr *nam, - int *extflagsp, struct ucred **credanonp, - int *numsecflavors, int **secflavors); + uint64_t *extflagsp, struct ucred **credanonp, + int *numsecflavors, int *secflavors); typedef int vfs_init_t(struct vfsconf *); typedef int vfs_uninit_t(struct vfsconf *); typedef int vfs_extattrctl_t(struct mount *mp, int cmd, @@ -928,8 +947,6 @@ void vfs_mount_error(struct mount *, const char *, ... void vfs_mountroot(void); /* mount our root filesystem */ void vfs_mountedfrom(struct mount *, const char *from); void vfs_notify_upper(struct vnode *, int); -void vfs_oexport_conv(const struct oexport_args *oexp, - struct export_args *exp); void vfs_ref(struct mount *); void vfs_rel(struct mount *); struct mount *vfs_mount_alloc(struct vnode *, struct vfsconf *, const char *, Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Jun 13 23:35:22 2020 (r362157) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Jun 14 00:10:18 2020 (r362158) @@ -596,7 +596,6 @@ static int ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct ufs_args args; - struct export_args exp; int error; if (data == NULL) @@ -604,10 +603,9 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t fla error = copyin(data, &args, sizeof args); if (error) return (error); - vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &exp, sizeof(exp)); + ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); error = kernel_mount(ma, flags); return (error); From owner-svn-src-all@freebsd.org Sun Jun 14 00:12:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BCD2346ACC; Sun, 14 Jun 2020 00:12:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kvzf2GYDz4dcf; Sun, 14 Jun 2020 00:12:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 492BD23977; Sun, 14 Jun 2020 00:12:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E0CUNF071207; Sun, 14 Jun 2020 00:12:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E0CUeC071206; Sun, 14 Jun 2020 00:12:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006140012.05E0CUeC071206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 14 Jun 2020 00:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362159 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 362159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 00:12:30 -0000 Author: rmacklem Date: Sun Jun 14 00:12:29 2020 New Revision: 362159 URL: https://svnweb.freebsd.org/changeset/base/362159 Log: Version bump for r362158, since the arguments for vfs_checkexp() changed. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jun 14 00:10:18 2020 (r362158) +++ head/sys/sys/param.h Sun Jun 14 00:12:29 2020 (r362159) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300097 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300098 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sun Jun 14 00:15:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66FAB346B30; Sun, 14 Jun 2020 00:15:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kw3P1JWMz4dx3; Sun, 14 Jun 2020 00:15:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 282BB2373B; Sun, 14 Jun 2020 00:15:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E0Fj4s071396; Sun, 14 Jun 2020 00:15:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E0FjX0071395; Sun, 14 Jun 2020 00:15:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006140015.05E0FjX0071395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 14 Jun 2020 00:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362160 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 362160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 00:15:45 -0000 Author: rmacklem Date: Sun Jun 14 00:15:44 2020 New Revision: 362160 URL: https://svnweb.freebsd.org/changeset/base/362160 Log: Add an entry to UPDATING for r362158. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jun 14 00:12:29 2020 (r362159) +++ head/UPDATING Sun Jun 14 00:15:44 2020 (r362160) @@ -26,6 +26,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200613: + r362158 changed the arguments for VFS_CHECKEXP(). As such, any + out of tree file systems need to be modified and rebuilt. + Also, any file systems that are modules must be rebuilt. + 20200604: read(2) of a directory fd is now rejected by default. root may re-enable it for system root only on non-ZFS filesystems with the From owner-svn-src-all@freebsd.org Sun Jun 14 00:21:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB51E346E8B; Sun, 14 Jun 2020 00:21:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kwBN5ZJ4z4f9J; Sun, 14 Jun 2020 00:21:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAB1423C0D; Sun, 14 Jun 2020 00:21:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E0LmlT075450; Sun, 14 Jun 2020 00:21:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E0LmXv075449; Sun, 14 Jun 2020 00:21:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006140021.05E0LmXv075449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 14 Jun 2020 00:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362161 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 362161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 00:21:48 -0000 Author: adrian Date: Sun Jun 14 00:21:48 2020 New Revision: 362161 URL: https://svnweb.freebsd.org/changeset/base/362161 Log: [net80211] Also convert the ddb path Whoops - this belonged in my previous commit. Modified: head/sys/net80211/ieee80211_ddb.c Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Sun Jun 14 00:15:44 2020 (r362160) +++ head/sys/net80211/ieee80211_ddb.c Sun Jun 14 00:21:48 2020 (r362161) @@ -209,6 +209,7 @@ _db_show_txampdu(const char *sep, int ix, const struct static void _db_show_rxampdu(const char *sep, int ix, const struct ieee80211_rx_ampdu *rap) { + struct mbuf *m; int i; db_printf("%srxampdu[%d]: %p flags 0x%x tid %u\n", @@ -219,10 +220,15 @@ _db_show_rxampdu(const char *sep, int ix, const struct db_printf("%s age %d nframes %d\n", sep, rap->rxa_age, rap->rxa_nframes); for (i = 0; i < IEEE80211_AGGR_BAWMAX; i++) - if (rap->rxa_m[i] != NULL) - db_printf("%s m[%2u:%4u] %p\n", sep, i, - IEEE80211_SEQ_ADD(rap->rxa_start, i), - rap->rxa_m[i]); + if (mbufq_len(&rap->rxa_mq[i]) > 0) { + db_printf("%s m[%2u:%4u] ", sep, i, + IEEE80211_SEQ_ADD(rap->rxa_start, i)); + STAILQ_FOREACH(m, &rap->rxa_mq[i].mq_head, + m_stailqpkt) { + db_printf(" %p", m); + } + db_printf("\n"); + } } static void From owner-svn-src-all@freebsd.org Sun Jun 14 00:23:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 361EC346FD8; Sun, 14 Jun 2020 00:23:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kwCv0gfBz4fd5; Sun, 14 Jun 2020 00:23:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1280423B18; Sun, 14 Jun 2020 00:23:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E0N6Xu077168; Sun, 14 Jun 2020 00:23:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E0N6Wd077167; Sun, 14 Jun 2020 00:23:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006140023.05E0N6Wd077167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 14 Jun 2020 00:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362162 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 362162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 00:23:07 -0000 Author: adrian Date: Sun Jun 14 00:23:06 2020 New Revision: 362162 URL: https://svnweb.freebsd.org/changeset/base/362162 Log: [net80211] Treat frames without an rx status as not a decap'ed A-MSDU. Drivers for NICs which do A-MSDU decap in hardware / driver will need to set the rx status, so if it's missing then treat it as not a decap'ed A-MSDU. Modified: head/sys/net80211/ieee80211_input.h Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Sun Jun 14 00:21:48 2020 (r362161) +++ head/sys/net80211/ieee80211_input.h Sun Jun 14 00:23:06 2020 (r362162) @@ -136,7 +136,8 @@ ishtinfooui(const uint8_t *frm) static __inline int ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs) { - + if (rxs == NULL) + return 0; return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU)); } From owner-svn-src-all@freebsd.org Sun Jun 14 00:40:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2402347380; Sun, 14 Jun 2020 00:40:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kwbN6KZPz4g2Q; Sun, 14 Jun 2020 00:40:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B609423E0C; Sun, 14 Jun 2020 00:40:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E0e0T5083384; Sun, 14 Jun 2020 00:40:00 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E0e03Y083383; Sun, 14 Jun 2020 00:40:00 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006140040.05E0e03Y083383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 14 Jun 2020 00:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362163 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 362163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 00:40:01 -0000 Author: rmacklem Date: Sun Jun 14 00:40:00 2020 New Revision: 362163 URL: https://svnweb.freebsd.org/changeset/base/362163 Log: Modify mountd to use the new struct export_args committed by r362158. r362158 modified struct export_args for make the ex_flags field 64bits and also changed the anonymous credentials to allow more than 16 groups. This patch fixes mountd.c to use the new structure. It does allocate larger exportlist and grouplist structures now. That will be fixed in a future commit. The only visible change will be that the credentials provided for the -maproot and -mapall exports options can now have more than 16 groups. Reviewed by: kib, freqlabs Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25088 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sun Jun 14 00:23:06 2020 (r362162) +++ head/usr.sbin/mountd/mountd.c Sun Jun 14 00:40:00 2020 (r362163) @@ -112,6 +112,15 @@ struct dirlist { #define DP_DEFSET 0x1 #define DP_HOSTSET 0x2 +/* + * maproot/mapall credentials. + */ +struct expcred { + uid_t cr_uid; + int cr_ngroups; + gid_t cr_groups[NGROUPS_MAX + 1]; +}; + struct exportlist { struct dirlist *ex_dirl; struct dirlist *ex_defdir; @@ -120,8 +129,8 @@ struct exportlist { fsid_t ex_fs; char *ex_fsdir; char *ex_indexfile; - struct xucred ex_defanon; - int ex_defexflags; + struct expcred ex_defanon; + uint64_t ex_defexflags; int ex_numsecflavors; int ex_secflavors[MAXSECFLAVORS]; int ex_defnumsecflavors; @@ -152,8 +161,8 @@ struct grouplist { int gr_type; union grouptypes gr_ptr; struct grouplist *gr_next; - struct xucred gr_anon; - int gr_exflags; + struct expcred gr_anon; + uint64_t gr_exflags; int gr_flag; int gr_numsecflavors; int gr_secflavors[MAXSECFLAVORS]; @@ -194,7 +203,7 @@ struct fhreturn { static char *add_expdir(struct dirlist **, char *, int); static void add_dlist(struct dirlist **, struct dirlist *, struct grouplist *, int, struct exportlist *, - struct xucred *, int); + struct expcred *, uint64_t); static void add_mlist(char *, char *); static int check_dirpath(char *); static int check_options(struct dirlist *); @@ -208,10 +217,10 @@ static void clearout_service(void); static void del_mlist(char *hostp, char *dirp); static struct dirlist *dirp_search(struct dirlist *, char *); static int do_export_mount(struct exportlist *, struct statfs *); -static int do_mount(struct exportlist *, struct grouplist *, int, - struct xucred *, char *, int, struct statfs *, int, int *); +static int do_mount(struct exportlist *, struct grouplist *, uint64_t, + struct expcred *, char *, int, struct statfs *, int, int *); static int do_opt(char **, char **, struct exportlist *, - struct grouplist *, int *, int *, struct xucred *); + struct grouplist *, int *, uint64_t *, struct expcred *); static struct exportlist *ex_search(fsid_t *, struct exportlisthead *); static struct exportlist *get_exp(void); static void free_dir(struct dirlist *); @@ -226,7 +235,7 @@ static void free_exports(struct exportlisthead *); static void read_exportfile(int); static int compare_nmount_exportlist(struct iovec *, int, char *); static int compare_export(struct exportlist *, struct exportlist *); -static int compare_cred(struct xucred *, struct xucred *); +static int compare_cred(struct expcred *, struct expcred *); static int compare_secflavor(int *, int *, int); static void delete_export(struct iovec *, int, struct statfs *, char *); static int get_host(char *, struct grouplist *, struct grouplist *); @@ -237,13 +246,13 @@ static int get_net(char *, struct netmsk *, int); static void getexp_err(struct exportlist *, struct grouplist *, const char *); static struct grouplist *get_grp(void); static void hang_dirp(struct dirlist *, struct grouplist *, - struct exportlist *, int, struct xucred *, int); + struct exportlist *, int, struct expcred *, uint64_t); static void huphandler(int sig); static int makemask(struct sockaddr_storage *ssp, int bitlen); static void mntsrv(struct svc_req *, SVCXPRT *); static void nextfield(char **, char **); static void out_of_mem(void); -static void parsecred(char *, struct xucred *); +static void parsecred(char *, struct expcred *); static int parsesec(char *, struct exportlist *); static int put_exlist(struct dirlist *, XDR *, struct dirlist *, int *, int); @@ -259,6 +268,7 @@ static int xdr_explist_common(XDR *, caddr_t, int); static int xdr_fhs(XDR *, caddr_t); static int xdr_mlist(XDR *, caddr_t); static void terminate(int); +static void cp_cred(struct expcred *, struct expcred *); #define EXPHASH(f) (fnv_32_buf((f), sizeof(fsid_t), 0) % exphashsize) static struct exportlisthead *exphead = NULL; @@ -268,13 +278,6 @@ static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INI static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; static char **hosts = NULL; -static struct xucred def_anon = { - XUCRED_VERSION, - (uid_t)65534, - 1, - { (gid_t)65533 }, - { NULL } -}; static int force_v2 = 0; static int resvport_only = 1; static int nhosts = 0; @@ -1503,9 +1506,10 @@ get_exportlist_one(int passno) struct grouplist *grp, *tgrp, *savgrp; struct dirlist *dirhead; struct statfs fsb; - struct xucred anon; + struct expcred anon; char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc; - int len, has_host, exflags, got_nondir, dirplen, netgrp; + int len, has_host, got_nondir, dirplen, netgrp; + uint64_t exflags; v4root_phase = 0; dirhead = (struct dirlist *)NULL; @@ -1521,7 +1525,9 @@ get_exportlist_one(int passno) * Set defaults. */ has_host = FALSE; - anon = def_anon; + anon.cr_uid = 65534; + anon.cr_ngroups = 1; + anon.cr_groups[0] = 65533; exflags = MNT_EXPORTED; got_nondir = 0; opt_flags = 0; @@ -1738,7 +1744,7 @@ get_exportlist_one(int passno) grp = tgrp; do { grp->gr_exflags = exflags; - grp->gr_anon = anon; + cp_cred(&grp->gr_anon, &anon); if (v4root_phase == 2 && passno == 0) LOGDEBUG("do_mount v4root"); if (passno == 0 && do_mount(ep, grp, exflags, &anon, @@ -1878,7 +1884,7 @@ get_exportlist(int passno) */ bzero(&eargs, sizeof (eargs)); eargs.export.ex_flags = MNT_DELEXPORT; - if (nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&eargs) < 0 && + if (nfssvc(NFSSVC_V4ROOTEXPORT | NFSSVC_NEWSTRUCT, (caddr_t)&eargs) < 0 && errno != ENOENT) syslog(LOG_ERR, "Can't delete exports for V4:"); @@ -2257,10 +2263,10 @@ compare_export(struct exportlist *ep, struct exportlis } while (0) /* - * Compare to struct xucred's. Return 0 if the same and 1 otherwise. + * Compare two struct expcred's. Return 0 if the same and 1 otherwise. */ static int -compare_cred(struct xucred *cr0, struct xucred *cr1) +compare_cred(struct expcred *cr0, struct expcred *cr1) { if (cr0->cr_uid != cr1->cr_uid || cr0->cr_ngroups != cr1->cr_ngroups) @@ -2425,7 +2431,7 @@ add_expdir(struct dirlist **dpp, char *cp, int len) */ static void hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, - int flags, struct xucred *anoncrp, int exflags) + int flags, struct expcred *anoncrp, uint64_t exflags) { struct hostlist *hp; struct dirlist *dp2; @@ -2443,7 +2449,7 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s if (ep->ex_numsecflavors > 0) memcpy(ep->ex_defsecflavors, ep->ex_secflavors, sizeof(ep->ex_secflavors)); - ep->ex_defanon = *anoncrp; + cp_cred(&ep->ex_defanon, anoncrp); ep->ex_defexflags = exflags; } else while (grp) { hp = get_ht(); @@ -2477,7 +2483,8 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s */ static void add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, - int flags, struct exportlist *ep, struct xucred *anoncrp, int exflags) + int flags, struct exportlist *ep, struct expcred *anoncrp, + uint64_t exflags) { struct dirlist *dp; struct hostlist *hp; @@ -2526,7 +2533,7 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, if (ep->ex_numsecflavors > 0) memcpy(ep->ex_defsecflavors, ep->ex_secflavors, sizeof(ep->ex_secflavors)); - ep->ex_defanon = *anoncrp; + cp_cred(&ep->ex_defanon, anoncrp); ep->ex_defexflags = exflags; } } @@ -2698,7 +2705,7 @@ parsesec(char *seclist, struct exportlist *ep) */ static int do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, - int *has_hostp, int *exflagsp, struct xucred *cr) + int *has_hostp, uint64_t *exflagsp, struct expcred *cr) { char *cpoptarg, *cpoptend; char *cp, *endcp, *cpopt, savedc, savedc2; @@ -2960,7 +2967,7 @@ do_export_mount(struct exportlist *ep, struct statfs * defgrp.gr_type = GT_DEFAULT; defgrp.gr_next = NULL; /* We have an entry for all other hosts/nets. */ - LOGDEBUG("ex_defexflags=0x%x", ep->ex_defexflags); + LOGDEBUG("ex_defexflags=0x%jx", (uintmax_t)ep->ex_defexflags); ret = do_mount(ep, &defgrp, ep->ex_defexflags, &ep->ex_defanon, ep->ex_fsdir, dirlen, fsp, ep->ex_defnumsecflavors, ep->ex_defsecflavors); @@ -2971,8 +2978,8 @@ do_export_mount(struct exportlist *ep, struct statfs * /* Do a mount for each group. */ grp = ep->ex_grphead; while (grp != NULL) { - LOGDEBUG("do mount gr_type=0x%x gr_exflags=0x%x", - grp->gr_type, grp->gr_exflags); + LOGDEBUG("do mount gr_type=0x%x gr_exflags=0x%jx", + grp->gr_type, (uintmax_t)grp->gr_exflags); ret = do_mount(ep, grp, grp->gr_exflags, &grp->gr_anon, ep->ex_fsdir, dirlen, fsp, grp->gr_numsecflavors, grp->gr_secflavors); @@ -2988,8 +2995,8 @@ do_export_mount(struct exportlist *ep, struct statfs * * the kernel. */ static int -do_mount(struct exportlist *ep, struct grouplist *grp, int exflags, - struct xucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb, +do_mount(struct exportlist *ep, struct grouplist *grp, uint64_t exflags, + struct expcred *anoncrp, char *dirp, int dirplen, struct statfs *fsb, int numsecflavors, int *secflavors) { struct statfs fsb1; @@ -3015,8 +3022,14 @@ do_mount(struct exportlist *ep, struct grouplist *grp, bzero(eap, sizeof (struct export_args)); bzero(errmsg, sizeof(errmsg)); eap->ex_flags = exflags; - eap->ex_anon = *anoncrp; - LOGDEBUG("do_mount exflags=0x%x", exflags); + eap->ex_uid = anoncrp->cr_uid; + eap->ex_ngroups = anoncrp->cr_ngroups; + if (eap->ex_ngroups > 0) { + eap->ex_groups = malloc(eap->ex_ngroups * sizeof(gid_t)); + memcpy(eap->ex_groups, anoncrp->cr_groups, eap->ex_ngroups * + sizeof(gid_t)); + } + LOGDEBUG("do_mount exflags=0x%jx", (uintmax_t)exflags); eap->ex_indexfile = ep->ex_indexfile; if (grp->gr_type == GT_HOST) ai = grp->gr_ptr.gt_addrinfo; @@ -3086,9 +3099,11 @@ do_mount(struct exportlist *ep, struct grouplist *grp, */ if (v4root_phase == 2) { nfsea.fspec = v4root_dirpath; - if (nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&nfsea) < 0) { + if (nfssvc(NFSSVC_V4ROOTEXPORT | NFSSVC_NEWSTRUCT, + (caddr_t)&nfsea) < 0) { syslog(LOG_ERR, "Exporting V4: failed"); - return (2); + ret = 2; + goto error_exit; } } else { /* @@ -3203,6 +3218,7 @@ skip: if (cp) *cp = savedc; error_exit: + free(eap->ex_groups); /* free strings allocated by strdup() in getmntopts.c */ if (iov != NULL) { free(iov[0].iov_base); /* fstype */ @@ -3429,17 +3445,14 @@ get_line(void) * Parse a description of a credential. */ static void -parsecred(char *namelist, struct xucred *cr) +parsecred(char *namelist, struct expcred *cr) { char *name; int cnt; char *names; struct passwd *pw; struct group *gr; - gid_t groups[XU_NGROUPS + 1]; - int ngroups; - cr->cr_version = XUCRED_VERSION; /* * Set up the unprivileged user. */ @@ -3465,27 +3478,24 @@ parsecred(char *namelist, struct xucred *cr) return; } cr->cr_uid = pw->pw_uid; - ngroups = XU_NGROUPS + 1; - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { + cr->cr_ngroups = NGROUPS_MAX + 1; + if (getgrouplist(pw->pw_name, pw->pw_gid, cr->cr_groups, + &cr->cr_ngroups)) { syslog(LOG_ERR, "too many groups"); - ngroups = XU_NGROUPS + 1; + cr->cr_ngroups = NGROUPS_MAX + 1; } /* * Compress out duplicate. */ - cr->cr_groups[0] = groups[0]; - if (ngroups > 1 && groups[0] == groups[1]) { - cr->cr_ngroups = ngroups - 1; - for (cnt = 2; cnt < ngroups; cnt++) - cr->cr_groups[cnt - 1] = groups[cnt]; - } else { - cr->cr_ngroups = ngroups; - if (cr->cr_ngroups > XU_NGROUPS) - cr->cr_ngroups = XU_NGROUPS; - for (cnt = 1; cnt < ngroups; cnt++) - cr->cr_groups[cnt] = groups[cnt]; + if (cr->cr_ngroups > 1 && cr->cr_groups[0] == + cr->cr_groups[1]) { + for (cnt = 2; cnt < cr->cr_ngroups; cnt++) + cr->cr_groups[cnt - 1] = cr->cr_groups[cnt]; + cr->cr_ngroups--; } + if (cr->cr_ngroups > NGROUPS_MAX) + cr->cr_ngroups = NGROUPS_MAX; return; } /* @@ -3501,7 +3511,7 @@ parsecred(char *namelist, struct xucred *cr) return; } cr->cr_ngroups = 0; - while (names != NULL && *names != '\0' && cr->cr_ngroups < XU_NGROUPS) { + while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS_MAX) { name = strsep_quote(&names, ":"); if (isdigit(*name) || *name == '-') { cr->cr_groups[cr->cr_ngroups++] = atoi(name); @@ -3513,7 +3523,7 @@ parsecred(char *namelist, struct xucred *cr) cr->cr_groups[cr->cr_ngroups++] = gr->gr_gid; } } - if (names != NULL && *names != '\0' && cr->cr_ngroups == XU_NGROUPS) + if (names != NULL && *names != '\0' && cr->cr_ngroups == NGROUPS_MAX) syslog(LOG_ERR, "too many groups"); } @@ -3833,4 +3843,14 @@ terminate(int sig __unused) rpcb_unset(MOUNTPROG, MOUNTVERS, NULL); rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL); exit (0); +} + +static void +cp_cred(struct expcred *outcr, struct expcred *incr) +{ + + outcr->cr_uid = incr->cr_uid; + outcr->cr_ngroups = incr->cr_ngroups; + memcpy(outcr->cr_groups, incr->cr_groups, incr->cr_ngroups * + sizeof(gid_t)); } From owner-svn-src-all@freebsd.org Sun Jun 14 01:22:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14018347E37; Sun, 14 Jun 2020 01:22:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kxXC6nrFz3Slw; Sun, 14 Jun 2020 01:22:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E47A12460B; Sun, 14 Jun 2020 01:22:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E1MJAE014346; Sun, 14 Jun 2020 01:22:19 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E1MJYV014345; Sun, 14 Jun 2020 01:22:19 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006140122.05E1MJYV014345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 14 Jun 2020 01:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362164 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 362164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 01:22:20 -0000 Author: rmacklem Date: Sun Jun 14 01:22:19 2020 New Revision: 362164 URL: https://svnweb.freebsd.org/changeset/base/362164 Log: Oops, r362158 committed a duplicate definition of MAXSECFLAVORS. This patch gets rid of the duplicate. Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Jun 14 00:40:00 2020 (r362163) +++ head/sys/sys/mount.h Sun Jun 14 01:22:19 2020 (r362164) @@ -518,7 +518,6 @@ struct o2export_args { /* * Export arguments for local filesystem mount calls. */ -#define MAXSECFLAVORS 5 struct export_args { uint64_t ex_flags; /* export related flags */ uid_t ex_root; /* mapping for root uid */ From owner-svn-src-all@freebsd.org Sun Jun 14 05:08:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EF6F32E74A; Sun, 14 Jun 2020 05:08:15 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l2Xv3ZGgz3fVP; Sun, 14 Jun 2020 05:08:15 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7169C26C69; Sun, 14 Jun 2020 05:08:15 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E58FtW049092; Sun, 14 Jun 2020 05:08:15 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E58FZM049091; Sun, 14 Jun 2020 05:08:15 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006140508.05E58FZM049091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sun, 14 Jun 2020 05:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362165 - head/contrib/tzcode/stdtime X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/contrib/tzcode/stdtime X-SVN-Commit-Revision: 362165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 05:08:15 -0000 Author: gbe (doc committer) Date: Sun Jun 14 05:08:15 2020 New Revision: 362165 URL: https://svnweb.freebsd.org/changeset/base/362165 Log: Add a HISTORY section to ctime(3) Reviewed by: bcr (mentor) Approved by: bcr (mentor) Obtained from: OpenBSD MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D24635 Modified: head/contrib/tzcode/stdtime/ctime.3 Modified: head/contrib/tzcode/stdtime/ctime.3 ============================================================================== --- head/contrib/tzcode/stdtime/ctime.3 Sun Jun 14 01:22:19 2020 (r362164) +++ head/contrib/tzcode/stdtime/ctime.3 Sun Jun 14 05:08:15 2020 (r362165) @@ -335,6 +335,33 @@ the time package contributed to Berkeley by .An Arthur Olson and which appeared in .Bx 4.3 . +.Pp +The functions +.Fn asctime , +.Fn gmtime , +and +.Fn localtime +first appeared in +.At v5 , +.Fn difftime +and +.Fn mktime +in +.Bx 4.3 Reno , +and +.Fn timegm +and +.Fn timelocal +in SunOS 4.0. +.Pp +The functions +.Fn asctime_r , +.Fn ctime_r , +.Fn gmtime_r , +and +.Fn localtime_r +have been available since +.Fx 8.0 . .Sh BUGS Except for .Fn difftime , From owner-svn-src-all@freebsd.org Sun Jun 14 05:25:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34AD232F021; Sun, 14 Jun 2020 05:25:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l2wM0bNkz3gF8; Sun, 14 Jun 2020 05:25:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA1A8276BB; Sun, 14 Jun 2020 05:25:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E5P6ZW061061; Sun, 14 Jun 2020 05:25:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E5P6TB061059; Sun, 14 Jun 2020 05:25:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006140525.05E5P6TB061059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 14 Jun 2020 05:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362166 - stable/12/sys/dev/usb/net X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb/net X-SVN-Commit-Revision: 362166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 05:25:07 -0000 Author: hselasky Date: Sun Jun 14 05:25:06 2020 New Revision: 362166 URL: https://svnweb.freebsd.org/changeset/base/362166 Log: MFC r362056: Add missing range checks when receiving USB ethernet packets. Found by: Ilja Van Sprundel, IOActive Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/net/if_cdceem.c stable/12/sys/dev/usb/net/if_muge.c stable/12/sys/dev/usb/net/if_smsc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/net/if_cdceem.c ============================================================================== --- stable/12/sys/dev/usb/net/if_cdceem.c Sun Jun 14 05:08:15 2020 (r362165) +++ stable/12/sys/dev/usb/net/if_cdceem.c Sun Jun 14 05:25:06 2020 (r362166) @@ -426,9 +426,10 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr struct usb_ether *ue; struct ifnet *ifp; struct mbuf *m; - int actlen, off; uint32_t computed_crc, received_crc; - uint16_t pktlen; + int pktlen; + int actlen; + int off; off = *offp; sc = usbd_xfer_softc(xfer); @@ -442,7 +443,7 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr (hdr & CDCEEM_DATA_CRC) ? "valid" : "absent", pktlen); - if (pktlen < ETHER_HDR_LEN) { + if (pktlen < (ETHER_HDR_LEN + 4)) { CDCEEM_WARN(sc, "bad ethernet frame length %d, should be at least %d", pktlen, ETHER_HDR_LEN); @@ -466,6 +467,14 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr } pktlen -= 4; /* Subtract the CRC. */ + + if (pktlen > m->m_len) { + CDCEEM_WARN(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + return; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); off += pktlen; @@ -512,7 +521,7 @@ cdceem_bulk_read_callback(struct usb_xfer *xfer, usb_e pc = usbd_xfer_get_frame(xfer, 0); off = 0; - while (off < actlen) { + while ((off + sizeof(hdr)) <= actlen) { usbd_copy_out(pc, off, &hdr, sizeof(hdr)); CDCEEM_DEBUG(sc, "hdr = %#x", hdr); off += sizeof(hdr); Modified: stable/12/sys/dev/usb/net/if_muge.c ============================================================================== --- stable/12/sys/dev/usb/net/if_muge.c Sun Jun 14 05:08:15 2020 (r362165) +++ stable/12/sys/dev/usb/net/if_muge.c Sun Jun 14 05:25:06 2020 (r362166) @@ -1166,9 +1166,9 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err struct ifnet *ifp = uether_getifp(ue); struct mbuf *m; struct usb_page_cache *pc; - uint16_t pktlen; uint32_t rx_cmd_a, rx_cmd_b; uint16_t rx_cmd_c; + int pktlen; int off; int actlen; @@ -1246,7 +1246,14 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err 1); goto tr_setup; } - + if (pktlen > m->m_len) { + muge_dbg_printf(sc, + "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); Modified: stable/12/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/12/sys/dev/usb/net/if_smsc.c Sun Jun 14 05:08:15 2020 (r362165) +++ stable/12/sys/dev/usb/net/if_smsc.c Sun Jun 14 05:25:06 2020 (r362166) @@ -973,7 +973,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -999,6 +999,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1027,7 +1030,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ From owner-svn-src-all@freebsd.org Sun Jun 14 05:27:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9456732EEDA; Sun, 14 Jun 2020 05:27:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l2zG3Q3vz3gLd; Sun, 14 Jun 2020 05:27:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BFC727323; Sun, 14 Jun 2020 05:27:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E5Rcec061249; Sun, 14 Jun 2020 05:27:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E5Rct3061248; Sun, 14 Jun 2020 05:27:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006140527.05E5Rct3061248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 14 Jun 2020 05:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362167 - stable/11/sys/dev/usb/net X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/net X-SVN-Commit-Revision: 362167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 05:27:38 -0000 Author: hselasky Date: Sun Jun 14 05:27:37 2020 New Revision: 362167 URL: https://svnweb.freebsd.org/changeset/base/362167 Log: MFC r362056: Add missing range checks when receiving USB ethernet packets. Found by: Ilja Van Sprundel, IOActive Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/net/if_smsc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/11/sys/dev/usb/net/if_smsc.c Sun Jun 14 05:25:06 2020 (r362166) +++ stable/11/sys/dev/usb/net/if_smsc.c Sun Jun 14 05:27:37 2020 (r362167) @@ -970,7 +970,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -996,6 +996,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1024,7 +1027,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ From owner-svn-src-all@freebsd.org Sun Jun 14 05:33:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8697F32F71F; Sun, 14 Jun 2020 05:33:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l35y31cvz3gtZ; Sun, 14 Jun 2020 05:33:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62E03275CC; Sun, 14 Jun 2020 05:33:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E5XQVc067293; Sun, 14 Jun 2020 05:33:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E5XQQ8067292; Sun, 14 Jun 2020 05:33:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006140533.05E5XQQ8067292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 14 Jun 2020 05:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r362168 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb/net X-SVN-Commit-Revision: 362168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 05:33:26 -0000 Author: hselasky Date: Sun Jun 14 05:33:25 2020 New Revision: 362168 URL: https://svnweb.freebsd.org/changeset/base/362168 Log: MFC r362056: Add missing range checks when receiving USB ethernet packets. Found by: Ilja Van Sprundel, IOActive Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/net/if_smsc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/10/sys/dev/usb/net/if_smsc.c Sun Jun 14 05:27:37 2020 (r362167) +++ stable/10/sys/dev/usb/net/if_smsc.c Sun Jun 14 05:33:25 2020 (r362168) @@ -949,7 +949,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -975,6 +975,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1003,7 +1006,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err ifp->if_iqdrops++; goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ From owner-svn-src-all@freebsd.org Sun Jun 14 05:35:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5127232F6ED; Sun, 14 Jun 2020 05:35:06 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l37t1VZYz3yBY; Sun, 14 Jun 2020 05:35:06 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EBA127538; Sun, 14 Jun 2020 05:35:06 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E5Z6U1067459; Sun, 14 Jun 2020 05:35:06 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E5Z2qH067440; Sun, 14 Jun 2020 05:35:02 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006140535.05E5Z2qH067440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sun, 14 Jun 2020 05:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362169 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 362169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 05:35:06 -0000 Author: gbe (doc committer) Date: Sun Jun 14 05:35:02 2020 New Revision: 362169 URL: https://svnweb.freebsd.org/changeset/base/362169 Log: libutil: Document function HISTORY within the manpages Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D24795 Modified: head/lib/libutil/_secure_path.3 head/lib/libutil/hexdump.3 head/lib/libutil/kinfo_getallproc.3 head/lib/libutil/kinfo_getfile.3 head/lib/libutil/kinfo_getproc.3 head/lib/libutil/kinfo_getvmmap.3 head/lib/libutil/kinfo_getvmobject.3 head/lib/libutil/login.conf.5 head/lib/libutil/login_auth.3 head/lib/libutil/login_cap.3 head/lib/libutil/login_class.3 head/lib/libutil/login_ok.3 head/lib/libutil/login_times.3 head/lib/libutil/login_tty.3 head/lib/libutil/pidfile.3 head/lib/libutil/pw_util.3 head/lib/libutil/realhostname.3 head/lib/libutil/trimdomain.3 head/lib/libutil/uucplock.3 Modified: head/lib/libutil/_secure_path.3 ============================================================================== --- head/lib/libutil/_secure_path.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/_secure_path.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 1997 +.Dd May 10, 2020 .Dt _SECURE_PATH 3 .Os .Sh NAME @@ -69,6 +69,10 @@ reason, at LOG_ERR priority. Code from which this function was derived was contributed to the .Fx project by Berkeley Software Design, Inc. +The function +.Fn _secure_path +first appeared in +.Fx 2.2.5 . .Sh BUGS The checks carried out are rudimentary and no attempt is made to eliminate race conditions between use of this function and Modified: head/lib/libutil/hexdump.3 ============================================================================== --- head/lib/libutil/hexdump.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/hexdump.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2017 +.Dd May 8, 2020 .Dt HEXDUMP 3 .Os .Sh NAME @@ -83,6 +83,11 @@ Do not print the character values on each line. .Sh SEE ALSO .Xr ascii 7 , .Xr sbuf_hexdump 9 +.Sh HISTORY +The +.Fn hexdump +function first appeared in +.Fx 6.4 . .Sh AUTHORS This manual page was written by .An Scott Long . Modified: head/lib/libutil/kinfo_getallproc.3 ============================================================================== --- head/lib/libutil/kinfo_getallproc.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/kinfo_getallproc.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2015 +.Dd May 8, 2020 .Dt KINFO_GETALLPROC 3 .Os .Sh NAME @@ -73,3 +73,8 @@ function returns .Xr free 3 , .Xr malloc 3 , .Xr sysctl 3 +.Sh HISTORY +The +.Fn kinfo_getallproc +function first appeared in +.Fx 8.3 . Modified: head/lib/libutil/kinfo_getfile.3 ============================================================================== --- head/lib/libutil/kinfo_getfile.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/kinfo_getfile.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -78,3 +78,8 @@ function returns .Xr kinfo_getvmmap 3 , .Xr malloc 3 , .Xr sysctl 3 +.Sh HISTORY +The +.Fn kinfo_getfile +function first appeared in +.Fx 7.0 . Modified: head/lib/libutil/kinfo_getproc.3 ============================================================================== --- head/lib/libutil/kinfo_getproc.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/kinfo_getproc.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2015 +.Dd May 10, 2020 .Dt KINFO_GETPROC 3 .Os .Sh NAME @@ -72,3 +72,8 @@ function returns .Xr free 3 , .Xr malloc 3 , .Xr sysctl 3 +.Sh HISTORY +The +.Fn kinfo_getproc +function first appeared in +.Fx 7.0 . Modified: head/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- head/lib/libutil/kinfo_getvmmap.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/kinfo_getvmmap.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2017 +.Dd May 10, 2020 .Dt KINFO_GETVMMAP 3 .Os .Sh NAME @@ -84,3 +84,8 @@ function returns .Xr free 3 , .Xr kinfo_getfile 3 , .Xr malloc 3 +.Sh HISTORY +The +.Fn kinfo_getvmmap +function first appeared in +.Fx 7.0 . Modified: head/lib/libutil/kinfo_getvmobject.3 ============================================================================== --- head/lib/libutil/kinfo_getvmobject.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/kinfo_getvmobject.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2015 +.Dd May 20, 2020 .Dt KINFO_GETVMOBJECT 3 .Os .Sh NAME @@ -71,3 +71,8 @@ function returns .Xr free 3 , .Xr kinfo_getvmmap 3 , .Xr malloc 3 +.Sh HISTORY +The +.Fn kinfo_getvmobject +function first appeared in +.Fx 10.2 . Modified: head/lib/libutil/login.conf.5 ============================================================================== --- head/lib/libutil/login.conf.5 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/login.conf.5 Sun Jun 14 05:35:02 2020 (r362169) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2020 +.Dd May 10, 2020 .Dt LOGIN.CONF 5 .Os .Sh NAME @@ -471,3 +471,8 @@ lists. .Xr ttys 5 , .Xr ftpd 8 , .Xr pam_passwdqc 8 +.Sh HISTORY +The file +.Nm +first appeared in +.Fx 2.1.5 . Modified: head/lib/libutil/login_auth.3 ============================================================================== --- head/lib/libutil/login_auth.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/login_auth.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 29, 1996 +.Dd May 10, 2020 .Dt LOGIN_AUTH 3 .Os .Sh NAME @@ -70,3 +70,10 @@ by .Xr login_class 3 , .Xr login.conf 5 , .Xr termcap 5 +.Sh HISTORY +The functions +.Fn auth_checknologin +and +.Fn auth_cat +first appeared in +.Fx 2.1.5 . Modified: head/lib/libutil/login_cap.3 ============================================================================== --- head/lib/libutil/login_cap.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/login_cap.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2007 +.Dd May 10, 2020 .Dt LOGIN_CAP 3 .Os .Sh NAME @@ -577,3 +577,21 @@ is returned to indicate this. .Xr login_class 3 , .Xr login.conf 5 , .Xr termcap 5 +.Sh HISTORY +The functions +.Fn login_close , +.Fn login_getcapbool , +.Fn login_getcaplist , +.Fn login_getcapnum , +.Fn login_getcapstr , +.Fn login_getcapsize , +.Fn login_getcaptime , +.Fn login_getclass , +.Fn login_getclassbyname , +.Fn login_getpwclass , +.Fn login_getstyle , +.Fn login_getuserclass +and +.Fn login_setcryptfmt +first appeared in +.Fx 2.1.5 . Modified: head/lib/libutil/login_class.3 ============================================================================== --- head/lib/libutil/login_class.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/login_class.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2011 +.Dd May 10, 2020 .Dt LOGIN_CLASS 3 .Os .Sh NAME @@ -221,3 +221,13 @@ with LOG_ERR priority and directed to the currently ac .Xr mac_set_proc 3 , .Xr login.conf 5 , .Xr termcap 5 +.Sh HISTORY +The functions +.Fn setclasscontext , +.Fn setclasscpumask , +.Fn setclassenvironment , +.Fn setclassresources +and +.Fn setusercontext +first appeared in +.Fx 2.1.5 . Modified: head/lib/libutil/login_ok.3 ============================================================================== --- head/lib/libutil/login_ok.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/login_ok.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 1997 +.Dd May 10, 2020 .Dt LOGIN_OK 3 .Os .Sh NAME @@ -140,3 +140,11 @@ access list. .Xr login_times 3 , .Xr login.conf 5 , .Xr termcap 5 +.Sh HISTORY +The functions +.Fn auth_ttyok , +.Fn auth_hostok + and +.Fn auth_timeok +functions first appeared in +.Fx 2.1.5 . Modified: head/lib/libutil/login_times.3 ============================================================================== --- head/lib/libutil/login_times.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/login_times.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2008 +.Dd May 10, 2020 .Dt LOGIN_TIMES 3 .Os .Sh NAME @@ -177,3 +177,13 @@ time falls, or -1 if none of them apply. .Xr login_class 3 , .Xr login.conf 5 , .Xr termcap 5 +.Sh HISTORY +The functions +.Fn parse_lt , +.Fn in_lt , +.Fn in_ltm , +.Fn in_ltms +and +.Fn in_lts +first appeared in +.Fx 2.1.5 . Modified: head/lib/libutil/login_tty.3 ============================================================================== --- head/lib/libutil/login_tty.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/login_tty.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd December 29, 1996 +.Dd May 10, 2020 .Dt LOGIN_TTY 3 .Os .Sh NAME @@ -63,3 +63,9 @@ the controlling terminal of the calling process, and 0 .Xr ioctl 2 , .Xr setsid 2 , .Xr tty 4 +.Sh HISTORY +The function +.Fn login_tty +first appeared in +.Bx 4.4 . + Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/pidfile.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd May 10, 2020 .Dt PIDFILE 3 .Os .Sh NAME @@ -286,6 +286,15 @@ Probably called not from the process which used .Xr open 2 , .Xr daemon 3 , .Xr flopen 3 +.Sh HISTORY +The functions +.Fn pidfile_open , +.Fn pidfile_write , +.Fn pidfile_close +and +.Fn pidfile_remove +first appeared in +.Fx 5.5 . .Sh AUTHORS .An -nosplit The Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/pw_util.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2018 +.Dd May 10, 2020 .Dt PW_UTIL 3 .Os .Sh NAME @@ -288,6 +288,9 @@ The .Fn pw_tmp returns an open file descriptor to the temporary password file or -1 in case of failure. +.Sh HISTORY +The functions for passwd file handling first appeared in +.Bx 4.4 . .Sh AUTHORS Portions of this software were developed for the .Fx Modified: head/lib/libutil/realhostname.3 ============================================================================== --- head/lib/libutil/realhostname.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/realhostname.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -100,3 +100,8 @@ now contains the numeric value of .Xr gethostbyname 3 , .Xr inet_ntoa 3 , .Xr realhostname_sa 3 +.Sh HISTORY +The +.Fn realhostname +function first appeared in +.Fx 3.2 . Modified: head/lib/libutil/trimdomain.3 ============================================================================== --- head/lib/libutil/trimdomain.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/trimdomain.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -83,3 +83,8 @@ The function does not return a value. .Sh SEE ALSO .Xr gethostname 3 +.Sh HISTORY +The function +.Fn trimdomain +first appeared in +.Fx 3.2 . Modified: head/lib/libutil/uucplock.3 ============================================================================== --- head/lib/libutil/uucplock.3 Sun Jun 14 05:33:25 2020 (r362168) +++ head/lib/libutil/uucplock.3 Sun Jun 14 05:35:02 2020 (r362169) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd March 30, 1997 +.Dd May 10, 2020 .Dt UUCPLOCK 3 .Os .Sh NAME @@ -170,6 +170,14 @@ for further details. .Xr open 2 , .Xr read 2 , .Xr write 2 +.Sh HISTORY +The functions +.Fn uu_lock , +.Fn uu_unlock +and +.Fn uu_lockerr +first appeared in +.Fx 2.0.5 . .Sh BUGS It is possible that a stale lock is not recognised as such if a new processes is assigned the same processes id as the program that left From owner-svn-src-all@freebsd.org Sun Jun 14 05:50:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0F6E32FCCD; Sun, 14 Jun 2020 05:50:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l3Td5kZ4z3yXW; Sun, 14 Jun 2020 05:50:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB7F42782B; Sun, 14 Jun 2020 05:50:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E5oTbV073652; Sun, 14 Jun 2020 05:50:29 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E5oSKj073645; Sun, 14 Jun 2020 05:50:28 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006140550.05E5oSKj073645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sun, 14 Jun 2020 05:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362170 - in head/cddl/contrib/opensolaris/cmd: dtrace lockstat zdb zfs zpool zstreamdump X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris/cmd: dtrace lockstat zdb zfs zpool zstreamdump X-SVN-Commit-Revision: 362170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 05:50:30 -0000 Author: gbe (doc committer) Date: Sun Jun 14 05:50:28 2020 New Revision: 362170 URL: https://svnweb.freebsd.org/changeset/base/362170 Log: Add HISTORY sections to ZFS and dtrace manpage Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D23833 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 05:35:02 2020 (r362169) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 05:50:28 2020 (r362170) @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2018 +.Dd February 25, 2020 .Dt DTRACE 1 .Os .Sh NAME @@ -776,6 +776,11 @@ failed or that the specified request could not be sati .It 2 Invalid command line options or arguments were specified. .El +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.1 . .Sh SEE ALSO .Xr cpp 1 , .Xr elf 5 , Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 05:35:02 2020 (r362169) +++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 05:50:28 2020 (r362170) @@ -21,7 +21,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2015 +.Dd February 25, 2020 .Dt LOCKSTAT 1 .Os .Sh NAME @@ -366,6 +366,11 @@ Count indv cuml rcnt nsec Lock C .Xr dtrace 1 , .Xr ksyms 4 , .Xr locking 9 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.1 . .Sh NOTES Tail-call elimination can affect call sites. For example, if Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Jun 14 05:35:02 2020 (r362169) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Jun 14 05:50:28 2020 (r362170) @@ -13,7 +13,7 @@ .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. .\" Copyright 2017 Nexenta Systems, Inc. .\" -.Dd October 06, 2017 +.Dd February 25, 2020 .Dt ZDB 8 .Os .Sh NAME @@ -407,3 +407,8 @@ dedup = 1.11, compress = 1.80, copies = 1.00, dedup * .Sh SEE ALSO .Xr zfs 8 , .Xr zpool 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.0 . Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Jun 14 05:35:02 2020 (r362169) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Jun 14 05:50:28 2020 (r362170) @@ -3949,6 +3949,11 @@ M F /tank/test/modified .Xr umount 8 , .Xr zfs-program 8 , .Xr zpool 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.0 . .Sh AUTHORS This manual page is a .Xr mdoc 7 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 14 05:35:02 2020 (r362169) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 14 05:50:28 2020 (r362170) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2019 +.Dd February 25, 2020 .Dt ZPOOL 8 .Os .Sh NAME @@ -2462,6 +2462,11 @@ Discarded approximately 29 seconds of transactions. .Xr zpool-features 7 , .Xr zfs 8 , .Xr zfsd 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.0 . .Sh AUTHORS This manual page is a .Xr mdoc 7 Modified: head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Sun Jun 14 05:35:02 2020 (r362169) +++ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Sun Jun 14 05:50:28 2020 (r362170) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2013 +.Dd February 25, 2020 .Dt ZSTREAMDUMP 8 .Os .Sh NAME @@ -52,6 +52,11 @@ Verbose. Dump all headers, not only begin and end head .El .Sh SEE ALSO .Xr zfs 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.0 . .Sh AUTHORS This manual page is a .Xr mdoc 7 From owner-svn-src-all@freebsd.org Sun Jun 14 05:59:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CC7632F982; Sun, 14 Jun 2020 05:59:32 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l3h40NWTz3yyV; Sun, 14 Jun 2020 05:59:32 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 085FF27AA2; Sun, 14 Jun 2020 05:59:32 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E5xVV1079657; Sun, 14 Jun 2020 05:59:31 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E5xU4l079650; Sun, 14 Jun 2020 05:59:30 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006140559.05E5xU4l079650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sun, 14 Jun 2020 05:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362171 - in head/lib/libc: stdio string sys X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head/lib/libc: stdio string sys X-SVN-Commit-Revision: 362171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 05:59:32 -0000 Author: gbe (doc committer) Date: Sun Jun 14 05:59:30 2020 New Revision: 362171 URL: https://svnweb.freebsd.org/changeset/base/362171 Log: libc manpages: various improvements from NetBSD - Add STANDARDS and HISTORY sections within the appropriate manpages - Mention two USENIX papers within kqueue(2) and strlcpy(3) Reviewed by: bcr (mentor) Approved by: bcr (mentor) Obtained from: NetBSD MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D24650 Modified: head/lib/libc/stdio/fflush.3 head/lib/libc/stdio/fopen.3 head/lib/libc/stdio/setbuf.3 head/lib/libc/string/strlcpy.3 head/lib/libc/sys/getgid.2 head/lib/libc/sys/getitimer.2 head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/stdio/fflush.3 ============================================================================== --- head/lib/libc/stdio/fflush.3 Sun Jun 14 05:50:28 2020 (r362170) +++ head/lib/libc/stdio/fflush.3 Sun Jun 14 05:59:30 2020 (r362171) @@ -32,7 +32,7 @@ .\" @(#)fflush.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 23, 2020 +.Dd May 1, 2020 .Dt FFLUSH 3 .Os .Sh NAME @@ -125,3 +125,12 @@ The function conforms to .St -isoC . +.Sh HISTORY +The +.Fn fflush +function first appeared in +.At v4 . +The +.Fn fpurge +function first appeared in +.Bx 4.4 . Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Sun Jun 14 05:50:28 2020 (r362170) +++ head/lib/libc/stdio/fopen.3 Sun Jun 14 05:59:30 2020 (r362171) @@ -32,7 +32,7 @@ .\" @(#)fopen.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 30, 2013 +.Dd May 1, 2020 .Dt FOPEN 3 .Os .Sh NAME @@ -356,3 +356,8 @@ The .Dq Li b mode does not conform to any standard but is also supported by glibc. +.Sh HISTORY +An +.Fn fopen +function appeared in +.At v1 . Modified: head/lib/libc/stdio/setbuf.3 ============================================================================== --- head/lib/libc/stdio/setbuf.3 Sun Jun 14 05:50:28 2020 (r362170) +++ head/lib/libc/stdio/setbuf.3 Sun Jun 14 05:59:30 2020 (r362171) @@ -32,7 +32,7 @@ .\" @(#)setbuf.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 18, 2013 +.Dd May 1, 2020 .Dt SETBUF 3 .Os .Sh NAME @@ -195,6 +195,23 @@ and functions conform to .St -isoC . +.Sh HISTORY +The +.Fn setbuf +function first appeared in +.At v7 . +The +.Fn setbuffer +function first appeared in +.Bx 4.1c . +The +.Fn setlinebuf +function first appeared in +.Bx 4.2 . +The +.Fn setvbuf +function first appeared in +.Bx 4.4 . .Sh BUGS .Fn setbuf usually uses a suboptimal buffer size and should be avoided. Modified: head/lib/libc/string/strlcpy.3 ============================================================================== --- head/lib/libc/string/strlcpy.3 Sun Jun 14 05:50:28 2020 (r362170) +++ head/lib/libc/string/strlcpy.3 Sun Jun 14 05:59:30 2020 (r362171) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2016 +.Dd May 1, 2020 .Dt STRLCPY 3 .Os .Sh NAME @@ -189,6 +189,16 @@ As a matter of fact, the first version of this manual .Xr strncat 3 , .Xr strncpy 3 , .Xr wcslcpy 3 +.Rs +.%A Todd C. Miller +.%A Theo de Raadt +.%T strlcpy and strlcat -- Consistent, Safe, String Copy and Concatenation +.%I USENIX Association +.%B Proceedings of the FREENIX Track: 1999 USENIX Annual Technical Conference +.%D June 6-11, 1999 +.%U http://www.usenix.org/publications/library/proceedings/usenix99/ +.%U full_papers/millert/millert.pdf +.Re .Sh HISTORY The .Fn strlcpy Modified: head/lib/libc/sys/getgid.2 ============================================================================== --- head/lib/libc/sys/getgid.2 Sun Jun 14 05:50:28 2020 (r362170) +++ head/lib/libc/sys/getgid.2 Sun Jun 14 05:59:30 2020 (r362171) @@ -28,7 +28,7 @@ .\" @(#)getgid.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 15, 2015 +.Dd May 1, 2020 .Dt GETGID 2 .Os .Sh NAME @@ -78,3 +78,8 @@ and .Fn getegid system calls are expected to conform to .St -p1003.1-90 . +.Sh HISTORY +The +.Fn getgid +function appeared in +.At v4 . Modified: head/lib/libc/sys/getitimer.2 ============================================================================== --- head/lib/libc/sys/getitimer.2 Sun Jun 14 05:50:28 2020 (r362170) +++ head/lib/libc/sys/getitimer.2 Sun Jun 14 05:59:30 2020 (r362171) @@ -28,7 +28,7 @@ .\" @(#)getitimer.2 8.3 (Berkeley) 5/16/95 .\" $FreeBSD$ .\" -.Dd May 16, 1995 +.Dd May 1, 2020 .Dt GETITIMER 2 .Os .Sh NAME @@ -173,6 +173,21 @@ to be handled. .Xr select 2 , .Xr sigaction 2 , .Xr clocks 7 +.Sh STANDARDS +The +.Fn getitimer +and +.Fn setitimer +functions conform to +.St -p1003.1-2001 . +The later +.St -p1003.1-2008 +revision however marked both functions as obsolescent, +recommending the use of +.Xr timer_gettime 2 +and +.Xr timer_settime 2 +instead. .Sh HISTORY The .Fn getitimer Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Sun Jun 14 05:50:28 2020 (r362170) +++ head/lib/libc/sys/kqueue.2 Sun Jun 14 05:59:30 2020 (r362171) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2020 +.Dd May 1, 2020 .Dt KQUEUE 2 .Os .Sh NAME @@ -776,6 +776,14 @@ have been applied. .Xr write 2 , .Xr pthread_setcancelstate 3 , .Xr signal 3 +.Rs +.%A Jonathan Lemon +.%T "Kqueue: A Generic and Scalable Event Notification Facility" +.%I USENIX Association +.%B Proceedings of the FREENIX Track: 2001 USENIX Annual Technical Conference +.%D June 25-30, 2001 +.\".http://www.usenix.org/event/usenix01/freenix01/full_papers/lemon/lemon.pdf +.Re .Sh HISTORY The .Fn kqueue From owner-svn-src-all@freebsd.org Sun Jun 14 06:59:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7BEF330AA5; Sun, 14 Jun 2020 06:59:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l50j540Sz42Rt; Sun, 14 Jun 2020 06:59:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8D778903; Sun, 14 Jun 2020 06:59:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E6x1Ow016079; Sun, 14 Jun 2020 06:59:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E6wxPl016062; Sun, 14 Jun 2020 06:58:59 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006140658.05E6wxPl016062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 14 Jun 2020 06:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362172 - in head: share/vt/fonts sys/dev/vt sys/dev/vt/font sys/sys tools/build tools/tools/vt/mkkfont usr.bin/vtfontcvt usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: share/vt/fonts sys/dev/vt sys/dev/vt/font sys/sys tools/build tools/tools/vt/mkkfont usr.bin/vtfontcvt usr.sbin/vidcontrol X-SVN-Commit-Revision: 362172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 06:59:01 -0000 Author: tsoome Date: Sun Jun 14 06:58:58 2020 New Revision: 362172 URL: https://svnweb.freebsd.org/changeset/base/362172 Log: Move font related data structured to sys/font.c and update vtfontcvt Prepare support to be able to handle font data in loader, consolidate data structures to sys/font.h and update vtfontcvt. vtfontcvt update is about to output set of glyphs in form of C source, the implementation does allow to output compressed or uncompressed font bitmaps. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D24189 Added: head/sys/sys/font.h (contents, props changed) Modified: head/share/vt/fonts/Makefile head/sys/dev/vt/font/vt_font_default.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_font.c head/sys/sys/consio.h head/tools/build/Makefile head/tools/tools/vt/mkkfont/mkkfont.c head/usr.bin/vtfontcvt/Makefile head/usr.bin/vtfontcvt/vtfontcvt.8 head/usr.bin/vtfontcvt/vtfontcvt.c head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/share/vt/fonts/Makefile ============================================================================== --- head/share/vt/fonts/Makefile Sun Jun 14 05:59:30 2020 (r362171) +++ head/share/vt/fonts/Makefile Sun Jun 14 06:58:58 2020 (r362172) @@ -15,7 +15,7 @@ CLEANFILES+= ${FONTS} .SUFFIXES: .bdf .fnt .fnt.uu .hex .bdf.fnt .hex.fnt: - vtfontcvt ${.IMPSRC} ${.TARGET} + vtfontcvt -o ${.TARGET} ${.IMPSRC} FILESDIR= ${SHAREDIR}/vt/fonts Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Sun Jun 14 05:59:30 2020 (r362171) +++ head/sys/dev/vt/font/vt_font_default.c Sun Jun 14 06:58:58 2020 (r362172) @@ -3006,7 +3006,7 @@ static uint8_t font_bytes[2224 * 16] = { 0x0c, 0x06, 0x03, 0x01, }; -static struct vt_font_map font_mapping_normal[308] = { +static vfnt_map_t font_mapping_normal[308] = { { 0x0020, 0x0001, 0x5e }, { 0x00a0, 0x0001, 0x00 }, { 0x00a1, 0x0060, 0x6e }, { 0x0110, 0x008f, 0x00 }, { 0x0111, 0x00cf, 0x08 }, { 0x011a, 0x00d2, 0x01 }, @@ -3163,7 +3163,7 @@ static struct vt_font_map font_mapping_normal[308] = { { 0xe0b0, 0x0478, 0x03 }, { 0xf6be, 0x0148, 0x00 }, }; -static struct vt_font_map font_mapping_bold[319] = { +static vfnt_map_t font_mapping_bold[319] = { { 0x0021, 0x047c, 0x0b }, { 0x002d, 0x0220, 0x00 }, { 0x002e, 0x0488, 0x50 }, { 0x00a1, 0x04d9, 0x07 }, { 0x00aa, 0x04e1, 0x03 }, { 0x00af, 0x04e5, 0x07 }, Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Sun Jun 14 05:59:30 2020 (r362171) +++ head/sys/dev/vt/vt.h Sun Jun 14 06:58:58 2020 (r362172) @@ -48,6 +48,7 @@ #include #include #include +#include #include "opt_syscons.h" #include "opt_splash.h" @@ -399,30 +400,6 @@ void vt_upgrade(struct vt_device *vd); /* name argument is not used yet. */ #define VT_DRIVER_DECLARE(name, drv) DATA_SET(vt_drv_set, drv) - -/* - * Fonts. - * - * Remapping tables are used to map Unicode points to glyphs. They need - * to be sorted, because vtfont_lookup() performs a binary search. Each - * font has two remapping tables, for normal and bold. When a character - * is not present in bold, it uses a normal glyph. When no glyph is - * available, it uses glyph 0, which is normally equal to U+FFFD. - */ - -struct vt_font_map { - uint32_t vfm_src; - uint16_t vfm_dst; - uint16_t vfm_len; -}; - -struct vt_font { - struct vt_font_map *vf_map[VFNT_MAPS]; - uint8_t *vf_bytes; - unsigned int vf_height, vf_width; - unsigned int vf_map_count[VFNT_MAPS]; - unsigned int vf_refcount; -}; #ifndef SC_NO_CUTPASTE struct vt_mouse_cursor { Modified: head/sys/dev/vt/vt_font.c ============================================================================== --- head/sys/dev/vt/vt_font.c Sun Jun 14 05:59:30 2020 (r362171) +++ head/sys/dev/vt/vt_font.c Sun Jun 14 06:58:58 2020 (r362172) @@ -49,7 +49,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); #define VTFONT_MAXDIMENSION 128 static uint16_t -vtfont_bisearch(const struct vt_font_map *map, unsigned int len, uint32_t src) +vtfont_bisearch(const vfnt_map_t *map, unsigned int len, uint32_t src) { int min, mid, max; @@ -137,7 +137,7 @@ vtfont_unref(struct vt_font *vf) } static int -vtfont_validate_map(struct vt_font_map *vfm, unsigned int length, +vtfont_validate_map(vfnt_map_t *vfm, unsigned int length, unsigned int glyph_count) { unsigned int i, last = 0; @@ -198,7 +198,7 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) vf->vf_map_count[i] = f->map_count[i]; if (f->map_count[i] == 0) continue; - mapsize = f->map_count[i] * sizeof(struct vt_font_map); + mapsize = f->map_count[i] * sizeof(vfnt_map_t); vf->vf_map[i] = malloc(mapsize, M_VTFONT, M_WAITOK); error = copyin(f->map[i], vf->vf_map[i], mapsize); if (error) Modified: head/sys/sys/consio.h ============================================================================== --- head/sys/sys/consio.h Sun Jun 14 05:59:30 2020 (r362171) +++ head/sys/sys/consio.h Sun Jun 14 06:58:58 2020 (r362172) @@ -37,6 +37,7 @@ #include #endif #include +#include /* * Console ioctl commands. Some commands are named as KDXXXX, GIO_XXX, and @@ -218,18 +219,6 @@ struct fnt16 { }; typedef struct fnt16 fnt16_t; -struct vfnt_map { - uint32_t src; - uint16_t dst; - uint16_t len; -}; -typedef struct vfnt_map vfnt_map_t; - -#define VFNT_MAP_NORMAL 0 -#define VFNT_MAP_NORMAL_RIGHT 1 -#define VFNT_MAP_BOLD 2 -#define VFNT_MAP_BOLD_RIGHT 3 -#define VFNT_MAPS 4 struct vfnt { vfnt_map_t *map[VFNT_MAPS]; uint8_t *glyphs; Added: head/sys/sys/font.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/font.h Sun Jun 14 06:58:58 2020 (r362172) @@ -0,0 +1,112 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2009, 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Ed Schouten under sponsorship from the + * FreeBSD Foundation. + * + * Portions of this software were developed by Oleksandr Rybalko + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_FONT_H_ +#define _SYS_FONT_H_ + +#include + +/* + * Fonts. + * + * Remapping tables are used to map Unicode points to glyphs. They need + * to be sorted, because vtfont_lookup() performs a binary search. Each + * font has two remapping tables, for normal and bold. When a character + * is not present in bold, it uses a normal glyph. When no glyph is + * available, it uses glyph 0, which is normally equal to U+FFFD. + */ + +enum vfnt_map_type { + VFNT_MAP_NORMAL = 0, /* Normal font. */ + VFNT_MAP_NORMAL_RIGHT, /* Normal font right hand. */ + VFNT_MAP_BOLD, /* Bold font. */ + VFNT_MAP_BOLD_RIGHT, /* Bold font right hand. */ + VFNT_MAPS /* Number of maps. */ +}; + +struct vfnt_map { + uint32_t vfm_src; + uint16_t vfm_dst; + uint16_t vfm_len; +} __packed; +typedef struct vfnt_map vfnt_map_t; + +struct vt_font { + vfnt_map_t *vf_map[VFNT_MAPS]; + uint8_t *vf_bytes; + uint32_t vf_height; + uint32_t vf_width; + uint32_t vf_map_count[VFNT_MAPS]; + uint32_t vf_refcount; +}; + +typedef struct vt_font_bitmap_data { + uint32_t vfbd_width; + uint32_t vfbd_height; + uint32_t vfbd_compressed_size; + uint32_t vfbd_uncompressed_size; + uint8_t *vfbd_compressed_data; + struct vt_font *vfbd_font; +} vt_font_bitmap_data_t; + +typedef enum { + FONT_AUTO, + FONT_MANUAL, + FONT_BOOT +} FONT_FLAGS; + +struct fontlist { + char *font_name; + FONT_FLAGS font_flags; + vt_font_bitmap_data_t *font_data; + vt_font_bitmap_data_t *(*font_load)(char *); + STAILQ_ENTRY(fontlist) font_next; +}; + +#define BORDER_PIXELS 10 /* space from screen border */ +typedef STAILQ_HEAD(font_list, fontlist) font_list_t; + +#define FONT_HEADER_MAGIC "VFNT0002" +struct font_header { + uint8_t fh_magic[8]; + uint8_t fh_width; + uint8_t fh_height; + uint16_t fh_pad; + uint32_t fh_glyph_count; + uint32_t fh_map_count[VFNT_MAPS]; +} __packed; + +#endif /* !_SYS_FONT_H_ */ Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Sun Jun 14 05:59:30 2020 (r362171) +++ head/tools/build/Makefile Sun Jun 14 06:58:58 2020 (r362172) @@ -92,6 +92,9 @@ DISKINCS+= ${SRCTOP}/sys/sys/disk/bsd.h SYSINCS+= ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h \ ${SRCTOP}/sys/sys/dnv.h +# vtfontcvt is using sys/font.h +SYSINCS+= ${SRCTOP}/sys/sys/font.h + # We want to run the build with only ${WORLDTMP} in $PATH to ensure we don't # accidentally run tools that are incompatible but happen to be in $PATH. # This is especially important when building on Linux/MacOS where many of the Modified: head/tools/tools/vt/mkkfont/mkkfont.c ============================================================================== --- head/tools/tools/vt/mkkfont/mkkfont.c Sun Jun 14 05:59:30 2020 (r362171) +++ head/tools/tools/vt/mkkfont/mkkfont.c Sun Jun 14 06:58:58 2020 (r362172) @@ -32,35 +32,21 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -struct file_mapping { - uint32_t source; - uint16_t destination; - uint16_t length; -} __packed; - -struct file_header { - uint8_t magic[8]; - uint8_t width; - uint8_t height; - uint16_t pad; - uint32_t glyph_count; - uint32_t map_count[4]; -} __packed; - static int -print_glyphs(struct file_header *fh) +print_glyphs(struct font_header *fh) { unsigned int gbytes, glyph_count, j, k, total; uint8_t *gbuf; - gbytes = howmany(fh->width, 8) * fh->height; - glyph_count = be32toh(fh->glyph_count); + gbytes = howmany(fh->fh_width, 8) * fh->fh_height; + glyph_count = be32toh(fh->fh_glyph_count); printf("\nstatic uint8_t font_bytes[%u * %u] = {", glyph_count, gbytes); total = glyph_count * gbytes; @@ -88,18 +74,18 @@ static const char *map_names[4] = { "normal", "normal_right", "bold", "bold_right" }; static int -print_mappings(struct file_header *fh, int map_index) +print_mappings(struct font_header *fh, int map_index) { - struct file_mapping fm; + vfnt_map_t fm; unsigned int nmappings, i, col = 0; - nmappings = be32toh(fh->map_count[map_index]); + nmappings = be32toh(fh->fh_map_count[map_index]); if (nmappings == 0) return (0); - printf("\nstatic struct vt_font_map font_mapping_%s[%u] = {", + printf("\nstatic vfnt_map_t font_mapping_%s[%u] = {", map_names[map_index], nmappings); for (i = 0; i < nmappings; i++) { @@ -110,8 +96,8 @@ print_mappings(struct file_header *fh, int map_index) printf(col == 0 ? "\n\t" : " "); printf("{ 0x%04x, 0x%04x, 0x%02x },", - be32toh(fm.source), be16toh(fm.destination), - be16toh(fm.length)); + be32toh(fm.vfm_src), be16toh(fm.vfm_dst), + be16toh(fm.vfm_len)); col = (col + 1) % 2; } @@ -121,7 +107,7 @@ print_mappings(struct file_header *fh, int map_index) } static int -print_info(struct file_header *fh) +print_info(struct font_header *fh) { unsigned int i; @@ -130,21 +116,21 @@ print_info(struct file_header *fh) "\t.vf_width\t\t= %u,\n" "\t.vf_height\t\t= %u,\n" "\t.vf_bytes\t\t= font_bytes,\n", - fh->width, fh->height); + fh->fh_width, fh->fh_height); printf("\t.vf_map\t\t\t= {\n"); for (i = 0; i < 4; i++) { - if (fh->map_count[i] > 0) + if (fh->fh_map_count[i] > 0) printf("\t\t\t\t font_mapping_%s,\n", map_names[i]); else printf("\t\t\t\t NULL,\n"); } printf("\t\t\t\t },\n"); printf("\t.vf_map_count\t\t= { %u, %u, %u, %u },\n", - be32toh(fh->map_count[0]), - be32toh(fh->map_count[1]), - be32toh(fh->map_count[2]), - be32toh(fh->map_count[3])); + be32toh(fh->fh_map_count[0]), + be32toh(fh->fh_map_count[1]), + be32toh(fh->fh_map_count[2]), + be32toh(fh->fh_map_count[3])); printf("\t.vf_refcount\t\t= 1,\n};\n"); return (0); @@ -153,15 +139,15 @@ print_info(struct file_header *fh) int main(int argc __unused, char *argv[] __unused) { - struct file_header fh; + struct font_header fh; unsigned int i; if (fread(&fh, sizeof fh, 1, stdin) != 1) { - perror("file_header"); + perror("font_header"); return (1); } - if (memcmp(fh.magic, "VFNT0002", 8) != 0) { + if (memcmp(fh.fh_magic, "VFNT0002", 8) != 0) { fprintf(stderr, "Bad magic\n"); return (1); } Modified: head/usr.bin/vtfontcvt/Makefile ============================================================================== --- head/usr.bin/vtfontcvt/Makefile Sun Jun 14 05:59:30 2020 (r362171) +++ head/usr.bin/vtfontcvt/Makefile Sun Jun 14 06:58:58 2020 (r362172) @@ -1,6 +1,11 @@ # $FreeBSD$ PROG= vtfontcvt +SRCS= vtfontcvt.c lz4.c MAN8= vtfontcvt.8 + +# lz4 compression functionality +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 .include Modified: head/usr.bin/vtfontcvt/vtfontcvt.8 ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.8 Sun Jun 14 05:59:30 2020 (r362171) +++ head/usr.bin/vtfontcvt/vtfontcvt.8 Sun Jun 14 06:58:58 2020 (r362172) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2014 +.Dd Mar 10, 2020 .Dt VTFONTCVT 8 .Os .Sh NAME @@ -32,29 +32,44 @@ .Nd "convert font files for use by the video console" .Sh SYNOPSIS .Nm +.Op Fl n +.Op Fl f Ar font Ns | Ns Ar source Ns | Ns Ar compressed-source .Op Fl h Ar height +.Fl o Ar output_file .Op Fl v .Op Fl w Ar width .Ar normal_font .Op Ar bold_font -.Ar output_file .Sh DESCRIPTION The .Nm utility reads source font files in either BDF or Unifont HEX format and -outputs a binary font file for use by +outputs a binary font file, C source, or C source with font data compressed +by using LZ4 compression method. +The output in C source is intended to be used to embed the font into program +binary. +The binary font file is for use by .Xr vt 4 . HEX format files must have the file extension .Pa .hex . .Pp The following options are available: .Bl -tag -width "12345678" +.It Fl f Ar font Ns | Ns Ar source Ns | Ns Ar compressed-source +Specify the output format. +The default is binary +.Ar font +file. .It Fl h Ar height Set font height. The default is 16. Font height is set automatically for HEX files that have a .Ql # Height: Ar height comment before any font data. +.It Fl n +Do not apply output filtering with C source output. +.It Fl o Ar output_file +Specify the name for the output file. .It Fl v Display verbose statistics about the converted font. .It Fl w Ar width Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 14 05:59:30 2020 (r362171) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 14 06:58:58 2020 (r362172) @@ -35,20 +35,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include #include #include +#include -#define VFNT_MAPS 4 -#define VFNT_MAP_NORMAL 0 -#define VFNT_MAP_NORMAL_RH 1 -#define VFNT_MAP_BOLD 2 -#define VFNT_MAP_BOLD_RH 3 #define VFNT_MAXGLYPHS 131072 #define VFNT_MAXDIMENSION 128 @@ -89,12 +87,102 @@ static struct mapping_list maps[VFNT_MAPS] = { static unsigned int mapping_total, map_count[4], map_folded_count[4], mapping_unique, mapping_dupe; +enum output_format { + VT_FONT, /* default */ + VT_C_SOURCE, /* C source for built in fonts */ + VT_C_COMPRESSED /* C source with compressed font data */ +}; + +struct whitelist { + uint32_t c; + uint32_t len; +}; + +/* + * Compressed font glyph list. To be used with boot loader, we need to have + * ascii set and box drawing chars. + */ +static struct whitelist c_list[] = { + { .c = 0, .len = 0 }, /* deault char */ + { .c = 0x20, .len = 0x5f }, + { .c = 0x2500, .len = 0 }, /* single frame */ + { .c = 0x2502, .len = 0 }, + { .c = 0x250c, .len = 0 }, + { .c = 0x2510, .len = 0 }, + { .c = 0x2514, .len = 0 }, + { .c = 0x2518, .len = 0 }, + { .c = 0x2550, .len = 1 }, /* double frame */ + { .c = 0x2554, .len = 0 }, + { .c = 0x2557, .len = 0 }, + { .c = 0x255a, .len = 0 }, + { .c = 0x255d, .len = 0 }, +}; + +/* + * Uncompressed source. For x86 we need cp437 so the vga text mode + * can program font into the vga card. + */ +static struct whitelist s_list[] = { + { .c = 0, .len = 0 }, /* deault char */ + { .c = 0x20, .len = 0x5f }, /* ascii set */ + { .c = 0xA0, .len = 0x5f }, /* latin 1 */ + { .c = 0x0192, .len = 0 }, + { .c = 0x0332, .len = 0 }, /* composing lower line */ + { .c = 0x0393, .len = 0 }, + { .c = 0x0398, .len = 0 }, + { .c = 0x03A3, .len = 0 }, + { .c = 0x03A6, .len = 0 }, + { .c = 0x03A9, .len = 0 }, + { .c = 0x03B1, .len = 1 }, + { .c = 0x03B4, .len = 0 }, + { .c = 0x03C0, .len = 0 }, + { .c = 0x03C3, .len = 0 }, + { .c = 0x03C4, .len = 0 }, + { .c = 0x207F, .len = 0 }, + { .c = 0x20A7, .len = 0 }, + { .c = 0x2205, .len = 0 }, + { .c = 0x220A, .len = 0 }, + { .c = 0x2219, .len = 1 }, + { .c = 0x221E, .len = 0 }, + { .c = 0x2229, .len = 0 }, + { .c = 0x2248, .len = 0 }, + { .c = 0x2261, .len = 0 }, + { .c = 0x2264, .len = 1 }, + { .c = 0x2310, .len = 0 }, + { .c = 0x2320, .len = 1 }, + { .c = 0x2500, .len = 0 }, + { .c = 0x2502, .len = 0 }, + { .c = 0x250C, .len = 0 }, + { .c = 0x2510, .len = 0 }, + { .c = 0x2514, .len = 0 }, + { .c = 0x2518, .len = 0 }, + { .c = 0x251C, .len = 0 }, + { .c = 0x2524, .len = 0 }, + { .c = 0x252C, .len = 0 }, + { .c = 0x2534, .len = 0 }, + { .c = 0x253C, .len = 0 }, + { .c = 0x2550, .len = 0x1c }, + { .c = 0x2580, .len = 0 }, + { .c = 0x2584, .len = 0 }, + { .c = 0x2588, .len = 0 }, + { .c = 0x258C, .len = 0 }, + { .c = 0x2590, .len = 3 }, + { .c = 0x25A0, .len = 0 }, +}; + +static bool filter = true; +static enum output_format format = VT_FONT; +/* Type for write callback. */ +typedef size_t (*vt_write)(const void *, size_t, size_t, FILE *); +static uint8_t *uncompressed; + static void usage(void) { - (void)fprintf(stderr, -"usage: vtfontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] out.fnt\n"); + (void)fprintf(stderr, "usage: vtfontcvt " + "[-n] [-f font|source|compressed-source] [-w width] " + "[-h height]\n\t[-v] normal.bdf [bold.bdf] out.fnt\n"); exit(1); } @@ -148,7 +236,7 @@ dedup_mapping(unsigned int map_idx) struct mapping *mp_bold, *mp_normal, *mp_temp; unsigned normal_map_idx = map_idx - VFNT_MAP_BOLD; - assert(map_idx == VFNT_MAP_BOLD || map_idx == VFNT_MAP_BOLD_RH); + assert(map_idx == VFNT_MAP_BOLD || map_idx == VFNT_MAP_BOLD_RIGHT); mp_normal = TAILQ_FIRST(&maps[normal_map_idx]); TAILQ_FOREACH_SAFE(mp_bold, &maps[map_idx], m_list, mp_temp) { while (mp_normal->m_char < mp_bold->m_char) @@ -201,6 +289,32 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, return (gl); } +static bool +check_whitelist(unsigned c) +{ + struct whitelist *w = NULL; + int i, n = 0; + + if (filter == false) + return (true); + + if (format == VT_C_SOURCE) { + w = s_list; + n = sizeof (s_list) / sizeof (s_list[0]); + } + if (format == VT_C_COMPRESSED) { + w = c_list; + n = sizeof (c_list) / sizeof (c_list[0]); + } + if (w == NULL) + return (true); + for (i = 0; i < n; i++) { + if (c >= w[i].c && c <= w[i].c + w[i].len) + return (true); + } + return (false); +} + static int add_char(unsigned curchar, unsigned map_idx, uint8_t *bytes, uint8_t *bytes_r) { @@ -210,7 +324,7 @@ add_char(unsigned curchar, unsigned map_idx, uint8_t * if (curchar == 0xFFFD) { if (map_idx < VFNT_MAP_BOLD) gl = add_glyph(bytes, 0, 1); - } else if (curchar >= 0x20) { + } else if (filter == false || curchar >= 0x20) { gl = add_glyph(bytes, map_idx, 0); if (add_mapping(gl, curchar, map_idx) != 0) return (1); @@ -287,9 +401,9 @@ set_width(int w) static int parse_bdf(FILE *fp, unsigned int map_idx) { - char *line, *ln, *p; + char *ln, *p; size_t length; - uint8_t *bytes, *bytes_r; + uint8_t *line, *bytes, *bytes_r; unsigned int curchar = 0, i, j, linenum = 0, bbwbytes; int bbw, bbh, bbox, bboy; /* Glyph bounding box. */ int fbbw = 0, fbbh, fbbox, fbboy; /* Font bounding box. */ @@ -414,10 +528,12 @@ parse_bdf(FILE *fp, unsigned int map_idx) goto out; } - rv = add_char(curchar, map_idx, bytes, - dwidth > (int)width ? bytes_r : NULL); - if (rv != 0) - goto out; + if (check_whitelist(curchar) == true) { + rv = add_char(curchar, map_idx, bytes, + dwidth > (int)width ? bytes_r : NULL); + if (rv != 0) + goto out; + } dwidth = bbw = bbh = 0; } @@ -484,10 +600,12 @@ parse_hex(FILE *fp, unsigned int map_idx) p += gwbytes * 2; } - rv = add_char(curchar, map_idx, bytes, - gwidth != width ? bytes_r : NULL); - if (rv != 0) - goto out; + if (check_whitelist(curchar) == true) { + rv = add_char(curchar, map_idx, bytes, + gwidth != width ? bytes_r : NULL); + if (rv != 0) + goto out; + } } } out: @@ -529,15 +647,51 @@ number_glyphs(void) gl->g_index = idx++; } +/* Note we only deal with byte stream here. */ +static size_t +write_glyph_source(const void *ptr, size_t size, size_t nitems, FILE *stream) +{ + const uint8_t *data = ptr; + size_t i; + + size *= nitems; + for (i = 0; i < size; i++) { + if ((i % wbytes) == 0) { + if (fprintf(stream, "\n") < 0) + return (0); + } + if (fprintf(stream, "0x%02x, ", data[i]) < 0) + return (0); + } + if (fprintf(stream, "\n") < 0) + nitems = 0; + + return (nitems); +} + +/* Write to buffer */ +static size_t +write_glyph_buf(const void *ptr, size_t size, size_t nitems, + FILE *stream __unused) +{ + static size_t index = 0; + + size *= nitems; + (void) memmove(uncompressed + index, ptr, size); + index += size; + + return (nitems); +} + static int -write_glyphs(FILE *fp) +write_glyphs(FILE *fp, vt_write cb) { struct glyph *gl; unsigned int i; for (i = 0; i < VFNT_MAPS; i++) { TAILQ_FOREACH(gl, &glyphs[i], g_list) - if (fwrite(gl->g_data, wbytes * height, 1, fp) != 1) + if (cb(gl->g_data, wbytes * height, 1, fp) != 1) return (1); } return (0); @@ -561,27 +715,21 @@ fold_mappings(unsigned int map_idx) } } -struct file_mapping { - uint32_t source; - uint16_t destination; - uint16_t length; -} __packed; - static int write_mappings(FILE *fp, unsigned int map_idx) { struct mapping_list *ml = &maps[map_idx]; struct mapping *mp; - struct file_mapping fm; + vfnt_map_t fm; unsigned int i = 0, j = 0; TAILQ_FOREACH(mp, ml, m_list) { j++; if (mp->m_length > 0) { i += mp->m_length; - fm.source = htobe32(mp->m_char); - fm.destination = htobe16(mp->m_glyph->g_index); - fm.length = htobe16(mp->m_length - 1); + fm.vfm_src = htobe32(mp->m_char); + fm.vfm_dst = htobe16(mp->m_glyph->g_index); + fm.vfm_len = htobe16(mp->m_length - 1); if (fwrite(&fm, sizeof fm, 1, fp) != 1) return (1); } @@ -590,21 +738,33 @@ write_mappings(FILE *fp, unsigned int map_idx) return (0); } -struct file_header { - uint8_t magic[8]; - uint8_t width; - uint8_t height; - uint16_t pad; - uint32_t glyph_count; - uint32_t map_count[4]; -} __packed; +static int +write_source_mappings(FILE *fp, unsigned int map_idx) +{ + struct mapping_list *ml = &maps[map_idx]; + struct mapping *mp; + unsigned int i = 0, j = 0; + TAILQ_FOREACH(mp, ml, m_list) { + j++; + if (mp->m_length > 0) { + i += mp->m_length; + if (fprintf(fp, "\t{ 0x%08x, 0x%04x, 0x%04x },\n", + mp->m_char, mp->m_glyph->g_index, + mp->m_length - 1) < 0) + return (1); + } + } + assert(i == j); + return (0); +} + static int write_fnt(const char *filename) { FILE *fp; - struct file_header fh = { - .magic = "VFNT0002", + struct font_header fh = { + .fh_magic = FONT_HEADER_MAGIC, }; fp = fopen(filename, "wb"); @@ -613,24 +773,24 @@ write_fnt(const char *filename) return (1); } - fh.width = width; - fh.height = height; - fh.glyph_count = htobe32(glyph_unique); - fh.map_count[0] = htobe32(map_folded_count[0]); - fh.map_count[1] = htobe32(map_folded_count[1]); - fh.map_count[2] = htobe32(map_folded_count[2]); - fh.map_count[3] = htobe32(map_folded_count[3]); - if (fwrite(&fh, sizeof fh, 1, fp) != 1) { + fh.fh_width = width; + fh.fh_height = height; + fh.fh_glyph_count = htobe32(glyph_unique); + fh.fh_map_count[0] = htobe32(map_folded_count[0]); + fh.fh_map_count[1] = htobe32(map_folded_count[1]); + fh.fh_map_count[2] = htobe32(map_folded_count[2]); + fh.fh_map_count[3] = htobe32(map_folded_count[3]); + if (fwrite(&fh, sizeof(fh), 1, fp) != 1) { perror(filename); fclose(fp); return (1); } - if (write_glyphs(fp) != 0 || + if (write_glyphs(fp, &fwrite) != 0 || write_mappings(fp, VFNT_MAP_NORMAL) != 0 || - write_mappings(fp, VFNT_MAP_NORMAL_RH) != 0 || + write_mappings(fp, VFNT_MAP_NORMAL_RIGHT) != 0 || write_mappings(fp, VFNT_MAP_BOLD) != 0 || - write_mappings(fp, VFNT_MAP_BOLD_RH) != 0) { + write_mappings(fp, VFNT_MAP_BOLD_RIGHT) != 0) { perror(filename); fclose(fp); return (1); @@ -640,6 +800,198 @@ write_fnt(const char *filename) return (0); } +static int +write_fnt_source(bool lz4, const char *filename) +{ + FILE *fp; + int rv = 1; + size_t uncompressed_size = wbytes * height * glyph_unique; + size_t compressed_size = uncompressed_size; + uint8_t *compressed = NULL; + + fp = fopen(filename, "w"); + if (fp == NULL) { + perror(filename); + return (1); + } + + if (lz4 == true) { + uncompressed = xmalloc(uncompressed_size); + compressed = xmalloc(uncompressed_size); + } + if (fprintf(fp, "/* Generated %ux%u console font source. */\n\n", + width, height) < 0) + goto done; + if (fprintf(fp, "#include \n") < 0) + goto done; + if (fprintf(fp, "#include \n") < 0) + goto done; + if (fprintf(fp, "#include \n\n") < 0) + goto done; + + /* Write font bytes. */ + if (fprintf(fp, "static uint8_t FONTDATA_%ux%u[] = {\n", + width, height) < 0) + goto done; + if (lz4 == true) { + if (write_glyphs(fp, &write_glyph_buf) != 0) + goto done; + compressed_size = lz4_compress(uncompressed, compressed, + uncompressed_size, compressed_size, 0); + if (write_glyph_source(compressed, compressed_size, 1, fp) != 1) + goto done; + free(uncompressed); + free(compressed); + } else { + if (write_glyphs(fp, &write_glyph_source) != 0) + goto done; + } + if (fprintf(fp, "};\n\n") < 0) + goto done; + + /* Write font maps. */ + if (!TAILQ_EMPTY(&maps[VFNT_MAP_NORMAL])) { + if (fprintf(fp, "static vfnt_map_t " + "FONTMAP_NORMAL_%ux%u[] = {\n", width, height) < 0) + goto done; + if (write_source_mappings(fp, VFNT_MAP_NORMAL) != 0) + goto done; + if (fprintf(fp, "};\n\n") < 0) + goto done; + } + if (!TAILQ_EMPTY(&maps[VFNT_MAP_NORMAL_RIGHT])) { + if (fprintf(fp, "static vfnt_map_t " + "FONTMAP_NORMAL_RH_%ux%u[] = {\n", width, height) < 0) + goto done; + if (write_source_mappings(fp, VFNT_MAP_NORMAL_RIGHT) != 0) + goto done; + if (fprintf(fp, "};\n\n") < 0) + goto done; + } + if (!TAILQ_EMPTY(&maps[VFNT_MAP_BOLD])) { + if (fprintf(fp, "static vfnt_map_t " + "FONTMAP_BOLD_%ux%u[] = {\n", width, height) < 0) + goto done; + if (write_source_mappings(fp, VFNT_MAP_BOLD) != 0) + goto done; + if (fprintf(fp, "};\n\n") < 0) + goto done; + } + if (!TAILQ_EMPTY(&maps[VFNT_MAP_BOLD_RIGHT])) { + if (fprintf(fp, "static vfnt_map_t " + "FONTMAP_BOLD_RH_%ux%u[] = {\n", width, height) < 0) + goto done; + if (write_source_mappings(fp, VFNT_MAP_BOLD_RIGHT) != 0) + goto done; + if (fprintf(fp, "};\n\n") < 0) + goto done; + } + + /* Write struct font. */ + if (fprintf(fp, "struct vt_font font_%ux%u = {\n", + width, height) < 0) + goto done; + if (fprintf(fp, "\t.vf_map\t= {\n") < 0) + goto done; + if (TAILQ_EMPTY(&maps[VFNT_MAP_NORMAL])) { + if (fprintf(fp, "\t\t\tNULL,\n") < 0) + goto done; + } else { + if (fprintf(fp, "\t\t\tFONTMAP_NORMAL_%ux%u,\n", + width, height) < 0) + goto done; + } + if (TAILQ_EMPTY(&maps[VFNT_MAP_NORMAL_RIGHT])) { + if (fprintf(fp, "\t\t\tNULL,\n") < 0) + goto done; + } else { + if (fprintf(fp, "\t\t\tFONTMAP_NORMAL_RH_%ux%u,\n", + width, height) < 0) + goto done; + } + if (TAILQ_EMPTY(&maps[VFNT_MAP_BOLD])) { + if (fprintf(fp, "\t\t\tNULL,\n") < 0) + goto done; + } else { + if (fprintf(fp, "\t\t\tFONTMAP_BOLD_%ux%u,\n", + width, height) < 0) + goto done; + } + if (TAILQ_EMPTY(&maps[VFNT_MAP_BOLD_RIGHT])) { + if (fprintf(fp, "\t\t\tNULL\n") < 0) + goto done; + } else { + if (fprintf(fp, "\t\t\tFONTMAP_BOLD_RH_%ux%u\n", + width, height) < 0) + goto done; + } + if (fprintf(fp, "\t\t},\n") < 0) + goto done; + if (lz4 == true) { + if (fprintf(fp, "\t.vf_bytes\t= NULL,\n") < 0) + goto done; + } else { + if (fprintf(fp, "\t.vf_bytes\t= FONTDATA_%ux%u,\n", + width, height) < 0) { + goto done; + } + } + if (fprintf(fp, "\t.vf_width\t= %u,\n", width) < 0) + goto done; + if (fprintf(fp, "\t.vf_height\t= %u,\n", height) < 0) + goto done; + if (fprintf(fp, "\t.vf_map_count\t= { %u, %u, %u, %u }\n", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jun 14 08:33:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED7463339E8 for ; Sun, 14 Jun 2020 08:33:10 +0000 (UTC) (envelope-from info@hwinfotech.net) Received: from dsf.hwinfotech.net (dsf.hwinfotech.net [192.99.237.18]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49l75L1xyKz47M9 for ; Sun, 14 Jun 2020 08:33:10 +0000 (UTC) (envelope-from info@hwinfotech.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=dkim; d=hwinfotech.net; h=Message-ID:Date:Subject:From:Reply-To:To:MIME-Version:Content-Type:List-Unsubscribe:List-Id; i=info@hwinfotech.net; bh=6xttWavITWCZKxSS6/7aO7GVMJY=; b=bI6i46Uz6YEk9NfQWjwhgLOpLpuqJUEEE7cYgtMavBRPseS3tpylyw+ffzA/Liu3Uy4zELmkqQFD Cjzua/+gcNhrGPxnvMBhN0Hz5EVmAy9aE+4ZOPGaF8ycp/U/nAmIVtomR5LY03NcjYHcjF7Yr3lL trFY++ngRidJhFbV6O0= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=dkim; d=hwinfotech.net; b=c2GImj8+eJ5mk3zUb8iFYVJ+bwF8kU/UUicZMahgNA8OPxMlDt1y/ZlpZvw5RqAqhNDrPMtYn4Vk 1sK1HCuADlqRo3IAimG5+Uf4Vqcjlgy/5Qw/cWB/lYrYfOV+psGxWSEAu62crQTRPtfavem01Yle KZWpLoO7NZPvJK5kmiE=; Message-ID: Date: Sun, 14 Jun 2020 08:33:08 +0000 Subject: Website and Mobile App Development From: HW Infotech Reply-To: HW Infotech To: "svn-src-all@freebsd.org" MIME-Version: 1.0 X-Sender: info@hwinfotech.net X-Report-Abuse: Please report abuse for this campaign here: http://app.hwinfotech.net/index.php/campaigns/ok072mq8cc88f/report-abuse/dd296hm0jzd67/kg077r6gsc60e X-Receiver: svn-src-all@freebsd.org X-Fxyn-Tracking-Did: 0 X-Fxyn-Subscriber-Uid: kg077r6gsc60e X-Fxyn-Mailer: SwiftMailer - 5.4.x X-Fxyn-EBS: http://app.hwinfotech.net/index.php/lists/block-address X-Fxyn-Delivery-Sid: 3 X-Fxyn-Customer-Uid: pp359780cbfd3 X-Fxyn-Customer-Gid: 0 X-Fxyn-Campaign-Uid: ok072mq8cc88f Precedence: bulk Feedback-ID: ok072mq8cc88f:kg077r6gsc60e:dd296hm0jzd67:pp359780cbfd3 X-Rspamd-Queue-Id: 49l75L1xyKz47M9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hwinfotech.net header.s=dkim header.b=bI6i46Uz; dmarc=pass (policy=none) header.from=hwinfotech.net; spf=pass (mx1.freebsd.org: domain of info@hwinfotech.net designates 192.99.237.18 as permitted sender) smtp.mailfrom=info@hwinfotech.net X-Spamd-Result: default: False [-4.22 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[info@hwinfotech.net]; R_DKIM_ALLOW(-0.20)[hwinfotech.net:s=dkim]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:192.99.237.18:c]; PRECEDENCE_BULK(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.972]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MANY_INVISIBLE_PARTS(0.05)[1]; NEURAL_HAM_MEDIUM(-0.93)[-0.928]; DKIM_TRACE(0.00)[hwinfotech.net:+]; DMARC_POLICY_ALLOW(-0.50)[hwinfotech.net,none]; NEURAL_HAM_SHORT(-1.36)[-1.360]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:16276, ipnet:192.99.0.0/16, country:FR]; MID_RHS_MATCH_FROM(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 08:33:11 -0000 We have =E2=9C=85 500+ clone ScriptHi, I am Waseem From HW Infotech. = =C2=A0 Please share your phone number or Skype id, Whatsapp if you are = looking to develop a clone of any website. Work in the following area := =E2=9C=85 Clone Script for any Website and Mobile APP -Development and= Digital Marketing for App, Web, Software Clone Scripts =E2=9C=85Readym= ade Script for useful product -Shop Website Templates, Clone Scripts, & M= arketplace Software | HW Infotech =E2=9C=85Software Requirement Specifica= tion Documentation =E2=9C=85A wireframe design for Website, ERP, Product = &Mobile app =E2=9C=85PHP Framework & MYSQL, HTML5, CSS3, JavaScript, jQue= ry, XML, JSON. =E2=9C=85eCommerce, WordPress,Magento,Open Cart, Joomla, M= agento 2, Prestashop =E2=9C=85Mobile APP- Android, IOS, Phone Gap and F= lutter =E2=9C=85SEO, SMO, and PPC =E2=9C=85Install and config the proje= ct =E2=9C=85Plugin: Customize and create a new plugin =E2=9C=85Migrate = & Upgrade: sustainable development and long-term =E2=9C=85WHM Panel serve= r configuration =E2=9C=85Server Optimization =E2=9C=85Website and Serve= r Penetration testing =E2=9C=85Load Balancing and Failover clustering Ser= ver =E2=9C=85Mail Server configuration for bulk emailing Contact us - H= ire A Developer | Web and App Development Services | HW Infotech Regard= s Waseem www.hwinfotech.com=C2=A0=C2=A0Gurugram | California |London|Va= ncouver|Abuja | Melbourne http://app.hwinfotech.net/index.php/lists/dd2= 96hm0jzd67/unsubscribe/kg077r6gsc60e/ok072mq8cc88f From owner-svn-src-all@freebsd.org Sun Jun 14 09:50:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6870334CF1; Sun, 14 Jun 2020 09:50:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l8p148Wbz4BhW; Sun, 14 Jun 2020 09:50:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 854C6A8C4; Sun, 14 Jun 2020 09:50:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05E9o19t020576; Sun, 14 Jun 2020 09:50:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05E9o0he020572; Sun, 14 Jun 2020 09:50:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006140950.05E9o0he020572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jun 2020 09:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362173 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 09:50:01 -0000 Author: tuexen Date: Sun Jun 14 09:50:00 2020 New Revision: 362173 URL: https://svnweb.freebsd.org/changeset/base/362173 Log: Cleanups, no functional change. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Jun 14 06:58:58 2020 (r362172) +++ head/sys/netinet/sctp_indata.c Sun Jun 14 09:50:00 2020 (r362173) @@ -66,7 +66,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co struct sctp_stream_in *strm, struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_tmit_chunk *chk, int lock_held); + struct sctp_tmit_chunk *chk, int hold_rlock); void Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jun 14 06:58:58 2020 (r362172) +++ head/sys/netinet/sctp_output.c Sun Jun 14 09:50:00 2020 (r362173) @@ -5118,7 +5118,6 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_ } } return (op_err); - break; } default: /* Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Sun Jun 14 06:58:58 2020 (r362172) +++ head/sys/netinet/sctp_ss_functions.c Sun Jun 14 09:50:00 2020 (r362173) @@ -767,8 +767,8 @@ sctp_ss_fb_scheduled(struct sctp_tcb *stcb, struct sct */ static void sctp_ss_fcfs_add(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, - int holds_lock); + struct sctp_stream_out *strq SCTP_UNUSED, + struct sctp_stream_queue_pending *sp, int holds_lock); static void sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_association *asoc, Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jun 14 06:58:58 2020 (r362172) +++ head/sys/netinet/sctputil.c Sun Jun 14 09:50:00 2020 (r362173) @@ -5230,10 +5230,6 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct soc if (((struct sockaddr_in *)addr)->sin_addr.s_addr == laddr->ifa->address.sin.sin_addr.s_addr) { /* found him. */ - if (holds_lock == 0) { - SCTP_INP_RUNLOCK(inp); - } - return (laddr->ifa); break; } } @@ -5243,10 +5239,6 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct soc if (SCTP6_ARE_ADDR_EQUAL((struct sockaddr_in6 *)addr, &laddr->ifa->address.sin6)) { /* found him. */ - if (holds_lock == 0) { - SCTP_INP_RUNLOCK(inp); - } - return (laddr->ifa); break; } } @@ -5255,7 +5247,7 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct soc if (holds_lock == 0) { SCTP_INP_RUNLOCK(inp); } - return (NULL); + return (laddr->ifa); } uint32_t @@ -5332,9 +5324,6 @@ sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t if (((struct sockaddr_in *)addr)->sin_addr.s_addr == sctp_ifap->address.sin.sin_addr.s_addr) { /* found him. */ - if (holds_lock == 0) - SCTP_IPI_ADDR_RUNLOCK(); - return (sctp_ifap); break; } } @@ -5344,9 +5333,6 @@ sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t if (SCTP6_ARE_ADDR_EQUAL((struct sockaddr_in6 *)addr, &sctp_ifap->address.sin6)) { /* found him. */ - if (holds_lock == 0) - SCTP_IPI_ADDR_RUNLOCK(); - return (sctp_ifap); break; } } @@ -5354,7 +5340,7 @@ sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t } if (holds_lock == 0) SCTP_IPI_ADDR_RUNLOCK(); - return (NULL); + return (sctp_ifap); } static void @@ -6930,7 +6916,7 @@ sctp_local_addr_count(struct sctp_tcb *stcb) #if defined(INET) int ipv4_local_scope, ipv4_addr_legal; #endif -#if defined (INET6) +#if defined(INET6) int local_scope, site_scope, ipv6_addr_legal; #endif struct sctp_vrf *vrf; From owner-svn-src-all@freebsd.org Sun Jun 14 10:13:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7880C33554F; Sun, 14 Jun 2020 10:13:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49l9KK2hmPz4CW6; Sun, 14 Jun 2020 10:13:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57C12ABDF; Sun, 14 Jun 2020 10:13:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EADf10038770; Sun, 14 Jun 2020 10:13:41 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EADfX1038769; Sun, 14 Jun 2020 10:13:41 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006141013.05EADfX1038769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 14 Jun 2020 10:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362174 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 362174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 10:13:41 -0000 Author: tsoome Date: Sun Jun 14 10:13:40 2020 New Revision: 362174 URL: https://svnweb.freebsd.org/changeset/base/362174 Log: loader.efi: update console after gfx mode change The gfx mode change should be coordinated with console setup. Modified: head/stand/efi/loader/framebuffer.c Modified: head/stand/efi/loader/framebuffer.c ============================================================================== --- head/stand/efi/loader/framebuffer.c Sun Jun 14 09:50:00 2020 (r362173) +++ head/stand/efi/loader/framebuffer.c Sun Jun 14 10:13:40 2020 (r362174) @@ -586,6 +586,7 @@ gop_autoresize(EFI_GRAPHICS_OUTPUT *gop) mode, EFI_ERROR_CODE(status)); return (CMD_ERROR); } + (void) efi_cons_update_mode(); } return (CMD_OK); } @@ -610,6 +611,7 @@ text_autoresize() } if (max_dim > 0) conout->SetMode(conout, best_mode); + (void) efi_cons_update_mode(); return (CMD_OK); } @@ -697,6 +699,7 @@ command_gop(int argc, char *argv[]) argv[0], mode, EFI_ERROR_CODE(status)); return (CMD_ERROR); } + (void) efi_cons_update_mode(); } else if (!strcmp(argv[1], "get")) { if (argc != 2) goto usage; From owner-svn-src-all@freebsd.org Sun Jun 14 11:41:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D49F0337259; Sun, 14 Jun 2020 11:41:57 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lCH95NkSz4HKY; Sun, 14 Jun 2020 11:41:57 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B431CBCB4; Sun, 14 Jun 2020 11:41:57 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EBfvRL090634; Sun, 14 Jun 2020 11:41:57 GMT (envelope-from dfr@FreeBSD.org) Received: (from dfr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EBfvBF090633; Sun, 14 Jun 2020 11:41:57 GMT (envelope-from dfr@FreeBSD.org) Message-Id: <202006141141.05EBfvBF090633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dfr set sender to dfr@FreeBSD.org using -f From: Doug Rabson Date: Sun, 14 Jun 2020 11:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362175 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: dfr X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 362175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 11:41:57 -0000 Author: dfr Date: Sun Jun 14 11:41:57 2020 New Revision: 362175 URL: https://svnweb.freebsd.org/changeset/base/362175 Log: Add support for the timecreate attribute This maps to the va_birthtime VFS attribute. Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun Jun 14 10:13:40 2020 (r362174) +++ head/sys/fs/nfs/nfs_commonsubs.c Sun Jun 14 11:41:57 2020 (r362175) @@ -2922,6 +2922,11 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount txdr_nfsv4time(&vap->va_mtime, tl); retnum += NFSX_V4TIME; break; + case NFSATTRBIT_TIMECREATE: + NFSM_BUILD(tl, u_int32_t *, NFSX_V4TIME); + txdr_nfsv4time(&vap->va_birthtime, tl); + retnum += NFSX_V4TIME; + break; case NFSATTRBIT_TIMEMODIFYSET: if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME); From owner-svn-src-all@freebsd.org Sun Jun 14 14:38:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 838EF33C011; Sun, 14 Jun 2020 14:38:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lHC52tGpz4Wl3; Sun, 14 Jun 2020 14:38:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DFF1D9F1; Sun, 14 Jun 2020 14:38:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EEcfRN006907; Sun, 14 Jun 2020 14:38:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EEcfbw006906; Sun, 14 Jun 2020 14:38:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202006141438.05EEcfbw006906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 14 Jun 2020 14:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362176 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 362176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 14:38:41 -0000 Author: trasz Date: Sun Jun 14 14:38:40 2020 New Revision: 362176 URL: https://svnweb.freebsd.org/changeset/base/362176 Log: Make linux(4) warn about unsupported CMSG level/type. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25255 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Jun 14 11:41:57 2020 (r362175) +++ head/sys/compat/linux/linux_socket.c Sun Jun 14 14:38:40 2020 (r362176) @@ -1042,8 +1042,12 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_level = linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level); if (cmsg->cmsg_type == -1 - || cmsg->cmsg_level != SOL_SOCKET) + || cmsg->cmsg_level != SOL_SOCKET) { + linux_msg(curthread, + "unsupported sendmsg cmsg level %d type %d", + linux_cmsg.cmsg_level, linux_cmsg.cmsg_type); goto bad; + } /* * Some applications (e.g. pulseaudio) attempt to @@ -1228,6 +1232,9 @@ linux_recvmsg_common(struct thread *td, l_int s, struc bsd_to_linux_sockopt_level(cm->cmsg_level); if (linux_cmsg->cmsg_type == -1 || cm->cmsg_level != SOL_SOCKET) { + linux_msg(curthread, + "unsupported recvmsg cmsg level %d type %d", + cm->cmsg_level, cm->cmsg_type); error = EINVAL; goto bad; } From owner-svn-src-all@freebsd.org Sun Jun 14 14:57:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AF8533C764; Sun, 14 Jun 2020 14:57:25 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49lHcj0NWdz4Y46; Sun, 14 Jun 2020 14:57:24 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05EEvH44072898; Sun, 14 Jun 2020 07:57:17 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05EEvH2Q072897; Sun, 14 Jun 2020 07:57:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006141457.05EEvH2Q072897@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362170 - in head/cddl/contrib/opensolaris/cmd: dtrace lockstat zdb zfs zpool zstreamdump In-Reply-To: <202006140550.05E5oSKj073645@repo.freebsd.org> To: Gordon Bergling Date: Sun, 14 Jun 2020 07:57:17 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49lHcj0NWdz4Y46 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 14:57:25 -0000 > Author: gbe (doc committer) > Date: Sun Jun 14 05:50:28 2020 > New Revision: 362170 > URL: https://svnweb.freebsd.org/changeset/base/362170 > > Log: > Add HISTORY sections to ZFS and dtrace manpage > > Reviewed by: bcr (mentor) > Approved by: bcr (mentor) > MFC after: 7 days > Differential Revision: https://reviews.freebsd.org/D23833 > > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 > head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 > head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 > head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 > head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Is this really the correct history? Didnt all of these first appear in Solaris? The man page may of first appeared in FreeBSD, but the commands themselves originated some place else? > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 05:35:02 2020 (r362169) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 05:50:28 2020 (r362170) > @@ -20,7 +20,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 30, 2018 > +.Dd February 25, 2020 > .Dt DTRACE 1 > .Os > .Sh NAME > @@ -776,6 +776,11 @@ failed or that the specified request could not be sati > .It 2 > Invalid command line options or arguments were specified. > .El > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 7.1 . > .Sh SEE ALSO > .Xr cpp 1 , > .Xr elf 5 , > > Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 05:35:02 2020 (r362169) > +++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 05:50:28 2020 (r362170) > @@ -21,7 +21,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 29, 2015 > +.Dd February 25, 2020 > .Dt LOCKSTAT 1 > .Os > .Sh NAME > @@ -366,6 +366,11 @@ Count indv cuml rcnt nsec Lock C > .Xr dtrace 1 , > .Xr ksyms 4 , > .Xr locking 9 > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 7.1 . > .Sh NOTES > Tail-call elimination can affect call sites. > For example, if > > Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Jun 14 05:35:02 2020 (r362169) > +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Jun 14 05:50:28 2020 (r362170) > @@ -13,7 +13,7 @@ > .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. > .\" Copyright 2017 Nexenta Systems, Inc. > .\" > -.Dd October 06, 2017 > +.Dd February 25, 2020 > .Dt ZDB 8 > .Os > .Sh NAME > @@ -407,3 +407,8 @@ dedup = 1.11, compress = 1.80, copies = 1.00, dedup * > .Sh SEE ALSO > .Xr zfs 8 , > .Xr zpool 8 > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 7.0 . > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Jun 14 05:35:02 2020 (r362169) > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Jun 14 05:50:28 2020 (r362170) > @@ -3949,6 +3949,11 @@ M F /tank/test/modified > .Xr umount 8 , > .Xr zfs-program 8 , > .Xr zpool 8 > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 7.0 . > .Sh AUTHORS > This manual page is a > .Xr mdoc 7 > > Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 14 05:35:02 2020 (r362169) > +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 14 05:50:28 2020 (r362170) > @@ -29,7 +29,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 7, 2019 > +.Dd February 25, 2020 > .Dt ZPOOL 8 > .Os > .Sh NAME > @@ -2462,6 +2462,11 @@ Discarded approximately 29 seconds of transactions. > .Xr zpool-features 7 , > .Xr zfs 8 , > .Xr zfsd 8 > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 7.0 . > .Sh AUTHORS > This manual page is a > .Xr mdoc 7 > > Modified: head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Sun Jun 14 05:35:02 2020 (r362169) > +++ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Sun Jun 14 05:50:28 2020 (r362170) > @@ -22,7 +22,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 31, 2013 > +.Dd February 25, 2020 > .Dt ZSTREAMDUMP 8 > .Os > .Sh NAME > @@ -52,6 +52,11 @@ Verbose. Dump all headers, not only begin and end head > .El > .Sh SEE ALSO > .Xr zfs 8 > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 7.0 . > .Sh AUTHORS > This manual page is a > .Xr mdoc 7 > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jun 14 16:05:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 327A233E0BC; Sun, 14 Jun 2020 16:05:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lK6s0cB6z4cfY; Sun, 14 Jun 2020 16:05:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D561EEEB; Sun, 14 Jun 2020 16:05:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EG58RI063760; Sun, 14 Jun 2020 16:05:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EG58YA063759; Sun, 14 Jun 2020 16:05:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006141605.05EG58YA063759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jun 2020 16:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362178 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 16:05:09 -0000 Author: tuexen Date: Sun Jun 14 16:05:08 2020 New Revision: 362178 URL: https://svnweb.freebsd.org/changeset/base/362178 Log: Allocate the mbuf for the signature in the COOKIE or the correct size. While there, do also do some cleanups. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jun 14 15:49:32 2020 (r362177) +++ head/sys/netinet/sctp_output.c Sun Jun 14 16:05:08 2020 (r362178) @@ -3831,8 +3831,6 @@ sctp_add_cookie(struct mbuf *init, int init_offset, struct mbuf *copy_init, *copy_initack, *m_at, *sig, *mret; struct sctp_state_cookie *stc; struct sctp_paramhdr *ph; - uint8_t *foo; - int sig_offset; uint16_t cookie_sz; mret = sctp_get_mbuf_for_msg((sizeof(struct sctp_state_cookie) + @@ -3896,24 +3894,20 @@ sctp_add_cookie(struct mbuf *init, int init_offset, break; } } - sig = sctp_get_mbuf_for_msg(SCTP_SECRET_SIZE, 0, M_NOWAIT, 1, MT_DATA); + sig = sctp_get_mbuf_for_msg(SCTP_SIGNATURE_SIZE, 0, M_NOWAIT, 1, MT_DATA); if (sig == NULL) { /* no space, so free the entire chain */ sctp_m_freem(mret); return (NULL); } - SCTP_BUF_LEN(sig) = 0; SCTP_BUF_NEXT(m_at) = sig; - sig_offset = 0; - foo = (uint8_t *)(mtod(sig, caddr_t)+sig_offset); - memset(foo, 0, SCTP_SIGNATURE_SIZE); - *signature = foo; - SCTP_BUF_LEN(sig) += SCTP_SIGNATURE_SIZE; + SCTP_BUF_LEN(sig) = SCTP_SIGNATURE_SIZE; cookie_sz += SCTP_SIGNATURE_SIZE; ph->param_length = htons(cookie_sz); + *signature = (uint8_t *)mtod(sig, caddr_t); + memset(*signature, 0, SCTP_SIGNATURE_SIZE); return (mret); } - static uint8_t sctp_get_ect(struct sctp_tcb *stcb) From owner-svn-src-all@freebsd.org Sun Jun 14 16:47:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D1B033E95B; Sun, 14 Jun 2020 16:47:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lL3T1MGfz4dxF; Sun, 14 Jun 2020 16:47:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29E0CF919; Sun, 14 Jun 2020 16:47:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EGlHSm088238; Sun, 14 Jun 2020 16:47:17 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EGlGUL088235; Sun, 14 Jun 2020 16:47:16 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202006141647.05EGlGUL088235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 14 Jun 2020 16:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362179 - in head/sys/dev: ic scc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys/dev: ic scc X-SVN-Commit-Revision: 362179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 16:47:17 -0000 Author: bdragon Date: Sun Jun 14 16:47:16 2020 New Revision: 362179 URL: https://svnweb.freebsd.org/changeset/base/362179 Log: [PowerPC] Fix scc z8530 driver Parts of the z8530 driver were still using the SUN channel spacing. This was invalid on PowerMac and QEMU, where the attachment was to escc, not escc-legacy. This means the driver has apparently NEVER worked properly on Macintosh hardware. Add documentation for the channel spacing details, and change to using driver-specific initialization instead of hardcoded spacing so either spacing can be used. Fixes boot hang in QEMU when using the serial console, and fixes use on Xserve serial (and presumably PowerMacs that have a Stealth Serial port or similar) Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D24661 Modified: head/sys/dev/ic/z8530.h head/sys/dev/scc/scc_bfe.h head/sys/dev/scc/scc_bfe_macio.c head/sys/dev/scc/scc_dev_z8530.c Modified: head/sys/dev/ic/z8530.h ============================================================================== --- head/sys/dev/ic/z8530.h Sun Jun 14 16:05:08 2020 (r362178) +++ head/sys/dev/ic/z8530.h Sun Jun 14 16:47:16 2020 (r362179) @@ -32,15 +32,14 @@ #define _DEV_IC_Z8530_H_ /* - * Channel B control: 0 - * Channel B data: 1 - * Channel A control: 2 - * Channel A data: 3 + * legacy: SUN compatible + * escc: Macintosh + * legacy escc + * Channel B control: 0 0 + * Channel B data: 1 1 + * Channel A control: 2 16 + * Channel A data: 3 17 */ - -/* The following apply when using a device-scoped bus handle */ -#define CHAN_A 2 -#define CHAN_B 0 #define REG_CTRL 0 #define REG_DATA 1 Modified: head/sys/dev/scc/scc_bfe.h ============================================================================== --- head/sys/dev/scc/scc_bfe.h Sun Jun 14 16:05:08 2020 (r362178) +++ head/sys/dev/scc/scc_bfe.h Sun Jun 14 16:47:16 2020 (r362179) @@ -114,7 +114,8 @@ struct scc_class { extern struct scc_class scc_quicc_class; extern struct scc_class scc_sab82532_class; -extern struct scc_class scc_z8530_class; +extern struct scc_class scc_z8530_escc_class; +extern struct scc_class scc_z8530_legacy_class; struct scc_softc { KOBJ_FIELDS; Modified: head/sys/dev/scc/scc_bfe_macio.c ============================================================================== --- head/sys/dev/scc/scc_bfe_macio.c Sun Jun 14 16:05:08 2020 (r362178) +++ head/sys/dev/scc/scc_bfe_macio.c Sun Jun 14 16:47:16 2020 (r362179) @@ -55,9 +55,10 @@ scc_macio_probe(device_t dev) sc = device_get_softc(dev); nm = ofw_bus_get_name(dev); + /* Attach to modern escc (channel shift 4 bits) */ if (!strcmp(nm, "escc")) { device_set_desc(dev, "Zilog Z8530 dual channel SCC"); - sc->sc_class = &scc_z8530_class; + sc->sc_class = &scc_z8530_escc_class; return (scc_bfe_probe(dev, MACIO_REGSHFT, MACIO_RCLK, 0)); } return (ENXIO); Modified: head/sys/dev/scc/scc_dev_z8530.c ============================================================================== --- head/sys/dev/scc/scc_dev_z8530.c Sun Jun 14 16:05:08 2020 (r362178) +++ head/sys/dev/scc/scc_dev_z8530.c Sun Jun 14 16:47:16 2020 (r362179) @@ -51,6 +51,10 @@ static int z8530_bfe_iclear(struct scc_softc *, struct static int z8530_bfe_ipend(struct scc_softc *); static int z8530_bfe_probe(struct scc_softc *); +/* Channel B is always at 0 offset. */ +#define CHAN_A (-(sc->sc_class->cl_range)) +#define CHAN_B 0 + static kobj_method_t z8530_methods[] = { KOBJMETHOD(scc_attach, z8530_bfe_attach), KOBJMETHOD(scc_iclear, z8530_bfe_iclear), @@ -59,14 +63,32 @@ static kobj_method_t z8530_methods[] = { KOBJMETHOD_END }; -struct scc_class scc_z8530_class = { - "z8530 class", +/* + * escc (macio) spacing. + */ +struct scc_class scc_z8530_escc_class = { + "z8530 escc class", z8530_methods, sizeof(struct scc_softc), .cl_channels = 2, .cl_class = SCC_CLASS_Z8530, .cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC, - .cl_range = CHAN_B - CHAN_A, + /* Negative .cl_range signifies this is channel spacing. */ + .cl_range = (CHAN_B - 16), +}; + +/* + * SUN compatible channel spacing. + */ +struct scc_class scc_z8530_legacy_class = { + "z8530 legacy class", + z8530_methods, + sizeof(struct scc_softc), + .cl_channels = 2, + .cl_class = SCC_CLASS_Z8530, + .cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC, + /* Negative .cl_range signifies this is channel spacing. */ + .cl_range = (CHAN_B - 2), }; /* Multiplexed I/O. */ From owner-svn-src-all@freebsd.org Sun Jun 14 17:36:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFAFC340735; Sun, 14 Jun 2020 17:36:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lM8Z3hglz4hs9; Sun, 14 Jun 2020 17:36:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7944E1021D; Sun, 14 Jun 2020 17:36:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EHakWx019513; Sun, 14 Jun 2020 17:36:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EHainf019500; Sun, 14 Jun 2020 17:36:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202006141736.05EHainf019500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Jun 2020 17:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362180 - in stable/12: contrib/apr contrib/apr-util contrib/apr-util/buckets contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbd/unsupported contrib/apr-util/dbm/sdbm con... X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/12: contrib/apr contrib/apr-util contrib/apr-util/buckets contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbd/unsupported contrib/apr-util/dbm/sdbm contrib/apr-util/include con... X-SVN-Commit-Revision: 362180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 17:36:46 -0000 Author: dim Date: Sun Jun 14 17:36:43 2020 New Revision: 362180 URL: https://svnweb.freebsd.org/changeset/base/362180 Log: Update Subversion and dependencies to 1.14.0 LTS. MFC r344438 (by emaste): svn: support building with WITH_PIE Subversion builds and links against its own .a archives using local rules, so did not benefit from with the WITH_PIE library support added in r344179. Apply the same _pie suffix locally. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D19246 MFC r352156 (by imp): Remove directory empty after r266735 MFC r357299 (by cem): contrib/apr: Remove scope leak UB In apr_vformatter, the variable buf was declared inside a limited scope region, but a pointer to it is leaked outside of that region and used later. This is undefined behavior. Fix by moving the buf variable to function scope. Reported by: Coverity CID: 1192541 MFC r357301 (by cem): contrib/apr: Rip out bogus [CS]PRNG implementation This construction used some relatively slow design involving SHA2; even if it were fed real entropy (unclear; external to the design), it did not handle fork in a safe way, and it was difficult to audit for correctness. So just rip it out and use the very simple and known-correct arc4random(3) interface in its place. MFC r361677: Change Makefiles under usr.bin/svn to make them easier to incrementally update. No functional change intended. MFC r361678: Update apr to 1.7.0. See contrib/apr/CHANGES for a summary of changes. MFC r361681: Change more Makefiles under usr.bin/svn to make them easier to incrementally update. No functional change intended. MFC r361684 (by kevans): apr: build some needed emulated 64-bit atomic bits after r361678 This should fix the build on armv{6,7}, mips, and mips64, which all need emulated 64-bit atomics for apr. MFC r361691: Follow-up r361678 (update apr to 1.7.0) by also regenerating the apr internal headers through the upstream configure script, with some minor custom tweaks. MFC r361692: Update apr-util to 1.6.1. See contrib/apr-util/CHANGES for a summary of changes. MFC r361693: Update Subversion to 1.14.0 LTS. See contrib/subversion/CHANGES for a summary of changes, or for a more thorough overview: https://subversion.apache.org/docs/release-notes/1.14 NOTE: there is no need to dump and reload repositories, and the working copy format is still the same as Subversion 1.8 through 1.13. Relnotes: yes Added: stable/12/contrib/apr-util/CMakeLists.txt - copied unchanged from r361692, head/contrib/apr-util/CMakeLists.txt stable/12/contrib/apr-util/README.FREETDS - copied unchanged from r361692, head/contrib/apr-util/README.FREETDS stable/12/contrib/apr-util/README.cmake - copied unchanged from r361692, head/contrib/apr-util/README.cmake stable/12/contrib/apr-util/crypto/apr_crypto_commoncrypto.c - copied unchanged from r361692, head/contrib/apr-util/crypto/apr_crypto_commoncrypto.c stable/12/contrib/apr-util/crypto/apr_siphash.c - copied unchanged from r361692, head/contrib/apr-util/crypto/apr_siphash.c stable/12/contrib/apr-util/dbd/unsupported/ - copied from r361692, head/contrib/apr-util/dbd/unsupported/ stable/12/contrib/apr-util/include/apr_ldap.hwc - copied unchanged from r361692, head/contrib/apr-util/include/apr_ldap.hwc stable/12/contrib/apr-util/include/apr_redis.h - copied unchanged from r361692, head/contrib/apr-util/include/apr_redis.h stable/12/contrib/apr-util/include/apr_siphash.h - copied unchanged from r361692, head/contrib/apr-util/include/apr_siphash.h stable/12/contrib/apr-util/include/apu.hwc - copied unchanged from r361692, head/contrib/apr-util/include/apu.hwc stable/12/contrib/apr-util/redis/ - copied from r361692, head/contrib/apr-util/redis/ stable/12/contrib/apr-util/test/testredis.c - copied unchanged from r361692, head/contrib/apr-util/test/testredis.c stable/12/contrib/apr-util/test/testsiphash.c - copied unchanged from r361692, head/contrib/apr-util/test/testsiphash.c stable/12/contrib/apr/atomic/unix/builtins64.c - copied unchanged from r361678, head/contrib/apr/atomic/unix/builtins64.c stable/12/contrib/apr/atomic/unix/mutex64.c - copied unchanged from r361678, head/contrib/apr/atomic/unix/mutex64.c stable/12/contrib/apr/encoding/apr_encode.c - copied unchanged from r361678, head/contrib/apr/encoding/apr_encode.c stable/12/contrib/apr/include/apr_cstr.h - copied unchanged from r361678, head/contrib/apr/include/apr_cstr.h stable/12/contrib/apr/include/apr_encode.h - copied unchanged from r361678, head/contrib/apr/include/apr_encode.h stable/12/contrib/apr/include/apr_perms_set.h - copied unchanged from r361678, head/contrib/apr/include/apr_perms_set.h stable/12/contrib/apr/poll/unix/wakeup.c - copied unchanged from r361678, head/contrib/apr/poll/unix/wakeup.c stable/12/contrib/apr/strings/apr_cstr.c - copied unchanged from r361678, head/contrib/apr/strings/apr_cstr.c stable/12/contrib/subversion/.swig_pl_checked - copied unchanged from r361693, head/contrib/subversion/.swig_pl_checked stable/12/contrib/subversion/.swig_py_checked - copied unchanged from r361693, head/contrib/subversion/.swig_py_checked stable/12/contrib/subversion/.swig_rb_checked - copied unchanged from r361693, head/contrib/subversion/.swig_rb_checked stable/12/contrib/subversion/subversion/include/private/svn_client_shelf.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/private/svn_client_shelf.h stable/12/contrib/subversion/subversion/include/private/svn_client_shelf2.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/private/svn_client_shelf2.h stable/12/contrib/subversion/subversion/include/private/svn_dirent_uri_private.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/private/svn_dirent_uri_private.h stable/12/contrib/subversion/subversion/include/svn_opt_impl.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/svn_opt_impl.h stable/12/contrib/subversion/subversion/include/svn_types_impl.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/svn_types_impl.h stable/12/contrib/subversion/subversion/libsvn_client/layout.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/layout.c stable/12/contrib/subversion/subversion/libsvn_client/shelf.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/shelf.c stable/12/contrib/subversion/subversion/libsvn_client/shelf2.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/shelf2.c stable/12/contrib/subversion/subversion/libsvn_client/wc_editor.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/wc_editor.c stable/12/contrib/subversion/subversion/libsvn_repos/dump_editor.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_repos/dump_editor.c stable/12/contrib/subversion/subversion/svn/filesize.c - copied unchanged from r361693, head/contrib/subversion/subversion/svn/filesize.c stable/12/contrib/subversion/subversion/svn/shelf-cmd.c - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf-cmd.c stable/12/contrib/subversion/subversion/svn/shelf-cmd.h - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf-cmd.h stable/12/contrib/subversion/subversion/svn/shelf2-cmd.c - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf2-cmd.c stable/12/contrib/subversion/subversion/svn/shelf2-cmd.h - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf2-cmd.h stable/12/usr.bin/svn/lib/libapr/apr_escape_test_char.h - copied unchanged from r361678, head/usr.bin/svn/lib/libapr/apr_escape_test_char.h Replaced: stable/12/contrib/apr/include/private/ - copied from r361678, head/contrib/apr/include/private/ Deleted: stable/12/contrib/apr-util/dbd/NWGNUdbdfreetds stable/12/contrib/apr-util/dbd/apr_dbd_freetds.c stable/12/contrib/subversion/doc/programmer/gtest-guide.txt stable/12/contrib/subversion/subversion/libsvn_client/copy_foreign.c stable/12/contrib/subversion/subversion/libsvn_client/shelve.c stable/12/contrib/subversion/subversion/svn/shelve-cmd.c Modified: stable/12/contrib/apr-util/CHANGES stable/12/contrib/apr-util/LICENSE stable/12/contrib/apr-util/Makefile.in stable/12/contrib/apr-util/Makefile.win stable/12/contrib/apr-util/NOTICE stable/12/contrib/apr-util/NWGNUmakefile stable/12/contrib/apr-util/README stable/12/contrib/apr-util/apr-util.spec stable/12/contrib/apr-util/aprutil.dsw stable/12/contrib/apr-util/apu-config.in stable/12/contrib/apr-util/buckets/apr_buckets_alloc.c stable/12/contrib/apr-util/buckets/apr_buckets_file.c stable/12/contrib/apr-util/build-outputs.mk stable/12/contrib/apr-util/build.conf stable/12/contrib/apr-util/buildconf stable/12/contrib/apr-util/configure stable/12/contrib/apr-util/configure.in stable/12/contrib/apr-util/crypto/apr_crypto.c stable/12/contrib/apr-util/crypto/apr_crypto_nss.c stable/12/contrib/apr-util/crypto/apr_crypto_openssl.c stable/12/contrib/apr-util/crypto/crypt_blowfish.c stable/12/contrib/apr-util/dbd/NWGNUmakefile stable/12/contrib/apr-util/dbd/apr_dbd.c stable/12/contrib/apr-util/dbm/sdbm/sdbm.c stable/12/contrib/apr-util/dbm/sdbm/sdbm_pair.c stable/12/contrib/apr-util/include/apr_buckets.h stable/12/contrib/apr-util/include/apr_crypto.h stable/12/contrib/apr-util/include/apr_dbd.h stable/12/contrib/apr-util/include/apr_xml.h stable/12/contrib/apr-util/include/apu.h.in stable/12/contrib/apr-util/include/apu.hnw stable/12/contrib/apr-util/include/apu.hw stable/12/contrib/apr-util/include/apu_version.h stable/12/contrib/apr-util/include/private/apr_crypto_internal.h stable/12/contrib/apr-util/include/private/apu_config.h.in stable/12/contrib/apr-util/memcache/apr_memcache.c stable/12/contrib/apr-util/test/Makefile.in stable/12/contrib/apr-util/test/Makefile.win stable/12/contrib/apr-util/test/NWGNUaputest stable/12/contrib/apr-util/test/abts_tests.h stable/12/contrib/apr-util/test/testall.dsw stable/12/contrib/apr-util/test/testcrypto.c stable/12/contrib/apr-util/test/testutil.h stable/12/contrib/apr-util/xml/apr_xml.c stable/12/contrib/apr/CHANGES stable/12/contrib/apr/CMakeLists.txt stable/12/contrib/apr/Makefile.in stable/12/contrib/apr/Makefile.win stable/12/contrib/apr/NOTICE stable/12/contrib/apr/NWGNUmakefile stable/12/contrib/apr/apr.dsp stable/12/contrib/apr/apr.mak stable/12/contrib/apr/apr.spec stable/12/contrib/apr/atomic/unix/ia32.c stable/12/contrib/apr/atomic/unix/mutex.c stable/12/contrib/apr/atomic/unix/ppc.c stable/12/contrib/apr/atomic/unix/s390.c stable/12/contrib/apr/atomic/unix/solaris.c stable/12/contrib/apr/build-outputs.mk stable/12/contrib/apr/buildconf stable/12/contrib/apr/config.layout stable/12/contrib/apr/configure stable/12/contrib/apr/configure.in stable/12/contrib/apr/docs/APRDesign.html stable/12/contrib/apr/docs/canonical_filenames.html stable/12/contrib/apr/docs/incomplete_types stable/12/contrib/apr/docs/pool-design.html stable/12/contrib/apr/encoding/apr_escape.c stable/12/contrib/apr/file_io/unix/copy.c stable/12/contrib/apr/file_io/unix/dir.c stable/12/contrib/apr/file_io/unix/flock.c stable/12/contrib/apr/file_io/unix/pipe.c stable/12/contrib/apr/file_io/unix/readwrite.c stable/12/contrib/apr/file_io/unix/seek.c stable/12/contrib/apr/include/apr.h.in stable/12/contrib/apr/include/apr.hnw stable/12/contrib/apr/include/apr.hw stable/12/contrib/apr/include/apr.hwc stable/12/contrib/apr/include/apr_allocator.h stable/12/contrib/apr/include/apr_atomic.h stable/12/contrib/apr/include/apr_errno.h stable/12/contrib/apr/include/apr_escape.h stable/12/contrib/apr/include/apr_file_info.h stable/12/contrib/apr/include/apr_file_io.h stable/12/contrib/apr/include/apr_general.h stable/12/contrib/apr/include/apr_global_mutex.h stable/12/contrib/apr/include/apr_hash.h stable/12/contrib/apr/include/apr_network_io.h stable/12/contrib/apr/include/apr_poll.h stable/12/contrib/apr/include/apr_portable.h stable/12/contrib/apr/include/apr_proc_mutex.h stable/12/contrib/apr/include/apr_shm.h stable/12/contrib/apr/include/apr_skiplist.h stable/12/contrib/apr/include/apr_strings.h stable/12/contrib/apr/include/apr_tables.h stable/12/contrib/apr/include/apr_thread_mutex.h stable/12/contrib/apr/include/apr_thread_proc.h stable/12/contrib/apr/include/apr_time.h stable/12/contrib/apr/include/apr_version.h stable/12/contrib/apr/include/arch/unix/apr_arch_atomic.h stable/12/contrib/apr/include/arch/unix/apr_arch_networkio.h stable/12/contrib/apr/include/arch/unix/apr_arch_poll_private.h stable/12/contrib/apr/include/arch/unix/apr_arch_proc_mutex.h stable/12/contrib/apr/include/arch/unix/apr_arch_shm.h stable/12/contrib/apr/include/arch/unix/apr_arch_thread_mutex.h stable/12/contrib/apr/include/arch/unix/apr_arch_threadproc.h stable/12/contrib/apr/include/arch/unix/apr_private.h.in stable/12/contrib/apr/libapr.dsp stable/12/contrib/apr/libapr.mak stable/12/contrib/apr/locks/unix/global_mutex.c stable/12/contrib/apr/locks/unix/proc_mutex.c stable/12/contrib/apr/locks/unix/thread_cond.c stable/12/contrib/apr/locks/unix/thread_mutex.c stable/12/contrib/apr/memory/unix/apr_pools.c stable/12/contrib/apr/misc/unix/errorcodes.c stable/12/contrib/apr/misc/unix/rand.c stable/12/contrib/apr/network_io/unix/multicast.c stable/12/contrib/apr/network_io/unix/sockaddr.c stable/12/contrib/apr/network_io/unix/sockets.c stable/12/contrib/apr/network_io/unix/sockopt.c stable/12/contrib/apr/poll/unix/epoll.c stable/12/contrib/apr/poll/unix/kqueue.c stable/12/contrib/apr/poll/unix/poll.c stable/12/contrib/apr/poll/unix/pollcb.c stable/12/contrib/apr/poll/unix/pollset.c stable/12/contrib/apr/poll/unix/port.c stable/12/contrib/apr/poll/unix/select.c stable/12/contrib/apr/poll/unix/z_asio.c stable/12/contrib/apr/random/unix/apr_random.c stable/12/contrib/apr/shmem/unix/shm.c stable/12/contrib/apr/strings/apr_cpystrn.c stable/12/contrib/apr/strings/apr_fnmatch.c stable/12/contrib/apr/strings/apr_snprintf.c stable/12/contrib/apr/tables/apr_skiplist.c stable/12/contrib/apr/tables/apr_tables.c stable/12/contrib/apr/threadproc/unix/proc.c stable/12/contrib/apr/threadproc/unix/signals.c stable/12/contrib/apr/tools/gen_test_char.c stable/12/contrib/subversion/.editorconfig stable/12/contrib/subversion/CHANGES stable/12/contrib/subversion/COMMITTERS stable/12/contrib/subversion/INSTALL stable/12/contrib/subversion/LICENSE stable/12/contrib/subversion/Makefile.in stable/12/contrib/subversion/NOTICE stable/12/contrib/subversion/aclocal.m4 stable/12/contrib/subversion/autogen.sh stable/12/contrib/subversion/build-outputs.mk stable/12/contrib/subversion/build.conf stable/12/contrib/subversion/configure stable/12/contrib/subversion/configure.ac stable/12/contrib/subversion/doc/doxygen.conf stable/12/contrib/subversion/doc/user/svn-best-practices.html stable/12/contrib/subversion/gen-make.py stable/12/contrib/subversion/get-deps.sh stable/12/contrib/subversion/subversion/include/private/svn_branch.h stable/12/contrib/subversion/subversion/include/private/svn_client_mtcc.h stable/12/contrib/subversion/subversion/include/private/svn_client_private.h stable/12/contrib/subversion/subversion/include/private/svn_dep_compat.h stable/12/contrib/subversion/subversion/include/private/svn_diff_tree.h stable/12/contrib/subversion/subversion/include/private/svn_element.h stable/12/contrib/subversion/subversion/include/private/svn_fs_fs_private.h stable/12/contrib/subversion/subversion/include/private/svn_repos_private.h stable/12/contrib/subversion/subversion/include/private/svn_sorts_private.h stable/12/contrib/subversion/subversion/include/private/svn_subr_private.h stable/12/contrib/subversion/subversion/include/private/svn_wc_private.h stable/12/contrib/subversion/subversion/include/svn_client.h stable/12/contrib/subversion/subversion/include/svn_config.h stable/12/contrib/subversion/subversion/include/svn_delta.h stable/12/contrib/subversion/subversion/include/svn_diff.h stable/12/contrib/subversion/subversion/include/svn_dirent_uri.h stable/12/contrib/subversion/subversion/include/svn_error_codes.h stable/12/contrib/subversion/subversion/include/svn_fs.h stable/12/contrib/subversion/subversion/include/svn_opt.h stable/12/contrib/subversion/subversion/include/svn_props.h stable/12/contrib/subversion/subversion/include/svn_ra.h stable/12/contrib/subversion/subversion/include/svn_ra_svn.h stable/12/contrib/subversion/subversion/include/svn_repos.h stable/12/contrib/subversion/subversion/include/svn_time.h stable/12/contrib/subversion/subversion/include/svn_types.h stable/12/contrib/subversion/subversion/include/svn_utf.h stable/12/contrib/subversion/subversion/include/svn_version.h stable/12/contrib/subversion/subversion/include/svn_wc.h stable/12/contrib/subversion/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c stable/12/contrib/subversion/subversion/libsvn_auth_gnome_keyring/libsvn_auth_gnome_keyring.pc.in stable/12/contrib/subversion/subversion/libsvn_auth_kwallet/kwallet.cpp stable/12/contrib/subversion/subversion/libsvn_auth_kwallet/libsvn_auth_kwallet.pc.in stable/12/contrib/subversion/subversion/libsvn_client/add.c stable/12/contrib/subversion/subversion/libsvn_client/blame.c stable/12/contrib/subversion/subversion/libsvn_client/client.h stable/12/contrib/subversion/subversion/libsvn_client/commit.c stable/12/contrib/subversion/subversion/libsvn_client/commit_util.c stable/12/contrib/subversion/subversion/libsvn_client/conflicts.c stable/12/contrib/subversion/subversion/libsvn_client/copy.c stable/12/contrib/subversion/subversion/libsvn_client/delete.c stable/12/contrib/subversion/subversion/libsvn_client/deprecated.c stable/12/contrib/subversion/subversion/libsvn_client/diff.c stable/12/contrib/subversion/subversion/libsvn_client/diff_local.c stable/12/contrib/subversion/subversion/libsvn_client/diff_summarize.c stable/12/contrib/subversion/subversion/libsvn_client/export.c stable/12/contrib/subversion/subversion/libsvn_client/info.c stable/12/contrib/subversion/subversion/libsvn_client/libsvn_client.pc.in stable/12/contrib/subversion/subversion/libsvn_client/list.c stable/12/contrib/subversion/subversion/libsvn_client/merge.c stable/12/contrib/subversion/subversion/libsvn_client/mtcc.c stable/12/contrib/subversion/subversion/libsvn_client/patch.c stable/12/contrib/subversion/subversion/libsvn_client/ra.c stable/12/contrib/subversion/subversion/libsvn_client/repos_diff.c stable/12/contrib/subversion/subversion/libsvn_client/revert.c stable/12/contrib/subversion/subversion/libsvn_client/revisions.c stable/12/contrib/subversion/subversion/libsvn_client/status.c stable/12/contrib/subversion/subversion/libsvn_client/update.c stable/12/contrib/subversion/subversion/libsvn_client/upgrade.c stable/12/contrib/subversion/subversion/libsvn_client/util.c stable/12/contrib/subversion/subversion/libsvn_delta/branch.c stable/12/contrib/subversion/subversion/libsvn_delta/branch_compat.c stable/12/contrib/subversion/subversion/libsvn_delta/compat.c stable/12/contrib/subversion/subversion/libsvn_delta/debug_editor.c stable/12/contrib/subversion/subversion/libsvn_delta/deprecated.c stable/12/contrib/subversion/subversion/libsvn_delta/element.c stable/12/contrib/subversion/subversion/libsvn_delta/libsvn_delta.pc.in stable/12/contrib/subversion/subversion/libsvn_delta/path_driver.c stable/12/contrib/subversion/subversion/libsvn_diff/diff_file.c stable/12/contrib/subversion/subversion/libsvn_diff/diff_tree.c stable/12/contrib/subversion/subversion/libsvn_diff/libsvn_diff.pc.in stable/12/contrib/subversion/subversion/libsvn_diff/parse-diff.c stable/12/contrib/subversion/subversion/libsvn_fs/fs-loader.c stable/12/contrib/subversion/subversion/libsvn_fs/fs-loader.h stable/12/contrib/subversion/subversion/libsvn_fs/libsvn_fs.pc.in stable/12/contrib/subversion/subversion/libsvn_fs_base/fs.c stable/12/contrib/subversion/subversion/libsvn_fs_base/libsvn_fs_base.pc.in stable/12/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h stable/12/contrib/subversion/subversion/libsvn_fs_fs/dag.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/dump-index.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.h stable/12/contrib/subversion/subversion/libsvn_fs_fs/id.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/index.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/libsvn_fs_fs.pc.in stable/12/contrib/subversion/subversion/libsvn_fs_fs/load-index.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/low_level.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/pack.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/recovery.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/12/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.sql stable/12/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/revprops.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/revprops.h stable/12/contrib/subversion/subversion/libsvn_fs_fs/stats.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/temp_serializer.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/temp_serializer.h stable/12/contrib/subversion/subversion/libsvn_fs_fs/transaction.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/tree.c stable/12/contrib/subversion/subversion/libsvn_fs_fs/verify.c stable/12/contrib/subversion/subversion/libsvn_fs_util/libsvn_fs_util.pc.in stable/12/contrib/subversion/subversion/libsvn_fs_x/cached_data.c stable/12/contrib/subversion/subversion/libsvn_fs_x/changes.c stable/12/contrib/subversion/subversion/libsvn_fs_x/dag_cache.c stable/12/contrib/subversion/subversion/libsvn_fs_x/dag_cache.h stable/12/contrib/subversion/subversion/libsvn_fs_x/fs.c stable/12/contrib/subversion/subversion/libsvn_fs_x/fs_x.c stable/12/contrib/subversion/subversion/libsvn_fs_x/libsvn_fs_x.pc.in stable/12/contrib/subversion/subversion/libsvn_fs_x/low_level.c stable/12/contrib/subversion/subversion/libsvn_fs_x/pack.c stable/12/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h stable/12/contrib/subversion/subversion/libsvn_fs_x/revprops.c stable/12/contrib/subversion/subversion/libsvn_fs_x/temp_serializer.c stable/12/contrib/subversion/subversion/libsvn_fs_x/transaction.c stable/12/contrib/subversion/subversion/libsvn_fs_x/tree.c stable/12/contrib/subversion/subversion/libsvn_fs_x/verify.c stable/12/contrib/subversion/subversion/libsvn_ra/compat.c stable/12/contrib/subversion/subversion/libsvn_ra/deprecated.c stable/12/contrib/subversion/subversion/libsvn_ra/libsvn_ra.pc.in stable/12/contrib/subversion/subversion/libsvn_ra/ra_loader.c stable/12/contrib/subversion/subversion/libsvn_ra/ra_loader.h stable/12/contrib/subversion/subversion/libsvn_ra/wrapper_template.h stable/12/contrib/subversion/subversion/libsvn_ra_local/libsvn_ra_local.pc.in stable/12/contrib/subversion/subversion/libsvn_ra_local/ra_plugin.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/commit.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/libsvn_ra_serf.pc.in stable/12/contrib/subversion/subversion/libsvn_ra_serf/list.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/lock.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/options.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h stable/12/contrib/subversion/subversion/libsvn_ra_serf/replay.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/serf.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/update.c stable/12/contrib/subversion/subversion/libsvn_ra_serf/util.c stable/12/contrib/subversion/subversion/libsvn_ra_svn/client.c stable/12/contrib/subversion/subversion/libsvn_ra_svn/editorp.c stable/12/contrib/subversion/subversion/libsvn_ra_svn/libsvn_ra_svn.pc.in stable/12/contrib/subversion/subversion/libsvn_ra_svn/protocol stable/12/contrib/subversion/subversion/libsvn_repos/authz.c stable/12/contrib/subversion/subversion/libsvn_repos/authz.h stable/12/contrib/subversion/subversion/libsvn_repos/authz_info.c stable/12/contrib/subversion/subversion/libsvn_repos/authz_parse.c stable/12/contrib/subversion/subversion/libsvn_repos/commit.c stable/12/contrib/subversion/subversion/libsvn_repos/config_file.c stable/12/contrib/subversion/subversion/libsvn_repos/config_file.h stable/12/contrib/subversion/subversion/libsvn_repos/delta.c stable/12/contrib/subversion/subversion/libsvn_repos/deprecated.c stable/12/contrib/subversion/subversion/libsvn_repos/dump.c stable/12/contrib/subversion/subversion/libsvn_repos/fs-wrap.c stable/12/contrib/subversion/subversion/libsvn_repos/libsvn_repos.pc.in stable/12/contrib/subversion/subversion/libsvn_repos/list.c stable/12/contrib/subversion/subversion/libsvn_repos/load-fs-vtable.c stable/12/contrib/subversion/subversion/libsvn_repos/load.c stable/12/contrib/subversion/subversion/libsvn_repos/log.c stable/12/contrib/subversion/subversion/libsvn_repos/replay.c stable/12/contrib/subversion/subversion/libsvn_repos/repos.c stable/12/contrib/subversion/subversion/libsvn_subr/cmdline.c stable/12/contrib/subversion/subversion/libsvn_subr/compress_lz4.c stable/12/contrib/subversion/subversion/libsvn_subr/config_file.c stable/12/contrib/subversion/subversion/libsvn_subr/config_keys.inc stable/12/contrib/subversion/subversion/libsvn_subr/config_win.c stable/12/contrib/subversion/subversion/libsvn_subr/deprecated.c stable/12/contrib/subversion/subversion/libsvn_subr/dirent_uri.c stable/12/contrib/subversion/subversion/libsvn_subr/error.c stable/12/contrib/subversion/subversion/libsvn_subr/gpg_agent.c stable/12/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/12/contrib/subversion/subversion/libsvn_subr/io.c stable/12/contrib/subversion/subversion/libsvn_subr/iter.c stable/12/contrib/subversion/subversion/libsvn_subr/libsvn_subr.pc.in stable/12/contrib/subversion/subversion/libsvn_subr/lz4/lz4.c stable/12/contrib/subversion/subversion/libsvn_subr/lz4/lz4internal.h stable/12/contrib/subversion/subversion/libsvn_subr/mergeinfo.c stable/12/contrib/subversion/subversion/libsvn_subr/object_pool.c stable/12/contrib/subversion/subversion/libsvn_subr/opt.c stable/12/contrib/subversion/subversion/libsvn_subr/pool.c stable/12/contrib/subversion/subversion/libsvn_subr/sorts.c stable/12/contrib/subversion/subversion/libsvn_subr/sqlite3wrapper.c stable/12/contrib/subversion/subversion/libsvn_subr/ssl_client_cert_pw_providers.c stable/12/contrib/subversion/subversion/libsvn_subr/stream.c stable/12/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/12/contrib/subversion/subversion/libsvn_subr/utf.c stable/12/contrib/subversion/subversion/libsvn_subr/utf8proc/utf8proc_data.c stable/12/contrib/subversion/subversion/libsvn_subr/version.c stable/12/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c stable/12/contrib/subversion/subversion/libsvn_subr/win32_crypto.c stable/12/contrib/subversion/subversion/libsvn_subr/x509info.c stable/12/contrib/subversion/subversion/libsvn_subr/x509parse.c stable/12/contrib/subversion/subversion/libsvn_wc/README stable/12/contrib/subversion/subversion/libsvn_wc/conflicts.c stable/12/contrib/subversion/subversion/libsvn_wc/conflicts.h stable/12/contrib/subversion/subversion/libsvn_wc/deprecated.c stable/12/contrib/subversion/subversion/libsvn_wc/diff_local.c stable/12/contrib/subversion/subversion/libsvn_wc/entries.c stable/12/contrib/subversion/subversion/libsvn_wc/libsvn_wc.pc.in stable/12/contrib/subversion/subversion/libsvn_wc/node.c stable/12/contrib/subversion/subversion/libsvn_wc/props.c stable/12/contrib/subversion/subversion/libsvn_wc/questions.c stable/12/contrib/subversion/subversion/libsvn_wc/revert.c stable/12/contrib/subversion/subversion/libsvn_wc/tree_conflicts.c stable/12/contrib/subversion/subversion/libsvn_wc/update_editor.c stable/12/contrib/subversion/subversion/libsvn_wc/upgrade.c stable/12/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/12/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/12/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/12/contrib/subversion/subversion/libsvn_wc/wc-queries.sql stable/12/contrib/subversion/subversion/libsvn_wc/wc.h stable/12/contrib/subversion/subversion/libsvn_wc/wc_db.c stable/12/contrib/subversion/subversion/libsvn_wc/wc_db.h stable/12/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c stable/12/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c stable/12/contrib/subversion/subversion/libsvn_wc/wcroot_anchor.c stable/12/contrib/subversion/subversion/svn/auth-cmd.c stable/12/contrib/subversion/subversion/svn/blame-cmd.c stable/12/contrib/subversion/subversion/svn/cl.h stable/12/contrib/subversion/subversion/svn/conflict-callbacks.c stable/12/contrib/subversion/subversion/svn/diff-cmd.c stable/12/contrib/subversion/subversion/svn/help-cmd.c stable/12/contrib/subversion/subversion/svn/info-cmd.c stable/12/contrib/subversion/subversion/svn/list-cmd.c stable/12/contrib/subversion/subversion/svn/log-cmd.c stable/12/contrib/subversion/subversion/svn/merge-cmd.c stable/12/contrib/subversion/subversion/svn/notify.c stable/12/contrib/subversion/subversion/svn/propset-cmd.c stable/12/contrib/subversion/subversion/svn/resolve-cmd.c stable/12/contrib/subversion/subversion/svn/revert-cmd.c stable/12/contrib/subversion/subversion/svn/svn.c stable/12/contrib/subversion/subversion/svn/util.c stable/12/contrib/subversion/subversion/svn_private_config.h.in stable/12/contrib/subversion/subversion/svnadmin/svnadmin.c stable/12/contrib/subversion/subversion/svnbench/cl.h stable/12/contrib/subversion/subversion/svnbench/help-cmd.c stable/12/contrib/subversion/subversion/svnbench/svnbench.c stable/12/contrib/subversion/subversion/svndumpfilter/svndumpfilter.c stable/12/contrib/subversion/subversion/svnfsfs/dump-index-cmd.c stable/12/contrib/subversion/subversion/svnfsfs/load-index-cmd.c stable/12/contrib/subversion/subversion/svnfsfs/stats-cmd.c stable/12/contrib/subversion/subversion/svnfsfs/svnfsfs.c stable/12/contrib/subversion/subversion/svnlook/svnlook.c stable/12/contrib/subversion/subversion/svnmucc/svnmucc.c stable/12/contrib/subversion/subversion/svnrdump/dump_editor.c stable/12/contrib/subversion/subversion/svnrdump/load_editor.c stable/12/contrib/subversion/subversion/svnrdump/svnrdump.c stable/12/contrib/subversion/subversion/svnrdump/svnrdump.h stable/12/contrib/subversion/subversion/svnrdump/util.c stable/12/contrib/subversion/subversion/svnserve/logger.c stable/12/contrib/subversion/subversion/svnserve/logger.h stable/12/contrib/subversion/subversion/svnserve/serve.c stable/12/contrib/subversion/subversion/svnserve/svnserve.c stable/12/contrib/subversion/subversion/svnsync/svnsync.c stable/12/contrib/subversion/subversion/svnversion/svnversion.c stable/12/contrib/subversion/win-tests.py stable/12/usr.bin/svn/Makefile stable/12/usr.bin/svn/Makefile.inc stable/12/usr.bin/svn/lib/Makefile stable/12/usr.bin/svn/lib/libapr/Makefile stable/12/usr.bin/svn/lib/libapr/apr.h stable/12/usr.bin/svn/lib/libapr/apr_private.h stable/12/usr.bin/svn/lib/libapr_util/Makefile stable/12/usr.bin/svn/lib/libapr_util/apu.h stable/12/usr.bin/svn/lib/libapr_util/apu_config.h stable/12/usr.bin/svn/lib/libserf/Makefile stable/12/usr.bin/svn/lib/libsvn_client/Makefile stable/12/usr.bin/svn/lib/libsvn_delta/Makefile stable/12/usr.bin/svn/lib/libsvn_diff/Makefile stable/12/usr.bin/svn/lib/libsvn_fs/Makefile stable/12/usr.bin/svn/lib/libsvn_fs_fs/Makefile stable/12/usr.bin/svn/lib/libsvn_fs_util/Makefile stable/12/usr.bin/svn/lib/libsvn_fs_x/Makefile stable/12/usr.bin/svn/lib/libsvn_ra/Makefile stable/12/usr.bin/svn/lib/libsvn_ra_local/Makefile stable/12/usr.bin/svn/lib/libsvn_ra_serf/Makefile stable/12/usr.bin/svn/lib/libsvn_ra_svn/Makefile stable/12/usr.bin/svn/lib/libsvn_repos/Makefile stable/12/usr.bin/svn/lib/libsvn_subr/Makefile stable/12/usr.bin/svn/lib/libsvn_wc/Makefile stable/12/usr.bin/svn/svn/Makefile stable/12/usr.bin/svn/svn_private_config.h stable/12/usr.bin/svn/svnadmin/Makefile stable/12/usr.bin/svn/svnbench/Makefile stable/12/usr.bin/svn/svndumpfilter/Makefile stable/12/usr.bin/svn/svnfsfs/Makefile stable/12/usr.bin/svn/svnlook/Makefile stable/12/usr.bin/svn/svnmucc/Makefile stable/12/usr.bin/svn/svnrdump/Makefile stable/12/usr.bin/svn/svnserve/Makefile stable/12/usr.bin/svn/svnsync/Makefile stable/12/usr.bin/svn/svnversion/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/apr-util/CHANGES ============================================================================== --- stable/12/contrib/apr-util/CHANGES Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/CHANGES Sun Jun 14 17:36:43 2020 (r362180) @@ -1,141 +1,62 @@ -*- coding: utf-8 -*- -Changes with APR-util 1.5.4 +Changes with APR-util 1.6.1 - *) MySQL driver: Fix incorrect handling of bad parameter in the - driver support for apr_dbd_transaction_end(). PR 56330. - [Weiqiang Li ] + *) Win32: Add function exports from new apr_crypto API's missing in 1.6.0. - *) apr_crypto_get_driver(): Fix invalid storage reference on error path. - [Philip Martin ] + *) Win32: Introduce XML_PARSER build-time variable to select the expat + library name to be linked to libaprutil-1.dll. See Makefile.win - *) Fix compile failure for Android. PR 56627. [Fredrik Fornwall - , Jeff Trawick] + *) Win32: Removed lingering xml/xml.dsp project forked from the expat + Project in the 1.9x era. Use expat's maintained build schema instead, + prior to building apr-util. - *) Fix to let ODBC driver build with MSVC6, which does not have intptr_t - [Tom Donovan] + *) apr_crypto: Fix compatibility with LibreSSL. PR 61596. + [Bernard Spil , Yann Ylavic] - *) Windows cmake build: Fix incompatiblities with Visual Studio - generators with all cmake versions, and the NMake Makefile generator - with cmake 2.8.12 and later. PR 56616 and other bugs. [Jeff Trawick, - Bert Huijben] + *) sdbm: better database/page validation to fail cleanly when corrupted. + [Yann Ylavic] - *) Fix detection of Berkeley DB 6.0. PR 55277. - [Lars Wendler ] +Changes with APR-util 1.6.0 - *) Improve platform detection for bundled expat by updating - config.guess and config.sub. [Rainer Jung] + *) The expat dependency of apr-util is no longer built with apr-util. + Install expat (including development headers and libraries) first + before building apr-util. [https://libexpat.github.io/] -Changes with APR-util 1.5.3 + *) Mark apr_dbd_freetds as unsupported, and remove it from all builds + [Nick Kew] - *) Cygwin: Use correct file extension when loading APR DSOs. PR 55587. - [Carlo Bramini ] + *) Update MySQL build to stop using libmysqlclient_r. + [Petr Sumbera ] - *) Add experimental cmake-based build system for Windows. Refer to - README.cmake for more information. [Jeff Trawick, Tom Donovan] + *) apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure + the size of the buffer used to read files. [Yann Ylavic] - *) Fix warnings in odbc driver on 64bit systems. - PR 55197 [Tom Donovan] + *) apr_crypto: avoid excessive iteration in bcrypt hash. + [Hanno Böck ] - *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi - Gacogne ] + *) apr_siphash: Implement keyed hash function SipHash. [Yann Ylavic] - *) Add support for Berkeley DB 6.0. [Rainer Jung] + *) apr_crypto: Add apr_crypto_key() function which supports keys + generated from a passphrase or a raw secret provided by the caller. + Deprecate apr_crypto_passphrase(). [Graham Leggett] - *) Improve platform detection for bundled expat by updating - config.guess and config.sub. [Rainer Jung] + *) apr_crypto_nss: Ensure the SECItem returned by PK11_ParamFromIV + is properly freed. [Graham Leggett] -Changes with APR-util 1.5.2 + *) apr_crypto: Don't cache the driver if initialisation fails. This + stops the second and subsequent attempt to use the API from failing + claiming the library is not initialised. [Graham Leggett] - *) Windows: Add command line makefiles. [Gregg Smith] + *) apr_crypto: Add a native CommonCrypto implementation for iOS and OSX + where OpenSSL has been deprecated. [Graham Leggett] - *) apr_uri_parse(): Do not accept invalid characters in the scheme. - Per RFC 3986 3.3, enforce that the first segment of a relative path does - not contain a colon. PR 52479. [Stefan Fritsch] + *) apr_xml_to_text: Add style APR_XML_X2T_PARSED to maintain a + consistent namespace prefix. [Jari Urpalainen + ] - *) Fix memory leak in hook sorting function. PR 51256. - [] +Changes with APR-util 1.5.x and later: - *) Speedup md5 calculation by avoiding some copying on little endian - architectures. PR 49011. [Stefan Fritsch, Stefan Fuhrmann - ] - - *) Use heap memory for crypt in apr_password_validate(), to reduce stack - usage. PR 54572. [Stefan Fritsch] - - *) Fix password validation failure for all crypt and crypt_r based - algorithms. PR 54603. [Harvey Eneman ] - - *) Fix syntax error in crypto/apr_passwd.c on non-glibc systems. PR 54275. - [Stefan Fritsch] - - *) Fix potential data corruption in apr_brigade_write() and friends if - the last bucket of the brigade is a heap bucket that has been split, - and there are still references to the next part of the original bucket - in use. [Stefan Fritsch] - - *) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe - Jaillet ] - - *) apr_crypto: If --with-crypto is passed to configure but no crypto - libraries are enabled, autodetect available libraries. [Jeff Trawick] - - *) memcache: Fix dead server retry logic. [Gavin Shelley ] - -Changes with APR-util 1.5.1 - - *) testmemcache: Fix crash. PR 52705. [Peter Poeml ] - - *) MinGW: Support shared builds of apr-util when apr is shared. - PR 46175. [Carlo Bramini , Jeff Trawick] - - *) Add support for Berkeley DB 5.2 and 5.3. Simplify detection script. - PR 53684. [Rainer Jung] - - *) configure: Allow to specify library specific custom linker flags - via the LDADD_XXX variables. [Rainer Jung] - - *) apr_password_validate(): Fix intermittent errors on systems - such as FreeBSD where the crypt() function is used. - (Broken only in 1.5.0) [Jeff Trawick] - - *) Improve platform detection for bundled expat by updating - config.guess and config.sub. [Rainer Jung] - -Changes with APR-util 1.5.0 - - *) dbd_pgsql_escape: Use PQescapeStringConn. [Nick Kew] - - *) apr_password_validate, apr_bcrypt_encode: Add support for bcrypt encoded - passwords. The bcrypt implementation uses code from crypt_blowfish - written by Solar Designer . apr_bcrypt_encode creates - hashes with "$2y$" prefix, but apr_password_validate also accepts the old - prefix "$2a$". PR 49288. [Stefan Fritsch] - - *) APR dbd: Allow to use apr_dbd_get_row() with a different pool than - apr_dbd_select(). PR 53533. [] - - *) APR dbd FreeTDS support: Fix spurious API errors caused by uninitialized - fields. [TROY.LIU åŠ‰æ˜¥å‰ ] - - *) apr_password_validate: Increase maximum hash string length to allow - more than 9999 rounds with sha512-crypt. PR 53410. [Stefan Fritsch] - - *) Fix segfaults in crypt() and crypt_r() failure modes. - PR 47272. [Arkadiusz Miskiewicz ] - - *) apr_crypto: Ensure that the if/else that governs the static - initialisation of each crypto driver works when the first driver - isn't in use. [Graham Leggett] - - *) apr_crypto: Ensure the *driver variable is initialised when a statically - compiled library is initialised for the first time. [Graham Leggett] - - *) apr_crypto: Ensure the *driver variable is initialised when the library - has already been loaded. Fix ported from apr_dbd. [Graham Leggett] - - *) apr_crypto: Move the static initialisation of DRIVER_LOAD from - apr_crypto_init() to apr_crypto_get_driver(), so that we don't lose - the parameters. [Graham Leggett] + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/CHANGES?view=markup Changes with APR-util 1.4.x and later: Copied: stable/12/contrib/apr-util/CMakeLists.txt (from r361692, head/contrib/apr-util/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/apr-util/CMakeLists.txt Sun Jun 14 17:36:43 2020 (r362180, copy of r361692, head/contrib/apr-util/CMakeLists.txt) @@ -0,0 +1,355 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Read README.cmake before using this. + +PROJECT(APR-Util C) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +FIND_PACKAGE(OpenSSL) + +FIND_PACKAGE(expat) + +OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) +OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) +OPTION(APR_HAS_LDAP "LDAP support" ON) +OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) +OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) +OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) +SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR include files") +SET(APR_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib" CACHE STRING "APR library to link with") + +IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h") + MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.") +ENDIF() +FOREACH(onelib ${APR_LIBRARIES}) + IF(NOT EXISTS ${onelib}) + MESSAGE(FATAL_ERROR "APR library ${onelib} was not found.") + ENDIF() +ENDFOREACH() + +IF(APU_HAVE_CRYPTO) +IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "OpenSSL is the only supported crypto implementation, and it wasn't found!") +ENDIF() +ENDIF() + +# create 1-or-0 representation of feature tests for apu.h + +SET(apu_have_crypto_10 0) +SET(apu_have_apr_iconv_10 0) # not yet implemented +SET(apr_has_ldap_10 0) + +IF(APU_HAVE_CRYPTO) + SET(apu_have_crypto_10 1) +ENDIF() + +IF(APR_HAS_LDAP) + SET(apr_has_ldap_10 1) +ENDIF() + +IF(NOT EXPAT_FOUND) + MESSAGE(FATAL_ERROR "Expat is required, and it wasn't found!") +ENDIF() + +SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS}) +SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES}) + +SET(LDAP_LIBRARIES) +IF(APR_HAS_LDAP) + SET(LDAP_LIBRARIES wldap32) +ENDIF() + +CONFIGURE_FILE(include/apu.hwc + ${PROJECT_BINARY_DIR}/apu.h) +CONFIGURE_FILE(include/apr_ldap.hwc + ${PROJECT_BINARY_DIR}/apr_ldap.h) +# "COPYONLY" just because anything else isn't implemented ;) +CONFIGURE_FILE(include/private/apu_config.hw + ${PROJECT_BINARY_DIR}/apu_config.h + COPYONLY) +CONFIGURE_FILE(include/private/apu_select_dbm.hw + ${PROJECT_BINARY_DIR}/apu_select_dbm.h + COPYONLY) +CONFIGURE_FILE(include/apu_want.hw + ${PROJECT_BINARY_DIR}/apu_want.h + COPYONLY) + +# Generated .h files are stored in PROJECT_BINARY_DIR, not the +# source tree. +# +# BROKEN: not searching PROJECT_BINARY_DIR first, so you have to +# manually delete apu.h in PROJECT_SOURCE_DIR/include if +# you've generated apu.h before using a different build + +SET(APR_INCLUDE_DIRECTORIES + ${PROJECT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/private + ${APR_INCLUDE_DIR} +) + +INCLUDE_DIRECTORIES(${APR_INCLUDE_DIRECTORIES} ${XMLLIB_INCLUDE_DIR}) + +SET(APR_PUBLIC_HEADERS_STATIC + include/apr_anylock.h + include/apr_base64.h + include/apr_buckets.h + include/apr_crypto.h + include/apr_date.h + include/apr_dbd.h + include/apr_dbm.h + include/apr_hooks.h + include/apr_ldap_init.h + include/apr_ldap_option.h + include/apr_ldap_rebind.h + include/apr_ldap_url.h + include/apr_md4.h + include/apr_md5.h + include/apr_memcache.h + include/apr_optional.h + include/apr_optional_hooks.h + include/apr_queue.h + include/apr_redis.h + include/apr_reslist.h + include/apr_rmm.h + include/apr_sdbm.h + include/apr_sha1.h + include/apr_siphash.h + include/apr_strmatch.h + include/apr_thread_pool.h + include/apr_uri.h + include/apr_uuid.h + include/apr_xlate.h + include/apr_xml.h + include/apu_errno.h + include/apu_version.h +) + +# apu_config.h and apu_select_dbm.h are private +SET(APR_PUBLIC_HEADERS_GENERATED + ${PROJECT_BINARY_DIR}/apu.h + ${PROJECT_BINARY_DIR}/apr_ldap.h + ${PROJECT_BINARY_DIR}/apu_want.h +) + +SET(APR_SOURCES + buckets/apr_brigade.c + buckets/apr_buckets.c + buckets/apr_buckets_alloc.c + buckets/apr_buckets_eos.c + buckets/apr_buckets_file.c + buckets/apr_buckets_flush.c + buckets/apr_buckets_heap.c + buckets/apr_buckets_mmap.c + buckets/apr_buckets_pipe.c + buckets/apr_buckets_pool.c + buckets/apr_buckets_refcount.c + buckets/apr_buckets_simple.c + buckets/apr_buckets_socket.c + crypto/apr_crypto.c + crypto/apr_md4.c + crypto/apr_md5.c + crypto/apr_passwd.c + crypto/apr_sha1.c + crypto/apr_siphash.c + crypto/crypt_blowfish.c + crypto/getuuid.c + crypto/uuid.c + dbd/apr_dbd.c + dbm/apr_dbm.c + dbm/apr_dbm_sdbm.c + dbm/sdbm/sdbm.c + dbm/sdbm/sdbm_hash.c + dbm/sdbm/sdbm_lock.c + dbm/sdbm/sdbm_pair.c + encoding/apr_base64.c + hooks/apr_hooks.c + memcache/apr_memcache.c + misc/apr_date.c + misc/apr_queue.c + misc/apr_reslist.c + misc/apr_rmm.c + misc/apr_thread_pool.c + misc/apu_dso.c + misc/apu_version.c + redis/apr_redis.c + strmatch/apr_strmatch.c + uri/apr_uri.c + xlate/xlate.c + xml/apr_xml.c +) + +IF(APR_HAS_LDAP) + SET(APR_SOURCES ${APR_SOURCES} ldap/apr_ldap_stub.c ldap/apr_ldap_url.c) +ENDIF() + +SET(APR_TEST_SOURCES + test/abts.c + test/testbuckets.c + test/testcrypto.c + test/testdate.c + test/testdbd.c + test/testdbm.c + test/testldap.c + test/testmd4.c + test/testmd5.c + test/testmemcache.c + test/testpass.c + test/testqueue.c + test/testredis.c + test/testreslist.c + test/testrmm.c + test/testsiphash.c + test/teststrmatch.c + test/testuri.c + test/testutil.c + test/testuuid.c + test/testxlate.c + test/testxml.c +) + +SET(install_targets) +SET(install_bin_pdb) +SET(dbd_drivers) + +# Note: The WINNT definition on some targets is used only by libaprutil.rc. + +# libaprutil-1 is shared, aprutil-1 is static +ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc) +SET(install_targets ${install_targets} libaprutil-1) +SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb) +TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) +SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT") + +ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} aprutil-1) +TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) +SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC") + +IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") + ENDIF() + ADD_LIBRARY(apr_crypto_openssl-1 SHARED crypto/apr_crypto_openssl.c libaprutil.rc) + SET(install_targets ${install_targets} apr_crypto_openssl-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb) + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_crypto_openssl") + TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES}) +ENDIF() + +IF(APU_HAVE_ODBC) + ADD_LIBRARY(apr_dbd_odbc-1 SHARED dbd/apr_dbd_odbc.c libaprutil.rc) + SET(install_targets ${install_targets} apr_dbd_odbc-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-1.pdb) + SET(dbd_drivers ${dbd_drivers} odbc) + TARGET_LINK_LIBRARIES(apr_dbd_odbc-1 libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32) + SET_PROPERTY(TARGET apr_dbd_odbc-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) + SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD;WINNT") + SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_dbd_odbc") +ENDIF() + +IF(APR_HAS_LDAP) + ADD_LIBRARY(apr_ldap-1 SHARED ldap/apr_ldap_init.c ldap/apr_ldap_option.c + ldap/apr_ldap_rebind.c libaprutil.rc) + SET(install_targets ${install_targets} apr_ldap-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb) + TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1 ${APR_LIBRARIES} ${LDAP_LIBRARIES}) + SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") + SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_ldap") + SET(apr_ldap_libraries apr_ldap-1) +ELSE() + SET(apr_ldap_libraries) +ENDIF() + +IF(APR_BUILD_TESTAPR) + ENABLE_TESTING() + # Create a "check" target that displays test program output to the console. + ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) + + # copy data files to build directory so that we can run programs from there + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory + ${PROJECT_BINARY_DIR}/data) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml + ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) + + IF(TEST_STATIC_LIBS) + SET(whichapr aprutil-1) + SET(apiflag "-DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC") + ELSE() + SET(whichapr libaprutil-1) + SET(apiflag) + ENDIF() + + ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) + TARGET_LINK_LIBRARIES(testall ${whichapr} ${apr_ldap_libraries} ${XMLLIB_LIBRARIES} ${LDAP_LIBRARIES}) + IF(apiflag) + SET_TARGET_PROPERTIES(testall PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testall COMMAND testall) + + ADD_EXECUTABLE(dbd test/dbd.c) + TARGET_LINK_LIBRARIES(dbd ${whichapr}) + IF(apiflag) + SET_TARGET_PROPERTIES(dbd PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + + # dbd is run multiple times with different parameters. + FOREACH(somedbd ${dbd_drivers}) + ADD_TEST(NAME dbd-${somedbd} COMMAND dbd ${somedbd}) + ENDFOREACH() + +ENDIF (APR_BUILD_TESTAPR) + +# Installation + +INSTALL(TARGETS ${install_targets} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + +IF(INSTALL_PDB) + INSTALL(FILES ${install_bin_pdb} + DESTINATION bin + CONFIGURATIONS RelWithDebInfo Debug) +ENDIF() + +INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) + +STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) +MESSAGE(STATUS "") +MESSAGE(STATUS "") +MESSAGE(STATUS "APR-Util configuration summary:") +MESSAGE(STATUS "") +MESSAGE(STATUS " Build type ...................... : ${CMAKE_BUILD_TYPE}") +MESSAGE(STATUS " Install .pdb (if available)...... : ${INSTALL_PDB}") +MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") +MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") +MESSAGE(STATUS " APR include directory ........... : ${APR_INCLUDE_DIR}") +MESSAGE(STATUS " APR libraries ................... : ${APR_LIBRARIES}") +MESSAGE(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}") +MESSAGE(STATUS " APU_HAVE_CRYPTO ................. : ${APU_HAVE_CRYPTO}") +MESSAGE(STATUS " APR_HAS_LDAP .................... : ${APR_HAS_LDAP}") +MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") +IF(TEST_STATIC_LIBS) +MESSAGE(STATUS " (testing static libraries)") +ELSE() +MESSAGE(STATUS " (testing dynamic libraries)") +ENDIF() Modified: stable/12/contrib/apr-util/LICENSE ============================================================================== --- stable/12/contrib/apr-util/LICENSE Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/LICENSE Sun Jun 14 17:36:43 2020 (r362180) @@ -312,6 +312,22 @@ For the crypto\apr_md4.c component: * documentation and/or software. */ +For the crypto\crypt_blowfish.c(.h) component: + + * Written by Solar Designer in 1998-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 1998-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + + See crypto/crypt_blowfish.c for more information. + For the include\apr_md4.h component: * Modified: stable/12/contrib/apr-util/Makefile.in ============================================================================== --- stable/12/contrib/apr-util/Makefile.in Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/Makefile.in Sun Jun 14 17:36:43 2020 (r362180) @@ -15,8 +15,8 @@ APRUTIL_LDFLAGS = @APRUTIL_LDFLAGS@ APRUTIL_LIBS = @APRUTIL_LIBS@ TARGET_LIB = lib@APRUTIL_LIBNAME@.la -INSTALL_SUBDIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ -EXTRA_SOURCE_DIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ +INSTALL_SUBDIRS = @APR_ICONV_DIR@ +EXTRA_SOURCE_DIRS = @APR_ICONV_DIR@ APRUTIL_PCFILE = apr-util-$(APRUTIL_MAJOR_VERSION).pc APU_CONFIG = apu-$(APRUTIL_MAJOR_VERSION)-config INSTALL = @INSTALL@ @@ -35,7 +35,6 @@ LDADD_dbd_oracle = @LDADD_dbd_oracle@ LDADD_dbd_sqlite2 = @LDADD_dbd_sqlite2@ LDADD_dbd_sqlite3 = @LDADD_dbd_sqlite3@ LDADD_dbd_mysql = @LDADD_dbd_mysql@ -LDADD_dbd_freetds = @LDADD_dbd_freetds@ LDADD_dbd_odbc = @LDADD_dbd_odbc@ LDADD_dbm_db = @LDADD_dbm_db@ LDADD_dbm_gdbm = @LDADD_dbm_gdbm@ @@ -43,6 +42,7 @@ LDADD_dbm_ndbm = @LDADD_dbm_ndbm@ LDADD_ldap = @LDADD_ldap@ LDADD_crypto_openssl = @LDADD_crypto_openssl@ LDADD_crypto_nss = @LDADD_crypto_nss@ +LDADD_crypto_commoncrypto = @LDADD_crypto_commoncrypto@ TARGETS = $(TARGET_LIB) aprutil.exp apu-config.out $(APU_MODULES) @@ -50,7 +50,7 @@ TARGETS = $(TARGET_LIB) aprutil.exp apu-config.out $(A @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_SUBDIRS = test @APR_ICONV_DIR@ @APR_XML_DIR@ +CLEAN_SUBDIRS = test @APR_ICONV_DIR@ CLEAN_TARGETS = exports.c export_vars.c aprutil.exp .make.dirs apu-config.out DISTCLEAN_TARGETS = config.cache config.log config.status libtool \ Modified: stable/12/contrib/apr-util/Makefile.win ============================================================================== --- stable/12/contrib/apr-util/Makefile.win Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/Makefile.win Sun Jun 14 17:36:43 2020 (r362180) @@ -51,6 +51,13 @@ # # CRYPTO_LIST="nss openssl" # +# Provide the XML_PARSER argument after configuring LIB and INCLUDE with +# the expat path of the corresponding xml parser, e.g. libexpatMT to choose +# static, or libexpat (default) to choose the dynamic library for aprutil-1.dll +# (Static libaprutil-1.lib always presumes libexpatMT with XML_STATIC flag.) +# +# XML_PARSER="libexpat" +# # For example; # # nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean @@ -73,6 +80,20 @@ USEDSW=1 PREFIX=..\apr-dist +!IF EXIST("..\openssl") +!IF EXIST("..\openssl\libcrypto.lib") +SSLOPT=_HAVE_OSSL110=1 +!ENDIF +!ENDIF + +# Legacy default (and unwise alternative) for libapr-1.dll is libexpatMT +XML_PARSER="libexpat" +!IF "$(XML_PARSER)" == "libexpat" +XMLOPT=XML_PARSER=$(XML_PARSER) +!ELSE +XMLOPT=XML_PARSER=$(XML_PARSER) XML_OPTIONS="/D XML_STATIC" +!ENDIF + !IF [$(COMSPEC) /c cl /nologo /? \ | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0 ARCH=x64 Release @@ -197,11 +218,9 @@ buildall: BUILD_MODE="$(ARCH)" BIND_MODE=shared cd .. !ENDIF - cd $(APU_PATH)\xml\expat\lib - $(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - $(ARCH)" RECURSE=0 $(CTARGET) - cd ..\..\.. - $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - $(ARCH)" RECURSE=0 $(CTARGET) - $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - $(ARCH)" RECURSE=0 $(CTARGET) + cd $(APU_PATH) + $(MAKE) $(MAKEOPT) $(SSLOPT) $(XMLOPT) -f aprutil.mak CFG="aprutil - $(ARCH)" RECURSE=0 $(CTARGET) + $(MAKE) $(MAKEOPT) $(SSLOPT) $(XMLOPT) -f libaprutil.mak CFG="libaprutil - $(ARCH)" RECURSE=0 $(CTARGET) cd ldap $(MAKE) $(MAKEOPT) -f apr_ldap.mak CFG="apr_ldap - $(ARCH)" RECURSE=0 $(CTARGET) cd .. @@ -215,7 +234,7 @@ buildall: cd .. cd crypto for %d in ($(CRYPTO_LIST) x) do if not %d == x \ - $(MAKE) $(MAKEOPT) -f apr_crypto_%d.mak CFG="apr_crypto_%d - $(ARCH)" RECURSE=0 $(CTARGET) + $(MAKE) $(MAKEOPT) $(SSLOPT) -f apr_crypto_%d.mak CFG="apr_crypto_%d - $(ARCH)" RECURSE=0 $(CTARGET) cd .. !ELSEIF $(USESLN) == 1 @@ -306,7 +325,7 @@ checkapr: checkapu: cd $(APU_PATH) cd test - $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \ + $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \ OUTDIR=$(LIBSPATH) APROUTDIR=$(LIBSOSPATH) \ APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \ Modified: stable/12/contrib/apr-util/NOTICE ============================================================================== --- stable/12/contrib/apr-util/NOTICE Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/NOTICE Sun Jun 14 17:36:43 2020 (r362180) @@ -1,5 +1,5 @@ Apache Portable Runtime Utility Library -Copyright (c) 2000-2014 The Apache Software Foundation. +Copyright (c) 2000-2016 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Modified: stable/12/contrib/apr-util/NWGNUmakefile ============================================================================== --- stable/12/contrib/apr-util/NWGNUmakefile Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/NWGNUmakefile Sun Jun 14 17:36:43 2020 (r362180) @@ -261,9 +261,11 @@ FILES_lib_objs = \ $(OBJDIR)/apr_memcache.o \ $(OBJDIR)/apr_passwd.o \ $(OBJDIR)/apr_queue.o \ + $(OBJDIR)/apr_redis.o \ $(OBJDIR)/apr_reslist.o \ $(OBJDIR)/apr_rmm.o \ $(OBJDIR)/apr_sha1.o \ + $(OBJDIR)/apr_siphash.o \ $(OBJDIR)/apu_version.o \ $(OBJDIR)/getuuid.o \ $(OBJDIR)/uuid.o \ @@ -296,7 +298,7 @@ install :: nlms FORCE # Any specialized rules here # -vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:ldap:memcache:misc:strmatch:uri:xlate:xml +vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:ldap:memcache:redis:misc:strmatch:uri:xlate:xml # # Include the 'tail' makefile that has targets that depend on variables defined Modified: stable/12/contrib/apr-util/README ============================================================================== --- stable/12/contrib/apr-util/README Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/README Sun Jun 14 17:36:43 2020 (r362180) @@ -34,7 +34,7 @@ Apache Portable Runtime Utility Library README String filename-style pattern matching URI Parsing Charset translation (iconv based) - XML parsing (expat based) + XML parsing (expat) For a more complete list, please refer to the following URLs: @@ -66,7 +66,7 @@ for your compiled code. Similarly, the bindings for p such as Oracle (--with-oracle option) must also be explicitly enabled. On windows, selection of supported drivers is via the environment values -DBD_LIST (for freetds, mysql, oracle, pgsql, sqlite2 and/or sqlite3) +DBD_LIST (for mysql, oracle, pgsql, sqlite2 and/or sqlite3) and DBM_LIST (db and/or gdbm). DBD odbc and DBM sdbm are unconditionally compiled and installed, do not include these in the list. Copied: stable/12/contrib/apr-util/README.FREETDS (from r361692, head/contrib/apr-util/README.FREETDS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/apr-util/README.FREETDS Sun Jun 14 17:36:43 2020 (r362180, copy of r361692, head/contrib/apr-util/README.FREETDS) @@ -0,0 +1,11 @@ +The APR DBD Driver for FreeTDS has been removed from the build. +It is known to have problems, and we are not able to maintain it. + +The source code is still available. If you want it and are able +to manage maintenance for yourself, you can patch the build and +work through issues that affect you, but you're on your own. + +We expect that for most users, the ODBC driver will serve as +an alternative. + +Sorry. Copied: stable/12/contrib/apr-util/README.cmake (from r361692, head/contrib/apr-util/README.cmake) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/apr-util/README.cmake Sun Jun 14 17:36:43 2020 (r362180, copy of r361692, head/contrib/apr-util/README.cmake) @@ -0,0 +1,139 @@ +Experimental cmake-based build support for APR-Util on Microsoft Windows + +Status +------ + +This build support is currently intended only for Microsoft Windows. +Only Windows NT-based systems can be targeted. (The traditional +Windows build support for APR can target Windows 9x as well.) + +This build support is experimental. Specifically, + +* It does not support all features of APR-Util. +* Some components may not be built correctly and/or in a manner + compatible with the previous Windows build support. +* Build interfaces, such as the mechanisms which are used to enable + optional functionality or specify prerequisites, may change from + release to release as feedback is received from users and bugs and + limitations are resolved. + +Important: Refer to the "Known Bugs and Limitations" section for further + information. + + It is beyond the scope of this document to document or explain + how to utilize the various cmake features, such as different + build backends or provisions for finding support libraries. + + Please refer to the cmake documentation for additional information + that applies to building any project with cmake. + +Prerequisites +------------- + +The following tools must be in PATH: + +* cmake, version 2.8 or later + cmake version 3.1.3 or later is required to work with current OpenSSL + releases. (OpenSSL is an optional prerequisite of APR-Util.) +* If using a command-line compiler: compiler and linker and related tools + (Refer to the cmake documentation for more information.) + +The following support libraries are mandatory: + +* APR 1.4.x or APR 1.5.x, built with cmake + +Optional support libraries allow optional features of APR to be enabled: + +* OpenSSL +* many others potentially, though the build support isn't currently + implemented + +How to build +------------ + +1. cd to a clean directory for building (i.e., don't build in your + source tree) + +2. Some cmake backends may want your compile tools in PATH. (Hint: "Visual + Studio Command Prompt") + +3. set CMAKE_LIBRARY_PATH=d:\path\to\prereq1\lib;d:\path\to\prereq2\lib;... + +4. set CMAKE_INCLUDE_PATH=d:\path\to\prereq1\include;d:\path\to\prereq2\include;... + +5. cmake -G "some backend, like 'NMake Makefiles'" + -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst + -DAPR-Util-specific-flags + d:/path/to/aprutilsource + + If APR 1.x was installed to a different directory than APR-Util, + also pass these additional arguments: + + -DAPR_INCLUDE_DIR=d:/path/to/apr1inst/include + -DAPR_LIBRARIES=d:/path/to/apr1inst/lib/libapr-1.lib + + Alternately, use cmake-gui and update settings in the GUI. + + APR-Util feature flags: + + APU_HAVE_CRYPTO Build crypt support (only the OpenSSL + implementation is currently supported) + Default: OFF + APU_HAVE_ODBC Build ODBC DBD driver + Default: ON + APR_BUILD_TESTAPR Build APR-Util test suite + Default: OFF + TEST_STATIC_LIBS Build the test suite to test the APR static + library instead of the APR dynamic library. + Default: OFF + In order to build the test suite against both + static and dynamic libraries, separate builds + will be required, one with TEST_STATIC_LIBS + set to ON. + INSTALL_PDB Install .pdb files if generated. + Default: ON + + CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL + + CMAKE_BUILD_TYPE + + For NMake Makefiles the choices are at least DEBUG, RELEASE, + RELWITHDEBINFO, and MINSIZEREL + Other backends make have other selections. + +6. build using chosen backend (e.g., "nmake install") + +Known Bugs and Limitations +-------------------------- + +* If include/apu.h or other generated files have been created in the source + directory by another build system, they will be used unexpectedly and + cause the build to fail. +* Options should be provided for remaining features, along with finding any + necessary libraries + + DBM: + . APU_HAVE_GDBM + . APU_HAVE_NDBM + . APU_HAVE_DB + + DBD: + . APU_HAVE_PGSQL + . APU_HAVE_MYSQL + . APU_HAVE_SQLITE3 + . APU_HAVE_SQLITE2 + . APU_HAVE_ORACLE + + CRYPTO: + . APU_HAVE_NSS + + XLATE, APU_HAVE_ICONV (no way to consume an apr-iconv build yet) +* Static builds of APR modules are not supported. +* CHANGES/LICENSE/NOTICE is not installed, unlike Makefile.win. + (But unlike Makefile.win we want to call them APR-Util-CHANGES.txt + and so on.) But perhaps that is a job for a higher-level script. + +Generally: + +* Many APR-Util features have not been tested with this build. +* Developers need to examine the existing Windows build in great detail and see + what is missing from the cmake-based build, whether a feature or some build + nuance. +* Any feedback you can provide on your experiences with this build will be + helpful. Modified: stable/12/contrib/apr-util/apr-util.spec ============================================================================== --- stable/12/contrib/apr-util/apr-util.spec Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/apr-util.spec Sun Jun 14 17:36:43 2020 (r362180) @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.5.4 +Version: 1.6.1 Release: 1 License: Apache Software License Group: System Environment/Libraries @@ -70,16 +70,6 @@ Requires: apr-util = %{version}-%{release} This package provides the SQLite driver for the apr-util DBD (database abstraction) interface. -%package freetds -Group: Development/Libraries -Summary: APR utility library FreeTDS DBD driver -BuildRequires: freetds-devel -Requires: apr-util = %{version}-%{release} - -%description freetds -This package provides the FreeTDS driver for the apr-util DBD -(database abstraction) interface. - %package odbc Group: Development/Libraries Summary: APR utility library ODBC DBD driver @@ -124,7 +114,7 @@ This package provides crypto support for apr-util base %configure --with-apr=%{_prefix} \ --includedir=%{_includedir}/apr-%{apuver} \ --with-ldap --without-gdbm \ - --with-sqlite3 --with-pgsql --with-mysql --with-freetds --with-odbc \ + --with-sqlite3 --with-pgsql --with-mysql --with-odbc \ --with-berkeley-db \ --with-crypto --with-openssl --with-nss \ --without-sqlite2 @@ -176,10 +166,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %{_libdir}/apr-util-%{apuver}/apr_dbd_sqlite* -%files freetds -%defattr(-,root,root,-) -%{_libdir}/apr-util-%{apuver}/apr_dbd_freetds* - %files odbc %defattr(-,root,root,-) %{_libdir}/apr-util-%{apuver}/apr_dbd_odbc* @@ -203,7 +189,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libaprutil-%{apuver}.so %{_libdir}/pkgconfig/apr-util-%{apuver}.pc %{_includedir}/apr-%{apuver}/*.h -%doc --parents html +%doc html %changelog * Tue Jun 22 2004 Graham Leggett 1.0.0-1 Modified: stable/12/contrib/apr-util/aprutil.dsw ============================================================================== --- stable/12/contrib/apr-util/aprutil.dsw Sun Jun 14 16:47:16 2020 (r362179) +++ stable/12/contrib/apr-util/aprutil.dsw Sun Jun 14 17:36:43 2020 (r362180) @@ -51,24 +51,6 @@ Package=<4> ############################################################################### -Project: "apr_dbd_freetds"=".\dbd\apr_dbd_freetds.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libapr - End Project Dependency - Begin Project Dependency - Project_Dep_Name libaprutil - End Project Dependency -}}} - -############################################################################### - Project: "apr_dbd_mysql"=".\dbd\apr_dbd_mysql.dsp" - Package Owner=<4> Package=<5> @@ -275,9 +257,6 @@ Package=<4> Begin Project Dependency Project_Dep_Name apriconv End Project Dependency - Begin Project Dependency - Project_Dep_Name xml - End Project Dependency }}} ############################################################################### @@ -383,9 +362,6 @@ Package=<4> Begin Project Dependency Project_Dep_Name libapriconv_ces_modules End Project Dependency - Begin Project Dependency - Project_Dep_Name xml - End Project Dependency }}} ############################################################################### @@ -449,18 +425,6 @@ Package=<4> Begin Project Dependency Project_Dep_Name libapr End Project Dependency -}}} - -############################################################################### - -Project: "xml"=".\xml\expat\lib\xml.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jun 14 18:20:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFB0B341896 for ; Sun, 14 Jun 2020 18:20:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lN6g0fNFz4kJD for ; Sun, 14 Jun 2020 18:20:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72d.google.com with SMTP id f18so13767618qkh.1 for ; Sun, 14 Jun 2020 11:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j303Dl7XWTUuflOyU4qEjHs80lsbbtb4NCinBNBKFy0=; b=hNf0Iq1YIYTG9YOyiSaOx6JrS/N+cqw5mDuHB21PVt/SoSbYMpDYunUNl8WtSjCIRb yEjLuz02OsbfoFEtLuNW9aZ1SGwDl2Aw5eezEbcOplh18iaZhljE8AkSPIII7GjbdjUt hWrEd2jlnW8UIE2oieGLzEJjFiZQGGo8iPf/sLazRbevJKytOMmCFZc1y2V6xalBzJHy yJORtqT4v7XiyoREJRLWIodW2N/sv6kbW7JLs00VyZ8ftUs04vAtV9Wx35SnC4eJxXQ1 DbvxIUcDbpX42kZJyQgwfIqW7V0ucPj6gIA6cQcPC6YEJFTLutDZ/O0fI91gwcPsSNaB OPXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j303Dl7XWTUuflOyU4qEjHs80lsbbtb4NCinBNBKFy0=; b=KHZ+68kDuunYbJuMwV/SLIT+E01iZahaWAJ7NJWVZy2qqiw/ANGFVU1GwIs0MOUs0O 8l2akpeg+1dAQAsTyHGepeil/2azjp0WyOLRuDLUYjOnjCc5qzXc/SqzigWl5jvF3zTa 3hfa8FASm5CJtkfl4AHKCOc6+i/nKzLgmUDyNkIfQrBPKeoETGHaTCaQrmSsO9zzVD1B 7VUzt3Spx84WFXPZSEBU/ZB8WgwyHfaLUqwGgDEGTon8qEWkfFt+XU0Kmwc/+YJpIHKf /tdDzKsHsftzB7GR0AjRhjmEHqVSzjKJNJL/L34Dwa+ldvbasSCfA9KcnmOtS6l03djN C1Bw== X-Gm-Message-State: AOAM530wa+vV/OAmuWcz5n7KU97EA/Zct/2ShQF205gvbIvHfeNXrp5N 8kBhZ7Cveoh2yDjEaMfOmz/7vvTTthMHaDwH/rsigw== X-Google-Smtp-Source: ABdhPJxV7BhiRMvrzenP2Xxv5J9fQo9unJaK9xP0Cv4be/vr0xGAJ0xEW/UAvy8GlMlHvaQ5YcNascgU+zDZvY3JfW4= X-Received: by 2002:a05:620a:127c:: with SMTP id b28mr11119456qkl.240.1592158809556; Sun, 14 Jun 2020 11:20:09 -0700 (PDT) MIME-Version: 1.0 References: <202006140550.05E5oSKj073645@repo.freebsd.org> <202006141457.05EEvH2Q072897@gndrsh.dnsmgr.net> In-Reply-To: <202006141457.05EEvH2Q072897@gndrsh.dnsmgr.net> From: Warner Losh Date: Sun, 14 Jun 2020 12:19:57 -0600 Message-ID: Subject: Re: svn commit: r362170 - in head/cddl/contrib/opensolaris/cmd: dtrace lockstat zdb zfs zpool zstreamdump To: "Rodney W. Grimes" Cc: Gordon Bergling , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 49lN6g0fNFz4kJD X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=hNf0Iq1Y; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72d) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.95 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.74)[-0.743]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.82)[-0.825]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.39)[-0.386]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72d:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 18:20:11 -0000 On Sun, Jun 14, 2020, 8:57 AM Rodney W. Grimes wrote: > > Author: gbe (doc committer) > > Date: Sun Jun 14 05:50:28 2020 > > New Revision: 362170 > > URL: https://svnweb.freebsd.org/changeset/base/362170 > > > > Log: > > Add HISTORY sections to ZFS and dtrace manpage > > > > Reviewed by: bcr (mentor) > > Approved by: bcr (mentor) > > MFC after: 7 days > > Differential Revision: https://reviews.freebsd.org/D23833 > > > > Modified: > > head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > > head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 > > head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 > > head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 > > head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 > > head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 > > Is this really the correct history? Didnt all of these first > appear in Solaris? > > The man page may of first appeared in FreeBSD, but the commands > themselves originated some place else? > They did first appear in FreeBSD as indicated (as far as I could tell). They originated in Solaris as well and could have that indicated as well. Other places in the tree note both where appropriate, but sometimes fall short noting only the first FreeBSD release they appeared in. Warner > > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > > > ============================================================================== > > --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 > 05:35:02 2020 (r362169) > > +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sun Jun 14 > 05:50:28 2020 (r362170) > > @@ -20,7 +20,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd October 30, 2018 > > +.Dd February 25, 2020 > > .Dt DTRACE 1 > > .Os > > .Sh NAME > > @@ -776,6 +776,11 @@ failed or that the specified request could not be > sati > > .It 2 > > Invalid command line options or arguments were specified. > > .El > > +.Sh HISTORY > > +The > > +.Nm > > +utility first appeared in > > +.Fx 7.1 . > > .Sh SEE ALSO > > .Xr cpp 1 , > > .Xr elf 5 , > > > > Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 > > > ============================================================================== > > --- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 > 05:35:02 2020 (r362169) > > +++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Jun 14 > 05:50:28 2020 (r362170) > > @@ -21,7 +21,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd September 29, 2015 > > +.Dd February 25, 2020 > > .Dt LOCKSTAT 1 > > .Os > > .Sh NAME > > @@ -366,6 +366,11 @@ Count indv cuml rcnt nsec Lock > C > > .Xr dtrace 1 , > > .Xr ksyms 4 , > > .Xr locking 9 > > +.Sh HISTORY > > +The > > +.Nm > > +utility first appeared in > > +.Fx 7.1 . > > .Sh NOTES > > Tail-call elimination can affect call sites. > > For example, if > > > > Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 > > > ============================================================================== > > --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Jun 14 > 05:35:02 2020 (r362169) > > +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Jun 14 > 05:50:28 2020 (r362170) > > @@ -13,7 +13,7 @@ > > .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. > > .\" Copyright 2017 Nexenta Systems, Inc. > > .\" > > -.Dd October 06, 2017 > > +.Dd February 25, 2020 > > .Dt ZDB 8 > > .Os > > .Sh NAME > > @@ -407,3 +407,8 @@ dedup = 1.11, compress = 1.80, copies = 1.00, dedup > * > > .Sh SEE ALSO > > .Xr zfs 8 , > > .Xr zpool 8 > > +.Sh HISTORY > > +The > > +.Nm > > +utility first appeared in > > +.Fx 7.0 . > > > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 > > > ============================================================================== > > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Jun 14 > 05:35:02 2020 (r362169) > > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Jun 14 > 05:50:28 2020 (r362170) > > @@ -3949,6 +3949,11 @@ M F /tank/test/modified > > .Xr umount 8 , > > .Xr zfs-program 8 , > > .Xr zpool 8 > > +.Sh HISTORY > > +The > > +.Nm > > +utility first appeared in > > +.Fx 7.0 . > > .Sh AUTHORS > > This manual page is a > > .Xr mdoc 7 > > > > Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 > > > ============================================================================== > > --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 14 > 05:35:02 2020 (r362169) > > +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 14 > 05:50:28 2020 (r362170) > > @@ -29,7 +29,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd November 7, 2019 > > +.Dd February 25, 2020 > > .Dt ZPOOL 8 > > .Os > > .Sh NAME > > @@ -2462,6 +2462,11 @@ Discarded approximately 29 seconds of > transactions. > > .Xr zpool-features 7 , > > .Xr zfs 8 , > > .Xr zfsd 8 > > +.Sh HISTORY > > +The > > +.Nm > > +utility first appeared in > > +.Fx 7.0 . > > .Sh AUTHORS > > This manual page is a > > .Xr mdoc 7 > > > > Modified: head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 > > > ============================================================================== > > --- head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 > Sun Jun 14 05:35:02 2020 (r362169) > > +++ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 > Sun Jun 14 05:50:28 2020 (r362170) > > @@ -22,7 +22,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd December 31, 2013 > > +.Dd February 25, 2020 > > .Dt ZSTREAMDUMP 8 > > .Os > > .Sh NAME > > @@ -52,6 +52,11 @@ Verbose. Dump all headers, not only begin and end head > > .El > > .Sh SEE ALSO > > .Xr zfs 8 > > +.Sh HISTORY > > +The > > +.Nm > > +utility first appeared in > > +.Fx 7.0 . > > .Sh AUTHORS > > This manual page is a > > .Xr mdoc 7 > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Sun Jun 14 18:49:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 597AD341E90; Sun, 14 Jun 2020 18:49:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lNm6121Tz4lw8; Sun, 14 Jun 2020 18:49:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D8E710BB8; Sun, 14 Jun 2020 18:49:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EInAYT062993; Sun, 14 Jun 2020 18:49:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EIn7hc062981; Sun, 14 Jun 2020 18:49:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202006141849.05EIn7hc062981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Jun 2020 18:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362181 - in stable/11: contrib/apr contrib/apr-util contrib/apr-util/buckets contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbd/unsupported contrib/apr-util/dbm/sdbm con... X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: contrib/apr contrib/apr-util contrib/apr-util/buckets contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbd/unsupported contrib/apr-util/dbm/sdbm contrib/apr-util/include con... X-SVN-Commit-Revision: 362181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 18:49:10 -0000 Author: dim Date: Sun Jun 14 18:49:06 2020 New Revision: 362181 URL: https://svnweb.freebsd.org/changeset/base/362181 Log: Update Subversion and dependencies to 1.14.0 LTS. MFC r323365 (by jonathan): Remove redundant source and object files. Reviewed by: bdrewery, ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12208 MFC r327739 (by asomers): Add Pull Request to the Subversion commit template Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D13178 MFC r333354 (by peter): Update svn-1.9.7 to 1.10.0. MFC r333355 (by peter): Update svn/svnlite from 1.9.7 to 1.10.0 MFC r333387 (by peter): Update svn_private_config.h - I misread an autoconf change. SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL -> SVN_LIBSVN_RA_LINKS_RA_LOCAL SVN_LIBSVN_CLIENT_LINKS_RA_SERF -> SVN_LIBSVN_RA_LINKS_RA_SERF SVN_LIBSVN_CLIENT_LINKS_RA_SVN -> SVN_LIBSVN_RA_LINKS_RA_SVN MFC r339256 (by jhb): Update Apache Serf to 1.3.9 to support OpenSSL 1.1.1. Approved by: re (rgrimes) MFC r352156 (by imp): Remove directory empty after r266735 MFC r357299 (by cem): contrib/apr: Remove scope leak UB In apr_vformatter, the variable buf was declared inside a limited scope region, but a pointer to it is leaked outside of that region and used later. This is undefined behavior. Fix by moving the buf variable to function scope. Reported by: Coverity CID: 1192541 MFC r357301 (by cem): contrib/apr: Rip out bogus [CS]PRNG implementation This construction used some relatively slow design involving SHA2; even if it were fed real entropy (unclear; external to the design), it did not handle fork in a safe way, and it was difficult to audit for correctness. So just rip it out and use the very simple and known-correct arc4random(3) interface in its place. MFC r361677: Change Makefiles under usr.bin/svn to make them easier to incrementally update. No functional change intended. MFC r361678: Update apr to 1.7.0. See contrib/apr/CHANGES for a summary of changes. MFC r361681: Change more Makefiles under usr.bin/svn to make them easier to incrementally update. No functional change intended. MFC r361684 (by kevans): apr: build some needed emulated 64-bit atomic bits after r361678 This should fix the build on armv{6,7}, mips, and mips64, which all need emulated 64-bit atomics for apr. MFC r361691: Follow-up r361678 (update apr to 1.7.0) by also regenerating the apr internal headers through the upstream configure script, with some minor custom tweaks. MFC r361692: Update apr-util to 1.6.1. See contrib/apr-util/CHANGES for a summary of changes. MFC r361693: Update Subversion to 1.14.0 LTS. See contrib/subversion/CHANGES for a summary of changes, or for a more thorough overview: https://subversion.apache.org/docs/release-notes/1.14 NOTE: there is no need to dump and reload repositories, and the working copy format is still the same as Subversion 1.8 through 1.13. Relnotes: yes Added: stable/11/contrib/apr-util/CMakeLists.txt - copied unchanged from r361692, head/contrib/apr-util/CMakeLists.txt stable/11/contrib/apr-util/README.FREETDS - copied unchanged from r361692, head/contrib/apr-util/README.FREETDS stable/11/contrib/apr-util/README.cmake - copied unchanged from r361692, head/contrib/apr-util/README.cmake stable/11/contrib/apr-util/crypto/apr_crypto_commoncrypto.c - copied unchanged from r361692, head/contrib/apr-util/crypto/apr_crypto_commoncrypto.c stable/11/contrib/apr-util/crypto/apr_siphash.c - copied unchanged from r361692, head/contrib/apr-util/crypto/apr_siphash.c stable/11/contrib/apr-util/dbd/unsupported/ - copied from r361692, head/contrib/apr-util/dbd/unsupported/ stable/11/contrib/apr-util/include/apr_ldap.hwc - copied unchanged from r361692, head/contrib/apr-util/include/apr_ldap.hwc stable/11/contrib/apr-util/include/apr_redis.h - copied unchanged from r361692, head/contrib/apr-util/include/apr_redis.h stable/11/contrib/apr-util/include/apr_siphash.h - copied unchanged from r361692, head/contrib/apr-util/include/apr_siphash.h stable/11/contrib/apr-util/include/apu.hwc - copied unchanged from r361692, head/contrib/apr-util/include/apu.hwc stable/11/contrib/apr-util/redis/ - copied from r361692, head/contrib/apr-util/redis/ stable/11/contrib/apr-util/test/testredis.c - copied unchanged from r361692, head/contrib/apr-util/test/testredis.c stable/11/contrib/apr-util/test/testsiphash.c - copied unchanged from r361692, head/contrib/apr-util/test/testsiphash.c stable/11/contrib/apr/atomic/unix/builtins64.c - copied unchanged from r361678, head/contrib/apr/atomic/unix/builtins64.c stable/11/contrib/apr/atomic/unix/mutex64.c - copied unchanged from r361678, head/contrib/apr/atomic/unix/mutex64.c stable/11/contrib/apr/encoding/apr_encode.c - copied unchanged from r361678, head/contrib/apr/encoding/apr_encode.c stable/11/contrib/apr/include/apr_cstr.h - copied unchanged from r361678, head/contrib/apr/include/apr_cstr.h stable/11/contrib/apr/include/apr_encode.h - copied unchanged from r361678, head/contrib/apr/include/apr_encode.h stable/11/contrib/apr/include/apr_perms_set.h - copied unchanged from r361678, head/contrib/apr/include/apr_perms_set.h stable/11/contrib/apr/poll/unix/wakeup.c - copied unchanged from r361678, head/contrib/apr/poll/unix/wakeup.c stable/11/contrib/apr/strings/apr_cstr.c - copied unchanged from r361678, head/contrib/apr/strings/apr_cstr.c stable/11/contrib/serf/STATUS - copied unchanged from r339256, head/contrib/serf/STATUS stable/11/contrib/subversion/.editorconfig - copied, changed from r333354, head/contrib/subversion/.editorconfig stable/11/contrib/subversion/.swig_pl_checked - copied unchanged from r361693, head/contrib/subversion/.swig_pl_checked stable/11/contrib/subversion/.swig_py_checked - copied unchanged from r361693, head/contrib/subversion/.swig_py_checked stable/11/contrib/subversion/.swig_rb_checked - copied unchanged from r361693, head/contrib/subversion/.swig_rb_checked stable/11/contrib/subversion/subversion/include/private/ra_svn_wrapped_sasl.h - copied unchanged from r333354, head/contrib/subversion/subversion/include/private/ra_svn_wrapped_sasl.h stable/11/contrib/subversion/subversion/include/private/svn_branch.h - copied, changed from r333354, head/contrib/subversion/subversion/include/private/svn_branch.h stable/11/contrib/subversion/subversion/include/private/svn_branch_compat.h - copied unchanged from r333354, head/contrib/subversion/subversion/include/private/svn_branch_compat.h stable/11/contrib/subversion/subversion/include/private/svn_branch_impl.h - copied unchanged from r333354, head/contrib/subversion/subversion/include/private/svn_branch_impl.h stable/11/contrib/subversion/subversion/include/private/svn_branch_nested.h - copied unchanged from r333354, head/contrib/subversion/subversion/include/private/svn_branch_nested.h stable/11/contrib/subversion/subversion/include/private/svn_branch_repos.h - copied unchanged from r333354, head/contrib/subversion/subversion/include/private/svn_branch_repos.h stable/11/contrib/subversion/subversion/include/private/svn_client_shelf.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/private/svn_client_shelf.h stable/11/contrib/subversion/subversion/include/private/svn_client_shelf2.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/private/svn_client_shelf2.h stable/11/contrib/subversion/subversion/include/private/svn_config_private.h - copied unchanged from r333354, head/contrib/subversion/subversion/include/private/svn_config_private.h stable/11/contrib/subversion/subversion/include/private/svn_dirent_uri_private.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/private/svn_dirent_uri_private.h stable/11/contrib/subversion/subversion/include/private/svn_element.h - copied, changed from r333354, head/contrib/subversion/subversion/include/private/svn_element.h stable/11/contrib/subversion/subversion/include/svn_opt_impl.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/svn_opt_impl.h stable/11/contrib/subversion/subversion/include/svn_types_impl.h - copied unchanged from r361693, head/contrib/subversion/subversion/include/svn_types_impl.h stable/11/contrib/subversion/subversion/libsvn_client/conflicts.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_client/conflicts.c stable/11/contrib/subversion/subversion/libsvn_client/layout.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/layout.c stable/11/contrib/subversion/subversion/libsvn_client/merge_elements.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_client/merge_elements.c stable/11/contrib/subversion/subversion/libsvn_client/shelf.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/shelf.c stable/11/contrib/subversion/subversion/libsvn_client/shelf2.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/shelf2.c stable/11/contrib/subversion/subversion/libsvn_client/wc_editor.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_client/wc_editor.c stable/11/contrib/subversion/subversion/libsvn_delta/branch.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_delta/branch.c stable/11/contrib/subversion/subversion/libsvn_delta/branch_compat.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_delta/branch_compat.c stable/11/contrib/subversion/subversion/libsvn_delta/branch_migrate.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_delta/branch_migrate.c stable/11/contrib/subversion/subversion/libsvn_delta/branch_nested.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_delta/branch_nested.c stable/11/contrib/subversion/subversion/libsvn_delta/branch_repos.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_delta/branch_repos.c stable/11/contrib/subversion/subversion/libsvn_delta/element.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_delta/element.c stable/11/contrib/subversion/subversion/libsvn_fs_base/fs_init.h - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_fs_base/fs_init.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs_init.h - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_fs_fs/fs_init.h stable/11/contrib/subversion/subversion/libsvn_fs_x/batch_fsync.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_fs_x/batch_fsync.c stable/11/contrib/subversion/subversion/libsvn_fs_x/batch_fsync.h - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_fs_x/batch_fsync.h stable/11/contrib/subversion/subversion/libsvn_fs_x/dag_cache.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_fs_x/dag_cache.c stable/11/contrib/subversion/subversion/libsvn_fs_x/dag_cache.h - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_fs_x/dag_cache.h stable/11/contrib/subversion/subversion/libsvn_fs_x/fs_init.h - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_fs_x/fs_init.h stable/11/contrib/subversion/subversion/libsvn_ra_serf/list.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_ra_serf/list.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/request_body.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_ra_serf/request_body.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/stream_bucket.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_ra_serf/stream_bucket.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/wrapped_sasl.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_ra_svn/wrapped_sasl.c stable/11/contrib/subversion/subversion/libsvn_repos/authz.h - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_repos/authz.h stable/11/contrib/subversion/subversion/libsvn_repos/authz_info.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_repos/authz_info.c stable/11/contrib/subversion/subversion/libsvn_repos/authz_parse.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_repos/authz_parse.c stable/11/contrib/subversion/subversion/libsvn_repos/compat.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_repos/compat.c stable/11/contrib/subversion/subversion/libsvn_repos/config_file.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_repos/config_file.c stable/11/contrib/subversion/subversion/libsvn_repos/config_file.h - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_repos/config_file.h stable/11/contrib/subversion/subversion/libsvn_repos/dump_editor.c - copied unchanged from r361693, head/contrib/subversion/subversion/libsvn_repos/dump_editor.c stable/11/contrib/subversion/subversion/libsvn_repos/list.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_repos/list.c stable/11/contrib/subversion/subversion/libsvn_subr/cache-null.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/cache-null.c stable/11/contrib/subversion/subversion/libsvn_subr/compress_lz4.c - copied, changed from r333354, head/contrib/subversion/subversion/libsvn_subr/compress_lz4.c stable/11/contrib/subversion/subversion/libsvn_subr/compress_zlib.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/compress_zlib.c stable/11/contrib/subversion/subversion/libsvn_subr/encode.c - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/encode.c stable/11/contrib/subversion/subversion/libsvn_subr/lz4/ - copied from r333354, head/contrib/subversion/subversion/libsvn_subr/lz4/ stable/11/contrib/subversion/subversion/libsvn_subr/pools.h - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/pools.h stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/LICENSE.md - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/utf8proc/LICENSE.md stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/NEWS.md - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/utf8proc/NEWS.md stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/README.md - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/utf8proc/README.md stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/lump.md - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/utf8proc/lump.md stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/utf8proc_internal.h - copied unchanged from r333354, head/contrib/subversion/subversion/libsvn_subr/utf8proc/utf8proc_internal.h stable/11/contrib/subversion/subversion/svn/filesize.c - copied unchanged from r361693, head/contrib/subversion/subversion/svn/filesize.c stable/11/contrib/subversion/subversion/svn/shelf-cmd.c - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf-cmd.c stable/11/contrib/subversion/subversion/svn/shelf-cmd.h - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf-cmd.h stable/11/contrib/subversion/subversion/svn/shelf2-cmd.c - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf2-cmd.c stable/11/contrib/subversion/subversion/svn/shelf2-cmd.h - copied unchanged from r361693, head/contrib/subversion/subversion/svn/shelf2-cmd.h stable/11/usr.bin/svn/lib/libapr/apr_escape_test_char.h - copied unchanged from r361678, head/usr.bin/svn/lib/libapr/apr_escape_test_char.h Replaced: stable/11/contrib/apr/include/private/ - copied from r361678, head/contrib/apr/include/private/ Deleted: stable/11/contrib/apr-util/dbd/NWGNUdbdfreetds stable/11/contrib/apr-util/dbd/apr_dbd_freetds.c stable/11/contrib/subversion/doc/programmer/gtest-guide.txt stable/11/contrib/subversion/subversion/libsvn_client/copy_foreign.c stable/11/contrib/subversion/subversion/libsvn_delta/debug_editor.h stable/11/contrib/subversion/subversion/libsvn_ra_serf/README stable/11/contrib/subversion/subversion/libsvn_repos/authz_pool.c stable/11/contrib/subversion/subversion/libsvn_subr/compress.c stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/LICENSE stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/README stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/utf8proc.h Modified: stable/11/contrib/apr-util/CHANGES stable/11/contrib/apr-util/LICENSE stable/11/contrib/apr-util/Makefile.in stable/11/contrib/apr-util/Makefile.win stable/11/contrib/apr-util/NOTICE stable/11/contrib/apr-util/NWGNUmakefile stable/11/contrib/apr-util/README stable/11/contrib/apr-util/apr-util.spec stable/11/contrib/apr-util/aprutil.dsw stable/11/contrib/apr-util/apu-config.in stable/11/contrib/apr-util/buckets/apr_buckets_alloc.c stable/11/contrib/apr-util/buckets/apr_buckets_file.c stable/11/contrib/apr-util/build-outputs.mk stable/11/contrib/apr-util/build.conf stable/11/contrib/apr-util/buildconf stable/11/contrib/apr-util/configure stable/11/contrib/apr-util/configure.in stable/11/contrib/apr-util/crypto/apr_crypto.c stable/11/contrib/apr-util/crypto/apr_crypto_nss.c stable/11/contrib/apr-util/crypto/apr_crypto_openssl.c stable/11/contrib/apr-util/crypto/crypt_blowfish.c stable/11/contrib/apr-util/dbd/NWGNUmakefile stable/11/contrib/apr-util/dbd/apr_dbd.c stable/11/contrib/apr-util/dbm/sdbm/sdbm.c stable/11/contrib/apr-util/dbm/sdbm/sdbm_pair.c stable/11/contrib/apr-util/include/apr_buckets.h stable/11/contrib/apr-util/include/apr_crypto.h stable/11/contrib/apr-util/include/apr_dbd.h stable/11/contrib/apr-util/include/apr_xml.h stable/11/contrib/apr-util/include/apu.h.in stable/11/contrib/apr-util/include/apu.hnw stable/11/contrib/apr-util/include/apu.hw stable/11/contrib/apr-util/include/apu_version.h stable/11/contrib/apr-util/include/private/apr_crypto_internal.h stable/11/contrib/apr-util/include/private/apu_config.h.in stable/11/contrib/apr-util/memcache/apr_memcache.c stable/11/contrib/apr-util/test/Makefile.in stable/11/contrib/apr-util/test/Makefile.win stable/11/contrib/apr-util/test/NWGNUaputest stable/11/contrib/apr-util/test/abts_tests.h stable/11/contrib/apr-util/test/testall.dsw stable/11/contrib/apr-util/test/testcrypto.c stable/11/contrib/apr-util/test/testutil.h stable/11/contrib/apr-util/xml/apr_xml.c stable/11/contrib/apr/CHANGES stable/11/contrib/apr/CMakeLists.txt stable/11/contrib/apr/Makefile.in stable/11/contrib/apr/Makefile.win stable/11/contrib/apr/NOTICE stable/11/contrib/apr/NWGNUmakefile stable/11/contrib/apr/apr.dsp stable/11/contrib/apr/apr.mak stable/11/contrib/apr/apr.spec stable/11/contrib/apr/atomic/unix/ia32.c stable/11/contrib/apr/atomic/unix/mutex.c stable/11/contrib/apr/atomic/unix/ppc.c stable/11/contrib/apr/atomic/unix/s390.c stable/11/contrib/apr/atomic/unix/solaris.c stable/11/contrib/apr/build-outputs.mk stable/11/contrib/apr/buildconf stable/11/contrib/apr/config.layout stable/11/contrib/apr/configure stable/11/contrib/apr/configure.in stable/11/contrib/apr/docs/APRDesign.html stable/11/contrib/apr/docs/canonical_filenames.html stable/11/contrib/apr/docs/incomplete_types stable/11/contrib/apr/docs/pool-design.html stable/11/contrib/apr/encoding/apr_escape.c stable/11/contrib/apr/file_io/unix/copy.c stable/11/contrib/apr/file_io/unix/dir.c stable/11/contrib/apr/file_io/unix/flock.c stable/11/contrib/apr/file_io/unix/pipe.c stable/11/contrib/apr/file_io/unix/readwrite.c stable/11/contrib/apr/file_io/unix/seek.c stable/11/contrib/apr/include/apr.h.in stable/11/contrib/apr/include/apr.hnw stable/11/contrib/apr/include/apr.hw stable/11/contrib/apr/include/apr.hwc stable/11/contrib/apr/include/apr_allocator.h stable/11/contrib/apr/include/apr_atomic.h stable/11/contrib/apr/include/apr_errno.h stable/11/contrib/apr/include/apr_escape.h stable/11/contrib/apr/include/apr_file_info.h stable/11/contrib/apr/include/apr_file_io.h stable/11/contrib/apr/include/apr_general.h stable/11/contrib/apr/include/apr_global_mutex.h stable/11/contrib/apr/include/apr_hash.h stable/11/contrib/apr/include/apr_network_io.h stable/11/contrib/apr/include/apr_poll.h stable/11/contrib/apr/include/apr_portable.h stable/11/contrib/apr/include/apr_proc_mutex.h stable/11/contrib/apr/include/apr_shm.h stable/11/contrib/apr/include/apr_skiplist.h stable/11/contrib/apr/include/apr_strings.h stable/11/contrib/apr/include/apr_tables.h stable/11/contrib/apr/include/apr_thread_mutex.h stable/11/contrib/apr/include/apr_thread_proc.h stable/11/contrib/apr/include/apr_time.h stable/11/contrib/apr/include/apr_version.h stable/11/contrib/apr/include/arch/unix/apr_arch_atomic.h stable/11/contrib/apr/include/arch/unix/apr_arch_networkio.h stable/11/contrib/apr/include/arch/unix/apr_arch_poll_private.h stable/11/contrib/apr/include/arch/unix/apr_arch_proc_mutex.h stable/11/contrib/apr/include/arch/unix/apr_arch_shm.h stable/11/contrib/apr/include/arch/unix/apr_arch_thread_mutex.h stable/11/contrib/apr/include/arch/unix/apr_arch_threadproc.h stable/11/contrib/apr/include/arch/unix/apr_private.h.in stable/11/contrib/apr/libapr.dsp stable/11/contrib/apr/libapr.mak stable/11/contrib/apr/locks/unix/global_mutex.c stable/11/contrib/apr/locks/unix/proc_mutex.c stable/11/contrib/apr/locks/unix/thread_cond.c stable/11/contrib/apr/locks/unix/thread_mutex.c stable/11/contrib/apr/memory/unix/apr_pools.c stable/11/contrib/apr/misc/unix/errorcodes.c stable/11/contrib/apr/misc/unix/rand.c stable/11/contrib/apr/network_io/unix/multicast.c stable/11/contrib/apr/network_io/unix/sockaddr.c stable/11/contrib/apr/network_io/unix/sockets.c stable/11/contrib/apr/network_io/unix/sockopt.c stable/11/contrib/apr/poll/unix/epoll.c stable/11/contrib/apr/poll/unix/kqueue.c stable/11/contrib/apr/poll/unix/poll.c stable/11/contrib/apr/poll/unix/pollcb.c stable/11/contrib/apr/poll/unix/pollset.c stable/11/contrib/apr/poll/unix/port.c stable/11/contrib/apr/poll/unix/select.c stable/11/contrib/apr/poll/unix/z_asio.c stable/11/contrib/apr/random/unix/apr_random.c stable/11/contrib/apr/shmem/unix/shm.c stable/11/contrib/apr/strings/apr_cpystrn.c stable/11/contrib/apr/strings/apr_fnmatch.c stable/11/contrib/apr/strings/apr_snprintf.c stable/11/contrib/apr/tables/apr_skiplist.c stable/11/contrib/apr/tables/apr_tables.c stable/11/contrib/apr/threadproc/unix/proc.c stable/11/contrib/apr/threadproc/unix/signals.c stable/11/contrib/apr/tools/gen_test_char.c stable/11/contrib/serf/CHANGES stable/11/contrib/serf/NOTICE stable/11/contrib/serf/README stable/11/contrib/serf/SConstruct stable/11/contrib/serf/auth/auth.c stable/11/contrib/serf/auth/auth.h stable/11/contrib/serf/auth/auth_basic.c stable/11/contrib/serf/auth/auth_digest.c stable/11/contrib/serf/auth/auth_spnego.c stable/11/contrib/serf/auth/auth_spnego.h stable/11/contrib/serf/auth/auth_spnego_gss.c stable/11/contrib/serf/auth/auth_spnego_sspi.c stable/11/contrib/serf/buckets/aggregate_buckets.c stable/11/contrib/serf/buckets/allocator.c stable/11/contrib/serf/buckets/barrier_buckets.c stable/11/contrib/serf/buckets/buckets.c stable/11/contrib/serf/buckets/bwtp_buckets.c stable/11/contrib/serf/buckets/chunk_buckets.c stable/11/contrib/serf/buckets/dechunk_buckets.c stable/11/contrib/serf/buckets/deflate_buckets.c stable/11/contrib/serf/buckets/file_buckets.c stable/11/contrib/serf/buckets/headers_buckets.c stable/11/contrib/serf/buckets/iovec_buckets.c stable/11/contrib/serf/buckets/limit_buckets.c stable/11/contrib/serf/buckets/mmap_buckets.c stable/11/contrib/serf/buckets/request_buckets.c stable/11/contrib/serf/buckets/response_body_buckets.c stable/11/contrib/serf/buckets/response_buckets.c stable/11/contrib/serf/buckets/simple_buckets.c stable/11/contrib/serf/buckets/socket_buckets.c stable/11/contrib/serf/buckets/ssl_buckets.c stable/11/contrib/serf/build/check.py stable/11/contrib/serf/build/gen_def.py stable/11/contrib/serf/context.c stable/11/contrib/serf/incoming.c stable/11/contrib/serf/outgoing.c stable/11/contrib/serf/serf.h stable/11/contrib/serf/serf_bucket_types.h stable/11/contrib/serf/serf_bucket_util.h stable/11/contrib/serf/serf_private.h stable/11/contrib/serf/ssltunnel.c stable/11/contrib/subversion/CHANGES stable/11/contrib/subversion/COMMITTERS stable/11/contrib/subversion/INSTALL stable/11/contrib/subversion/LICENSE stable/11/contrib/subversion/Makefile.in stable/11/contrib/subversion/NOTICE stable/11/contrib/subversion/README stable/11/contrib/subversion/aclocal.m4 stable/11/contrib/subversion/autogen.sh stable/11/contrib/subversion/build-outputs.mk stable/11/contrib/subversion/build.conf stable/11/contrib/subversion/configure stable/11/contrib/subversion/configure.ac stable/11/contrib/subversion/doc/doxygen.conf stable/11/contrib/subversion/doc/user/svn-best-practices.html stable/11/contrib/subversion/gen-make.py stable/11/contrib/subversion/get-deps.sh stable/11/contrib/subversion/subversion/include/private/ra_svn_sasl.h stable/11/contrib/subversion/subversion/include/private/svn_atomic.h stable/11/contrib/subversion/subversion/include/private/svn_cache.h stable/11/contrib/subversion/subversion/include/private/svn_client_mtcc.h stable/11/contrib/subversion/subversion/include/private/svn_client_private.h stable/11/contrib/subversion/subversion/include/private/svn_cmdline_private.h stable/11/contrib/subversion/subversion/include/private/svn_delta_private.h stable/11/contrib/subversion/subversion/include/private/svn_dep_compat.h stable/11/contrib/subversion/subversion/include/private/svn_diff_private.h stable/11/contrib/subversion/subversion/include/private/svn_diff_tree.h stable/11/contrib/subversion/subversion/include/private/svn_fs_fs_private.h stable/11/contrib/subversion/subversion/include/private/svn_fs_private.h stable/11/contrib/subversion/subversion/include/private/svn_fs_util.h stable/11/contrib/subversion/subversion/include/private/svn_io_private.h stable/11/contrib/subversion/subversion/include/private/svn_log.h stable/11/contrib/subversion/subversion/include/private/svn_mergeinfo_private.h stable/11/contrib/subversion/subversion/include/private/svn_mutex.h stable/11/contrib/subversion/subversion/include/private/svn_object_pool.h stable/11/contrib/subversion/subversion/include/private/svn_packed_data.h stable/11/contrib/subversion/subversion/include/private/svn_ra_svn_private.h stable/11/contrib/subversion/subversion/include/private/svn_repos_private.h stable/11/contrib/subversion/subversion/include/private/svn_sorts_private.h stable/11/contrib/subversion/subversion/include/private/svn_sqlite.h stable/11/contrib/subversion/subversion/include/private/svn_string_private.h stable/11/contrib/subversion/subversion/include/private/svn_subr_private.h stable/11/contrib/subversion/subversion/include/private/svn_temp_serializer.h stable/11/contrib/subversion/subversion/include/private/svn_utf_private.h stable/11/contrib/subversion/subversion/include/private/svn_wc_private.h stable/11/contrib/subversion/subversion/include/svn_auth.h stable/11/contrib/subversion/subversion/include/svn_base64.h stable/11/contrib/subversion/subversion/include/svn_checksum.h stable/11/contrib/subversion/subversion/include/svn_client.h stable/11/contrib/subversion/subversion/include/svn_cmdline.h stable/11/contrib/subversion/subversion/include/svn_config.h stable/11/contrib/subversion/subversion/include/svn_dav.h stable/11/contrib/subversion/subversion/include/svn_delta.h stable/11/contrib/subversion/subversion/include/svn_diff.h stable/11/contrib/subversion/subversion/include/svn_dirent_uri.h stable/11/contrib/subversion/subversion/include/svn_error.h stable/11/contrib/subversion/subversion/include/svn_error_codes.h stable/11/contrib/subversion/subversion/include/svn_fs.h stable/11/contrib/subversion/subversion/include/svn_hash.h stable/11/contrib/subversion/subversion/include/svn_io.h stable/11/contrib/subversion/subversion/include/svn_opt.h stable/11/contrib/subversion/subversion/include/svn_props.h stable/11/contrib/subversion/subversion/include/svn_ra.h stable/11/contrib/subversion/subversion/include/svn_ra_svn.h stable/11/contrib/subversion/subversion/include/svn_repos.h stable/11/contrib/subversion/subversion/include/svn_string.h stable/11/contrib/subversion/subversion/include/svn_time.h stable/11/contrib/subversion/subversion/include/svn_types.h stable/11/contrib/subversion/subversion/include/svn_user.h stable/11/contrib/subversion/subversion/include/svn_utf.h stable/11/contrib/subversion/subversion/include/svn_version.h stable/11/contrib/subversion/subversion/include/svn_wc.h stable/11/contrib/subversion/subversion/include/svn_x509.h stable/11/contrib/subversion/subversion/include/svn_xml.h stable/11/contrib/subversion/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c stable/11/contrib/subversion/subversion/libsvn_auth_gnome_keyring/libsvn_auth_gnome_keyring.pc.in stable/11/contrib/subversion/subversion/libsvn_auth_kwallet/kwallet.cpp stable/11/contrib/subversion/subversion/libsvn_auth_kwallet/libsvn_auth_kwallet.pc.in stable/11/contrib/subversion/subversion/libsvn_client/add.c stable/11/contrib/subversion/subversion/libsvn_client/blame.c stable/11/contrib/subversion/subversion/libsvn_client/checkout.c stable/11/contrib/subversion/subversion/libsvn_client/client.h stable/11/contrib/subversion/subversion/libsvn_client/commit.c stable/11/contrib/subversion/subversion/libsvn_client/commit_util.c stable/11/contrib/subversion/subversion/libsvn_client/copy.c stable/11/contrib/subversion/subversion/libsvn_client/delete.c stable/11/contrib/subversion/subversion/libsvn_client/deprecated.c stable/11/contrib/subversion/subversion/libsvn_client/diff.c stable/11/contrib/subversion/subversion/libsvn_client/diff_local.c stable/11/contrib/subversion/subversion/libsvn_client/diff_summarize.c stable/11/contrib/subversion/subversion/libsvn_client/export.c stable/11/contrib/subversion/subversion/libsvn_client/externals.c stable/11/contrib/subversion/subversion/libsvn_client/import.c stable/11/contrib/subversion/subversion/libsvn_client/info.c stable/11/contrib/subversion/subversion/libsvn_client/libsvn_client.pc.in stable/11/contrib/subversion/subversion/libsvn_client/list.c stable/11/contrib/subversion/subversion/libsvn_client/merge.c stable/11/contrib/subversion/subversion/libsvn_client/mergeinfo.c stable/11/contrib/subversion/subversion/libsvn_client/mtcc.c stable/11/contrib/subversion/subversion/libsvn_client/patch.c stable/11/contrib/subversion/subversion/libsvn_client/ra.c stable/11/contrib/subversion/subversion/libsvn_client/relocate.c stable/11/contrib/subversion/subversion/libsvn_client/repos_diff.c stable/11/contrib/subversion/subversion/libsvn_client/resolved.c stable/11/contrib/subversion/subversion/libsvn_client/revert.c stable/11/contrib/subversion/subversion/libsvn_client/revisions.c stable/11/contrib/subversion/subversion/libsvn_client/status.c stable/11/contrib/subversion/subversion/libsvn_client/update.c stable/11/contrib/subversion/subversion/libsvn_client/upgrade.c stable/11/contrib/subversion/subversion/libsvn_client/util.c stable/11/contrib/subversion/subversion/libsvn_delta/cancel.c stable/11/contrib/subversion/subversion/libsvn_delta/compat.c stable/11/contrib/subversion/subversion/libsvn_delta/debug_editor.c stable/11/contrib/subversion/subversion/libsvn_delta/default_editor.c stable/11/contrib/subversion/subversion/libsvn_delta/deprecated.c stable/11/contrib/subversion/subversion/libsvn_delta/libsvn_delta.pc.in stable/11/contrib/subversion/subversion/libsvn_delta/path_driver.c stable/11/contrib/subversion/subversion/libsvn_delta/svndiff.c stable/11/contrib/subversion/subversion/libsvn_delta/text_delta.c stable/11/contrib/subversion/subversion/libsvn_delta/xdelta.c stable/11/contrib/subversion/subversion/libsvn_diff/binary_diff.c stable/11/contrib/subversion/subversion/libsvn_diff/diff.h stable/11/contrib/subversion/subversion/libsvn_diff/diff3.c stable/11/contrib/subversion/subversion/libsvn_diff/diff_file.c stable/11/contrib/subversion/subversion/libsvn_diff/diff_memory.c stable/11/contrib/subversion/subversion/libsvn_diff/diff_tree.c stable/11/contrib/subversion/subversion/libsvn_diff/libsvn_diff.pc.in stable/11/contrib/subversion/subversion/libsvn_diff/parse-diff.c stable/11/contrib/subversion/subversion/libsvn_fs/deprecated.c stable/11/contrib/subversion/subversion/libsvn_fs/editor.c stable/11/contrib/subversion/subversion/libsvn_fs/fs-loader.c stable/11/contrib/subversion/subversion/libsvn_fs/fs-loader.h stable/11/contrib/subversion/subversion/libsvn_fs/libsvn_fs.pc.in stable/11/contrib/subversion/subversion/libsvn_fs_base/bdb/rev-table.c stable/11/contrib/subversion/subversion/libsvn_fs_base/fs.c stable/11/contrib/subversion/subversion/libsvn_fs_base/libsvn_fs_base.pc.in stable/11/contrib/subversion/subversion/libsvn_fs_base/lock.c stable/11/contrib/subversion/subversion/libsvn_fs_base/revs-txns.c stable/11/contrib/subversion/subversion/libsvn_fs_base/revs-txns.h stable/11/contrib/subversion/subversion/libsvn_fs_base/tree.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/caching.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/dag.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/dump-index.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/hotcopy.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/hotcopy.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/id.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/index.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/libsvn_fs_fs.pc.in stable/11/contrib/subversion/subversion/libsvn_fs_fs/load-index.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/lock.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/low_level.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/low_level.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/pack.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/recovery.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.sql stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/rev_file.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/revprops.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/revprops.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/stats.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/structure stable/11/contrib/subversion/subversion/libsvn_fs_fs/structure-indexes stable/11/contrib/subversion/subversion/libsvn_fs_fs/temp_serializer.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/temp_serializer.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/transaction.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/tree.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/util.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/util.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/verify.c stable/11/contrib/subversion/subversion/libsvn_fs_util/fs-util.c stable/11/contrib/subversion/subversion/libsvn_fs_util/libsvn_fs_util.pc.in stable/11/contrib/subversion/subversion/libsvn_fs_x/cached_data.c stable/11/contrib/subversion/subversion/libsvn_fs_x/cached_data.h stable/11/contrib/subversion/subversion/libsvn_fs_x/caching.c stable/11/contrib/subversion/subversion/libsvn_fs_x/changes.c stable/11/contrib/subversion/subversion/libsvn_fs_x/changes.h stable/11/contrib/subversion/subversion/libsvn_fs_x/dag.c stable/11/contrib/subversion/subversion/libsvn_fs_x/dag.h stable/11/contrib/subversion/subversion/libsvn_fs_x/fs.c stable/11/contrib/subversion/subversion/libsvn_fs_x/fs.h stable/11/contrib/subversion/subversion/libsvn_fs_x/fs_x.c stable/11/contrib/subversion/subversion/libsvn_fs_x/fs_x.h stable/11/contrib/subversion/subversion/libsvn_fs_x/hotcopy.c stable/11/contrib/subversion/subversion/libsvn_fs_x/hotcopy.h stable/11/contrib/subversion/subversion/libsvn_fs_x/index.c stable/11/contrib/subversion/subversion/libsvn_fs_x/index.h stable/11/contrib/subversion/subversion/libsvn_fs_x/libsvn_fs_x.pc.in stable/11/contrib/subversion/subversion/libsvn_fs_x/lock.c stable/11/contrib/subversion/subversion/libsvn_fs_x/lock.h stable/11/contrib/subversion/subversion/libsvn_fs_x/low_level.c stable/11/contrib/subversion/subversion/libsvn_fs_x/low_level.h stable/11/contrib/subversion/subversion/libsvn_fs_x/noderevs.c stable/11/contrib/subversion/subversion/libsvn_fs_x/noderevs.h stable/11/contrib/subversion/subversion/libsvn_fs_x/pack.c stable/11/contrib/subversion/subversion/libsvn_fs_x/pack.h stable/11/contrib/subversion/subversion/libsvn_fs_x/recovery.c stable/11/contrib/subversion/subversion/libsvn_fs_x/recovery.h stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache.c stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache.h stable/11/contrib/subversion/subversion/libsvn_fs_x/reps.c stable/11/contrib/subversion/subversion/libsvn_fs_x/reps.h stable/11/contrib/subversion/subversion/libsvn_fs_x/rev_file.c stable/11/contrib/subversion/subversion/libsvn_fs_x/rev_file.h stable/11/contrib/subversion/subversion/libsvn_fs_x/revprops.c stable/11/contrib/subversion/subversion/libsvn_fs_x/revprops.h stable/11/contrib/subversion/subversion/libsvn_fs_x/string_table.c stable/11/contrib/subversion/subversion/libsvn_fs_x/string_table.h stable/11/contrib/subversion/subversion/libsvn_fs_x/temp_serializer.c stable/11/contrib/subversion/subversion/libsvn_fs_x/temp_serializer.h stable/11/contrib/subversion/subversion/libsvn_fs_x/transaction.c stable/11/contrib/subversion/subversion/libsvn_fs_x/transaction.h stable/11/contrib/subversion/subversion/libsvn_fs_x/tree.c stable/11/contrib/subversion/subversion/libsvn_fs_x/tree.h stable/11/contrib/subversion/subversion/libsvn_fs_x/util.c stable/11/contrib/subversion/subversion/libsvn_fs_x/util.h stable/11/contrib/subversion/subversion/libsvn_fs_x/verify.c stable/11/contrib/subversion/subversion/libsvn_fs_x/verify.h stable/11/contrib/subversion/subversion/libsvn_ra/compat.c stable/11/contrib/subversion/subversion/libsvn_ra/deprecated.c stable/11/contrib/subversion/subversion/libsvn_ra/libsvn_ra.pc.in stable/11/contrib/subversion/subversion/libsvn_ra/ra_loader.c stable/11/contrib/subversion/subversion/libsvn_ra/ra_loader.h stable/11/contrib/subversion/subversion/libsvn_ra/wrapper_template.h stable/11/contrib/subversion/subversion/libsvn_ra_local/libsvn_ra_local.pc.in stable/11/contrib/subversion/subversion/libsvn_ra_local/ra_plugin.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/blame.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/commit.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/eagain_bucket.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/get_file.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/getlocations.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/getlocationsegments.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/libsvn_ra_serf.pc.in stable/11/contrib/subversion/subversion/libsvn_ra_serf/lock.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/log.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/merge.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/mergeinfo.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/multistatus.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/options.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/property.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h stable/11/contrib/subversion/subversion/libsvn_ra_serf/replay.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/sb_bucket.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/serf.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/stat.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/update.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/util.c stable/11/contrib/subversion/subversion/libsvn_ra_serf/xml.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/client.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/cram.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/cyrus_auth.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/deprecated.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/editorp.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/internal_auth.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/libsvn_ra_svn.pc.in stable/11/contrib/subversion/subversion/libsvn_ra_svn/marshal.c stable/11/contrib/subversion/subversion/libsvn_ra_svn/protocol stable/11/contrib/subversion/subversion/libsvn_ra_svn/ra_svn.h stable/11/contrib/subversion/subversion/libsvn_repos/authz.c stable/11/contrib/subversion/subversion/libsvn_repos/commit.c stable/11/contrib/subversion/subversion/libsvn_repos/config_pool.c stable/11/contrib/subversion/subversion/libsvn_repos/delta.c stable/11/contrib/subversion/subversion/libsvn_repos/deprecated.c stable/11/contrib/subversion/subversion/libsvn_repos/dump.c stable/11/contrib/subversion/subversion/libsvn_repos/fs-wrap.c stable/11/contrib/subversion/subversion/libsvn_repos/hooks.c stable/11/contrib/subversion/subversion/libsvn_repos/libsvn_repos.pc.in stable/11/contrib/subversion/subversion/libsvn_repos/load-fs-vtable.c stable/11/contrib/subversion/subversion/libsvn_repos/load.c stable/11/contrib/subversion/subversion/libsvn_repos/log.c stable/11/contrib/subversion/subversion/libsvn_repos/replay.c stable/11/contrib/subversion/subversion/libsvn_repos/reporter.c stable/11/contrib/subversion/subversion/libsvn_repos/repos.c stable/11/contrib/subversion/subversion/libsvn_repos/repos.h stable/11/contrib/subversion/subversion/libsvn_repos/rev_hunt.c stable/11/contrib/subversion/subversion/libsvn_subr/atomic.c stable/11/contrib/subversion/subversion/libsvn_subr/auth.c stable/11/contrib/subversion/subversion/libsvn_subr/base64.c stable/11/contrib/subversion/subversion/libsvn_subr/cache-inprocess.c stable/11/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c stable/11/contrib/subversion/subversion/libsvn_subr/checksum.c stable/11/contrib/subversion/subversion/libsvn_subr/cmdline.c stable/11/contrib/subversion/subversion/libsvn_subr/config.c stable/11/contrib/subversion/subversion/libsvn_subr/config_auth.c stable/11/contrib/subversion/subversion/libsvn_subr/config_file.c stable/11/contrib/subversion/subversion/libsvn_subr/config_impl.h stable/11/contrib/subversion/subversion/libsvn_subr/config_keys.inc stable/11/contrib/subversion/subversion/libsvn_subr/config_win.c stable/11/contrib/subversion/subversion/libsvn_subr/deprecated.c stable/11/contrib/subversion/subversion/libsvn_subr/dirent_uri.c stable/11/contrib/subversion/subversion/libsvn_subr/dso.c stable/11/contrib/subversion/subversion/libsvn_subr/eol.c stable/11/contrib/subversion/subversion/libsvn_subr/error.c stable/11/contrib/subversion/subversion/libsvn_subr/errorcode.inc stable/11/contrib/subversion/subversion/libsvn_subr/fnv1a.c stable/11/contrib/subversion/subversion/libsvn_subr/fnv1a.h stable/11/contrib/subversion/subversion/libsvn_subr/gpg_agent.c stable/11/contrib/subversion/subversion/libsvn_subr/hash.c stable/11/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/11/contrib/subversion/subversion/libsvn_subr/io.c stable/11/contrib/subversion/subversion/libsvn_subr/iter.c stable/11/contrib/subversion/subversion/libsvn_subr/libsvn_subr.pc.in stable/11/contrib/subversion/subversion/libsvn_subr/log.c stable/11/contrib/subversion/subversion/libsvn_subr/lz4/lz4.c stable/11/contrib/subversion/subversion/libsvn_subr/lz4/lz4internal.h stable/11/contrib/subversion/subversion/libsvn_subr/mergeinfo.c stable/11/contrib/subversion/subversion/libsvn_subr/mutex.c stable/11/contrib/subversion/subversion/libsvn_subr/object_pool.c stable/11/contrib/subversion/subversion/libsvn_subr/opt.c stable/11/contrib/subversion/subversion/libsvn_subr/packed_data.c stable/11/contrib/subversion/subversion/libsvn_subr/path.c stable/11/contrib/subversion/subversion/libsvn_subr/pool.c stable/11/contrib/subversion/subversion/libsvn_subr/prefix_string.c stable/11/contrib/subversion/subversion/libsvn_subr/prompt.c stable/11/contrib/subversion/subversion/libsvn_subr/properties.c stable/11/contrib/subversion/subversion/libsvn_subr/skel.c stable/11/contrib/subversion/subversion/libsvn_subr/sorts.c stable/11/contrib/subversion/subversion/libsvn_subr/spillbuf.c stable/11/contrib/subversion/subversion/libsvn_subr/sqlite.c stable/11/contrib/subversion/subversion/libsvn_subr/sqlite3wrapper.c stable/11/contrib/subversion/subversion/libsvn_subr/ssl_client_cert_pw_providers.c stable/11/contrib/subversion/subversion/libsvn_subr/stream.c stable/11/contrib/subversion/subversion/libsvn_subr/string.c stable/11/contrib/subversion/subversion/libsvn_subr/subst.c stable/11/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/11/contrib/subversion/subversion/libsvn_subr/temp_serializer.c stable/11/contrib/subversion/subversion/libsvn_subr/user.c stable/11/contrib/subversion/subversion/libsvn_subr/utf.c stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc.c stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/utf8proc.c stable/11/contrib/subversion/subversion/libsvn_subr/utf8proc/utf8proc_data.c stable/11/contrib/subversion/subversion/libsvn_subr/version.c stable/11/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c stable/11/contrib/subversion/subversion/libsvn_subr/win32_crashrpt_dll.h stable/11/contrib/subversion/subversion/libsvn_subr/win32_crypto.c stable/11/contrib/subversion/subversion/libsvn_subr/win32_xlate.c stable/11/contrib/subversion/subversion/libsvn_subr/x509info.c stable/11/contrib/subversion/subversion/libsvn_subr/x509parse.c stable/11/contrib/subversion/subversion/libsvn_subr/xml.c stable/11/contrib/subversion/subversion/libsvn_wc/README stable/11/contrib/subversion/subversion/libsvn_wc/adm_crawler.c stable/11/contrib/subversion/subversion/libsvn_wc/conflicts.c stable/11/contrib/subversion/subversion/libsvn_wc/conflicts.h stable/11/contrib/subversion/subversion/libsvn_wc/copy.c stable/11/contrib/subversion/subversion/libsvn_wc/crop.c stable/11/contrib/subversion/subversion/libsvn_wc/deprecated.c stable/11/contrib/subversion/subversion/libsvn_wc/diff.h stable/11/contrib/subversion/subversion/libsvn_wc/diff_editor.c stable/11/contrib/subversion/subversion/libsvn_wc/diff_local.c stable/11/contrib/subversion/subversion/libsvn_wc/entries.c stable/11/contrib/subversion/subversion/libsvn_wc/externals.c stable/11/contrib/subversion/subversion/libsvn_wc/libsvn_wc.pc.in stable/11/contrib/subversion/subversion/libsvn_wc/node.c stable/11/contrib/subversion/subversion/libsvn_wc/old-and-busted.c stable/11/contrib/subversion/subversion/libsvn_wc/props.c stable/11/contrib/subversion/subversion/libsvn_wc/questions.c stable/11/contrib/subversion/subversion/libsvn_wc/revert.c stable/11/contrib/subversion/subversion/libsvn_wc/status.c stable/11/contrib/subversion/subversion/libsvn_wc/translate.c stable/11/contrib/subversion/subversion/libsvn_wc/tree_conflicts.c stable/11/contrib/subversion/subversion/libsvn_wc/update_editor.c stable/11/contrib/subversion/subversion/libsvn_wc/upgrade.c stable/11/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/11/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/11/contrib/subversion/subversion/libsvn_wc/wc-metadata.sql stable/11/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/11/contrib/subversion/subversion/libsvn_wc/wc-queries.sql stable/11/contrib/subversion/subversion/libsvn_wc/wc.h stable/11/contrib/subversion/subversion/libsvn_wc/wc_db.c stable/11/contrib/subversion/subversion/libsvn_wc/wc_db.h stable/11/contrib/subversion/subversion/libsvn_wc/wc_db_pristine.c stable/11/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c stable/11/contrib/subversion/subversion/libsvn_wc/wc_db_util.c stable/11/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c stable/11/contrib/subversion/subversion/libsvn_wc/wcroot_anchor.c stable/11/contrib/subversion/subversion/libsvn_wc/workqueue.c stable/11/contrib/subversion/subversion/svn/auth-cmd.c stable/11/contrib/subversion/subversion/svn/blame-cmd.c stable/11/contrib/subversion/subversion/svn/cl-conflicts.c stable/11/contrib/subversion/subversion/svn/cl-conflicts.h stable/11/contrib/subversion/subversion/svn/cl-log.h stable/11/contrib/subversion/subversion/svn/cl.h stable/11/contrib/subversion/subversion/svn/cleanup-cmd.c stable/11/contrib/subversion/subversion/svn/conflict-callbacks.c stable/11/contrib/subversion/subversion/svn/diff-cmd.c stable/11/contrib/subversion/subversion/svn/help-cmd.c stable/11/contrib/subversion/subversion/svn/info-cmd.c stable/11/contrib/subversion/subversion/svn/list-cmd.c stable/11/contrib/subversion/subversion/svn/log-cmd.c stable/11/contrib/subversion/subversion/svn/merge-cmd.c stable/11/contrib/subversion/subversion/svn/notify.c stable/11/contrib/subversion/subversion/svn/propdel-cmd.c stable/11/contrib/subversion/subversion/svn/propedit-cmd.c stable/11/contrib/subversion/subversion/svn/propget-cmd.c stable/11/contrib/subversion/subversion/svn/propset-cmd.c stable/11/contrib/subversion/subversion/svn/resolve-cmd.c stable/11/contrib/subversion/subversion/svn/revert-cmd.c stable/11/contrib/subversion/subversion/svn/status.c stable/11/contrib/subversion/subversion/svn/svn.c stable/11/contrib/subversion/subversion/svn/switch-cmd.c stable/11/contrib/subversion/subversion/svn/update-cmd.c stable/11/contrib/subversion/subversion/svn/util.c stable/11/contrib/subversion/subversion/svn_private_config.h.in stable/11/contrib/subversion/subversion/svn_private_config.hw stable/11/contrib/subversion/subversion/svnadmin/svnadmin.c stable/11/contrib/subversion/subversion/svnbench/cl.h stable/11/contrib/subversion/subversion/svnbench/help-cmd.c stable/11/contrib/subversion/subversion/svnbench/null-export-cmd.c stable/11/contrib/subversion/subversion/svnbench/null-list-cmd.c stable/11/contrib/subversion/subversion/svnbench/null-log-cmd.c stable/11/contrib/subversion/subversion/svnbench/svnbench.c stable/11/contrib/subversion/subversion/svndumpfilter/svndumpfilter.c stable/11/contrib/subversion/subversion/svnfsfs/dump-index-cmd.c stable/11/contrib/subversion/subversion/svnfsfs/load-index-cmd.c stable/11/contrib/subversion/subversion/svnfsfs/stats-cmd.c stable/11/contrib/subversion/subversion/svnfsfs/svnfsfs.c stable/11/contrib/subversion/subversion/svnfsfs/svnfsfs.h stable/11/contrib/subversion/subversion/svnlook/svnlook.c stable/11/contrib/subversion/subversion/svnmucc/svnmucc.c stable/11/contrib/subversion/subversion/svnrdump/dump_editor.c stable/11/contrib/subversion/subversion/svnrdump/load_editor.c stable/11/contrib/subversion/subversion/svnrdump/svnrdump.c stable/11/contrib/subversion/subversion/svnrdump/svnrdump.h stable/11/contrib/subversion/subversion/svnrdump/util.c stable/11/contrib/subversion/subversion/svnserve/cyrus_auth.c stable/11/contrib/subversion/subversion/svnserve/logger.c stable/11/contrib/subversion/subversion/svnserve/logger.h stable/11/contrib/subversion/subversion/svnserve/serve.c stable/11/contrib/subversion/subversion/svnserve/server.h stable/11/contrib/subversion/subversion/svnserve/svnserve.c stable/11/contrib/subversion/subversion/svnsync/svnsync.c stable/11/contrib/subversion/subversion/svnversion/svnversion.c stable/11/contrib/subversion/win-tests.py stable/11/usr.bin/svn/Makefile stable/11/usr.bin/svn/lib/Makefile stable/11/usr.bin/svn/lib/libapr/Makefile stable/11/usr.bin/svn/lib/libapr/apr.h stable/11/usr.bin/svn/lib/libapr/apr_private.h stable/11/usr.bin/svn/lib/libapr_util/Makefile stable/11/usr.bin/svn/lib/libapr_util/apu.h stable/11/usr.bin/svn/lib/libapr_util/apu_config.h stable/11/usr.bin/svn/lib/libserf/Makefile stable/11/usr.bin/svn/lib/libsvn_client/Makefile stable/11/usr.bin/svn/lib/libsvn_delta/Makefile stable/11/usr.bin/svn/lib/libsvn_diff/Makefile stable/11/usr.bin/svn/lib/libsvn_fs/Makefile stable/11/usr.bin/svn/lib/libsvn_fs_fs/Makefile stable/11/usr.bin/svn/lib/libsvn_fs_util/Makefile stable/11/usr.bin/svn/lib/libsvn_fs_x/Makefile stable/11/usr.bin/svn/lib/libsvn_ra/Makefile stable/11/usr.bin/svn/lib/libsvn_ra_local/Makefile stable/11/usr.bin/svn/lib/libsvn_ra_serf/Makefile stable/11/usr.bin/svn/lib/libsvn_ra_svn/Makefile stable/11/usr.bin/svn/lib/libsvn_repos/Makefile stable/11/usr.bin/svn/lib/libsvn_subr/Makefile stable/11/usr.bin/svn/lib/libsvn_wc/Makefile stable/11/usr.bin/svn/svn/Makefile stable/11/usr.bin/svn/svn_private_config.h stable/11/usr.bin/svn/svnadmin/Makefile stable/11/usr.bin/svn/svnbench/Makefile stable/11/usr.bin/svn/svndumpfilter/Makefile stable/11/usr.bin/svn/svnfsfs/Makefile stable/11/usr.bin/svn/svnlook/Makefile stable/11/usr.bin/svn/svnmucc/Makefile stable/11/usr.bin/svn/svnrdump/Makefile stable/11/usr.bin/svn/svnserve/Makefile stable/11/usr.bin/svn/svnsync/Makefile stable/11/usr.bin/svn/svnversion/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/apr-util/CHANGES ============================================================================== --- stable/11/contrib/apr-util/CHANGES Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/CHANGES Sun Jun 14 18:49:06 2020 (r362181) @@ -1,141 +1,62 @@ -*- coding: utf-8 -*- -Changes with APR-util 1.5.4 +Changes with APR-util 1.6.1 - *) MySQL driver: Fix incorrect handling of bad parameter in the - driver support for apr_dbd_transaction_end(). PR 56330. - [Weiqiang Li ] + *) Win32: Add function exports from new apr_crypto API's missing in 1.6.0. - *) apr_crypto_get_driver(): Fix invalid storage reference on error path. - [Philip Martin ] + *) Win32: Introduce XML_PARSER build-time variable to select the expat + library name to be linked to libaprutil-1.dll. See Makefile.win - *) Fix compile failure for Android. PR 56627. [Fredrik Fornwall - , Jeff Trawick] + *) Win32: Removed lingering xml/xml.dsp project forked from the expat + Project in the 1.9x era. Use expat's maintained build schema instead, + prior to building apr-util. - *) Fix to let ODBC driver build with MSVC6, which does not have intptr_t - [Tom Donovan] + *) apr_crypto: Fix compatibility with LibreSSL. PR 61596. + [Bernard Spil , Yann Ylavic] - *) Windows cmake build: Fix incompatiblities with Visual Studio - generators with all cmake versions, and the NMake Makefile generator - with cmake 2.8.12 and later. PR 56616 and other bugs. [Jeff Trawick, - Bert Huijben] + *) sdbm: better database/page validation to fail cleanly when corrupted. + [Yann Ylavic] - *) Fix detection of Berkeley DB 6.0. PR 55277. - [Lars Wendler ] +Changes with APR-util 1.6.0 - *) Improve platform detection for bundled expat by updating - config.guess and config.sub. [Rainer Jung] + *) The expat dependency of apr-util is no longer built with apr-util. + Install expat (including development headers and libraries) first + before building apr-util. [https://libexpat.github.io/] -Changes with APR-util 1.5.3 + *) Mark apr_dbd_freetds as unsupported, and remove it from all builds + [Nick Kew] - *) Cygwin: Use correct file extension when loading APR DSOs. PR 55587. - [Carlo Bramini ] + *) Update MySQL build to stop using libmysqlclient_r. + [Petr Sumbera ] - *) Add experimental cmake-based build system for Windows. Refer to - README.cmake for more information. [Jeff Trawick, Tom Donovan] + *) apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure + the size of the buffer used to read files. [Yann Ylavic] - *) Fix warnings in odbc driver on 64bit systems. - PR 55197 [Tom Donovan] + *) apr_crypto: avoid excessive iteration in bcrypt hash. + [Hanno Böck ] - *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi - Gacogne ] + *) apr_siphash: Implement keyed hash function SipHash. [Yann Ylavic] - *) Add support for Berkeley DB 6.0. [Rainer Jung] + *) apr_crypto: Add apr_crypto_key() function which supports keys + generated from a passphrase or a raw secret provided by the caller. + Deprecate apr_crypto_passphrase(). [Graham Leggett] - *) Improve platform detection for bundled expat by updating - config.guess and config.sub. [Rainer Jung] + *) apr_crypto_nss: Ensure the SECItem returned by PK11_ParamFromIV + is properly freed. [Graham Leggett] -Changes with APR-util 1.5.2 + *) apr_crypto: Don't cache the driver if initialisation fails. This + stops the second and subsequent attempt to use the API from failing + claiming the library is not initialised. [Graham Leggett] - *) Windows: Add command line makefiles. [Gregg Smith] + *) apr_crypto: Add a native CommonCrypto implementation for iOS and OSX + where OpenSSL has been deprecated. [Graham Leggett] - *) apr_uri_parse(): Do not accept invalid characters in the scheme. - Per RFC 3986 3.3, enforce that the first segment of a relative path does - not contain a colon. PR 52479. [Stefan Fritsch] + *) apr_xml_to_text: Add style APR_XML_X2T_PARSED to maintain a + consistent namespace prefix. [Jari Urpalainen + ] - *) Fix memory leak in hook sorting function. PR 51256. - [] +Changes with APR-util 1.5.x and later: - *) Speedup md5 calculation by avoiding some copying on little endian - architectures. PR 49011. [Stefan Fritsch, Stefan Fuhrmann - ] - - *) Use heap memory for crypt in apr_password_validate(), to reduce stack - usage. PR 54572. [Stefan Fritsch] - - *) Fix password validation failure for all crypt and crypt_r based - algorithms. PR 54603. [Harvey Eneman ] - - *) Fix syntax error in crypto/apr_passwd.c on non-glibc systems. PR 54275. - [Stefan Fritsch] - - *) Fix potential data corruption in apr_brigade_write() and friends if - the last bucket of the brigade is a heap bucket that has been split, - and there are still references to the next part of the original bucket - in use. [Stefan Fritsch] - - *) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe - Jaillet ] - - *) apr_crypto: If --with-crypto is passed to configure but no crypto - libraries are enabled, autodetect available libraries. [Jeff Trawick] - - *) memcache: Fix dead server retry logic. [Gavin Shelley ] - -Changes with APR-util 1.5.1 - - *) testmemcache: Fix crash. PR 52705. [Peter Poeml ] - - *) MinGW: Support shared builds of apr-util when apr is shared. - PR 46175. [Carlo Bramini , Jeff Trawick] - - *) Add support for Berkeley DB 5.2 and 5.3. Simplify detection script. - PR 53684. [Rainer Jung] - - *) configure: Allow to specify library specific custom linker flags - via the LDADD_XXX variables. [Rainer Jung] - - *) apr_password_validate(): Fix intermittent errors on systems - such as FreeBSD where the crypt() function is used. - (Broken only in 1.5.0) [Jeff Trawick] - - *) Improve platform detection for bundled expat by updating - config.guess and config.sub. [Rainer Jung] - -Changes with APR-util 1.5.0 - - *) dbd_pgsql_escape: Use PQescapeStringConn. [Nick Kew] - - *) apr_password_validate, apr_bcrypt_encode: Add support for bcrypt encoded - passwords. The bcrypt implementation uses code from crypt_blowfish - written by Solar Designer . apr_bcrypt_encode creates - hashes with "$2y$" prefix, but apr_password_validate also accepts the old - prefix "$2a$". PR 49288. [Stefan Fritsch] - - *) APR dbd: Allow to use apr_dbd_get_row() with a different pool than - apr_dbd_select(). PR 53533. [] - - *) APR dbd FreeTDS support: Fix spurious API errors caused by uninitialized - fields. [TROY.LIU åŠ‰æ˜¥å‰ ] - - *) apr_password_validate: Increase maximum hash string length to allow - more than 9999 rounds with sha512-crypt. PR 53410. [Stefan Fritsch] - - *) Fix segfaults in crypt() and crypt_r() failure modes. - PR 47272. [Arkadiusz Miskiewicz ] - - *) apr_crypto: Ensure that the if/else that governs the static - initialisation of each crypto driver works when the first driver - isn't in use. [Graham Leggett] - - *) apr_crypto: Ensure the *driver variable is initialised when a statically - compiled library is initialised for the first time. [Graham Leggett] - - *) apr_crypto: Ensure the *driver variable is initialised when the library - has already been loaded. Fix ported from apr_dbd. [Graham Leggett] - - *) apr_crypto: Move the static initialisation of DRIVER_LOAD from - apr_crypto_init() to apr_crypto_get_driver(), so that we don't lose - the parameters. [Graham Leggett] + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/CHANGES?view=markup Changes with APR-util 1.4.x and later: Copied: stable/11/contrib/apr-util/CMakeLists.txt (from r361692, head/contrib/apr-util/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/apr-util/CMakeLists.txt Sun Jun 14 18:49:06 2020 (r362181, copy of r361692, head/contrib/apr-util/CMakeLists.txt) @@ -0,0 +1,355 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Read README.cmake before using this. + +PROJECT(APR-Util C) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +FIND_PACKAGE(OpenSSL) + +FIND_PACKAGE(expat) + +OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) +OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) +OPTION(APR_HAS_LDAP "LDAP support" ON) +OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) +OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) +OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) +SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR include files") +SET(APR_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib" CACHE STRING "APR library to link with") + +IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h") + MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.") +ENDIF() +FOREACH(onelib ${APR_LIBRARIES}) + IF(NOT EXISTS ${onelib}) + MESSAGE(FATAL_ERROR "APR library ${onelib} was not found.") + ENDIF() +ENDFOREACH() + +IF(APU_HAVE_CRYPTO) +IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "OpenSSL is the only supported crypto implementation, and it wasn't found!") +ENDIF() +ENDIF() + +# create 1-or-0 representation of feature tests for apu.h + +SET(apu_have_crypto_10 0) +SET(apu_have_apr_iconv_10 0) # not yet implemented +SET(apr_has_ldap_10 0) + +IF(APU_HAVE_CRYPTO) + SET(apu_have_crypto_10 1) +ENDIF() + +IF(APR_HAS_LDAP) + SET(apr_has_ldap_10 1) +ENDIF() + +IF(NOT EXPAT_FOUND) + MESSAGE(FATAL_ERROR "Expat is required, and it wasn't found!") +ENDIF() + +SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS}) +SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES}) + +SET(LDAP_LIBRARIES) +IF(APR_HAS_LDAP) + SET(LDAP_LIBRARIES wldap32) +ENDIF() + +CONFIGURE_FILE(include/apu.hwc + ${PROJECT_BINARY_DIR}/apu.h) +CONFIGURE_FILE(include/apr_ldap.hwc + ${PROJECT_BINARY_DIR}/apr_ldap.h) +# "COPYONLY" just because anything else isn't implemented ;) +CONFIGURE_FILE(include/private/apu_config.hw + ${PROJECT_BINARY_DIR}/apu_config.h + COPYONLY) +CONFIGURE_FILE(include/private/apu_select_dbm.hw + ${PROJECT_BINARY_DIR}/apu_select_dbm.h + COPYONLY) +CONFIGURE_FILE(include/apu_want.hw + ${PROJECT_BINARY_DIR}/apu_want.h + COPYONLY) + +# Generated .h files are stored in PROJECT_BINARY_DIR, not the +# source tree. +# +# BROKEN: not searching PROJECT_BINARY_DIR first, so you have to +# manually delete apu.h in PROJECT_SOURCE_DIR/include if +# you've generated apu.h before using a different build + +SET(APR_INCLUDE_DIRECTORIES + ${PROJECT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/private + ${APR_INCLUDE_DIR} +) + +INCLUDE_DIRECTORIES(${APR_INCLUDE_DIRECTORIES} ${XMLLIB_INCLUDE_DIR}) + +SET(APR_PUBLIC_HEADERS_STATIC + include/apr_anylock.h + include/apr_base64.h + include/apr_buckets.h + include/apr_crypto.h + include/apr_date.h + include/apr_dbd.h + include/apr_dbm.h + include/apr_hooks.h + include/apr_ldap_init.h + include/apr_ldap_option.h + include/apr_ldap_rebind.h + include/apr_ldap_url.h + include/apr_md4.h + include/apr_md5.h + include/apr_memcache.h + include/apr_optional.h + include/apr_optional_hooks.h + include/apr_queue.h + include/apr_redis.h + include/apr_reslist.h + include/apr_rmm.h + include/apr_sdbm.h + include/apr_sha1.h + include/apr_siphash.h + include/apr_strmatch.h + include/apr_thread_pool.h + include/apr_uri.h + include/apr_uuid.h + include/apr_xlate.h + include/apr_xml.h + include/apu_errno.h + include/apu_version.h +) + +# apu_config.h and apu_select_dbm.h are private +SET(APR_PUBLIC_HEADERS_GENERATED + ${PROJECT_BINARY_DIR}/apu.h + ${PROJECT_BINARY_DIR}/apr_ldap.h + ${PROJECT_BINARY_DIR}/apu_want.h +) + +SET(APR_SOURCES + buckets/apr_brigade.c + buckets/apr_buckets.c + buckets/apr_buckets_alloc.c + buckets/apr_buckets_eos.c + buckets/apr_buckets_file.c + buckets/apr_buckets_flush.c + buckets/apr_buckets_heap.c + buckets/apr_buckets_mmap.c + buckets/apr_buckets_pipe.c + buckets/apr_buckets_pool.c + buckets/apr_buckets_refcount.c + buckets/apr_buckets_simple.c + buckets/apr_buckets_socket.c + crypto/apr_crypto.c + crypto/apr_md4.c + crypto/apr_md5.c + crypto/apr_passwd.c + crypto/apr_sha1.c + crypto/apr_siphash.c + crypto/crypt_blowfish.c + crypto/getuuid.c + crypto/uuid.c + dbd/apr_dbd.c + dbm/apr_dbm.c + dbm/apr_dbm_sdbm.c + dbm/sdbm/sdbm.c + dbm/sdbm/sdbm_hash.c + dbm/sdbm/sdbm_lock.c + dbm/sdbm/sdbm_pair.c + encoding/apr_base64.c + hooks/apr_hooks.c + memcache/apr_memcache.c + misc/apr_date.c + misc/apr_queue.c + misc/apr_reslist.c + misc/apr_rmm.c + misc/apr_thread_pool.c + misc/apu_dso.c + misc/apu_version.c + redis/apr_redis.c + strmatch/apr_strmatch.c + uri/apr_uri.c + xlate/xlate.c + xml/apr_xml.c +) + +IF(APR_HAS_LDAP) + SET(APR_SOURCES ${APR_SOURCES} ldap/apr_ldap_stub.c ldap/apr_ldap_url.c) +ENDIF() + +SET(APR_TEST_SOURCES + test/abts.c + test/testbuckets.c + test/testcrypto.c + test/testdate.c + test/testdbd.c + test/testdbm.c + test/testldap.c + test/testmd4.c + test/testmd5.c + test/testmemcache.c + test/testpass.c + test/testqueue.c + test/testredis.c + test/testreslist.c + test/testrmm.c + test/testsiphash.c + test/teststrmatch.c + test/testuri.c + test/testutil.c + test/testuuid.c + test/testxlate.c + test/testxml.c +) + +SET(install_targets) +SET(install_bin_pdb) +SET(dbd_drivers) + +# Note: The WINNT definition on some targets is used only by libaprutil.rc. + +# libaprutil-1 is shared, aprutil-1 is static +ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc) +SET(install_targets ${install_targets} libaprutil-1) +SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb) +TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) +SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT") + +ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} aprutil-1) +TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) +SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC") + +IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") + ENDIF() + ADD_LIBRARY(apr_crypto_openssl-1 SHARED crypto/apr_crypto_openssl.c libaprutil.rc) + SET(install_targets ${install_targets} apr_crypto_openssl-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb) + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_crypto_openssl") + TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES}) +ENDIF() + +IF(APU_HAVE_ODBC) + ADD_LIBRARY(apr_dbd_odbc-1 SHARED dbd/apr_dbd_odbc.c libaprutil.rc) + SET(install_targets ${install_targets} apr_dbd_odbc-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-1.pdb) + SET(dbd_drivers ${dbd_drivers} odbc) + TARGET_LINK_LIBRARIES(apr_dbd_odbc-1 libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32) + SET_PROPERTY(TARGET apr_dbd_odbc-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) + SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD;WINNT") + SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_dbd_odbc") +ENDIF() + +IF(APR_HAS_LDAP) + ADD_LIBRARY(apr_ldap-1 SHARED ldap/apr_ldap_init.c ldap/apr_ldap_option.c + ldap/apr_ldap_rebind.c libaprutil.rc) + SET(install_targets ${install_targets} apr_ldap-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb) + TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1 ${APR_LIBRARIES} ${LDAP_LIBRARIES}) + SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") + SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_ldap") + SET(apr_ldap_libraries apr_ldap-1) +ELSE() + SET(apr_ldap_libraries) +ENDIF() + +IF(APR_BUILD_TESTAPR) + ENABLE_TESTING() + # Create a "check" target that displays test program output to the console. + ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) + + # copy data files to build directory so that we can run programs from there + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory + ${PROJECT_BINARY_DIR}/data) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml + ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) + + IF(TEST_STATIC_LIBS) + SET(whichapr aprutil-1) + SET(apiflag "-DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC") + ELSE() + SET(whichapr libaprutil-1) + SET(apiflag) + ENDIF() + + ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) + TARGET_LINK_LIBRARIES(testall ${whichapr} ${apr_ldap_libraries} ${XMLLIB_LIBRARIES} ${LDAP_LIBRARIES}) + IF(apiflag) + SET_TARGET_PROPERTIES(testall PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testall COMMAND testall) + + ADD_EXECUTABLE(dbd test/dbd.c) + TARGET_LINK_LIBRARIES(dbd ${whichapr}) + IF(apiflag) + SET_TARGET_PROPERTIES(dbd PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + + # dbd is run multiple times with different parameters. + FOREACH(somedbd ${dbd_drivers}) + ADD_TEST(NAME dbd-${somedbd} COMMAND dbd ${somedbd}) + ENDFOREACH() + +ENDIF (APR_BUILD_TESTAPR) + +# Installation + +INSTALL(TARGETS ${install_targets} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + +IF(INSTALL_PDB) + INSTALL(FILES ${install_bin_pdb} + DESTINATION bin + CONFIGURATIONS RelWithDebInfo Debug) +ENDIF() + +INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) + +STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) +MESSAGE(STATUS "") +MESSAGE(STATUS "") +MESSAGE(STATUS "APR-Util configuration summary:") +MESSAGE(STATUS "") +MESSAGE(STATUS " Build type ...................... : ${CMAKE_BUILD_TYPE}") +MESSAGE(STATUS " Install .pdb (if available)...... : ${INSTALL_PDB}") +MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") +MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") +MESSAGE(STATUS " APR include directory ........... : ${APR_INCLUDE_DIR}") +MESSAGE(STATUS " APR libraries ................... : ${APR_LIBRARIES}") +MESSAGE(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}") +MESSAGE(STATUS " APU_HAVE_CRYPTO ................. : ${APU_HAVE_CRYPTO}") +MESSAGE(STATUS " APR_HAS_LDAP .................... : ${APR_HAS_LDAP}") +MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") +IF(TEST_STATIC_LIBS) +MESSAGE(STATUS " (testing static libraries)") +ELSE() +MESSAGE(STATUS " (testing dynamic libraries)") +ENDIF() Modified: stable/11/contrib/apr-util/LICENSE ============================================================================== --- stable/11/contrib/apr-util/LICENSE Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/LICENSE Sun Jun 14 18:49:06 2020 (r362181) @@ -312,6 +312,22 @@ For the crypto\apr_md4.c component: * documentation and/or software. */ +For the crypto\crypt_blowfish.c(.h) component: + + * Written by Solar Designer in 1998-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 1998-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + + See crypto/crypt_blowfish.c for more information. + For the include\apr_md4.h component: * Modified: stable/11/contrib/apr-util/Makefile.in ============================================================================== --- stable/11/contrib/apr-util/Makefile.in Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/Makefile.in Sun Jun 14 18:49:06 2020 (r362181) @@ -15,8 +15,8 @@ APRUTIL_LDFLAGS = @APRUTIL_LDFLAGS@ APRUTIL_LIBS = @APRUTIL_LIBS@ TARGET_LIB = lib@APRUTIL_LIBNAME@.la -INSTALL_SUBDIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ -EXTRA_SOURCE_DIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ +INSTALL_SUBDIRS = @APR_ICONV_DIR@ +EXTRA_SOURCE_DIRS = @APR_ICONV_DIR@ APRUTIL_PCFILE = apr-util-$(APRUTIL_MAJOR_VERSION).pc APU_CONFIG = apu-$(APRUTIL_MAJOR_VERSION)-config INSTALL = @INSTALL@ @@ -35,7 +35,6 @@ LDADD_dbd_oracle = @LDADD_dbd_oracle@ LDADD_dbd_sqlite2 = @LDADD_dbd_sqlite2@ LDADD_dbd_sqlite3 = @LDADD_dbd_sqlite3@ LDADD_dbd_mysql = @LDADD_dbd_mysql@ -LDADD_dbd_freetds = @LDADD_dbd_freetds@ LDADD_dbd_odbc = @LDADD_dbd_odbc@ LDADD_dbm_db = @LDADD_dbm_db@ LDADD_dbm_gdbm = @LDADD_dbm_gdbm@ @@ -43,6 +42,7 @@ LDADD_dbm_ndbm = @LDADD_dbm_ndbm@ LDADD_ldap = @LDADD_ldap@ LDADD_crypto_openssl = @LDADD_crypto_openssl@ LDADD_crypto_nss = @LDADD_crypto_nss@ +LDADD_crypto_commoncrypto = @LDADD_crypto_commoncrypto@ TARGETS = $(TARGET_LIB) aprutil.exp apu-config.out $(APU_MODULES) @@ -50,7 +50,7 @@ TARGETS = $(TARGET_LIB) aprutil.exp apu-config.out $(A @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_SUBDIRS = test @APR_ICONV_DIR@ @APR_XML_DIR@ +CLEAN_SUBDIRS = test @APR_ICONV_DIR@ CLEAN_TARGETS = exports.c export_vars.c aprutil.exp .make.dirs apu-config.out DISTCLEAN_TARGETS = config.cache config.log config.status libtool \ Modified: stable/11/contrib/apr-util/Makefile.win ============================================================================== --- stable/11/contrib/apr-util/Makefile.win Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/Makefile.win Sun Jun 14 18:49:06 2020 (r362181) @@ -51,6 +51,13 @@ # # CRYPTO_LIST="nss openssl" # +# Provide the XML_PARSER argument after configuring LIB and INCLUDE with +# the expat path of the corresponding xml parser, e.g. libexpatMT to choose +# static, or libexpat (default) to choose the dynamic library for aprutil-1.dll +# (Static libaprutil-1.lib always presumes libexpatMT with XML_STATIC flag.) +# +# XML_PARSER="libexpat" +# # For example; # # nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean @@ -73,6 +80,20 @@ USEDSW=1 PREFIX=..\apr-dist +!IF EXIST("..\openssl") +!IF EXIST("..\openssl\libcrypto.lib") +SSLOPT=_HAVE_OSSL110=1 +!ENDIF +!ENDIF + +# Legacy default (and unwise alternative) for libapr-1.dll is libexpatMT +XML_PARSER="libexpat" +!IF "$(XML_PARSER)" == "libexpat" +XMLOPT=XML_PARSER=$(XML_PARSER) +!ELSE +XMLOPT=XML_PARSER=$(XML_PARSER) XML_OPTIONS="/D XML_STATIC" +!ENDIF + !IF [$(COMSPEC) /c cl /nologo /? \ | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0 ARCH=x64 Release @@ -197,11 +218,9 @@ buildall: BUILD_MODE="$(ARCH)" BIND_MODE=shared cd .. !ENDIF - cd $(APU_PATH)\xml\expat\lib - $(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - $(ARCH)" RECURSE=0 $(CTARGET) - cd ..\..\.. - $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - $(ARCH)" RECURSE=0 $(CTARGET) - $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - $(ARCH)" RECURSE=0 $(CTARGET) + cd $(APU_PATH) + $(MAKE) $(MAKEOPT) $(SSLOPT) $(XMLOPT) -f aprutil.mak CFG="aprutil - $(ARCH)" RECURSE=0 $(CTARGET) + $(MAKE) $(MAKEOPT) $(SSLOPT) $(XMLOPT) -f libaprutil.mak CFG="libaprutil - $(ARCH)" RECURSE=0 $(CTARGET) cd ldap $(MAKE) $(MAKEOPT) -f apr_ldap.mak CFG="apr_ldap - $(ARCH)" RECURSE=0 $(CTARGET) cd .. @@ -215,7 +234,7 @@ buildall: cd .. cd crypto for %d in ($(CRYPTO_LIST) x) do if not %d == x \ - $(MAKE) $(MAKEOPT) -f apr_crypto_%d.mak CFG="apr_crypto_%d - $(ARCH)" RECURSE=0 $(CTARGET) + $(MAKE) $(MAKEOPT) $(SSLOPT) -f apr_crypto_%d.mak CFG="apr_crypto_%d - $(ARCH)" RECURSE=0 $(CTARGET) cd .. !ELSEIF $(USESLN) == 1 @@ -306,7 +325,7 @@ checkapr: checkapu: cd $(APU_PATH) cd test - $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \ + $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \ OUTDIR=$(LIBSPATH) APROUTDIR=$(LIBSOSPATH) \ APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \ Modified: stable/11/contrib/apr-util/NOTICE ============================================================================== --- stable/11/contrib/apr-util/NOTICE Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/NOTICE Sun Jun 14 18:49:06 2020 (r362181) @@ -1,5 +1,5 @@ Apache Portable Runtime Utility Library -Copyright (c) 2000-2014 The Apache Software Foundation. +Copyright (c) 2000-2016 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Modified: stable/11/contrib/apr-util/NWGNUmakefile ============================================================================== --- stable/11/contrib/apr-util/NWGNUmakefile Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/NWGNUmakefile Sun Jun 14 18:49:06 2020 (r362181) @@ -261,9 +261,11 @@ FILES_lib_objs = \ $(OBJDIR)/apr_memcache.o \ $(OBJDIR)/apr_passwd.o \ $(OBJDIR)/apr_queue.o \ + $(OBJDIR)/apr_redis.o \ $(OBJDIR)/apr_reslist.o \ $(OBJDIR)/apr_rmm.o \ $(OBJDIR)/apr_sha1.o \ + $(OBJDIR)/apr_siphash.o \ $(OBJDIR)/apu_version.o \ $(OBJDIR)/getuuid.o \ $(OBJDIR)/uuid.o \ @@ -296,7 +298,7 @@ install :: nlms FORCE # Any specialized rules here # -vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:ldap:memcache:misc:strmatch:uri:xlate:xml +vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:ldap:memcache:redis:misc:strmatch:uri:xlate:xml # # Include the 'tail' makefile that has targets that depend on variables defined Modified: stable/11/contrib/apr-util/README ============================================================================== --- stable/11/contrib/apr-util/README Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/README Sun Jun 14 18:49:06 2020 (r362181) @@ -34,7 +34,7 @@ Apache Portable Runtime Utility Library README String filename-style pattern matching URI Parsing Charset translation (iconv based) - XML parsing (expat based) + XML parsing (expat) For a more complete list, please refer to the following URLs: @@ -66,7 +66,7 @@ for your compiled code. Similarly, the bindings for p such as Oracle (--with-oracle option) must also be explicitly enabled. On windows, selection of supported drivers is via the environment values -DBD_LIST (for freetds, mysql, oracle, pgsql, sqlite2 and/or sqlite3) +DBD_LIST (for mysql, oracle, pgsql, sqlite2 and/or sqlite3) and DBM_LIST (db and/or gdbm). DBD odbc and DBM sdbm are unconditionally compiled and installed, do not include these in the list. Copied: stable/11/contrib/apr-util/README.FREETDS (from r361692, head/contrib/apr-util/README.FREETDS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/apr-util/README.FREETDS Sun Jun 14 18:49:06 2020 (r362181, copy of r361692, head/contrib/apr-util/README.FREETDS) @@ -0,0 +1,11 @@ +The APR DBD Driver for FreeTDS has been removed from the build. +It is known to have problems, and we are not able to maintain it. + +The source code is still available. If you want it and are able +to manage maintenance for yourself, you can patch the build and +work through issues that affect you, but you're on your own. + +We expect that for most users, the ODBC driver will serve as +an alternative. + +Sorry. Copied: stable/11/contrib/apr-util/README.cmake (from r361692, head/contrib/apr-util/README.cmake) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/apr-util/README.cmake Sun Jun 14 18:49:06 2020 (r362181, copy of r361692, head/contrib/apr-util/README.cmake) @@ -0,0 +1,139 @@ +Experimental cmake-based build support for APR-Util on Microsoft Windows + +Status +------ + +This build support is currently intended only for Microsoft Windows. +Only Windows NT-based systems can be targeted. (The traditional +Windows build support for APR can target Windows 9x as well.) + +This build support is experimental. Specifically, + +* It does not support all features of APR-Util. +* Some components may not be built correctly and/or in a manner + compatible with the previous Windows build support. +* Build interfaces, such as the mechanisms which are used to enable + optional functionality or specify prerequisites, may change from + release to release as feedback is received from users and bugs and + limitations are resolved. + +Important: Refer to the "Known Bugs and Limitations" section for further + information. + + It is beyond the scope of this document to document or explain + how to utilize the various cmake features, such as different + build backends or provisions for finding support libraries. + + Please refer to the cmake documentation for additional information + that applies to building any project with cmake. + +Prerequisites +------------- + +The following tools must be in PATH: + +* cmake, version 2.8 or later + cmake version 3.1.3 or later is required to work with current OpenSSL + releases. (OpenSSL is an optional prerequisite of APR-Util.) +* If using a command-line compiler: compiler and linker and related tools + (Refer to the cmake documentation for more information.) + +The following support libraries are mandatory: + +* APR 1.4.x or APR 1.5.x, built with cmake + +Optional support libraries allow optional features of APR to be enabled: + +* OpenSSL +* many others potentially, though the build support isn't currently + implemented + +How to build +------------ + +1. cd to a clean directory for building (i.e., don't build in your + source tree) + +2. Some cmake backends may want your compile tools in PATH. (Hint: "Visual + Studio Command Prompt") + +3. set CMAKE_LIBRARY_PATH=d:\path\to\prereq1\lib;d:\path\to\prereq2\lib;... + +4. set CMAKE_INCLUDE_PATH=d:\path\to\prereq1\include;d:\path\to\prereq2\include;... + +5. cmake -G "some backend, like 'NMake Makefiles'" + -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst + -DAPR-Util-specific-flags + d:/path/to/aprutilsource + + If APR 1.x was installed to a different directory than APR-Util, + also pass these additional arguments: + + -DAPR_INCLUDE_DIR=d:/path/to/apr1inst/include + -DAPR_LIBRARIES=d:/path/to/apr1inst/lib/libapr-1.lib + + Alternately, use cmake-gui and update settings in the GUI. + + APR-Util feature flags: + + APU_HAVE_CRYPTO Build crypt support (only the OpenSSL + implementation is currently supported) + Default: OFF + APU_HAVE_ODBC Build ODBC DBD driver + Default: ON + APR_BUILD_TESTAPR Build APR-Util test suite + Default: OFF + TEST_STATIC_LIBS Build the test suite to test the APR static + library instead of the APR dynamic library. + Default: OFF + In order to build the test suite against both + static and dynamic libraries, separate builds + will be required, one with TEST_STATIC_LIBS + set to ON. + INSTALL_PDB Install .pdb files if generated. + Default: ON + + CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL + + CMAKE_BUILD_TYPE + + For NMake Makefiles the choices are at least DEBUG, RELEASE, + RELWITHDEBINFO, and MINSIZEREL + Other backends make have other selections. + +6. build using chosen backend (e.g., "nmake install") + +Known Bugs and Limitations +-------------------------- + +* If include/apu.h or other generated files have been created in the source + directory by another build system, they will be used unexpectedly and + cause the build to fail. +* Options should be provided for remaining features, along with finding any + necessary libraries + + DBM: + . APU_HAVE_GDBM + . APU_HAVE_NDBM + . APU_HAVE_DB + + DBD: + . APU_HAVE_PGSQL + . APU_HAVE_MYSQL + . APU_HAVE_SQLITE3 + . APU_HAVE_SQLITE2 + . APU_HAVE_ORACLE + + CRYPTO: + . APU_HAVE_NSS + + XLATE, APU_HAVE_ICONV (no way to consume an apr-iconv build yet) +* Static builds of APR modules are not supported. +* CHANGES/LICENSE/NOTICE is not installed, unlike Makefile.win. + (But unlike Makefile.win we want to call them APR-Util-CHANGES.txt + and so on.) But perhaps that is a job for a higher-level script. + +Generally: + +* Many APR-Util features have not been tested with this build. +* Developers need to examine the existing Windows build in great detail and see + what is missing from the cmake-based build, whether a feature or some build + nuance. +* Any feedback you can provide on your experiences with this build will be + helpful. Modified: stable/11/contrib/apr-util/apr-util.spec ============================================================================== --- stable/11/contrib/apr-util/apr-util.spec Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/apr-util.spec Sun Jun 14 18:49:06 2020 (r362181) @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.5.4 +Version: 1.6.1 Release: 1 License: Apache Software License Group: System Environment/Libraries @@ -70,16 +70,6 @@ Requires: apr-util = %{version}-%{release} This package provides the SQLite driver for the apr-util DBD (database abstraction) interface. -%package freetds -Group: Development/Libraries -Summary: APR utility library FreeTDS DBD driver -BuildRequires: freetds-devel -Requires: apr-util = %{version}-%{release} - -%description freetds -This package provides the FreeTDS driver for the apr-util DBD -(database abstraction) interface. - %package odbc Group: Development/Libraries Summary: APR utility library ODBC DBD driver @@ -124,7 +114,7 @@ This package provides crypto support for apr-util base %configure --with-apr=%{_prefix} \ --includedir=%{_includedir}/apr-%{apuver} \ --with-ldap --without-gdbm \ - --with-sqlite3 --with-pgsql --with-mysql --with-freetds --with-odbc \ + --with-sqlite3 --with-pgsql --with-mysql --with-odbc \ --with-berkeley-db \ --with-crypto --with-openssl --with-nss \ --without-sqlite2 @@ -176,10 +166,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %{_libdir}/apr-util-%{apuver}/apr_dbd_sqlite* -%files freetds -%defattr(-,root,root,-) -%{_libdir}/apr-util-%{apuver}/apr_dbd_freetds* - %files odbc %defattr(-,root,root,-) %{_libdir}/apr-util-%{apuver}/apr_dbd_odbc* @@ -203,7 +189,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libaprutil-%{apuver}.so %{_libdir}/pkgconfig/apr-util-%{apuver}.pc %{_includedir}/apr-%{apuver}/*.h -%doc --parents html +%doc html %changelog * Tue Jun 22 2004 Graham Leggett 1.0.0-1 Modified: stable/11/contrib/apr-util/aprutil.dsw ============================================================================== --- stable/11/contrib/apr-util/aprutil.dsw Sun Jun 14 17:36:43 2020 (r362180) +++ stable/11/contrib/apr-util/aprutil.dsw Sun Jun 14 18:49:06 2020 (r362181) @@ -51,24 +51,6 @@ Package=<4> ############################################################################### -Project: "apr_dbd_freetds"=".\dbd\apr_dbd_freetds.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libapr - End Project Dependency - Begin Project Dependency - Project_Dep_Name libaprutil - End Project Dependency -}}} - -############################################################################### - Project: "apr_dbd_mysql"=".\dbd\apr_dbd_mysql.dsp" - Package Owner=<4> Package=<5> @@ -275,9 +257,6 @@ Package=<4> Begin Project Dependency Project_Dep_Name apriconv End Project Dependency - Begin Project Dependency - Project_Dep_Name xml - End Project Dependency }}} ############################################################################### @@ -383,9 +362,6 @@ Package=<4> Begin Project Dependency Project_Dep_Name libapriconv_ces_modules End Project Dependency - Begin Project Dependency - Project_Dep_Name xml - End Project Dependency }}} ############################################################################### @@ -449,18 +425,6 @@ Package=<4> Begin Project Dependency Project_Dep_Name libapr End Project Dependency -}}} - -############################################################################### - -Project: "xml"=".\xml\expat\lib\xml.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jun 14 19:41:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFFC1342DE1; Sun, 14 Jun 2020 19:41:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lPwP5FJgz4p0k; Sun, 14 Jun 2020 19:41:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF33C11A05; Sun, 14 Jun 2020 19:41:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EJfPgR095453; Sun, 14 Jun 2020 19:41:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EJfPWk095451; Sun, 14 Jun 2020 19:41:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202006141941.05EJfPWk095451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 Jun 2020 19:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362182 - head/bin/sh/tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh/tests/execution X-SVN-Commit-Revision: 362182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 19:41:25 -0000 Author: jilles Date: Sun Jun 14 19:41:24 2020 New Revision: 362182 URL: https://svnweb.freebsd.org/changeset/base/362182 Log: sh/tests: Add tests for SIGINT in non-jobc background commands If job control is not enabled, background commands shall ignore SIGINT and SIGQUIT, and it shall be possible to override that ignore in the same shell. MFC after: 1 week Added: head/bin/sh/tests/execution/bg11.0 (contents, props changed) head/bin/sh/tests/execution/bg12.0 (contents, props changed) Modified: head/bin/sh/tests/execution/Makefile Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Sun Jun 14 18:49:06 2020 (r362181) +++ head/bin/sh/tests/execution/Makefile Sun Jun 14 19:41:24 2020 (r362182) @@ -17,6 +17,8 @@ ${PACKAGE}FILES+= bg7.0 ${PACKAGE}FILES+= bg8.0 ${PACKAGE}FILES+= bg9.0 ${PACKAGE}FILES+= bg10.0 bg10.0.stdout +${PACKAGE}FILES+= bg11.0 +${PACKAGE}FILES+= bg12.0 ${PACKAGE}FILES+= env1.0 ${PACKAGE}FILES+= fork1.0 ${PACKAGE}FILES+= fork2.0 Added: head/bin/sh/tests/execution/bg11.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/bg11.0 Sun Jun 14 19:41:24 2020 (r362182) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX` +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +# Use a trap, not the default action, since the shell may catch SIGINT and +# therefore its processing may be delayed. +{ trap 'exit 5' TERM; read dummy fifo1 +kill -INT "$!" +kill -TERM "$!" +exec 3>&- +wait "$!" +r=$? +[ "$r" = 5 ] Added: head/bin/sh/tests/execution/bg12.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/bg12.0 Sun Jun 14 19:41:24 2020 (r362182) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX` +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +{ trap - INT; : >fifo1; sleep 5; exit 4; } & +: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B11834337A; Sun, 14 Jun 2020 19:53:38 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from wforward2-smtp.messagingengine.com (wforward2-smtp.messagingengine.com [64.147.123.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49lQBT4qj6z4p5T; Sun, 14 Jun 2020 19:53:37 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailforward.west.internal (Postfix) with ESMTP id D6EA740B; Sun, 14 Jun 2020 15:53:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 14 Jun 2020 15:53:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=5NmNTk FW+evNCwUrDBhM/Hulxc/TpqM/BYlPAsqJ1uY=; b=e2DvOjohMA9syyih2ZN0Z5 7E/TqInQ/9xMG4DydOzvwnywDr7Wkd/YlelnH13yjZnKv8O1BcURz8Rvmh33JR+X nJmo+mFSiXVLgZEZ/7RMCHX4VVk3Yeh37UpNZboccZzqD1JfMERQAMVRUpe8uOL7 XgTt8KsPA7DVDcB+oNmmTpSQuh+2w4BVTEjlcGEsmFNuwkqaR4iDnDTAq+NQNgVf 1djsZ3obAyETtsJmVnMpEAwQQll44+YmBDH/JZqWiVRlr5JRJ5OhWdml/wbAl69o VZFFjwj8DuhnynJPfNUWEvPffTEJS4e1MHvzU1FfUMGBETpUSWv62fSlPi0vuMUg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeiiedgudegiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefvohhmucflohhnvghsuceothhhjhesfhhrvggvsghsugdr ohhrgheqnecuggftrfgrthhtvghrnhepveevtefgieefueejudeiuefhgeeuheejudetve egkeeitdefleevgfekveejjeevnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecu kfhppedufeejrdehtddrudejrdduvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehthhhjsehfrhgvvggsshgurdhorhhg X-ME-Proxy: Received: from tom-desk.erg.abdn.ac.uk (tom-desk.erg.abdn.ac.uk [137.50.17.12]) by mail.messagingengine.com (Postfix) with ESMTPA id 6A084328005D; Sun, 14 Jun 2020 15:53:34 -0400 (EDT) Date: Sun, 14 Jun 2020 20:51:26 +0100 From: Tom Jones To: Jessica Clarke Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361944 - in head/sys/dev/virtio: . network Message-ID: <20200614195126.GB68578@tom-desk.erg.abdn.ac.uk> References: <202006082151.058LpabU003001@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202006082151.058LpabU003001@repo.freebsd.org> X-Rspamd-Queue-Id: 49lQBT4qj6z4p5T X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 19:53:38 -0000 On Mon, Jun 08, 2020 at 09:51:36PM +0000, Jessica Clarke wrote: > Author: jrtc27 > Date: Mon Jun 8 21:51:36 2020 > New Revision: 361944 > URL: https://svnweb.freebsd.org/changeset/base/361944 > > Log: > virtio: Support non-legacy network device and queue > > The non-legacy interface always defines num_buffers in the header, > regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. We > also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1 > during negotiation, as it supports non-legacy transports just fine. This > fixes network packet transmission on TinyEMU. > > Reviewed by: br, brooks (mentor), jhb (mentor) > Approved by: br, brooks (mentor), jhb (mentor) > Differential Revision: https://reviews.freebsd.org/D25132 > > Modified: > head/sys/dev/virtio/network/if_vtnet.c > head/sys/dev/virtio/network/if_vtnetvar.h > head/sys/dev/virtio/virtio.c > head/sys/dev/virtio/virtqueue.c > Hi Jessica, After updating my current bhyve vm today (on a 12.1 host), networking no longer works. Reverting this commit seems to resolve the issue. I think vtnet is not passing enough data up to the ip layer. If I capture on the tap interface for the vm I see arp requests and arp replies, however kern.msgbuf is full of: <5>arp: short packet received on vtnet0 and netstat does not see any replies to arp requests: root@freebsd-current:~ # netstat -s -p arp arp: 11 ARP requests sent 0 ARP requests failed to sent 0 ARP replies sent 0 ARP requests received 0 ARP replies received 0 ARP packets received 24 total packets dropped due to no ARP entry 2 ARP entrys timed out 0 Duplicate IPs seen If I set up an arp entry manually I can see ICMP echo requests and responses on the tap interface, but the vm does not see the responses. root@freebsd-current:~ # netstat -s -p ip ip: 7 total packets received 0 bad header checksums 0 with size smaller than minimum 7 with data size < data length 0 with ip length > max ip packet size 0 with header length < data size 0 with data length < header length The line 7 with data size < data length makes me think that vtnet is truncating packets. markj pointed me at this bug in irc which might also be related: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242 - Tom From owner-svn-src-all@freebsd.org Sun Jun 14 20:47:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B9783444FE; Sun, 14 Jun 2020 20:47:32 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lRNh0MlLz4rb1; Sun, 14 Jun 2020 20:47:32 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 038A912663; Sun, 14 Jun 2020 20:47:32 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EKlVGN036763; Sun, 14 Jun 2020 20:47:31 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EKlV2u036760; Sun, 14 Jun 2020 20:47:31 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006142047.05EKlV2u036760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 14 Jun 2020 20:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362183 - in head/sys/dev: netmap virtio/network X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys/dev: netmap virtio/network X-SVN-Commit-Revision: 362183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 20:47:32 -0000 Author: vmaffione Date: Sun Jun 14 20:47:31 2020 New Revision: 362183 URL: https://svnweb.freebsd.org/changeset/base/362183 Log: netmap: vtnet: fix races in vtnet_netmap_reg() The nm_register callback needs to call nm_set_native_flags() or nm_clear_native_flags() once the device has been stopped. However, in the current implementation this is not true, as the device is stopped by vtnet_init_locked(). This causes race conditions where the driver crashes as soon as it dequeues netmap buffers assuming they are mbufs (or the other way around). To fix the issue, we extend vtnet_init_locked() with a second argument that, if not zero, will set/clear the netmap flags. This results in a huge simplification of the nm_register callback itself. Also, use netmap_reset() to check if a ring is going to be re-initialized in netmap mode. MFC after: 1 week Modified: head/sys/dev/netmap/if_vtnet_netmap.h head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- head/sys/dev/netmap/if_vtnet_netmap.h Sun Jun 14 19:41:24 2020 (r362182) +++ head/sys/dev/netmap/if_vtnet_netmap.h Sun Jun 14 20:47:31 2020 (r362183) @@ -39,52 +39,18 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state) { struct ifnet *ifp = na->ifp; struct vtnet_softc *sc = ifp->if_softc; - int success; - int i; - /* Drain the taskqueues to make sure that there are no worker threads - * accessing the virtqueues. */ - vtnet_drain_taskqueues(sc); - + /* + * Trigger a device reinit, asking vtnet_init_locked() to + * also enter or exit netmap mode. + */ VTNET_CORE_LOCK(sc); - - /* We need nm_netmap_on() to return true when called by - * vtnet_init_locked() below. */ - if (state) - nm_set_native_flags(na); - - /* We need to trigger a device reset in order to unexpose guest buffers - * published to the host. */ - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - /* Get pending used buffers. The way they are freed depends on whether - * they are netmap buffer or they are mbufs. We can tell apart the two - * cases by looking at kring->nr_mode, before this is possibly updated - * in the loop below. */ - for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { - struct vtnet_txq *txq = &sc->vtnet_txqs[i]; - struct vtnet_rxq *rxq = &sc->vtnet_rxqs[i]; - - VTNET_TXQ_LOCK(txq); - vtnet_txq_free_mbufs(txq); - VTNET_TXQ_UNLOCK(txq); - - VTNET_RXQ_LOCK(rxq); - vtnet_rxq_free_mbufs(rxq); - VTNET_RXQ_UNLOCK(rxq); - } - vtnet_init_locked(sc); - success = (ifp->if_drv_flags & IFF_DRV_RUNNING) ? 0 : ENXIO; - - if (state) { - netmap_krings_mode_commit(na, state); - } else { - nm_clear_native_flags(na); - netmap_krings_mode_commit(na, state); - } - + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + vtnet_init_locked(sc, state ? VTNET_INIT_NETMAP_ENTER + : VTNET_INIT_NETMAP_EXIT); VTNET_CORE_UNLOCK(sc); - return success; + return 0; } @@ -245,15 +211,13 @@ vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) { struct netmap_adapter *na = NA(rxq->vtnrx_sc->vtnet_ifp); struct netmap_kring *kring; + struct netmap_slot *slot; int error; - if (!nm_native_on(na) || rxq->vtnrx_id >= na->num_rx_rings) + slot = netmap_reset(na, NR_RX, rxq->vtnrx_id, 0); + if (slot == NULL) return -1; - kring = na->rx_rings[rxq->vtnrx_id]; - if (!(nm_kring_pending_on(kring) || - kring->nr_pending_mode == NKR_NETMAP_ON)) - return -1; /* Expose all the RX netmap buffers we can. In case of no indirect * buffers, the number of netmap slots in the RX ring matches the Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sun Jun 14 19:41:24 2020 (r362182) +++ head/sys/dev/virtio/network/if_vtnet.c Sun Jun 14 20:47:31 2020 (r362183) @@ -181,7 +181,7 @@ static int vtnet_init_tx_queues(struct vtnet_softc *); static int vtnet_init_rxtx_queues(struct vtnet_softc *); static void vtnet_set_active_vq_pairs(struct vtnet_softc *); static int vtnet_reinit(struct vtnet_softc *); -static void vtnet_init_locked(struct vtnet_softc *); +static void vtnet_init_locked(struct vtnet_softc *, int); static void vtnet_init(void *); static void vtnet_free_ctrl_vq(struct vtnet_softc *); @@ -523,7 +523,7 @@ vtnet_resume(device_t dev) VTNET_CORE_LOCK(sc); if (ifp->if_flags & IFF_UP) - vtnet_init_locked(sc); + vtnet_init_locked(sc, 0); sc->vtnet_flags &= ~VTNET_FLAG_SUSPENDED; VTNET_CORE_UNLOCK(sc); @@ -1087,7 +1087,7 @@ vtnet_change_mtu(struct vtnet_softc *sc, int new_mtu) if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - vtnet_init_locked(sc); + vtnet_init_locked(sc, 0); } return (0); @@ -1131,7 +1131,7 @@ vtnet_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat } } } else - vtnet_init_locked(sc); + vtnet_init_locked(sc, 0); if (error == 0) sc->vtnet_if_flags = ifp->if_flags; @@ -1189,7 +1189,7 @@ vtnet_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - vtnet_init_locked(sc); + vtnet_init_locked(sc, 0); } VTNET_CORE_UNLOCK(sc); @@ -2783,7 +2783,7 @@ vtnet_tick(void *xsc) if (timedout != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - vtnet_init_locked(sc); + vtnet_init_locked(sc, 0); } else callout_schedule(&sc->vtnet_tick_ch, hz); } @@ -3068,6 +3068,9 @@ vtnet_init_tx_queues(struct vtnet_softc *sc) for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { txq = &sc->vtnet_txqs[i]; txq->vtntx_watchdog = 0; +#ifdef DEV_NETMAP + netmap_reset(NA(sc->vtnet_ifp), NR_TX, i, 0); +#endif /* DEV_NETMAP */ } return (0); @@ -3151,7 +3154,7 @@ vtnet_reinit(struct vtnet_softc *sc) } static void -vtnet_init_locked(struct vtnet_softc *sc) +vtnet_init_locked(struct vtnet_softc *sc, int init_mode) { device_t dev; struct ifnet *ifp; @@ -3166,6 +3169,18 @@ vtnet_init_locked(struct vtnet_softc *sc) vtnet_stop(sc); +#ifdef DEV_NETMAP + /* Once stopped we can update the netmap flags, if necessary. */ + switch (init_mode) { + case VTNET_INIT_NETMAP_ENTER: + nm_set_native_flags(NA(ifp)); + break; + case VTNET_INIT_NETMAP_EXIT: + nm_clear_native_flags(NA(ifp)); + break; + } +#endif /* DEV_NETMAP */ + /* Reinitialize with the host. */ if (vtnet_virtio_reinit(sc) != 0) goto fail; @@ -3192,7 +3207,7 @@ vtnet_init(void *xsc) sc = xsc; VTNET_CORE_LOCK(sc); - vtnet_init_locked(sc); + vtnet_init_locked(sc, 0); VTNET_CORE_UNLOCK(sc); } Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Sun Jun 14 19:41:24 2020 (r362182) +++ head/sys/dev/virtio/network/if_vtnetvar.h Sun Jun 14 20:47:31 2020 (r362183) @@ -372,4 +372,10 @@ CTASSERT(((VTNET_MAX_TX_SEGS - 1) * MCLBYTES) >= VTNET "VTNET Core Lock", MTX_DEF); \ } while (0) +/* + * Values for the init_mode argument of vtnet_init_locked(). + */ +#define VTNET_INIT_NETMAP_ENTER 1 +#define VTNET_INIT_NETMAP_EXIT 2 + #endif /* _IF_VTNETVAR_H */ From owner-svn-src-all@freebsd.org Sun Jun 14 20:56:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D50B33449D7 for ; Sun, 14 Jun 2020 20:56:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lRZZ6bryz4sRc for ; Sun, 14 Jun 2020 20:56:06 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f66.google.com with SMTP id b82so4160670wmb.1 for ; Sun, 14 Jun 2020 13:56:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=cNwu/trXfmxkiH6gJQxC/Bp9+cfnTgp6P0B/RjqV4t4=; b=XGaGNuaivWQ43maGeKDmjzV+S/oYR935KWDnAbDwVcXNtPuqS5NRlBATtdl7IC27wo 07rzHM2ipmCFNe3No/Q32ARi8O7FU6TAsI5ToWri+YAz48VpGEeSsDus4LfkheekXulW hlykyNsKFdETQXWtvletGxLG/DDuvZ0aLJqX0LVYBRgLSVd9evVIqTJqRjZQ+Sdh0ohI S2sGhtKtfm9WW4lYdVE8CgCrQGfoJoQtz27602xP/JSUjfcz9UXTSah1uSLaM+SeFjXA AjtrqZU9R2ZV5FszteU+YGRtj2IYO22OMYOMvEMfRuGyBR+dBqkQS8G3PtoOJRy/QCiV CTdQ== X-Gm-Message-State: AOAM531kgFgkfMpQlZ+3UOf9E8yeSs9ESuaBSlcbuFOy8r0NJhTNepRU appF6qUvgbOpM5xBk7QNeQuDZw== X-Google-Smtp-Source: ABdhPJyMlnKzKgmfWVFlF1szl7fKzGPVr6Gfh93KH/1O9lwU2fC7WhSajQJIY2+2hPlvQ3ytFiN6dw== X-Received: by 2002:a1c:a444:: with SMTP id n65mr9194019wme.99.1592168165139; Sun, 14 Jun 2020 13:56:05 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id t8sm19175249wmi.46.2020.06.14.13.56.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jun 2020 13:56:04 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361944 - in head/sys/dev/virtio: . network From: Jessica Clarke In-Reply-To: <20200614195126.GB68578@tom-desk.erg.abdn.ac.uk> Date: Sun, 14 Jun 2020 21:56:03 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <97EEF019-16A4-4626-A484-A00979B52A74@freebsd.org> References: <202006082151.058LpabU003001@repo.freebsd.org> <20200614195126.GB68578@tom-desk.erg.abdn.ac.uk> To: Tom Jones X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49lRZZ6bryz4sRc X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.05)[-1.047]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.17)[-0.168]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.66:from]; NEURAL_HAM_MEDIUM(-0.99)[-0.989]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.66:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 20:56:07 -0000 On 14 Jun 2020, at 20:51, Tom Jones wrote: > On Mon, Jun 08, 2020 at 09:51:36PM +0000, Jessica Clarke wrote: >> Author: jrtc27 >> Date: Mon Jun 8 21:51:36 2020 >> New Revision: 361944 >> URL: https://svnweb.freebsd.org/changeset/base/361944 >>=20 >> Log: >> virtio: Support non-legacy network device and queue >>=20 >> The non-legacy interface always defines num_buffers in the header, >> regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it = unused. We >> also need to ensure our virtqueue doesn't filter out = VIRTIO_F_VERSION_1 >> during negotiation, as it supports non-legacy transports just fine. = This >> fixes network packet transmission on TinyEMU. >>=20 >> Reviewed by: br, brooks (mentor), jhb (mentor) >> Approved by: br, brooks (mentor), jhb (mentor) >> Differential Revision: https://reviews.freebsd.org/D25132 >>=20 >> Modified: >> head/sys/dev/virtio/network/if_vtnet.c >> head/sys/dev/virtio/network/if_vtnetvar.h >> head/sys/dev/virtio/virtio.c >> head/sys/dev/virtio/virtqueue.c >>=20 >=20 > Hi Jessica, >=20 > After updating my current bhyve vm today (on a 12.1 host), networking = no longer > works. Reverting this commit seems to resolve the issue. I think vtnet = is not > passing enough data up to the ip layer. >=20 > If I capture on the tap interface for the vm I see arp requests and = arp > replies, however kern.msgbuf is full of:=20 >=20 > <5>arp: short packet received on vtnet0 >=20 > and netstat does not see any replies to arp requests: >=20 > root@freebsd-current:~ # netstat -s -p arp > arp: > 11 ARP requests sent > 0 ARP requests failed to sent > 0 ARP replies sent > 0 ARP requests received > 0 ARP replies received > 0 ARP packets received > 24 total packets dropped due to no ARP entry > 2 ARP entrys timed out > 0 Duplicate IPs seen >=20 > If I set up an arp entry manually I can see ICMP echo requests and = responses on > the tap interface, but the vm does not see the responses.=20 >=20 > root@freebsd-current:~ # netstat -s -p ip > ip: > 7 total packets received > 0 bad header checksums > 0 with size smaller than minimum > 7 with data size < data length > 0 with ip length > max ip packet size > 0 with header length < data size > 0 with data length < header length >=20 > The line >=20 > 7 with data size < data length >=20 > makes me think that vtnet is truncating packets.=20 >=20 > markj pointed me at this bug in irc which might also be related: >=20 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247242 Hi Tom, Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf" case. Could you please try the patch below? Jess diff --git a/sys/dev/virtio/network/if_vtnet.c = b/sys/dev/virtio/network/if_vtnet.c index 7a0859cc0eb1..7e10b75f7f66 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1819,9 +1819,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) adjsz =3D sizeof(struct vtnet_rx_header); /* * Account for our pad inserted between the header - * and the actual start of the frame. + * and the actual start of the frame. This includes + * the unused num_buffers when using a legacy device. */ - len +=3D VTNET_RX_HEADER_PAD; + len +=3D adjsz - sc->vtnet_hdr_size; } else { mhdr =3D mtod(m, struct virtio_net_hdr_mrg_rxbuf *); nbufs =3D mhdr->num_buffers; From owner-svn-src-all@freebsd.org Sun Jun 14 20:57:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84B77344CA7; Sun, 14 Jun 2020 20:57:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lRc43N5vz4s9s; Sun, 14 Jun 2020 20:57:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EE6F124C8; Sun, 14 Jun 2020 20:57:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EKvOrn042647; Sun, 14 Jun 2020 20:57:24 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EKvOCh042646; Sun, 14 Jun 2020 20:57:24 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006142057.05EKvOCh042646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 14 Jun 2020 20:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362184 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 362184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 20:57:24 -0000 Author: tsoome Date: Sun Jun 14 20:57:24 2020 New Revision: 362184 URL: https://svnweb.freebsd.org/changeset/base/362184 Log: zfsboot: cstyle cleanup No functional changes intended. Sponsored by: Netflix, Klara Inc. Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sun Jun 14 20:47:31 2020 (r362183) +++ head/stand/i386/zfsboot/zfsboot.c Sun Jun 14 20:57:24 2020 (r362184) @@ -48,20 +48,20 @@ __FBSDID("$FreeBSD$"); #include "libzfs.h" -#define ARGS 0x900 -#define NOPT 14 -#define NDEV 3 +#define ARGS 0x900 +#define NOPT 14 +#define NDEV 3 -#define BIOS_NUMDRIVES 0x475 -#define DRV_HARD 0x80 -#define DRV_MASK 0x7f +#define BIOS_NUMDRIVES 0x475 +#define DRV_HARD 0x80 +#define DRV_MASK 0x7f -#define TYPE_AD 0 -#define TYPE_DA 1 -#define TYPE_MAXHARD TYPE_DA -#define TYPE_FD 2 +#define TYPE_AD 0 +#define TYPE_DA 1 +#define TYPE_MAXHARD TYPE_DA +#define TYPE_FD 2 -#define DEV_GELIBOOT_BSIZE 4096 +#define DEV_GELIBOOT_BSIZE 4096 extern uint32_t _end; @@ -97,12 +97,12 @@ uint32_t opts; * If no loader is found, try to load a kernel directly instead. */ static const struct string { - const char *p; - size_t len; + const char *p; + size_t len; } loadpath[] = { - { PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS) }, - { PATH_LOADER, sizeof(PATH_LOADER) }, - { PATH_KERNEL, sizeof(PATH_KERNEL) }, + { PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS) }, + { PATH_LOADER, sizeof(PATH_LOADER) }, + { PATH_KERNEL, sizeof(PATH_KERNEL) }, }; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; @@ -130,7 +130,7 @@ static char *heap_next; static char *heap_end; /* Buffers that must not span a 64k boundary. */ -#define READ_BUF_SIZE 8192 +#define READ_BUF_SIZE 8192 struct dmadat { char rdbuf[READ_BUF_SIZE]; /* for reading large things */ char secbuf[READ_BUF_SIZE]; /* for MBR/disklabel */ @@ -150,9 +150,9 @@ static char gelipw[GELI_PW_MAXLEN]; #endif struct zfsdsk { - struct dsk dsk; + struct dsk dsk; #ifdef LOADER_GELI_SUPPORT - struct geli_dev *gdev; + struct geli_dev *gdev; #endif }; @@ -162,7 +162,8 @@ struct zfsdsk { * Read from a dnode (which must be from a ZPL filesystem). */ static int -zfs_read(spa_t *spa, const dnode_phys_t *dnode, off_t *offp, void *start, size_t size) +zfs_read(spa_t *spa, const dnode_phys_t *dnode, off_t *offp, void *start, + size_t size) { const znode_phys_t *zp = (const znode_phys_t *) dnode->dn_bonus; size_t n; @@ -198,10 +199,10 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu daddr_t lba, alignlba; off_t diff; unsigned int nb, alignnb; - struct zfsdsk *zdsk = (struct zfsdsk *) priv; + struct zfsdsk *zdsk = priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) - return -1; + return (-1); p = buf; lba = off / DEV_BSIZE; @@ -242,12 +243,13 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu } if (drvread(&zdsk->dsk, dmadat->rdbuf, alignlba, alignnb)) - return -1; + return (-1); #ifdef LOADER_GELI_SUPPORT /* decrypt */ if (zdsk->gdev != NULL) { - if (geli_read(zdsk->gdev, ((alignlba - zdsk->dsk.start) * - DEV_BSIZE), dmadat->rdbuf, alignnb * DEV_BSIZE)) + if (geli_read(zdsk->gdev, + ((alignlba - zdsk->dsk.start) * DEV_BSIZE), + dmadat->rdbuf, alignnb * DEV_BSIZE)) return (-1); } #endif @@ -260,13 +262,13 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu diff = 0; } - return 0; + return (0); } /* Match the signature exactly due to signature madness */ static int vdev_read2(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) { - return vdev_read(vdev, priv, off, buf, bytes); + return (vdev_read(vdev, priv, off, buf, bytes)); } @@ -276,10 +278,10 @@ vdev_write(vdev_t *vdev, void *priv, off_t off, void * char *p; daddr_t lba; unsigned int nb; - struct zfsdsk *zdsk = (struct zfsdsk *) priv; + struct zfsdsk *zdsk = priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) - return -1; + return (-1); p = buf; lba = off / DEV_BSIZE; @@ -290,23 +292,23 @@ vdev_write(vdev_t *vdev, void *priv, off_t off, void * nb = READ_BUF_SIZE / DEV_BSIZE; memcpy(dmadat->rdbuf, p, nb * DEV_BSIZE); if (drvwrite(&zdsk->dsk, dmadat->rdbuf, lba, nb)) - return -1; + return (-1); p += nb * DEV_BSIZE; lba += nb; bytes -= nb * DEV_BSIZE; } - return 0; + return (0); } static int xfsread(const dnode_phys_t *dnode, off_t *offp, void *buf, size_t nbyte) { - if ((size_t)zfs_read(spa, dnode, offp, buf, nbyte) != nbyte) { - printf("Invalid format\n"); - return -1; - } - return 0; + if ((size_t)zfs_read(spa, dnode, offp, buf, nbyte) != nbyte) { + printf("Invalid format\n"); + return (-1); + } + return (0); } /* @@ -369,87 +371,93 @@ vdev_clear_pad2(vdev_t *vdev) static void bios_getmem(void) { - uint64_t size; + uint64_t size; - /* Parse system memory map */ - v86.ebx = 0; - do { - v86.ctl = V86_FLAGS; - v86.addr = 0x15; /* int 0x15 function 0xe820*/ - v86.eax = 0xe820; - v86.ecx = sizeof(struct bios_smap); - v86.edx = SMAP_SIG; - v86.es = VTOPSEG(&smap); - v86.edi = VTOPOFF(&smap); - v86int(); - if (V86_CY(v86.efl) || (v86.eax != SMAP_SIG)) - break; - /* look for a low-memory segment that's large enough */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && - (smap.length >= (512 * 1024))) - bios_basemem = smap.length; - /* look for the first segment in 'extended' memory */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { - bios_extmem = smap.length; - } + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe820 */ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if (V86_CY(v86.efl) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && + (smap.base == 0x100000)) { + bios_extmem = smap.length; + } - /* - * Look for the largest segment in 'extended' memory beyond - * 1MB but below 4GB. - */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && - (smap.base < 0x100000000ull)) { - size = smap.length; + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; - /* - * If this segment crosses the 4GB boundary, truncate it. - */ - if (smap.base + size > 0x100000000ull) - size = 0x100000000ull - smap.base; + /* + * If this segment crosses the 4GB boundary, + * truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; - if (size > high_heap_size) { - high_heap_size = size; - high_heap_base = smap.base; - } - } - } while (v86.ebx != 0); + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); - /* Fall back to the old compatibility function for base memory */ - if (bios_basemem == 0) { - v86.ctl = 0; - v86.addr = 0x12; /* int 0x12 */ - v86int(); - - bios_basemem = (v86.eax & 0xffff) * 1024; - } + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); - /* Fall back through several compatibility functions for extended memory */ - if (bios_extmem == 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x15; /* int 0x15 function 0xe801*/ - v86.eax = 0xe801; - v86int(); - if (!V86_CY(v86.efl)) { - bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + bios_basemem = (v86.eax & 0xffff) * 1024; } - } - if (bios_extmem == 0) { - v86.ctl = 0; - v86.addr = 0x15; /* int 0x15 function 0x88*/ - v86.eax = 0x8800; - v86int(); - bios_extmem = (v86.eax & 0xffff) * 1024; - } - /* - * If we have extended memory and did not find a suitable heap - * region in the SMAP, use the last 3MB of 'extended' memory as a - * high heap candidate. - */ - if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { - high_heap_size = HEAP_MIN; - high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; - } + /* + * Fall back through several compatibility functions for extended + * memory. + */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801 */ + v86.eax = 0xe801; + v86int(); + if (!V86_CY(v86.efl)) { + bios_extmem = ((v86.ecx & 0xffff) + + ((v86.edx & 0xffff) * 64)) * 1024; + } + } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88 */ + v86.eax = 0x8800; + v86int(); + bios_extmem = (v86.eax & 0xffff) * 1024; + } + + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } } /* @@ -458,20 +466,20 @@ bios_getmem(void) static int int13probe(int drive) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x800; - v86.edx = drive; - v86int(); - - if (!V86_CY(v86.efl) && /* carry clear */ - ((v86.edx & 0xff) != (drive & DRV_MASK))) { /* unit # OK */ - if ((v86.ecx & 0x3f) == 0) { /* absurd sector size */ - return(0); /* skip device */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x800; + v86.edx = drive; + v86int(); + + if (!V86_CY(v86.efl) && /* carry clear */ + ((v86.edx & 0xff) != (drive & DRV_MASK))) { /* unit # OK */ + if ((v86.ecx & 0x3f) == 0) { /* absurd sector size */ + return (0); /* skip device */ + } + return (1); } - return (1); - } - return(0); + return (0); } /* @@ -481,11 +489,11 @@ int13probe(int drive) static struct zfsdsk * copy_dsk(struct zfsdsk *zdsk) { - struct zfsdsk *newdsk; + struct zfsdsk *newdsk; - newdsk = malloc(sizeof(struct zfsdsk)); - *newdsk = *zdsk; - return (newdsk); + newdsk = malloc(sizeof(struct zfsdsk)); + *newdsk = *zdsk; + return (newdsk); } /* @@ -560,8 +568,8 @@ drvsize_ext(struct zfsdsk *zdsk) v86.edx = dskp->drive; v86.ebx = 0x55aa; v86int(); - if (V86_CY(v86.efl) || /* carry set */ - (v86.ebx & 0xffff) != 0xaa55 || /* signature */ + if (V86_CY(v86.efl) || /* carry set */ + (v86.ebx & 0xffff) != 0xaa55 || /* signature */ (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) return (size); @@ -593,598 +601,619 @@ static void probe_drive(struct zfsdsk *zdsk) { #ifdef GPT - struct gpt_hdr hdr; - struct gpt_ent *ent; - unsigned part, entries_per_sec; - daddr_t slba; + struct gpt_hdr hdr; + struct gpt_ent *ent; + unsigned part, entries_per_sec; + daddr_t slba; #endif #if defined(GPT) || defined(LOADER_GELI_SUPPORT) - daddr_t elba; + daddr_t elba; #endif - struct dos_partition *dp; - char *sec; - unsigned i; + struct dos_partition *dp; + char *sec; + unsigned i; #ifdef LOADER_GELI_SUPPORT - /* - * Taste the disk, if it is GELI encrypted, decrypt it then dig out the - * partition table and probe each slice/partition in turn for a vdev or - * GELI encrypted vdev. - */ - elba = drvsize_ext(zdsk); - if (elba > 0) { - elba--; - } - zdsk->gdev = geli_taste(vdev_read, zdsk, elba, "disk%u:0:"); - if ((zdsk->gdev != NULL) && (geli_havekey(zdsk->gdev) == 0)) - geli_passphrase(zdsk->gdev, gelipw); + /* + * Taste the disk, if it is GELI encrypted, decrypt it then dig out the + * partition table and probe each slice/partition in turn for a vdev or + * GELI encrypted vdev. + */ + elba = drvsize_ext(zdsk); + if (elba > 0) { + elba--; + } + zdsk->gdev = geli_taste(vdev_read, zdsk, elba, "disk%u:0:"); + if ((zdsk->gdev != NULL) && (geli_havekey(zdsk->gdev) == 0)) + geli_passphrase(zdsk->gdev, gelipw); #endif /* LOADER_GELI_SUPPORT */ - sec = dmadat->secbuf; - zdsk->dsk.start = 0; + sec = dmadat->secbuf; + zdsk->dsk.start = 0; #ifdef GPT - /* - * First check for GPT. - */ - if (drvread(&zdsk->dsk, sec, 1, 1)) { - return; - } - memcpy(&hdr, sec, sizeof(hdr)); - if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || - hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x00010000 || - hdr.hdr_entsz < sizeof(*ent) || DEV_BSIZE % hdr.hdr_entsz != 0) { - goto trymbr; - } + /* + * First check for GPT. + */ + if (drvread(&zdsk->dsk, sec, 1, 1)) { + return; + } + memcpy(&hdr, sec, sizeof(hdr)); + if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || + hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x00010000 || + hdr.hdr_entsz < sizeof(*ent) || DEV_BSIZE % hdr.hdr_entsz != 0) { + goto trymbr; + } - /* - * Probe all GPT partitions for the presence of ZFS pools. We - * return the spa_t for the first we find (if requested). This - * will have the effect of booting from the first pool on the - * disk. - * - * If no vdev is found, GELI decrypting the device and try again - */ - entries_per_sec = DEV_BSIZE / hdr.hdr_entsz; - slba = hdr.hdr_lba_table; - elba = slba + hdr.hdr_entries / entries_per_sec; - while (slba < elba) { - zdsk->dsk.start = 0; - if (drvread(&zdsk->dsk, sec, slba, 1)) - return; - for (part = 0; part < entries_per_sec; part++) { - ent = (struct gpt_ent *)(sec + part * hdr.hdr_entsz); - if (memcmp(&ent->ent_type, &freebsd_zfs_uuid, - sizeof(uuid_t)) == 0) { - zdsk->dsk.start = ent->ent_lba_start; - zdsk->dsk.size = ent->ent_lba_end - ent->ent_lba_start + 1; - zdsk->dsk.slice = part + 1; - zdsk->dsk.part = 255; - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - /* - * This slice had a vdev. We need a new dsk - * structure now since the vdev now owns this one. - */ - zdsk = copy_dsk(zdsk); - } + /* + * Probe all GPT partitions for the presence of ZFS pools. We + * return the spa_t for the first we find (if requested). This + * will have the effect of booting from the first pool on the + * disk. + * + * If no vdev is found, GELI decrypting the device and try again + */ + entries_per_sec = DEV_BSIZE / hdr.hdr_entsz; + slba = hdr.hdr_lba_table; + elba = slba + hdr.hdr_entries / entries_per_sec; + while (slba < elba) { + zdsk->dsk.start = 0; + if (drvread(&zdsk->dsk, sec, slba, 1)) + return; + for (part = 0; part < entries_per_sec; part++) { + ent = (struct gpt_ent *)(sec + part * hdr.hdr_entsz); + if (memcmp(&ent->ent_type, &freebsd_zfs_uuid, + sizeof(uuid_t)) == 0) { + zdsk->dsk.start = ent->ent_lba_start; + zdsk->dsk.size = + ent->ent_lba_end - ent->ent_lba_start + 1; + zdsk->dsk.slice = part + 1; + zdsk->dsk.part = 255; + if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { + /* + * This slice had a vdev. We need a new + * dsk structure now since the vdev now + * owns this one. + */ + zdsk = copy_dsk(zdsk); + } #ifdef LOADER_GELI_SUPPORT - else if ((zdsk->gdev = geli_taste(vdev_read, zdsk, - ent->ent_lba_end - ent->ent_lba_start, "disk%up%u:", - zdsk->dsk.unit, zdsk->dsk.slice)) != NULL) { - if (geli_havekey(zdsk->gdev) == 0 || - geli_passphrase(zdsk->gdev, gelipw) == 0) { - /* - * This slice has GELI, check it for ZFS. - */ - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - /* - * This slice had a vdev. We need a new dsk - * structure now since the vdev now owns this one. - */ - zdsk = copy_dsk(zdsk); + else if ((zdsk->gdev = geli_taste(vdev_read, + zdsk, ent->ent_lba_end - ent->ent_lba_start, + "disk%up%u:", zdsk->dsk.unit, + zdsk->dsk.slice)) != NULL) { + if (geli_havekey(zdsk->gdev) == 0 || + geli_passphrase(zdsk->gdev, gelipw) + == 0) { + /* + * This slice has GELI, + * check it for ZFS. + */ + if (vdev_probe(vdev_read2, + zdsk, NULL) == 0) { + /* + * This slice had a + * vdev. We need a new + * dsk structure now + * since the vdev now + * owns this one. + */ + zdsk = copy_dsk(zdsk); + } + break; + } + } +#endif /* LOADER_GELI_SUPPORT */ } - break; - } } -#endif /* LOADER_GELI_SUPPORT */ - } + slba++; } - slba++; - } - return; + return; trymbr: #endif /* GPT */ - if (drvread(&zdsk->dsk, sec, DOSBBSECTOR, 1)) - return; - dp = (void *)(sec + DOSPARTOFF); + if (drvread(&zdsk->dsk, sec, DOSBBSECTOR, 1)) + return; + dp = (void *)(sec + DOSPARTOFF); - for (i = 0; i < NDOSPART; i++) { - if (!dp[i].dp_typ) - continue; - zdsk->dsk.start = dp[i].dp_start; - zdsk->dsk.size = dp[i].dp_size; - zdsk->dsk.slice = i + 1; - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - zdsk = copy_dsk(zdsk); - } -#ifdef LOADER_GELI_SUPPORT - else if ((zdsk->gdev = geli_taste(vdev_read, zdsk, dp[i].dp_size - - dp[i].dp_start, "disk%us%u:")) != NULL) { - if (geli_havekey(zdsk->gdev) == 0 || - geli_passphrase(zdsk->gdev, gelipw) == 0) { - /* - * This slice has GELI, check it for ZFS. - */ + for (i = 0; i < NDOSPART; i++) { + if (!dp[i].dp_typ) + continue; + zdsk->dsk.start = dp[i].dp_start; + zdsk->dsk.size = dp[i].dp_size; + zdsk->dsk.slice = i + 1; if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - /* - * This slice had a vdev. We need a new dsk - * structure now since the vdev now owns this one. - */ - zdsk = copy_dsk(zdsk); + zdsk = copy_dsk(zdsk); } - break; - } - } +#ifdef LOADER_GELI_SUPPORT + else if ((zdsk->gdev = geli_taste(vdev_read, zdsk, + dp[i].dp_size - dp[i].dp_start, "disk%us%u:")) != NULL) { + if (geli_havekey(zdsk->gdev) == 0 || + geli_passphrase(zdsk->gdev, gelipw) == 0) { + /* + * This slice has GELI, check it for ZFS. + */ + if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { + /* + * This slice had a vdev. We need a new + * dsk structure now since the vdev now + * owns this one. + */ + zdsk = copy_dsk(zdsk); + } + break; + } + } #endif /* LOADER_GELI_SUPPORT */ - } + } } int main(void) { - dnode_phys_t dn; - off_t off; - struct zfsdsk *zdsk; - int autoboot, i; - int nextboot; - int rc; + dnode_phys_t dn; + off_t off; + struct zfsdsk *zdsk; + int autoboot, i; + int nextboot; + int rc; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - bios_getmem(); + bios_getmem(); - if (high_heap_size > 0) { - heap_end = PTOV(high_heap_base + high_heap_size); - heap_next = PTOV(high_heap_base); - } else { - heap_next = (char *)dmadat + sizeof(*dmadat); - heap_end = (char *)PTOV(bios_basemem); - } - setheap(heap_next, heap_end); + if (high_heap_size > 0) { + heap_end = PTOV(high_heap_base + high_heap_size); + heap_next = PTOV(high_heap_base); + } else { + heap_next = (char *)dmadat + sizeof(*dmadat); + heap_end = (char *)PTOV(bios_basemem); + } + setheap(heap_next, heap_end); - zdsk = calloc(1, sizeof(struct zfsdsk)); - zdsk->dsk.drive = *(uint8_t *)PTOV(ARGS); - zdsk->dsk.type = zdsk->dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - zdsk->dsk.unit = zdsk->dsk.drive & DRV_MASK; - zdsk->dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; - zdsk->dsk.part = 0; - zdsk->dsk.start = 0; - zdsk->dsk.size = drvsize_ext(zdsk); + zdsk = calloc(1, sizeof(struct zfsdsk)); + zdsk->dsk.drive = *(uint8_t *)PTOV(ARGS); + zdsk->dsk.type = zdsk->dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + zdsk->dsk.unit = zdsk->dsk.drive & DRV_MASK; + zdsk->dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; + zdsk->dsk.part = 0; + zdsk->dsk.start = 0; + zdsk->dsk.size = drvsize_ext(zdsk); - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = bios_basemem / 1024; - bootinfo.bi_extmem = bios_extmem / 1024; - bootinfo.bi_memsizes_valid++; - bootinfo.bi_bios_dev = zdsk->dsk.drive; + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); + bootinfo.bi_basemem = bios_basemem / 1024; + bootinfo.bi_extmem = bios_extmem / 1024; + bootinfo.bi_memsizes_valid++; + bootinfo.bi_bios_dev = zdsk->dsk.drive; - bootdev = MAKEBOOTDEV(dev_maj[zdsk->dsk.type], - zdsk->dsk.slice, zdsk->dsk.unit, zdsk->dsk.part); + bootdev = MAKEBOOTDEV(dev_maj[zdsk->dsk.type], + zdsk->dsk.slice, zdsk->dsk.unit, zdsk->dsk.part); - /* Process configuration file */ + /* Process configuration file */ - autoboot = 1; + autoboot = 1; - zfs_init(); + zfs_init(); - /* - * Probe the boot drive first - we will try to boot from whatever - * pool we find on that drive. - */ - probe_drive(zdsk); + /* + * Probe the boot drive first - we will try to boot from whatever + * pool we find on that drive. + */ + probe_drive(zdsk); - /* - * Probe the rest of the drives that the bios knows about. This - * will find any other available pools and it may fill in missing - * vdevs for the boot pool. - */ + /* + * Probe the rest of the drives that the bios knows about. This + * will find any other available pools and it may fill in missing + * vdevs for the boot pool. + */ #ifndef VIRTUALBOX - for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) #else - for (i = 0; i < MAXBDDEV; i++) + for (i = 0; i < MAXBDDEV; i++) #endif - { - if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) - continue; + { + if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) + continue; - if (!int13probe(i | DRV_HARD)) - break; + if (!int13probe(i | DRV_HARD)) + break; - zdsk = calloc(1, sizeof(struct zfsdsk)); - zdsk->dsk.drive = i | DRV_HARD; - zdsk->dsk.type = zdsk->dsk.drive & TYPE_AD; - zdsk->dsk.unit = i; - zdsk->dsk.slice = 0; - zdsk->dsk.part = 0; - zdsk->dsk.start = 0; - zdsk->dsk.size = drvsize_ext(zdsk); - probe_drive(zdsk); - } + zdsk = calloc(1, sizeof(struct zfsdsk)); + zdsk->dsk.drive = i | DRV_HARD; + zdsk->dsk.type = zdsk->dsk.drive & TYPE_AD; + zdsk->dsk.unit = i; + zdsk->dsk.slice = 0; + zdsk->dsk.part = 0; + zdsk->dsk.start = 0; + zdsk->dsk.size = drvsize_ext(zdsk); + probe_drive(zdsk); + } - /* - * The first discovered pool, if any, is the pool. - */ - spa = spa_get_primary(); - if (!spa) { - printf("%s: No ZFS pools located, can't boot\n", BOOTPROG); - for (;;) - ; - } + /* + * The first discovered pool, if any, is the pool. + */ + spa = spa_get_primary(); + if (!spa) { + printf("%s: No ZFS pools located, can't boot\n", BOOTPROG); + for (;;) + ; + } - primary_spa = spa; - primary_vdev = spa_get_primary_vdev(spa); + primary_spa = spa; + primary_vdev = spa_get_primary_vdev(spa); - nextboot = 0; - rc = vdev_read_pad2(primary_vdev, cmd, sizeof(cmd)); - if (vdev_clear_pad2(primary_vdev)) - printf("failed to clear pad2 area of primary vdev\n"); - if (rc == 0) { + nextboot = 0; + rc = vdev_read_pad2(primary_vdev, cmd, sizeof(cmd)); + if (vdev_clear_pad2(primary_vdev)) + printf("failed to clear pad2 area of primary vdev\n"); + if (rc == 0) { + if (*cmd) { + /* + * We could find an old-style ZFS Boot Block header + * here. Simply ignore it. + */ + if (*(uint64_t *)cmd != 0x2f5b007b10c) { + /* + * Note that parse() is destructive to cmd[] + * and we also want to honor RBX_QUIET option + * that could be present in cmd[]. + */ + nextboot = 1; + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse_cmd()) { + printf("failed to parse pad2 area of " + "primary vdev\n"); + reboot(); + } + if (!OPT_CHECK(RBX_QUIET)) + printf("zfs nextboot: %s\n", cmddup); + } + /* Do not process this command twice */ + *cmd = 0; + } + } else + printf("failed to read pad2 area of primary vdev\n"); + + /* Mount ZFS only if it's not already mounted via nextboot parsing. */ + if (zfsmount.spa == NULL && + (zfs_spa_init(spa) != 0 || zfs_mount(spa, 0, &zfsmount) != 0)) { + printf("%s: failed to mount default pool %s\n", + BOOTPROG, spa->spa_name); + autoboot = 0; + } else if (zfs_lookup(&zfsmount, PATH_CONFIG, &dn) == 0 || + zfs_lookup(&zfsmount, PATH_DOTCONFIG, &dn) == 0) { + off = 0; + zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); + } + if (*cmd) { - /* - * We could find an old-style ZFS Boot Block header here. - * Simply ignore it. - */ - if (*(uint64_t *)cmd != 0x2f5b007b10c) { /* - * Note that parse() is destructive to cmd[] and we also want - * to honor RBX_QUIET option that could be present in cmd[]. + * Note that parse_cmd() is destructive to cmd[] and we also + * want to honor RBX_QUIET option that could be present in + * cmd[]. */ - nextboot = 1; memcpy(cmddup, cmd, sizeof(cmd)); - if (parse_cmd()) { - printf("failed to parse pad2 area of primary vdev\n"); - reboot(); - } + if (parse_cmd()) + autoboot = 0; if (!OPT_CHECK(RBX_QUIET)) - printf("zfs nextboot: %s\n", cmddup); - } - /* Do not process this command twice */ - *cmd = 0; + printf("%s: %s\n", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; } - } else - printf("failed to read pad2 area of primary vdev\n"); - /* Mount ZFS only if it's not already mounted via nextboot parsing. */ - if (zfsmount.spa == NULL && - (zfs_spa_init(spa) != 0 || zfs_mount(spa, 0, &zfsmount) != 0)) { - printf("%s: failed to mount default pool %s\n", - BOOTPROG, spa->spa_name); - autoboot = 0; - } else if (zfs_lookup(&zfsmount, PATH_CONFIG, &dn) == 0 || - zfs_lookup(&zfsmount, PATH_DOTCONFIG, &dn) == 0) { - off = 0; - zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); - } + /* Do not risk waiting at the prompt forever. */ + if (nextboot && !autoboot) + reboot(); - if (*cmd) { - /* - * Note that parse_cmd() is destructive to cmd[] and we also want - * to honor RBX_QUIET option that could be present in cmd[]. - */ - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse_cmd()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s\n", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } - - /* Do not risk waiting at the prompt forever. */ - if (nextboot && !autoboot) - reboot(); - - if (autoboot && !*kname) { - /* - * Iterate through the list of loader and kernel paths, trying to load. - * If interrupted by a keypress, or in case of failure, drop the user - * to the boot2 prompt. - */ - for (i = 0; i < nitems(loadpath); i++) { - memcpy(kname, loadpath[i].p, loadpath[i].len); - if (keyhit(3)) - break; - load(); + if (autoboot && !*kname) { + /* + * Iterate through the list of loader and kernel paths, + * trying to load. If interrupted by a keypress, or in case of + * failure, drop the user to the boot2 prompt. + */ + for (i = 0; i < nitems(loadpath); i++) { + memcpy(kname, loadpath[i].p, loadpath[i].len); + if (keyhit(3)) + break; + load(); + } } - } - /* Present the user with the boot2 prompt. */ + /* Present the user with the boot2 prompt. */ - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) { - printf("\nFreeBSD/x86 boot\n"); - if (zfs_rlookup(spa, zfsmount.rootobj, rootname) != 0) - printf("Default: %s/<0x%llx>:%s\n" - "boot: ", - spa->spa_name, zfsmount.rootobj, kname); - else if (rootname[0] != '\0') - printf("Default: %s/%s:%s\n" - "boot: ", - spa->spa_name, rootname, kname); - else - printf("Default: %s:%s\n" - "boot: ", - spa->spa_name, kname); + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) { + printf("\nFreeBSD/x86 boot\n"); + if (zfs_rlookup(spa, zfsmount.rootobj, rootname) != 0) + printf("Default: %s/<0x%llx>:%s\n" + "boot: ", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jun 14 21:07:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFF9A345567; Sun, 14 Jun 2020 21:07:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lRqN4gxxz4tY2; Sun, 14 Jun 2020 21:07:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C01312776; Sun, 14 Jun 2020 21:07:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EL7Cqg049012; Sun, 14 Jun 2020 21:07:12 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EL7Cwu049011; Sun, 14 Jun 2020 21:07:12 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006142107.05EL7Cwu049011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 14 Jun 2020 21:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362185 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 362185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 21:07:12 -0000 Author: vmaffione Date: Sun Jun 14 21:07:12 2020 New Revision: 362185 URL: https://svnweb.freebsd.org/changeset/base/362185 Log: iflib: netmap: enter/exit netmap mode after device stops Avoid possible race conditions by calling nm_set_native_flags() and nm_clear_native_flags() only after the device has been stopped. MFC after: 1 week Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sun Jun 14 20:57:24 2020 (r362184) +++ head/sys/net/iflib.c Sun Jun 14 21:07:12 2020 (r362185) @@ -788,13 +788,19 @@ iflib_netmap_register(struct netmap_adapter *na, int o if (!CTX_IS_VF(ctx)) IFDI_CRCSTRIP_SET(ctx, onoff, iflib_crcstrip); - /* enable or disable flags and callbacks in na and ifp */ + iflib_stop(ctx); + + /* + * Enable (or disable) netmap flags, and intercept (or restore) + * ifp->if_transmit. This is done once the device has been stopped + * to prevent race conditions. + */ if (onoff) { nm_set_native_flags(na); } else { nm_clear_native_flags(na); } - iflib_stop(ctx); + iflib_init_locked(ctx); IFDI_CRCSTRIP_SET(ctx, onoff, iflib_crcstrip); // XXX why twice ? status = ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1; From owner-svn-src-all@freebsd.org Sun Jun 14 21:09:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D767F345666; Sun, 14 Jun 2020 21:09:19 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lRsq5HZHz4tlS; Sun, 14 Jun 2020 21:09:19 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: vmaffione) by smtp.freebsd.org (Postfix) with ESMTPSA id AB429200A4; Sun, 14 Jun 2020 21:09:19 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id g18so11113184qtu.13; Sun, 14 Jun 2020 14:09:19 -0700 (PDT) X-Gm-Message-State: AOAM5318rtRGvrCdS+0Wgqe3ab5bjcLQSZ8nwpRB3H7NSNi6dn4XuqMB aGtmXBwItRBdcwyECJSlioO/WeaElqiJlbLjTfg= X-Google-Smtp-Source: ABdhPJyQpogVILVqiowmZfnC0UqTf85YtfR36gdjNySzbMjXDmPd6aafjPjax2W0aFvFjc6oBkomHWsUWq3SZ2kwkGI= X-Received: by 2002:aed:3c58:: with SMTP id u24mr12543080qte.309.1592168959239; Sun, 14 Jun 2020 14:09:19 -0700 (PDT) MIME-Version: 1.0 References: <202006082151.058LpabU003001@repo.freebsd.org> <20200614195126.GB68578@tom-desk.erg.abdn.ac.uk> <97EEF019-16A4-4626-A484-A00979B52A74@freebsd.org> In-Reply-To: <97EEF019-16A4-4626-A484-A00979B52A74@freebsd.org> From: Vincenzo Maffione Date: Sun, 14 Jun 2020 23:09:07 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361944 - in head/sys/dev/virtio: . network To: Jessica Clarke Cc: Tom Jones , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 21:09:19 -0000 You may already know that, but FreeBSD-CURRENT supports mergeable rx buffers as of r358180. Cheers, Vincenzo Il giorno dom 14 giu 2020 alle ore 22:56 Jessica Clarke ha scritto: > On 14 Jun 2020, at 20:51, Tom Jones wrote: > > On Mon, Jun 08, 2020 at 09:51:36PM +0000, Jessica Clarke wrote: > >> Author: jrtc27 > >> Date: Mon Jun 8 21:51:36 2020 > >> New Revision: 361944 > >> URL: https://svnweb.freebsd.org/changeset/base/361944 > >> > >> Log: > >> virtio: Support non-legacy network device and queue > >> > >> The non-legacy interface always defines num_buffers in the header, > >> regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. > We > >> also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1 > >> during negotiation, as it supports non-legacy transports just fine. > This > >> fixes network packet transmission on TinyEMU. > >> > >> Reviewed by: br, brooks (mentor), jhb (mentor) > >> Approved by: br, brooks (mentor), jhb (mentor) > >> Differential Revision: https://reviews.freebsd.org/D25132 > >> > >> Modified: > >> head/sys/dev/virtio/network/if_vtnet.c > >> head/sys/dev/virtio/network/if_vtnetvar.h > >> head/sys/dev/virtio/virtio.c > >> head/sys/dev/virtio/virtqueue.c > >> > > > > Hi Jessica, > > > > After updating my current bhyve vm today (on a 12.1 host), networking no > longer > > works. Reverting this commit seems to resolve the issue. I think vtnet > is not > > passing enough data up to the ip layer. > > > > If I capture on the tap interface for the vm I see arp requests and arp > > replies, however kern.msgbuf is full of: > > > > <5>arp: short packet received on vtnet0 > > > > and netstat does not see any replies to arp requests: > > > > root@freebsd-current:~ # netstat -s -p arp > > arp: > > 11 ARP requests sent > > 0 ARP requests failed to sent > > 0 ARP replies sent > > 0 ARP requests received > > 0 ARP replies received > > 0 ARP packets received > > 24 total packets dropped due to no ARP entry > > 2 ARP entrys timed out > > 0 Duplicate IPs seen > > > > If I set up an arp entry manually I can see ICMP echo requests and > responses on > > the tap interface, but the vm does not see the responses. > > > > root@freebsd-current:~ # netstat -s -p ip > > ip: > > 7 total packets received > > 0 bad header checksums > > 0 with size smaller than minimum > > 7 with data size < data length > > 0 with ip length > max ip packet size > > 0 with header length < data size > > 0 with data length < header length > > > > The line > > > > 7 with data size < data length > > > > makes me think that vtnet is truncating packets. > > > > markj pointed me at this bug in irc which might also be related: > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242 > > Hi Tom, > Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf" > case. Could you please try the patch below? > > Jess > > diff --git a/sys/dev/virtio/network/if_vtnet.c > b/sys/dev/virtio/network/if_vtnet.c > index 7a0859cc0eb1..7e10b75f7f66 100644 > --- a/sys/dev/virtio/network/if_vtnet.c > +++ b/sys/dev/virtio/network/if_vtnet.c > @@ -1819,9 +1819,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > adjsz = sizeof(struct vtnet_rx_header); > /* > * Account for our pad inserted between the header > - * and the actual start of the frame. > + * and the actual start of the frame. This includes > + * the unused num_buffers when using a legacy device. > */ > - len += VTNET_RX_HEADER_PAD; > + len += adjsz - sc->vtnet_hdr_size; > } else { > mhdr = mtod(m, struct virtio_net_hdr_mrg_rxbuf *); > nbufs = mhdr->num_buffers; > > From owner-svn-src-all@freebsd.org Sun Jun 14 21:24:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DEDD345C31; Sun, 14 Jun 2020 21:24:42 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from wforward1-smtp.messagingengine.com (wforward1-smtp.messagingengine.com [64.147.123.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49lSCY4wbpz4vjR; Sun, 14 Jun 2020 21:24:41 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailforward.west.internal (Postfix) with ESMTP id 0591F411; Sun, 14 Jun 2020 17:24:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sun, 14 Jun 2020 17:24:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=rof2E6 ZtULdT5N0EOIoca/VKGqB3k91fgUcOkXYghKU=; b=jTUVJqQ5cPcKeBFewUAAOq UtG55G0DG+c11Xecs6GFfOM31g/JPjRupXqfXyDdw+eVDrMbZ1VbJy1FLSMjOBMA sKYwqbflznFSfPoyFA003UXDtUKfsgFB1tuF+wIYraqxPogAaUBiP6j24bBRfsyV Ng+du2dCs6SCSO9qrHN0wZeiHZLbADdtR3obltijHIF+T4KbSRSHAxb38psKUzzJ UuRi5Ui6h8avY7D4c2yKRztMvjN0nBMxZtuwlJb1jA8R92HzY2l9RMKoJtNOOD8k j+SgeMEG4I0TE7FOAQvcHUB/ksJQ1BSFD6e6LdjOiBYpEvYISvRMIIYV+i7zj+PQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeiiedgudeifecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefvohhmucflohhnvghsuceothhhjhesfhhrvggvsghsugdr ohhrgheqnecuggftrfgrthhtvghrnhepveevtefgieefueejudeiuefhgeeuheejudetve egkeeitdefleevgfekveejjeevnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecu kfhppedufeejrdehtddrudejrdduvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehthhhjsehfrhgvvggsshgurdhorhhg X-ME-Proxy: Received: from tom-desk.erg.abdn.ac.uk (tom-desk.erg.abdn.ac.uk [137.50.17.12]) by mail.messagingengine.com (Postfix) with ESMTPA id BAAAF3060FE7; Sun, 14 Jun 2020 17:24:38 -0400 (EDT) Date: Sun, 14 Jun 2020 22:22:30 +0100 From: Tom Jones To: Jessica Clarke Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361944 - in head/sys/dev/virtio: . network Message-ID: <20200614212230.GC68578@tom-desk.erg.abdn.ac.uk> References: <202006082151.058LpabU003001@repo.freebsd.org> <20200614195126.GB68578@tom-desk.erg.abdn.ac.uk> <97EEF019-16A4-4626-A484-A00979B52A74@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <97EEF019-16A4-4626-A484-A00979B52A74@freebsd.org> X-Rspamd-Queue-Id: 49lSCY4wbpz4vjR X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 21:24:42 -0000 On Sun, Jun 14, 2020 at 09:56:03PM +0100, Jessica Clarke wrote: > On 14 Jun 2020, at 20:51, Tom Jones wrote: > > On Mon, Jun 08, 2020 at 09:51:36PM +0000, Jessica Clarke wrote: > >> Author: jrtc27 > >> Date: Mon Jun 8 21:51:36 2020 > >> New Revision: 361944 > >> URL: https://svnweb.freebsd.org/changeset/base/361944 > >> > >> Log: > >> virtio: Support non-legacy network device and queue > >> > >> The non-legacy interface always defines num_buffers in the header, > >> regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. We > >> also need to ensure our virtqueue doesn't filter out VIRTIO_F_VERSION_1 > >> during negotiation, as it supports non-legacy transports just fine. This > >> fixes network packet transmission on TinyEMU. > >> > >> Reviewed by: br, brooks (mentor), jhb (mentor) > >> Approved by: br, brooks (mentor), jhb (mentor) > >> Differential Revision: https://reviews.freebsd.org/D25132 > >> > >> Modified: > >> head/sys/dev/virtio/network/if_vtnet.c > >> head/sys/dev/virtio/network/if_vtnetvar.h > >> head/sys/dev/virtio/virtio.c > >> head/sys/dev/virtio/virtqueue.c > >> > > > > Hi Jessica, > > > > After updating my current bhyve vm today (on a 12.1 host), networking no longer > > works. Reverting this commit seems to resolve the issue. I think vtnet is not > > passing enough data up to the ip layer. > > > > If I capture on the tap interface for the vm I see arp requests and arp > > replies, however kern.msgbuf is full of: > > > > <5>arp: short packet received on vtnet0 > > > > and netstat does not see any replies to arp requests: > > > > root@freebsd-current:~ # netstat -s -p arp > > arp: > > 11 ARP requests sent > > 0 ARP requests failed to sent > > 0 ARP replies sent > > 0 ARP requests received > > 0 ARP replies received > > 0 ARP packets received > > 24 total packets dropped due to no ARP entry > > 2 ARP entrys timed out > > 0 Duplicate IPs seen > > > > If I set up an arp entry manually I can see ICMP echo requests and responses on > > the tap interface, but the vm does not see the responses. > > > > root@freebsd-current:~ # netstat -s -p ip > > ip: > > 7 total packets received > > 0 bad header checksums > > 0 with size smaller than minimum > > 7 with data size < data length > > 0 with ip length > max ip packet size > > 0 with header length < data size > > 0 with data length < header length > > > > The line > > > > 7 with data size < data length > > > > makes me think that vtnet is truncating packets. > > > > markj pointed me at this bug in irc which might also be related: > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242 > > Hi Tom, > Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf" > case. Could you please try the patch below? > > Jess > This changed fixed the issue for me. Please feel free to add Tested By: thj when you commit. In testing I this lor went by, I wonder if this is something you care about: acquiring duplicate lock of same type: "vtnet0-rx0" 1st vtnet0-rx0 @ /usr/home/tj/code/freebsd/projects/review-D25220/sys/dev/virtio/network/if_vtnet.c:1780 2nd vtnet0-rx0 @ /usr/home/tj/code/freebsd/projects/review-D25220/sys/kern/subr_taskqueue.c:281 stack backtrace: #0 0xffffffff80c32881 at witness_debugger+0x71 #1 0xffffffff80ba3e54 at __mtx_lock_flags+0x94 #2 0xffffffff80c24bd2 at taskqueue_enqueue+0x42 #3 0xffffffff80a1af99 at vtnet_rxq_tq_intr+0xb9 #4 0xffffffff80c2520a at taskqueue_run_locked+0xaa #5 0xffffffff80c26284 at taskqueue_thread_loop+0x94 #6 0xffffffff80b830e0 at fork_exit+0x80 #7 0xffffffff81040eae at fork_trampoline+0xe - Tom From owner-svn-src-all@freebsd.org Sun Jun 14 22:05:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73783346ADA for ; Sun, 14 Jun 2020 22:05:45 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lT6w5Y4tz3T7Q for ; Sun, 14 Jun 2020 22:05:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f67.google.com with SMTP id o8so3311408wmh.4 for ; Sun, 14 Jun 2020 15:05:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mEHnXo+1wUMFhVpeBENtiOfcOAkEMSvrOFnqttI1WQ8=; b=JRf/L259KgR4G4YFRD34RNdpImxBZ9MKq/87htvmQh8CEQeU1feXAKITnR3yIaKtwN B2o8dDE1SDxKyFOmnrFUB7mgaYyW+edJ95jD0S63ijruuE4+FH/Cs7NCKbCMpZfe3S/9 YmqvdE3Kuop6IGegzUspgLzGE7FFKVHxPs1mABXQHixVDdqLdwldQvC2me0gDZgLFNPv vTE74GZVmDimzygDXwC189qy6g2YYs9bgxq1lbo2quLDqKdlfwVssusOuZ4tybMbGIXK U8OBF0FXE8BKKM4A5EomryuJmfJ5eqMORaX22EEFcDe79NbPWZDqMC47MgQqpuw956HC qhHg== X-Gm-Message-State: AOAM532ZdwSwBBlF1SIjJvZ6eWhkUvSi8EtdfhNITtTd2ULMa9rKCVu4 1nuacpHrffD8VAu2R4RPb2qzzg== X-Google-Smtp-Source: ABdhPJzIJPosos1yXC/0BMBVs7cLrbE7OJ6Dg0OU3CvtIwQOc89E2fwage8f7vc9Y9xqLtONqNMGSA== X-Received: by 2002:a1c:6a13:: with SMTP id f19mr10257620wmc.142.1592172343350; Sun, 14 Jun 2020 15:05:43 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id c6sm20913472wma.15.2020.06.14.15.05.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jun 2020 15:05:42 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361944 - in head/sys/dev/virtio: . network From: Jessica Clarke In-Reply-To: <20200614212230.GC68578@tom-desk.erg.abdn.ac.uk> Date: Sun, 14 Jun 2020 23:05:42 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0FD9E443-1B40-4495-B2C0-4803121EF911@freebsd.org> References: <202006082151.058LpabU003001@repo.freebsd.org> <20200614195126.GB68578@tom-desk.erg.abdn.ac.uk> <97EEF019-16A4-4626-A484-A00979B52A74@freebsd.org> <20200614212230.GC68578@tom-desk.erg.abdn.ac.uk> To: Tom Jones , Vincenzo Maffione X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49lT6w5Y4tz3T7Q X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.56 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.03)[-1.035]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.04)[-0.038]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.67:from]; NEURAL_HAM_MEDIUM(-0.99)[-0.988]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.67:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 22:05:45 -0000 On 14 Jun 2020, at 22:22, Tom Jones wrote: > On Sun, Jun 14, 2020 at 09:56:03PM +0100, Jessica Clarke wrote: >> On 14 Jun 2020, at 20:51, Tom Jones wrote: >>> On Mon, Jun 08, 2020 at 09:51:36PM +0000, Jessica Clarke wrote: >>>> Author: jrtc27 >>>> Date: Mon Jun 8 21:51:36 2020 >>>> New Revision: 361944 >>>> URL: https://svnweb.freebsd.org/changeset/base/361944 >>>>=20 >>>> Log: >>>> virtio: Support non-legacy network device and queue >>>>=20 >>>> The non-legacy interface always defines num_buffers in the header, >>>> regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it = unused. We >>>> also need to ensure our virtqueue doesn't filter out = VIRTIO_F_VERSION_1 >>>> during negotiation, as it supports non-legacy transports just fine. = This >>>> fixes network packet transmission on TinyEMU. >>>>=20 >>>> Reviewed by: br, brooks (mentor), jhb (mentor) >>>> Approved by: br, brooks (mentor), jhb (mentor) >>>> Differential Revision: https://reviews.freebsd.org/D25132 >>>>=20 >>>> Modified: >>>> head/sys/dev/virtio/network/if_vtnet.c >>>> head/sys/dev/virtio/network/if_vtnetvar.h >>>> head/sys/dev/virtio/virtio.c >>>> head/sys/dev/virtio/virtqueue.c >>>>=20 >>>=20 >>> Hi Jessica, >>>=20 >>> After updating my current bhyve vm today (on a 12.1 host), = networking no longer >>> works. Reverting this commit seems to resolve the issue. I think = vtnet is not >>> passing enough data up to the ip layer. >>>=20 >>> If I capture on the tap interface for the vm I see arp requests and = arp >>> replies, however kern.msgbuf is full of:=20 >>>=20 >>> <5>arp: short packet received on vtnet0 >>>=20 >>> and netstat does not see any replies to arp requests: >>>=20 >>> root@freebsd-current:~ # netstat -s -p arp >>> arp: >>> 11 ARP requests sent >>> 0 ARP requests failed to sent >>> 0 ARP replies sent >>> 0 ARP requests received >>> 0 ARP replies received >>> 0 ARP packets received >>> 24 total packets dropped due to no ARP entry >>> 2 ARP entrys timed out >>> 0 Duplicate IPs seen >>>=20 >>> If I set up an arp entry manually I can see ICMP echo requests and = responses on >>> the tap interface, but the vm does not see the responses.=20 >>>=20 >>> root@freebsd-current:~ # netstat -s -p ip >>> ip: >>> 7 total packets received >>> 0 bad header checksums >>> 0 with size smaller than minimum >>> 7 with data size < data length >>> 0 with ip length > max ip packet size >>> 0 with header length < data size >>> 0 with data length < header length >>>=20 >>> The line >>>=20 >>> 7 with data size < data length >>>=20 >>> makes me think that vtnet is truncating packets.=20 >>>=20 >>> markj pointed me at this bug in irc which might also be related: >>>=20 >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247242 >>=20 >> Hi Tom, >> Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf" >> case. Could you please try the patch below? >>=20 >> Jess >>=20 >=20 > This changed fixed the issue for me. Please feel free to add=20 >=20 > Tested By: thj=20 >=20 > when you commit. Great, thanks for the report. > In testing I this lor went by, I wonder if this is something you care = about: >=20 > acquiring duplicate lock of same type: "vtnet0-rx0" > 1st vtnet0-rx0 @ = /usr/home/tj/code/freebsd/projects/review-D25220/sys/dev/virtio/network/if= _vtnet.c:1780 > 2nd vtnet0-rx0 @ = /usr/home/tj/code/freebsd/projects/review-D25220/sys/kern/subr_taskqueue.c= :281 > stack backtrace: > #0 0xffffffff80c32881 at witness_debugger+0x71 > #1 0xffffffff80ba3e54 at __mtx_lock_flags+0x94 > #2 0xffffffff80c24bd2 at taskqueue_enqueue+0x42 > #3 0xffffffff80a1af99 at vtnet_rxq_tq_intr+0xb9 > #4 0xffffffff80c2520a at taskqueue_run_locked+0xaa > #5 0xffffffff80c26284 at taskqueue_thread_loop+0x94 > #6 0xffffffff80b830e0 at fork_exit+0x80 > #7 0xffffffff81040eae at fork_trampoline+0xe Hm, I think that's just a false-positive, because if_vtnet constructs the taskqueue using the same name as its own internal mutexes. Though the locking around vtnet_rx_vq_intr and vtnet_rxq_tq_intr is a bit fishy given they're rather similar yet inconsistent. I would imagine rxq->vtnrx_stats.vrxs_rescheduled is supposed to be protected by that mutex, but wouldn't like to say whether taskqueue_enqueue needs to be. Vincenzo, you recently touched code around there, perhaps you could be persuaded to have a quick look?.. Jess From owner-svn-src-all@freebsd.org Sun Jun 14 22:39:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFF823473CC; Sun, 14 Jun 2020 22:39:34 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lTsy64rDz3V3q; Sun, 14 Jun 2020 22:39:34 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBFD21363A; Sun, 14 Jun 2020 22:39:34 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EMdYEV004628; Sun, 14 Jun 2020 22:39:34 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EMdYHb004627; Sun, 14 Jun 2020 22:39:34 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202006142239.05EMdYHb004627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Sun, 14 Jun 2020 22:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362186 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 362186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 22:39:35 -0000 Author: jrtc27 Date: Sun Jun 14 22:39:34 2020 New Revision: 362186 URL: https://svnweb.freebsd.org/changeset/base/362186 Log: vtnet: Fix regression introduced in r361944 For legacy devices that don't support MrgRxBuf (such as bhyve pre-r358180), r361944 failed to update the receive handler to account for the additional padding introduced by the unused num_buffers field that is now always present in struct vtnet_rx_header. Thus, calculate the padding dynamically based on vtnet_hdr_size. PR: 247242 Reported by: thj Tested by: thj Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sun Jun 14 21:07:12 2020 (r362185) +++ head/sys/dev/virtio/network/if_vtnet.c Sun Jun 14 22:39:34 2020 (r362186) @@ -1819,9 +1819,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) adjsz = sizeof(struct vtnet_rx_header); /* * Account for our pad inserted between the header - * and the actual start of the frame. + * and the actual start of the frame. This includes + * the unused num_buffers when using a legacy device. */ - len += VTNET_RX_HEADER_PAD; + len += adjsz - sc->vtnet_hdr_size; } else { mhdr = mtod(m, struct virtio_net_hdr_mrg_rxbuf *); nbufs = mhdr->num_buffers; From owner-svn-src-all@freebsd.org Mon Jun 15 03:01:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 569E334C8E1; Mon, 15 Jun 2020 03:01:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lbhB1Gc9z401R; Mon, 15 Jun 2020 03:01:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23DED16E27; Mon, 15 Jun 2020 03:01:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05F31Ukg066542; Mon, 15 Jun 2020 03:01:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05F31Tuh066537; Mon, 15 Jun 2020 03:01:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006150301.05F31Tuh066537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Jun 2020 03:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362187 - in stable/12/sys: compat/linux vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: compat/linux vm X-SVN-Commit-Revision: 362187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 03:01:30 -0000 Author: markj Date: Mon Jun 15 03:01:28 2020 New Revision: 362187 URL: https://svnweb.freebsd.org/changeset/base/362187 Log: MFC r361945, r362036: Stop computing a "sharedram" value when emulating Linux sysinfo(2). Modified: stable/12/sys/compat/linux/linux_misc.c stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_map.h stable/12/sys/vm/vm_mmap.c stable/12/sys/vm/vm_unix.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Sun Jun 14 22:39:34 2020 (r362186) +++ stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:01:28 2020 (r362187) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef COMPAT_LINUX32 @@ -150,7 +149,6 @@ int linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) { struct l_sysinfo sysinfo; - vm_object_t object; int i, j; struct timespec ts; @@ -168,14 +166,13 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ sysinfo.totalram = physmem * PAGE_SIZE; sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; + /* + * sharedram counts pages allocated to named, swap-backed objects such + * as shared memory segments and tmpfs files. There is no cheap way to + * compute this, so just leave the field unpopulated. Linux itself only + * started setting this field in the 3.x timeframe. + */ sysinfo.sharedram = 0; - mtx_lock(&vm_object_list_mtx); - TAILQ_FOREACH(object, &vm_object_list, object_list) - if (object->shadow_count > 1) - sysinfo.sharedram += object->resident_page_count; - mtx_unlock(&vm_object_list_mtx); - - sysinfo.sharedram *= PAGE_SIZE; sysinfo.bufferram = 0; swap_pager_status(&i, &j); Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Sun Jun 14 22:39:34 2020 (r362186) +++ stable/12/sys/vm/vm_map.c Mon Jun 15 03:01:28 2020 (r362187) @@ -3097,7 +3097,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm u_long npages; u_int last_timestamp; int rv; - boolean_t need_wakeup, result, user_wire; + boolean_t need_wakeup, result, user_wire, user_wire_limit; vm_prot_t prot; VM_MAP_ASSERT_LOCKED(map); @@ -3108,6 +3108,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; + user_wire_limit = (flags & VM_MAP_WIRE_USER_LIMIT) ? TRUE : FALSE; VM_MAP_RANGE_CHECK(map, start, end); if (!vm_map_lookup_entry(map, start, &first_entry)) { if (flags & VM_MAP_WIRE_HOLESOK) @@ -3188,7 +3189,8 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm entry->wired_count++; npages = atop(entry->end - entry->start); - if (user_wire && !vm_map_wire_user_count_add(npages)) { + if (user_wire_limit && + !vm_map_wire_user_count_add(npages)) { vm_map_wire_entry_failure(map, entry, entry->start); end = entry->end; @@ -3250,7 +3252,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm last_timestamp = map->timestamp; if (rv != KERN_SUCCESS) { vm_map_wire_entry_failure(map, entry, faddr); - if (user_wire) + if (user_wire_limit) vm_map_wire_user_count_sub(npages); end = entry->end; goto done; @@ -3319,7 +3321,7 @@ done: */ if (entry->wired_count == 1) { vm_map_entry_unwire(map, entry); - if (user_wire) + if (user_wire_limit) vm_map_wire_user_count_sub( atop(entry->end - entry->start)); } else @@ -4455,7 +4457,8 @@ retry: if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { rv = vm_map_wire_locked(map, grow_start, grow_start + grow_amount, - VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | + VM_MAP_WIRE_NOHOLES); } vm_map_lock_downgrade(map); Modified: stable/12/sys/vm/vm_map.h ============================================================================== --- stable/12/sys/vm/vm_map.h Sun Jun 14 22:39:34 2020 (r362186) +++ stable/12/sys/vm/vm_map.h Mon Jun 15 03:01:28 2020 (r362187) @@ -397,6 +397,8 @@ long vmspace_resident_count(struct vmspace *vmspace); #define VM_MAP_WIRE_WRITE 4 /* Validate writable. */ +#define VM_MAP_WIRE_USER_LIMIT 8 /* Enfore the user wiring limit */ + #ifdef _KERNEL boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); Modified: stable/12/sys/vm/vm_mmap.c ============================================================================== --- stable/12/sys/vm/vm_mmap.c Sun Jun 14 22:39:34 2020 (r362186) +++ stable/12/sys/vm/vm_mmap.c Mon Jun 15 03:01:28 2020 (r362187) @@ -1046,7 +1046,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint } #endif error = vm_map_wire(map, start, end, - VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | VM_MAP_WIRE_NOHOLES); #ifdef RACCT if (racct_enable && error != KERN_SUCCESS) { PROC_LOCK(proc); @@ -1111,7 +1111,8 @@ sys_mlockall(struct thread *td, struct mlockall_args * * calling vm_fault_wire() for each page in the region. */ error = vm_map_wire(map, vm_map_min(map), vm_map_max(map), - VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK); + VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | + VM_MAP_WIRE_HOLESOK); if (error == KERN_SUCCESS) error = 0; else if (error == KERN_RESOURCE_SHORTAGE) @@ -1589,6 +1590,7 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz if ((map->flags & MAP_WIREFUTURE) != 0) (void)vm_map_wire_locked(map, *addr, *addr + size, VM_MAP_WIRE_USER | + VM_MAP_WIRE_USER_LIMIT | ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); vm_map_unlock(map); Modified: stable/12/sys/vm/vm_unix.c ============================================================================== --- stable/12/sys/vm/vm_unix.c Sun Jun 14 22:39:34 2020 (r362186) +++ stable/12/sys/vm/vm_unix.c Mon Jun 15 03:01:28 2020 (r362187) @@ -185,7 +185,8 @@ kern_break(struct thread *td, uintptr_t *addr) 0); if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { rv = vm_map_wire_locked(map, old, new, - VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | + VM_MAP_WIRE_NOHOLES); if (rv != KERN_SUCCESS) vm_map_delete(map, old, new); } From owner-svn-src-all@freebsd.org Mon Jun 15 03:02:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D350C34CD2E; Mon, 15 Jun 2020 03:02:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lbj85Dfkz40np; Mon, 15 Jun 2020 03:02:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AED0A17007; Mon, 15 Jun 2020 03:02:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05F32KAI068470; Mon, 15 Jun 2020 03:02:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05F32JoI068465; Mon, 15 Jun 2020 03:02:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006150302.05F32JoI068465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Jun 2020 03:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362188 - in stable/12/sys: compat/linux vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: compat/linux vm X-SVN-Commit-Revision: 362188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 03:02:20 -0000 Author: markj Date: Mon Jun 15 03:02:19 2020 New Revision: 362188 URL: https://svnweb.freebsd.org/changeset/base/362188 Log: Revert r362187, it contained some unintended changes. This is a direct commit to stable/12. Modified: stable/12/sys/compat/linux/linux_misc.c stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_map.h stable/12/sys/vm/vm_mmap.c stable/12/sys/vm/vm_unix.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:01:28 2020 (r362187) +++ stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:02:19 2020 (r362188) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_LINUX32 @@ -149,6 +150,7 @@ int linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) { struct l_sysinfo sysinfo; + vm_object_t object; int i, j; struct timespec ts; @@ -166,13 +168,14 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ sysinfo.totalram = physmem * PAGE_SIZE; sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; - /* - * sharedram counts pages allocated to named, swap-backed objects such - * as shared memory segments and tmpfs files. There is no cheap way to - * compute this, so just leave the field unpopulated. Linux itself only - * started setting this field in the 3.x timeframe. - */ sysinfo.sharedram = 0; + mtx_lock(&vm_object_list_mtx); + TAILQ_FOREACH(object, &vm_object_list, object_list) + if (object->shadow_count > 1) + sysinfo.sharedram += object->resident_page_count; + mtx_unlock(&vm_object_list_mtx); + + sysinfo.sharedram *= PAGE_SIZE; sysinfo.bufferram = 0; swap_pager_status(&i, &j); Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Mon Jun 15 03:01:28 2020 (r362187) +++ stable/12/sys/vm/vm_map.c Mon Jun 15 03:02:19 2020 (r362188) @@ -3097,7 +3097,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm u_long npages; u_int last_timestamp; int rv; - boolean_t need_wakeup, result, user_wire, user_wire_limit; + boolean_t need_wakeup, result, user_wire; vm_prot_t prot; VM_MAP_ASSERT_LOCKED(map); @@ -3108,7 +3108,6 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; - user_wire_limit = (flags & VM_MAP_WIRE_USER_LIMIT) ? TRUE : FALSE; VM_MAP_RANGE_CHECK(map, start, end); if (!vm_map_lookup_entry(map, start, &first_entry)) { if (flags & VM_MAP_WIRE_HOLESOK) @@ -3189,8 +3188,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm entry->wired_count++; npages = atop(entry->end - entry->start); - if (user_wire_limit && - !vm_map_wire_user_count_add(npages)) { + if (user_wire && !vm_map_wire_user_count_add(npages)) { vm_map_wire_entry_failure(map, entry, entry->start); end = entry->end; @@ -3252,7 +3250,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm last_timestamp = map->timestamp; if (rv != KERN_SUCCESS) { vm_map_wire_entry_failure(map, entry, faddr); - if (user_wire_limit) + if (user_wire) vm_map_wire_user_count_sub(npages); end = entry->end; goto done; @@ -3321,7 +3319,7 @@ done: */ if (entry->wired_count == 1) { vm_map_entry_unwire(map, entry); - if (user_wire_limit) + if (user_wire) vm_map_wire_user_count_sub( atop(entry->end - entry->start)); } else @@ -4457,8 +4455,7 @@ retry: if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { rv = vm_map_wire_locked(map, grow_start, grow_start + grow_amount, - VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | - VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); } vm_map_lock_downgrade(map); Modified: stable/12/sys/vm/vm_map.h ============================================================================== --- stable/12/sys/vm/vm_map.h Mon Jun 15 03:01:28 2020 (r362187) +++ stable/12/sys/vm/vm_map.h Mon Jun 15 03:02:19 2020 (r362188) @@ -397,8 +397,6 @@ long vmspace_resident_count(struct vmspace *vmspace); #define VM_MAP_WIRE_WRITE 4 /* Validate writable. */ -#define VM_MAP_WIRE_USER_LIMIT 8 /* Enfore the user wiring limit */ - #ifdef _KERNEL boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); Modified: stable/12/sys/vm/vm_mmap.c ============================================================================== --- stable/12/sys/vm/vm_mmap.c Mon Jun 15 03:01:28 2020 (r362187) +++ stable/12/sys/vm/vm_mmap.c Mon Jun 15 03:02:19 2020 (r362188) @@ -1046,7 +1046,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint } #endif error = vm_map_wire(map, start, end, - VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); #ifdef RACCT if (racct_enable && error != KERN_SUCCESS) { PROC_LOCK(proc); @@ -1111,8 +1111,7 @@ sys_mlockall(struct thread *td, struct mlockall_args * * calling vm_fault_wire() for each page in the region. */ error = vm_map_wire(map, vm_map_min(map), vm_map_max(map), - VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | - VM_MAP_WIRE_HOLESOK); + VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK); if (error == KERN_SUCCESS) error = 0; else if (error == KERN_RESOURCE_SHORTAGE) @@ -1590,7 +1589,6 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz if ((map->flags & MAP_WIREFUTURE) != 0) (void)vm_map_wire_locked(map, *addr, *addr + size, VM_MAP_WIRE_USER | - VM_MAP_WIRE_USER_LIMIT | ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); vm_map_unlock(map); Modified: stable/12/sys/vm/vm_unix.c ============================================================================== --- stable/12/sys/vm/vm_unix.c Mon Jun 15 03:01:28 2020 (r362187) +++ stable/12/sys/vm/vm_unix.c Mon Jun 15 03:02:19 2020 (r362188) @@ -185,8 +185,7 @@ kern_break(struct thread *td, uintptr_t *addr) 0); if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { rv = vm_map_wire_locked(map, old, new, - VM_MAP_WIRE_USER | VM_MAP_WIRE_USER_LIMIT | - VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); if (rv != KERN_SUCCESS) vm_map_delete(map, old, new); } From owner-svn-src-all@freebsd.org Mon Jun 15 03:03:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EF6934CAD6; Mon, 15 Jun 2020 03:03:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lbjw11DZz40mg; Mon, 15 Jun 2020 03:03:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DF2C1700F; Mon, 15 Jun 2020 03:03:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05F3303M071065; Mon, 15 Jun 2020 03:03:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05F32xX6071064; Mon, 15 Jun 2020 03:02:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006150302.05F32xX6071064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Jun 2020 03:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362189 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 362189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 03:03:00 -0000 Author: markj Date: Mon Jun 15 03:02:59 2020 New Revision: 362189 URL: https://svnweb.freebsd.org/changeset/base/362189 Log: MFC r361945, r362036: Stop computing a "sharedram" value when emulating Linux sysinfo(2). Modified: stable/12/sys/compat/linux/linux_misc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:02:19 2020 (r362188) +++ stable/12/sys/compat/linux/linux_misc.c Mon Jun 15 03:02:59 2020 (r362189) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef COMPAT_LINUX32 @@ -150,7 +149,6 @@ int linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) { struct l_sysinfo sysinfo; - vm_object_t object; int i, j; struct timespec ts; @@ -168,14 +166,13 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ sysinfo.totalram = physmem * PAGE_SIZE; sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; + /* + * sharedram counts pages allocated to named, swap-backed objects such + * as shared memory segments and tmpfs files. There is no cheap way to + * compute this, so just leave the field unpopulated. Linux itself only + * started setting this field in the 3.x timeframe. + */ sysinfo.sharedram = 0; - mtx_lock(&vm_object_list_mtx); - TAILQ_FOREACH(object, &vm_object_list, object_list) - if (object->shadow_count > 1) - sysinfo.sharedram += object->resident_page_count; - mtx_unlock(&vm_object_list_mtx); - - sysinfo.sharedram *= PAGE_SIZE; sysinfo.bufferram = 0; swap_pager_status(&i, &j); From owner-svn-src-all@freebsd.org Mon Jun 15 03:10:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0EAE34CE6B; Mon, 15 Jun 2020 03:10:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lbv35xs4z4153; Mon, 15 Jun 2020 03:10:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6F1D16F3E; Mon, 15 Jun 2020 03:10:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05F3Ata4073295; Mon, 15 Jun 2020 03:10:55 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05F3AsGT072616; Mon, 15 Jun 2020 03:10:54 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202006150310.05F3AsGT072616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 15 Jun 2020 03:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362190 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Commit-Revision: 362190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 03:10:55 -0000 Author: cy Date: Mon Jun 15 03:10:53 2020 New Revision: 362190 URL: https://svnweb.freebsd.org/changeset/base/362190 Log: MFC r362095, r362145 r362095: MFV r362082: Update sqlite3 3.31.1 --> 3.32.0. PR: 247149 Reported by: spam123@bitbert.com Reminded by: emaste Security: CVE-2020-11655, CVE-2020-13434, CVE-2020-13435, CVE-2020-13630, CVE-2020-13631, CVE-2020-13632 r362145: MFV r362143: Update sqlite3 to 3.32.2 (3320200). CVE-2020-11655: SQLite through 3.31.1 allows attackers to cause a denial of service (segmentation fault) via a malformed window-function query because the AggInfo object's initialization is mishandled. CVE-2020-13434: SQLite through 3.32.0 has an integer overflow in sqlite3_str_vappendf in printf.c. CVE-2020-13435: SQLite through 3.32.0 has a segmentation fault in sqlite3ExprCodeTarget in expr.c. CVE-2020-13630: ext/fts3/fts3.c in SQLite before 3.32.0 has a use-after-free in fts3EvalNextRow, related to the snippet feature CVE-2020-13631: SQLite before 3.32.0 allows a virtual table to be renamed to the name of one of its shadow tables, related to alter.c and build.c. CVE-2020-13632: ext/fts3/fts3_snippet.c in SQLite before 3.32.0 ha s a NULL pointer dereference via a crafted matchinfo() query. PR: 247149 Reported by: spam123@bitbert.com Security: vuxml: c4ac9c79-ab37-11ea-8b5e-b42e99a1b9c3 https://nvd.nist.gov/vuln/detail/CVE-2020-11655 https://nvd.nist.gov/vuln/detail/CVE-2020-13434 https://nvd.nist.gov/vuln/detail/CVE-2020-13435 https://nvd.nist.gov/vuln/detail/CVE-2020-13630 https://nvd.nist.gov/vuln/detail/CVE-2020-13631 https://nvd.nist.gov/vuln/detail/CVE-2020-13632 Modified: stable/11/contrib/sqlite3/Makefile.msc stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/shell.c stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/sqlite3ext.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/sqlite3/Makefile.msc stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/shell.c stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/sqlite3ext.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/sqlite3/Makefile.msc ============================================================================== --- stable/11/contrib/sqlite3/Makefile.msc Mon Jun 15 03:02:59 2020 (r362189) +++ stable/11/contrib/sqlite3/Makefile.msc Mon Jun 15 03:10:53 2020 (r362190) @@ -196,6 +196,7 @@ OSTRACE = 0 DEBUG = 0 !ENDIF + # Enable use of available compiler optimizations? Normally, this should be # non-zero. Setting this to zero, thus disabling all compiler optimizations, # can be useful for testing. @@ -288,6 +289,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 Modified: stable/11/contrib/sqlite3/configure ============================================================================== --- stable/11/contrib/sqlite3/configure Mon Jun 15 03:02:59 2020 (r362189) +++ stable/11/contrib/sqlite3/configure Mon Jun 15 03:10:53 2020 (r362190) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.31.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.31.1' -PACKAGE_STRING='sqlite 3.31.1' +PACKAGE_VERSION='3.32.2' +PACKAGE_STRING='sqlite 3.32.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.31.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.31.1:";; + short | recursive ) echo "Configuration of sqlite 3.32.2:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.31.1 +sqlite configure 3.32.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.31.1, which was +It was created by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.31.1' + VERSION='3.32.2' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.31.1, which was +This file was extended by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.31.1 +sqlite config.status 3.32.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/sqlite3/configure.ac ============================================================================== --- stable/11/contrib/sqlite3/configure.ac Mon Jun 15 03:02:59 2020 (r362189) +++ stable/11/contrib/sqlite3/configure.ac Mon Jun 15 03:10:53 2020 (r362190) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.31.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.32.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/11/contrib/sqlite3/shell.c ============================================================================== --- stable/11/contrib/sqlite3/shell.c Mon Jun 15 03:02:59 2020 (r362189) +++ stable/11/contrib/sqlite3/shell.c Mon Jun 15 03:10:53 2020 (r362190) @@ -36,6 +36,14 @@ #endif /* +** Determine if we are dealing with WinRT, which provides only a subset of +** the full Win32 API. +*/ +#if !defined(SQLITE_OS_WINRT) +# define SQLITE_OS_WINRT 0 +#endif + +/* ** Warning pragmas copied from msvc.h in the core. */ #if defined(_MSC_VER) @@ -147,22 +155,26 @@ typedef unsigned char u8; #if defined(_WIN32) || defined(WIN32) -# include -# include -# define isatty(h) _isatty(h) -# ifndef access -# define access(f,m) _access((f),(m)) +# if SQLITE_OS_WINRT +# define SQLITE_OMIT_POPEN 1 +# else +# include +# include +# define isatty(h) _isatty(h) +# ifndef access +# define access(f,m) _access((f),(m)) +# endif +# ifndef unlink +# define unlink _unlink +# endif +# ifndef strdup +# define strdup _strdup +# endif +# undef popen +# define popen _popen +# undef pclose +# define pclose _pclose # endif -# ifndef unlink -# define unlink _unlink -# endif -# ifndef strdup -# define strdup _strdup -# endif -# undef popen -# define popen _popen -# undef pclose -# define pclose _pclose #else /* Make sure isatty() has a prototype. */ extern int isatty(int); @@ -191,6 +203,9 @@ typedef unsigned char u8; #define ToLower(X) (char)tolower((unsigned char)X) #if defined(_WIN32) || defined(WIN32) +#if SQLITE_OS_WINRT +#include +#endif #include /* string conversion routines only needed on Win32 */ @@ -206,7 +221,7 @@ extern LPWSTR sqlite3_win32_utf8_to_unicode(const char ** rendering quoted strings that contain \n characters). The following ** routines take care of that. */ -#if defined(_WIN32) || defined(WIN32) +#if (defined(_WIN32) || defined(WIN32)) && !SQLITE_OS_WINRT static void setBinaryMode(FILE *file, int isOutput){ if( isOutput ) fflush(file); _setmode(_fileno(file), _O_BINARY); @@ -310,6 +325,7 @@ static int hasTimer(void){ if( getProcessTimesAddr ){ return 1; } else { +#if !SQLITE_OS_WINRT /* GetProcessTimes() isn't supported in WIN95 and some other Windows ** versions. See if the version we are running on has it, and if it ** does, save off a pointer to it and the current process handle. @@ -326,6 +342,7 @@ static int hasTimer(void){ FreeLibrary(hinstLib); } } +#endif } return 0; } @@ -415,7 +432,16 @@ static sqlite3 *globalDb = 0; */ static volatile int seenInterrupt = 0; +#ifdef SQLITE_DEBUG /* +** Out-of-memory simulator variables +*/ +static unsigned int oomCounter = 0; /* Simulate OOM when equals 1 */ +static unsigned int oomRepeat = 0; /* Number of OOMs in a row */ +static void*(*defaultMalloc)(int) = 0; /* The low-level malloc routine */ +#endif /* SQLITE_DEBUG */ + +/* ** This is the name of our program. It is set in main(), used ** in a number of other places, mostly for error messages. */ @@ -466,6 +492,49 @@ static void shell_out_of_memory(void){ exit(1); } +#ifdef SQLITE_DEBUG +/* This routine is called when a simulated OOM occurs. It is broken +** out as a separate routine to make it easy to set a breakpoint on +** the OOM +*/ +void shellOomFault(void){ + if( oomRepeat>0 ){ + oomRepeat--; + }else{ + oomCounter--; + } +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* This routine is a replacement malloc() that is used to simulate +** Out-Of-Memory (OOM) errors for testing purposes. +*/ +static void *oomMalloc(int nByte){ + if( oomCounter ){ + if( oomCounter==1 ){ + shellOomFault(); + return 0; + }else{ + oomCounter--; + } + } + return defaultMalloc(nByte); +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* Register the OOM simulator. This must occur before any memory +** allocations */ +static void registerOomSimulator(void){ + sqlite3_mem_methods mem; + sqlite3_config(SQLITE_CONFIG_GETMALLOC, &mem); + defaultMalloc = mem.xMalloc; + mem.xMalloc = oomMalloc; + sqlite3_config(SQLITE_CONFIG_MALLOC, &mem); +} +#endif + /* ** Write I/O traces to the following stream. */ @@ -2426,6 +2495,7 @@ static int writeFile( if( mtime>=0 ){ #if defined(_WIN32) +#if !SQLITE_OS_WINRT /* Windows */ FILETIME lastAccess; FILETIME lastWrite; @@ -2456,6 +2526,7 @@ static int writeFile( }else{ return 1; } +#endif #elif defined(AT_FDCWD) && 0 /* utimensat() is not universally available */ /* Recent unix */ struct timespec times[2]; @@ -4213,6 +4284,101 @@ int sqlite3MemTraceDeactivate(void){ } /************************* End ../ext/misc/memtrace.c ********************/ +/************************* Begin ../ext/misc/uint.c ******************/ +/* +** 2020-04-14 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This SQLite extension implements the UINT collating sequence. +** +** UINT works like BINARY for text, except that embedded strings +** of digits compare in numeric order. +** +** * Leading zeros are handled properly, in the sense that +** they do not mess of the maginitude comparison of embedded +** strings of digits. "x00123y" is equal to "x123y". +** +** * Only unsigned integers are recognized. Plus and minus +** signs are ignored. Decimal points and exponential notation +** are ignored. +** +** * Embedded integers can be of arbitrary length. Comparison +** is *not* limited integers that can be expressed as a +** 64-bit machine integer. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include +#include + +/* +** Compare text in lexicographic order, except strings of digits +** compare in numeric order. +*/ +static int uintCollFunc( + void *notUsed, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + const unsigned char *zA = (const unsigned char*)pKey1; + const unsigned char *zB = (const unsigned char*)pKey2; + int i=0, j=0, x; + (void)notUsed; + while( i +#include /* ** Implementation of the "sqlar_compress(X)" SQL function. @@ -7834,14 +8001,19 @@ int idxFindIndexes( /* int iParent = sqlite3_column_int(pExplain, 1); */ /* int iNotUsed = sqlite3_column_int(pExplain, 2); */ const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3); - int nDetail = STRLEN(zDetail); + int nDetail; int i; + if( !zDetail ) continue; + nDetail = STRLEN(zDetail); + for(i=0; imodePrior = p->mode; + p->priorShFlgs = p->shellFlgs; memcpy(p->colSepPrior, p->colSeparator, sizeof(p->colSeparator)); memcpy(p->rowSepPrior, p->rowSeparator, sizeof(p->rowSeparator)); } static void outputModePop(ShellState *p){ p->mode = p->modePrior; + p->shellFlgs = p->priorShFlgs; memcpy(p->colSeparator, p->colSepPrior, sizeof(p->colSeparator)); memcpy(p->rowSeparator, p->rowSepPrior, sizeof(p->rowSeparator)); } @@ -10871,8 +11046,7 @@ static void set_table_name(ShellState *p, const char * */ static int run_table_dump_query( ShellState *p, /* Query context */ - const char *zSelect, /* SELECT statement to extract content */ - const char *zFirstRow /* Print before first row, if not NULL */ + const char *zSelect /* SELECT statement to extract content */ ){ sqlite3_stmt *pSelect; int rc; @@ -10889,10 +11063,6 @@ static int run_table_dump_query( rc = sqlite3_step(pSelect); nResult = sqlite3_column_count(pSelect); while( rc==SQLITE_ROW ){ - if( zFirstRow ){ - utf8_printf(p->out, "%s", zFirstRow); - zFirstRow = 0; - } z = (const char*)sqlite3_column_text(pSelect, 0); utf8_printf(p->out, "%s", z); for(i=1; idb, 0, 0); sqlite3_shathree_init(p->db, 0, 0); sqlite3_completion_init(p->db, 0, 0); + sqlite3_uint_init(p->db, 0, 0); #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) sqlite3_dbdata_init(p->db, 0, 0); #endif @@ -13073,6 +13268,8 @@ struct ImportCtx { int n; /* Number of bytes in z */ int nAlloc; /* Space allocated for z[] */ int nLine; /* Current line number */ + int nRow; /* Number of rows imported */ + int nErr; /* Number of errors encountered */ int bNotFirst; /* True if one or more bytes already read */ int cTerm; /* Character that terminated the most recent field */ int cColSep; /* The column separator character. (Usually ",") */ @@ -13454,11 +13651,15 @@ static void output_reset(ShellState *p){ zCmd = sqlite3_mprintf("%s %s", zXdgOpenCmd, p->zTempFile); if( system(zCmd) ){ utf8_printf(stderr, "Failed: [%s]\n", zCmd); + }else{ + /* Give the start/open/xdg-open command some time to get + ** going before we continue, and potential delete the + ** p->zTempFile data file out from under it */ + sqlite3_sleep(2000); } sqlite3_free(zCmd); outputModePop(p); p->doXdgOpen = 0; - sqlite3_sleep(100); } #endif /* !defined(SQLITE_NOHAVE_SYSTEM) */ } @@ -13534,12 +13735,7 @@ static int shell_dbinfo_command(ShellState *p, int nAr "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", -1, &pStmt, 0); if( rc ){ - if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){ - utf8_printf(stderr, "the \".dbinfo\" command requires the " - "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n"); - }else{ - utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); - } + utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); sqlite3_finalize(pStmt); return 1; } @@ -13748,9 +13944,21 @@ static void newTempFile(ShellState *p, const char *zSu sqlite3_file_control(p->db, 0, SQLITE_FCNTL_TEMPFILENAME, &p->zTempFile); } if( p->zTempFile==0 ){ + /* If p->db is an in-memory database then the TEMPFILENAME file-control + ** will not work and we will need to fallback to guessing */ + char *zTemp; sqlite3_uint64 r; sqlite3_randomness(sizeof(r), &r); - p->zTempFile = sqlite3_mprintf("temp%llx.%s", r, zSuffix); + zTemp = getenv("TEMP"); + if( zTemp==0 ) zTemp = getenv("TMP"); + if( zTemp==0 ){ +#ifdef _WIN32 + zTemp = "\\tmp"; +#else + zTemp = "/tmp"; +#endif + } + p->zTempFile = sqlite3_mprintf("%s/temp%llx.%s", zTemp, r, zSuffix); }else{ p->zTempFile = sqlite3_mprintf("%z.%s", p->zTempFile, zSuffix); } @@ -15774,7 +15982,8 @@ static int do_meta_command(char *zLine, ShellState *p) #endif /* !(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) */ if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){ - const char *zLike = 0; + char *zLike = 0; + char *zSql; int i; int savedShowHeader = p->showHeader; int savedShellFlags = p->shellFlgs; @@ -15802,12 +16011,10 @@ static int do_meta_command(char *zLine, ShellState *p) goto meta_command_exit; } }else if( zLike ){ - raw_printf(stderr, "Usage: .dump ?--preserve-rowids? " - "?--newlines? ?LIKE-PATTERN?\n"); - rc = 1; - goto meta_command_exit; + zLike = sqlite3_mprintf("%z OR name LIKE %Q ESCAPE '\\'", + zLike, azArg[i]); }else{ - zLike = azArg[i]; + zLike = sqlite3_mprintf("name LIKE %Q ESCAPE '\\'", azArg[i]); } } @@ -15825,35 +16032,25 @@ static int do_meta_command(char *zLine, ShellState *p) ** corrupt. */ sqlite3_exec(p->db, "SAVEPOINT dump; PRAGMA writable_schema=ON", 0, 0, 0); p->nErr = 0; - if( zLike==0 ){ - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE sql NOT NULL AND type=='table' AND name!='sqlite_sequence'" - ); - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE name=='sqlite_sequence'" - ); - run_table_dump_query(p, - "SELECT sql FROM sqlite_master " - "WHERE sql NOT NULL AND type IN ('index','trigger','view')", 0 - ); - }else{ - char *zSql; - zSql = sqlite3_mprintf( - "SELECT name, type, sql FROM sqlite_master " - "WHERE tbl_name LIKE %Q AND type=='table'" - " AND sql NOT NULL", zLike); - run_schema_dump_query(p,zSql); - sqlite3_free(zSql); - zSql = sqlite3_mprintf( - "SELECT sql FROM sqlite_master " - "WHERE sql NOT NULL" - " AND type IN ('index','trigger','view')" - " AND tbl_name LIKE %Q", zLike); - run_table_dump_query(p, zSql, 0); - sqlite3_free(zSql); - } + if( zLike==0 ) zLike = sqlite3_mprintf("true"); + zSql = sqlite3_mprintf( + "SELECT name, type, sql FROM sqlite_master " + "WHERE (%s) AND type=='table'" + " AND sql NOT NULL" + " ORDER BY tbl_name='sqlite_sequence', rowid", + zLike + ); + run_schema_dump_query(p,zSql); + sqlite3_free(zSql); + zSql = sqlite3_mprintf( + "SELECT sql FROM sqlite_master " + "WHERE (%s) AND sql NOT NULL" + " AND type IN ('index','trigger','view')", + zLike + ); + run_table_dump_query(p, zSql); + sqlite3_free(zSql); + sqlite3_free(zLike); if( p->writableSchema ){ raw_printf(p->out, "PRAGMA writable_schema=OFF;\n"); p->writableSchema = 0; @@ -15956,6 +16153,7 @@ static int do_meta_command(char *zLine, ShellState *p) { "tempfilename", SQLITE_FCNTL_TEMPFILENAME, "" }, { "has_moved", SQLITE_FCNTL_HAS_MOVED, "" }, { "lock_timeout", SQLITE_FCNTL_LOCK_TIMEOUT, "MILLISEC" }, + { "reserve_bytes", SQLITE_FCNTL_RESERVE_BYTES, "[N]" }, }; int filectrl = -1; int iCtrl = -1; @@ -15963,10 +16161,21 @@ static int do_meta_command(char *zLine, ShellState *p) int isOk = 0; /* 0: usage 1: %lld 2: no-result */ int n2, i; const char *zCmd = 0; + const char *zSchema = 0; open_db(p, 0); zCmd = nArg>=2 ? azArg[1] : "help"; + if( zCmd[0]=='-' + && (strcmp(zCmd,"--schema")==0 || strcmp(zCmd,"-schema")==0) + && nArg>=4 + ){ + zSchema = azArg[2]; + for(i=3; idb, 0, SQLITE_FCNTL_SIZE_LIMIT, &iRes); + sqlite3_file_control(p->db, zSchema, SQLITE_FCNTL_SIZE_LIMIT, &iRes); isOk = 1; break; } @@ -16017,7 +16226,7 @@ static int do_meta_command(char *zLine, ShellState *p) int x; if( nArg!=3 ) break; x = (int)integerValue(azArg[2]); - sqlite3_file_control(p->db, 0, filectrl, &x); + sqlite3_file_control(p->db, zSchema, filectrl, &x); isOk = 2; break; } @@ -16026,7 +16235,7 @@ static int do_meta_command(char *zLine, ShellState *p) int x; if( nArg!=2 && nArg!=3 ) break; x = nArg==3 ? booleanValue(azArg[2]) : -1; - sqlite3_file_control(p->db, 0, filectrl, &x); + sqlite3_file_control(p->db, zSchema, filectrl, &x); iRes = x; isOk = 1; break; @@ -16034,7 +16243,7 @@ static int do_meta_command(char *zLine, ShellState *p) case SQLITE_FCNTL_HAS_MOVED: { int x; if( nArg!=2 ) break; - sqlite3_file_control(p->db, 0, filectrl, &x); + sqlite3_file_control(p->db, zSchema, filectrl, &x); iRes = x; isOk = 1; break; @@ -16042,7 +16251,7 @@ static int do_meta_command(char *zLine, ShellState *p) case SQLITE_FCNTL_TEMPFILENAME: { char *z = 0; if( nArg!=2 ) break; - sqlite3_file_control(p->db, 0, filectrl, &z); + sqlite3_file_control(p->db, zSchema, filectrl, &z); if( z ){ utf8_printf(p->out, "%s\n", z); sqlite3_free(z); @@ -16050,6 +16259,18 @@ static int do_meta_command(char *zLine, ShellState *p) isOk = 2; break; } + case SQLITE_FCNTL_RESERVE_BYTES: { + int x; + if( nArg>=3 ){ + x = atoi(azArg[2]); + sqlite3_file_control(p->db, zSchema, filectrl, &x); + } + x = -1; + sqlite3_file_control(p->db, zSchema, filectrl, &x); + utf8_printf(p->out,"%d\n", x); + isOk = 2; + break; + } } } if( isOk==0 && iCtrl>=0 ){ @@ -16133,8 +16354,8 @@ static int do_meta_command(char *zLine, ShellState *p) }else if( c=='i' && strncmp(azArg[0], "import", n)==0 ){ - char *zTable; /* Insert data into this table */ - char *zFile; /* Name of file to extra content from */ + char *zTable = 0; /* Insert data into this table */ + char *zFile = 0; /* Name of file to extra content from */ sqlite3_stmt *pStmt = NULL; /* A statement */ int nCol; /* Number of columns in the table */ int nByte; /* Number of bytes in an SQL string */ @@ -16145,51 +16366,108 @@ static int do_meta_command(char *zLine, ShellState *p) ImportCtx sCtx; /* Reader context */ char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */ int (SQLITE_CDECL *xCloser)(FILE*); /* Func to close file */ + int eVerbose = 0; /* Larger for more console output */ + int nSkip = 0; /* Initial lines to skip */ + int useOutputMode = 1; /* Use output mode to determine separators */ - if( nArg!=3 ){ - raw_printf(stderr, "Usage: .import FILE TABLE\n"); - goto meta_command_exit; - } - zFile = azArg[1]; - zTable = azArg[2]; - seenInterrupt = 0; memset(&sCtx, 0, sizeof(sCtx)); - open_db(p, 0); - nSep = strlen30(p->colSeparator); - if( nSep==0 ){ - raw_printf(stderr, - "Error: non-null column separator required for import\n"); - return 1; + if( p->mode==MODE_Ascii ){ + xRead = ascii_read_one_field; + }else{ + xRead = csv_read_one_field; } - if( nSep>1 ){ - raw_printf(stderr, "Error: multi-character column separators not allowed" - " for import\n"); - return 1; + for(i=1; iout, "ERROR: extra argument: \"%s\". Usage:\n", z); + showHelp(p->out, "import"); + rc = 1; + goto meta_command_exit; + } + }else if( strcmp(z,"-v")==0 ){ + eVerbose++; + }else if( strcmp(z,"-skip")==0 && iout, "ERROR: unknown option: \"%s\". Usage:\n", z); + showHelp(p->out, "import"); + rc = 1; + goto meta_command_exit; + } } - nSep = strlen30(p->rowSeparator); - if( nSep==0 ){ - raw_printf(stderr, "Error: non-null row separator required for import\n"); - return 1; + if( zTable==0 ){ + utf8_printf(p->out, "ERROR: missing %s argument. Usage:\n", + zFile==0 ? "FILE" : "TABLE"); + showHelp(p->out, "import"); + rc = 1; + goto meta_command_exit; } - if( nSep==2 && p->mode==MODE_Csv && strcmp(p->rowSeparator, SEP_CrLf)==0 ){ - /* When importing CSV (only), if the row separator is set to the - ** default output row separator, change it to the default input - ** row separator. This avoids having to maintain different input - ** and output row separators. */ - sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); + seenInterrupt = 0; + open_db(p, 0); + if( useOutputMode ){ + /* If neither the --csv or --ascii options are specified, then set + ** the column and row separator characters from the output mode. */ + nSep = strlen30(p->colSeparator); + if( nSep==0 ){ + raw_printf(stderr, + "Error: non-null column separator required for import\n"); + rc = 1; + goto meta_command_exit; + } + if( nSep>1 ){ + raw_printf(stderr, + "Error: multi-character column separators not allowed" + " for import\n"); + rc = 1; + goto meta_command_exit; + } nSep = strlen30(p->rowSeparator); + if( nSep==0 ){ + raw_printf(stderr, + "Error: non-null row separator required for import\n"); + rc = 1; + goto meta_command_exit; + } + if( nSep==2 && p->mode==MODE_Csv && strcmp(p->rowSeparator,SEP_CrLf)==0 ){ + /* When importing CSV (only), if the row separator is set to the + ** default output row separator, change it to the default input + ** row separator. This avoids having to maintain different input + ** and output row separators. */ + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); + nSep = strlen30(p->rowSeparator); + } + if( nSep>1 ){ + raw_printf(stderr, "Error: multi-character row separators not allowed" + " for import\n"); + rc = 1; + goto meta_command_exit; + } + sCtx.cColSep = p->colSeparator[0]; + sCtx.cRowSep = p->rowSeparator[0]; } - if( nSep>1 ){ - raw_printf(stderr, "Error: multi-character row separators not allowed" - " for import\n"); - return 1; - } sCtx.zFile = zFile; sCtx.nLine = 1; if( sCtx.zFile[0]=='|' ){ #ifdef SQLITE_OMIT_POPEN raw_printf(stderr, "Error: pipes are not supported in this OS\n"); - return 1; + rc = 1; + goto meta_command_exit; #else sCtx.in = popen(sCtx.zFile+1, "r"); sCtx.zFile = ""; @@ -16199,17 +16477,26 @@ static int do_meta_command(char *zLine, ShellState *p) sCtx.in = fopen(sCtx.zFile, "rb"); xCloser = fclose; } - if( p->mode==MODE_Ascii ){ - xRead = ascii_read_one_field; - }else{ - xRead = csv_read_one_field; - } if( sCtx.in==0 ){ utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile); - return 1; + rc = 1; + goto meta_command_exit; } - sCtx.cColSep = p->colSeparator[0]; - sCtx.cRowSep = p->rowSeparator[0]; + if( eVerbose>=2 || (eVerbose>=1 && useOutputMode) ){ + char zSep[2]; + zSep[1] = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 03:10:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20C3434CF9D; Mon, 15 Jun 2020 03:10:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lbv50NQ3z419j; Mon, 15 Jun 2020 03:10:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02EA516F40; Mon, 15 Jun 2020 03:10:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05F3AuxD073305; Mon, 15 Jun 2020 03:10:56 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05F3AuP0073301; Mon, 15 Jun 2020 03:10:56 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202006150310.05F3AuP0073301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 15 Jun 2020 03:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362190 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Commit-Revision: 362190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 03:10:57 -0000 Author: cy Date: Mon Jun 15 03:10:53 2020 New Revision: 362190 URL: https://svnweb.freebsd.org/changeset/base/362190 Log: MFC r362095, r362145 r362095: MFV r362082: Update sqlite3 3.31.1 --> 3.32.0. PR: 247149 Reported by: spam123@bitbert.com Reminded by: emaste Security: CVE-2020-11655, CVE-2020-13434, CVE-2020-13435, CVE-2020-13630, CVE-2020-13631, CVE-2020-13632 r362145: MFV r362143: Update sqlite3 to 3.32.2 (3320200). CVE-2020-11655: SQLite through 3.31.1 allows attackers to cause a denial of service (segmentation fault) via a malformed window-function query because the AggInfo object's initialization is mishandled. CVE-2020-13434: SQLite through 3.32.0 has an integer overflow in sqlite3_str_vappendf in printf.c. CVE-2020-13435: SQLite through 3.32.0 has a segmentation fault in sqlite3ExprCodeTarget in expr.c. CVE-2020-13630: ext/fts3/fts3.c in SQLite before 3.32.0 has a use-after-free in fts3EvalNextRow, related to the snippet feature CVE-2020-13631: SQLite before 3.32.0 allows a virtual table to be renamed to the name of one of its shadow tables, related to alter.c and build.c. CVE-2020-13632: ext/fts3/fts3_snippet.c in SQLite before 3.32.0 ha s a NULL pointer dereference via a crafted matchinfo() query. PR: 247149 Reported by: spam123@bitbert.com Security: vuxml: c4ac9c79-ab37-11ea-8b5e-b42e99a1b9c3 https://nvd.nist.gov/vuln/detail/CVE-2020-11655 https://nvd.nist.gov/vuln/detail/CVE-2020-13434 https://nvd.nist.gov/vuln/detail/CVE-2020-13435 https://nvd.nist.gov/vuln/detail/CVE-2020-13630 https://nvd.nist.gov/vuln/detail/CVE-2020-13631 https://nvd.nist.gov/vuln/detail/CVE-2020-13632 Modified: stable/12/contrib/sqlite3/Makefile.msc stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/shell.c stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/sqlite3ext.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/sqlite3/Makefile.msc stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/shell.c stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/sqlite3ext.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/sqlite3/Makefile.msc ============================================================================== --- stable/12/contrib/sqlite3/Makefile.msc Mon Jun 15 03:02:59 2020 (r362189) +++ stable/12/contrib/sqlite3/Makefile.msc Mon Jun 15 03:10:53 2020 (r362190) @@ -196,6 +196,7 @@ OSTRACE = 0 DEBUG = 0 !ENDIF + # Enable use of available compiler optimizations? Normally, this should be # non-zero. Setting this to zero, thus disabling all compiler optimizations, # can be useful for testing. @@ -288,6 +289,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 Modified: stable/12/contrib/sqlite3/configure ============================================================================== --- stable/12/contrib/sqlite3/configure Mon Jun 15 03:02:59 2020 (r362189) +++ stable/12/contrib/sqlite3/configure Mon Jun 15 03:10:53 2020 (r362190) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.31.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.31.1' -PACKAGE_STRING='sqlite 3.31.1' +PACKAGE_VERSION='3.32.2' +PACKAGE_STRING='sqlite 3.32.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.31.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.31.1:";; + short | recursive ) echo "Configuration of sqlite 3.32.2:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.31.1 +sqlite configure 3.32.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.31.1, which was +It was created by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.31.1' + VERSION='3.32.2' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.31.1, which was +This file was extended by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.31.1 +sqlite config.status 3.32.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/sqlite3/configure.ac ============================================================================== --- stable/12/contrib/sqlite3/configure.ac Mon Jun 15 03:02:59 2020 (r362189) +++ stable/12/contrib/sqlite3/configure.ac Mon Jun 15 03:10:53 2020 (r362190) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.31.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.32.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/12/contrib/sqlite3/shell.c ============================================================================== --- stable/12/contrib/sqlite3/shell.c Mon Jun 15 03:02:59 2020 (r362189) +++ stable/12/contrib/sqlite3/shell.c Mon Jun 15 03:10:53 2020 (r362190) @@ -36,6 +36,14 @@ #endif /* +** Determine if we are dealing with WinRT, which provides only a subset of +** the full Win32 API. +*/ +#if !defined(SQLITE_OS_WINRT) +# define SQLITE_OS_WINRT 0 +#endif + +/* ** Warning pragmas copied from msvc.h in the core. */ #if defined(_MSC_VER) @@ -147,22 +155,26 @@ typedef unsigned char u8; #if defined(_WIN32) || defined(WIN32) -# include -# include -# define isatty(h) _isatty(h) -# ifndef access -# define access(f,m) _access((f),(m)) +# if SQLITE_OS_WINRT +# define SQLITE_OMIT_POPEN 1 +# else +# include +# include +# define isatty(h) _isatty(h) +# ifndef access +# define access(f,m) _access((f),(m)) +# endif +# ifndef unlink +# define unlink _unlink +# endif +# ifndef strdup +# define strdup _strdup +# endif +# undef popen +# define popen _popen +# undef pclose +# define pclose _pclose # endif -# ifndef unlink -# define unlink _unlink -# endif -# ifndef strdup -# define strdup _strdup -# endif -# undef popen -# define popen _popen -# undef pclose -# define pclose _pclose #else /* Make sure isatty() has a prototype. */ extern int isatty(int); @@ -191,6 +203,9 @@ typedef unsigned char u8; #define ToLower(X) (char)tolower((unsigned char)X) #if defined(_WIN32) || defined(WIN32) +#if SQLITE_OS_WINRT +#include +#endif #include /* string conversion routines only needed on Win32 */ @@ -206,7 +221,7 @@ extern LPWSTR sqlite3_win32_utf8_to_unicode(const char ** rendering quoted strings that contain \n characters). The following ** routines take care of that. */ -#if defined(_WIN32) || defined(WIN32) +#if (defined(_WIN32) || defined(WIN32)) && !SQLITE_OS_WINRT static void setBinaryMode(FILE *file, int isOutput){ if( isOutput ) fflush(file); _setmode(_fileno(file), _O_BINARY); @@ -310,6 +325,7 @@ static int hasTimer(void){ if( getProcessTimesAddr ){ return 1; } else { +#if !SQLITE_OS_WINRT /* GetProcessTimes() isn't supported in WIN95 and some other Windows ** versions. See if the version we are running on has it, and if it ** does, save off a pointer to it and the current process handle. @@ -326,6 +342,7 @@ static int hasTimer(void){ FreeLibrary(hinstLib); } } +#endif } return 0; } @@ -415,7 +432,16 @@ static sqlite3 *globalDb = 0; */ static volatile int seenInterrupt = 0; +#ifdef SQLITE_DEBUG /* +** Out-of-memory simulator variables +*/ +static unsigned int oomCounter = 0; /* Simulate OOM when equals 1 */ +static unsigned int oomRepeat = 0; /* Number of OOMs in a row */ +static void*(*defaultMalloc)(int) = 0; /* The low-level malloc routine */ +#endif /* SQLITE_DEBUG */ + +/* ** This is the name of our program. It is set in main(), used ** in a number of other places, mostly for error messages. */ @@ -466,6 +492,49 @@ static void shell_out_of_memory(void){ exit(1); } +#ifdef SQLITE_DEBUG +/* This routine is called when a simulated OOM occurs. It is broken +** out as a separate routine to make it easy to set a breakpoint on +** the OOM +*/ +void shellOomFault(void){ + if( oomRepeat>0 ){ + oomRepeat--; + }else{ + oomCounter--; + } +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* This routine is a replacement malloc() that is used to simulate +** Out-Of-Memory (OOM) errors for testing purposes. +*/ +static void *oomMalloc(int nByte){ + if( oomCounter ){ + if( oomCounter==1 ){ + shellOomFault(); + return 0; + }else{ + oomCounter--; + } + } + return defaultMalloc(nByte); +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* Register the OOM simulator. This must occur before any memory +** allocations */ +static void registerOomSimulator(void){ + sqlite3_mem_methods mem; + sqlite3_config(SQLITE_CONFIG_GETMALLOC, &mem); + defaultMalloc = mem.xMalloc; + mem.xMalloc = oomMalloc; + sqlite3_config(SQLITE_CONFIG_MALLOC, &mem); +} +#endif + /* ** Write I/O traces to the following stream. */ @@ -2426,6 +2495,7 @@ static int writeFile( if( mtime>=0 ){ #if defined(_WIN32) +#if !SQLITE_OS_WINRT /* Windows */ FILETIME lastAccess; FILETIME lastWrite; @@ -2456,6 +2526,7 @@ static int writeFile( }else{ return 1; } +#endif #elif defined(AT_FDCWD) && 0 /* utimensat() is not universally available */ /* Recent unix */ struct timespec times[2]; @@ -4213,6 +4284,101 @@ int sqlite3MemTraceDeactivate(void){ } /************************* End ../ext/misc/memtrace.c ********************/ +/************************* Begin ../ext/misc/uint.c ******************/ +/* +** 2020-04-14 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This SQLite extension implements the UINT collating sequence. +** +** UINT works like BINARY for text, except that embedded strings +** of digits compare in numeric order. +** +** * Leading zeros are handled properly, in the sense that +** they do not mess of the maginitude comparison of embedded +** strings of digits. "x00123y" is equal to "x123y". +** +** * Only unsigned integers are recognized. Plus and minus +** signs are ignored. Decimal points and exponential notation +** are ignored. +** +** * Embedded integers can be of arbitrary length. Comparison +** is *not* limited integers that can be expressed as a +** 64-bit machine integer. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include +#include + +/* +** Compare text in lexicographic order, except strings of digits +** compare in numeric order. +*/ +static int uintCollFunc( + void *notUsed, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + const unsigned char *zA = (const unsigned char*)pKey1; + const unsigned char *zB = (const unsigned char*)pKey2; + int i=0, j=0, x; + (void)notUsed; + while( i +#include /* ** Implementation of the "sqlar_compress(X)" SQL function. @@ -7834,14 +8001,19 @@ int idxFindIndexes( /* int iParent = sqlite3_column_int(pExplain, 1); */ /* int iNotUsed = sqlite3_column_int(pExplain, 2); */ const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3); - int nDetail = STRLEN(zDetail); + int nDetail; int i; + if( !zDetail ) continue; + nDetail = STRLEN(zDetail); + for(i=0; imodePrior = p->mode; + p->priorShFlgs = p->shellFlgs; memcpy(p->colSepPrior, p->colSeparator, sizeof(p->colSeparator)); memcpy(p->rowSepPrior, p->rowSeparator, sizeof(p->rowSeparator)); } static void outputModePop(ShellState *p){ p->mode = p->modePrior; + p->shellFlgs = p->priorShFlgs; memcpy(p->colSeparator, p->colSepPrior, sizeof(p->colSeparator)); memcpy(p->rowSeparator, p->rowSepPrior, sizeof(p->rowSeparator)); } @@ -10871,8 +11046,7 @@ static void set_table_name(ShellState *p, const char * */ static int run_table_dump_query( ShellState *p, /* Query context */ - const char *zSelect, /* SELECT statement to extract content */ - const char *zFirstRow /* Print before first row, if not NULL */ + const char *zSelect /* SELECT statement to extract content */ ){ sqlite3_stmt *pSelect; int rc; @@ -10889,10 +11063,6 @@ static int run_table_dump_query( rc = sqlite3_step(pSelect); nResult = sqlite3_column_count(pSelect); while( rc==SQLITE_ROW ){ - if( zFirstRow ){ - utf8_printf(p->out, "%s", zFirstRow); - zFirstRow = 0; - } z = (const char*)sqlite3_column_text(pSelect, 0); utf8_printf(p->out, "%s", z); for(i=1; idb, 0, 0); sqlite3_shathree_init(p->db, 0, 0); sqlite3_completion_init(p->db, 0, 0); + sqlite3_uint_init(p->db, 0, 0); #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) sqlite3_dbdata_init(p->db, 0, 0); #endif @@ -13073,6 +13268,8 @@ struct ImportCtx { int n; /* Number of bytes in z */ int nAlloc; /* Space allocated for z[] */ int nLine; /* Current line number */ + int nRow; /* Number of rows imported */ + int nErr; /* Number of errors encountered */ int bNotFirst; /* True if one or more bytes already read */ int cTerm; /* Character that terminated the most recent field */ int cColSep; /* The column separator character. (Usually ",") */ @@ -13454,11 +13651,15 @@ static void output_reset(ShellState *p){ zCmd = sqlite3_mprintf("%s %s", zXdgOpenCmd, p->zTempFile); if( system(zCmd) ){ utf8_printf(stderr, "Failed: [%s]\n", zCmd); + }else{ + /* Give the start/open/xdg-open command some time to get + ** going before we continue, and potential delete the + ** p->zTempFile data file out from under it */ + sqlite3_sleep(2000); } sqlite3_free(zCmd); outputModePop(p); p->doXdgOpen = 0; - sqlite3_sleep(100); } #endif /* !defined(SQLITE_NOHAVE_SYSTEM) */ } @@ -13534,12 +13735,7 @@ static int shell_dbinfo_command(ShellState *p, int nAr "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", -1, &pStmt, 0); if( rc ){ - if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){ - utf8_printf(stderr, "the \".dbinfo\" command requires the " - "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n"); - }else{ - utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); - } + utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); sqlite3_finalize(pStmt); return 1; } @@ -13748,9 +13944,21 @@ static void newTempFile(ShellState *p, const char *zSu sqlite3_file_control(p->db, 0, SQLITE_FCNTL_TEMPFILENAME, &p->zTempFile); } if( p->zTempFile==0 ){ + /* If p->db is an in-memory database then the TEMPFILENAME file-control + ** will not work and we will need to fallback to guessing */ + char *zTemp; sqlite3_uint64 r; sqlite3_randomness(sizeof(r), &r); - p->zTempFile = sqlite3_mprintf("temp%llx.%s", r, zSuffix); + zTemp = getenv("TEMP"); + if( zTemp==0 ) zTemp = getenv("TMP"); + if( zTemp==0 ){ +#ifdef _WIN32 + zTemp = "\\tmp"; +#else + zTemp = "/tmp"; +#endif + } + p->zTempFile = sqlite3_mprintf("%s/temp%llx.%s", zTemp, r, zSuffix); }else{ p->zTempFile = sqlite3_mprintf("%z.%s", p->zTempFile, zSuffix); } @@ -15774,7 +15982,8 @@ static int do_meta_command(char *zLine, ShellState *p) #endif /* !(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) */ if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){ - const char *zLike = 0; + char *zLike = 0; + char *zSql; int i; int savedShowHeader = p->showHeader; int savedShellFlags = p->shellFlgs; @@ -15802,12 +16011,10 @@ static int do_meta_command(char *zLine, ShellState *p) goto meta_command_exit; } }else if( zLike ){ - raw_printf(stderr, "Usage: .dump ?--preserve-rowids? " - "?--newlines? ?LIKE-PATTERN?\n"); - rc = 1; - goto meta_command_exit; + zLike = sqlite3_mprintf("%z OR name LIKE %Q ESCAPE '\\'", + zLike, azArg[i]); }else{ - zLike = azArg[i]; + zLike = sqlite3_mprintf("name LIKE %Q ESCAPE '\\'", azArg[i]); } } @@ -15825,35 +16032,25 @@ static int do_meta_command(char *zLine, ShellState *p) ** corrupt. */ sqlite3_exec(p->db, "SAVEPOINT dump; PRAGMA writable_schema=ON", 0, 0, 0); p->nErr = 0; - if( zLike==0 ){ - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE sql NOT NULL AND type=='table' AND name!='sqlite_sequence'" - ); - run_schema_dump_query(p, - "SELECT name, type, sql FROM sqlite_master " - "WHERE name=='sqlite_sequence'" - ); - run_table_dump_query(p, - "SELECT sql FROM sqlite_master " - "WHERE sql NOT NULL AND type IN ('index','trigger','view')", 0 - ); - }else{ - char *zSql; - zSql = sqlite3_mprintf( - "SELECT name, type, sql FROM sqlite_master " - "WHERE tbl_name LIKE %Q AND type=='table'" - " AND sql NOT NULL", zLike); - run_schema_dump_query(p,zSql); - sqlite3_free(zSql); - zSql = sqlite3_mprintf( - "SELECT sql FROM sqlite_master " - "WHERE sql NOT NULL" - " AND type IN ('index','trigger','view')" - " AND tbl_name LIKE %Q", zLike); - run_table_dump_query(p, zSql, 0); - sqlite3_free(zSql); - } + if( zLike==0 ) zLike = sqlite3_mprintf("true"); + zSql = sqlite3_mprintf( + "SELECT name, type, sql FROM sqlite_master " + "WHERE (%s) AND type=='table'" + " AND sql NOT NULL" + " ORDER BY tbl_name='sqlite_sequence', rowid", + zLike + ); + run_schema_dump_query(p,zSql); + sqlite3_free(zSql); + zSql = sqlite3_mprintf( + "SELECT sql FROM sqlite_master " + "WHERE (%s) AND sql NOT NULL" + " AND type IN ('index','trigger','view')", + zLike + ); + run_table_dump_query(p, zSql); + sqlite3_free(zSql); + sqlite3_free(zLike); if( p->writableSchema ){ raw_printf(p->out, "PRAGMA writable_schema=OFF;\n"); p->writableSchema = 0; @@ -15956,6 +16153,7 @@ static int do_meta_command(char *zLine, ShellState *p) { "tempfilename", SQLITE_FCNTL_TEMPFILENAME, "" }, { "has_moved", SQLITE_FCNTL_HAS_MOVED, "" }, { "lock_timeout", SQLITE_FCNTL_LOCK_TIMEOUT, "MILLISEC" }, + { "reserve_bytes", SQLITE_FCNTL_RESERVE_BYTES, "[N]" }, }; int filectrl = -1; int iCtrl = -1; @@ -15963,10 +16161,21 @@ static int do_meta_command(char *zLine, ShellState *p) int isOk = 0; /* 0: usage 1: %lld 2: no-result */ int n2, i; const char *zCmd = 0; + const char *zSchema = 0; open_db(p, 0); zCmd = nArg>=2 ? azArg[1] : "help"; + if( zCmd[0]=='-' + && (strcmp(zCmd,"--schema")==0 || strcmp(zCmd,"-schema")==0) + && nArg>=4 + ){ + zSchema = azArg[2]; + for(i=3; idb, 0, SQLITE_FCNTL_SIZE_LIMIT, &iRes); + sqlite3_file_control(p->db, zSchema, SQLITE_FCNTL_SIZE_LIMIT, &iRes); isOk = 1; break; } @@ -16017,7 +16226,7 @@ static int do_meta_command(char *zLine, ShellState *p) int x; if( nArg!=3 ) break; x = (int)integerValue(azArg[2]); - sqlite3_file_control(p->db, 0, filectrl, &x); + sqlite3_file_control(p->db, zSchema, filectrl, &x); isOk = 2; break; } @@ -16026,7 +16235,7 @@ static int do_meta_command(char *zLine, ShellState *p) int x; if( nArg!=2 && nArg!=3 ) break; x = nArg==3 ? booleanValue(azArg[2]) : -1; - sqlite3_file_control(p->db, 0, filectrl, &x); + sqlite3_file_control(p->db, zSchema, filectrl, &x); iRes = x; isOk = 1; break; @@ -16034,7 +16243,7 @@ static int do_meta_command(char *zLine, ShellState *p) case SQLITE_FCNTL_HAS_MOVED: { int x; if( nArg!=2 ) break; - sqlite3_file_control(p->db, 0, filectrl, &x); + sqlite3_file_control(p->db, zSchema, filectrl, &x); iRes = x; isOk = 1; break; @@ -16042,7 +16251,7 @@ static int do_meta_command(char *zLine, ShellState *p) case SQLITE_FCNTL_TEMPFILENAME: { char *z = 0; if( nArg!=2 ) break; - sqlite3_file_control(p->db, 0, filectrl, &z); + sqlite3_file_control(p->db, zSchema, filectrl, &z); if( z ){ utf8_printf(p->out, "%s\n", z); sqlite3_free(z); @@ -16050,6 +16259,18 @@ static int do_meta_command(char *zLine, ShellState *p) isOk = 2; break; } + case SQLITE_FCNTL_RESERVE_BYTES: { + int x; + if( nArg>=3 ){ + x = atoi(azArg[2]); + sqlite3_file_control(p->db, zSchema, filectrl, &x); + } + x = -1; + sqlite3_file_control(p->db, zSchema, filectrl, &x); + utf8_printf(p->out,"%d\n", x); + isOk = 2; + break; + } } } if( isOk==0 && iCtrl>=0 ){ @@ -16133,8 +16354,8 @@ static int do_meta_command(char *zLine, ShellState *p) }else if( c=='i' && strncmp(azArg[0], "import", n)==0 ){ - char *zTable; /* Insert data into this table */ - char *zFile; /* Name of file to extra content from */ + char *zTable = 0; /* Insert data into this table */ + char *zFile = 0; /* Name of file to extra content from */ sqlite3_stmt *pStmt = NULL; /* A statement */ int nCol; /* Number of columns in the table */ int nByte; /* Number of bytes in an SQL string */ @@ -16145,51 +16366,108 @@ static int do_meta_command(char *zLine, ShellState *p) ImportCtx sCtx; /* Reader context */ char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */ int (SQLITE_CDECL *xCloser)(FILE*); /* Func to close file */ + int eVerbose = 0; /* Larger for more console output */ + int nSkip = 0; /* Initial lines to skip */ + int useOutputMode = 1; /* Use output mode to determine separators */ - if( nArg!=3 ){ - raw_printf(stderr, "Usage: .import FILE TABLE\n"); - goto meta_command_exit; - } - zFile = azArg[1]; - zTable = azArg[2]; - seenInterrupt = 0; memset(&sCtx, 0, sizeof(sCtx)); - open_db(p, 0); - nSep = strlen30(p->colSeparator); - if( nSep==0 ){ - raw_printf(stderr, - "Error: non-null column separator required for import\n"); - return 1; + if( p->mode==MODE_Ascii ){ + xRead = ascii_read_one_field; + }else{ + xRead = csv_read_one_field; } - if( nSep>1 ){ - raw_printf(stderr, "Error: multi-character column separators not allowed" - " for import\n"); - return 1; + for(i=1; iout, "ERROR: extra argument: \"%s\". Usage:\n", z); + showHelp(p->out, "import"); + rc = 1; + goto meta_command_exit; + } + }else if( strcmp(z,"-v")==0 ){ + eVerbose++; + }else if( strcmp(z,"-skip")==0 && iout, "ERROR: unknown option: \"%s\". Usage:\n", z); + showHelp(p->out, "import"); + rc = 1; + goto meta_command_exit; + } } - nSep = strlen30(p->rowSeparator); - if( nSep==0 ){ - raw_printf(stderr, "Error: non-null row separator required for import\n"); - return 1; + if( zTable==0 ){ + utf8_printf(p->out, "ERROR: missing %s argument. Usage:\n", + zFile==0 ? "FILE" : "TABLE"); + showHelp(p->out, "import"); + rc = 1; + goto meta_command_exit; } - if( nSep==2 && p->mode==MODE_Csv && strcmp(p->rowSeparator, SEP_CrLf)==0 ){ - /* When importing CSV (only), if the row separator is set to the - ** default output row separator, change it to the default input - ** row separator. This avoids having to maintain different input - ** and output row separators. */ - sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); + seenInterrupt = 0; + open_db(p, 0); + if( useOutputMode ){ + /* If neither the --csv or --ascii options are specified, then set + ** the column and row separator characters from the output mode. */ + nSep = strlen30(p->colSeparator); + if( nSep==0 ){ + raw_printf(stderr, + "Error: non-null column separator required for import\n"); + rc = 1; + goto meta_command_exit; + } + if( nSep>1 ){ + raw_printf(stderr, + "Error: multi-character column separators not allowed" + " for import\n"); + rc = 1; + goto meta_command_exit; + } nSep = strlen30(p->rowSeparator); + if( nSep==0 ){ + raw_printf(stderr, + "Error: non-null row separator required for import\n"); + rc = 1; + goto meta_command_exit; + } + if( nSep==2 && p->mode==MODE_Csv && strcmp(p->rowSeparator,SEP_CrLf)==0 ){ + /* When importing CSV (only), if the row separator is set to the + ** default output row separator, change it to the default input + ** row separator. This avoids having to maintain different input + ** and output row separators. */ + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); + nSep = strlen30(p->rowSeparator); + } + if( nSep>1 ){ + raw_printf(stderr, "Error: multi-character row separators not allowed" + " for import\n"); + rc = 1; + goto meta_command_exit; + } + sCtx.cColSep = p->colSeparator[0]; + sCtx.cRowSep = p->rowSeparator[0]; } - if( nSep>1 ){ - raw_printf(stderr, "Error: multi-character row separators not allowed" - " for import\n"); - return 1; - } sCtx.zFile = zFile; sCtx.nLine = 1; if( sCtx.zFile[0]=='|' ){ #ifdef SQLITE_OMIT_POPEN raw_printf(stderr, "Error: pipes are not supported in this OS\n"); - return 1; + rc = 1; + goto meta_command_exit; #else sCtx.in = popen(sCtx.zFile+1, "r"); sCtx.zFile = ""; @@ -16199,17 +16477,26 @@ static int do_meta_command(char *zLine, ShellState *p) sCtx.in = fopen(sCtx.zFile, "rb"); xCloser = fclose; } - if( p->mode==MODE_Ascii ){ - xRead = ascii_read_one_field; - }else{ - xRead = csv_read_one_field; - } if( sCtx.in==0 ){ utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile); - return 1; + rc = 1; + goto meta_command_exit; } - sCtx.cColSep = p->colSeparator[0]; - sCtx.cRowSep = p->rowSeparator[0]; + if( eVerbose>=2 || (eVerbose>=1 && useOutputMode) ){ + char zSep[2]; + zSep[1] = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 08:57:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D85FD32CC1B for ; Mon, 15 Jun 2020 08:57:21 +0000 (UTC) (envelope-from 40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@e.promowagon.fr) Received: from ip2.promowagon.fr (ip2.promowagon.fr [185.31.81.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49llZm3vByz4K41 for ; Mon, 15 Jun 2020 08:57:19 +0000 (UTC) (envelope-from 40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@e.promowagon.fr) Received: by ip2.promowagon.fr id hssrue2l724c for ; Mon, 15 Jun 2020 08:57:11 +0000 (envelope-from <40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@e.promowagon.fr>) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; q=dns/txt; d=promowagon.fr; s=default1k; h=Date:Subject:From:To; bh=UEs4bARdFFrLZBOvQaNoYT6oTci9rHh6tgO9dNJNkHs=; b=jIT8CUqv9QRHS/m+v30mSMb+uYV+zkCRqSsOLQcB6YIfKY4K4T0VNvHJonrbASfXXkRI DsL0+zJLZDOZgJOeHfUdYi6LSz3wlnn62oBgIm46Jzo8NmxqDRNCNbmt9y1zR34A0enNjH MP+fL4MF7If3jsNPX8RVdauLPkLCW9q7s= MIME-Version: 1.0 Date: Mon, 15 Jun 2020 08:57:11 +0000 Message-ID: <40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@links.indisuivi.fr> Subject: =?utf-8?Q?Jusqu'au_30_juin=2C_profitez_de_conditions_exceptionnelles_sur_?= =?utf-8?Q?les_v=C3=A9hicules_neufs?= From: "=?utf-8?Q?Jaguar_par_PMW?=" Reply-To: =?utf-8?Q?Jaguar_par_PMW?= To: svn-src-all@freebsd.org List-Unsubscribe-Post: List-Unsubscribe=One-Click X-Message-Type: newsletter X-Rspamd-Queue-Id: 49llZm3vByz4K41 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=promowagon.fr header.s=default1k header.b=jIT8CUqv; dmarc=none; spf=pass (mx1.freebsd.org: domain of 40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@e.promowagon.fr designates 185.31.81.148 as permitted sender) smtp.mailfrom=40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@e.promowagon.fr X-Spamd-Result: default: False [0.71 / 15.00]; HAS_REPLYTO(0.00)[info@promowagon.fr]; R_SPF_ALLOW(-0.20)[+ip4:185.31.80.0/22]; REPLYTO_DN_EQ_FROM_DN(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[promowagon.fr:+]; NEURAL_HAM_SHORT(-0.38)[-0.384]; FROM_EXCESS_QP(1.20)[]; FORGED_SENDER(0.30)[info@promowagon.fr,40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@e.promowagon.fr]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:47544, ipnet:185.31.80.0/22, country:PL]; FROM_NEQ_ENVFROM(0.00)[info@promowagon.fr,40532=09842f69-1e06-4663-9957-4f876f4645c9=91=24813111@e.promowagon.fr]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.78)[-0.779]; R_DKIM_ALLOW(-0.20)[promowagon.fr:s=default1k]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.36)[-0.364]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[promowagon.fr]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MANY_INVISIBLE_PARTS(0.05)[1]; REPLYTO_EXCESS_QP(1.20)[] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 08:57:21 -0000 Si vous ne visualisez pas ce message correctement [1]cliquez-ici Pour ne plus recevoir nos offres vous pouvez vous d=C3=A9sabonner en bas= de cette page ou bien [2]cliquer ici. References 1. https://links.indisuivi.fr/v/2ZI/qjubcavAvDqtNDuidDtoGa/fe8c0091 2. https://links.indisuivi.fr/u/2ZI/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/F/d5= f523ac Allopromo vous a envoy=C3=A9 cette newsletter car vous avez accept=C3=A9= de recevoir ses offres partenaires [1]Jaguar France [2]Jaguar France [3]Vos r=C3=AAves ont suffisamment attendu Jusqu'au 30 juin, profitez de conditions exceptionnelles pendant les Liberty Days sur nos v=C3=A9hicules neufs disponibles imm=C3=A9diatement= en stock et d=C3=A9couvrez l'offre Liberty Leasing* : roulez maintenant et payez en 2021 ! [4]J'EN PROFITE On devrait toujours =C3=A9couter ses envies, aujourd'hui plus que jamais= =2E Que vous pr=C3=A9f=C3=A9riez l'=C3=A9l=C3=A9gance et le dynamisme de nos= berlines ou la polyvalence et le confort de nos SUV, une Jaguar reste avant tout un objet de d=C3=A9sir. Alors si un mod=C3=A8le vous pla=C3=AEt vraiment, pourquoi h=C3=A9siter = plus longtemps ? [5]FB [6]TW [7]YT [8]IN [9]LI Liberty Days =3D Les Journ=C3=A9es Libert=C3=A9. Liberty Leasing =3D Loc= ation en libert=C3=A9. * Offre Liberty Leasing en location longue dur=C3=A9e sur 37 mois avec u= n report des 7 premiers loyers (hors services et assurances optionnels) r=C3=A9partis sur les 30 loyers suivants, avec un premier pr=C3=A9l=C3= =A8vement en Janvier 2021. Les loyers sont d=C3=A9termin=C3=A9s selon le type de v=C3= =A9hicule et le kilom=C3=A9trage souscrits. Offre non cumulable, r=C3=A9serv=C3=A9e a= ux particuliers, sur nos v=C3=A9hicules neufs disponibles imm=C3=A9diatemen= t avant le 30 juin 2020 dans le r=C3=A9seau Jaguar participant. Sous r=C3=A9serv= e d'acceptation de votre dossier par LEASYS France SAS, 413 360 181 RCS Versailles, courtier en assurance enregistr=C3=A9 =C3=A0 l'ORIAS. Jaguar Land Rover France - 509 016 804 RCS Nanterre. Vos donn=C3=A9es personnelles n'ont pas =C3=A9t=C3=A9 communiqu=C3=A9es = =C3=A0 Jaguar Land Rover France =20 [10][?type=3Ddisplayemail&i=3Dfhb0dhf0dfjc0bagde0cajgif] References 1. https://links.indisuivi.fr/c/2ZI/c1m/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/10317450 2. https://links.indisuivi.fr/c/2ZI/c1b/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/e3d0129b 3. https://links.indisuivi.fr/c/2ZI/c1o/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/a2fd0486 4. https://links.indisuivi.fr/c/2ZI/c1L/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/be4f6094 5. https://links.indisuivi.fr/c/2ZI/c1i/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/aed893bd 6. https://links.indisuivi.fr/c/2ZI/c17/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/a72a0775 7. https://links.indisuivi.fr/c/2ZI/c12/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/40a5d8f3 8. https://links.indisuivi.fr/c/2ZI/c1X/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/9692120e 9. https://links.indisuivi.fr/c/2ZI/c16/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/fe4c3f1e 10. https://links.indisuivi.fr/c/2ZI/c1k/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/1c14e36b Vous disposez d'un droit d'acc=C3=A8s, de rectification, d'opposition et= de consentement auquel vous avez acc=C3=A8s =C3=A0 partir de cette page = web : [1]Charte des Donn=C3=A9es Personnelles . Vous recevez ce message sur votre adresse email car vous =C3=AAtes inscr= it =C3=A0 notre liste compos=C3=A9e de dirigeants et professionnels. MEDIAZUR - 1 = Rue Prommenade des anglais 06000 Nice. 833 975 758 RCS. Pour stopper la r=C3=A9ception par email de nos messages, suivez ce lie= n : [2]Se d=C3=A9sabonner.. References 1. https://links.indisuivi.fr/c/2ZI/c1v/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/= F/cb0d6001 2. https://links.indisuivi.fr/u/2ZI/qjubcavAvDqtNDuidDtoGa/Fd/FA-V9/F/d5= f523ac From owner-svn-src-all@freebsd.org Mon Jun 15 10:08:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8DA232E642; Mon, 15 Jun 2020 10:08:02 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ln8L5rG4z4NBY; Mon, 15 Jun 2020 10:08:02 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C334E1BCC9; Mon, 15 Jun 2020 10:08:02 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FA82Nx031031; Mon, 15 Jun 2020 10:08:02 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FA82YG031030; Mon, 15 Jun 2020 10:08:02 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006151008.05FA82YG031030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Mon, 15 Jun 2020 10:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362191 - head/sbin/md5 X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/sbin/md5 X-SVN-Commit-Revision: 362191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 10:08:03 -0000 Author: fernape (ports committer) Date: Mon Jun 15 10:08:02 2020 New Revision: 362191 URL: https://svnweb.freebsd.org/changeset/base/362191 Log: md5(1): fix style in man page Fix a bunch of style problems reported by mandoc(1) and igor: mandoc: ./md5.1:19:71: STYLE: no blank before trailing delimiter: Nm ... rmd160, mandoc: ./md5.1:20:23: STYLE: no blank before trailing delimiter: Nm ... skein512, mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:35:2: STYLE: useless macro: Tn mandoc: ./md5.1:42:2: STYLE: useless macro: Tn mandoc: ./md5.1:45:2: STYLE: useless macro: Tn mandoc: ./md5.1:47:2: STYLE: useless macro: Tn mandoc: ./md5.1:56:2: STYLE: useless macro: Tn mandoc: ./md5.1:58:2: STYLE: useless macro: Tn mandoc: ./md5.1:61:2: STYLE: useless macro: Tn mandoc: ./md5.1:66:2: STYLE: useless macro: Tn mandoc: ./md5.1:68:2: STYLE: useless macro: Tn mandoc: ./md5.1:104:24: STYLE: no blank before trailing delimiter: Nm skein512, mandoc: ./md5.1:117:6: STYLE: referenced manual not found: Xr sha224 3 igor: md5.1:46:no comma after "i.e.":either algorithm, [i.e.] to find an input that produces a specific Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D25277 Modified: head/sbin/md5/md5.1 Modified: head/sbin/md5/md5.1 ============================================================================== --- head/sbin/md5/md5.1 Mon Jun 15 03:10:53 2020 (r362190) +++ head/sbin/md5/md5.1 Mon Jun 15 10:08:02 2020 (r362191) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd July 9, 2018 +.Dd June 15, 2020 .Dt MD5 1 .Os .Sh NAME @@ -16,8 +16,8 @@ (All other hashes have the same options and usage.) .Sh DESCRIPTION The -.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512, sha512t256, rmd160, -.Nm skein256, skein512, +.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t256 , rmd160 , +.Nm skein256 , skein512 , and .Nm skein1024 utilities take as input a message of arbitrary length and produce as @@ -29,43 +29,29 @@ of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. -The -.Tn SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, -and -.Tn SKEIN +The SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, +and SKEIN algorithms are intended for digital signature applications, where a large file must be .Dq compressed in a secure manner before being encrypted with a private (secret) -key under a public-key cryptosystem such as -.Tn RSA . +key under a public-key cryptosystem such as RSA. .Pp -The -.Tn MD5 -and -.Tn SHA-1 -algorithms have been proven to be vulnerable to practical collision -attacks and should not be relied upon to produce unique outputs, +The MD5 and SHA-1 algorithms have been proven to be vulnerable to practical +collision attacks and should not be relied upon to produce unique outputs, .Em nor should they be used as part of a cryptographic signature scheme. As of 2017-03-02, there is no publicly known method to .Em reverse -either algorithm, i.e. to find an input that produces a specific +either algorithm, i.e., to find an input that produces a specific output. .Pp -.Tn SHA-512t256 -is a version of -.Tn SHA-512 -truncated to only 256 bits. -On 64-bit hardware, this algorithm is approximately 50% faster than -.Tn SHA-256 -but with the same level of security. +SHA-512t256 is a version of SHA-512 truncated to only 256 bits. +On 64-bit hardware, this algorithm is approximately 50% faster than SHA-256 but +with the same level of security. The hashes are not interchangeable. .Pp -It is recommended that all new applications use -.Tn SHA-512 -or -.Tn SKEIN-512 +It is recommended that all new applications use SHA-512 or SKEIN-512 instead of one of the other hash functions. .Pp The following options may be used in any combination and must @@ -101,7 +87,7 @@ Run a built-in test script. .Sh EXIT STATUS The .Nm md5 , sha1 , sha224 , sha256 , sha512 , sha512t256 , rmd160 , -.Nm skein256 , skein512, +.Nm skein256 , skein512 , and .Nm skein1024 utilities exit 0 on success, @@ -114,7 +100,6 @@ option. .Xr md5 3 , .Xr ripemd 3 , .Xr sha 3 , -.Xr sha224 3 , .Xr sha256 3 , .Xr sha384 3 , .Xr sha512 3 , From owner-svn-src-all@freebsd.org Mon Jun 15 11:02:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ABF132F75B; Mon, 15 Jun 2020 11:02:02 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49lpLd4JDsz4QsS; Mon, 15 Jun 2020 11:02:01 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id AEEC85C00D8; Mon, 15 Jun 2020 07:02:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 15 Jun 2020 07:02:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.dev; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=e +UxwaJ6zUy/sYysZaWGxJf1TdwIGwlf1rdGfMI0PDU=; b=E6ZAGDalHLUY87r1g DvMKt4kHAsm1pSDggS7zr6twEs5e0+yuDMzcsOoQ5rp7NmGRE9Pcxh84KkivleIA HTZvPbmJIzBI3sIHNKsZ3vQe+vLPlaV/2jYUx/MBqluz+9OdaZzn7R6zNya8Vz+r 0PKAznxyGb7veoxemuKSqCW1OsEh5CbIQjyd76E1rJdBiBrcvt1nQ8GE37Y7cWjo l+zstPUFIKgp2Vo6YRxxe14XjG+PilgkazbLS36Ncdf/9U8tmCs0YrMZaa8Ziyg+ GtMCFfDJ5jie6WSBb78EYYBtH6H/AJL+oMwyCGdTuJ0sGE+CwtIZLkti9fcPxrjt 3ODWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=e+UxwaJ6zUy/sYysZaWGxJf1TdwIGwlf1rdGfMI0P DU=; b=Q6xpSVgFkgbenmLr7uErKLtrZG4oRvhSG7hNNLgnBr95h1lKDU9RGlyuz m88t52BV+NkUpDhuVh+D+zOdnHyU7lc5XqLvTqJ1l8kcbagEvQYOaASE5lC1KVEe RysEU37bYU7qxVr/nUj3FLVSHJfdzkM5nnYiGJxR6uBOYgW30bDHAvlzk/MDq/IA /lbmk7XFwQK03aK61TywRzLHxPeBpkRfIVYEW+K+uPY1QYQ3SGxUYbHZoRjT9/r2 QFudyQI74it5fXZhBa5w2T4Ny3J4i6wS1HoxU/6z+EmmHORYIVOF9BC1obend7hQ zcxx3HRn4yzfeHcqCwzNL7AO+Fo3A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeikedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpegjuhhrihcurfgrnhhkohhvuceohihurhhiphhvseihuhhr ihhpvhdruggvvheqnecuggftrfgrthhtvghrnhepveefvefgtefgueekfeejudeukeffje eugfeiteetueelvddttefhleehvdejteevnecuffhomhgrihhnpehfrhgvvggsshgurdho rhhgnecukfhppeeluddrvdegtddruddvgedrudefjeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuhhrihhpvheshihurhhiphhvrdguvghv X-ME-Proxy: Received: from [192.168.1.6] (unknown [91.240.124.137]) by mail.messagingengine.com (Postfix) with ESMTPA id 9C6E5328005D; Mon, 15 Jun 2020 07:01:59 -0400 (EDT) Subject: Re: svn commit: r362191 - head/sbin/md5 To: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006151008.05FA82YG031030@repo.freebsd.org> From: Yuri Pankov Message-ID: <8d50454e-4cec-d665-92ab-e62ca87e68d8@yuripv.dev> Date: Mon, 15 Jun 2020 14:01:59 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <202006151008.05FA82YG031030@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49lpLd4JDsz4QsS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 11:02:02 -0000 Fernando Apesteguía wrote: > Author: fernape (ports committer) > Date: Mon Jun 15 10:08:02 2020 > New Revision: 362191 > URL: https://svnweb.freebsd.org/changeset/base/362191 > > Log: > md5(1): fix style in man page > > Fix a bunch of style problems reported by mandoc(1) and igor: > > mandoc: ./md5.1:19:71: STYLE: no blank before trailing delimiter: Nm ... rmd160, > mandoc: ./md5.1:20:23: STYLE: no blank before trailing delimiter: Nm ... skein512, > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:35:2: STYLE: useless macro: Tn > mandoc: ./md5.1:42:2: STYLE: useless macro: Tn > mandoc: ./md5.1:45:2: STYLE: useless macro: Tn > mandoc: ./md5.1:47:2: STYLE: useless macro: Tn > mandoc: ./md5.1:56:2: STYLE: useless macro: Tn > mandoc: ./md5.1:58:2: STYLE: useless macro: Tn > mandoc: ./md5.1:61:2: STYLE: useless macro: Tn > mandoc: ./md5.1:66:2: STYLE: useless macro: Tn > mandoc: ./md5.1:68:2: STYLE: useless macro: Tn > mandoc: ./md5.1:104:24: STYLE: no blank before trailing delimiter: Nm skein512, > mandoc: ./md5.1:117:6: STYLE: referenced manual not found: Xr sha224 3 > > igor: > md5.1:46:no comma after "i.e.":either algorithm, [i.e.] to find an input that produces a specific > > Approved by: bcr@ > Differential Revision: https://reviews.freebsd.org/D25277 > > Modified: > head/sbin/md5/md5.1 > > Modified: head/sbin/md5/md5.1 > ============================================================================== > --- head/sbin/md5/md5.1 Mon Jun 15 03:10:53 2020 (r362190) > +++ head/sbin/md5/md5.1 Mon Jun 15 10:08:02 2020 (r362191) > @@ -1,5 +1,5 @@ > .\" $FreeBSD$ > -.Dd July 9, 2018 > +.Dd June 15, 2020 > .Dt MD5 1 > .Os > .Sh NAME > @@ -16,8 +16,8 @@ > (All other hashes have the same options and usage.) > .Sh DESCRIPTION > The > -.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512, sha512t256, rmd160, > -.Nm skein256, skein512, > +.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t256 , rmd160 , > +.Nm skein256 , skein512 , > and > .Nm skein1024 > utilities take as input a message of arbitrary length and produce as > @@ -29,43 +29,29 @@ of the input. > It is conjectured that it is computationally infeasible to > produce two messages having the same message digest, or to produce any > message having a given prespecified target message digest. > -The > -.Tn SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, > -and > -.Tn SKEIN > +The SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, > +and SKEIN > algorithms are intended for digital signature applications, where a > large file must be > .Dq compressed > in a secure manner before being encrypted with a private > (secret) > -key under a public-key cryptosystem such as > -.Tn RSA . > +key under a public-key cryptosystem such as RSA. > .Pp > -The > -.Tn MD5 > -and > -.Tn SHA-1 > -algorithms have been proven to be vulnerable to practical collision > -attacks and should not be relied upon to produce unique outputs, > +The MD5 and SHA-1 algorithms have been proven to be vulnerable to practical > +collision attacks and should not be relied upon to produce unique outputs, > .Em nor should they be used as part of a cryptographic signature scheme. > As of 2017-03-02, there is no publicly known method to > .Em reverse > -either algorithm, i.e. to find an input that produces a specific > +either algorithm, i.e., to find an input that produces a specific > output. > .Pp > -.Tn SHA-512t256 > -is a version of > -.Tn SHA-512 > -truncated to only 256 bits. > -On 64-bit hardware, this algorithm is approximately 50% faster than > -.Tn SHA-256 > -but with the same level of security. > +SHA-512t256 is a version of SHA-512 truncated to only 256 bits. > +On 64-bit hardware, this algorithm is approximately 50% faster than SHA-256 but > +with the same level of security. > The hashes are not interchangeable. > .Pp > -It is recommended that all new applications use > -.Tn SHA-512 > -or > -.Tn SKEIN-512 > +It is recommended that all new applications use SHA-512 or SKEIN-512 > instead of one of the other hash functions. > .Pp > The following options may be used in any combination and must > @@ -101,7 +87,7 @@ Run a built-in test script. > .Sh EXIT STATUS > The > .Nm md5 , sha1 , sha224 , sha256 , sha512 , sha512t256 , rmd160 , > -.Nm skein256 , skein512, > +.Nm skein256 , skein512 , > and > .Nm skein1024 > utilities exit 0 on success, > @@ -114,7 +100,6 @@ option. > .Xr md5 3 , > .Xr ripemd 3 , > .Xr sha 3 , > -.Xr sha224 3 , > .Xr sha256 3 , > .Xr sha384 3 , > .Xr sha512 3 , I think we should create sha256.3 -> sha224.3 instead of removing the reference, as done for sha512.3 -> sha384.3 -- if you look at the sha256.3 man page, it documents all of the SHA224_* functions; i.e.,: Index: Makefile =================================================================== --- Makefile (revision 362145) +++ Makefile (working copy) @@ -40,7 +40,7 @@ MLINKS+=sha256.3 SHA224_Init.3 sha256.3 SHA224_Update.3 MLINKS+=sha256.3 SHA224_Final.3 sha256.3 SHA224_End.3 MLINKS+=sha256.3 SHA224_File.3 sha256.3 SHA224_FileChunk.3 -MLINKS+=sha256.3 SHA224_Data.3 +MLINKS+=sha256.3 SHA224_Data.3 sha256.3 sha224.3 MLINKS+=sha256.3 SHA256_Init.3 sha256.3 SHA256_Update.3 MLINKS+=sha256.3 SHA256_Final.3 sha256.3 SHA256_End.3 MLINKS+=sha256.3 SHA256_File.3 sha256.3 SHA256_FileChunk.3 From owner-svn-src-all@freebsd.org Mon Jun 15 11:29:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CD16330657; Mon, 15 Jun 2020 11:29:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lpyN0NgWz4SXj; Mon, 15 Jun 2020 11:29:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 088D01CBCD; Mon, 15 Jun 2020 11:29:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FBTVQ0080378; Mon, 15 Jun 2020 11:29:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FBTVaG080377; Mon, 15 Jun 2020 11:29:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006151129.05FBTVaG080377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Jun 2020 11:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r362192 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 362192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 11:29:32 -0000 Author: andrew Date: Mon Jun 15 11:29:31 2020 New Revision: 362192 URL: https://svnweb.freebsd.org/changeset/base/362192 Log: Increase limit for an OpenCSD import Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Jun 15 10:08:02 2020 (r362191) +++ svnadmin/conf/sizelimit.conf Mon Jun 15 11:29:31 2020 (r362192) @@ -15,6 +15,7 @@ # First field is username, second field is the raised limit required. achim +andrew bapt davidcs dim 20480000 From owner-svn-src-all@freebsd.org Mon Jun 15 11:30:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A4DC3307B6; Mon, 15 Jun 2020 11:30:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lpz535JFz4SMs; Mon, 15 Jun 2020 11:30:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 644F71CF00; Mon, 15 Jun 2020 11:30:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FBU90V080510; Mon, 15 Jun 2020 11:30:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FBU5jK080489; Mon, 15 Jun 2020 11:30:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006151130.05FBU5jK080489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Jun 2020 11:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362193 - in vendor/opencsd/dist: . decoder/build/linux decoder/build/linux/ref_trace_decode_lib decoder/build/win-vs2015/ref_trace_decode_lib decoder/docs decoder/docs/prog_guide decod... X-SVN-Group: vendor X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in vendor/opencsd/dist: . decoder/build/linux decoder/build/linux/ref_trace_decode_lib decoder/build/win-vs2015/ref_trace_decode_lib decoder/docs decoder/docs/prog_guide decoder/include/common decoder... X-SVN-Commit-Revision: 362193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 11:30:09 -0000 Author: andrew Date: Mon Jun 15 11:30:04 2020 New Revision: 362193 URL: https://svnweb.freebsd.org/changeset/base/362193 Log: Import OpenCSD v0.14.2 Sponsored by: Innovate UK Added: vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_stack.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_raw_buffer.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_gen_elem_stack.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/auto-fdo/set_strobing.sh (contents, props changed) vendor/opencsd/dist/decoder/tests/auto-fdo/show_strobing.sh (contents, props changed) vendor/opencsd/dist/decoder/tests/run_capi_test.bash (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/ vendor/opencsd/dist/decoder/tests/snapshots/Snowball/ vendor/opencsd/dist/decoder/tests/snapshots/Snowball/cpu_0.ini vendor/opencsd/dist/decoder/tests/snapshots/Snowball/cpu_1.ini vendor/opencsd/dist/decoder/tests/snapshots/Snowball/cstrace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/Snowball/device_2.ini vendor/opencsd/dist/decoder/tests/snapshots/Snowball/device_3.ini vendor/opencsd/dist/decoder/tests/snapshots/Snowball/kernel_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/Snowball/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/Snowball/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/ vendor/opencsd/dist/decoder/tests/snapshots/TC2/cpu_0.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/cpu_1.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/cpu_2.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/cpu_3.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/cpu_4.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/cstrace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/TC2/device_10.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/device_5.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/device_6.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/device_7.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/device_8.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/device_9.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/ds5-dumps/ vendor/opencsd/dist/decoder/tests/snapshots/TC2/ds5-dumps/etmv3_0x10.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/TC2/ds5-dumps/etmv3_0x11.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/TC2/ds5-dumps/etmv3_0x12.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/TC2/ds5-dumps/ptmv1_0x13.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/TC2/kernel_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/TC2/pkt_proc_logs/ vendor/opencsd/dist/decoder/tests/snapshots/TC2/pkt_proc_logs/trc_pkt_lister-dcd-0x13.ppl vendor/opencsd/dist/decoder/tests/snapshots/TC2/pkt_proc_logs/trc_pkt_lister_0x13.ppl vendor/opencsd/dist/decoder/tests/snapshots/TC2/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/TC2/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/ vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/DSTREAM_0.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/README.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/contents.ini vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/device1.ini vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/device2.ini vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/a55-test-tpiu/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/ vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/CSTMC_TRACE_FIFO.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/device1.ini vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/device2.ini vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/mem_Cortex-A57_0.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/pkt_proc_logs/ vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/pkt_proc_logs/trc_pkt_lister_a57ss-1.ppl vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/pkt_proc_logs/trc_pkt_lister_a57ss-2.ppl vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/pkt_proc_logs/trc_pkt_lister_a57ss.ppl vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/a57_single_step/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/ vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cc1.fini_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cc1.init_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cc1.text_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cc1__libc_freeres_fn_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cc1__libc_thread_freeres_fn_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cpu_0.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cpu_1.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cpu_2.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cpu_3.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cpu_4.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cpu_5.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/cstrace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/etm_0.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/etm_1.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/etm_2.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/etm_3.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/etm_4.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/etm_5.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/bugfix-exact-match/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/init-short-addr/ vendor/opencsd/dist/decoder/tests/snapshots/init-short-addr/device1.ini vendor/opencsd/dist/decoder/tests/snapshots/init-short-addr/device2.ini vendor/opencsd/dist/decoder/tests/snapshots/init-short-addr/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/init-short-addr/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/init-short-addr/tracebuffer.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/ vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/cpu_0.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/cpu_1.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/cpu_2.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/cpu_3.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/cpu_4.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/cpu_5.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/cstrace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/device_10.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/device_11.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/device_6.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/device_7.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/device_8.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/device_9.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/kernel_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-ret-stck/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/ vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/cpu_0.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/device_6.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/uname.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/uname_trace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-001/vdso.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/ vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/cpu_0.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/cpu_1.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/cpu_2.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/cpu_3.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/cpu_4.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/cpu_5.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/device_10.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/device_11.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/device_6.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/device_7.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/device_8.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/device_9.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/ld-2.21.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/libc-2.21.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/trace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/uname.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno-uname-002/vdso.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/ vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cpu_0.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cpu_1.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cpu_2.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cpu_3.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cpu_4.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cpu_5.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cstrace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/cstraceitm.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/device_10.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/device_11.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/device_12.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/device_6.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/device_7.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/device_8.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/device_9.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/ds-5-dumps/ vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/ds-5-dumps/Trace_Report_0x10_cpu_0_2015Sep17_104900.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/ds-5-dumps/Trace_Report_0x11_cpu_1_2015Sep17_104748.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/ds-5-dumps/Trace_Report_0x13_cpu_3_2015Sep17_104147.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/ds-5-dumps/Trace_Report_0x15_cpu_5_2015Sep17_105126.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/kernel_dump.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/ vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/trc_pkt_lister_0x10.ppl vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/trc_pkt_lister_0x11.ppl vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/trc_pkt_lister_0x12.ppl vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/trc_pkt_lister_0x13.ppl vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/trc_pkt_lister_0x14.ppl vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/trc_pkt_lister_0x15.ppl vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/pkt_proc_logs/trc_pkt_lister_all.ppl vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/juno_r1_1/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only/ vendor/opencsd/dist/decoder/tests/snapshots/stm_only-2/ vendor/opencsd/dist/decoder/tests/snapshots/stm_only-2/cstraceitm.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/stm_only-2/device_0.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only-2/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only-2/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only-juno/ vendor/opencsd/dist/decoder/tests/snapshots/stm_only-juno/cstraceitm.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/stm_only-juno/device_0.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only-juno/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only-juno/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only/cstraceitm.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/stm_only/device_0.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/stm_only/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/ vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/PTM_0_2.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/README.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/device1.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/device2.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/device3.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/device4.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/device5.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/device6.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/ds-5_trace_dump/ vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/ds-5_trace_dump/a15_rs.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_0_VECTORS.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_1_RO_CODE.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_2_RO_DATA.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_3_RW_DATA.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_4_ZI_DATA.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_5_ARM_LIB_HEAP.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_6_ARM_LIB_STACK.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_7_IRQ_STACK.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/mem_Cortex-A15_0_8_TTB.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/tc2-ptm-rstk-t32/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/ vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/cpu_3.ini vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/device_9.ini vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/ld-2.21.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/libc-2.21.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/trace.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/trace.ini vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/uname.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/test-file-mem-offsets/vdso.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/ vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/PTM_0_2.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/README.txt (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/device1.ini vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/device2.ini vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/device3.ini vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/device4.ini vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/device5.ini vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/device6.ini vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_0_VECTORS.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_1_RO_CODE.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_2_RO_DATA.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_3_RW_DATA.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_4_ZI_DATA.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_5_ARM_LIB_HEAP.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_6_ARM_LIB_STACK.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_7_IRQ_STACK.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/mem_Cortex-A15_0_8_TTB.bin (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/snapshot.ini vendor/opencsd/dist/decoder/tests/snapshots/trace_cov_a15/trace.ini Deleted: vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4d.h vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_elem_etmv4d.cpp vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4.cpp vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4d_impl.h vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.h vendor/opencsd/dist/decoder/tests/auto-fdo/record.sh Modified: vendor/opencsd/dist/HOWTO.md vendor/opencsd/dist/README.md vendor/opencsd/dist/decoder/build/linux/makefile vendor/opencsd/dist/decoder/build/linux/makefile.dev vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/makefile vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters vendor/opencsd/dist/decoder/docs/doxygen_config.dox vendor/opencsd/dist/decoder/docs/prog_guide/prog_guide_generic_pkts.md vendor/opencsd/dist/decoder/docs/test_progs.md vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr.h vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_list.h vendor/opencsd/dist/decoder/include/common/trc_core_arch_map.h vendor/opencsd/dist/decoder/include/common/trc_gen_elem.h vendor/opencsd/dist/decoder/include/common/trc_pkt_decode_base.h vendor/opencsd/dist/decoder/include/i_dec/trc_i_decode.h vendor/opencsd/dist/decoder/include/i_dec/trc_idec_arminst.h vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc_bufptr.h vendor/opencsd/dist/decoder/include/opencsd/etmv3/trc_pkt_decode_etmv3.h vendor/opencsd/dist/decoder/include/opencsd/etmv4/etmv4_decoder.h vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_etmv4_stack_elem.h vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_decode_etmv4i.h vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4.h vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h vendor/opencsd/dist/decoder/include/opencsd/ocsd_if_types.h vendor/opencsd/dist/decoder/include/opencsd/ocsd_if_version.h vendor/opencsd/dist/decoder/include/opencsd/ptm/trc_pkt_decode_ptm.h vendor/opencsd/dist/decoder/include/opencsd/stm/trc_pkt_decode_stm.h vendor/opencsd/dist/decoder/include/opencsd/trc_gen_elem_types.h vendor/opencsd/dist/decoder/include/pkt_printers/pkt_printer_t.h vendor/opencsd/dist/decoder/source/etmv3/trc_pkt_decode_etmv3.cpp vendor/opencsd/dist/decoder/source/etmv4/trc_etmv4_stack_elem.cpp vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_elem_etmv4i.cpp vendor/opencsd/dist/decoder/source/i_dec/trc_i_decode.cpp vendor/opencsd/dist/decoder/source/i_dec/trc_idec_arminst.cpp vendor/opencsd/dist/decoder/source/mem_acc/trc_mem_acc_bufptr.cpp vendor/opencsd/dist/decoder/source/ocsd_dcd_tree.cpp vendor/opencsd/dist/decoder/source/ocsd_error.cpp vendor/opencsd/dist/decoder/source/ptm/trc_pkt_decode_ptm.cpp vendor/opencsd/dist/decoder/source/stm/trc_pkt_decode_stm.cpp vendor/opencsd/dist/decoder/source/trc_component.cpp vendor/opencsd/dist/decoder/source/trc_core_arch_map.cpp vendor/opencsd/dist/decoder/source/trc_gen_elem.cpp vendor/opencsd/dist/decoder/tests/auto-fdo/autofdo.md vendor/opencsd/dist/decoder/tests/perf-test-scripts/perf-setup-env.bash vendor/opencsd/dist/decoder/tests/run_pkt_decode_tests.bash Modified: vendor/opencsd/dist/HOWTO.md ============================================================================== --- vendor/opencsd/dist/HOWTO.md Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/HOWTO.md Mon Jun 15 11:30:04 2020 (r362193) @@ -4,37 +4,39 @@ HOWTO - using the library with perf {#howto_perf} @brief Using command line perf and OpenCSD to collect and decode trace. This HOWTO explains how to use the perf cmd line tools and the openCSD -library to collect and extract program flow traces generated by the +library to collect and extract program flow traces generated by the CoreSight IP blocks on a Linux system. The examples have been generated using -an aarch64 Juno-r0 platform. All information is considered accurate and tested -using the latest version of the library and the `master` branch on the -[perf-opencsd github repository][1]. +an aarch64 Juno-r0 platform. On Target Trace Acquisition - Perf Record ----------------------------------------- -All the enhancement to the Perf tools that support the new `cs_etm` pmu have -not been upstreamed yet. To get the required functionality branch -`perf-opencsd-master` needs to be downloaded to the target system where -traces are to be collected. This branch is a vanilla upstream kernel -supplemented with modifications to the CoreSight framework and drivers to be -usable by the Perf core. The remaining out of tree patches are being -upstreamed incrementally. -From there compiling the perf tools with `make -C tools/perf CORESIGHT=1` will -yield a `perf` executable that will support CoreSight trace collection. Note -that if traces are to be decompressed *off* target, there is no need to download +Compile the perf tool from the same kernel source code version you are using with: + + make -C tools/perf + +This will yield a `perf` executable that will support CoreSight trace collection. + +*Note:* If traces are to be decompressed **off** target, there is no need to download and compile the openCSD library (on the target). +If you are instead planning to use perf to record and decode the trace on the target, +compile the perf tool linking against the openCSD library, in the following way: + + make -C tools/perf VF=1 CORESIGHT=1 + +Further information on the needed build environments and options are detailed later +in the section **Off Target Perf Tools Compilation**. + Before launching a trace run a sink that will collect trace data needs to be identified. All CoreSight blocks identified by the framework are registed in sysFS: linaro@linaro-nano:~$ ls /sys/bus/coresight/devices/ - 20010000.etf 20040000.main_funnel 22040000.etm 22140000.etm - 230c0000.A53_funnel 23240000.etm replicator@20020000 20030000.tpiu - 20070000.etr 220c0000.A57_funnel 23040000.etm 23140000.etm 23340000.etm + etm0 etm2 etm4 etm6 funnel0 funnel2 funnel4 stm0 tmc_etr0 + etm1 etm3 etm5 etm7 funnel1 funnel3 replicator0 tmc_etf0 CoreSight blocks are listed in the device tree for a specific system and @@ -43,7 +45,7 @@ the sink that will recieve trace data needs to be iden option on the perf command line. Once a sink has been identify trace collection can start. An easy and yet interesting example is the `uname` command: - linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -e cs_etm/@20070000.etr/ --per-thread uname + linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -e cs_etm/@tmc_etr0/ --per-thread uname This will generate a `perf.data` file where execution has been traced for both user and kernel space. To narrow the field to either user or kernel space the @@ -51,7 +53,7 @@ user and kernel space. To narrow the field to either traces to user space: - linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -vvv -e cs_etm/@20070000.etr/u --per-thread uname + linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -vvv -e cs_etm/@tmc_etr0/u --per-thread uname Problems setting modules path maps, continuing anyway... ----------------------------------------------------------- perf_event_attr: @@ -131,9 +133,9 @@ falls within the specified range. Any work done by th range will not be traced. Address range filters can be specified for both user and kernel space session: - perf record -e cs_etm/@20070000.etr/k --filter 'filter 0xffffff8008562d0c/0x48' --per-thread uname + perf record -e cs_etm/@tmc_etr0/k --filter 'filter 0xffffff8008562d0c/0x48' --per-thread uname - perf record -e cs_etm/@20070000.etr/u --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main + perf record -e cs_etm/@tmc_etr0/u --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main When dealing with kernel space trace addresses are typically taken in the 'System.map' file. In user space addresses are relocatable and can be @@ -171,20 +173,20 @@ equal to the start address. Incidentally traces stop insruction pointer is equal to the stop address. Anything that happens between there to events is traced: - perf record -e cs_etm/@20070000.etr/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0' --per-thread uname + perf record -e cs_etm/@tmc_etr0/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0' --per-thread uname - perf record -vvv -e cs_etm/@20070000.etr/u --filter 'start 0x72c@/opt/lib/libcstest.so.1.0, \ + perf record -vvv -e cs_etm/@tmc_etr0/u --filter 'start 0x72c@/opt/lib/libcstest.so.1.0, \ stop 0x40082c@/home/linaro/main' \ - --per-thread ./main + --per-thread ./main **Limitation on address filters:** The only limitation on address filters is the amount of address comparator found on an implementation and the mutual exclusion between range and start stop filters. As such the following example would _not_ work: - perf record -e cs_etm/@20070000.etr/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0, \ // start/stop + perf record -e cs_etm/@tmc_etr0/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0, \ // start/stop filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' \ // address range - --per-thread uname + --per-thread uname Additional Trace Options ------------------------ @@ -198,10 +200,32 @@ Presently this threshold is fixed at 256 cycles for `p Command line options in `perf record` to use these features are part of the options for the `cs_etm` event: - perf record -e cs_etm/timestamp,cycacc,@20070000.etr/ --per-thread uname + perf record -e cs_etm/timestamp,cycacc,@tmc_etr0/ --per-thread uname At current version, `perf record` and `perf script` do not use this additional information. +The cs_etm perf event +--------------------- + +System information for this perf pmu event can be found at: + + /sys/devices/cs_etm + +This contains internal format of the parameters described above: + + root@linaro-developer:~# ls /sys/devices/cs_etm/format + contextid cycacc retstack sinkid timestamp + +and names of registered sinks: + + root@linaro-developer:~# ls /sys/devices/cs_etm/sinks + tmc_etf0 tmc_etr0 tpiu0 + +Note: The `sinkid` parameter is there to document the usage of a 32-bit internal parameter to +pass the sink name used in the cs_etm/@sink/ command to the kernel drivers. It can be used +directly as cs_etm/sinkid=/ but this is not recommended as the values used are +considered opaque and subject to changes. + On Target Trace Collection -------------------------- The entire program flow will have been recorded in the `perf.data` file. @@ -248,7 +272,7 @@ The openCSD library is not part of the perf tools. It [github][1] and needs to be compiled before the perf tools. Checkout the required branch/tag version into a local directory. - linaro@t430:~/linaro/coresight$ git clone -b v0.8 https://github.com/Linaro/OpenCSD.git my-opencsd + linaro@t430:~/linaro/coresight$ git clone https://github.com/Linaro/OpenCSD.git my-opencsd Cloning into 'OpenCSD'... remote: Counting objects: 2063, done. remote: Total 2063 (delta 0), reused 0 (delta 0), pack-reused 2063 @@ -301,7 +325,8 @@ distribution without having to be compiled. Off Target Perf Tools Compilation --------------------------------- -As mentionned above the openCSD library is not part of the perf tools' code base + +As mentioned above the openCSD library is not part of the perf tools' code base and needs to be installed on a system prior to compilation. Information about the status of the openCSD library on a system is given at compile time by the perf tools build script: @@ -366,8 +391,8 @@ output as follows:- Set to any other value will remove the RAW_PACKED lines. -Working with a debug version of the openCSD library ---------------------------------------------------- +Working with an alternate version of the openCSD library +-------------------------------------------------------- When compiling the perf tools it is possible to reference another version of the openCSD library than the one installed on the system. This is useful when working with multiple development trees or having the desire to keep system @@ -407,10 +432,14 @@ where the perf tools and openCSD library have been com -rw------- 1 linaro linaro 78016 Feb 24 12:21 perf.data -rw-rw-r-- 1 linaro linaro 1245881 Feb 24 12:25 uname.v4.user.sept20.tgz -Perf is expecting files related to the trace capture (`perf.data`) to be located -under `~/.debug` [3]. This example will remove the current `~/.debug` directory -to be sure everything is clean. +Perf is expecting files related to the trace capture (`perf.data`) to be located in the `buildid` directory. +By default this is under `~/.debug`. Alternatively the default `buildid` directory can be changed +using the command: + perf config --system buildid.dir=/my/own/buildid/dir + +This example will remove the current `~/.debug` directory to be sure everything is clean. + linaro@t430:~/linaro/coresight/sept20$ rm -rf ~/.debug linaro@t430:~/linaro/coresight/sept20$ cp -dpR .debug ~/ linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf report --stdio @@ -586,12 +615,18 @@ Use as follows:- 1. Prior to building perf, edit `perf-setup-env.bash` to conform to your environment. There are four lines at the top of the file that will require editing. -2. Execute the script using the command +2. Execute the script using the command: source perf-setup-env.bash - This will set up all the environment variables mentioned in the sections on building and running - perf above, and these are used by the `perf-test...` scripts to run the tests. + This will set up a perf execute environment for using the perf report and script commands. + + Alternatively use the command: + + source perf-setup-env.base buildenv + + This will add in the build environment variables mentioned in the sections on building above alongside the + environment for using the used by the `perf-test...` scripts to run the tests. 3. Build perf as described above. 4. Follow the instructions for downloading the test capture, or create a capture from your target. @@ -629,8 +664,6 @@ Best regards, *The Linaro CoreSight Team* -------------------------------------- -[1]: https://github.com/Linaro/perf-opencsd "perf-opencsd Github" +[1]: https://github.com/Linaro/OpenCSD [2]: http://people.linaro.org/~mathieu.poirier/openCSD/uname.v4.user.sept20.tgz - -[3]: Get in touch with us if you know a way to change this. Modified: vendor/opencsd/dist/README.md ============================================================================== --- vendor/opencsd/dist/README.md Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/README.md Mon Jun 15 11:30:04 2020 (r362193) @@ -27,11 +27,11 @@ Releases will appear on the master branch in the git r CoreSight Trace Component Support. ---------------------------------- -_Current Version 0.12.0_ +_Current Version 0.14.2_ ### Current support: -- ETMv4 (v4.4) instruction trace - packet processing and packet decode. +- ETMv4 (v4.5 [A/R profile] v4.4 [M profile]) instruction trace - packet processing and packet decode. - PTM (v1.1) instruction trace - packet processing and packet decode. - ETMv3 (v3.5) instruction trace - packet processing and packet decode. - ETMv3 (v3.5) data trace - packet processing. @@ -55,13 +55,12 @@ Note on the Git Repository. This git repository for OpenCSD contains only source for the OpenCSD decoder library. From version 0.4, releases appear as versioned tags on the master branch. -From version 0.7.4, the required updates to CoreSight drivers and perf, that are not -currently upstream in the linux kernel tree, are now contained in a separate -repository to be found at: +CoreSight kernel drivers and perf suport for CoreSight trace is maintained in the latest +upstream kernel versions. -https://github.com/Linaro/perf-opencsd +One exception is a minor patch required for autoFDO support. +See [autofdo.md](@ref AutoFDO). - Documentation ------------- @@ -142,29 +141,75 @@ Version and Modification Information AutoFDO: update documentation for AutoFDO usage and add in "record.sh" script - _Version 0.9.3_: Bugfix: Test snapshot library not handling 'offset' parameters in dump file sections. Install: ocsd_if_version.h moved to opencsd/include to allow installation on OS & use in compiling client apps. -- _Version 0.10.0_: __Updates__: Add additional information about the last instruction to the generic output packet. - __Docs__: update docs for updated output packet. - __Bugfix__: typecast removed from OCSD_VER_NUM in ocsd_if_version.h to allow use in C pre-processor. - __Bugfix__: ETMV4: Interworking ISA change between A32-T32 occasionally missed during instruction decode. -- _Version 0.10.1_: __Updates__: Build update - allow multi-thread make (make -j). - __Docs__: Minor update to AutoFDO documentation. -- _Version 0.11.0_: __Update__: ETM v4 decoder updated to support ETM version up to v4.4 - __Update__: Memory access callback function - added new callback signature to provide TraceID to client when requesting memory. - __Update__: Created new example program to demonstrate using memory buffer in APIs. - __Bugfix__: Typos in docs and source. - __Bugfix__: Memory accessor - validate callback return values. -- _Version 0.11.1_: __Update__: build:- change -fpic to -fPIC to allow Debian build on sparc. - __Bugfix__: build:- remove unused variable -- _Version 0.11.2_: __Update__: docs:- HOWTO.md update to match new perf build requirements. - __Bugfix__: Minor spelling typos fixed. -- _Version 0.12.0_: __Update__: Frame deformatter - TPIU FSYNC and HSYNC support added. - __Update__: ETM v4: Bugfix & clarification on Exception trace handling. Where exception occurs at a branch target before any instructions - have been executed, the preferred return address is also the target address of the branch instruction. This case now includes as specific flag in - the packet. Additionally any context change associated with this target address was being applied incorrectly. - __Update__: Core / Architecture mapping to core names as used by test programs / snapshots updated to include additional recent ARM cores. - __Update__: Docs: Update to reflect new exception flag. Update test program example to reflect latest output. - __Bugfix__: ETM v4: Valid trace info packet was not handled correctly (0x01, 0x00). - __Bugfix__: ETM v4: Error messaging on commit stack overflow. +- _Version 0.10.0_: + - __Updates__: Add additional information about the last instruction to the generic output packet. + - __Docs__: update docs for updated output packet. + - __Bugfix__: typecast removed from OCSD_VER_NUM in ocsd_if_version.h to allow use in C pre-processor. + - __Bugfix__: ETMV4: Interworking ISA change between A32-T32 occasionally missed during instruction decode. + +- _Version 0.10.1_: + - __Updates__: Build update - allow multi-thread make (make -j). + - __Docs__: Minor update to AutoFDO documentation. + +- _Version 0.11.0_: + - __Update__: ETM v4 decoder updated to support ETM version up to v4.4 + - __Update__: Memory access callback function - added new callback signature to provide TraceID to client when requesting memory. + - __Update__: Created new example program to demonstrate using memory buffer in APIs. + - __Bugfix__: Typos in docs and source. + - __Bugfix__: Memory accessor - validate callback return values. + +- _Version 0.11.1_: + - __Update__: build:- change -fpic to -fPIC to allow Debian build on sparc. + - __Bugfix__: build:- remove unused variable + +- _Version 0.11.2_: + - __Update__: docs:- HOWTO.md update to match new perf build requirements. + - __Bugfix__: Minor spelling typos fixed. + +- _Version 0.12.0_: + - __Update__: Frame deformatter - TPIU FSYNC and HSYNC support added. + - __Update__: ETM v4: Bugfix & clarification on Exception trace handling. Where exception occurs at a branch target before any instructions + have been executed, the preferred return address is also the target address of the branch instruction. This case now includes as specific flag in + the packet. Additionally any context change associated with this target address was being applied incorrectly. + - _Update__: Core / Architecture mapping to core names as used by test programs / snapshots updated to include additional recent ARM cores. + - __Update__: Docs: Update to reflect new exception flag. Update test program example to reflect latest output. + - __Bugfix__: ETM v4: Valid trace info packet was not handled correctly (0x01, 0x00). + - __Bugfix__: ETM v4: Error messaging on commit stack overflow. + +- _Version 0.12.1_: + - __Update__: build: remove -g option from release build. + - __Update__: tests: Snapshots can now use generic arch+profile names rather than core names, e.g. ARMv8-A + - __Bugfix__: Instruction decode - v8.3 B[L]A{A|B}[Z] instructions mis-identified. + -__Bugfix__: Transition from A64 to A32 can be mis-decoded if the trace implementation represents the transition + as an individual address packet followed by a context packet. + +- _Version 0.12.2_: + - __Bugfix__: Clean up memory leaks. + - __Bugfix__: ETMv4: Ensure addressing history zeroed after TINFO. + - __Update__: Allow GCC version to be included in build output path. + - __Bugfix__: Packet printing update when WFI/WFE is P0 element. + +- _Version 0.13.x_ : Intermediate development version. + +- _Version 0.14.0_: + - __Update__: ETMv4 - decoder update & simplification to handle advanced trace features. + - __Update__: ETMv4 - decoder support for speculative trace. + - __Update__: Generic Elements: Additional information in EOT, UNSYNC, ON packets to give reason. + - __Update__: Memaccess: Add EL2 secure memory space flag. + - __Update__: Documentation: Updated for release changes and to reflect latest kernel version support for CoreSight. + - __Update__: Perf helper scripts updated to reflect latest build flow. + - __Bugfix__: Fix for component operational flag inputs. + +- _Version 0.14.1_: + - __Update__: ETMv4 - Add support for Q elements. + - __Bugfix__: build: fix logic issue for && operator. (github issue #23, sumitted by yabinc) + +- _Version 0.14.2_: + - __Update__: Architecture versioning. Set enum tag values to make conversion to numeric version easier. + - __Update__: I-decode: remove global temporary decode state data and replace with local instance data + to make library more easily usable in multi-threaded programs. + - __Bugfix__: I-decode: Some Thumb instructions not correctly reported as implied returns. + (github issue #24, submitted by kongy). Licence Information Modified: vendor/opencsd/dist/decoder/build/linux/makefile ============================================================================== --- vendor/opencsd/dist/decoder/build/linux/makefile Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/build/linux/makefile Mon Jun 15 11:30:04 2020 (r362193) @@ -70,8 +70,8 @@ INSTALL_BIN_DIR=$(PREFIX)/bin export INSTALL_INCLUDE_DIR=$(PREFIX)/include/ # compile flags -CFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -fPIC -CXXFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -fPIC -std=c++11 +CFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -Wlogical-op -fPIC +CXXFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -Wlogical-op -fPIC -std=c++11 LDFLAGS += -Wl,-z,defs ARFLAGS ?= rcs @@ -81,8 +81,8 @@ CFLAGS += -g -O0 -DDEBUG CXXFLAGS += -g -O0 -DDEBUG BUILD_VARIANT=dbg else -CFLAGS += -g -O2 -DNDEBUG -CXXFLAGS += -g -O2 -DNDEBUG +CFLAGS += -O2 -DNDEBUG +CXXFLAGS += -O2 -DNDEBUG BUILD_VARIANT=rel endif Modified: vendor/opencsd/dist/decoder/build/linux/makefile.dev ============================================================================== --- vendor/opencsd/dist/decoder/build/linux/makefile.dev Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/build/linux/makefile.dev Mon Jun 15 11:30:04 2020 (r362193) @@ -56,7 +56,12 @@ CXXFLAGS += $(MFLAG) CFLAGS += $(MFLAG) LDFLAGS += $(MFLAG) +ifdef GCCDIR +GCCVER:= $(shell $(CROSS_COMPILE)gcc -dumpversion | cut -c 1-3) +PLAT_DIR=builddir/linux$(BIT_VARIANT)/GCC_$(GCCVER) +else PLAT_DIR=linux$(BIT_VARIANT)/$(BUILD_VARIANT) +endif # include the main makefile include makefile Modified: vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/makefile ============================================================================== --- vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/makefile Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/makefile Mon Jun 15 11:30:04 2020 (r362193) @@ -59,11 +59,9 @@ ETMV3OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv3.o \ $(BUILD_DIR)/trc_pkt_proc_etmv3_impl.o ETMV4OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv4.o \ - $(BUILD_DIR)/trc_pkt_proc_etmv4.o \ - $(BUILD_DIR)/trc_pkt_proc_etmv4i_impl.o \ + $(BUILD_DIR)/trc_pkt_proc_etmv4i.o \ $(BUILD_DIR)/trc_pkt_decode_etmv4i.o \ $(BUILD_DIR)/trc_pkt_elem_etmv4i.o \ - $(BUILD_DIR)/trc_pkt_elem_etmv4d.o \ $(BUILD_DIR)/trc_etmv4_stack_elem.o PTMOBJ= $(BUILD_DIR)/trc_cmp_cfg_ptm.o \ @@ -94,6 +92,7 @@ OBJECTS=$(BUILD_DIR)/ocsd_code_follower.o \ $(BUILD_DIR)/ocsd_error.o \ $(BUILD_DIR)/ocsd_error_logger.o \ $(BUILD_DIR)/ocsd_gen_elem_list.o \ + $(BUILD_DIR)/ocsd_gen_elem_stack.o \ $(BUILD_DIR)/ocsd_lib_dcd_register.o \ $(BUILD_DIR)/ocsd_msg_logger.o \ $(BUILD_DIR)/ocsd_version.o \ Modified: vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj ============================================================================== --- vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj Mon Jun 15 11:30:04 2020 (r362193) @@ -323,6 +323,7 @@ + @@ -400,8 +401,6 @@ - - @@ -413,10 +412,8 @@ - - - + @@ -430,6 +427,7 @@ + Modified: vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters ============================================================================== --- vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters Mon Jun 15 11:30:04 2020 (r362193) @@ -221,12 +221,6 @@ Header Files\ptm - - Source Files\etmv4 - - - Source Files\etmv4 - Source Files\etmv3 @@ -359,6 +353,9 @@ Header Files + + Header Files\common + @@ -385,18 +382,9 @@ Source Files\ptm - - Source Files\etmv4 - Source Files\etmv4 - - Source Files\etmv4 - - - Source Files\etmv4 - Source Files\etmv4 @@ -489,6 +477,12 @@ Source Files\mem_acc + + + Source Files\etmv4 + + + Source Files \ No newline at end of file Modified: vendor/opencsd/dist/decoder/docs/doxygen_config.dox ============================================================================== --- vendor/opencsd/dist/decoder/docs/doxygen_config.dox Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/docs/doxygen_config.dox Mon Jun 15 11:30:04 2020 (r362193) @@ -38,7 +38,7 @@ PROJECT_NAME = "OpenCSD - CoreSight Trace De # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.10.0 +PROJECT_NUMBER = 0.14.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a Modified: vendor/opencsd/dist/decoder/docs/prog_guide/prog_guide_generic_pkts.md ============================================================================== --- vendor/opencsd/dist/decoder/docs/prog_guide/prog_guide_generic_pkts.md Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/docs/prog_guide/prog_guide_generic_pkts.md Mon Jun 15 11:30:04 2020 (r362193) @@ -83,7 +83,7 @@ typedef struct _ocsd_generic_trace_elem { trace_on_reason_t trace_on_reason; /* reason for the trace on packet */ ocsd_swt_info_t sw_trace_info; /* software trace packet info */ uint32_t num_instr_range; /* number of instructions covered by range packet (for T32 this cannot be calculated from en-st/i_size) */ - + unsync_info_t unsync_eot_info; /* additional information for unsync / end-of-trace packets. */ }; const void *ptr_extended_data; /* pointer to extended data buffer (data trace, sw trace payload) / custom structure */ @@ -140,6 +140,19 @@ instruction by subtraction from `en_addr`. This value __ETMv3, PTM__ : These protocols can output a cycle count directly as part of the trace packet that generates the trace range. In this case `has_cc` will be 1 and `cycle_count` will be valid. + + +### OCSD_GEN_TRC_ELEM_I_RANGE_NOPATH ### +__packet fields valid__: `isa, st_addr, en_addr, num_instr_range` + +`num_instr_range` represents the number of instructions executed in this range, but there is incomplete information +as to program execution path from start to end of range. +If `num_instr` is 0, then an unknown number of instructions were executed between the start and end of the range. +`st_addr` represents the start of execution represented by this packet. +`en_addr` represents the address where execution will continue from after the instructions represented by this packet. +`isa` represents the ISA for the instruction at `en_addr`. + +Used when ETMv4 Q elements are being traced. ### OCSD_GEN_TRC_ELEM_ADDR_NACC ### Modified: vendor/opencsd/dist/decoder/docs/test_progs.md ============================================================================== --- vendor/opencsd/dist/decoder/docs/test_progs.md Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/docs/test_progs.md Mon Jun 15 11:30:04 2020 (r362193) @@ -20,6 +20,9 @@ See [external_custom.md](@ref custom_decoders) for det These programs are both built at the same time as the library for the same set of platforms. See [build_libs.md](@ref build_lib) for build details. +_Note:_ The programs above use the library's [core name mapper helper class] (@ref CoreArchProfileMap) to map +the name of the core into a profile / architecture pair that the library can use. +The snapshot definition must use one of the names recognised by this class or an error will occur. Trace "Snapshot" directory. ---------------------------- Modified: vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr.h ============================================================================== --- vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr.h Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr.h Mon Jun 15 11:30:04 2020 (r362193) @@ -115,6 +115,9 @@ ocsd_err_t DecoderMngrBase::createDecoder(co if(!pkt_proc) return OCSD_ERR_MEM; + // set the op mode flags + pkt_proc->setComponentOpMode(create_flags & (OCSD_OPFLG_COMP_MODE_MASK | OCSD_OPFLG_PKTPROC_COMMON)); + // set the configuration TrcPktProcBase *pProcBase = dynamic_cast< TrcPktProcBase *>(pkt_proc); if(pProcBase == 0) @@ -132,6 +135,9 @@ ocsd_err_t DecoderMngrBase::createDecoder(co pkt_dcd = createPktDecode(bUseInstID, instID); if(!pkt_dcd) return OCSD_ERR_MEM; + + // set the op mode flags + pkt_dcd->setComponentOpMode(create_flags & (OCSD_OPFLG_COMP_MODE_MASK | OCSD_OPFLG_PKTDEC_COMMON)); // get the decoder base TrcPktDecodeBase *pBase = dynamic_cast< TrcPktDecodeBase *>(pkt_dcd); Modified: vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_list.h ============================================================================== --- vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_list.h Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_list.h Mon Jun 15 11:30:04 2020 (r362193) @@ -1,6 +1,6 @@ /* - * \file ocsd_gen_elem_stack.h - * \brief OpenCSD : Generic element output stack. + * \file ocsd_gen_elem_list.h + * \brief OpenCSD : Generic element output list. * * \copyright Copyright (c) 2016, ARM Limited. All Rights Reserved. */ @@ -47,7 +47,7 @@ * This should remove some of the requirement on the packet processing to be re-enterant, * simplifying this code. * - * Last element(s) on this stack can be marked pending to allow for later cancellation. + * Last element(s) on this list can be marked pending to allow for later cancellation. * (This required for cancel element in ETMv3 exeception branch). * * The "list" is actually a ring buffer - maintaining pointers to indicate current valid elements. @@ -150,4 +150,4 @@ inline void OcsdGenElemList::initSendIf(componentAttac m_sendIf = pGenElemIf; } -/* End of File ocsd_gen_elem_stack.h */ +/* End of File ocsd_gen_elem_list.h */ Added: vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_stack.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_stack.h Mon Jun 15 11:30:04 2020 (r362193) @@ -0,0 +1,109 @@ +/* +* \file ocsd_gen_elem_stack.h +* \brief OpenCSD : Generic element output stack. +* +* \copyright Copyright (c) 2020, ARM Limited. All Rights Reserved. +*/ + +/* +* Redistribution and use in source and binary forms, with or without modification, +* are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* +* 3. Neither the name of the copyright holder nor the names of its contributors +* may be used to endorse or promote products derived from this software without +* specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "trc_gen_elem.h" +#include "comp_attach_pt_t.h" +#include "interfaces/trc_gen_elem_in_i.h" + +/* element stack to handle cases where a trace element can generate multiple output packets + + maintains the "current" element, which might be sent independently of this stack, and also + ensures that persistent data in the output elements is maintained between elements. +*/ +class OcsdGenElemStack +{ +public: + OcsdGenElemStack(); + ~OcsdGenElemStack(); + + void initSendIf(componentAttachPt *pGenElemIf); + void initCSID(const uint8_t CSID) { m_CSID = CSID; }; + + OcsdTraceElement &getCurrElem(); //!< get the current element. + ocsd_err_t resetElemStack(); //!< set pointers to base of stack + ocsd_err_t addElem(const ocsd_trc_index_t trc_pkt_idx); //!< add elem to stack and set current. + void setCurrElemIdx(const ocsd_trc_index_t trc_pkt_idx); //!< packet index for this element + ocsd_err_t addElemType(const ocsd_trc_index_t trc_pkt_idx, ocsd_gen_trc_elem_t elem_type); + + ocsd_datapath_resp_t sendElements(); //!< send elements on the stack + const int numElemToSend() const; + +private: + typedef struct _elemPtr { + OcsdTraceElement *pElem; //!< pointer to the listed trace element + ocsd_trc_index_t trc_pkt_idx; //!< packet index in the trace stream + } elemPtr_t; + + const bool isInit(); //!< check correctly initialised. + + ocsd_err_t growArray(); + void copyPersistentData(int src, int dst); //!< copy across persistent state data between elements + void resetIndexes(); //!< clear down all indexes - reset or send complete. + + elemPtr_t *m_pElemArray; //!< an array of pointers to elements. + int m_elemArraySize; //!< number of element pointers in the array + + int m_elem_to_send; //!< number of live elements in the stack - init to 1. + int m_curr_elem_idx; //!< index into the element array. + int m_send_elem_idx; //!< next element to send. + + //!< send packet info + uint8_t m_CSID; + componentAttachPt *m_sendIf; //!< element send interface. + + bool m_is_init; +}; + +inline const int OcsdGenElemStack::numElemToSend() const +{ + return m_elem_to_send; +} + +inline void OcsdGenElemStack::initSendIf(componentAttachPt *pGenElemIf) +{ + m_sendIf = pGenElemIf; +} + +inline void OcsdGenElemStack::setCurrElemIdx(const ocsd_trc_index_t trc_pkt_idx) +{ + m_pElemArray[m_curr_elem_idx].trc_pkt_idx = trc_pkt_idx; +} + +inline OcsdTraceElement &OcsdGenElemStack::getCurrElem() +{ + return *(m_pElemArray[m_curr_elem_idx].pElem); +} + + +/* End of File ocsd_gen_elem_stack.h */ Modified: vendor/opencsd/dist/decoder/include/common/trc_core_arch_map.h ============================================================================== --- vendor/opencsd/dist/decoder/include/common/trc_core_arch_map.h Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/include/common/trc_core_arch_map.h Mon Jun 15 11:30:04 2020 (r362193) @@ -39,6 +39,23 @@ #include #include "opencsd/ocsd_if_types.h" +/** @class CoreArchProfileMap + * + * @brief Map core / arch name to profile for decoder. + * + * Helper class for library clients to map core or architecture version names onto + * a profile / arch version pair suitable for use with the decode library. + * + * Valid core names are:- + * - Cortex-Axx : where xx = 5,7,12,15,17,32,35,53,55,57,65,72,73,75,76,77; + * - Cortex-Rxx : where xx = 5,7,8,52; + * - Cortex-Mxx : where xx = 0,0+,3,4,23,33; + * + * Valid architecture profile names are:- + * - ARMv7-A, ARMv7-R, ARMv7-M; + * - ARMv8-A, ARMv8.3A, ARMv8-R, ARMv8-M; + * + */ class CoreArchProfileMap { public: @@ -50,16 +67,31 @@ class CoreArchProfileMap (public) private: std::map core_profiles; + std::map arch_profiles; }; inline ocsd_arch_profile_t CoreArchProfileMap::getArchProfile(const std::string &coreName) { ocsd_arch_profile_t ap = { ARCH_UNKNOWN, profile_Unknown }; + bool bFound = false; std::map::const_iterator it; + + /* match against the core name map. */ it = core_profiles.find(coreName); - if(it != core_profiles.end()) + if (it != core_profiles.end()) + { ap = it->second; + bFound = true; + } + + /* scan architecture profiles on no core name match */ + if (!bFound) + { + it = arch_profiles.find(coreName); + if (it != arch_profiles.end()) + ap = it->second; + } return ap; } Modified: vendor/opencsd/dist/decoder/include/common/trc_gen_elem.h ============================================================================== --- vendor/opencsd/dist/decoder/include/common/trc_gen_elem.h Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/include/common/trc_gen_elem.h Mon Jun 15 11:30:04 2020 (r362193) @@ -72,6 +72,7 @@ class OcsdTraceElement : public trcPrintableElem, publ void setTraceOnReason(const trace_on_reason_t reason); + void setUnSyncEOTReason(const unsync_info_t reason); void setAddrRange(const ocsd_vaddr_t st_addr, const ocsd_vaddr_t en_addr, const int num_instr = 1); void setLastInstrInfo(const bool exec, const ocsd_instr_type last_i_type, const ocsd_instr_subtype last_i_subtype, const uint8_t size); @@ -94,7 +95,8 @@ class OcsdTraceElement : public trcPrintableElem, publ // return current context const ocsd_pe_context &getContext() const { return context; }; - + void copyPersistentData(const OcsdTraceElement &src); + private: void printSWInfoPkt(std::ostringstream &oss) const; void clearPerPktData(); //!< clear flags that indicate validity / have values on a per packet basis @@ -171,8 +173,8 @@ inline void OcsdTraceElement::init() inline void OcsdTraceElement::clearPerPktData() { - flag_bits = 0; // union with trace_on_reason / trace_event - + flag_bits = 0; // bit-field with various flags. + exception_number = 0; // union with trace_on_reason / trace_event ptr_extended_data = 0; // extended data pointer } @@ -181,6 +183,11 @@ inline void OcsdTraceElement::setTraceOnReason(const t trace_on_reason = reason; } +inline void OcsdTraceElement::setUnSyncEOTReason(const unsync_info_t reason) +{ + unsync_eot_info = reason; +} + inline void OcsdTraceElement::setISA(const ocsd_isa isa_update) { isa = isa_update; @@ -201,6 +208,12 @@ inline void OcsdTraceElement::setExtendedDataPtr(const ptr_extended_data = data_ptr; } +// set persistent data between output packets. +inline void OcsdTraceElement::copyPersistentData(const OcsdTraceElement &src) +{ + isa = src.isa; + context = src.context; +} /** @}*/ Modified: vendor/opencsd/dist/decoder/include/common/trc_pkt_decode_base.h ============================================================================== --- vendor/opencsd/dist/decoder/include/common/trc_pkt_decode_base.h Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/include/common/trc_pkt_decode_base.h Mon Jun 15 11:30:04 2020 (r362193) @@ -85,7 +85,10 @@ class TrcPktDecodeI : public TraceComponent (protected virtual ocsd_err_t onProtocolConfig() = 0; virtual const uint8_t getCoreSightTraceID() = 0; + /* init handling */ const bool checkInit(); + /* Called on first init confirmation */ + virtual void onFirstInitOK() {}; /* data output */ ocsd_datapath_resp_t outputTraceElement(const OcsdTraceElement &elem); // use current index @@ -147,6 +150,8 @@ inline const bool TrcPktDecodeI::checkInit() init_err_msg = "No instruction decoder interface attached and enabled"; else m_decode_init_ok = true; + if (m_decode_init_ok) + onFirstInitOK(); } return m_decode_init_ok; } Added: vendor/opencsd/dist/decoder/include/common/trc_raw_buffer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/decoder/include/common/trc_raw_buffer.h Mon Jun 15 11:30:04 2020 (r362193) @@ -0,0 +1,96 @@ +/* +* \file trc_raw_buffer.h +* \brief OpenCSD : Trace raw data byte buffer +* +* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved. +*/ + +/* +* Redistribution and use in source and binary forms, with or without modification, +* are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* +* 3. Neither the name of the copyright holder nor the names of its contributors +* may be used to endorse or promote products derived from this software without +* specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ARM_TRC_RAW_BUFFER_H_INCLUDED +#define ARM_TRC_RAW_BUFFER_H_INCLUDED + +#include + +class TraceRawBuffer +{ +public: + TraceRawBuffer() : + m_bufSize(0), + m_bufProcessed(0), + m_pBuffer(0), + pkt(0) + {}; + ~TraceRawBuffer() {}; + + // init the buffer + void init(const uint32_t size, const uint8_t *rawtrace, std::vector *out_packet); + void copyByteToPkt(); // move a byte to the packet buffer + uint8_t peekNextByte(); // value of next byte in buffer. + + bool empty() { return m_bufProcessed == m_bufSize; }; + // bytes processed. + uint32_t processed() { return m_bufProcessed; }; + // buffer size; + uint32_t size() { return m_bufSize; } + +private: + uint32_t m_bufSize; + uint32_t m_bufProcessed; + const uint8_t *m_pBuffer; + std::vector *pkt; + +}; + +// init the buffer +inline void TraceRawBuffer::init(const uint32_t size, const uint8_t *rawtrace, std::vector *out_packet) +{ + m_bufSize = size; + m_bufProcessed = 0; + m_pBuffer = rawtrace; + pkt = out_packet; +} + +inline void TraceRawBuffer::copyByteToPkt() +{ + if (!empty()) { + pkt->push_back(m_pBuffer[m_bufProcessed]); + m_bufProcessed++; + } +} + +inline uint8_t TraceRawBuffer::peekNextByte() +{ + uint8_t val = 0; + if (!empty()) + val = m_pBuffer[m_bufProcessed]; + return val; +} + +#endif // ARM_TRC_RAW_BUFFER_H_INCLUDED + Modified: vendor/opencsd/dist/decoder/include/i_dec/trc_i_decode.h ============================================================================== --- vendor/opencsd/dist/decoder/include/i_dec/trc_i_decode.h Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/include/i_dec/trc_i_decode.h Mon Jun 15 11:30:04 2020 (r362193) @@ -46,10 +46,9 @@ class TrcIDecode : public IInstrDecode (public) virtual ocsd_err_t DecodeInstruction(ocsd_instr_info *instr_info); private: - ocsd_err_t DecodeA32(ocsd_instr_info *instr_info); - ocsd_err_t DecodeA64(ocsd_instr_info *instr_info); - ocsd_err_t DecodeT32(ocsd_instr_info *instr_info); - void SetArchVersion(ocsd_instr_info *instr_info); + ocsd_err_t DecodeA32(ocsd_instr_info *instr_info, struct decode_info *info); + ocsd_err_t DecodeA64(ocsd_instr_info *instr_info, struct decode_info *info); + ocsd_err_t DecodeT32(ocsd_instr_info *instr_info, struct decode_info *info); }; #endif // ARM_TRC_I_DECODE_H_INCLUDED Modified: vendor/opencsd/dist/decoder/include/i_dec/trc_idec_arminst.h ============================================================================== --- vendor/opencsd/dist/decoder/include/i_dec/trc_idec_arminst.h Mon Jun 15 11:29:31 2020 (r362192) +++ vendor/opencsd/dist/decoder/include/i_dec/trc_idec_arminst.h Mon Jun 15 11:30:04 2020 (r362193) @@ -42,6 +42,12 @@ #include "opencsd/ocsd_if_types.h" #include +/* supplementary decode information */ +struct decode_info { + uint16_t arch_version; + ocsd_instr_subtype instr_sub_type; +}; + /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 11:31:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 351FC3305F6; Mon, 15 Jun 2020 11:31:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lq0Z0klQz4SfL; Mon, 15 Jun 2020 11:31:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE9AE1CEAB; Mon, 15 Jun 2020 11:31:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FBVPgx083872; Mon, 15 Jun 2020 11:31:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FBVPrU083871; Mon, 15 Jun 2020 11:31:25 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006151131.05FBVPrU083871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Jun 2020 11:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362194 - vendor/opencsd/v0.14.2 X-SVN-Group: vendor X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: vendor/opencsd/v0.14.2 X-SVN-Commit-Revision: 362194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 11:31:26 -0000 Author: andrew Date: Mon Jun 15 11:31:25 2020 New Revision: 362194 URL: https://svnweb.freebsd.org/changeset/base/362194 Log: Tag OpenCSD v0.14.2 Added: vendor/opencsd/v0.14.2/ - copied from r362193, vendor/opencsd/dist/ From owner-svn-src-all@freebsd.org Mon Jun 15 12:33:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A392A332CBD; Mon, 15 Jun 2020 12:33:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49lrN61m4Jz4XSn; Mon, 15 Jun 2020 12:33:25 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05FCXN2I076563; Mon, 15 Jun 2020 05:33:23 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05FCXN4L076562; Mon, 15 Jun 2020 05:33:23 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006151233.05FCXN4L076562@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362191 - head/sbin/md5 In-Reply-To: <202006151008.05FA82YG031030@repo.freebsd.org> To: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Mon, 15 Jun 2020 05:33:23 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49lrN61m4Jz4XSn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 12:33:26 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: fernape (ports committer) > Date: Mon Jun 15 10:08:02 2020 > New Revision: 362191 > URL: https://svnweb.freebsd.org/changeset/base/362191 > > Log: > md5(1): fix style in man page > > Fix a bunch of style problems reported by mandoc(1) and igor: > > mandoc: ./md5.1:19:71: STYLE: no blank before trailing delimiter: Nm ... rmd160, > mandoc: ./md5.1:20:23: STYLE: no blank before trailing delimiter: Nm ... skein512, > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:33:2: STYLE: useless macro: Tn > mandoc: ./md5.1:35:2: STYLE: useless macro: Tn > mandoc: ./md5.1:42:2: STYLE: useless macro: Tn > mandoc: ./md5.1:45:2: STYLE: useless macro: Tn > mandoc: ./md5.1:47:2: STYLE: useless macro: Tn > mandoc: ./md5.1:56:2: STYLE: useless macro: Tn > mandoc: ./md5.1:58:2: STYLE: useless macro: Tn > mandoc: ./md5.1:61:2: STYLE: useless macro: Tn > mandoc: ./md5.1:66:2: STYLE: useless macro: Tn > mandoc: ./md5.1:68:2: STYLE: useless macro: Tn Mandoc is fine to ignore this, but it is wrong to call it useless. I really wish that this stop. .Tn might be useless to mandoc, but it is a very usable thing if your formatting to something other than txt, as in a ps or pdf. > mandoc: ./md5.1:104:24: STYLE: no blank before trailing delimiter: Nm skein512, > mandoc: ./md5.1:117:6: STYLE: referenced manual not found: Xr sha224 3 > > igor: > md5.1:46:no comma after "i.e.":either algorithm, [i.e.] to find an input that produces a specific > > Approved by: bcr@ > Differential Revision: https://reviews.freebsd.org/D25277 > > Modified: > head/sbin/md5/md5.1 > > Modified: head/sbin/md5/md5.1 > ============================================================================== > --- head/sbin/md5/md5.1 Mon Jun 15 03:10:53 2020 (r362190) > +++ head/sbin/md5/md5.1 Mon Jun 15 10:08:02 2020 (r362191) > @@ -1,5 +1,5 @@ > .\" $FreeBSD$ > -.Dd July 9, 2018 > +.Dd June 15, 2020 > .Dt MD5 1 > .Os > .Sh NAME > @@ -16,8 +16,8 @@ > (All other hashes have the same options and usage.) > .Sh DESCRIPTION > The > -.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512, sha512t256, rmd160, > -.Nm skein256, skein512, > +.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t256 , rmd160 , > +.Nm skein256 , skein512 , > and > .Nm skein1024 > utilities take as input a message of arbitrary length and produce as > @@ -29,43 +29,29 @@ of the input. > It is conjectured that it is computationally infeasible to > produce two messages having the same message digest, or to produce any > message having a given prespecified target message digest. > -The > -.Tn SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, > -and > -.Tn SKEIN > +The SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, > +and SKEIN > algorithms are intended for digital signature applications, where a > large file must be > .Dq compressed > in a secure manner before being encrypted with a private > (secret) > -key under a public-key cryptosystem such as > -.Tn RSA . > +key under a public-key cryptosystem such as RSA. > .Pp > -The > -.Tn MD5 > -and > -.Tn SHA-1 > -algorithms have been proven to be vulnerable to practical collision > -attacks and should not be relied upon to produce unique outputs, > +The MD5 and SHA-1 algorithms have been proven to be vulnerable to practical > +collision attacks and should not be relied upon to produce unique outputs, > .Em nor should they be used as part of a cryptographic signature scheme. > As of 2017-03-02, there is no publicly known method to > .Em reverse > -either algorithm, i.e. to find an input that produces a specific > +either algorithm, i.e., to find an input that produces a specific > output. > .Pp > -.Tn SHA-512t256 > -is a version of > -.Tn SHA-512 > -truncated to only 256 bits. > -On 64-bit hardware, this algorithm is approximately 50% faster than > -.Tn SHA-256 > -but with the same level of security. > +SHA-512t256 is a version of SHA-512 truncated to only 256 bits. > +On 64-bit hardware, this algorithm is approximately 50% faster than SHA-256 but > +with the same level of security. > The hashes are not interchangeable. > .Pp > -It is recommended that all new applications use > -.Tn SHA-512 > -or > -.Tn SKEIN-512 > +It is recommended that all new applications use SHA-512 or SKEIN-512 > instead of one of the other hash functions. > .Pp > The following options may be used in any combination and must > @@ -101,7 +87,7 @@ Run a built-in test script. > .Sh EXIT STATUS > The > .Nm md5 , sha1 , sha224 , sha256 , sha512 , sha512t256 , rmd160 , > -.Nm skein256 , skein512, > +.Nm skein256 , skein512 , > and > .Nm skein1024 > utilities exit 0 on success, > @@ -114,7 +100,6 @@ option. > .Xr md5 3 , > .Xr ripemd 3 , > .Xr sha 3 , > -.Xr sha224 3 , > .Xr sha256 3 , > .Xr sha384 3 , > .Xr sha512 3 , > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Jun 15 13:03:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3B5433365C; Mon, 15 Jun 2020 13:03:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ls2F47SDz4YkC; Mon, 15 Jun 2020 13:03:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 701501E0B3; Mon, 15 Jun 2020 13:03:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FD319e041938; Mon, 15 Jun 2020 13:03:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FD31Bs041937; Mon, 15 Jun 2020 13:03:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006151303.05FD31Bs041937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Jun 2020 13:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362195 - head/contrib/opencsd X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/contrib/opencsd X-SVN-Commit-Revision: 362195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 13:03:01 -0000 Author: andrew Date: Mon Jun 15 13:03:01 2020 New Revision: 362195 URL: https://svnweb.freebsd.org/changeset/base/362195 Log: Bootstrap mergeinfo for OpenCSD Sponsored by: Innovate UK Modified: Directory Properties: head/contrib/opencsd/ (props changed) From owner-svn-src-all@freebsd.org Mon Jun 15 13:17:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF92D333D0F; Mon, 15 Jun 2020 13:17:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lsLq4zwCz4ZDH; Mon, 15 Jun 2020 13:17:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A63BE1E39C; Mon, 15 Jun 2020 13:17:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FDHNFl048678; Mon, 15 Jun 2020 13:17:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FDHMrG048673; Mon, 15 Jun 2020 13:17:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006151317.05FDHMrG048673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Jun 2020 13:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362196 - in vendor: NetBSD/blacklist blocklist blocklist/dist/bin blocklist/dist/etc blocklist/dist/etc/rc.d blocklist/dist/include blocklist/dist/lib blocklist/dist/libexec X-SVN-Group: vendor X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in vendor: NetBSD/blacklist blocklist blocklist/dist/bin blocklist/dist/etc blocklist/dist/etc/rc.d blocklist/dist/include blocklist/dist/lib blocklist/dist/libexec X-SVN-Commit-Revision: 362196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 13:17:23 -0000 Author: emaste Date: Mon Jun 15 13:17:22 2020 New Revision: 362196 URL: https://svnweb.freebsd.org/changeset/base/362196 Log: Following upstream, rename blacklist to blocklist Also move up one level from vendor/NetBSD/blacklist to vendor/blocklist, as this is now has a standalone home at https://github.com/zoulasc/blocklist I also renamed the individual files under dist/ so that the subsequent update from upstream will drop in. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Added: vendor/blocklist/ - copied from r362195, vendor/NetBSD/blacklist/ vendor/blocklist/dist/bin/blocklistctl.8 - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistctl.8 vendor/blocklist/dist/bin/blocklistctl.c - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistctl.c vendor/blocklist/dist/bin/blocklistd.8 - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistd.8 vendor/blocklist/dist/bin/blocklistd.c - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistd.c vendor/blocklist/dist/bin/blocklistd.conf.5 - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistd.conf.5 vendor/blocklist/dist/etc/blocklistd.conf - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/etc/blacklistd.conf vendor/blocklist/dist/etc/rc.d/blocklistd - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/etc/rc.d/blacklistd vendor/blocklist/dist/include/blocklist.h - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/include/blacklist.h vendor/blocklist/dist/lib/blocklist.c - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/lib/blacklist.c vendor/blocklist/dist/lib/libblocklist.3 - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/lib/libblacklist.3 vendor/blocklist/dist/libexec/blocklistd-helper - copied unchanged from r362194, vendor/NetBSD/blacklist/dist/libexec/blacklistd-helper Deleted: vendor/NetBSD/blacklist/ vendor/blocklist/dist/bin/blacklistctl.8 vendor/blocklist/dist/bin/blacklistctl.c vendor/blocklist/dist/bin/blacklistd.8 vendor/blocklist/dist/bin/blacklistd.c vendor/blocklist/dist/bin/blacklistd.conf.5 vendor/blocklist/dist/etc/blacklistd.conf vendor/blocklist/dist/etc/rc.d/blacklistd vendor/blocklist/dist/include/blacklist.h vendor/blocklist/dist/lib/blacklist.c vendor/blocklist/dist/lib/libblacklist.3 vendor/blocklist/dist/libexec/blacklistd-helper Copied: vendor/blocklist/dist/bin/blocklistctl.8 (from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistctl.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/dist/bin/blocklistctl.8 Mon Jun 15 13:17:22 2020 (r362196, copy of r362194, vendor/NetBSD/blacklist/dist/bin/blacklistctl.8) @@ -0,0 +1,86 @@ +.\" $NetBSD: blacklistctl.8,v 1.9 2016/06/08 12:48:37 wiz Exp $ +.\" +.\" Copyright (c) 2015 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Christos Zoulas. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd June 7, 2016 +.Dt BLACKLISTCTL 8 +.Os +.Sh NAME +.Nm blacklistctl +.Nd display and change the state of blacklistd +.Sh SYNOPSIS +.Nm +.Cm dump +.Op Fl abdnrw +.Sh DESCRIPTION +.Nm +is a program used to display the state of +.Xr blacklistd 8 +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl a +Show all database entries, by default it shows only the embryonic ones. +.It Fl b +Show only the blocked entries. +.It Fl d +Increase debugging level. +.It Fl n +Don't display a header. +.It Fl r +Show the remaining blocked time instead of the last activity time. +.It Fl w +Normally the width of addresses is good for IPv4, the +.Fl w +flag, makes the display wide enough for IPv6 addresses. +.El +.Sh SEE ALSO +.Xr blacklistd 8 +.Sh NOTES +Sometimes the reported number of failed attempts can exceed the number +of attempts that +.Xr blacklistd 8 +is configured to block. +This can happen either because the rule has been removed manually, or +because there were more attempts in flight while the rule block was being +added. +This condition is normal; in that case +.Xr blacklistd 8 +will first attempt to remove the existing rule, and then it will re-add +it to make sure that there is only one rule active. +.Sh HISTORY +.Nm +first appeared in +.Nx 7 . +.Fx +support for +.Nm +was implemented in +.Fx 11 . +.Sh AUTHORS +.An Christos Zoulas Copied: vendor/blocklist/dist/bin/blocklistctl.c (from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistctl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/dist/bin/blocklistctl.c Mon Jun 15 13:17:22 2020 (r362196, copy of r362194, vendor/NetBSD/blacklist/dist/bin/blacklistctl.c) @@ -0,0 +1,168 @@ +/* $NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $ */ + +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +__RCSID("$NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $"); + +#include +#include +#ifdef HAVE_LIBUTIL_H +#include +#endif +#ifdef HAVE_UTIL_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "conf.h" +#include "state.h" +#include "internal.h" +#include "support.h" + +static __dead void +usage(int c) +{ + if (c == 0) + warnx("Missing/unknown command"); + else + warnx("Unknown option `%c'", (char)c); + fprintf(stderr, "Usage: %s dump [-abdnrw]\n", getprogname()); + exit(EXIT_FAILURE); +} + +static const char * +star(char *buf, size_t len, int val) +{ + if (val == -1) + return "*"; + snprintf(buf, len, "%d", val); + return buf; +} + +int +main(int argc, char *argv[]) +{ + const char *dbname = _PATH_BLSTATE; + DB *db; + struct conf c; + struct dbinfo dbi; + unsigned int i; + struct timespec ts; + int all, blocked, remain, wide, noheader; + int o; + + noheader = wide = blocked = all = remain = 0; + lfun = dlog; + + if (argc == 1 || strcmp(argv[1], "dump") != 0) + usage(0); + + argc--; + argv++; + + while ((o = getopt(argc, argv, "abD:dnrw")) != -1) + switch (o) { + case 'a': + all = 1; + blocked = 0; + break; + case 'b': + blocked = 1; + break; + case 'D': + dbname = optarg; + break; + case 'd': + debug++; + break; + case 'n': + noheader = 1; + break; + case 'r': + remain = 1; + break; + case 'w': + wide = 1; + break; + default: + usage(o); + break; + } + + db = state_open(dbname, O_RDONLY, 0); + if (db == NULL) + err(EXIT_FAILURE, "Can't open `%s'", dbname); + + clock_gettime(CLOCK_REALTIME, &ts); + wide = wide ? 8 * 4 + 7 : 4 * 3 + 3; + if (!noheader) + printf("%*.*s/ma:port\tid\tnfail\t%s\n", wide, wide, + "address", remain ? "remaining time" : "last access"); + for (i = 1; state_iterate(db, &c, &dbi, i) != 0; i = 0) { + char buf[BUFSIZ]; + char mbuf[64], pbuf[64]; + if (!all) { + if (blocked) { + if (c.c_nfail == -1 || dbi.count < c.c_nfail) + continue; + } else { + if (dbi.count >= c.c_nfail) + continue; + } + } + sockaddr_snprintf(buf, sizeof(buf), "%a", (void *)&c.c_ss); + printf("%*.*s/%s:%s\t", wide, wide, buf, + star(mbuf, sizeof(mbuf), c.c_lmask), + star(pbuf, sizeof(pbuf), c.c_port)); + if (c.c_duration == -1) { + strlcpy(buf, "never", sizeof(buf)); + } else { + if (remain) + fmtydhms(buf, sizeof(buf), + c.c_duration - (ts.tv_sec - dbi.last)); + else + fmttime(buf, sizeof(buf), dbi.last); + } + printf("%s\t%d/%s\t%-s\n", dbi.id, dbi.count, + star(mbuf, sizeof(mbuf), c.c_nfail), buf); + } + state_close(db); + return EXIT_SUCCESS; +} Copied: vendor/blocklist/dist/bin/blocklistd.8 (from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistd.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/dist/bin/blocklistd.8 Mon Jun 15 13:17:22 2020 (r362196, copy of r362194, vendor/NetBSD/blacklist/dist/bin/blacklistd.8) @@ -0,0 +1,227 @@ +.\" $NetBSD: blacklistd.8,v 1.18 2016/07/30 06:09:29 dholland Exp $ +.\" +.\" Copyright (c) 2015 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Christos Zoulas. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd June 7, 2016 +.Dt BLACKLISTD 8 +.Os +.Sh NAME +.Nm blacklistd +.Nd block and release ports on demand to avoid DoS abuse +.Sh SYNOPSIS +.Nm +.Op Fl dfrv +.Op Fl C Ar controlprog +.Op Fl c Ar configfile +.Op Fl D Ar dbfile +.Op Fl P Ar sockpathsfile +.Op Fl R Ar rulename +.Op Fl s Ar sockpath +.Op Fl t Ar timeout +.Sh DESCRIPTION +.Nm +is a daemon similar to +.Xr syslogd 8 +that listens to sockets at paths specified in the +.Ar sockpathsfile +for notifications from other daemons about successful or failed connection +attempts. +If no such file is specified, then it only listens to the socket path +specified by +.Ar sockspath +or if that is not specified to +.Pa /var/run/blacklistd.sock . +Each notification contains an (action, port, protocol, address, owner) tuple +that identifies the remote connection and the action. +This tuple is consulted against entries in +.Ar configfile +with syntax specified in +.Xr blacklistd.conf 5 . +If an entry is matched, a state entry is created for that tuple. +Each entry contains a number of tries limit and a duration. +.Pp +If the action is +.Dq add +and the number of tries limit is reached, then a +control script +.Ar controlprog +is invoked with arguments: +.Bd -literal -offset indent +control add
+.Ed +.Pp +and should invoke a packet filter command to block the connection +specified by the arguments. +The +.Ar rulename +argument can be set from the command line (default +.Dv blacklistd ) . +The script could print a numerical id to stdout as a handle for +the rule that can be used later to remove that connection, but +that is not required as all information to remove the rule is +kept. +.Pp +If the action is +.Dq remove +Then the same control script is invoked as: +.Bd -literal -offset indent +control remove
+.Ed +.Pp +where +.Ar id +is the number returned from the +.Dq add +action. +.Pp +.Nm +maintains a database of known connections in +.Ar dbfile . +On startup it reads entries from that file, and updates its internal state. +.Pp +.Nm +checks the list of active entries every +.Ar timeout +seconds (default +.Dv 15 ) +and removes entries and block rules using the control program as necessary. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl C Ar controlprog +Use +.Ar controlprog +to communicate with the packet filter, usually +.Pa /libexec/blacklistd-helper . +The following arguments are passed to the control program: +.Bl -tag -width protocol +.It action +The action to perform: +.Dv add , +.Dv rem , +or +.Dv flush +to add, remove or flush a firewall rule. +.It name +The rule name. +.It protocol +The optional protocol name (can be empty): +.Dv tcp , +.Dv tcp6 , +.Dv udp , +.Dv udp6 . +.It address +The IPv4 or IPv6 numeric address to be blocked or released. +.It mask +The numeric mask to be applied to the blocked or released address +.It port +The optional numeric port to be blocked (can be empty). +.It id +For packet filters that support removal of rules by rule identifier, the +identifier of the rule to be removed. +The add command is expected to return the rule identifier string to stdout. +.El +.It Fl c Ar configuration +The name of the configuration file to read, usually +.Pa /etc/blacklistd.conf . +.It Fl D Ar dbfile +The Berkeley DB file where +.Nm +stores its state, usually +.Pa /var/run/blacklistd.db . +.It Fl d +Normally, +.Nm +disassociates itself from the terminal unless the +.Fl d +flag is specified, in which case it stays in the foreground. +.It Fl f +Truncate the state database and flush all the rules named +.Ar rulename +are deleted by invoking the control script as: +.Bd -literal -offset indent +control flush +.Ed +.It Fl P Ar sockspathsfile +A file containing a list of pathnames, one per line that +.Nm +will create sockets to listen to. +This is useful for chrooted environments. +.It Fl R Ar rulename +Specify the default rule name for the packet filter rules, usually +.Dv blacklistd . +.It Fl r +Re-read the firewall rules from the internal database, then +remove and re-add them. +This helps for packet filters that don't retain state across reboots. +.It Fl s Ar sockpath +Add +.Ar sockpath +to the list of Unix sockets +.Nm +listens to. +.It Fl t Ar timeout +The interval in seconds +.Nm +polls the state file to update the rules. +.It Fl v +Cause +.Nm +to print +diagnostic messages to +.Dv stdout +instead of +.Xr syslogd 8 . +.El +.Sh FILES +.Bl -tag -width /libexec/blacklistd-helper -compact +.It Pa /libexec/blacklistd-helper +Shell script invoked to interface with the packet filter. +.It Pa /etc/blacklistd.conf +Configuration file. +.It Pa /var/db/blacklistd.db +Database of current connection entries. +.It Pa /var/run/blacklistd.sock +Socket to receive connection notifications. +.El +.Sh SEE ALSO +.Xr blacklistd.conf 5 , +.Xr blacklistctl 8 , +.Xr npfctl 8 , +.Xr syslogd 8 +.Sh HISTORY +.Nm +first appeared in +.Nx 7 . +.Fx +support for +.Nm +was implemented in +.Fx 11 . +.Sh AUTHORS +.An Christos Zoulas Copied: vendor/blocklist/dist/bin/blocklistd.c (from r362194, vendor/NetBSD/blacklist/dist/bin/blacklistd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/dist/bin/blocklistd.c Mon Jun 15 13:17:22 2020 (r362196, copy of r362194, vendor/NetBSD/blacklist/dist/bin/blacklistd.c) @@ -0,0 +1,568 @@ +/* $NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $ */ + +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +__RCSID("$NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $"); + +#include +#include +#include + +#ifdef HAVE_LIBUTIL_H +#include +#endif +#ifdef HAVE_UTIL_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bl.h" +#include "internal.h" +#include "conf.h" +#include "run.h" +#include "state.h" +#include "support.h" + +static const char *configfile = _PATH_BLCONF; +static DB *state; +static const char *dbfile = _PATH_BLSTATE; +static sig_atomic_t readconf; +static sig_atomic_t done; +static int vflag; + +static void +sigusr1(int n __unused) +{ + debug++; +} + +static void +sigusr2(int n __unused) +{ + debug--; +} + +static void +sighup(int n __unused) +{ + readconf++; +} + +static void +sigdone(int n __unused) +{ + done++; +} + +static __dead void +usage(int c) +{ + if (c) + warnx("Unknown option `%c'", (char)c); + fprintf(stderr, "Usage: %s [-vdfr] [-c ] [-R ] " + "[-P ] [-C ] [-D ] " + "[-s ] [-t ]\n", getprogname()); + exit(EXIT_FAILURE); +} + +static int +getremoteaddress(bl_info_t *bi, struct sockaddr_storage *rss, socklen_t *rsl) +{ + *rsl = sizeof(*rss); + memset(rss, 0, *rsl); + + if (getpeername(bi->bi_fd, (void *)rss, rsl) != -1) + return 0; + + if (errno != ENOTCONN) { + (*lfun)(LOG_ERR, "getpeername failed (%m)"); + return -1; + } + + if (bi->bi_slen == 0) { + (*lfun)(LOG_ERR, "unconnected socket with no peer in message"); + return -1; + } + + switch (bi->bi_ss.ss_family) { + case AF_INET: + *rsl = sizeof(struct sockaddr_in); + break; + case AF_INET6: + *rsl = sizeof(struct sockaddr_in6); + break; + default: + (*lfun)(LOG_ERR, "bad client passed socket family %u", + (unsigned)bi->bi_ss.ss_family); + return -1; + } + + if (*rsl != bi->bi_slen) { + (*lfun)(LOG_ERR, "bad client passed socket length %u != %u", + (unsigned)*rsl, (unsigned)bi->bi_slen); + return -1; + } + + memcpy(rss, &bi->bi_ss, *rsl); + +#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN + if (*rsl != rss->ss_len) { + (*lfun)(LOG_ERR, + "bad client passed socket internal length %u != %u", + (unsigned)*rsl, (unsigned)rss->ss_len); + return -1; + } +#endif + return 0; +} + +static void +process(bl_t bl) +{ + struct sockaddr_storage rss; + socklen_t rsl; + char rbuf[BUFSIZ]; + bl_info_t *bi; + struct conf c; + struct dbinfo dbi; + struct timespec ts; + + if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { + (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); + return; + } + + if ((bi = bl_recv(bl)) == NULL) { + (*lfun)(LOG_ERR, "no message (%m)"); + return; + } + + if (getremoteaddress(bi, &rss, &rsl) == -1) + goto out; + + if (debug) { + sockaddr_snprintf(rbuf, sizeof(rbuf), "%a:%p", (void *)&rss); + (*lfun)(LOG_DEBUG, "processing type=%d fd=%d remote=%s msg=%s" + " uid=%lu gid=%lu", bi->bi_type, bi->bi_fd, rbuf, + bi->bi_msg, (unsigned long)bi->bi_uid, + (unsigned long)bi->bi_gid); + } + + if (conf_find(bi->bi_fd, bi->bi_uid, &rss, &c) == NULL) { + (*lfun)(LOG_DEBUG, "no rule matched"); + goto out; + } + + + if (state_get(state, &c, &dbi) == -1) + goto out; + + if (debug) { + char b1[128], b2[128]; + (*lfun)(LOG_DEBUG, "%s: initial db state for %s: count=%d/%d " + "last=%s now=%s", __func__, rbuf, dbi.count, c.c_nfail, + fmttime(b1, sizeof(b1), dbi.last), + fmttime(b2, sizeof(b2), ts.tv_sec)); + } + + switch (bi->bi_type) { + case BL_ADD: + dbi.count++; + dbi.last = ts.tv_sec; + if (dbi.id[0]) { + /* + * We should not be getting this since the rule + * should have blocked the address. A possible + * explanation is that someone removed that rule, + * and another would be that we got another attempt + * before we added the rule. In anycase, we remove + * and re-add the rule because we don't want to add + * it twice, because then we'd lose track of it. + */ + (*lfun)(LOG_DEBUG, "rule exists %s", dbi.id); + (void)run_change("rem", &c, dbi.id, 0); + dbi.id[0] = '\0'; + } + if (c.c_nfail != -1 && dbi.count >= c.c_nfail) { + int res = run_change("add", &c, dbi.id, sizeof(dbi.id)); + if (res == -1) + goto out; + sockaddr_snprintf(rbuf, sizeof(rbuf), "%a", + (void *)&rss); + (*lfun)(LOG_INFO, + "blocked %s/%d:%d for %d seconds", + rbuf, c.c_lmask, c.c_port, c.c_duration); + + } + break; + case BL_DELETE: + if (dbi.last == 0) + goto out; + dbi.count = 0; + dbi.last = 0; + break; + default: + (*lfun)(LOG_ERR, "unknown message %d", bi->bi_type); + } + state_put(state, &c, &dbi); + +out: + close(bi->bi_fd); + + if (debug) { + char b1[128], b2[128]; + (*lfun)(LOG_DEBUG, "%s: final db state for %s: count=%d/%d " + "last=%s now=%s", __func__, rbuf, dbi.count, c.c_nfail, + fmttime(b1, sizeof(b1), dbi.last), + fmttime(b2, sizeof(b2), ts.tv_sec)); + } +} + +static void +update_interfaces(void) +{ + struct ifaddrs *oifas, *nifas; + + if (getifaddrs(&nifas) == -1) + return; + + oifas = ifas; + ifas = nifas; + + if (oifas) + freeifaddrs(oifas); +} + +static void +update(void) +{ + struct timespec ts; + struct conf c; + struct dbinfo dbi; + unsigned int f, n; + char buf[128]; + void *ss = &c.c_ss; + + if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { + (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); + return; + } + +again: + for (n = 0, f = 1; state_iterate(state, &c, &dbi, f) == 1; + f = 0, n++) + { + time_t when = c.c_duration + dbi.last; + if (debug > 1) { + char b1[64], b2[64]; + sockaddr_snprintf(buf, sizeof(buf), "%a:%p", ss); + (*lfun)(LOG_DEBUG, "%s:[%u] %s count=%d duration=%d " + "last=%s " "now=%s", __func__, n, buf, dbi.count, + c.c_duration, fmttime(b1, sizeof(b1), dbi.last), + fmttime(b2, sizeof(b2), ts.tv_sec)); + } + if (c.c_duration == -1 || when >= ts.tv_sec) + continue; + if (dbi.id[0]) { + run_change("rem", &c, dbi.id, 0); + sockaddr_snprintf(buf, sizeof(buf), "%a", ss); + syslog(LOG_INFO, "released %s/%d:%d after %d seconds", + buf, c.c_lmask, c.c_port, c.c_duration); + } + state_del(state, &c); + goto again; + } +} + +static void +addfd(struct pollfd **pfdp, bl_t **blp, size_t *nfd, size_t *maxfd, + const char *path) +{ + bl_t bl = bl_create(true, path, vflag ? vdlog : vsyslog); + if (bl == NULL || !bl_isconnected(bl)) + exit(EXIT_FAILURE); + if (*nfd >= *maxfd) { + *maxfd += 10; + *blp = realloc(*blp, sizeof(**blp) * *maxfd); + if (*blp == NULL) + err(EXIT_FAILURE, "malloc"); + *pfdp = realloc(*pfdp, sizeof(**pfdp) * *maxfd); + if (*pfdp == NULL) + err(EXIT_FAILURE, "malloc"); + } + + (*pfdp)[*nfd].fd = bl_getfd(bl); + (*pfdp)[*nfd].events = POLLIN; + (*blp)[*nfd] = bl; + *nfd += 1; +} + +static void +uniqueadd(struct conf ***listp, size_t *nlist, size_t *mlist, struct conf *c) +{ + struct conf **list = *listp; + + if (c->c_name[0] == '\0') + return; + for (size_t i = 0; i < *nlist; i++) { + if (strcmp(list[i]->c_name, c->c_name) == 0) + return; + } + if (*nlist == *mlist) { + *mlist += 10; + void *p = realloc(*listp, *mlist * sizeof(*list)); + if (p == NULL) + err(EXIT_FAILURE, "Can't allocate for rule list"); + list = *listp = p; + } + list[(*nlist)++] = c; +} + +static void +rules_flush(void) +{ + struct conf **list; + size_t nlist, mlist; + + list = NULL; + mlist = nlist = 0; + for (size_t i = 0; i < rconf.cs_n; i++) + uniqueadd(&list, &nlist, &mlist, &rconf.cs_c[i]); + for (size_t i = 0; i < lconf.cs_n; i++) + uniqueadd(&list, &nlist, &mlist, &lconf.cs_c[i]); + + for (size_t i = 0; i < nlist; i++) + run_flush(list[i]); + free(list); +} + +static void +rules_restore(void) +{ + struct conf c; + struct dbinfo dbi; + unsigned int f; + + for (f = 1; state_iterate(state, &c, &dbi, f) == 1; f = 0) { + if (dbi.id[0] == '\0') + continue; + (void)run_change("add", &c, dbi.id, sizeof(dbi.id)); + } +} + +int +main(int argc, char *argv[]) +{ + int c, tout, flags, flush, restore, ret; + const char *spath, **blsock; + size_t nblsock, maxblsock; + + setprogname(argv[0]); + + spath = NULL; + blsock = NULL; + maxblsock = nblsock = 0; + flush = 0; + restore = 0; + tout = 0; + flags = O_RDWR|O_EXCL|O_CLOEXEC; + while ((c = getopt(argc, argv, "C:c:D:dfP:rR:s:t:v")) != -1) { + switch (c) { + case 'C': + controlprog = optarg; + break; + case 'c': + configfile = optarg; + break; + case 'D': + dbfile = optarg; + break; + case 'd': + debug++; + break; + case 'f': + flush++; + break; + case 'P': + spath = optarg; + break; + case 'R': + rulename = optarg; + break; + case 'r': + restore++; + break; + case 's': + if (nblsock >= maxblsock) { + maxblsock += 10; + void *p = realloc(blsock, + sizeof(*blsock) * maxblsock); + if (p == NULL) + err(EXIT_FAILURE, + "Can't allocate memory for %zu sockets", + maxblsock); + blsock = p; + } + blsock[nblsock++] = optarg; + break; + case 't': + tout = atoi(optarg) * 1000; + break; + case 'v': + vflag++; + break; + default: + usage(c); + } + } + + argc -= optind; + if (argc) + usage(0); + + signal(SIGHUP, sighup); + signal(SIGINT, sigdone); + signal(SIGQUIT, sigdone); + signal(SIGTERM, sigdone); + signal(SIGUSR1, sigusr1); + signal(SIGUSR2, sigusr2); + + openlog(getprogname(), LOG_PID, LOG_DAEMON); + + if (debug) { + lfun = dlog; + if (tout == 0) + tout = 5000; + } else { + if (tout == 0) + tout = 15000; + } + + update_interfaces(); + conf_parse(configfile); + if (flush) { + rules_flush(); + if (!restore) + flags |= O_TRUNC; + } + + struct pollfd *pfd = NULL; + bl_t *bl = NULL; + size_t nfd = 0; + size_t maxfd = 0; + + for (size_t i = 0; i < nblsock; i++) + addfd(&pfd, &bl, &nfd, &maxfd, blsock[i]); + free(blsock); + + if (spath) { + FILE *fp = fopen(spath, "r"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 13:34:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B8673345B1; Mon, 15 Jun 2020 13:34:43 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lskp1tYRz4bxr; Mon, 15 Jun 2020 13:34:42 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ed1-f67.google.com with SMTP id g1so11521851edv.6; Mon, 15 Jun 2020 06:34:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EoAi9ZkmyCdjyeC2ahufL0SuUAsiSkuCgicHhRGTkqg=; b=YpdHLVfYeWqHknTIXfhj6Du69lqCXJKgDK0XooY0AHWpTjkJSkYer3qLQQ7EUXXFSM wzVeHvAvmqe2svYRHJUIAlonW9YPG0d9UzUg96rXRJsgYHDdOHXu5CZxdj2iX5dfT3GS 5893znYPZhGlRA1x3IeG883yzx+V+i1CHF5AM9Pnl1PJJeK8nBhAoD+9fRtCq5kg+qNK EvBJ6a0Q4gDROL5MSLIpp7mvGkz/7NFd74x7qSPiXze29Mjm8DFL7/040ibRKssvVpsp fR3nm8HOXs+XZEHAN183teTCpMK3ECsfIGOb2QKzUv32up2K4AvjJS6ERweCSiHJBRH5 ayiw== X-Gm-Message-State: AOAM530oTZRQKAwPqQbpl/dx67poLHiYIKXAUQlkQMmTKQ4MwDciHn0i Mplg6DGw8yu8NIViOaWwyRwJ0nJEr94= X-Google-Smtp-Source: ABdhPJx/x9nKqzSVbyMOsjvHfNh1MFNw/CUElHJsv3zYVDe/AufyFw18Q9TshFPDuFOJqPjUCYJj+w== X-Received: by 2002:aa7:c486:: with SMTP id m6mr24718961edq.234.1592228080032; Mon, 15 Jun 2020 06:34:40 -0700 (PDT) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id d6sm8447067edn.75.2020.06.15.06.34.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jun 2020 06:34:39 -0700 (PDT) Subject: Re: svn commit: r362191 - head/sbin/md5 To: rgrimes@freebsd.org, =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006151233.05FCXN4L076562@gndrsh.dnsmgr.net> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: <146239e5-081f-18f7-3a3b-54d912fb8bfd@FreeBSD.org> Date: Mon, 15 Jun 2020 15:34:38 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <202006151233.05FCXN4L076562@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49lskp1tYRz4bxr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.208.67 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-1.65 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.93)[-0.930]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.61)[-0.606]; NEURAL_HAM_SHORT(-0.11)[-0.109]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.67:from]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.67:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 13:34:43 -0000 Hi, On 6/15/20 2:33 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: fernape (ports committer) >> Date: Mon Jun 15 10:08:02 2020 >> New Revision: 362191 >> URL: https://svnweb.freebsd.org/changeset/base/362191 >> >> Log: >> md5(1): fix style in man page > > Mandoc is fine to ignore this, but it is wrong to call it useless. > > I really wish that this stop. .Tn might be useless to mandoc, > but it is a very usable thing if your formatting to something > other than txt, as in a ps or pdf. In that case I would consider patching our in-tree mandoc to not warn about Tn. Or request support for Tn or a well-defined replacement upstream. I can see the benefit of keeping Tn around, as it /might/ potentially create nice formatting for HTML. On the other hand, I don't like the idea of not following the linter. Cheers, Mateusz From owner-svn-src-all@freebsd.org Mon Jun 15 13:44:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 332EF334463; Mon, 15 Jun 2020 13:44:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lsyJ0yMRz4cSK; Mon, 15 Jun 2020 13:44:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BCD71E72D; Mon, 15 Jun 2020 13:44:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FDieLX067005; Mon, 15 Jun 2020 13:44:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FDibMt066990; Mon, 15 Jun 2020 13:44:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006151344.05FDibMt066990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Jun 2020 13:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362197 - in vendor/blocklist/dist: . bin diff etc etc/rc.d include lib libexec port test X-SVN-Group: vendor X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in vendor/blocklist/dist: . bin diff etc etc/rc.d include lib libexec port test X-SVN-Commit-Revision: 362197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 13:44:40 -0000 Author: emaste Date: Mon Jun 15 13:44:37 2020 New Revision: 362197 URL: https://svnweb.freebsd.org/changeset/base/362197 Log: blocklist: update to 2020-06-15 snapshot Upstream hash 7093cd90cc9eae6bf9fa6b66f679ea6b15451c1e Obtained from: https://github.com/zoulasc/blocklist Sponsored by: The FreeBSD Foundation Added: vendor/blocklist/dist/diff/postfix.diff Modified: vendor/blocklist/dist/Makefile vendor/blocklist/dist/Makefile.inc vendor/blocklist/dist/README vendor/blocklist/dist/TODO vendor/blocklist/dist/bin/Makefile vendor/blocklist/dist/bin/blocklistctl.8 vendor/blocklist/dist/bin/blocklistctl.c vendor/blocklist/dist/bin/blocklistd.8 vendor/blocklist/dist/bin/blocklistd.c vendor/blocklist/dist/bin/blocklistd.conf.5 vendor/blocklist/dist/bin/conf.c vendor/blocklist/dist/bin/conf.h vendor/blocklist/dist/bin/internal.c vendor/blocklist/dist/bin/internal.h vendor/blocklist/dist/bin/run.c vendor/blocklist/dist/bin/run.h vendor/blocklist/dist/bin/state.c vendor/blocklist/dist/bin/state.h vendor/blocklist/dist/bin/support.c vendor/blocklist/dist/bin/support.h vendor/blocklist/dist/diff/ftpd.diff vendor/blocklist/dist/diff/named.diff vendor/blocklist/dist/diff/proftpd.diff vendor/blocklist/dist/diff/ssh.diff vendor/blocklist/dist/etc/Makefile vendor/blocklist/dist/etc/npf.conf vendor/blocklist/dist/etc/rc.d/Makefile vendor/blocklist/dist/etc/rc.d/blocklistd vendor/blocklist/dist/include/Makefile vendor/blocklist/dist/include/bl.h vendor/blocklist/dist/include/blocklist.h vendor/blocklist/dist/lib/Makefile vendor/blocklist/dist/lib/bl.c vendor/blocklist/dist/lib/blocklist.c vendor/blocklist/dist/lib/libblocklist.3 vendor/blocklist/dist/libexec/Makefile vendor/blocklist/dist/libexec/blocklistd-helper vendor/blocklist/dist/port/Makefile.am vendor/blocklist/dist/port/_strtoi.h vendor/blocklist/dist/port/configure.ac vendor/blocklist/dist/port/fgetln.c vendor/blocklist/dist/port/fparseln.c vendor/blocklist/dist/port/pidfile.c vendor/blocklist/dist/port/popenve.c vendor/blocklist/dist/port/port.h vendor/blocklist/dist/port/sockaddr_snprintf.c vendor/blocklist/dist/port/strlcat.c vendor/blocklist/dist/port/strlcpy.c vendor/blocklist/dist/port/strtoi.c vendor/blocklist/dist/test/Makefile vendor/blocklist/dist/test/cltest.c vendor/blocklist/dist/test/srvtest.c Modified: vendor/blocklist/dist/Makefile ============================================================================== --- vendor/blocklist/dist/Makefile Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/Makefile Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2015/01/22 17:49:41 christos Exp $ +# $NetBSD: Makefile,v 1.1 2015/01/21 16:16:00 christos Exp $ SUBDIR = lib .WAIT include bin etc libexec Modified: vendor/blocklist/dist/Makefile.inc ============================================================================== --- vendor/blocklist/dist/Makefile.inc Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/Makefile.inc Mon Jun 15 13:44:37 2020 (r362197) @@ -1,9 +1,9 @@ -# $NetBSD: Makefile.inc,v 1.3 2015/01/23 03:57:22 christos Exp $ +# $NetBSD: Makefile.inc,v 1.2 2015/01/22 04:20:50 christos Exp $ WARNS=6 .if !defined(LIB) -LDADD+= -lblacklist -DPADD+= ${LIBBLACKLIST} +LDADD+= -lblocklist +DPADD+= ${LIBBLOCKLIST} .endif CPPFLAGS+= -I${.CURDIR}/../include CPPFLAGS+=-DHAVE_STRUCT_SOCKADDR_SA_LEN -DHAVE_UTIL_H -DHAVE_DB_H Modified: vendor/blocklist/dist/README ============================================================================== --- vendor/blocklist/dist/README Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/README Mon Jun 15 13:44:37 2020 (r362197) @@ -1,21 +1,21 @@ -# $NetBSD: README,v 1.8 2017/04/13 17:59:34 christos Exp $ +# $NetBSD: README,v 1.7 2015/01/26 00:34:50 christos Exp $ This package contains library that can be used by network daemons to communicate with a packet filter via a daemon to enforce opening and closing ports dynamically based on policy. -The interface to the packet filter is in libexec/blacklistd-helper +The interface to the packet filter is in libexec/blocklistd-helper (this is currently designed for npf) and the configuration file -(inspired from inetd.conf) is in etc/blacklistd.conf. +(inspired from inetd.conf) is in etc/blocklistd.conf. -On NetBSD you can find an example npf.conf and blacklistd.conf in -/usr/share/examples/blacklistd; you need to adjust the interface +On NetBSD you can find an example npf.conf and blocklistd.conf in +/usr/share/examples/blocklistd; you need to adjust the interface in npf.conf and copy both files to /etc; then you just enable -blacklistd=YES in /etc/rc.conf, start it up, and you are all set. +blocklistd=YES in /etc/rc.conf, start it up, and you are all set. -There is also a startup file in etc/rc.d/blacklistd +There is also a startup file in etc/rc.d/blocklistd -Patches to various daemons to add blacklisting capabilitiers are in the +Patches to various daemons to add blocklisting capabilitiers are in the "diff" directory: - OpenSSH: diff/ssh.diff [tcp socket example] - Bind: diff/named.diff [both tcp and udp] @@ -23,21 +23,21 @@ Patches to various daemons to add blacklisting capabil These patches have been applied to NetBSD-current. -The network daemon (for example sshd) communicates to blacklistd, via +The network daemon (for example sshd) communicates to blocklistd, via a unix socket like syslog. The library calls are simple and everything is handled by the library. In the simplest form the only thing the daemon needs to do is to call: - blacklist(action, acceptedfd, message); + blocklist(action, acceptedfd, message); Where: - action = 0 -> successful login clear blacklist state + action = 0 -> successful login clear blocklist state 1 -> failed login, add to the failed count acceptedfd -> the file descriptor where the server is connected to the remote client. It is used to determine the listening socket, and the remote address. This allows any program to - contact the blacklist daemon, since the verification + contact the blocklist daemon, since the verification if the program has access to the listening socket is done by virtue that the port number is retrieved from the kernel. @@ -46,9 +46,9 @@ Where: Unfortunately there is no way to get information about the "peer" from a udp socket, because there is no connection and that information is kept with the server. In that case the daemon can provide the -peer information to blacklistd via: +peer information to blocklistd via: - blacklist_sa(action, acceptedfd, sockaddr, sockaddr_len, message); + blocklist_sa(action, acceptedfd, sockaddr, sockaddr_len, message); The configuration file contains entries of the form: @@ -70,8 +70,8 @@ will let us have 2 connections before blocking. Finall for an hour; we could block forever too by specifying * in the duration column. -blacklistd and the library use syslog(3) to report errors. The -blacklist filter state is persisted automatically in /var/db/blacklistd.db +blocklistd and the library use syslog(3) to report errors. The +blocklist filter state is persisted automatically in /var/db/blocklistd.db so that if the daemon is restarted, it remembers what connections is currently handling. To start from a fresh state (if you restart npf too for example), you can use -f. To watch the daemon at work, @@ -80,25 +80,25 @@ you can use -d. The current control file is designed for npf, and it uses the dynamic rule feature. You need to create a dynamic rule in your /etc/npf.conf on the group referring to the interface you want to block -called blacklistd as follows: +called blocklistd as follows: ext_if=bge0 int_if=sk0 group "external" on $ext_if { ... - ruleset "blacklistd-ext" - ruleset "blacklistd" + ruleset "blocklistd-ext" + ruleset "blocklistd" ... } group "internal" on $int_if { ... - ruleset "blacklistd-int" + ruleset "blocklistd-int" ... } -You can use 'blacklistctl dump -a' to list all the current entries +You can use 'blocklistctl dump -a' to list all the current entries in the database; the ones that have nfail / where urrent >= otal, should have an id assosiated with them; this means that there is a packet filter rule added for that entry. For npf, you Modified: vendor/blocklist/dist/TODO ============================================================================== --- vendor/blocklist/dist/TODO Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/TODO Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -# $NetBSD: TODO,v 1.7 2015/01/23 21:34:01 christos Exp $ +# $NetBSD: TODO,v 1.6 2015/01/22 18:15:56 christos Exp $ - don't poll periodically, find the next timeout - use the socket also for commands? Or separate socket? @@ -17,5 +17,5 @@ -n block unblock -- do we need an api in blacklistctl to perform maintenance -- fix the blacklistctl output to be more user friendly +- do we need an api in blocklistctl to perform maintenance +- fix the blocklistctl output to be more user friendly Modified: vendor/blocklist/dist/bin/Makefile ============================================================================== --- vendor/blocklist/dist/bin/Makefile Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/bin/Makefile Mon Jun 15 13:44:37 2020 (r362197) @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.11 2015/01/27 19:40:36 christos Exp $ +# $NetBSD: Makefile,v 1.10 2015/01/22 17:49:41 christos Exp $ BINDIR=/sbin -PROGS=blacklistd blacklistctl -MAN.blacklistd=blacklistd.8 blacklistd.conf.5 -MAN.blacklistctl=blacklistctl.8 -SRCS.blacklistd = blacklistd.c conf.c run.c state.c support.c internal.c -SRCS.blacklistctl = blacklistctl.c conf.c state.c support.c internal.c +PROGS=blocklistd blocklistctl +MAN.blocklistd=blocklistd.8 blocklistd.conf.5 +MAN.blocklistctl=blocklistctl.8 +SRCS.blocklistd = blocklistd.c conf.c run.c state.c support.c internal.c +SRCS.blocklistctl = blocklistctl.c conf.c state.c support.c internal.c DBG=-g LDADD+=-lutil Modified: vendor/blocklist/dist/bin/blocklistctl.8 ============================================================================== --- vendor/blocklist/dist/bin/blocklistctl.8 Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/bin/blocklistctl.8 Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -.\" $NetBSD: blacklistctl.8,v 1.9 2016/06/08 12:48:37 wiz Exp $ +.\" $NetBSD: blocklistctl.8,v 1.8 2016/06/07 17:31:02 christos Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -28,11 +28,11 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd June 7, 2016 -.Dt BLACKLISTCTL 8 +.Dt BLOCKLISTCTL 8 .Os .Sh NAME -.Nm blacklistctl -.Nd display and change the state of blacklistd +.Nm blocklistctl +.Nd display and change the state of blocklistd .Sh SYNOPSIS .Nm .Cm dump @@ -40,7 +40,7 @@ .Sh DESCRIPTION .Nm is a program used to display the state of -.Xr blacklistd 8 +.Xr blocklistd 8 .Pp The following options are available: .Bl -tag -width indent @@ -60,17 +60,17 @@ Normally the width of addresses is good for IPv4, the flag, makes the display wide enough for IPv6 addresses. .El .Sh SEE ALSO -.Xr blacklistd 8 +.Xr blocklistd 8 .Sh NOTES Sometimes the reported number of failed attempts can exceed the number of attempts that -.Xr blacklistd 8 +.Xr blocklistd 8 is configured to block. This can happen either because the rule has been removed manually, or because there were more attempts in flight while the rule block was being added. This condition is normal; in that case -.Xr blacklistd 8 +.Xr blocklistd 8 will first attempt to remove the existing rule, and then it will re-add it to make sure that there is only one rule active. .Sh HISTORY Modified: vendor/blocklist/dist/bin/blocklistctl.c ============================================================================== --- vendor/blocklist/dist/bin/blocklistctl.c Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/bin/blocklistctl.c Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -/* $NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $ */ +/* $NetBSD: blocklistctl.c,v 1.22 2018/05/24 19:19:37 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #endif #include -__RCSID("$NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $"); +__RCSID("$NetBSD: blocklistctl.c,v 1.22 2018/05/24 19:19:37 christos Exp $"); #include #include Modified: vendor/blocklist/dist/bin/blocklistd.8 ============================================================================== --- vendor/blocklist/dist/bin/blocklistd.8 Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/bin/blocklistd.8 Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -.\" $NetBSD: blacklistd.8,v 1.18 2016/07/30 06:09:29 dholland Exp $ +.\" $NetBSD: blocklistd.8,v 1.23 2020/04/21 13:57:12 christos Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,11 +27,11 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 7, 2016 -.Dt BLACKLISTD 8 +.Dd April 21, 2020 +.Dt BLOCKLISTD 8 .Os .Sh NAME -.Nm blacklistd +.Nm blocklistd .Nd block and release ports on demand to avoid DoS abuse .Sh SYNOPSIS .Nm @@ -55,16 +55,52 @@ If no such file is specified, then it only listens to specified by .Ar sockspath or if that is not specified to -.Pa /var/run/blacklistd.sock . +.Pa /var/run/blocklistd.sock . Each notification contains an (action, port, protocol, address, owner) tuple that identifies the remote connection and the action. This tuple is consulted against entries in .Ar configfile with syntax specified in -.Xr blacklistd.conf 5 . +.Xr blocklistd.conf 5 . If an entry is matched, a state entry is created for that tuple. Each entry contains a number of tries limit and a duration. .Pp +The way +.Nm +does configuration entry matching is by having the client side pass the +file descriptor associated with the connection the client wants to blocklist +as well as passing socket credentials. +.Pp +The file descriptor is used to retrieve information (address and port) +about the remote side with +.Xr getpeername 2 +and the local side with +.Xr getsockname 2 . +.Pp +By examining the port of the local side, +.Nm +can determine if the client program +.Dq owns +the port. +By examining the optional address portion on the local side, it can match +interfaces. +By examining the remote address, it can match specific allow or deny rules. +.Pp +Finally +.Nm +can examine the socket credentials to match the user in the configuration file. +.Pp +While this works well for TCP sockets, it cannot be relied on for unbound +UDP sockets. +It is also less meaningful when it comes to connections using non-privileged +ports. +On the other hand, if we receive a request that has a local endpoint indicating +a UDP privileged port, we can presume that the client was privileged to be +able to acquire that port. +.Pp +Once an entry is matched +.Nm +can perform various actions. If the action is .Dq add and the number of tries limit is reached, then a @@ -80,17 +116,17 @@ specified by the arguments. The .Ar rulename argument can be set from the command line (default -.Dv blacklistd ) . +.Dv blocklistd ) . The script could print a numerical id to stdout as a handle for the rule that can be used later to remove that connection, but that is not required as all information to remove the rule is kept. .Pp If the action is -.Dq remove +.Dq rem Then the same control script is invoked as: .Bd -literal -offset indent -control remove
+control rem
.Ed .Pp where @@ -117,7 +153,7 @@ The following options are available: Use .Ar controlprog to communicate with the packet filter, usually -.Pa /libexec/blacklistd-helper . +.Pa /libexec/blocklistd-helper . The following arguments are passed to the control program: .Bl -tag -width protocol .It action @@ -148,12 +184,12 @@ The add command is expected to return the rule identif .El .It Fl c Ar configuration The name of the configuration file to read, usually -.Pa /etc/blacklistd.conf . +.Pa /etc/blocklistd.conf . .It Fl D Ar dbfile The Berkeley DB file where .Nm stores its state, usually -.Pa /var/run/blacklistd.db . +.Pa /var/db/blocklistd.db . .It Fl d Normally, .Nm @@ -174,11 +210,11 @@ will create sockets to listen to. This is useful for chrooted environments. .It Fl R Ar rulename Specify the default rule name for the packet filter rules, usually -.Dv blacklistd . +.Dv blocklistd . .It Fl r Re-read the firewall rules from the internal database, then remove and re-add them. -This helps for packet filters that don't retain state across reboots. +This helps for packet filters that do not retain state across reboots. .It Fl s Ar sockpath Add .Ar sockpath @@ -198,20 +234,41 @@ diagnostic messages to instead of .Xr syslogd 8 . .El +.Sh SIGNAL HANDLING +.Nm +deals with the following signals: +.Bl -tag -width "USR2" +.It Dv HUP +Receipt of this signal causes +.Nm +to re-read the configuration file. +.It Dv INT , Dv TERM & Dv QUIT +These signals tell +.Nm +to exit in an orderly fashion. +.It Dv USR1 +This signal tells +.Nm +to increase the internal debugging level by 1. +.It Dv USR2 +This signal tells +.Nm +to decrease the internal debugging level by 1. +.El .Sh FILES -.Bl -tag -width /libexec/blacklistd-helper -compact -.It Pa /libexec/blacklistd-helper +.Bl -tag -width /libexec/blocklistd-helper -compact +.It Pa /libexec/blocklistd-helper Shell script invoked to interface with the packet filter. -.It Pa /etc/blacklistd.conf +.It Pa /etc/blocklistd.conf Configuration file. -.It Pa /var/db/blacklistd.db +.It Pa /var/db/blocklistd.db Database of current connection entries. -.It Pa /var/run/blacklistd.sock +.It Pa /var/run/blocklistd.sock Socket to receive connection notifications. .El .Sh SEE ALSO -.Xr blacklistd.conf 5 , -.Xr blacklistctl 8 , +.Xr blocklistd.conf 5 , +.Xr blocklistctl 8 , .Xr npfctl 8 , .Xr syslogd 8 .Sh HISTORY Modified: vendor/blocklist/dist/bin/blocklistd.c ============================================================================== --- vendor/blocklist/dist/bin/blocklistd.c Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/bin/blocklistd.c Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -/* $NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $ */ +/* $NetBSD: blocklistd.c,v 1.42 2020/03/11 02:33:18 roy Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "config.h" #endif #include -__RCSID("$NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $"); +__RCSID("$NetBSD: blocklistd.c,v 1.42 2020/03/11 02:33:18 roy Exp $"); #include #include @@ -123,7 +123,7 @@ getremoteaddress(bl_info_t *bi, struct sockaddr_storag return 0; if (errno != ENOTCONN) { - (*lfun)(LOG_ERR, "getpeername failed (%m)"); + (*lfun)(LOG_ERR, "getpeername failed (%m)"); return -1; } @@ -141,13 +141,13 @@ getremoteaddress(bl_info_t *bi, struct sockaddr_storag break; default: (*lfun)(LOG_ERR, "bad client passed socket family %u", - (unsigned)bi->bi_ss.ss_family); + (unsigned)bi->bi_ss.ss_family); return -1; } if (*rsl != bi->bi_slen) { (*lfun)(LOG_ERR, "bad client passed socket length %u != %u", - (unsigned)*rsl, (unsigned)bi->bi_slen); + (unsigned)*rsl, (unsigned)bi->bi_slen); return -1; } @@ -157,7 +157,7 @@ getremoteaddress(bl_info_t *bi, struct sockaddr_storag if (*rsl != rss->ss_len) { (*lfun)(LOG_ERR, "bad client passed socket internal length %u != %u", - (unsigned)*rsl, (unsigned)rss->ss_len); + (unsigned)*rsl, (unsigned)rss->ss_len); return -1; } #endif @@ -176,12 +176,12 @@ process(bl_t bl) struct timespec ts; if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { - (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); + (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); return; } if ((bi = bl_recv(bl)) == NULL) { - (*lfun)(LOG_ERR, "no message (%m)"); + (*lfun)(LOG_ERR, "no message (%m)"); return; } @@ -214,33 +214,38 @@ process(bl_t bl) } switch (bi->bi_type) { + case BL_ABUSE: + /* + * If the application has signaled abusive behavior, + * set the number of fails to be one less than the + * configured limit. Fallthrough to the normal BL_ADD + * processing, which will increment the failure count + * to the threshhold, and block the abusive address. + */ + if (c.c_nfail != -1) + dbi.count = c.c_nfail - 1; + /*FALLTHROUGH*/ case BL_ADD: dbi.count++; dbi.last = ts.tv_sec; - if (dbi.id[0]) { + if (c.c_nfail != -1 && dbi.count >= c.c_nfail) { /* - * We should not be getting this since the rule - * should have blocked the address. A possible - * explanation is that someone removed that rule, - * and another would be that we got another attempt - * before we added the rule. In anycase, we remove - * and re-add the rule because we don't want to add - * it twice, because then we'd lose track of it. + * No point in re-adding the rule. + * It might exist already due to latency in processing + * and removing the rule is the wrong thing to do as + * it allows a window to attack again. */ - (*lfun)(LOG_DEBUG, "rule exists %s", dbi.id); - (void)run_change("rem", &c, dbi.id, 0); - dbi.id[0] = '\0'; - } - if (c.c_nfail != -1 && dbi.count >= c.c_nfail) { - int res = run_change("add", &c, dbi.id, sizeof(dbi.id)); - if (res == -1) - goto out; + if (dbi.id[0] == '\0') { + int res = run_change("add", &c, + dbi.id, sizeof(dbi.id)); + if (res == -1) + goto out; + } sockaddr_snprintf(rbuf, sizeof(rbuf), "%a", (void *)&rss); (*lfun)(LOG_INFO, "blocked %s/%d:%d for %d seconds", rbuf, c.c_lmask, c.c_port, c.c_duration); - } break; case BL_DELETE: @@ -249,8 +254,11 @@ process(bl_t bl) dbi.count = 0; dbi.last = 0; break; + case BL_BADUSER: + /* ignore for now */ + break; default: - (*lfun)(LOG_ERR, "unknown message %d", bi->bi_type); + (*lfun)(LOG_ERR, "unknown message %d", bi->bi_type); } state_put(state, &c, &dbi); @@ -292,7 +300,7 @@ update(void) void *ss = &c.c_ss; if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { - (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); + (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); return; } Modified: vendor/blocklist/dist/bin/blocklistd.conf.5 ============================================================================== --- vendor/blocklist/dist/bin/blocklistd.conf.5 Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/bin/blocklistd.conf.5 Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -.\" $NetBSD: blacklistd.conf.5,v 1.7 2017/06/07 13:50:57 wiz Exp $ +.\" $NetBSD: blocklistd.conf.5,v 1.9 2019/11/06 20:33:30 para Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,17 +27,17 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 5, 2017 -.Dt BLACKLISTD.CONF 5 +.Dd May 18, 2020 +.Dt BLOCKLISTD.CONF 5 .Os .Sh NAME -.Nm blacklistd.conf -.Nd configuration file format for blacklistd +.Nm blocklistd.conf +.Nd configuration file format for blocklistd .Sh DESCRIPTION The .Nm -files contains configuration entries for -.Xr blacklistd 8 +file contains configuration entries for +.Xr blocklistd 8 in a fashion similar to .Xr inetd.conf 5 . Only one entry per line is permitted. @@ -125,18 +125,18 @@ The second field is the socket .Dv dgram , or numeric. The third field is the -.Va prococol : +.Va protocol : .Dv tcp , .Dv udp , .Dv tcp6 , .Dv udp6 , or numeric. -The fourth file is the effective user +The fourth field is the effective user .Va ( owner ) of the daemon process reporting the event, either as a username or a userid. .Pp -The rest of the fields are controlling the behavior of the filter. +The rest of the fields control the behavior of the filter. .Pp The .Va name @@ -192,12 +192,12 @@ rule that matched. .Pp The .Va remote -rules can be used for whitelisting specific addresses, changing the mask +rules can be used for allowing specific addresses, changing the mask size, the rule that the packet filter uses, the number of failed attempts, or the block duration. .Sh FILES -.Bl -tag -width /etc/blacklistd.conf -compact -.It Pa /etc/blacklistd.conf +.Bl -tag -width /etc/blocklistd.conf -compact +.It Pa /etc/blocklistd.conf Configuration file. .El .Sh EXAMPLES @@ -214,8 +214,8 @@ bnx0:ssh * * * * 3 6h 8.8.0.0/16:ssh * * * /24 = = .Ed .Sh SEE ALSO -.Xr blacklistctl 8 , -.Xr blacklistd 8 +.Xr blocklistctl 8 , +.Xr blocklistd 8 .Sh HISTORY .Nm first appeared in Modified: vendor/blocklist/dist/bin/conf.c ============================================================================== --- vendor/blocklist/dist/bin/conf.c Mon Jun 15 13:17:22 2020 (r362196) +++ vendor/blocklist/dist/bin/conf.c Mon Jun 15 13:44:37 2020 (r362197) @@ -1,4 +1,4 @@ -/* $NetBSD: conf.c,v 1.24 2016/04/04 15:52:56 christos Exp $ */ +/* $NetBSD: conf.c,v 1.30 2020/03/12 19:47:32 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #endif #include -__RCSID("$NetBSD: conf.c,v 1.24 2016/04/04 15:52:56 christos Exp $"); +__RCSID("$NetBSD: conf.c,v 1.30 2020/03/12 19:47:32 christos Exp $"); #include #ifdef HAVE_LIBUTIL_H @@ -46,6 +46,7 @@ __RCSID("$NetBSD: conf.c,v 1.24 2016/04/04 15:52:56 ch #include #include #include +#include #include #include #include @@ -55,6 +56,7 @@ __RCSID("$NetBSD: conf.c,v 1.24 2016/04/04 15:52:56 ch #include #include #include +#include #include #include "bl.h" @@ -90,7 +92,7 @@ advance(char **p) } static int -getnum(const char *f, size_t l, bool local, void *rp, const char *name, +conf_getnum(const char *f, size_t l, bool local, void *rp, const char *name, const char *p) { int e; @@ -127,13 +129,14 @@ out: } static int -getnfail(const char *f, size_t l, bool local, struct conf *c, const char *p) +conf_getnfail(const char *f, size_t l, bool local, struct conf *c, + const char *p) { - return getnum(f, l, local, &c->c_nfail, "nfail", p); + return conf_getnum(f, l, local, &c->c_nfail, "nfail", p); } static int -getsecs(const char *f, size_t l, bool local, struct conf *c, const char *p) +conf_getsecs(const char *f, size_t l, bool local, struct conf *c, const char *p) { int e; char *ep; @@ -173,9 +176,9 @@ again: } break; } - } else + } else tot = im; - + if (e == 0) { c->c_duration = (int)tot; return 0; @@ -193,7 +196,7 @@ out: } static int -getport(const char *f, size_t l, bool local, void *r, const char *p) +conf_getport(const char *f, size_t l, bool local, void *r, const char *p) { struct servent *sv; @@ -207,14 +210,14 @@ getport(const char *f, size_t l, bool local, void *r, return 0; } - return getnum(f, l, local, r, "service", p); + return conf_getnum(f, l, local, r, "service", p); } static int -getmask(const char *f, size_t l, bool local, const char **p, int *mask) +conf_getmask(const char *f, size_t l, bool local, const char **p, int *mask) { char *d; - const char *s = *p; + const char *s = *p; if ((d = strchr(s, ':')) != NULL) { *d++ = '\0'; @@ -226,11 +229,12 @@ getmask(const char *f, size_t l, bool local, const cha } *d++ = '\0'; - return getnum(f, l, local, mask, "mask", d); + return conf_getnum(f, l, local, mask, "mask", d); } static int -gethostport(const char *f, size_t l, bool local, struct conf *c, const char *p) +conf_gethostport(const char *f, size_t l, bool local, struct conf *c, + const char *p) { char *d; // XXX: Ok to write to string. in_port_t *port = NULL; @@ -249,7 +253,7 @@ gethostport(const char *f, size_t l, bool local, struc } else pstr = p; - if (getmask(f, l, local, &pstr, &c->c_lmask) == -1) + if (conf_getmask(f, l, local, &pstr, &c->c_lmask) == -1) goto out; if (d) { @@ -264,7 +268,7 @@ gethostport(const char *f, size_t l, bool local, struc sin6->sin6_len = sizeof(*sin6); #endif port = &sin6->sin6_port; - } + } } else if (pstr != p || strchr(p, '.') || conf_is_interface(p)) { if (pstr == p) pstr = "*"; @@ -300,7 +304,7 @@ gethostport(const char *f, size_t l, bool local, struc } } - if (getport(f, l, local, &c->c_port, pstr) == -1) + if (conf_getport(f, l, local, &c->c_port, pstr) == -1) return -1; if (port && c->c_port != FSTAR && c->c_port != FEQUAL) @@ -320,7 +324,7 @@ out2: } static int -getproto(const char *f, size_t l, bool local __unused, struct conf *c, +conf_getproto(const char *f, size_t l, bool local __unused, struct conf *c, const char *p) { if (strcmp(p, "stream") == 0) { @@ -331,22 +335,22 @@ getproto(const char *f, size_t l, bool local __unused, c->c_proto = IPPROTO_UDP; return 0; } - return getnum(f, l, local, &c->c_proto, "protocol", p); + return conf_getnum(f, l, local, &c->c_proto, "protocol", p); } static int -getfamily(const char *f, size_t l, bool local __unused, struct conf *c, +conf_getfamily(const char *f, size_t l, bool local __unused, struct conf *c, const char *p) { if (strncmp(p, "tcp", 3) == 0 || strncmp(p, "udp", 3) == 0) { c->c_family = p[3] == '6' ? AF_INET6 : AF_INET; return 0; } - return getnum(f, l, local, &c->c_family, "family", p); + return conf_getnum(f, l, local, &c->c_family, "family", p); } static int -getuid(const char *f, size_t l, bool local __unused, struct conf *c, +conf_getuid(const char *f, size_t l, bool local __unused, struct conf *c, const char *p) { struct passwd *pw; @@ -356,21 +360,22 @@ getuid(const char *f, size_t l, bool local __unused, s return 0; } - return getnum(f, l, local, &c->c_uid, "user", p); + return conf_getnum(f, l, local, &c->c_uid, "user", p); } static int -getname(const char *f, size_t l, bool local, struct conf *c, +conf_getname(const char *f, size_t l, bool local, struct conf *c, const char *p) { - if (getmask(f, l, local, &p, &c->c_rmask) == -1) + if (conf_getmask(f, l, local, &p, &c->c_rmask) == -1) return -1; - + if (strcmp(p, "*") == 0) { strlcpy(c->c_name, rulename, CONFNAMESZ); return 0; } + if (strcmp(p, "=") == 0) { if (local) goto out; @@ -406,19 +411,19 @@ conf_parseline(const char *f, size_t l, char *p, struc p++; memset(c, 0, sizeof(*c)); - e = getvalue(f, l, local, c, &p, gethostport); + e = getvalue(f, l, local, c, &p, conf_gethostport); if (e) return -1; - e = getvalue(f, l, local, c, &p, getproto); + e = getvalue(f, l, local, c, &p, conf_getproto); if (e) return -1; - e = getvalue(f, l, local, c, &p, getfamily); + e = getvalue(f, l, local, c, &p, conf_getfamily); if (e) return -1; - e = getvalue(f, l, local, c, &p, getuid); + e = getvalue(f, l, local, c, &p, conf_getuid); if (e) return -1; - e = getvalue(f, l, local, c, &p, getname); + e = getvalue(f, l, local, c, &p, conf_getname); if (e) return -1; - e = getvalue(f, l, local, c, &p, getnfail); + e = getvalue(f, l, local, c, &p, conf_getnfail); if (e) return -1; - e = getvalue(f, l, local, c, &p, getsecs); + e = getvalue(f, l, local, c, &p, conf_getsecs); if (e) return -1; return 0; @@ -473,7 +478,6 @@ conf_amask_eq(const void *v1, const void *v2, size_t l return 1; goto out; case FEQUAL: - (*lfun)(LOG_CRIT, "%s: Internal error: bad mask %d", __func__, mask); abort(); @@ -687,7 +691,7 @@ conf_addr_eq(const struct sockaddr_storage *s1, static int conf_eq(const struct conf *c1, const struct conf *c2) { - + if (!conf_addr_eq(&c1->c_ss, &c2->c_ss, c2->c_lmask)) return 0; @@ -744,7 +748,7 @@ fmtport(char *b, size_t l, int port) if (port == FSTAR) return; - if (b[0] == '\0' || strcmp(b, "*") == 0) + if (b[0] == '\0' || strcmp(b, "*") == 0) snprintf(b, l, "%d", port); else { snprintf(buf, sizeof(buf), ":%d", port); @@ -820,7 +824,7 @@ conf_print(char *buf, size_t len, const char *pref, co fmtmask(ha, sizeof(ha), c->c_family, c->c_lmask); fmtport(ha, sizeof(ha), c->c_port); - + sp = *delim == '\t' ? 20 : -1; hb[0] = '\0'; if (*delim) @@ -878,7 +882,7 @@ conf_merge(struct conf *c, const struct conf *sc) (*lfun)(LOG_DEBUG, "%s: %s", __func__, conf_print(buf, sizeof(buf), "to:\t", "", c)); } - + if (sc->c_name[0]) memcpy(c->c_name, sc->c_name, CONFNAMESZ); if (sc->c_uid != FEQUAL) @@ -998,32 +1002,73 @@ confset_match(const struct confset *cs, struct conf *c return i; } -const struct conf * -conf_find(int fd, uid_t uid, const struct sockaddr_storage *rss, - struct conf *cr) -{ - int proto; - socklen_t slen; - struct sockaddr_storage lss; - size_t i; - char buf[BUFSIZ]; +#ifdef AF_ROUTE +static int +conf_route_perm(int fd) { +/* Disable for now, the access check in the routing socket uses curlwp */ +#if defined(RTM_IFANNOUNCE) && defined(RT_ROUNDUP) + /* + * Send a routing message that is not supported to check for access + * We expect EOPNOTSUPP for having access, since we are sending a + * request the system does not understand and EACCES if we don't have + * access. + */ + static struct sockaddr_in sin = { +#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN + .sin_len = sizeof(sin), +#endif + .sin_family = AF_INET, + }; + char buf[4096]; + struct rt_msghdr *rtm = (void *)buf; + char *cp = (char *)(rtm + 1); + size_t l; - memset(cr, 0, sizeof(*cr)); - slen = sizeof(lss); - memset(&lss, 0, slen); - if (getsockname(fd, (void *)&lss, &slen) == -1) { - (*lfun)(LOG_ERR, "getsockname failed (%m)"); - return NULL; +#define NEXTADDR(s) \ + l = RT_ROUNDUP(sizeof(*s)); memmove(cp, s, l); cp += l; + memset(buf, 0, sizeof(buf)); + rtm->rtm_type = RTM_IFANNOUNCE; + rtm->rtm_flags = 0; + rtm->rtm_addrs = RTA_DST|RTA_GATEWAY; + rtm->rtm_version = RTM_VERSION; + rtm->rtm_seq = 666; + NEXTADDR(&sin); + NEXTADDR(&sin); + rtm->rtm_msglen = (u_short)((char *)cp - (char *)rtm); + if (write(fd, rtm, rtm->rtm_msglen) != -1) { + (*lfun)(LOG_ERR, "Writing to routing socket succeeded!"); + return 0; } + switch (errno) { + case EACCES: + return 0; + case EOPNOTSUPP: + return 1; + default: + (*lfun)(LOG_ERR, + "Unexpected error writing to routing socket (%m)"); + return 0; + } +#else + return 0; +#endif +} +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 13:46:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E8A7334B12; Mon, 15 Jun 2020 13:46:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lt0f3byKz4cl2; Mon, 15 Jun 2020 13:46:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76B0C1E909; Mon, 15 Jun 2020 13:46:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FDkgiE067155; Mon, 15 Jun 2020 13:46:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FDket7067145; Mon, 15 Jun 2020 13:46:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006151346.05FDket7067145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Jun 2020 13:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362198 - in vendor/blocklist/20200615: . bin diff etc etc/rc.d include lib libexec port test X-SVN-Group: vendor X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in vendor/blocklist/20200615: . bin diff etc etc/rc.d include lib libexec port test X-SVN-Commit-Revision: 362198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 13:46:42 -0000 Author: emaste Date: Mon Jun 15 13:46:40 2020 New Revision: 362198 URL: https://svnweb.freebsd.org/changeset/base/362198 Log: Tag 2020-06-15 blocklist snapshot Upstream git hash 7093cd90cc9eae6bf9fa6b66f679ea6b15451c1e Obtained from: https://github.com/zoulasc/blocklist Sponsored by: The FreeBSD Foundation Added: vendor/blocklist/20200615/ - copied from r362196, vendor/blocklist/dist/ vendor/blocklist/20200615/diff/postfix.diff - copied unchanged from r362197, vendor/blocklist/dist/diff/postfix.diff Replaced: vendor/blocklist/20200615/Makefile - copied unchanged from r362197, vendor/blocklist/dist/Makefile vendor/blocklist/20200615/Makefile.inc - copied unchanged from r362197, vendor/blocklist/dist/Makefile.inc vendor/blocklist/20200615/README - copied unchanged from r362197, vendor/blocklist/dist/README vendor/blocklist/20200615/TODO - copied unchanged from r362197, vendor/blocklist/dist/TODO vendor/blocklist/20200615/bin/Makefile - copied unchanged from r362197, vendor/blocklist/dist/bin/Makefile vendor/blocklist/20200615/bin/blocklistctl.8 - copied unchanged from r362197, vendor/blocklist/dist/bin/blocklistctl.8 vendor/blocklist/20200615/bin/blocklistctl.c - copied unchanged from r362197, vendor/blocklist/dist/bin/blocklistctl.c vendor/blocklist/20200615/bin/blocklistd.8 - copied unchanged from r362197, vendor/blocklist/dist/bin/blocklistd.8 vendor/blocklist/20200615/bin/blocklistd.c - copied unchanged from r362197, vendor/blocklist/dist/bin/blocklistd.c vendor/blocklist/20200615/bin/blocklistd.conf.5 - copied unchanged from r362197, vendor/blocklist/dist/bin/blocklistd.conf.5 vendor/blocklist/20200615/bin/conf.c - copied unchanged from r362197, vendor/blocklist/dist/bin/conf.c vendor/blocklist/20200615/bin/conf.h - copied unchanged from r362197, vendor/blocklist/dist/bin/conf.h vendor/blocklist/20200615/bin/internal.c - copied unchanged from r362197, vendor/blocklist/dist/bin/internal.c vendor/blocklist/20200615/bin/internal.h - copied unchanged from r362197, vendor/blocklist/dist/bin/internal.h vendor/blocklist/20200615/bin/run.c - copied unchanged from r362197, vendor/blocklist/dist/bin/run.c vendor/blocklist/20200615/bin/run.h - copied unchanged from r362197, vendor/blocklist/dist/bin/run.h vendor/blocklist/20200615/bin/state.c - copied unchanged from r362197, vendor/blocklist/dist/bin/state.c vendor/blocklist/20200615/bin/state.h - copied unchanged from r362197, vendor/blocklist/dist/bin/state.h vendor/blocklist/20200615/bin/support.c - copied unchanged from r362197, vendor/blocklist/dist/bin/support.c vendor/blocklist/20200615/bin/support.h - copied unchanged from r362197, vendor/blocklist/dist/bin/support.h vendor/blocklist/20200615/diff/ftpd.diff - copied unchanged from r362197, vendor/blocklist/dist/diff/ftpd.diff vendor/blocklist/20200615/diff/named.diff - copied unchanged from r362197, vendor/blocklist/dist/diff/named.diff vendor/blocklist/20200615/diff/proftpd.diff - copied unchanged from r362197, vendor/blocklist/dist/diff/proftpd.diff vendor/blocklist/20200615/diff/ssh.diff - copied unchanged from r362197, vendor/blocklist/dist/diff/ssh.diff vendor/blocklist/20200615/etc/Makefile - copied unchanged from r362197, vendor/blocklist/dist/etc/Makefile vendor/blocklist/20200615/etc/npf.conf - copied unchanged from r362197, vendor/blocklist/dist/etc/npf.conf vendor/blocklist/20200615/etc/rc.d/Makefile - copied unchanged from r362197, vendor/blocklist/dist/etc/rc.d/Makefile vendor/blocklist/20200615/etc/rc.d/blocklistd - copied unchanged from r362197, vendor/blocklist/dist/etc/rc.d/blocklistd vendor/blocklist/20200615/include/Makefile - copied unchanged from r362197, vendor/blocklist/dist/include/Makefile vendor/blocklist/20200615/include/bl.h - copied unchanged from r362197, vendor/blocklist/dist/include/bl.h vendor/blocklist/20200615/include/blocklist.h - copied unchanged from r362197, vendor/blocklist/dist/include/blocklist.h vendor/blocklist/20200615/lib/Makefile - copied unchanged from r362197, vendor/blocklist/dist/lib/Makefile vendor/blocklist/20200615/lib/bl.c - copied unchanged from r362197, vendor/blocklist/dist/lib/bl.c vendor/blocklist/20200615/lib/blocklist.c - copied unchanged from r362197, vendor/blocklist/dist/lib/blocklist.c vendor/blocklist/20200615/lib/libblocklist.3 - copied unchanged from r362197, vendor/blocklist/dist/lib/libblocklist.3 vendor/blocklist/20200615/libexec/Makefile - copied unchanged from r362197, vendor/blocklist/dist/libexec/Makefile vendor/blocklist/20200615/libexec/blocklistd-helper - copied unchanged from r362197, vendor/blocklist/dist/libexec/blocklistd-helper vendor/blocklist/20200615/port/Makefile.am - copied unchanged from r362197, vendor/blocklist/dist/port/Makefile.am vendor/blocklist/20200615/port/_strtoi.h - copied unchanged from r362197, vendor/blocklist/dist/port/_strtoi.h vendor/blocklist/20200615/port/configure.ac - copied unchanged from r362197, vendor/blocklist/dist/port/configure.ac vendor/blocklist/20200615/port/fgetln.c - copied unchanged from r362197, vendor/blocklist/dist/port/fgetln.c vendor/blocklist/20200615/port/fparseln.c - copied unchanged from r362197, vendor/blocklist/dist/port/fparseln.c vendor/blocklist/20200615/port/pidfile.c - copied unchanged from r362197, vendor/blocklist/dist/port/pidfile.c vendor/blocklist/20200615/port/popenve.c - copied unchanged from r362197, vendor/blocklist/dist/port/popenve.c vendor/blocklist/20200615/port/port.h - copied unchanged from r362197, vendor/blocklist/dist/port/port.h vendor/blocklist/20200615/port/sockaddr_snprintf.c - copied unchanged from r362197, vendor/blocklist/dist/port/sockaddr_snprintf.c vendor/blocklist/20200615/port/strlcat.c - copied unchanged from r362197, vendor/blocklist/dist/port/strlcat.c vendor/blocklist/20200615/port/strlcpy.c - copied unchanged from r362197, vendor/blocklist/dist/port/strlcpy.c vendor/blocklist/20200615/port/strtoi.c - copied unchanged from r362197, vendor/blocklist/dist/port/strtoi.c vendor/blocklist/20200615/test/Makefile - copied unchanged from r362197, vendor/blocklist/dist/test/Makefile vendor/blocklist/20200615/test/cltest.c - copied unchanged from r362197, vendor/blocklist/dist/test/cltest.c vendor/blocklist/20200615/test/srvtest.c - copied unchanged from r362197, vendor/blocklist/dist/test/srvtest.c Copied: vendor/blocklist/20200615/Makefile (from r362197, vendor/blocklist/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/Makefile Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/Makefile) @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2015/01/21 16:16:00 christos Exp $ + +SUBDIR = lib .WAIT include bin etc libexec + +.include Copied: vendor/blocklist/20200615/Makefile.inc (from r362197, vendor/blocklist/dist/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/Makefile.inc Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/Makefile.inc) @@ -0,0 +1,10 @@ +# $NetBSD: Makefile.inc,v 1.2 2015/01/22 04:20:50 christos Exp $ + +WARNS=6 +.if !defined(LIB) +LDADD+= -lblocklist +DPADD+= ${LIBBLOCKLIST} +.endif +CPPFLAGS+= -I${.CURDIR}/../include +CPPFLAGS+=-DHAVE_STRUCT_SOCKADDR_SA_LEN -DHAVE_UTIL_H -DHAVE_DB_H + Copied: vendor/blocklist/20200615/README (from r362197, vendor/blocklist/dist/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/README Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/README) @@ -0,0 +1,113 @@ +# $NetBSD: README,v 1.7 2015/01/26 00:34:50 christos Exp $ + +This package contains library that can be used by network daemons to +communicate with a packet filter via a daemon to enforce opening and +closing ports dynamically based on policy. + +The interface to the packet filter is in libexec/blocklistd-helper +(this is currently designed for npf) and the configuration file +(inspired from inetd.conf) is in etc/blocklistd.conf. + +On NetBSD you can find an example npf.conf and blocklistd.conf in +/usr/share/examples/blocklistd; you need to adjust the interface +in npf.conf and copy both files to /etc; then you just enable +blocklistd=YES in /etc/rc.conf, start it up, and you are all set. + +There is also a startup file in etc/rc.d/blocklistd + +Patches to various daemons to add blocklisting capabilitiers are in the +"diff" directory: + - OpenSSH: diff/ssh.diff [tcp socket example] + - Bind: diff/named.diff [both tcp and udp] + - ftpd: diff/ftpd.diff [tcp] + +These patches have been applied to NetBSD-current. + +The network daemon (for example sshd) communicates to blocklistd, via +a unix socket like syslog. The library calls are simple and everything +is handled by the library. In the simplest form the only thing the +daemon needs to do is to call: + + blocklist(action, acceptedfd, message); + +Where: + action = 0 -> successful login clear blocklist state + 1 -> failed login, add to the failed count + acceptedfd -> the file descriptor where the server is + connected to the remote client. It is used + to determine the listening socket, and the + remote address. This allows any program to + contact the blocklist daemon, since the verification + if the program has access to the listening + socket is done by virtue that the port + number is retrieved from the kernel. + message -> an optional string that is used in debugging logs. + +Unfortunately there is no way to get information about the "peer" +from a udp socket, because there is no connection and that information +is kept with the server. In that case the daemon can provide the +peer information to blocklistd via: + + blocklist_sa(action, acceptedfd, sockaddr, sockaddr_len, message); + +The configuration file contains entries of the form: + +# Blacklist rule +# host/Port type protocol owner name nfail disable +192.168.1.1:ssh stream tcp * -int 10 1m +8.8.8.8:ssh stream tcp * -ext 6 60m +ssh stream tcp6 * * 6 60m +http stream tcp * * 6 60m + +Here note that owner is * because the connection is done from the +child ssh socket which runs with user privs. We treat ipv4 connections +differently by maintaining two different rules one for the external +interface and one from the internal We also register for both tcp +and tcp6 since those are different listening sockets and addresses; +we don't bother with ipv6 and separate rules. We use nfail = 6, +because ssh allows 3 password attempts per connection, and this +will let us have 2 connections before blocking. Finally we block +for an hour; we could block forever too by specifying * in the +duration column. + +blocklistd and the library use syslog(3) to report errors. The +blocklist filter state is persisted automatically in /var/db/blocklistd.db +so that if the daemon is restarted, it remembers what connections +is currently handling. To start from a fresh state (if you restart +npf too for example), you can use -f. To watch the daemon at work, +you can use -d. + +The current control file is designed for npf, and it uses the +dynamic rule feature. You need to create a dynamic rule in your +/etc/npf.conf on the group referring to the interface you want to block +called blocklistd as follows: + +ext_if=bge0 +int_if=sk0 + +group "external" on $ext_if { + ... + ruleset "blocklistd-ext" + ruleset "blocklistd" + ... +} + +group "internal" on $int_if { + ... + ruleset "blocklistd-int" + ... +} + +You can use 'blocklistctl dump -a' to list all the current entries +in the database; the ones that have nfail / where urrent +>= otal, should have an id assosiated with them; this means that +there is a packet filter rule added for that entry. For npf, you +can examine the packet filter dynamic rule entries using 'npfctl +rule list'. The number of current entries can exceed +the total. This happens because entering packet filter rules is +asynchronous; there could be other connection before the rule +becomes activated. + +Enjoy, + +christos Copied: vendor/blocklist/20200615/TODO (from r362197, vendor/blocklist/dist/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/TODO Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/TODO) @@ -0,0 +1,21 @@ +# $NetBSD: TODO,v 1.6 2015/01/22 18:15:56 christos Exp $ + +- don't poll periodically, find the next timeout +- use the socket also for commands? Or separate socket? +- add functionality to the control program. Should it change the database + directly, or talk to the daemon to have it do it? +- perhaps handle interfaces too instead of addresses for dynamic ip? + ? What to do with multiple addresses? +- perhaps rate limit against DoS +- perhaps instead of scanning the list have a sparse map by port? +- do we want to use libnpf directly for efficiency? +- add more daemons ftpd? +- do we care about the db state becoming too large? +- instead of a yes = bump one, no = return to 0 interface, do we want + to have something more flexible like? + +n + -n + block + unblock +- do we need an api in blocklistctl to perform maintenance +- fix the blocklistctl output to be more user friendly Copied: vendor/blocklist/20200615/bin/Makefile (from r362197, vendor/blocklist/dist/bin/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/bin/Makefile Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/bin/Makefile) @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.10 2015/01/22 17:49:41 christos Exp $ + +BINDIR=/sbin + +PROGS=blocklistd blocklistctl +MAN.blocklistd=blocklistd.8 blocklistd.conf.5 +MAN.blocklistctl=blocklistctl.8 +SRCS.blocklistd = blocklistd.c conf.c run.c state.c support.c internal.c +SRCS.blocklistctl = blocklistctl.c conf.c state.c support.c internal.c +DBG=-g + +LDADD+=-lutil +DPADD+=${LIBUTIL} + +.include Copied: vendor/blocklist/20200615/bin/blocklistctl.8 (from r362197, vendor/blocklist/dist/bin/blocklistctl.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/bin/blocklistctl.8 Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/bin/blocklistctl.8) @@ -0,0 +1,86 @@ +.\" $NetBSD: blocklistctl.8,v 1.8 2016/06/07 17:31:02 christos Exp $ +.\" +.\" Copyright (c) 2015 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Christos Zoulas. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd June 7, 2016 +.Dt BLOCKLISTCTL 8 +.Os +.Sh NAME +.Nm blocklistctl +.Nd display and change the state of blocklistd +.Sh SYNOPSIS +.Nm +.Cm dump +.Op Fl abdnrw +.Sh DESCRIPTION +.Nm +is a program used to display the state of +.Xr blocklistd 8 +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl a +Show all database entries, by default it shows only the embryonic ones. +.It Fl b +Show only the blocked entries. +.It Fl d +Increase debugging level. +.It Fl n +Don't display a header. +.It Fl r +Show the remaining blocked time instead of the last activity time. +.It Fl w +Normally the width of addresses is good for IPv4, the +.Fl w +flag, makes the display wide enough for IPv6 addresses. +.El +.Sh SEE ALSO +.Xr blocklistd 8 +.Sh NOTES +Sometimes the reported number of failed attempts can exceed the number +of attempts that +.Xr blocklistd 8 +is configured to block. +This can happen either because the rule has been removed manually, or +because there were more attempts in flight while the rule block was being +added. +This condition is normal; in that case +.Xr blocklistd 8 +will first attempt to remove the existing rule, and then it will re-add +it to make sure that there is only one rule active. +.Sh HISTORY +.Nm +first appeared in +.Nx 7 . +.Fx +support for +.Nm +was implemented in +.Fx 11 . +.Sh AUTHORS +.An Christos Zoulas Copied: vendor/blocklist/20200615/bin/blocklistctl.c (from r362197, vendor/blocklist/dist/bin/blocklistctl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/bin/blocklistctl.c Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/bin/blocklistctl.c) @@ -0,0 +1,168 @@ +/* $NetBSD: blocklistctl.c,v 1.22 2018/05/24 19:19:37 christos Exp $ */ + +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +__RCSID("$NetBSD: blocklistctl.c,v 1.22 2018/05/24 19:19:37 christos Exp $"); + +#include +#include +#ifdef HAVE_LIBUTIL_H +#include +#endif +#ifdef HAVE_UTIL_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "conf.h" +#include "state.h" +#include "internal.h" +#include "support.h" + +static __dead void +usage(int c) +{ + if (c == 0) + warnx("Missing/unknown command"); + else + warnx("Unknown option `%c'", (char)c); + fprintf(stderr, "Usage: %s dump [-abdnrw]\n", getprogname()); + exit(EXIT_FAILURE); +} + +static const char * +star(char *buf, size_t len, int val) +{ + if (val == -1) + return "*"; + snprintf(buf, len, "%d", val); + return buf; +} + +int +main(int argc, char *argv[]) +{ + const char *dbname = _PATH_BLSTATE; + DB *db; + struct conf c; + struct dbinfo dbi; + unsigned int i; + struct timespec ts; + int all, blocked, remain, wide, noheader; + int o; + + noheader = wide = blocked = all = remain = 0; + lfun = dlog; + + if (argc == 1 || strcmp(argv[1], "dump") != 0) + usage(0); + + argc--; + argv++; + + while ((o = getopt(argc, argv, "abD:dnrw")) != -1) + switch (o) { + case 'a': + all = 1; + blocked = 0; + break; + case 'b': + blocked = 1; + break; + case 'D': + dbname = optarg; + break; + case 'd': + debug++; + break; + case 'n': + noheader = 1; + break; + case 'r': + remain = 1; + break; + case 'w': + wide = 1; + break; + default: + usage(o); + break; + } + + db = state_open(dbname, O_RDONLY, 0); + if (db == NULL) + err(EXIT_FAILURE, "Can't open `%s'", dbname); + + clock_gettime(CLOCK_REALTIME, &ts); + wide = wide ? 8 * 4 + 7 : 4 * 3 + 3; + if (!noheader) + printf("%*.*s/ma:port\tid\tnfail\t%s\n", wide, wide, + "address", remain ? "remaining time" : "last access"); + for (i = 1; state_iterate(db, &c, &dbi, i) != 0; i = 0) { + char buf[BUFSIZ]; + char mbuf[64], pbuf[64]; + if (!all) { + if (blocked) { + if (c.c_nfail == -1 || dbi.count < c.c_nfail) + continue; + } else { + if (dbi.count >= c.c_nfail) + continue; + } + } + sockaddr_snprintf(buf, sizeof(buf), "%a", (void *)&c.c_ss); + printf("%*.*s/%s:%s\t", wide, wide, buf, + star(mbuf, sizeof(mbuf), c.c_lmask), + star(pbuf, sizeof(pbuf), c.c_port)); + if (c.c_duration == -1) { + strlcpy(buf, "never", sizeof(buf)); + } else { + if (remain) + fmtydhms(buf, sizeof(buf), + c.c_duration - (ts.tv_sec - dbi.last)); + else + fmttime(buf, sizeof(buf), dbi.last); + } + printf("%s\t%d/%s\t%-s\n", dbi.id, dbi.count, + star(mbuf, sizeof(mbuf), c.c_nfail), buf); + } + state_close(db); + return EXIT_SUCCESS; +} Copied: vendor/blocklist/20200615/bin/blocklistd.8 (from r362197, vendor/blocklist/dist/bin/blocklistd.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/bin/blocklistd.8 Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/bin/blocklistd.8) @@ -0,0 +1,284 @@ +.\" $NetBSD: blocklistd.8,v 1.23 2020/04/21 13:57:12 christos Exp $ +.\" +.\" Copyright (c) 2015 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Christos Zoulas. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd April 21, 2020 +.Dt BLOCKLISTD 8 +.Os +.Sh NAME +.Nm blocklistd +.Nd block and release ports on demand to avoid DoS abuse +.Sh SYNOPSIS +.Nm +.Op Fl dfrv +.Op Fl C Ar controlprog +.Op Fl c Ar configfile +.Op Fl D Ar dbfile +.Op Fl P Ar sockpathsfile +.Op Fl R Ar rulename +.Op Fl s Ar sockpath +.Op Fl t Ar timeout +.Sh DESCRIPTION +.Nm +is a daemon similar to +.Xr syslogd 8 +that listens to sockets at paths specified in the +.Ar sockpathsfile +for notifications from other daemons about successful or failed connection +attempts. +If no such file is specified, then it only listens to the socket path +specified by +.Ar sockspath +or if that is not specified to +.Pa /var/run/blocklistd.sock . +Each notification contains an (action, port, protocol, address, owner) tuple +that identifies the remote connection and the action. +This tuple is consulted against entries in +.Ar configfile +with syntax specified in +.Xr blocklistd.conf 5 . +If an entry is matched, a state entry is created for that tuple. +Each entry contains a number of tries limit and a duration. +.Pp +The way +.Nm +does configuration entry matching is by having the client side pass the +file descriptor associated with the connection the client wants to blocklist +as well as passing socket credentials. +.Pp +The file descriptor is used to retrieve information (address and port) +about the remote side with +.Xr getpeername 2 +and the local side with +.Xr getsockname 2 . +.Pp +By examining the port of the local side, +.Nm +can determine if the client program +.Dq owns +the port. +By examining the optional address portion on the local side, it can match +interfaces. +By examining the remote address, it can match specific allow or deny rules. +.Pp +Finally +.Nm +can examine the socket credentials to match the user in the configuration file. +.Pp +While this works well for TCP sockets, it cannot be relied on for unbound +UDP sockets. +It is also less meaningful when it comes to connections using non-privileged +ports. +On the other hand, if we receive a request that has a local endpoint indicating +a UDP privileged port, we can presume that the client was privileged to be +able to acquire that port. +.Pp +Once an entry is matched +.Nm +can perform various actions. +If the action is +.Dq add +and the number of tries limit is reached, then a +control script +.Ar controlprog +is invoked with arguments: +.Bd -literal -offset indent +control add
+.Ed +.Pp +and should invoke a packet filter command to block the connection +specified by the arguments. +The +.Ar rulename +argument can be set from the command line (default +.Dv blocklistd ) . +The script could print a numerical id to stdout as a handle for +the rule that can be used later to remove that connection, but +that is not required as all information to remove the rule is +kept. +.Pp +If the action is +.Dq rem +Then the same control script is invoked as: +.Bd -literal -offset indent +control rem
+.Ed +.Pp +where +.Ar id +is the number returned from the +.Dq add +action. +.Pp +.Nm +maintains a database of known connections in +.Ar dbfile . +On startup it reads entries from that file, and updates its internal state. +.Pp +.Nm +checks the list of active entries every +.Ar timeout +seconds (default +.Dv 15 ) +and removes entries and block rules using the control program as necessary. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl C Ar controlprog +Use +.Ar controlprog +to communicate with the packet filter, usually +.Pa /libexec/blocklistd-helper . +The following arguments are passed to the control program: +.Bl -tag -width protocol +.It action +The action to perform: +.Dv add , +.Dv rem , +or +.Dv flush +to add, remove or flush a firewall rule. +.It name +The rule name. +.It protocol +The optional protocol name (can be empty): +.Dv tcp , +.Dv tcp6 , +.Dv udp , +.Dv udp6 . +.It address +The IPv4 or IPv6 numeric address to be blocked or released. +.It mask +The numeric mask to be applied to the blocked or released address +.It port +The optional numeric port to be blocked (can be empty). +.It id +For packet filters that support removal of rules by rule identifier, the +identifier of the rule to be removed. +The add command is expected to return the rule identifier string to stdout. +.El +.It Fl c Ar configuration +The name of the configuration file to read, usually +.Pa /etc/blocklistd.conf . +.It Fl D Ar dbfile +The Berkeley DB file where +.Nm +stores its state, usually +.Pa /var/db/blocklistd.db . +.It Fl d +Normally, +.Nm +disassociates itself from the terminal unless the +.Fl d +flag is specified, in which case it stays in the foreground. +.It Fl f +Truncate the state database and flush all the rules named +.Ar rulename +are deleted by invoking the control script as: +.Bd -literal -offset indent +control flush +.Ed +.It Fl P Ar sockspathsfile +A file containing a list of pathnames, one per line that +.Nm +will create sockets to listen to. +This is useful for chrooted environments. +.It Fl R Ar rulename +Specify the default rule name for the packet filter rules, usually +.Dv blocklistd . +.It Fl r +Re-read the firewall rules from the internal database, then +remove and re-add them. +This helps for packet filters that do not retain state across reboots. +.It Fl s Ar sockpath +Add +.Ar sockpath +to the list of Unix sockets +.Nm +listens to. +.It Fl t Ar timeout +The interval in seconds +.Nm +polls the state file to update the rules. +.It Fl v +Cause +.Nm +to print +diagnostic messages to +.Dv stdout +instead of +.Xr syslogd 8 . +.El +.Sh SIGNAL HANDLING +.Nm +deals with the following signals: +.Bl -tag -width "USR2" +.It Dv HUP +Receipt of this signal causes +.Nm +to re-read the configuration file. +.It Dv INT , Dv TERM & Dv QUIT +These signals tell +.Nm +to exit in an orderly fashion. +.It Dv USR1 +This signal tells +.Nm +to increase the internal debugging level by 1. +.It Dv USR2 +This signal tells +.Nm +to decrease the internal debugging level by 1. +.El +.Sh FILES +.Bl -tag -width /libexec/blocklistd-helper -compact +.It Pa /libexec/blocklistd-helper +Shell script invoked to interface with the packet filter. +.It Pa /etc/blocklistd.conf +Configuration file. +.It Pa /var/db/blocklistd.db +Database of current connection entries. +.It Pa /var/run/blocklistd.sock +Socket to receive connection notifications. +.El +.Sh SEE ALSO +.Xr blocklistd.conf 5 , +.Xr blocklistctl 8 , +.Xr npfctl 8 , +.Xr syslogd 8 +.Sh HISTORY +.Nm +first appeared in +.Nx 7 . +.Fx +support for +.Nm +was implemented in +.Fx 11 . +.Sh AUTHORS +.An Christos Zoulas Copied: vendor/blocklist/20200615/bin/blocklistd.c (from r362197, vendor/blocklist/dist/bin/blocklistd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/blocklist/20200615/bin/blocklistd.c Mon Jun 15 13:46:40 2020 (r362198, copy of r362197, vendor/blocklist/dist/bin/blocklistd.c) @@ -0,0 +1,576 @@ +/* $NetBSD: blocklistd.c,v 1.42 2020/03/11 02:33:18 roy Exp $ */ + +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +__RCSID("$NetBSD: blocklistd.c,v 1.42 2020/03/11 02:33:18 roy Exp $"); + +#include +#include +#include + +#ifdef HAVE_LIBUTIL_H +#include +#endif +#ifdef HAVE_UTIL_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bl.h" +#include "internal.h" +#include "conf.h" +#include "run.h" +#include "state.h" +#include "support.h" + +static const char *configfile = _PATH_BLCONF; +static DB *state; +static const char *dbfile = _PATH_BLSTATE; +static sig_atomic_t readconf; +static sig_atomic_t done; +static int vflag; + +static void +sigusr1(int n __unused) +{ + debug++; +} + +static void +sigusr2(int n __unused) +{ + debug--; +} + +static void +sighup(int n __unused) +{ + readconf++; +} + +static void +sigdone(int n __unused) +{ + done++; +} + +static __dead void +usage(int c) +{ + if (c) + warnx("Unknown option `%c'", (char)c); + fprintf(stderr, "Usage: %s [-vdfr] [-c ] [-R ] " + "[-P ] [-C ] [-D ] " + "[-s ] [-t ]\n", getprogname()); + exit(EXIT_FAILURE); +} + +static int +getremoteaddress(bl_info_t *bi, struct sockaddr_storage *rss, socklen_t *rsl) +{ + *rsl = sizeof(*rss); + memset(rss, 0, *rsl); + + if (getpeername(bi->bi_fd, (void *)rss, rsl) != -1) + return 0; + + if (errno != ENOTCONN) { + (*lfun)(LOG_ERR, "getpeername failed (%m)"); + return -1; + } + + if (bi->bi_slen == 0) { + (*lfun)(LOG_ERR, "unconnected socket with no peer in message"); + return -1; + } + + switch (bi->bi_ss.ss_family) { + case AF_INET: + *rsl = sizeof(struct sockaddr_in); + break; + case AF_INET6: + *rsl = sizeof(struct sockaddr_in6); + break; + default: + (*lfun)(LOG_ERR, "bad client passed socket family %u", + (unsigned)bi->bi_ss.ss_family); + return -1; + } + + if (*rsl != bi->bi_slen) { + (*lfun)(LOG_ERR, "bad client passed socket length %u != %u", + (unsigned)*rsl, (unsigned)bi->bi_slen); + return -1; + } + + memcpy(rss, &bi->bi_ss, *rsl); + +#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN + if (*rsl != rss->ss_len) { + (*lfun)(LOG_ERR, + "bad client passed socket internal length %u != %u", + (unsigned)*rsl, (unsigned)rss->ss_len); + return -1; + } +#endif + return 0; +} + +static void +process(bl_t bl) +{ + struct sockaddr_storage rss; + socklen_t rsl; + char rbuf[BUFSIZ]; + bl_info_t *bi; + struct conf c; + struct dbinfo dbi; + struct timespec ts; + + if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { + (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); + return; + } + + if ((bi = bl_recv(bl)) == NULL) { + (*lfun)(LOG_ERR, "no message (%m)"); + return; + } + + if (getremoteaddress(bi, &rss, &rsl) == -1) + goto out; + + if (debug) { + sockaddr_snprintf(rbuf, sizeof(rbuf), "%a:%p", (void *)&rss); + (*lfun)(LOG_DEBUG, "processing type=%d fd=%d remote=%s msg=%s" + " uid=%lu gid=%lu", bi->bi_type, bi->bi_fd, rbuf, + bi->bi_msg, (unsigned long)bi->bi_uid, + (unsigned long)bi->bi_gid); + } + + if (conf_find(bi->bi_fd, bi->bi_uid, &rss, &c) == NULL) { + (*lfun)(LOG_DEBUG, "no rule matched"); + goto out; + } + + + if (state_get(state, &c, &dbi) == -1) + goto out; + + if (debug) { + char b1[128], b2[128]; + (*lfun)(LOG_DEBUG, "%s: initial db state for %s: count=%d/%d " + "last=%s now=%s", __func__, rbuf, dbi.count, c.c_nfail, + fmttime(b1, sizeof(b1), dbi.last), + fmttime(b2, sizeof(b2), ts.tv_sec)); + } + + switch (bi->bi_type) { + case BL_ABUSE: + /* + * If the application has signaled abusive behavior, + * set the number of fails to be one less than the + * configured limit. Fallthrough to the normal BL_ADD + * processing, which will increment the failure count + * to the threshhold, and block the abusive address. + */ + if (c.c_nfail != -1) + dbi.count = c.c_nfail - 1; + /*FALLTHROUGH*/ + case BL_ADD: + dbi.count++; + dbi.last = ts.tv_sec; + if (c.c_nfail != -1 && dbi.count >= c.c_nfail) { + /* + * No point in re-adding the rule. + * It might exist already due to latency in processing + * and removing the rule is the wrong thing to do as + * it allows a window to attack again. + */ + if (dbi.id[0] == '\0') { + int res = run_change("add", &c, + dbi.id, sizeof(dbi.id)); + if (res == -1) + goto out; + } + sockaddr_snprintf(rbuf, sizeof(rbuf), "%a", + (void *)&rss); + (*lfun)(LOG_INFO, + "blocked %s/%d:%d for %d seconds", + rbuf, c.c_lmask, c.c_port, c.c_duration); + } + break; + case BL_DELETE: + if (dbi.last == 0) + goto out; + dbi.count = 0; + dbi.last = 0; + break; + case BL_BADUSER: + /* ignore for now */ + break; + default: + (*lfun)(LOG_ERR, "unknown message %d", bi->bi_type); + } + state_put(state, &c, &dbi); + +out: + close(bi->bi_fd); + + if (debug) { + char b1[128], b2[128]; + (*lfun)(LOG_DEBUG, "%s: final db state for %s: count=%d/%d " + "last=%s now=%s", __func__, rbuf, dbi.count, c.c_nfail, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 13:57:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B3B4335229; Mon, 15 Jun 2020 13:57:04 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49ltDb6ccdz4dk4; Mon, 15 Jun 2020 13:57:03 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 98DEE4C8; Mon, 15 Jun 2020 09:57:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 15 Jun 2020 09:57:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.dev; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=C hAE99alU9F4LRAMMsGeTTgUPfBLvA7Bs48Rk5qwpIw=; b=ixX+6L/lLP/9MBpDE ceHOoI7c4gTv6JsQY1i1RHvaEH98PqnHVIurUJb4F+2IXV6klmLv3a/14PZ1/Ral fIG/mjFUsWhpp2Vn/ey0MWB3RxYofdsPE476yS5Kst/+m1aTdlJV89+vWhYSbtiJ kaw9srlJAMe4j8GTzS/B2YFBYCQeMNXqhhg+lJNUGJjFTSDmbR6fjqaBuEiMXfhW F+oQZzP3JjdHVa3l7cm7i7MYVCgnkRiLYWljx3s2P8SZI4oKUYunDWSMg1yzxapj cjWEB+nZMhJeA0BfO4dv0nb3eH97hwZuNIVUXnXo3sVU1BpnbJoe2lj8cpBYbEoU HfspA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=ChAE99alU9F4LRAMMsGeTTgUPfBLvA7Bs48Rk5qwp Iw=; b=AM/SXglWIpKkAY084TwruPe1WyOr78+SfYbl/24U0/iySwUhXphs2CDhL AHL8m2xncBdErF4AKFy0PkhbsqNsbFlJJPCaJ9OaZ/M6ACNYDsFXBkFAGaPaF4Hf DcDZOn1JhcHqJLfBVmEx1eFaAz4tKOVYBu4k5QLnNiUU3u+K9tCrb8+t8f/5j4/Y Dp9Pt98dVkNYkS1PqbyMSNpnydcfYOT3RW6IN3C4enA9zyLMkpI799zeHLQbI5gl IubPcX0movmcYVQL48F7hTqkKFE1HnWUbjMxnLzgwSVcJslrev90Tl0cuXhZYXPn yTxcFg0ksK0JYS8GmTcGSLvtXXsUw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeikedgieelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpegjuhhrihcurfgrnhhkohhvuceohihurhhiphhvseihuhhr ihhpvhdruggvvheqnecuggftrfgrthhtvghrnhepveefvefgtefgueekfeejudeukeffje eugfeiteetueelvddttefhleehvdejteevnecuffhomhgrihhnpehfrhgvvggsshgurdho rhhgnecukfhppeeluddrvdegtddruddvgedrudefjeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuhhrihhpvheshihurhhiphhvrdguvghv X-ME-Proxy: Received: from [192.168.1.6] (unknown [91.240.124.137]) by mail.messagingengine.com (Postfix) with ESMTPA id CEA1B3280059; Mon, 15 Jun 2020 09:56:59 -0400 (EDT) Subject: Re: svn commit: r362191 - head/sbin/md5 To: Mateusz Piotrowski <0mp@FreeBSD.org>, rgrimes@freebsd.org, =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006151233.05FCXN4L076562@gndrsh.dnsmgr.net> <146239e5-081f-18f7-3a3b-54d912fb8bfd@FreeBSD.org> From: Yuri Pankov Message-ID: Date: Mon, 15 Jun 2020 16:56:59 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <146239e5-081f-18f7-3a3b-54d912fb8bfd@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49ltDb6ccdz4dk4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 13:57:04 -0000 Mateusz Piotrowski wrote: > Hi, > > On 6/15/20 2:33 PM, Rodney W. Grimes wrote: >> [ Charset UTF-8 unsupported, converting... ] >>> Author: fernape (ports committer) >>> Date: Mon Jun 15 10:08:02 2020 >>> New Revision: 362191 >>> URL: https://svnweb.freebsd.org/changeset/base/362191 >>> >>> Log: >>> md5(1): fix style in man page >> >> Mandoc is fine to ignore this, but it is wrong to call it useless. >> >> I really wish that this stop. .Tn might be useless to mandoc, >> but it is a very usable thing if your formatting to something >> other than txt, as in a ps or pdf. > > In that case I would consider patching our in-tree mandoc to not warn > about Tn. Or request support for Tn or a well-defined replacement upstream. > > I can see the benefit of keeping Tn around, as it /might/ potentially > create nice formatting for HTML. On the other hand, I don't like the > idea of not following the linter. It's marked as obsolete exactly because it's misused, quoting mdoc(7): Even though the macro name (“tradenameâ€) suggests a semantic function, historic usage is inconsistent, mostly using it as a presentation-level macro to request a small caps font. If we want to somehow emphasize the text, .Sy, .Em, or similar macros should be used instead, I don't see why though, it certainly doesn't help the readability (IMO, of coursE). From owner-svn-src-all@freebsd.org Mon Jun 15 14:58:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 372A9336F43; Mon, 15 Jun 2020 14:58:41 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lvbj0ntRz3TGw; Mon, 15 Jun 2020 14:58:41 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 131261F586; Mon, 15 Jun 2020 14:58:41 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FEweDs010760; Mon, 15 Jun 2020 14:58:40 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FEweZa010759; Mon, 15 Jun 2020 14:58:40 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202006151458.05FEweZa010759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Mon, 15 Jun 2020 14:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362199 - head/sys/netgraph/bluetooth/include X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/sys/netgraph/bluetooth/include X-SVN-Commit-Revision: 362199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 14:58:41 -0000 Author: takawata Date: Mon Jun 15 14:58:40 2020 New Revision: 362199 URL: https://svnweb.freebsd.org/changeset/base/362199 Log: Update event masks constant to Bluetooth core spec V5.2 and add LE Events. PR: 247257 Submitted by: Marc Veldman Modified: head/sys/netgraph/bluetooth/include/ng_hci.h Modified: head/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_hci.h Mon Jun 15 13:46:40 2020 (r362198) +++ head/sys/netgraph/bluetooth/include/ng_hci.h Mon Jun 15 14:58:40 2020 (r362199) @@ -225,7 +225,8 @@ /* 0x0010 - 0x8000 - reserved for future use */ /* Event masks */ -#define NG_HCI_EVMSK_ALL 0x00000000ffffffff +#define NG_HCI_EVMSK_DEFAULT 0x00001fffffffffff +#define NG_HCI_EVMSK_ALL 0x1fffffffffffffff #define NG_HCI_EVMSK_NONE 0x0000000000000000 #define NG_HCI_EVMSK_INQUIRY_COMPL 0x0000000000000001 #define NG_HCI_EVMSK_INQUIRY_RESULT 0x0000000000000002 @@ -259,7 +260,70 @@ #define NG_HCI_EVMSK_QOS_VIOLATION 0x0000000020000000 #define NG_HCI_EVMSK_PAGE_SCAN_MODE_CHANGE 0x0000000040000000 #define NG_HCI_EVMSK_PAGE_SCAN_REP_MODE_CHANGE 0x0000000080000000 -/* 0x0000000100000000 - 0x8000000000000000 - reserved for future use */ +#define NG_HCI_EVMSK_FLOW_SPEC_COMPL 0x0000000100000000 +#define NG_HCI_EVMSK_INQUIRY_RESULT_W_RSSI 0x0000000200000000 +#define NG_HCI_EVMSK_READ_REM_EXT_FEAT_COMPL 0x0000000400000000 + +/* 0x0000000800000000 - 0x0000080000000000 - not in use */ + +#define NG_HCI_EVMSK_SYNC_CONN_COMPL 0x0000100000000000 +#define NG_HCI_EVMSK_SYNC_CONN_CHANGED 0x0000200000000000 +#define NG_HCI_EVMSK_SNIFF_SUBRATING 0x0000400000000000 +#define NG_HCI_EVMSK_EXT_INQUIRY_RESULT 0x0000800000000000 +#define NG_HCI_EVMSK_ENC_KEY_REFRESH_COMPL 0x0001000000000000 +#define NG_HCI_EVMSK_IO_CAPABILITY_REQ 0x0002000000000000 +#define NG_HCI_EVMSK_IO_CAPABILITY_RESP 0x0004000000000000 +#define NG_HCI_EVMSK_USER_CONFIRMATION_REQ 0x0008000000000000 +#define NG_HCI_EVMSK_USER_PASSKEY_REQ 0x0010000000000000 +#define NG_HCI_EVMSK_REM_OOB_DATA_REQ 0x0020000000000000 +#define NG_HCI_EVMSK_SIMPLE_PAIRING_COMPL 0x0040000000000000 +#define NG_HCI_EVMSK_LINK_SUPERV_TO_CHANGED 0x0080000000000000 +#define NG_HCI_EVMSK_ENH_FLUSH_COMPL 0x0100000000000000 +#define NG_HCI_EVMSK_USER_PASSKEY_NOTIFICATION 0x0200000000000000 +#define NG_HCI_EVMSK_KEYPRESS_NOTIFICATION 0x0400000000000000 +#define NG_HCI_EVMSK_REM_HOST_SUPP_FEAT_NOTIFI 0x0800000000000000 +#define NG_HCI_EVMSK_LE_META 0x1000000000000000 +/* 0x1000000100000000 - 0x8000000000000000 - reserved for future use */ + +/* LE events masks*/ +#define NG_HCI_LEEVMSK_ALL 0x000000003fffffff +#define NG_HCI_LEEVMSK_NONE 0x0000000000000000 +#define NG_HCI_LEEVMSK_DEFAULT 0x000000000000001f +#define NG_HCI_LEEVMSK_CONN_COMPLETE 0x0000000000000001 +#define NG_HCI_LEEVMSK_ADV_REP 0x0000000000000002 +#define NG_HCI_LEEVMSK_CONN_UPDATE 0x0000000000000004 +#define NG_HCI_LEEVMSK_READ_REM_FEAT_REQ 0x0000000000000008 +#define NG_HCI_LEEVMSK_LONG_TERM_KEY_REQ 0x0000000000000010 +#define NG_HCI_LEEVMSK_REM_CONN_PARAM_REQ 0x0000000000000020 +#define NG_HCI_LEEVMSK_DATA_LENGTH_CHG 0x0000000000000040 +#define NG_HCI_LEEVMSK_RD_LOC_P256_PK_COMPL 0x0000000000000080 +#define NG_HCI_LEEVMSK_GEN_DHKEY_COMPL 0x0000000000000100 +#define NG_HCI_LEEVMSK_ENH_CONN_COMPL 0x0000000000000200 +#define NG_HCI_LEEVMSK_DIR_ADV_REP 0x0000000000000400 +#define NG_HCI_LEEVMSK_PHY_UPD_COMPL 0x0000000000000800 +#define NG_HCI_LEEVMSK_EXT_ADV_REP 0x0000000000001000 +#define NG_HCI_LEEVMSK_PER_ADV_SYNC_EST 0x0000000000002000 +#define NG_HCI_LEEVMSK_PER_ADV_REP 0x0000000000004000 +#define NG_HCI_LEEVMSK_PER_ADV_SYNC_LOST 0x0000000000008000 +#define NG_HCI_LEEVMSK_SCAN_TIMEOUT 0x0000000000010000 +#define NG_HCI_LEEVMSK_ADV_SET_TERM 0x0000000000020000 +#define NG_HCI_LEEVMSK_SCAN_REQ_RCVD 0x0000000000040000 +#define NG_HCI_LEEVMSK_CHAN_SEL_ALGO 0x0000000000080000 +#define NG_HCI_LEEVMSK_CONNLESS_IQ_REP 0x0000000000010000 +#define NG_HCI_LEEVMSK_CONN_IQ_REP 0x0000000000020000 +#define NG_HCI_LEEVMSK_CTE_REQ_FAILED 0x0000000000040000 +#define NG_HCI_LEEVMSK_PER_ADV_SYN_TRF_RCVD 0x0000000000080000 +#define NG_HCI_LEEVMSK_CIS_EST 0x0000000000100000 +#define NG_HCI_LEEVMSK_CIS_REQ 0x0000000000200000 +#define NG_HCI_LEEVMSK_CREATE_BIG_COMPL 0x0000000000400000 +#define NG_HCI_LEEVMSK_TERM_BIG_COMPL 0x0000000000800000 +#define NG_HCI_LEEVMSK_BIG_SYNC_EST 0x0000000001000000 +#define NG_HCI_LEEVMSK_BIG_SYNC_LOST 0x0000000002000000 +#define NG_HCI_LEEVMSK_REQ_PEER_SCA_COMPL 0x0000000004000000 +#define NG_HCI_LEEVMSK_PATH_LOSS_THRESHOLD 0x0000000008000000 +#define NG_HCI_LEEVMSK_TX_PWR_REP 0x0000000010000000 +#define NG_HCI_LEEVMSK_BIGINFO_ADV_REP 0x0000000020000000 +/* 0x0000000040000000 - 0x8000000000000000 - reserved for future use */ /* Filter types */ #define NG_HCI_FILTER_TYPE_NONE 0x00 From owner-svn-src-all@freebsd.org Mon Jun 15 15:47:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73E9B338380 for ; Mon, 15 Jun 2020 15:47:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lwh04lS6z3YGj for ; Mon, 15 Jun 2020 15:47:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x735.google.com with SMTP id n141so16160538qke.2 for ; Mon, 15 Jun 2020 08:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ABduOYTC/N5j7pR3JNvQwlP5VjVV/9ibuIYv4jerhOc=; b=C8ja9Db69k1Bx9Qg9LnwiSiFMYKqXOxQyXV7s7pmqWU/RRVHCe3UR1Na4hmvljgknP WpZfQKjZXGx16L8z+mzEuUG34lvPd0wAOmbsLzQxH6VnWs7v6OW9Hz18GqNfw/oPZPAu D5ESJy5YKLG+DZmSAmdLEq/KmM80hNg3KYP8IQZ4OJ9JPCn9ykZ7JPK5Plgf4V+rsK5/ 7oZjubg6p3LihxCSyIEkagTVJMAkZTcVBF6E/rHjUFYM1xSt4AiR4hBCBUBaTszonfa4 u2rktuKLD0wmc4k6XBLtc2oUIMCujtW/zZxgPDwE6gjXYe2J2TqCgRFwCXYiMdQdnLt3 t6WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ABduOYTC/N5j7pR3JNvQwlP5VjVV/9ibuIYv4jerhOc=; b=iI0wxdLItxQQTn/BFcjKR+EHR1f9Q7NuWcqEGmvx0lYKQUdPtqETJgXvPl17EsS+YR xAPHUs5blTOsGuO0RoFDP0JD2CBqIKJQ8AsYQ1qc5/C2N2VFEoKmubVSECm01OIhltoa d7BSLT+KNIwXS6gci28lNg0JZRQF2zMMx+R6LpOfbM1dQDEgbPTE7z47pnBW3wZR9lfO t55/f5b7XU4eSR9YrmBNz07ER+slz1ob76Nrom8AsIwPjOTPGiI671gKaBcaRKxeRGPb gq23/03Sg78nxWtmWPSuS5OZEqFplpNbizvJDURmlbUDa4eL4k29AX/2np31Lo8jhqpD 9X0w== X-Gm-Message-State: AOAM531H4BXH5DGKuBR2KtoX9TdvSlfqx3N7sfcjssOFWOjDbl84FBwz DLKCVSljm0o6G1eYrvLnOIJKwO/pTUOb8Mdjl7JJFA== X-Google-Smtp-Source: ABdhPJwjCRQ5yehuuJQesB4pNnibdVCienkrH9WKC7nABqqgUAK/8f82VdMRrO+nkRsJKeabuqdqUicDSGcwziFfsPA= X-Received: by 2002:a37:392:: with SMTP id 140mr15524006qkd.495.1592236047828; Mon, 15 Jun 2020 08:47:27 -0700 (PDT) MIME-Version: 1.0 References: <202006151233.05FCXN4L076562@gndrsh.dnsmgr.net> <146239e5-081f-18f7-3a3b-54d912fb8bfd@FreeBSD.org> In-Reply-To: <146239e5-081f-18f7-3a3b-54d912fb8bfd@FreeBSD.org> From: Warner Losh Date: Mon, 15 Jun 2020 09:47:16 -0600 Message-ID: Subject: Re: svn commit: r362191 - head/sbin/md5 To: Mateusz Piotrowski <0mp@freebsd.org> Cc: "Rodney W. Grimes" , =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49lwh04lS6z3YGj X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=C8ja9Db6; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::735) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.78)[-0.779]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.48)[-0.479]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.73)[-0.732]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::735:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 15:47:29 -0000 On Mon, Jun 15, 2020 at 7:34 AM Mateusz Piotrowski <0mp@freebsd.org> wrote: > Hi, > > On 6/15/20 2:33 PM, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: fernape (ports committer) > >> Date: Mon Jun 15 10:08:02 2020 > >> New Revision: 362191 > >> URL: https://svnweb.freebsd.org/changeset/base/362191 > >> > >> Log: > >> md5(1): fix style in man page > > > > Mandoc is fine to ignore this, but it is wrong to call it useless. > > > > I really wish that this stop. .Tn might be useless to mandoc, > > but it is a very usable thing if your formatting to something > > other than txt, as in a ps or pdf. > > In that case I would consider patching our in-tree mandoc to not warn > about Tn. Or request support for Tn or a well-defined replacement upstream. > > I can see the benefit of keeping Tn around, as it /might/ potentially > create nice formatting for HTML. On the other hand, I don't like the > idea of not following the linter. > I thought that Tn thing was the general consensus thing and added to the linter because of that. The man page explains why it's problematic: Tn word ... Supported only for compatibility, do not use this in new manuals. Even though the macro name ("tradename") suggests a semantic function, historic usage is inconsistent, mostly using it as a presentation-level macro to request a small caps font. It was useful for the Unix trademark, but was tailor towards AT&T's preferred dressing for the Unix trademark, not for trademarks in general. In this case, there were several instances of abuse: -.Tn RSA . +key under a public-key cryptosystem such as RSA. Not a trademark in this context. RSA is a trademark for the RSA corporation and it uses it in various other contexts. -The -.Tn MD5 -and -.Tn SHA-1 -algorithms have been proven to be vulnerable to practical collision -attacks and should not be relied upon to produce unique outputs, +The MD5 and SHA-1 algorithms have been proven to be vulnerable to practical +collision attacks and should not be relied upon to produce unique outputs, MD5 and SHA-1 are not trade names in this context. The rest seem similar, though I've not gone to the trouble to look them all up. All in all, while I have some sympathy to Rod's view that we're losing semantic information by these changes in general, this particular one actually fixes the abuse talked about in the mdoc manual, IMHO. Warner From owner-svn-src-all@freebsd.org Mon Jun 15 15:59:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D861F3386CE; Mon, 15 Jun 2020 15:59:44 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lwy85hCzz3ZfC; Mon, 15 Jun 2020 15:59:44 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDFA51FC65; Mon, 15 Jun 2020 15:59:44 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FFxixn050668; Mon, 15 Jun 2020 15:59:44 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FFxi1N050666; Mon, 15 Jun 2020 15:59:44 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <202006151559.05FFxi1N050666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Mon, 15 Jun 2020 15:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362200 - in stable/12/tools/tools/locale: etc/final-maps tools X-SVN-Group: stable-12 X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in stable/12/tools/tools/locale: etc/final-maps tools X-SVN-Commit-Revision: 362200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 15:59:44 -0000 Author: yuripv Date: Mon Jun 15 15:59:44 2020 New Revision: 362200 URL: https://svnweb.freebsd.org/changeset/base/362200 Log: MFC r353127: Pre-generate Big5 charmap from CLDR data. The one used previously was missing the characters in 0-127 range, making various tools try to escape them in output. PR: 235100 Reviewed by: bapt Tested by: Ting-Wei Lan Differential Revision: https://reviews.freebsd.org/D21794 Modified: stable/12/tools/tools/locale/etc/final-maps/map.Big5 (contents, props changed) stable/12/tools/tools/locale/tools/finalize Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/locale/etc/final-maps/map.Big5 ============================================================================== --- stable/12/tools/tools/locale/etc/final-maps/map.Big5 Mon Jun 15 14:58:40 2020 (r362199) +++ stable/12/tools/tools/locale/etc/final-maps/map.Big5 Mon Jun 15 15:59:44 2020 (r362200) @@ -1,13708 +1,13968 @@ +###################### +# POSIX charmap +# Generated automatically from the Unicode Character Database and Common Locale Data Repository +# see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html +# charset: Big5 +###################### +################################################################################################# +# Copyright 1991-2011 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in # +# http://www.unicode.org/copyright.html. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode # +# data files and any associated documentation (the "Data Files") or Unicode software and any # +# associated documentation (the "Software") to deal in the Data Files or Software without # +# restriction, including without limitation the rights to use, copy, modify, merge, publish, # +# distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom # +# the Data Files or Software are furnished to do so, provided that (a) the above copyright # +# notice(s) and this permission notice appear with all copies of the Data Files or Software, # +# (b) both the above copyright notice(s) and this permission notice appear in associated # +# documentation, and (c) there is clear notice in each modified Data File or in the Software as # +# well as in the documentation associated with the Data File(s) or Software that the data or # +# software has been modified. # +# # +# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # +# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT # +# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR # +# CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # +# CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. # +################################################################################################# + "Big5" - 1 - 2 + 1 + 2 + CHARMAP - \xa1\x40 - \xa1\x41 - \xa1\x42 - \xa1\x43 - \xa1\x44 - \xa1\x45 - \xa1\x46 - \xa1\x47 - \xa1\x48 - \xa1\x49 - \xa1\x4a - \xa1\x4b - \xa1\x4c - \xa1\x4d - \xa1\x4e - \xa1\x4f - \xa1\x50 - \xa1\x51 - \xa1\x52 - \xa1\x53 - \xa1\x54 - \xa1\x55 - \xa1\x56 - \xa1\x57 - \xa1\x58 - \xa1\x59 - \xa1\x5b - \xa1\x5c - \xa1\x5d - \xa1\x5e - \xa1\x5f - \xa1\x60 - \xa1\x61 - \xa1\x62 - \xa1\x63 - \xa1\x64 - \xa1\x65 - \xa1\x66 - \xa1\x67 - \xa1\x68 - \xa1\x69 - \xa1\x6a - \xa1\x6b - \xa1\x6c - \xa1\x6d - \xa1\x6e - \xa1\x6f - \xa1\x70 - \xa1\x71 - \xa1\x72 - \xa1\x73 - \xa1\x74 - \xa1\x75 - \xa1\x76 - \xa1\x77 - \xa1\x78 - \xa1\x79 - \xa1\x7a - \xa1\x7b - \xa1\x7c - \xa1\x7d - \xa1\x7e - \xa1\xa1 - \xa1\xa2 - \xa1\xa3 - \xa1\xa4 - \xa1\xa5 - \xa1\xa6 - \xa1\xa7 - \xa1\xa8 - \xa1\xa9 - \xa1\xaa - \xa1\xab - \xa1\xac - \xa1\xad - \xa1\xae - \xa1\xaf - \xa1\xb0 - \xa1\xb1 - \xa1\xb2 - \xa1\xb3 - \xa1\xb4 - \xa1\xb5 - \xa1\xb6 - \xa1\xb7 - \xa1\xb8 - \xa1\xb9 - \xa1\xba - \xa1\xbb - \xa1\xbc - \xa1\xbd - \xa1\xbe - \xa1\xbf - \xa1\xc0 - \xa1\xc1 - \xa1\xc2 - \xa1\xc4 - \xa1\xc6 - \xa1\xc7 - \xa1\xc8 - \xa1\xc9 - \xa1\xca - \xa1\xcb - \xa1\xcc - \xa1\xcd - \xa1\xce - \xa1\xcf - \xa1\xd0 - \xa1\xd1 - \xa1\xd2 - \xa1\xd3 - \xa1\xd4 - \xa1\xd5 - \xa1\xd6 - \xa1\xd7 - \xa1\xd8 - \xa1\xd9 - \xa1\xda - \xa1\xdb - \xa1\xdc - \xa1\xdd - \xa1\xde - \xa1\xdf - \xa1\xe0 - \xa1\xe1 - \xa1\xe2 - \xa1\xe3 - \xa1\xe4 - \xa1\xe5 - \xa1\xe6 - \xa1\xe7 - \xa1\xe8 - \xa1\xe9 - \xa1\xea - \xa1\xeb - \xa1\xec - \xa1\xed - \xa1\xee - \xa1\xef - \xa1\xf0 - \xa1\xf1 - \xa1\xf2 - \xa1\xf3 - \xa1\xf4 - \xa1\xf5 - \xa1\xf6 - \xa1\xf7 - \xa1\xf8 - \xa1\xf9 - \xa1\xfa - \xa1\xfb - \xa1\xfc - \xa1\xfd - \xa2\x41 - \xa2\x42 - \xa2\x43 - \xa2\x44 - \xa2\x45 - \xa2\x46 - \xa2\x47 - \xa2\x48 - \xa2\x49 - \xa2\x4a - \xa2\x4b - \xa2\x4c - \xa2\x4d - \xa2\x4e - \xa2\x4f - \xa2\x50 - \xa2\x51 - \xa2\x52 - \xa2\x53 - \xa2\x54 - \xa2\x55 - \xa2\x56 - \xa2\x57 - \xa2\x58 - \xa2\x59 - \xa2\x5a - \xa2\x5b - \xa2\x5c - \xa2\x5d - \xa2\x5e - \xa2\x5f - \xa2\x60 - \xa2\x61 - \xa2\x62 - \xa2\x63 - \xa2\x64 - \xa2\x65 - \xa2\x66 - \xa2\x67 - \xa2\x68 - \xa2\x69 - \xa2\x6a - \xa2\x6b - \xa2\x6c - \xa2\x6d - \xa2\x6e - \xa2\x6f - \xa2\x70 - \xa2\x71 - \xa2\x72 - \xa2\x73 - \xa2\x74 - \xa2\x75 - \xa2\x76 - \xa2\x77 - \xa2\x78 - \xa2\x79 - \xa2\x7a - \xa2\x7b - \xa2\x7c - \xa2\x7d - \xa2\x7e - \xa2\xa1 - \xa2\xa2 - \xa2\xa3 - \xa2\xa4 - \xa2\xa5 - \xa2\xa6 - \xa2\xa7 - \xa2\xa8 - \xa2\xa9 - \xa2\xaa - \xa2\xab - \xa2\xac - \xa2\xad - \xa2\xae - \xa2\xaf - \xa2\xb0 - \xa2\xb1 - \xa2\xb2 - \xa2\xb3 - \xa2\xb4 - \xa2\xb5 - \xa2\xb6 - \xa2\xb7 - \xa2\xb8 - \xa2\xb9 - \xa2\xba - \xa2\xbb - \xa2\xbc - \xa2\xbd - \xa2\xbe - \xa2\xbf - \xa2\xc0 - \xa2\xc1 - \xa2\xc2 - \xa2\xc3 - \xa2\xc4 - \xa2\xc5 - \xa2\xc6 - \xa2\xc7 - \xa2\xc8 - \xa2\xc9 - \xa2\xca - \xa2\xcb - \xa2\xcd - \xa2\xcf - \xa2\xd0 - \xa2\xd1 - \xa2\xd2 - \xa2\xd3 - \xa2\xd4 - \xa2\xd5 - \xa2\xd6 - \xa2\xd7 - \xa2\xd8 - \xa2\xd9 - \xa2\xda - \xa2\xdb - \xa2\xdc - \xa2\xdd - \xa2\xde - \xa2\xdf - \xa2\xe0 - \xa2\xe1 - \xa2\xe2 - \xa2\xe3 - \xa2\xe4 - \xa2\xe5 - \xa2\xe6 - \xa2\xe7 - \xa2\xe8 - \xa2\xe9 - \xa2\xea - \xa2\xeb - \xa2\xec - \xa2\xed - \xa2\xee - \xa2\xef - \xa2\xf0 - \xa2\xf1 - \xa2\xf2 - \xa2\xf3 - \xa2\xf4 - \xa2\xf5 - \xa2\xf6 - \xa2\xf7 - \xa2\xf8 - \xa2\xf9 - \xa2\xfa - \xa2\xfb - \xa2\xfc - \xa2\xfd - \xa2\xfe - \xa3\x40 - \xa3\x41 - \xa3\x42 - \xa3\x43 - \xa3\x44 - \xa3\x45 - \xa3\x46 - \xa3\x47 - \xa3\x48 - \xa3\x49 - \xa3\x4a - \xa3\x4b - \xa3\x4c - \xa3\x4d - \xa3\x4e - \xa3\x4f - \xa3\x50 - \xa3\x51 - \xa3\x52 - \xa3\x53 - \xa3\x54 - \xa3\x55 - \xa3\x56 - \xa3\x57 - \xa3\x58 - \xa3\x59 - \xa3\x5a - \xa3\x5b - \xa3\x5c - \xa3\x5d - \xa3\x5e - \xa3\x5f - \xa3\x60 - \xa3\x61 - \xa3\x62 - \xa3\x63 - \xa3\x64 - \xa3\x65 - \xa3\x66 - \xa3\x67 - \xa3\x68 - \xa3\x69 - \xa3\x6a - \xa3\x6b - \xa3\x6c - \xa3\x6d - \xa3\x6e - \xa3\x6f - \xa3\x70 - \xa3\x71 - \xa3\x72 - \xa3\x73 - \xa3\x74 - \xa3\x75 - \xa3\x76 - \xa3\x77 - \xa3\x78 - \xa3\x79 - \xa3\x7a - \xa3\x7b - \xa3\x7c - \xa3\x7d - \xa3\x7e - \xa3\xa1 - \xa3\xa2 - \xa3\xa3 - \xa3\xa4 - \xa3\xa5 - \xa3\xa6 - \xa3\xa7 - \xa3\xa8 - \xa3\xa9 - \xa3\xaa - \xa3\xab - \xa3\xac - \xa3\xad - \xa3\xae - \xa3\xaf - \xa3\xb0 - \xa3\xb1 - \xa3\xb2 - \xa3\xb3 - \xa3\xb4 - \xa3\xb5 - \xa3\xb6 - \xa3\xb7 - \xa3\xb8 - \xa3\xb9 - \xa3\xba - \xa3\xbb - \xa3\xbc - \xa3\xbd - \xa3\xbe - \xa3\xbf - \xa4\x40 - \xa4\x41 - \xa4\x42 - \xa4\x43 - \xa4\x44 - \xa4\x45 - \xa4\x46 - \xa4\x47 - \xa4\x48 - \xa4\x49 - \xa4\x4a - \xa4\x4b - \xa4\x4c - \xa4\x4d - \xa4\x4e - \xa4\x4f - \xa4\x50 - \xa4\x51 - \xa4\x52 - \xa4\x53 - \xa4\x54 - \xa4\x55 - \xa4\x56 - \xa4\x57 - \xa4\x58 - \xa4\x59 - \xa4\x5a - \xa4\x5b - \xa4\x5c - \xa4\x5d - \xa4\x5e - \xa4\x5f - \xa4\x60 - \xa4\x61 - \xa4\x62 - \xa4\x63 - \xa4\x64 - \xa4\x65 - \xa4\x66 - \xa4\x67 - \xa4\x68 - \xa4\x69 - \xa4\x6a - \xa4\x6b - \xa4\x6c - \xa4\x6d - \xa4\x6e - \xa4\x6f - \xa4\x70 - \xa4\x71 - \xa4\x72 - \xa4\x73 - \xa4\x74 - \xa4\x75 - \xa4\x76 - \xa4\x77 - \xa4\x78 - \xa4\x79 - \xa4\x7a - \xa4\x7b - \xa4\x7c - \xa4\x7d - \xa4\x7e - \xa4\xa1 - \xa4\xa2 - \xa4\xa3 - \xa4\xa4 - \xa4\xa5 - \xa4\xa6 - \xa4\xa7 - \xa4\xa8 - \xa4\xa9 - \xa4\xaa - \xa4\xab - \xa4\xac - \xa4\xad - \xa4\xae - \xa4\xaf - \xa4\xb0 - \xa4\xb1 - \xa4\xb2 - \xa4\xb3 - \xa4\xb4 - \xa4\xb5 - \xa4\xb6 - \xa4\xb7 - \xa4\xb8 - \xa4\xb9 - \xa4\xba - \xa4\xbb - \xa4\xbc - \xa4\xbd - \xa4\xbe - \xa4\xbf - \xa4\xc0 - \xa4\xc1 - \xa4\xc2 - \xa4\xc3 - \xa4\xc4 - \xa4\xc5 - \xa4\xc6 - \xa4\xc7 - \xa4\xc8 - \xa4\xc9 - \xa4\xca - \xa4\xcb - \xa4\xcc - \xa4\xcd - \xa4\xce - \xa4\xcf - \xa4\xd0 - \xa4\xd1 - \xa4\xd2 - \xa4\xd3 - \xa4\xd4 - \xa4\xd5 - \xa4\xd6 - \xa4\xd7 - \xa4\xd8 - \xa4\xd9 - \xa4\xda - \xa4\xdb - \xa4\xdc - \xa4\xdd - \xa4\xde - \xa4\xdf - \xa4\xe0 - \xa4\xe1 - \xa4\xe2 - \xa4\xe3 - \xa4\xe4 - \xa4\xe5 - \xa4\xe6 - \xa4\xe7 - \xa4\xe8 - \xa4\xe9 - \xa4\xea - \xa4\xeb - \xa4\xec - \xa4\xed - \xa4\xee - \xa4\xef - \xa4\xf0 - \xa4\xf1 - \xa4\xf2 - \xa4\xf3 - \xa4\xf4 - \xa4\xf5 - \xa4\xf6 - \xa4\xf7 - \xa4\xf8 - \xa4\xf9 - \xa4\xfa - \xa4\xfb - \xa4\xfc - \xa4\xfd - \xa4\xfe - \xa5\x40 - \xa5\x41 - \xa5\x42 - \xa5\x43 - \xa5\x44 - \xa5\x45 - \xa5\x46 - \xa5\x47 - \xa5\x48 - \xa5\x49 - \xa5\x4a - \xa5\x4b - \xa5\x4c - \xa5\x4d - \xa5\x4e - \xa5\x4f - \xa5\x50 - \xa5\x51 - \xa5\x52 - \xa5\x53 - \xa5\x54 - \xa5\x55 - \xa5\x56 - \xa5\x57 - \xa5\x58 - \xa5\x59 - \xa5\x5a - \xa5\x5b - \xa5\x5c - \xa5\x5d - \xa5\x5e - \xa5\x5f - \xa5\x60 - \xa5\x61 - \xa5\x62 - \xa5\x63 - \xa5\x64 - \xa5\x65 - \xa5\x66 - \xa5\x67 - \xa5\x68 - \xa5\x69 - \xa5\x6a - \xa5\x6b - \xa5\x6c - \xa5\x6d - \xa5\x6e - \xa5\x6f - \xa5\x70 - \xa5\x71 - \xa5\x72 - \xa5\x73 - \xa5\x74 - \xa5\x75 - \xa5\x76 - \xa5\x77 - \xa5\x78 - \xa5\x79 - \xa5\x7a - \xa5\x7b - \xa5\x7c - \xa5\x7d - \xa5\x7e - \xa5\xa1 - \xa5\xa2 - \xa5\xa3 - \xa5\xa4 - \xa5\xa5 - \xa5\xa6 - \xa5\xa7 - \xa5\xa8 - \xa5\xa9 - \xa5\xaa - \xa5\xab - \xa5\xac - \xa5\xad - \xa5\xae - \xa5\xaf - \xa5\xb0 - \xa5\xb1 - \xa5\xb2 - \xa5\xb3 - \xa5\xb4 - \xa5\xb5 - \xa5\xb6 - \xa5\xb7 - \xa5\xb8 - \xa5\xb9 - \xa5\xba - \xa5\xbb - \xa5\xbc - \xa5\xbd - \xa5\xbe - \xa5\xbf - \xa5\xc0 - \xa5\xc1 - \xa5\xc2 - \xa5\xc3 - \xa5\xc4 - \xa5\xc5 - \xa5\xc6 - \xa5\xc7 - \xa5\xc8 - \xa5\xc9 - \xa5\xca - \xa5\xcb - \xa5\xcc - \xa5\xcd - \xa5\xce - \xa5\xcf - \xa5\xd0 - \xa5\xd1 - \xa5\xd2 - \xa5\xd3 - \xa5\xd4 - \xa5\xd5 - \xa5\xd6 - \xa5\xd7 - \xa5\xd8 - \xa5\xd9 - \xa5\xda - \xa5\xdb - \xa5\xdc - \xa5\xdd - \xa5\xde - \xa5\xdf - \xa5\xe0 - \xa5\xe1 - \xa5\xe2 - \xa5\xe3 - \xa5\xe4 - \xa5\xe5 - \xa5\xe6 - \xa5\xe7 - \xa5\xe8 - \xa5\xe9 - \xa5\xea - \xa5\xeb - \xa5\xec - \xa5\xed - \xa5\xee - \xa5\xef - \xa5\xf0 - \xa5\xf1 - \xa5\xf2 - \xa5\xf3 - \xa5\xf4 - \xa5\xf5 - \xa5\xf6 - \xa5\xf7 - \xa5\xf8 - \xa5\xf9 - \xa5\xfa - \xa5\xfb - \xa5\xfc - \xa5\xfd - \xa5\xfe - \xa6\x40 - \xa6\x41 - \xa6\x42 - \xa6\x43 - \xa6\x44 - \xa6\x45 - \xa6\x46 - \xa6\x47 - \xa6\x48 - \xa6\x49 - \xa6\x4a - \xa6\x4b - \xa6\x4c - \xa6\x4d - \xa6\x4e - \xa6\x4f - \xa6\x50 - \xa6\x51 - \xa6\x52 - \xa6\x53 - \xa6\x54 - \xa6\x55 - \xa6\x56 - \xa6\x57 - \xa6\x58 - \xa6\x59 - \xa6\x5a - \xa6\x5b - \xa6\x5c - \xa6\x5d - \xa6\x5e - \xa6\x5f - \xa6\x60 - \xa6\x61 - \xa6\x62 - \xa6\x63 - \xa6\x64 - \xa6\x65 - \xa6\x66 - \xa6\x67 - \xa6\x68 - \xa6\x69 - \xa6\x6a - \xa6\x6b - \xa6\x6c - \xa6\x6d - \xa6\x6e - \xa6\x6f - \xa6\x70 - \xa6\x71 - \xa6\x72 - \xa6\x73 - \xa6\x74 - \xa6\x75 - \xa6\x76 - \xa6\x77 - \xa6\x78 - \xa6\x79 - \xa6\x7a - \xa6\x7b - \xa6\x7c - \xa6\x7d - \xa6\x7e - \xa6\xa1 - \xa6\xa2 - \xa6\xa3 - \xa6\xa4 - \xa6\xa5 - \xa6\xa6 - \xa6\xa7 - \xa6\xa8 - \xa6\xa9 - \xa6\xaa - \xa6\xab - \xa6\xac - \xa6\xad - \xa6\xae - \xa6\xaf - \xa6\xb0 - \xa6\xb1 - \xa6\xb2 - \xa6\xb3 - \xa6\xb4 - \xa6\xb5 - \xa6\xb6 - \xa6\xb7 - \xa6\xb8 - \xa6\xb9 - \xa6\xba - \xa6\xbb - \xa6\xbc - \xa6\xbd - \xa6\xbe - \xa6\xbf - \xa6\xc0 - \xa6\xc1 - \xa6\xc2 - \xa6\xc3 - \xa6\xc4 - \xa6\xc5 - \xa6\xc6 - \xa6\xc7 - \xa6\xc8 - \xa6\xc9 - \xa6\xca - \xa6\xcb - \xa6\xcc - \xa6\xcd - \xa6\xce - \xa6\xcf - \xa6\xd0 - \xa6\xd1 - \xa6\xd2 - \xa6\xd3 - \xa6\xd4 - \xa6\xd5 - \xa6\xd6 - \xa6\xd7 - \xa6\xd8 - \xa6\xd9 - \xa6\xda - \xa6\xdb - \xa6\xdc - \xa6\xdd - \xa6\xde - \xa6\xdf - \xa6\xe0 - \xa6\xe1 - \xa6\xe2 - \xa6\xe3 - \xa6\xe4 - \xa6\xe5 - \xa6\xe6 - \xa6\xe7 - \xa6\xe8 - \xa6\xe9 - \xa6\xea - \xa6\xeb - \xa6\xec - \xa6\xed - \xa6\xee - \xa6\xef - \xa6\xf0 - \xa6\xf1 - \xa6\xf2 - \xa6\xf3 - \xa6\xf4 - \xa6\xf5 - \xa6\xf6 - \xa6\xf7 - \xa6\xf8 - \xa6\xf9 - \xa6\xfa - \xa6\xfb - \xa6\xfc - \xa6\xfd - \xa6\xfe - \xa7\x40 - \xa7\x41 - \xa7\x42 - \xa7\x43 - \xa7\x44 - \xa7\x45 - \xa7\x46 - \xa7\x47 - \xa7\x48 - \xa7\x49 - \xa7\x4a - \xa7\x4b - \xa7\x4c - \xa7\x4d - \xa7\x4e - \xa7\x4f - \xa7\x50 - \xa7\x51 - \xa7\x52 - \xa7\x53 - \xa7\x54 - \xa7\x55 - \xa7\x56 - \xa7\x57 - \xa7\x58 - \xa7\x59 - \xa7\x5a - \xa7\x5b - \xa7\x5c - \xa7\x5d - \xa7\x5e - \xa7\x5f - \xa7\x60 - \xa7\x61 - \xa7\x62 - \xa7\x63 - \xa7\x64 - \xa7\x65 - \xa7\x66 - \xa7\x67 - \xa7\x68 - \xa7\x69 - \xa7\x6a - \xa7\x6b - \xa7\x6c - \xa7\x6d - \xa7\x6e - \xa7\x6f - \xa7\x70 - \xa7\x71 - \xa7\x72 - \xa7\x73 - \xa7\x74 - \xa7\x75 - \xa7\x76 - \xa7\x77 - \xa7\x78 - \xa7\x79 - \xa7\x7a - \xa7\x7b - \xa7\x7c - \xa7\x7d - \xa7\x7e - \xa7\xa1 - \xa7\xa2 - \xa7\xa3 - \xa7\xa4 - \xa7\xa5 - \xa7\xa6 - \xa7\xa7 - \xa7\xa8 - \xa7\xa9 - \xa7\xaa - \xa7\xab - \xa7\xac - \xa7\xad - \xa7\xae - \xa7\xaf - \xa7\xb0 - \xa7\xb1 - \xa7\xb2 - \xa7\xb3 - \xa7\xb4 - \xa7\xb5 - \xa7\xb6 - \xa7\xb7 - \xa7\xb8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 16:35:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5373A33980B; Mon, 15 Jun 2020 16:35:29 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lxlP1YqFz3d87; Mon, 15 Jun 2020 16:35:29 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30CFB2045A; Mon, 15 Jun 2020 16:35:29 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FGZSmr076675; Mon, 15 Jun 2020 16:35:28 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FGZRDA076670; Mon, 15 Jun 2020 16:35:27 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202006151635.05FGZRDA076670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 15 Jun 2020 16:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362201 - in head/sys/dev: cxgb cxgbe mlx4/mlx4_en mlx5/mlx5_en mxge oce X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head/sys/dev: cxgb cxgbe mlx4/mlx4_en mlx5/mlx5_en mxge oce X-SVN-Commit-Revision: 362201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 16:35:29 -0000 Author: freqlabs Date: Mon Jun 15 16:35:27 2020 New Revision: 362201 URL: https://svnweb.freebsd.org/changeset/base/362201 Log: Avoid trying to toggle TSO twice Remove TSO from the toggle mask when automatically disabled by TXCKSUM* in various NIC drivers. Reviewed by: hselasky, np, gallatin, jpaetzel Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25120 Modified: head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mxge/if_mxge.c head/sys/dev/oce/oce_if.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/cxgb/cxgb_main.c Mon Jun 15 16:35:27 2020 (r362201) @@ -1964,6 +1964,7 @@ fail: if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~IFCAP_TSO4; if_printf(ifp, "tso4 disabled due to -txcsum.\n"); @@ -1975,6 +1976,7 @@ fail: if (IFCAP_TSO6 & ifp->if_capenable && !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~IFCAP_TSO6; if_printf(ifp, "tso6 disabled due to -txcsum6.\n"); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/cxgbe/t4_main.c Mon Jun 15 16:35:27 2020 (r362201) @@ -1989,6 +1989,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~IFCAP_TSO4; if_printf(ifp, "tso4 disabled due to -txcsum.\n"); @@ -2000,6 +2001,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd if (IFCAP_TSO6 & ifp->if_capenable && !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~IFCAP_TSO6; if_printf(ifp, "tso6 disabled due to -txcsum6.\n"); Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Jun 15 16:35:27 2020 (r362201) @@ -2006,6 +2006,7 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long com if (IFCAP_TSO4 & dev->if_capenable && !(IFCAP_TXCSUM & dev->if_capenable)) { + mask &= ~IFCAP_TSO4; dev->if_capenable &= ~IFCAP_TSO4; dev->if_hwassist &= ~CSUM_IP_TSO; if_printf(dev, @@ -2018,6 +2019,7 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long com if (IFCAP_TSO6 & dev->if_capenable && !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) { + mask &= ~IFCAP_TSO6; dev->if_capenable &= ~IFCAP_TSO6; dev->if_hwassist &= ~CSUM_IP6_TSO; if_printf(dev, Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jun 15 16:35:27 2020 (r362201) @@ -3323,6 +3323,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_IP_TSO; mlx5_en_err(ifp, @@ -3335,6 +3336,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t if (IFCAP_TSO6 & ifp->if_capenable && !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~IFCAP_TSO6; ifp->if_hwassist &= ~CSUM_IP6_TSO; mlx5_en_err(ifp, Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/mxge/if_mxge.c Mon Jun 15 16:35:27 2020 (r362201) @@ -4223,13 +4223,15 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { if (IFCAP_TXCSUM & ifp->if_capenable) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4); ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP); } else { ifp->if_capenable |= IFCAP_TXCSUM; ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); } - } else if (mask & IFCAP_RXCSUM) { + } + if (mask & IFCAP_RXCSUM) { if (IFCAP_RXCSUM & ifp->if_capenable) { ifp->if_capenable &= ~IFCAP_RXCSUM; } else { @@ -4251,6 +4253,7 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t #if IFCAP_TSO6 if (mask & IFCAP_TXCSUM_IPV6) { if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6 | IFCAP_TSO6); ifp->if_hwassist &= ~(CSUM_TCP_IPV6 @@ -4260,7 +4263,8 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6); } - } else if (mask & IFCAP_RXCSUM_IPV6) { + } + if (mask & IFCAP_RXCSUM_IPV6) { if (IFCAP_RXCSUM_IPV6 & ifp->if_capenable) { ifp->if_capenable &= ~IFCAP_RXCSUM_IPV6; } else { Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/oce/oce_if.c Mon Jun 15 16:35:27 2020 (r362201) @@ -539,6 +539,7 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d if (IFCAP_TSO & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + u &= ~IFCAP_TSO; ifp->if_capenable &= ~IFCAP_TSO; ifp->if_hwassist &= ~CSUM_TSO; if_printf(ifp, From owner-svn-src-all@freebsd.org Mon Jun 15 18:45:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E9E033CBB9; Mon, 15 Jun 2020 18:45:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m0dZ0r31z45Gv; Mon, 15 Jun 2020 18:45:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:cd19:4bb2:5f88:2d0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id CE7072A32E; Mon, 15 Jun 2020 18:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r362152 - head/usr.bin/ldd To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006131821.05DILVnR053798@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 15 Jun 2020 11:45:31 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202006131821.05DILVnR053798@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 18:45:40 -0000 On 6/13/20 11:21 AM, Konstantin Belousov wrote: > Author: kib > Date: Sat Jun 13 18:21:31 2020 > New Revision: 362152 > URL: https://svnweb.freebsd.org/changeset/base/362152 > > Log: > Fix ldd for PIE binaries after rtld stopped accepting binaries for dlopen. > > ldd proclaims ET_DYN objects as shared libraries and tries to > dlopen(RTLD_TRACE) them to get dependencies. Since PIE binaries are > ET_DYN | DF_1_PIE, refusal to dlopen such binaries breaks ldd. > > Fix it by reading and parsing dynamic segment looking for DF_FLAG_1 > and taking DF_1_PIE into account when deciding between binary and > library. Hmmm, I have an alternate patch for this that instead depends on the present of PT_INTERP (since we already look at program headers) to determine PIE vs not-PIE. This has the advantage of working for older binaries since DF_1_PIE is relatively recent. (I had also changed it to use libelf to reduce code duplication for the 32-bit compat stuff, but it was pending on getting the branding sorted out since it still doesn't fully work for RISC-V and aarch64 shared libraries until they are branded as the patches also look at notes sections to check for the FreeBSD ABI note tag to decide if a shared library is a FreeBSD one that can be passed to dlopen()). -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jun 15 18:57:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D73B33E09A; Mon, 15 Jun 2020 18:57:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m0vY2Rryz4HGN; Mon, 15 Jun 2020 18:57:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9A2222359; Mon, 15 Jun 2020 18:57:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FIvhbZ083635; Mon, 15 Jun 2020 18:57:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FIvhYI083634; Mon, 15 Jun 2020 18:57:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202006151857.05FIvhYI083634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Jun 2020 18:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362202 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 362202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 18:57:47 -0000 Author: jhb Date: Mon Jun 15 18:57:43 2020 New Revision: 362202 URL: https://svnweb.freebsd.org/changeset/base/362202 Log: Simplify MACHINE_ARCH to be a single string. Big endian and armv4 mean that we are now down to only two supported variants. A future change will use MACHINE_ARCH in assembly which does not support C-style string concatentation and thus needs MACHINE_ARCH defined as a single string. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25211 Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Mon Jun 15 16:35:27 2020 (r362201) +++ head/sys/arm/include/param.h Mon Jun 15 18:57:43 2020 (r362202) @@ -54,25 +54,15 @@ #define __PCI_REROUTE_INTERRUPT -#if __ARM_ARCH >= 7 -#define _V_SUFFIX "v7" -#elif __ARM_ARCH >= 6 -#define _V_SUFFIX "v6" -#else -#define _V_SUFFIX "" -#endif - -#ifdef __ARM_BIG_ENDIAN -#define _EB_SUFFIX "eb" -#else -#define _EB_SUFFIX "" -#endif - #ifndef MACHINE #define MACHINE "arm" #endif #ifndef MACHINE_ARCH -#define MACHINE_ARCH "arm" _V_SUFFIX _EB_SUFFIX +#if __ARM_ARCH >= 7 +#define MACHINE_ARCH "armv7" +#else +#define MACHINE_ARCH "armv6" +#endif #endif #ifdef SMP From owner-svn-src-all@freebsd.org Mon Jun 15 19:31:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 155D93413FE; Mon, 15 Jun 2020 19:31:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49m1fs3G8Hz4dss; Mon, 15 Jun 2020 19:31:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 05FJVeUa090343 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 15 Jun 2020 22:31:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 05FJVeUa090343 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 05FJVePo090342; Mon, 15 Jun 2020 22:31:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Jun 2020 22:31:40 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362152 - head/usr.bin/ldd Message-ID: <20200615193140.GB45690@kib.kiev.ua> References: <202006131821.05DILVnR053798@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49m1fs3G8Hz4dss X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 19:31:50 -0000 On Mon, Jun 15, 2020 at 11:45:31AM -0700, John Baldwin wrote: > On 6/13/20 11:21 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Jun 13 18:21:31 2020 > > New Revision: 362152 > > URL: https://svnweb.freebsd.org/changeset/base/362152 > > > > Log: > > Fix ldd for PIE binaries after rtld stopped accepting binaries for dlopen. > > > > ldd proclaims ET_DYN objects as shared libraries and tries to > > dlopen(RTLD_TRACE) them to get dependencies. Since PIE binaries are > > ET_DYN | DF_1_PIE, refusal to dlopen such binaries breaks ldd. > > > > Fix it by reading and parsing dynamic segment looking for DF_FLAG_1 > > and taking DF_1_PIE into account when deciding between binary and > > library. > > Hmmm, I have an alternate patch for this that instead depends on the > present of PT_INTERP (since we already look at program headers) to > determine PIE vs not-PIE. >From my understanding of some discussions on the ABI list PT_INTERP is not the characteristic property of the binary. Instead it is ET_EXEC | (ET_DYN && DF_1_PIE), i.e. this is the reason why the flag was added. > This has the advantage of working for older > binaries since DF_1_PIE is relatively recent. (I had also changed it to > use libelf to reduce code duplication for the 32-bit compat stuff, but > it was pending on getting the branding sorted out since it still doesn't > fully work for RISC-V and aarch64 shared libraries until they are > branded as the patches also look at notes sections to check for the > FreeBSD ABI note tag to decide if a shared library is a FreeBSD one that > can be passed to dlopen()). Initially I considered to just reenable dlopening ET_DYN && DF_1_PIE for tracing. After your note about old binaries without DF_1_PIE, I think it is even better idea. I do not have an opinion on use of libelf in ldd. It is fine, perhaps, since I do not think about ldd as anything fundamental, just a convenience wrapper around rtld. So one more dependency for ldd is not that critical. From owner-svn-src-all@freebsd.org Mon Jun 15 19:32:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F29C03415B3; Mon, 15 Jun 2020 19:32:20 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m1gS67XKz4f3l; Mon, 15 Jun 2020 19:32:20 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: vmaffione) by smtp.freebsd.org (Postfix) with ESMTPSA id CCED32A0B6; Mon, 15 Jun 2020 19:32:20 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: by mail-qt1-f178.google.com with SMTP id e16so13611840qtg.0; Mon, 15 Jun 2020 12:32:20 -0700 (PDT) X-Gm-Message-State: AOAM533igznWN2C6xB0VO6B+I2IHCAvMOP5dyPK1NlUH9sApAFElmFXa i4oY53Il3m8G94gLUg+pEdigs15MLDMs/OC5RLk= X-Google-Smtp-Source: ABdhPJzRziYRPd4gvcQls6kMtFuebquU144c4W+RD+zrDHExh93oZehD/ijWZoxwPHYNd7QgtFQZGbL/QiCk9qvR9fc= X-Received: by 2002:ac8:67d7:: with SMTP id r23mr18044180qtp.110.1592249540151; Mon, 15 Jun 2020 12:32:20 -0700 (PDT) MIME-Version: 1.0 References: <202006082151.058LpabU003001@repo.freebsd.org> <20200614195126.GB68578@tom-desk.erg.abdn.ac.uk> <97EEF019-16A4-4626-A484-A00979B52A74@freebsd.org> <20200614212230.GC68578@tom-desk.erg.abdn.ac.uk> <0FD9E443-1B40-4495-B2C0-4803121EF911@freebsd.org> In-Reply-To: <0FD9E443-1B40-4495-B2C0-4803121EF911@freebsd.org> From: Vincenzo Maffione Date: Mon, 15 Jun 2020 21:32:08 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361944 - in head/sys/dev/virtio: . network To: Jessica Clarke Cc: Tom Jones , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 19:32:21 -0000 Il giorno lun 15 giu 2020 alle ore 00:05 Jessica Clarke ha scritto: > On 14 Jun 2020, at 22:22, Tom Jones wrote: > > On Sun, Jun 14, 2020 at 09:56:03PM +0100, Jessica Clarke wrote: > >> On 14 Jun 2020, at 20:51, Tom Jones wrote: > >>> On Mon, Jun 08, 2020 at 09:51:36PM +0000, Jessica Clarke wrote: > >>>> Author: jrtc27 > >>>> Date: Mon Jun 8 21:51:36 2020 > >>>> New Revision: 361944 > >>>> URL: https://svnweb.freebsd.org/changeset/base/361944 > >>>> > >>>> Log: > >>>> virtio: Support non-legacy network device and queue > >>>> > >>>> The non-legacy interface always defines num_buffers in the header, > >>>> regardless of whether VIRTIO_NET_F_MRG_RXBUF, just leaving it unused. > We > >>>> also need to ensure our virtqueue doesn't filter out > VIRTIO_F_VERSION_1 > >>>> during negotiation, as it supports non-legacy transports just fine. > This > >>>> fixes network packet transmission on TinyEMU. > >>>> > >>>> Reviewed by: br, brooks (mentor), jhb (mentor) > >>>> Approved by: br, brooks (mentor), jhb (mentor) > >>>> Differential Revision: https://reviews.freebsd.org/D25132 > >>>> > >>>> Modified: > >>>> head/sys/dev/virtio/network/if_vtnet.c > >>>> head/sys/dev/virtio/network/if_vtnetvar.h > >>>> head/sys/dev/virtio/virtio.c > >>>> head/sys/dev/virtio/virtqueue.c > >>>> > >>> > >>> Hi Jessica, > >>> > >>> After updating my current bhyve vm today (on a 12.1 host), networking > no longer > >>> works. Reverting this commit seems to resolve the issue. I think vtnet > is not > >>> passing enough data up to the ip layer. > >>> > >>> If I capture on the tap interface for the vm I see arp requests and arp > >>> replies, however kern.msgbuf is full of: > >>> > >>> <5>arp: short packet received on vtnet0 > >>> > >>> and netstat does not see any replies to arp requests: > >>> > >>> root@freebsd-current:~ # netstat -s -p arp > >>> arp: > >>> 11 ARP requests sent > >>> 0 ARP requests failed to sent > >>> 0 ARP replies sent > >>> 0 ARP requests received > >>> 0 ARP replies received > >>> 0 ARP packets received > >>> 24 total packets dropped due to no ARP entry > >>> 2 ARP entrys timed out > >>> 0 Duplicate IPs seen > >>> > >>> If I set up an arp entry manually I can see ICMP echo requests and > responses on > >>> the tap interface, but the vm does not see the responses. > >>> > >>> root@freebsd-current:~ # netstat -s -p ip > >>> ip: > >>> 7 total packets received > >>> 0 bad header checksums > >>> 0 with size smaller than minimum > >>> 7 with data size < data length > >>> 0 with ip length > max ip packet size > >>> 0 with header length < data size > >>> 0 with data length < header length > >>> > >>> The line > >>> > >>> 7 with data size < data length > >>> > >>> makes me think that vtnet is truncating packets. > >>> > >>> markj pointed me at this bug in irc which might also be related: > >>> > >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247242 > >> > >> Hi Tom, > >> Sorry about that; it seems bhyve hits the "legacy and no MrgRxBuf" > >> case. Could you please try the patch below? > >> > >> Jess > >> > > > > This changed fixed the issue for me. Please feel free to add > > > > Tested By: thj > > > > when you commit. > > Great, thanks for the report. > > > In testing I this lor went by, I wonder if this is something you care > about: > > > > acquiring duplicate lock of same type: "vtnet0-rx0" > > 1st vtnet0-rx0 @ > /usr/home/tj/code/freebsd/projects/review-D25220/sys/dev/virtio/network/if_vtnet.c:1780 > > 2nd vtnet0-rx0 @ > /usr/home/tj/code/freebsd/projects/review-D25220/sys/kern/subr_taskqueue.c:281 > > stack backtrace: > > #0 0xffffffff80c32881 at witness_debugger+0x71 > > #1 0xffffffff80ba3e54 at __mtx_lock_flags+0x94 > > #2 0xffffffff80c24bd2 at taskqueue_enqueue+0x42 > > #3 0xffffffff80a1af99 at vtnet_rxq_tq_intr+0xb9 > > #4 0xffffffff80c2520a at taskqueue_run_locked+0xaa > > #5 0xffffffff80c26284 at taskqueue_thread_loop+0x94 > > #6 0xffffffff80b830e0 at fork_exit+0x80 > > #7 0xffffffff81040eae at fork_trampoline+0xe > > Hm, I think that's just a false-positive, because if_vtnet constructs > the taskqueue using the same name as its own internal mutexes. Though > the locking around vtnet_rx_vq_intr and vtnet_rxq_tq_intr is a bit > fishy given they're rather similar yet inconsistent. I would imagine > rxq->vtnrx_stats.vrxs_rescheduled is supposed to be protected by that > mutex, but wouldn't like to say whether taskqueue_enqueue needs to be. > Vincenzo, you recently touched code around there, perhaps you could be > persuaded to have a quick look?.. > Yes, you are right on both. There is also code duplication that can be easily removed. I will fix that. Cheers, Vincenzo > > Jess > > From owner-svn-src-all@freebsd.org Mon Jun 15 19:38:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 672C63419DC; Mon, 15 Jun 2020 19:38:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m1q02L9lz4fJw; Mon, 15 Jun 2020 19:38:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B4AC22C2F; Mon, 15 Jun 2020 19:38:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FJcqlb030355; Mon, 15 Jun 2020 19:38:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FJcmoe030335; Mon, 15 Jun 2020 19:38:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202006151938.05FJcmoe030335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Jun 2020 19:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362203 - in head/lib/csu: . aarch64 amd64 arm common i386 mips powerpc powerpc64 riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/lib/csu: . aarch64 amd64 arm common i386 mips powerpc powerpc64 riscv X-SVN-Commit-Revision: 362203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 19:38:52 -0000 Author: jhb Date: Mon Jun 15 19:38:48 2020 New Revision: 362203 URL: https://svnweb.freebsd.org/changeset/base/362203 Log: Remove the sed hack for ABI tag notes. The ELF notes compiled in C were placed in a section with the wrong type (SHT_PROGBITS instead of SHT_NOTE). Previously, sed was used on the generated assembly to rewrite the section type. Instead, write the notes in assembly which permits setting the correct section type directly. While here, move inline assembly entry points out of C and into assembly for aarch64, arm, and riscv. Reviewed by: kib Tested on: amd64 (cirrus-ci), riscv64 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25211 Added: head/lib/csu/aarch64/crt1_c.c - copied, changed from r362202, head/lib/csu/aarch64/crt1.c head/lib/csu/aarch64/crt1_s.S - copied, changed from r362201, head/lib/csu/aarch64/crt1.c head/lib/csu/amd64/crt1_c.c - copied, changed from r362202, head/lib/csu/amd64/crt1.c head/lib/csu/arm/crt1_c.c - copied, changed from r362202, head/lib/csu/arm/crt1.c head/lib/csu/arm/crt1_s.S - copied, changed from r362201, head/lib/csu/arm/crt1.c head/lib/csu/common/crtbrand.S - copied, changed from r362202, head/lib/csu/common/crtbrand.c head/lib/csu/common/ignore_init_note.S - copied, changed from r362201, head/lib/csu/common/ignore_init.c head/lib/csu/mips/crt1_c.c - copied, changed from r362202, head/lib/csu/mips/crt1.c head/lib/csu/powerpc/crt1_c.c - copied, changed from r362202, head/lib/csu/powerpc/crt1.c head/lib/csu/powerpc64/crt1_c.c - copied, changed from r362202, head/lib/csu/powerpc64/crt1.c head/lib/csu/riscv/crt1_c.c - copied, changed from r362202, head/lib/csu/riscv/crt1.c head/lib/csu/riscv/crt1_s.S - copied, changed from r362201, head/lib/csu/riscv/crt1.c Deleted: head/lib/csu/aarch64/crt1.c head/lib/csu/amd64/crt1.c head/lib/csu/arm/crt1.c head/lib/csu/common/crtbrand.c head/lib/csu/mips/crt1.c head/lib/csu/powerpc/crt1.c head/lib/csu/powerpc64/crt1.c head/lib/csu/riscv/crt1.c Modified: head/lib/csu/Makefile.inc head/lib/csu/aarch64/Makefile head/lib/csu/amd64/Makefile head/lib/csu/arm/Makefile head/lib/csu/common/ignore_init.c head/lib/csu/i386/Makefile head/lib/csu/i386/crt1_c.c head/lib/csu/i386/crt1_s.S head/lib/csu/mips/Makefile head/lib/csu/powerpc/Makefile head/lib/csu/powerpc64/Makefile head/lib/csu/riscv/Makefile Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/Makefile.inc Mon Jun 15 19:38:48 2020 (r362203) @@ -2,8 +2,6 @@ SSP_CFLAGS= -SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/' - NO_WMISSING_VARIABLE_DECLARATIONS= .include @@ -12,6 +10,8 @@ NO_WMISSING_VARIABLE_DECLARATIONS= OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o + +ACFLAGS+= -DLOCORE CFLAGS+= -fno-asynchronous-unwind-tables CFLAGS+= -fno-omit-frame-pointer Modified: head/lib/csu/aarch64/Makefile ============================================================================== --- head/lib/csu/aarch64/Makefile Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/aarch64/Makefile Mon Jun 15 19:38:48 2020 (r362203) @@ -2,9 +2,9 @@ .PATH: ${.CURDIR:H}/common -SRCS= crt1.c crti.S crtn.S +SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o +OBJS+= Scrt1.o crt1.o gcrt1.o CFLAGS+= -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS @@ -17,31 +17,21 @@ FILESDIR= ${LIBDIR} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY -CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s gcrt1.s Scrt1.s +CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not -# directly compiled to .o files. +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +gcrt1.o: gcrt1_c.o crt1_s.o + ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o -crt1.o: crt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s +crt1.o: crt1_c.o crt1_s.o + ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o -gcrt1.s: crt1.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s - -Scrt1.s: crt1.c - ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} - -Scrt1.o: Scrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s +Scrt1.o: Scrt1_c.o crt1_s.o + ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o .include Copied and modified: head/lib/csu/aarch64/crt1_c.c (from r362202, head/lib/csu/aarch64/crt1.c) ============================================================================== --- head/lib/csu/aarch64/crt1.c Mon Jun 15 18:57:43 2020 (r362202, copy source) +++ head/lib/csu/aarch64/crt1_c.c Mon Jun 15 19:38:48 2020 (r362203) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -#include "crtbrand.c" #include "ignore_init.c" #ifdef GCRT @@ -48,19 +47,6 @@ extern int etext; extern long * _end; void __start(int, char **, char **, void (*)(void)); - -/* The entry function. */ -__asm(" .text \n" -" .align 0 \n" -" .globl _start \n" -" _start: \n" -" mov x3, x2 \n" /* cleanup */ -" add x1, x0, #8 \n" /* load argv */ -" ldr x0, [x0] \n" /* load argc */ -" add x2, x1, x0, lsl #3 \n" /* env is after argv */ -" add x2, x2, #8 \n" /* argv is null terminated */ -" b __start "); - /* The entry function. */ void Copied and modified: head/lib/csu/aarch64/crt1_s.S (from r362201, head/lib/csu/aarch64/crt1.c) ============================================================================== --- head/lib/csu/aarch64/crt1.c Mon Jun 15 16:35:27 2020 (r362201, copy source) +++ head/lib/csu/aarch64/crt1_s.S Mon Jun 15 19:38:48 2020 (r362203) @@ -29,57 +29,19 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include __FBSDID("$FreeBSD$"); -#include +#include "crtbrand.S" +#include "ignore_init_note.S" -#include "libc_private.h" -#include "crtbrand.c" -#include "ignore_init.c" +ENTRY(_start) + mov x3, x2 /* cleanup */ + add x1, x0, #8 /* load argv */ + ldr x0, [x0] /* load argc */ + add x2, x1, x0, lsl #3 /* env is after argv */ + add x2, x2, #8 /* argv is null terminated */ + b __start +END(_start) -#ifdef GCRT -extern void _mcleanup(void); -extern void monstartup(void *, void *); -extern int eprol; -extern int etext; -#endif - -extern long * _end; - -void __start(int, char **, char **, void (*)(void)); - -/* The entry function. */ -__asm(" .text \n" -" .align 0 \n" -" .globl _start \n" -" _start: \n" -" mov x3, x2 \n" /* cleanup */ -" add x1, x0, #8 \n" /* load argv */ -" ldr x0, [x0] \n" /* load argc */ -" add x2, x1, x0, lsl #3 \n" /* env is after argv */ -" add x2, x2, #8 \n" /* argv is null terminated */ -" b __start "); - - -/* The entry function. */ -void -__start(int argc, char *argv[], char *env[], void (*cleanup)(void)) -{ - - handle_argv(argc, argv, env); - - if (&_DYNAMIC != NULL) - atexit(cleanup); - else - _init_tls(); - -#ifdef GCRT - atexit(_mcleanup); - monstartup(&eprol, &etext); -__asm__("eprol:"); -#endif - - handle_static_init(argc, argv, env); - exit(main(argc, argv, env)); -} + .section .note.GNU-stack,"",@progbits Modified: head/lib/csu/amd64/Makefile ============================================================================== --- head/lib/csu/amd64/Makefile Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/amd64/Makefile Mon Jun 15 19:38:48 2020 (r362203) @@ -2,9 +2,9 @@ .PATH: ${.CURDIR:H}/common -SRCS= crt1.c crti.S crtn.S +SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o +OBJS+= Scrt1.o crt1.o gcrt1.o CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include CFLAGS+= -fno-omit-frame-pointer -DCRT_IRELOC_RELA @@ -17,31 +17,22 @@ FILESDIR= ${LIBDIR} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY -CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s gcrt1.s Scrt1.s +CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o -# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not -# directly compiled to .o files. +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o -crt1.o: crt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s +crt1.o: crt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o -gcrt1.s: crt1.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s - -Scrt1.s: crt1.c - ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} - -Scrt1.o: Scrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s +Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o .include Copied and modified: head/lib/csu/amd64/crt1_c.c (from r362202, head/lib/csu/amd64/crt1.c) ============================================================================== --- head/lib/csu/amd64/crt1.c Mon Jun 15 18:57:43 2020 (r362202, copy source) +++ head/lib/csu/amd64/crt1_c.c Mon Jun 15 19:38:48 2020 (r362203) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -#include "crtbrand.c" #include "ignore_init.c" typedef void (*fptr)(void); Modified: head/lib/csu/arm/Makefile ============================================================================== --- head/lib/csu/arm/Makefile Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/arm/Makefile Mon Jun 15 19:38:48 2020 (r362203) @@ -2,9 +2,9 @@ .PATH: ${.CURDIR:H}/common -SRCS= crt1.c crti.S crtn.S +SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o +OBJS+= Scrt1.o crt1.o gcrt1.o CFLAGS+= -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS @@ -17,31 +17,24 @@ FILESDIR= ${LIBDIR} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY -CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s gcrt1.s Scrt1.s +CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not -# directly compiled to .o files. +crt1_c.o: crt1_c.c + ${CC} ${CFLAGS} ${STATIC_CFLAGS} -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -crt1.s: crt1.c - ${CC} ${CFLAGS} ${STATIC_CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +crt1.o: crt1_c.o crt1_s.o + ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o -crt1.o: crt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.s: crt1.c - ${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +gcrt1.o: gcrt1_c.o crt1_s.o + ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o -gcrt1.o: gcrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -Scrt1.s: crt1.c - ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} - -Scrt1.o: Scrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s +Scrt1.o: Scrt1_c.o crt1_s.o + ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o .include Copied and modified: head/lib/csu/arm/crt1_c.c (from r362202, head/lib/csu/arm/crt1.c) ============================================================================== --- head/lib/csu/arm/crt1.c Mon Jun 15 18:57:43 2020 (r362202, copy source) +++ head/lib/csu/arm/crt1_c.c Mon Jun 15 19:38:48 2020 (r362203) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -#include "crtbrand.c" #include "ignore_init.c" struct Struct_Obj_Entry; @@ -70,26 +69,6 @@ struct ps_strings *__ps_strings; void __start(int, char **, char **, struct ps_strings *, const struct Struct_Obj_Entry *, void (*)(void)); -/* The entry function. */ -__asm(" .text \n" -" .align 0 \n" -" .globl _start \n" -" _start: \n" -" mov r5, r2 /* cleanup */ \n" -" mov r4, r1 /* obj_main */ \n" -" mov r3, r0 /* ps_strings */ \n" -" /* Get argc, argv, and envp from stack */ \n" -" ldr r0, [sp, #0x0000] \n" -" add r1, sp, #0x0004 \n" -" add r2, r1, r0, lsl #2 \n" -" add r2, r2, #0x0004 \n" -" /* Ensure the stack is properly aligned before calling C code. */\n" -" bic sp, sp, #7 \n" -" sub sp, sp, #8 \n" -" str r5, [sp, #4] \n" -" str r4, [sp, #0] \n" -"\n" -" b __start "); /* ARGSUSED */ void __start(int argc, char **argv, char **env, struct ps_strings *ps_strings, @@ -112,20 +91,6 @@ __start(int argc, char **argv, char **env, struct ps_s handle_static_init(argc, argv, env); exit(main(argc, argv, env)); } - -static const struct { - int32_t namesz; - int32_t descsz; - int32_t type; - char name[sizeof(NOTE_FREEBSD_VENDOR)]; - char desc[sizeof(MACHINE_ARCH)]; -} archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = { - .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(MACHINE_ARCH), - .type = NT_FREEBSD_ARCH_TAG, - .name = NOTE_FREEBSD_VENDOR, - .desc = MACHINE_ARCH -}; #ifdef GCRT __asm__(".text"); Copied and modified: head/lib/csu/arm/crt1_s.S (from r362201, head/lib/csu/arm/crt1.c) ============================================================================== --- head/lib/csu/arm/crt1.c Mon Jun 15 16:35:27 2020 (r362201, copy source) +++ head/lib/csu/arm/crt1_s.S Mon Jun 15 19:38:48 2020 (r362203) @@ -41,94 +41,38 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include __FBSDID("$FreeBSD$"); -#include -#include -#include +#include "crtbrand.S" +#include "ignore_init_note.S" -#include "libc_private.h" -#include "crtbrand.c" -#include "ignore_init.c" +ENTRY(_start) + mov r5, r2 /* cleanup */ + mov r4, r1 /* obj_main */ + mov r3, r0 /* ps_strings */ + /* Get argc, argv, and envp from stack */ + ldr r0, [sp, #0x0000] + add r1, sp, #0x0004 + add r2, r1, r0, lsl #2 + add r2, r2, #0x0004 + /* Ensure the stack is properly aligned before calling C code. */ + bic sp, sp, #7 + sub sp, sp, #8 + str r5, [sp, #4] + str r4, [sp, #0] -struct Struct_Obj_Entry; -struct ps_strings; + b __start +END(_start) -extern void _start(int, char **, char **, const struct Struct_Obj_Entry *, - void (*)(void), struct ps_strings *); + .section .note.tag,"a",%note + .p2align 2 + .4byte 2f-1f + .4byte 4f-3f + .4byte NT_FREEBSD_ARCH_TAG +1: .asciz NOTE_FREEBSD_VENDOR +2: .p2align 2 +3: .asciz MACHINE_ARCH +4: -#ifdef GCRT -extern void _mcleanup(void); -extern void monstartup(void *, void *); -extern int eprol; -extern int etext; -#endif - -struct ps_strings *__ps_strings; - -void __start(int, char **, char **, struct ps_strings *, - const struct Struct_Obj_Entry *, void (*)(void)); - -/* The entry function. */ -__asm(" .text \n" -" .align 0 \n" -" .globl _start \n" -" _start: \n" -" mov r5, r2 /* cleanup */ \n" -" mov r4, r1 /* obj_main */ \n" -" mov r3, r0 /* ps_strings */ \n" -" /* Get argc, argv, and envp from stack */ \n" -" ldr r0, [sp, #0x0000] \n" -" add r1, sp, #0x0004 \n" -" add r2, r1, r0, lsl #2 \n" -" add r2, r2, #0x0004 \n" -" /* Ensure the stack is properly aligned before calling C code. */\n" -" bic sp, sp, #7 \n" -" sub sp, sp, #8 \n" -" str r5, [sp, #4] \n" -" str r4, [sp, #0] \n" -"\n" -" b __start "); -/* ARGSUSED */ -void -__start(int argc, char **argv, char **env, struct ps_strings *ps_strings, - const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void)) -{ - - handle_argv(argc, argv, env); - - if (ps_strings != (struct ps_strings *)0) - __ps_strings = ps_strings; - - if (&_DYNAMIC != NULL) - atexit(cleanup); - else - _init_tls(); -#ifdef GCRT - atexit(_mcleanup); - monstartup(&eprol, &etext); -#endif - handle_static_init(argc, argv, env); - exit(main(argc, argv, env)); -} - -static const struct { - int32_t namesz; - int32_t descsz; - int32_t type; - char name[sizeof(NOTE_FREEBSD_VENDOR)]; - char desc[sizeof(MACHINE_ARCH)]; -} archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = { - .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(MACHINE_ARCH), - .type = NT_FREEBSD_ARCH_TAG, - .name = NOTE_FREEBSD_VENDOR, - .desc = MACHINE_ARCH -}; - -#ifdef GCRT -__asm__(".text"); -__asm__("eprol:"); -__asm__(".previous"); -#endif + .section .note.GNU-stack,"",%progbits Copied and modified: head/lib/csu/common/crtbrand.S (from r362202, head/lib/csu/common/crtbrand.c) ============================================================================== --- head/lib/csu/common/crtbrand.c Mon Jun 15 18:57:43 2020 (r362202, copy source) +++ head/lib/csu/common/crtbrand.S Mon Jun 15 19:38:48 2020 (r362203) @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include __FBSDID("$FreeBSD$"); #include @@ -33,52 +33,27 @@ __FBSDID("$FreeBSD$"); #include "notes.h" /* - * Special ".note" entry specifying the ABI version. See + * Special ".note.tag" entry specifying the ABI version. See * http://www.netbsd.org/Documentation/kernel/elf-notes.html * for more information. - * - * For all arches except sparc, gcc emits the section directive for the - * following struct with a PROGBITS type. However, newer versions of binutils - * (after 2.16.90) require the section to be of NOTE type, to guarantee that the - * .note.ABI-tag section correctly ends up in the first page of the final - * executable. - * - * Unfortunately, there is no clean way to tell gcc to use another section type, - * so this C file (or the C file that includes it) must be compiled in multiple - * steps: - * - * - Compile the .c file to a .s file. - * - Edit the .s file to change the 'progbits' type to 'note', for the section - * directive that defines the .note.ABI-tag section. - * - Compile the .s file to an object file. - * - * These steps are done in the invididual Makefiles for each applicable arch. */ -static const struct { - int32_t namesz; - int32_t descsz; - int32_t type; - char name[sizeof(NOTE_FREEBSD_VENDOR)]; - int32_t desc; -} abitag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = { - .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(int32_t), - .type = NT_FREEBSD_ABI_TAG, - .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version -}; -static const struct { - int32_t namesz; - int32_t descsz; - int32_t type; - char name[sizeof(NOTE_FREEBSD_VENDOR)]; - uint32_t desc[1]; -} crt_feature_ctl __attribute__ ((section (NOTE_SECTION), - aligned(4))) __used = { - .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(uint32_t), - .type = NT_FREEBSD_FEATURE_CTL, - .name = NOTE_FREEBSD_VENDOR, - .desc = { 0 } -}; + .section .note.tag,"a",%note + .p2align 2 + .4byte 2f-1f + .4byte 4f-3f + .4byte NT_FREEBSD_ABI_TAG +1: .asciz NOTE_FREEBSD_VENDOR +2: .p2align 2 +3: .4byte __FreeBSD_version +4: + + .section .note.tag,"a",%note + .p2align 2 + .4byte 2f-1f + .4byte 4f-3f + .4byte NT_FREEBSD_FEATURE_CTL +1: .asciz NOTE_FREEBSD_VENDOR +2: .p2align 2 +3: .4byte 0 +4: Modified: head/lib/csu/common/ignore_init.c ============================================================================== --- head/lib/csu/common/ignore_init.c Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/common/ignore_init.c Mon Jun 15 19:38:48 2020 (r362203) @@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "notes.h" - extern int main(int, char **, char **); extern void (*__preinit_array_start[])(int, char **, char **) __hidden; @@ -140,18 +138,3 @@ handle_argv(int argc, char *argv[], char **env) } } } - -static const struct { - int32_t namesz; - int32_t descsz; - int32_t type; - char name[sizeof(NOTE_FREEBSD_VENDOR)]; - uint32_t desc; -} crt_noinit_tag __attribute__ ((section (NOTE_SECTION), - aligned(4))) __used = { - .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(uint32_t), - .type = NT_FREEBSD_NOINIT_TAG, - .name = NOTE_FREEBSD_VENDOR, - .desc = 0 -}; Copied and modified: head/lib/csu/common/ignore_init_note.S (from r362201, head/lib/csu/common/ignore_init.c) ============================================================================== --- head/lib/csu/common/ignore_init.c Mon Jun 15 16:35:27 2020 (r362201, copy source) +++ head/lib/csu/common/ignore_init_note.S Mon Jun 15 19:38:48 2020 (r362203) @@ -25,133 +25,19 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include __FBSDID("$FreeBSD$"); -#include -#include #include #include "notes.h" -extern int main(int, char **, char **); - -extern void (*__preinit_array_start[])(int, char **, char **) __hidden; -extern void (*__preinit_array_end[])(int, char **, char **) __hidden; -extern void (*__init_array_start[])(int, char **, char **) __hidden; -extern void (*__init_array_end[])(int, char **, char **) __hidden; -extern void (*__fini_array_start[])(void) __hidden; -extern void (*__fini_array_end[])(void) __hidden; -extern void _fini(void) __hidden; -extern void _init(void) __hidden; - -extern int _DYNAMIC; -#pragma weak _DYNAMIC - -#if defined(CRT_IRELOC_RELA) -extern const Elf_Rela __rela_iplt_start[] __weak_symbol __hidden; -extern const Elf_Rela __rela_iplt_end[] __weak_symbol __hidden; - -#include "reloc.c" - -static void -process_irelocs(void) -{ - const Elf_Rela *r; - - for (r = &__rela_iplt_start[0]; r < &__rela_iplt_end[0]; r++) - crt1_handle_rela(r); -} -#elif defined(CRT_IRELOC_REL) -extern const Elf_Rel __rel_iplt_start[] __weak_symbol __hidden; -extern const Elf_Rel __rel_iplt_end[] __weak_symbol __hidden; - -#include "reloc.c" - -static void -process_irelocs(void) -{ - const Elf_Rel *r; - - for (r = &__rel_iplt_start[0]; r < &__rel_iplt_end[0]; r++) - crt1_handle_rel(r); -} -#elif defined(CRT_IRELOC_SUPPRESS) -#else -#error "Define platform reloc type" -#endif - -char **environ; -const char *__progname = ""; - -static void -finalizer(void) -{ - void (*fn)(void); - size_t array_size, n; - - array_size = __fini_array_end - __fini_array_start; - for (n = array_size; n > 0; n--) { - fn = __fini_array_start[n - 1]; - if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1) - (fn)(); - } - _fini(); -} - -static inline void -handle_static_init(int argc, char **argv, char **env) -{ - void (*fn)(int, char **, char **); - size_t array_size, n; - - if (&_DYNAMIC != NULL) - return; - - atexit(finalizer); - - array_size = __preinit_array_end - __preinit_array_start; - for (n = 0; n < array_size; n++) { - fn = __preinit_array_start[n]; - if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1) - fn(argc, argv, env); - } - _init(); - array_size = __init_array_end - __init_array_start; - for (n = 0; n < array_size; n++) { - fn = __init_array_start[n]; - if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1) - fn(argc, argv, env); - } -} - -static inline void -handle_argv(int argc, char *argv[], char **env) -{ - const char *s; - - if (environ == NULL) - environ = env; - if (argc > 0 && argv[0] != NULL) { - __progname = argv[0]; - for (s = __progname; *s != '\0'; s++) { - if (*s == '/') - __progname = s + 1; - } - } -} - -static const struct { - int32_t namesz; - int32_t descsz; - int32_t type; - char name[sizeof(NOTE_FREEBSD_VENDOR)]; - uint32_t desc; -} crt_noinit_tag __attribute__ ((section (NOTE_SECTION), - aligned(4))) __used = { - .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(uint32_t), - .type = NT_FREEBSD_NOINIT_TAG, - .name = NOTE_FREEBSD_VENDOR, - .desc = 0 -}; + .section .note.tag,"a",%note + .p2align 2 + .4byte 2f-1f + .4byte 4f-3f + .4byte NT_FREEBSD_NOINIT_TAG +1: .asciz NOTE_FREEBSD_VENDOR +2: .p2align 2 +3: .4byte 0 +4: Modified: head/lib/csu/i386/Makefile ============================================================================== --- head/lib/csu/i386/Makefile Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/i386/Makefile Mon Jun 15 19:38:48 2020 (r362203) @@ -4,7 +4,7 @@ SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o crt1.o Scrt1.o +OBJS+= Scrt1.o crt1.o gcrt1.o CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_REL @@ -18,38 +18,19 @@ FILESDIR= ${LIBDIR} .undef LIBRARIES_ONLY CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s -# See the comment in lib/csu/common/crtbrand.c for the reason crt1_c.c is not -# directly compiled to .o files. +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1_c.s: crt1_c.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1_c.c - sed ${SED_FIX_NOTE} ${.TARGET} - -gcrt1_c.o: gcrt1_c.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s - gcrt1.o: gcrt1_c.o crt1_s.o ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o -crt1_c.s: crt1_c.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c - sed ${SED_FIX_NOTE} ${.TARGET} - -crt1_c.o: crt1_c.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s - crt1.o: crt1_c.o crt1_s.o ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o ${OBJCOPY} --localize-symbol _start1 crt1.o -Scrt1_c.s: crt1_c.c - ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c - sed ${SED_FIX_NOTE} ${.TARGET} - -Scrt1_c.o: Scrt1_c.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c Scrt1.o: Scrt1_c.o crt1_s.o ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o Modified: head/lib/csu/i386/crt1_c.c ============================================================================== --- head/lib/csu/i386/crt1_c.c Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/i386/crt1_c.c Mon Jun 15 19:38:48 2020 (r362203) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -#include "crtbrand.c" #include "ignore_init.c" typedef void (*fptr)(void); Modified: head/lib/csu/i386/crt1_s.S ============================================================================== --- head/lib/csu/i386/crt1_s.S Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/i386/crt1_s.S Mon Jun 15 19:38:48 2020 (r362203) @@ -25,6 +25,9 @@ #include __FBSDID("$FreeBSD$"); +#include "crtbrand.S" +#include "ignore_init_note.S" + .text .align 4 .globl _start Modified: head/lib/csu/mips/Makefile ============================================================================== --- head/lib/csu/mips/Makefile Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/mips/Makefile Mon Jun 15 19:38:48 2020 (r362203) @@ -2,9 +2,9 @@ .PATH: ${.CURDIR:H}/common -SRCS= crt1.c crti.S crtn.S +SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o +OBJS+= Scrt1.o crt1.o gcrt1.o CFLAGS+= -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS @@ -17,31 +17,22 @@ FILESDIR= ${LIBDIR} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY -CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s gcrt1.s Scrt1.s +CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o -# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not -# directly compiled to .o files. +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o -crt1.o: crt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s +crt1.o: crt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o -gcrt1.s: crt1.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s - -Scrt1.s: crt1.c - ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} - -Scrt1.o: Scrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s +Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o .include Copied and modified: head/lib/csu/mips/crt1_c.c (from r362202, head/lib/csu/mips/crt1.c) ============================================================================== --- head/lib/csu/mips/crt1.c Mon Jun 15 18:57:43 2020 (r362202, copy source) +++ head/lib/csu/mips/crt1_c.c Mon Jun 15 19:38:48 2020 (r362203) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -#include "crtbrand.c" #include "ignore_init.c" struct Struct_Obj_Entry; Modified: head/lib/csu/powerpc/Makefile ============================================================================== --- head/lib/csu/powerpc/Makefile Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/powerpc/Makefile Mon Jun 15 19:38:48 2020 (r362203) @@ -2,9 +2,9 @@ .PATH: ${.CURDIR:H}/common -SRCS= crt1.c crti.S crtn.S crtsavres.S +SRCS= crti.S crtn.S crtsavres.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o +OBJS+= Scrt1.o crt1.o gcrt1.o CFLAGS+= -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS @@ -17,31 +17,22 @@ FILESDIR= ${LIBDIR} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY -CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s gcrt1.s Scrt1.s +CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o -# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not -# directly compiled to .o files. +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o -crt1.o: crt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s +crt1.o: crt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o -gcrt1.s: crt1.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s - -Scrt1.s: crt1.c - ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} - -Scrt1.o: Scrt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s +Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o .include Copied and modified: head/lib/csu/powerpc/crt1_c.c (from r362202, head/lib/csu/powerpc/crt1.c) ============================================================================== --- head/lib/csu/powerpc/crt1.c Mon Jun 15 18:57:43 2020 (r362202, copy source) +++ head/lib/csu/powerpc/crt1_c.c Mon Jun 15 19:38:48 2020 (r362203) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -#include "crtbrand.c" #include "ignore_init.c" struct Struct_Obj_Entry; Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Mon Jun 15 18:57:43 2020 (r362202) +++ head/lib/csu/powerpc64/Makefile Mon Jun 15 19:38:48 2020 (r362203) @@ -2,9 +2,9 @@ .PATH: ${.CURDIR:H}/common -SRCS= crt1.c crti.S crtn.S +SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= crtsavres.o Scrt1.o gcrt1.o +OBJS+= Scrt1.o crt1.o crtsavres.o gcrt1.o CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include \ -mlongcall -DCRT_IRELOC_RELA @@ -17,35 +17,27 @@ FILESDIR= ${LIBDIR} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY -CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s crtsavres.S gcrt1.s Scrt1.s +CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o +CLEANFILES+= crtsavres.S -# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not -# directly compiled to .o files. - -crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} - # On powerpc64 crtsavres is an empty file crtsavres.S: touch ${.TARGET} -crt1.o: crt1.s - ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s +gcrt1_c.o: crt1_c.c *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 15 19:46:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14AE9341B35; Mon, 15 Jun 2020 19:46:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m1zt6nl6z4g42; Mon, 15 Jun 2020 19:46:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E477522FC3; Mon, 15 Jun 2020 19:46:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FJkYkk036215; Mon, 15 Jun 2020 19:46:34 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FJkYZR036214; Mon, 15 Jun 2020 19:46:34 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006151946.05FJkYZR036214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 15 Jun 2020 19:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362204 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 362204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 19:46:35 -0000 Author: vmaffione Date: Mon Jun 15 19:46:34 2020 New Revision: 362204 URL: https://svnweb.freebsd.org/changeset/base/362204 Log: if_vtnet: let vtnet_rx_vq_intr() and vtnet_rxq_tq_intr() share code Since the two functions are similar, introduce a common function (vtnet_rx_vq_process()) to share common code. This also improves locking, by ensuring vrxs_rescheduled is accessed under the RXQ lock, and taskqueue_enqueue() is not called under the lock (therefore avoiding a spurious duplicate lock warning). Reported by: jrtc27 MFC after: 2 weeks Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Mon Jun 15 19:38:48 2020 (r362203) +++ head/sys/dev/virtio/network/if_vtnet.c Mon Jun 15 19:46:34 2020 (r362204) @@ -128,6 +128,7 @@ static int vtnet_rxq_merged_eof(struct vtnet_rxq *, st static void vtnet_rxq_input(struct vtnet_rxq *, struct mbuf *, struct virtio_net_hdr *); static int vtnet_rxq_eof(struct vtnet_rxq *); +static void vtnet_rx_vq_process(struct vtnet_rxq *rxq, int tries); static void vtnet_rx_vq_intr(void *); static void vtnet_rxq_tq_intr(void *, int); @@ -1915,20 +1916,17 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) } static void -vtnet_rx_vq_intr(void *xrxq) +vtnet_rx_vq_process(struct vtnet_rxq *rxq, int tries) { struct vtnet_softc *sc; - struct vtnet_rxq *rxq; struct ifnet *ifp; - int tries, more; + int more; #ifdef DEV_NETMAP int nmirq; #endif /* DEV_NETMAP */ - rxq = xrxq; sc = rxq->vtnrx_sc; ifp = sc->vtnet_ifp; - tries = 0; if (__predict_false(rxq->vtnrx_id >= sc->vtnet_act_vq_pairs)) { /* @@ -1976,58 +1974,32 @@ again: * This is an occasional condition or race (when !more), * so retry a few times before scheduling the taskqueue. */ - if (tries++ < VTNET_INTR_DISABLE_RETRIES) + if (tries-- > 0) goto again; - VTNET_RXQ_UNLOCK(rxq); rxq->vtnrx_stats.vrxs_rescheduled++; + VTNET_RXQ_UNLOCK(rxq); taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); } else VTNET_RXQ_UNLOCK(rxq); } static void -vtnet_rxq_tq_intr(void *xrxq, int pending) +vtnet_rx_vq_intr(void *xrxq) { - struct vtnet_softc *sc; struct vtnet_rxq *rxq; - struct ifnet *ifp; - int more; -#ifdef DEV_NETMAP - int nmirq; -#endif /* DEV_NETMAP */ rxq = xrxq; - sc = rxq->vtnrx_sc; - ifp = sc->vtnet_ifp; + vtnet_rx_vq_process(rxq, VTNET_INTR_DISABLE_RETRIES); +} - VTNET_RXQ_LOCK(rxq); +static void +vtnet_rxq_tq_intr(void *xrxq, int pending) +{ + struct vtnet_rxq *rxq; -#ifdef DEV_NETMAP - nmirq = netmap_rx_irq(ifp, rxq->vtnrx_id, &more); - if (nmirq != NM_IRQ_PASS) { - VTNET_RXQ_UNLOCK(rxq); - if (nmirq == NM_IRQ_RESCHED) { - taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); - } - return; - } -#endif /* DEV_NETMAP */ - - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - VTNET_RXQ_UNLOCK(rxq); - return; - } - - more = vtnet_rxq_eof(rxq); - if (more || vtnet_rxq_enable_intr(rxq) != 0) { - if (!more) - vtnet_rxq_disable_intr(rxq); - rxq->vtnrx_stats.vrxs_rescheduled++; - taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); - } - - VTNET_RXQ_UNLOCK(rxq); + rxq = xrxq; + vtnet_rx_vq_process(rxq, 0); } static int From owner-svn-src-all@freebsd.org Mon Jun 15 20:12:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C896342800; Mon, 15 Jun 2020 20:12:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m2YR2n9sz3SXr; Mon, 15 Jun 2020 20:12:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5ADC223433; Mon, 15 Jun 2020 20:12:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FKCBNT054076; Mon, 15 Jun 2020 20:12:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FKCBNU054075; Mon, 15 Jun 2020 20:12:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202006152012.05FKCBNU054075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Jun 2020 20:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362205 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 362205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 20:12:11 -0000 Author: trasz Date: Mon Jun 15 20:12:10 2020 New Revision: 362205 URL: https://svnweb.freebsd.org/changeset/base/362205 Log: Make Linux uname(2) return x86_64 to 32-bit apps. This helps Steam. PR: kern/240432 Analyzed by by: Alex S Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25248 Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Jun 15 19:46:34 2020 (r362204) +++ head/sys/compat/linux/linux_misc.c Mon Jun 15 20:12:10 2020 (r362205) @@ -704,7 +704,17 @@ linux_newuname(struct thread *td, struct linux_newunam *p = '\0'; break; } +#if defined(__amd64__) + /* + * On amd64, Linux uname(2) needs to return "x86_64" + * for both 64-bit and 32-bit applications. On 32-bit, + * the string returned by getauxval(AT_PLATFORM) needs + * to remain "i686", though. + */ + strlcpy(utsname.machine, "x86_64", LINUX_MAX_UTSNAME); +#else strlcpy(utsname.machine, linux_kplatform, LINUX_MAX_UTSNAME); +#endif return (copyout(&utsname, args->buf, sizeof(utsname))); } From owner-svn-src-all@freebsd.org Mon Jun 15 21:12:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7FD134401F; Mon, 15 Jun 2020 21:12:24 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49m3tv5gd6z3XtM; Mon, 15 Jun 2020 21:12:23 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05FLCF4h078087; Mon, 15 Jun 2020 14:12:15 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05FLCFqc078086; Mon, 15 Jun 2020 14:12:15 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006152112.05FLCFqc078086@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362191 - head/sbin/md5 In-Reply-To: To: Warner Losh Date: Mon, 15 Jun 2020 14:12:15 -0700 (PDT) CC: Mateusz Piotrowski <0mp@freebsd.org>, "Rodney W. Grimes" , =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49m3tv5gd6z3XtM X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.54 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.31)[0.314]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.36)[0.365]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.96)[0.960]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 21:12:24 -0000 > On Mon, Jun 15, 2020 at 7:34 AM Mateusz Piotrowski <0mp@freebsd.org> wrote: > > > Hi, > > > > On 6/15/20 2:33 PM, Rodney W. Grimes wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > >> Author: fernape (ports committer) > > >> Date: Mon Jun 15 10:08:02 2020 > > >> New Revision: 362191 > > >> URL: https://svnweb.freebsd.org/changeset/base/362191 > > >> > > >> Log: > > >> md5(1): fix style in man page > > > > > > Mandoc is fine to ignore this, but it is wrong to call it useless. > > > > > > I really wish that this stop. .Tn might be useless to mandoc, > > > but it is a very usable thing if your formatting to something > > > other than txt, as in a ps or pdf. > > > > In that case I would consider patching our in-tree mandoc to not warn > > about Tn. Or request support for Tn or a well-defined replacement upstream. > > > > I can see the benefit of keeping Tn around, as it /might/ potentially > > create nice formatting for HTML. On the other hand, I don't like the > > idea of not following the linter. > > > > I thought that Tn thing was the general consensus thing and added to the > linter because of that. The man page explains why it's problematic: > > Tn word ... > Supported only for compatibility, do not use this in new manuals. > Even though the macro name ("tradename") suggests a semantic > function, historic usage is inconsistent, mostly using it as a > presentation-level macro to request a small caps font. I believe that comes about because of confusion over trade name vs trademark. They are not defined as the same thing. > It was useful for the Unix trademark, but was tailor towards AT&T's > preferred dressing for the Unix trademark, not for trademarks in general. Crossing tradename with trademark? > In this case, there were several instances of abuse: > > -.Tn RSA . > +key under a public-key cryptosystem such as RSA. trade name: noun 1. the name used by a manufacturer, merchant, service company, farming business, etc., to identify itself individually as a business. 2. a word or phrase used in a trade to designate a business, service, or a particular class of goods, but that is not technically a trademark, either because it is not susceptible of exclusive appropriation as a trademark or because it is not affixed to goods sold in the market. 3. the name by which an article or substance is known to the trade. I would say RSA defanitly meets 3, and probably 2. > > Not a trademark in this context. RSA is a trademark for the RSA corporation > and it uses it in various other contexts. > > -The > -.Tn MD5 > -and > -.Tn SHA-1 > -algorithms have been proven to be vulnerable to practical collision > -attacks and should not be relied upon to produce unique outputs, > +The MD5 and SHA-1 algorithms have been proven to be vulnerable to practical > +collision attacks and should not be relied upon to produce unique outputs, > > MD5 and SHA-1 are not trade names in this context. The rest seem similar, > though I've not gone to the trouble to look them all up. I would disagree under the definition of trade name above, you seem to be applying the definition of trade mark. > > All in all, while I have some sympathy to Rod's view that we're losing > semantic information by these changes in general, this particular one > actually fixes the abuse talked about in the mdoc manual, IMHO. Only if the macro is rigidly defined as "trademark" and it is not. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Jun 15 22:33:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DFAA3454C7; Mon, 15 Jun 2020 22:33:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m5gv6hlXz3cy0; Mon, 15 Jun 2020 22:32:59 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E10FE25012; Mon, 15 Jun 2020 22:32:59 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FMWxb3042310; Mon, 15 Jun 2020 22:32:59 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FMWxrI042307; Mon, 15 Jun 2020 22:32:59 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202006152232.05FMWxrI042307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 15 Jun 2020 22:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362206 - stable/12/sys/dev/evdev X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/12/sys/dev/evdev X-SVN-Commit-Revision: 362206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 22:33:00 -0000 Author: wulf Date: Mon Jun 15 22:32:59 2020 New Revision: 362206 URL: https://svnweb.freebsd.org/changeset/base/362206 Log: MFC r360624: [evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys. "F lock" is a switch between two sets of scancodes for function keys F1-F12 found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is pressed, then F1-F12 act as function keys and produce usual keyscans for these keys. When "F lock" is depressed, F1-F12 produced the same keyscans but prefixed with E0. Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys. [1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html [2] https://reviews.freebsd.org/D21565 MFC r360625: [evdev] Sync event codes with Linux kernel 5.6 Modified: stable/12/sys/dev/evdev/evdev_utils.c stable/12/sys/dev/evdev/input-event-codes.h stable/12/sys/dev/evdev/input.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/evdev/evdev_utils.c ============================================================================== --- stable/12/sys/dev/evdev/evdev_utils.c Mon Jun 15 20:12:10 2020 (r362205) +++ stable/12/sys/dev/evdev/evdev_utils.c Mon Jun 15 22:32:59 2020 (r362206) @@ -166,16 +166,16 @@ static uint16_t evdev_at_set1_scancodes[] = { NONE, NONE, KEY_VOLUMEDOWN, NONE, KEY_VOLUMEUP, NONE, KEY_HOMEPAGE, NONE, NONE, KEY_KPSLASH, NONE, KEY_SYSRQ, - KEY_RIGHTALT, NONE, NONE, NONE, - NONE, NONE, NONE, NONE, + KEY_RIGHTALT, NONE, NONE, KEY_F13, + KEY_F14, KEY_F15, KEY_F16, KEY_F17, /* 0x40 - 0x5f. 0xE0 prefixed */ - NONE, NONE, NONE, NONE, - NONE, NONE, KEY_PAUSE, KEY_HOME, + KEY_F18, KEY_F19, KEY_F20, KEY_F21, + KEY_F22, NONE, KEY_PAUSE, KEY_HOME, KEY_UP, KEY_PAGEUP, NONE, KEY_LEFT, NONE, KEY_RIGHT, NONE, KEY_END, KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, - NONE, NONE, NONE, NONE, - NONE, NONE, NONE, KEY_LEFTMETA, + NONE, NONE, NONE, KEY_F23, + KEY_F24, NONE, NONE, KEY_LEFTMETA, KEY_RIGHTMETA, KEY_MENU, KEY_POWER, KEY_SLEEP, /* 0x60 - 0x7f. 0xE0 prefixed */ NONE, NONE, NONE, KEY_WAKEUP, Modified: stable/12/sys/dev/evdev/input-event-codes.h ============================================================================== --- stable/12/sys/dev/evdev/input-event-codes.h Mon Jun 15 20:12:10 2020 (r362205) +++ stable/12/sys/dev/evdev/input-event-codes.h Mon Jun 15 22:32:59 2020 (r362206) @@ -453,10 +453,12 @@ #define KEY_TITLE 0x171 #define KEY_SUBTITLE 0x172 #define KEY_ANGLE 0x173 -#define KEY_ZOOM 0x174 +#define KEY_FULL_SCREEN 0x174 /* AC View Toggle */ +#define KEY_ZOOM KEY_FULL_SCREEN #define KEY_MODE 0x175 #define KEY_KEYBOARD 0x176 -#define KEY_SCREEN 0x177 +#define KEY_ASPECT_RATIO 0x177 /* HUTRR37: Aspect */ +#define KEY_SCREEN KEY_ASPECT_RATIO #define KEY_PC 0x178 /* Media Select Computer */ #define KEY_TV 0x179 /* Media Select TV */ #define KEY_TV2 0x17a /* Media Select Cable */ @@ -618,6 +620,7 @@ #define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ #define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ #define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */ +#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ @@ -660,7 +663,87 @@ */ #define KEY_DATA 0x277 #define KEY_ONSCREEN_KEYBOARD 0x278 +/* Electronic privacy screen control */ +#define KEY_PRIVACY_SCREEN_TOGGLE 0x279 +/* Select an area of screen to be copied */ +#define KEY_SELECTIVE_SCREENSHOT 0x27a + +/* + * Some keyboards have keys which do not have a defined meaning, these keys + * are intended to be programmed / bound to macros by the user. For most + * keyboards with these macro-keys the key-sequence to inject, or action to + * take, is all handled by software on the host side. So from the kernel's + * point of view these are just normal keys. + * + * The KEY_MACRO# codes below are intended for such keys, which may be labeled + * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys + * where the marking on the key does indicate a defined meaning / purpose. + * + * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing + * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO + * define MUST be added. + */ +#define KEY_MACRO1 0x290 +#define KEY_MACRO2 0x291 +#define KEY_MACRO3 0x292 +#define KEY_MACRO4 0x293 +#define KEY_MACRO5 0x294 +#define KEY_MACRO6 0x295 +#define KEY_MACRO7 0x296 +#define KEY_MACRO8 0x297 +#define KEY_MACRO9 0x298 +#define KEY_MACRO10 0x299 +#define KEY_MACRO11 0x29a +#define KEY_MACRO12 0x29b +#define KEY_MACRO13 0x29c +#define KEY_MACRO14 0x29d +#define KEY_MACRO15 0x29e +#define KEY_MACRO16 0x29f +#define KEY_MACRO17 0x2a0 +#define KEY_MACRO18 0x2a1 +#define KEY_MACRO19 0x2a2 +#define KEY_MACRO20 0x2a3 +#define KEY_MACRO21 0x2a4 +#define KEY_MACRO22 0x2a5 +#define KEY_MACRO23 0x2a6 +#define KEY_MACRO24 0x2a7 +#define KEY_MACRO25 0x2a8 +#define KEY_MACRO26 0x2a9 +#define KEY_MACRO27 0x2aa +#define KEY_MACRO28 0x2ab +#define KEY_MACRO29 0x2ac +#define KEY_MACRO30 0x2ad + +/* + * Some keyboards with the macro-keys described above have some extra keys + * for controlling the host-side software responsible for the macro handling: + * -A macro recording start/stop key. Note that not all keyboards which emit + * KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if + * KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START + * should be interpreted as a recording start/stop toggle; + * -Keys for switching between different macro (pre)sets, either a key for + * cycling through the configured presets or keys to directly select a preset. + */ +#define KEY_MACRO_RECORD_START 0x2b0 +#define KEY_MACRO_RECORD_STOP 0x2b1 +#define KEY_MACRO_PRESET_CYCLE 0x2b2 +#define KEY_MACRO_PRESET1 0x2b3 +#define KEY_MACRO_PRESET2 0x2b4 +#define KEY_MACRO_PRESET3 0x2b5 + +/* + * Some keyboards have a buildin LCD panel where the contents are controlled + * by the host. Often these have a number of keys directly below the LCD + * intended for controlling a menu shown on the LCD. These keys often don't + * have any labeling so we just name them KEY_KBD_LCD_MENU# + */ +#define KEY_KBD_LCD_MENU1 0x2b8 +#define KEY_KBD_LCD_MENU2 0x2b9 +#define KEY_KBD_LCD_MENU3 0x2ba +#define KEY_KBD_LCD_MENU4 0x2bb +#define KEY_KBD_LCD_MENU5 0x2bc + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1 @@ -722,6 +805,16 @@ #define REL_DIAL 0x07 #define REL_WHEEL 0x08 #define REL_MISC 0x09 +/* + * 0x0a is reserved and should not be used in input drivers. + * It was used by HID as REL_MISC+1 and userspace needs to detect if + * the next REL_* event is correct or is just REL_MISC + n. + * We define here REL_RESERVED so userspace can rely on it and detect + * the situation described above. + */ +#define REL_RESERVED 0x0a +#define REL_WHEEL_HI_RES 0x0b +#define REL_HWHEEL_HI_RES 0x0c #define REL_MAX 0x0f #define REL_CNT (REL_MAX+1) @@ -757,6 +850,15 @@ #define ABS_VOLUME 0x20 #define ABS_MISC 0x28 + +/* + * 0x2e is reserved and should not be used in input drivers. + * It was used by HID as ABS_MISC+6 and userspace needs to detect if + * the next ABS_* event is correct or is just ABS_MISC + n. + * We define here ABS_RESERVED so userspace can rely on it and detect + * the situation described above. + */ +#define ABS_RESERVED 0x2e #define ABS_MT_SLOT 0x2f /* MT slot being modified */ #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ Modified: stable/12/sys/dev/evdev/input.h ============================================================================== --- stable/12/sys/dev/evdev/input.h Mon Jun 15 20:12:10 2020 (r362205) +++ stable/12/sys/dev/evdev/input.h Mon Jun 15 22:32:59 2020 (r362206) @@ -148,10 +148,11 @@ struct input_keymap_entry { /* * MT_TOOL types */ -#define MT_TOOL_FINGER 0 -#define MT_TOOL_PEN 1 -#define MT_TOOL_PALM 2 -#define MT_TOOL_MAX 2 +#define MT_TOOL_FINGER 0x00 +#define MT_TOOL_PEN 0x01 +#define MT_TOOL_PALM 0x02 +#define MT_TOOL_DIAL 0x0a +#define MT_TOOL_MAX 0x0f /* * Values describing the status of a force-feedback effect From owner-svn-src-all@freebsd.org Mon Jun 15 22:35:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 011733451B8; Mon, 15 Jun 2020 22:35:41 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m5l06BHGz3cwq; Mon, 15 Jun 2020 22:35:40 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF9C524EBF; Mon, 15 Jun 2020 22:35:40 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FMZemZ042537; Mon, 15 Jun 2020 22:35:40 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FMZevU042534; Mon, 15 Jun 2020 22:35:40 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202006152235.05FMZevU042534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 15 Jun 2020 22:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362207 - stable/11/sys/dev/evdev X-SVN-Group: stable-11 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/11/sys/dev/evdev X-SVN-Commit-Revision: 362207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 22:35:41 -0000 Author: wulf Date: Mon Jun 15 22:35:39 2020 New Revision: 362207 URL: https://svnweb.freebsd.org/changeset/base/362207 Log: MFC r360624: [evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys. "F lock" is a switch between two sets of scancodes for function keys F1-F12 found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is pressed, then F1-F12 act as function keys and produce usual keyscans for these keys. When "F lock" is depressed, F1-F12 produced the same keyscans but prefixed with E0. Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys. [1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html [2] https://reviews.freebsd.org/D21565 MFC r360625: [evdev] Sync event codes with Linux kernel 5.6 Modified: stable/11/sys/dev/evdev/evdev_utils.c stable/11/sys/dev/evdev/input-event-codes.h stable/11/sys/dev/evdev/input.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/evdev/evdev_utils.c ============================================================================== --- stable/11/sys/dev/evdev/evdev_utils.c Mon Jun 15 22:32:59 2020 (r362206) +++ stable/11/sys/dev/evdev/evdev_utils.c Mon Jun 15 22:35:39 2020 (r362207) @@ -168,16 +168,16 @@ static uint16_t evdev_at_set1_scancodes[] = { NONE, NONE, KEY_VOLUMEDOWN, NONE, KEY_VOLUMEUP, NONE, KEY_HOMEPAGE, NONE, NONE, KEY_KPSLASH, NONE, KEY_SYSRQ, - KEY_RIGHTALT, NONE, NONE, NONE, - NONE, NONE, NONE, NONE, + KEY_RIGHTALT, NONE, NONE, KEY_F13, + KEY_F14, KEY_F15, KEY_F16, KEY_F17, /* 0x40 - 0x5f. 0xE0 prefixed */ - NONE, NONE, NONE, NONE, - NONE, NONE, KEY_PAUSE, KEY_HOME, + KEY_F18, KEY_F19, KEY_F20, KEY_F21, + KEY_F22, NONE, KEY_PAUSE, KEY_HOME, KEY_UP, KEY_PAGEUP, NONE, KEY_LEFT, NONE, KEY_RIGHT, NONE, KEY_END, KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, - NONE, NONE, NONE, NONE, - NONE, NONE, NONE, KEY_LEFTMETA, + NONE, NONE, NONE, KEY_F23, + KEY_F24, NONE, NONE, KEY_LEFTMETA, KEY_RIGHTMETA, KEY_MENU, KEY_POWER, KEY_SLEEP, /* 0x60 - 0x7f. 0xE0 prefixed */ NONE, NONE, NONE, KEY_WAKEUP, Modified: stable/11/sys/dev/evdev/input-event-codes.h ============================================================================== --- stable/11/sys/dev/evdev/input-event-codes.h Mon Jun 15 22:32:59 2020 (r362206) +++ stable/11/sys/dev/evdev/input-event-codes.h Mon Jun 15 22:35:39 2020 (r362207) @@ -453,10 +453,12 @@ #define KEY_TITLE 0x171 #define KEY_SUBTITLE 0x172 #define KEY_ANGLE 0x173 -#define KEY_ZOOM 0x174 +#define KEY_FULL_SCREEN 0x174 /* AC View Toggle */ +#define KEY_ZOOM KEY_FULL_SCREEN #define KEY_MODE 0x175 #define KEY_KEYBOARD 0x176 -#define KEY_SCREEN 0x177 +#define KEY_ASPECT_RATIO 0x177 /* HUTRR37: Aspect */ +#define KEY_SCREEN KEY_ASPECT_RATIO #define KEY_PC 0x178 /* Media Select Computer */ #define KEY_TV 0x179 /* Media Select TV */ #define KEY_TV2 0x17a /* Media Select Cable */ @@ -618,6 +620,7 @@ #define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ #define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ #define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */ +#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ @@ -660,7 +663,87 @@ */ #define KEY_DATA 0x277 #define KEY_ONSCREEN_KEYBOARD 0x278 +/* Electronic privacy screen control */ +#define KEY_PRIVACY_SCREEN_TOGGLE 0x279 +/* Select an area of screen to be copied */ +#define KEY_SELECTIVE_SCREENSHOT 0x27a + +/* + * Some keyboards have keys which do not have a defined meaning, these keys + * are intended to be programmed / bound to macros by the user. For most + * keyboards with these macro-keys the key-sequence to inject, or action to + * take, is all handled by software on the host side. So from the kernel's + * point of view these are just normal keys. + * + * The KEY_MACRO# codes below are intended for such keys, which may be labeled + * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys + * where the marking on the key does indicate a defined meaning / purpose. + * + * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing + * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO + * define MUST be added. + */ +#define KEY_MACRO1 0x290 +#define KEY_MACRO2 0x291 +#define KEY_MACRO3 0x292 +#define KEY_MACRO4 0x293 +#define KEY_MACRO5 0x294 +#define KEY_MACRO6 0x295 +#define KEY_MACRO7 0x296 +#define KEY_MACRO8 0x297 +#define KEY_MACRO9 0x298 +#define KEY_MACRO10 0x299 +#define KEY_MACRO11 0x29a +#define KEY_MACRO12 0x29b +#define KEY_MACRO13 0x29c +#define KEY_MACRO14 0x29d +#define KEY_MACRO15 0x29e +#define KEY_MACRO16 0x29f +#define KEY_MACRO17 0x2a0 +#define KEY_MACRO18 0x2a1 +#define KEY_MACRO19 0x2a2 +#define KEY_MACRO20 0x2a3 +#define KEY_MACRO21 0x2a4 +#define KEY_MACRO22 0x2a5 +#define KEY_MACRO23 0x2a6 +#define KEY_MACRO24 0x2a7 +#define KEY_MACRO25 0x2a8 +#define KEY_MACRO26 0x2a9 +#define KEY_MACRO27 0x2aa +#define KEY_MACRO28 0x2ab +#define KEY_MACRO29 0x2ac +#define KEY_MACRO30 0x2ad + +/* + * Some keyboards with the macro-keys described above have some extra keys + * for controlling the host-side software responsible for the macro handling: + * -A macro recording start/stop key. Note that not all keyboards which emit + * KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if + * KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START + * should be interpreted as a recording start/stop toggle; + * -Keys for switching between different macro (pre)sets, either a key for + * cycling through the configured presets or keys to directly select a preset. + */ +#define KEY_MACRO_RECORD_START 0x2b0 +#define KEY_MACRO_RECORD_STOP 0x2b1 +#define KEY_MACRO_PRESET_CYCLE 0x2b2 +#define KEY_MACRO_PRESET1 0x2b3 +#define KEY_MACRO_PRESET2 0x2b4 +#define KEY_MACRO_PRESET3 0x2b5 + +/* + * Some keyboards have a buildin LCD panel where the contents are controlled + * by the host. Often these have a number of keys directly below the LCD + * intended for controlling a menu shown on the LCD. These keys often don't + * have any labeling so we just name them KEY_KBD_LCD_MENU# + */ +#define KEY_KBD_LCD_MENU1 0x2b8 +#define KEY_KBD_LCD_MENU2 0x2b9 +#define KEY_KBD_LCD_MENU3 0x2ba +#define KEY_KBD_LCD_MENU4 0x2bb +#define KEY_KBD_LCD_MENU5 0x2bc + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1 @@ -722,6 +805,16 @@ #define REL_DIAL 0x07 #define REL_WHEEL 0x08 #define REL_MISC 0x09 +/* + * 0x0a is reserved and should not be used in input drivers. + * It was used by HID as REL_MISC+1 and userspace needs to detect if + * the next REL_* event is correct or is just REL_MISC + n. + * We define here REL_RESERVED so userspace can rely on it and detect + * the situation described above. + */ +#define REL_RESERVED 0x0a +#define REL_WHEEL_HI_RES 0x0b +#define REL_HWHEEL_HI_RES 0x0c #define REL_MAX 0x0f #define REL_CNT (REL_MAX+1) @@ -757,6 +850,15 @@ #define ABS_VOLUME 0x20 #define ABS_MISC 0x28 + +/* + * 0x2e is reserved and should not be used in input drivers. + * It was used by HID as ABS_MISC+6 and userspace needs to detect if + * the next ABS_* event is correct or is just ABS_MISC + n. + * We define here ABS_RESERVED so userspace can rely on it and detect + * the situation described above. + */ +#define ABS_RESERVED 0x2e #define ABS_MT_SLOT 0x2f /* MT slot being modified */ #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ Modified: stable/11/sys/dev/evdev/input.h ============================================================================== --- stable/11/sys/dev/evdev/input.h Mon Jun 15 22:32:59 2020 (r362206) +++ stable/11/sys/dev/evdev/input.h Mon Jun 15 22:35:39 2020 (r362207) @@ -148,10 +148,11 @@ struct input_keymap_entry { /* * MT_TOOL types */ -#define MT_TOOL_FINGER 0 -#define MT_TOOL_PEN 1 -#define MT_TOOL_PALM 2 -#define MT_TOOL_MAX 2 +#define MT_TOOL_FINGER 0x00 +#define MT_TOOL_PEN 0x01 +#define MT_TOOL_PALM 0x02 +#define MT_TOOL_DIAL 0x0a +#define MT_TOOL_MAX 0x0f /* * Values describing the status of a force-feedback effect From owner-svn-src-all@freebsd.org Mon Jun 15 22:41:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB211345803; Mon, 15 Jun 2020 22:41:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m5sh5ZqNz3dH2; Mon, 15 Jun 2020 22:41:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAE1024EC2; Mon, 15 Jun 2020 22:41:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FMfSCa042867; Mon, 15 Jun 2020 22:41:28 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FMfST2042865; Mon, 15 Jun 2020 22:41:28 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202006152241.05FMfST2042865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 15 Jun 2020 22:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362208 - in stable/12: share/man/man4 sys/dev/atkbdc X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/atkbdc X-SVN-Commit-Revision: 362208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 22:41:28 -0000 Author: wulf Date: Mon Jun 15 22:41:28 2020 New Revision: 362208 URL: https://svnweb.freebsd.org/changeset/base/362208 Log: MFC r361715: [psm] Do not disable trackpoint when hw.psm.elantech.touchpad_off is enabled PR: 246117 Reported by: Alexander Sieg MFC r361718: [psm] Workaround active PS/2 multiplexor hang which happens on some laptops after returning to legacy multiplexing mode at initialization stage. PR: 242542 Reported by: Felix Palmen Modified: stable/12/share/man/man4/psm.4 stable/12/sys/dev/atkbdc/psm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/psm.4 ============================================================================== --- stable/12/share/man/man4/psm.4 Mon Jun 15 22:35:39 2020 (r362207) +++ stable/12/share/man/man4/psm.4 Mon Jun 15 22:41:28 2020 (r362208) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2016 +.Dd June 2, 2020 .Dt PSM 4 .Os .Sh NAME @@ -361,6 +361,15 @@ the sysctl with the same name and by restarting .Xr moused 8 using .Pa /etc/rc.d/moused . +.Pp +Active multiplexing support can be disabled by setting +.Va hw.psm.mux_disabled +to +.Em 1 +at boot-time. +This will prevent +.Nm +from enabling active multiplexing mode needed for some Synaptics touchpads. .Sh IOCTLS There are a few .Xr ioctl 2 Modified: stable/12/sys/dev/atkbdc/psm.c ============================================================================== --- stable/12/sys/dev/atkbdc/psm.c Mon Jun 15 22:35:39 2020 (r362207) +++ stable/12/sys/dev/atkbdc/psm.c Mon Jun 15 22:41:28 2020 (r362208) @@ -516,6 +516,7 @@ static int verbose = PSM_DEBUG; static int synaptics_support = 1; static int trackpoint_support = 1; static int elantech_support = 1; +static int mux_disabled = 0; /* for backward compatibility */ #define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) @@ -2984,6 +2985,9 @@ SYSCTL_INT(_hw_psm, OID_AUTO, trackpoint_support, CTLF SYSCTL_INT(_hw_psm, OID_AUTO, elantech_support, CTLFLAG_RDTUN, &elantech_support, 0, "Enable support for Elantech touchpads"); +SYSCTL_INT(_hw_psm, OID_AUTO, mux_disabled, CTLFLAG_RDTUN, + &mux_disabled, 0, "Disable active multiplexing"); + static void psmintr(void *arg) { @@ -4436,7 +4440,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m *x = *y = *z = 0; ms->button = ms->obutton; - if (sc->syninfo.touchpad_off) + if (sc->syninfo.touchpad_off && pkt != ELANTECH_PKT_TRACKPOINT) return (0); /* Common legend @@ -6252,6 +6256,9 @@ enable_synaptics_mux(struct psm_softc *sc, enum probea int active_ports_count = 0; int active_ports_mask = 0; + if (mux_disabled != 0) + return (FALSE); + version = enable_aux_mux(kbdc); if (version == -1) return (FALSE); @@ -6288,6 +6295,21 @@ enable_synaptics_mux(struct psm_softc *sc, enum probea /* IRQ handler does not support active multiplexing mode */ disable_aux_mux(kbdc); + + /* Is MUX still alive after switching back to legacy mode? */ + if (!enable_aux_dev(kbdc) || !disable_aux_dev(kbdc)) { + /* + * On some laptops e.g. Lenovo X121e dead AUX MUX can be + * brought back to life with resetting of keyboard. + */ + reset_kbd(kbdc); + if (!enable_aux_dev(kbdc) || !disable_aux_dev(kbdc)) { + printf("psm%d: AUX MUX hang detected!\n", sc->unit); + printf("Consider adding hw.psm.mux_disabled=1 to " + "loader tunables\n"); + } + } + empty_both_buffers(kbdc, 10); /* remove stray data if any */ return (probe); } From owner-svn-src-all@freebsd.org Mon Jun 15 22:43:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBC253459B9; Mon, 15 Jun 2020 22:43:46 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m5wL52pmz3dBw; Mon, 15 Jun 2020 22:43:46 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A842425198; Mon, 15 Jun 2020 22:43:46 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FMhk8R048665; Mon, 15 Jun 2020 22:43:46 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FMhkhX048663; Mon, 15 Jun 2020 22:43:46 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202006152243.05FMhkhX048663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 15 Jun 2020 22:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362209 - in stable/11: share/man/man4 sys/dev/atkbdc X-SVN-Group: stable-11 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/atkbdc X-SVN-Commit-Revision: 362209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 22:43:46 -0000 Author: wulf Date: Mon Jun 15 22:43:46 2020 New Revision: 362209 URL: https://svnweb.freebsd.org/changeset/base/362209 Log: MFC r361715: [psm] Do not disable trackpoint when hw.psm.elantech.touchpad_off is enabled PR: 246117 Reported by: Alexander Sieg MFC r361718: [psm] Workaround active PS/2 multiplexor hang which happens on some laptops after returning to legacy multiplexing mode at initialization stage. PR: 242542 Reported by: Felix Palmen Modified: stable/11/share/man/man4/psm.4 stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/psm.4 ============================================================================== --- stable/11/share/man/man4/psm.4 Mon Jun 15 22:41:28 2020 (r362208) +++ stable/11/share/man/man4/psm.4 Mon Jun 15 22:43:46 2020 (r362209) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2016 +.Dd June 2, 2020 .Dt PSM 4 .Os .Sh NAME @@ -361,6 +361,15 @@ the sysctl with the same name and by restarting .Xr moused 8 using .Pa /etc/rc.d/moused . +.Pp +Active multiplexing support can be disabled by setting +.Va hw.psm.mux_disabled +to +.Em 1 +at boot-time. +This will prevent +.Nm +from enabling active multiplexing mode needed for some Synaptics touchpads. .Sh IOCTLS There are a few .Xr ioctl 2 Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Mon Jun 15 22:41:28 2020 (r362208) +++ stable/11/sys/dev/atkbdc/psm.c Mon Jun 15 22:43:46 2020 (r362209) @@ -515,6 +515,7 @@ static int verbose = PSM_DEBUG; static int synaptics_support = 0; static int trackpoint_support = 0; static int elantech_support = 0; +static int mux_disabled = 0; /* for backward compatibility */ #define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) @@ -2991,6 +2992,9 @@ SYSCTL_INT(_hw_psm, OID_AUTO, trackpoint_support, CTLF SYSCTL_INT(_hw_psm, OID_AUTO, elantech_support, CTLFLAG_RDTUN, &elantech_support, 0, "Enable support for Elantech touchpads"); +SYSCTL_INT(_hw_psm, OID_AUTO, mux_disabled, CTLFLAG_RDTUN, + &mux_disabled, 0, "Disable active multiplexing"); + static void psmintr(void *arg) { @@ -4439,7 +4443,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m *x = *y = *z = 0; ms->button = ms->obutton; - if (sc->syninfo.touchpad_off) + if (sc->syninfo.touchpad_off && pkt != ELANTECH_PKT_TRACKPOINT) return (0); /* Common legend @@ -6246,6 +6250,9 @@ enable_synaptics_mux(struct psm_softc *sc, enum probea int active_ports_count = 0; int active_ports_mask = 0; + if (mux_disabled != 0) + return (FALSE); + version = enable_aux_mux(kbdc); if (version == -1) return (FALSE); @@ -6282,6 +6289,21 @@ enable_synaptics_mux(struct psm_softc *sc, enum probea /* IRQ handler does not support active multiplexing mode */ disable_aux_mux(kbdc); + + /* Is MUX still alive after switching back to legacy mode? */ + if (!enable_aux_dev(kbdc) || !disable_aux_dev(kbdc)) { + /* + * On some laptops e.g. Lenovo X121e dead AUX MUX can be + * brought back to life with resetting of keyboard. + */ + reset_kbd(kbdc); + if (!enable_aux_dev(kbdc) || !disable_aux_dev(kbdc)) { + printf("psm%d: AUX MUX hang detected!\n", sc->unit); + printf("Consider adding hw.psm.mux_disabled=1 to " + "loader tunables\n"); + } + } + empty_both_buffers(kbdc, 10); /* remove stray data if any */ return (probe); } From owner-svn-src-all@freebsd.org Tue Jun 16 00:18:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9F09347F56 for ; Tue, 16 Jun 2020 00:18:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m81L0X40z412T for ; Tue, 16 Jun 2020 00:18:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id e16so14205930qtg.0 for ; Mon, 15 Jun 2020 17:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=clflAy0o4lqnIRnQgLyP8omm7AkpTBEXiORFcT2bgsw=; b=XEXRnB+FxoEEQO66qK7RQGebMVuSoViIT8Yh+JvWAeRjqk08z7OIzn/eimT0DmXgfZ gcjfHSbKMUYtPB7C1xsRKHjHXLNgVfD7rFXavsQ40b0R7Nbzzpru1IbgsT7cZgVcgLJk bKNbf44hNUcfe1948n76yE2916W48xRk3vnf6aMSpqGApRZLqeQ3T9OIyAfMwLk5vzxt uXAaKVbNO230eWK37RlcWAuJgg5lefPS+G3NEPTfKOmh4qMt6j+kpp64O7dsFh8Ls7Jz 5wVt/IgTz307EKTPq5EYuF3pJO5V26izJuxb4SWzo3r/u2TOyDjvkuC97vu3sPv92LBk 9/QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=clflAy0o4lqnIRnQgLyP8omm7AkpTBEXiORFcT2bgsw=; b=AbeReRSEFkyYK41e4fFVItRDpNRxdQ2p2IVx/XGVXisE+ExoXyYSqGjMOWgqlYaOB7 aI5EHVpyZ2t5/KVyUMRYhMHuCrUKar1p41CssXVSf11ZRALS4dI4oTNC109dLjRudTwE /pHuObRMJGZf6HWb3MgLl2hMQKCcdfsNE5Ry1i8rPWI5ac1vGesfLCzMY/Lg7l9OonJM pUnE8C7R6aRcbkj4wO/rL0PQ5rfmw7HFQHx4vMo0NPmxA4b6qPulDY2Iv9/rV3xXGPvU /+8Zoej6JuxSkeP+zE6q97JzHb4KDNFu7Z+4nMAcLIifsvqo9MbTPvAK7K4Ztp0VSOuB tBuQ== X-Gm-Message-State: AOAM533lRynCLY/dpZ+1rx9+yXNgaSV8rNqZzb07G55+MQC7N6WLCY7w tswVpiYkF2ZKaHqUSYZtH3Y0Yej6/ZqPTqW34nVkAA== X-Google-Smtp-Source: ABdhPJxC0jXDTjigF3xpf612zIkH8dU0oxQKuW6uEi/Iz+jQjxrX+CAEG5ivbGEr+XiNEBafp22QvoCJoSTyh2H4V9c= X-Received: by 2002:ac8:4b71:: with SMTP id g17mr18761887qts.187.1592266692450; Mon, 15 Jun 2020 17:18:12 -0700 (PDT) MIME-Version: 1.0 References: <202006152112.05FLCFqc078086@gndrsh.dnsmgr.net> In-Reply-To: <202006152112.05FLCFqc078086@gndrsh.dnsmgr.net> From: Warner Losh Date: Mon, 15 Jun 2020 18:18:00 -0600 Message-ID: Subject: Re: svn commit: r362191 - head/sbin/md5 To: "Rodney W. Grimes" Cc: Mateusz Piotrowski <0mp@freebsd.org>, =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49m81L0X40z412T X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=XEXRnB+F; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82d) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.66 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.77)[-0.774]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.45)[-0.446]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.44)[-0.442]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82d:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 00:18:14 -0000 On Mon, Jun 15, 2020, 3:12 PM Rodney W. Grimes wrote: > > On Mon, Jun 15, 2020 at 7:34 AM Mateusz Piotrowski <0mp@freebsd.org> > wrote: > > > > > Hi, > > > > > > On 6/15/20 2:33 PM, Rodney W. Grimes wrote: > > > > [ Charset UTF-8 unsupported, converting... ] > > > >> Author: fernape (ports committer) > > > >> Date: Mon Jun 15 10:08:02 2020 > > > >> New Revision: 362191 > > > >> URL: https://svnweb.freebsd.org/changeset/base/362191 > > > >> > > > >> Log: > > > >> md5(1): fix style in man page > > > > > > > > Mandoc is fine to ignore this, but it is wrong to call it useless. > > > > > > > > I really wish that this stop. .Tn might be useless to mandoc, > > > > but it is a very usable thing if your formatting to something > > > > other than txt, as in a ps or pdf. > > > > > > In that case I would consider patching our in-tree mandoc to not warn > > > about Tn. Or request support for Tn or a well-defined replacement > upstream. > > > > > > I can see the benefit of keeping Tn around, as it /might/ potentially > > > create nice formatting for HTML. On the other hand, I don't like the > > > idea of not following the linter. > > > > > > > I thought that Tn thing was the general consensus thing and added to the > > linter because of that. The man page explains why it's problematic: > > > > Tn word ... > > Supported only for compatibility, do not use this in new > manuals. > > Even though the macro name ("tradename") suggests a semantic > > function, historic usage is inconsistent, mostly using it as a > > presentation-level macro to request a small caps font. > > I believe that comes about because of confusion over trade name vs > trademark. They are not defined as the same thing. > > > It was useful for the Unix trademark, but was tailor towards AT&T's > > preferred dressing for the Unix trademark, not for trademarks in general. > > Crossing tradename with trademark? > > > In this case, there were several instances of abuse: > > > > -.Tn RSA . > > +key under a public-key cryptosystem such as RSA. > > trade name: noun > 1. the name used by a manufacturer, merchant, service company, > farming business, etc., to identify itself individually > as a business. > 2. a word or phrase used in a trade to designate a business, > service, or a particular class of goods, but that is not > technically a trademark, either because it is not > susceptible of exclusive appropriation as a trademark or > because it is not affixed to goods sold in the market. > 3. the name by which an article or substance is known to the trade. > > I would say RSA defanitly meets 3, and probably 2. > > > > > Not a trademark in this context. RSA is a trademark for the RSA > corporation > > and it uses it in various other contexts. > > > > -The > > -.Tn MD5 > > -and > > -.Tn SHA-1 > > -algorithms have been proven to be vulnerable to practical collision > > -attacks and should not be relied upon to produce unique outputs, > > +The MD5 and SHA-1 algorithms have been proven to be vulnerable to > practical > > +collision attacks and should not be relied upon to produce unique > outputs, > > > > MD5 and SHA-1 are not trade names in this context. The rest seem similar, > > though I've not gone to the trouble to look them all up. > > I would disagree under the definition of trade name above, > you seem to be applying the definition of trade mark. > None of these are trade names. They are all simple names used to describe different algorithms. They are no more trade names than bubble sort or radix tree. > > > All in all, while I have some sympathy to Rod's view that we're losing > > semantic information by these changes in general, this particular one > > actually fixes the abuse talked about in the mdoc manual, IMHO. > > Only if the macro is rigidly defined as "trademark" and it > is not. > The macro is obsoleted in upstream. Splitting hairs on this isn't going to change that. Time has passed this one by. Warner > Warner > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Tue Jun 16 00:27:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77265348226; Tue, 16 Jun 2020 00:27:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m8D62mSfz41Sl; Tue, 16 Jun 2020 00:27:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55A442648F; Tue, 16 Jun 2020 00:27:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G0RYdZ010384; Tue, 16 Jun 2020 00:27:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G0RWEN010373; Tue, 16 Jun 2020 00:27:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006160027.05G0RWEN010373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Jun 2020 00:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362210 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 362210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 00:27:34 -0000 Author: adrian Date: Tue Jun 16 00:27:32 2020 New Revision: 362210 URL: https://svnweb.freebsd.org/changeset/base/362210 Log: [net80211] Add initial U-APSD negotiation support. U-APSD (unscheduled automatic power save delivery) is a power save method that's a bit better than legacy PS-POLL - stations can mark frames with an extra flag that tells the AP to leak out more frames after it sends its own frames rather than needing to send a PS-POLL to get another frame from the AP. Now, this code just handles the negotiation bits; it doesn't actually implement U-APSD. That's up to drivers, and nothing in the tree yet implements this. I /may/ implement this for ath(4) if I eventually care enough but right now I plan on just implementing it for firmware offload based NICs that handle this in the NIC. I'll commit the ifconfig bit after this and I may have some follow-up commits as this gets used more by me in local testing. This should be a glorious no-op for everyone else. If things change for anyone that isn't fixed by a complete recompile then please reach out to me. Modified: head/sys/net80211/_ieee80211.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_sta.h head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/_ieee80211.h Tue Jun 16 00:27:32 2020 (r362210) @@ -488,6 +488,7 @@ struct ieee80211_mimo_info { #define IEEE80211_C_MBSS 0x00040000 /* CAPABILITY: MBSS available */ #define IEEE80211_C_SWSLEEP 0x00080000 /* CAPABILITY: do sleep here */ #define IEEE80211_C_SWAMSDUTX 0x00100000 /* CAPABILITY: software A-MSDU TX */ +#define IEEE80211_C_UAPSD 0x00200000 /* CAPABILITY: U-APSD */ /* 0x7c0000 available */ #define IEEE80211_C_WPA1 0x00800000 /* CAPABILITY: WPA1 avail */ #define IEEE80211_C_WPA2 0x01000000 /* CAPABILITY: WPA2 avail */ Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211.c Tue Jun 16 00:27:32 2020 (r362210) @@ -616,6 +616,12 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ie if (vap->iv_opmode == IEEE80211_M_HOSTAP && (vap->iv_caps & IEEE80211_C_DFS)) vap->iv_flags_ext |= IEEE80211_FEXT_DFS; + /* NB: only flip on U-APSD for hostap/sta for now */ + if ((vap->iv_opmode == IEEE80211_M_STA) + || (vap->iv_opmode == IEEE80211_M_HOSTAP)) { + if (vap->iv_caps & IEEE80211_C_UAPSD) + vap->iv_flags_ext |= IEEE80211_FEXT_UAPSD; + } vap->iv_des_chan = IEEE80211_CHAN_ANYC; /* any channel is ok */ vap->iv_bmissthreshold = IEEE80211_HWBMISS_DEFAULT; Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_hostap.c Tue Jun 16 00:27:32 2020 (r362210) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include /* for parse_wmeie */ #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -2253,8 +2254,18 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbu * Mark node as capable of QoS. */ ni->ni_flags |= IEEE80211_NODE_QOS; + if (ieee80211_parse_wmeie(wme, wh, ni) > 0) { + if (ni->ni_uapsd != 0) + ni->ni_flags |= + IEEE80211_NODE_UAPSD; + else + ni->ni_flags &= + ~IEEE80211_NODE_UAPSD; + } } else - ni->ni_flags &= ~IEEE80211_NODE_QOS; + ni->ni_flags &= + ~(IEEE80211_NODE_QOS | + IEEE80211_NODE_UAPSD); #ifdef IEEE80211_SUPPORT_SUPERG if (ath != NULL) { setie(ath_ie, ath - sfrm); @@ -2268,6 +2279,7 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbu #undef setie } else { ni->ni_flags &= ~IEEE80211_NODE_QOS; + ni->ni_flags &= ~IEEE80211_NODE_UAPSD; ni->ni_ath_flags = 0; } ieee80211_node_join(ni, resp); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_ioctl.c Tue Jun 16 00:27:32 2020 (r362210) @@ -1145,6 +1145,11 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_l if (vap->iv_flags_ht & IEEE80211_FHT_LDPC_RX) ireq->i_val |= 2; break; + case IEEE80211_IOC_UAPSD: + ireq->i_val = 0; + if (vap->iv_flags_ext & IEEE80211_FEXT_UAPSD) + ireq->i_val = 1; + break; /* VHT */ case IEEE80211_IOC_VHTCONF: @@ -3461,6 +3466,16 @@ ieee80211_ioctl_set80211(struct ieee80211vap *vap, u_l /* NB: reset only if we're operating on an 11n channel */ if (isvapht(vap)) error = ERESTART; + break; + case IEEE80211_IOC_UAPSD: + if ((vap->iv_caps & IEEE80211_C_UAPSD) == 0) + return EOPNOTSUPP; + if (ireq->i_val == 0) + vap->iv_flags_ext &= ~IEEE80211_FEXT_UAPSD; + else if (ireq->i_val == 1) + vap->iv_flags_ext |= IEEE80211_FEXT_UAPSD; + else + return EINVAL; break; /* VHT */ Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_ioctl.h Tue Jun 16 00:27:32 2020 (r362210) @@ -710,6 +710,8 @@ struct ieee80211req { #define IEEE80211_IOC_GREENFIELD 112 /* Greenfield (on, off) */ #define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) */ #define IEEE80211_IOC_LDPC 114 /* LDPC Tx/RX (on, off) */ +#define IEEE80211_IOC_UAPSD 115 /* UAPSD (on, off) */ +#define IEEE80211_IOC_UAPSD_INFO 116 /* UAPSD (SP, per-AC enable) */ /* VHT */ #define IEEE80211_IOC_VHTCONF 130 /* VHT config (off, on; widths) */ Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_node.h Tue Jun 16 00:27:32 2020 (r362210) @@ -146,6 +146,7 @@ struct ieee80211_node { #define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ #define IEEE80211_NODE_VHT 0x100000 /* VHT enabled */ #define IEEE80211_NODE_LDPC 0x200000 /* LDPC enabled */ +#define IEEE80211_NODE_UAPSD 0x400000 /* U-APSD power save enabled */ uint16_t ni_associd; /* association ID */ uint16_t ni_vlan; /* vlan tag */ uint16_t ni_txpower; /* current transmit power */ @@ -255,6 +256,9 @@ struct ieee80211_node { /* quiet time IE state for the given node */ uint32_t ni_quiet_ie_set; /* Quiet time IE was seen */ struct ieee80211_quiet_ie ni_quiet_ie; /* last seen quiet IE */ + + /* U-APSD */ + uint8_t ni_uapsd; /* U-APSD per-node flags matching WMM STA QoS Info field */ uint64_t ni_spare[3]; }; Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_output.c Tue Jun 16 00:27:32 2020 (r362210) @@ -2156,26 +2156,48 @@ add_ie(uint8_t *frm, const uint8_t *ie) * Add a WME information element to a frame. */ uint8_t * -ieee80211_add_wme_info(uint8_t *frm, struct ieee80211_wme_state *wme) +ieee80211_add_wme_info(uint8_t *frm, struct ieee80211_wme_state *wme, + struct ieee80211_node *ni) { - static const struct ieee80211_wme_info info = { - .wme_id = IEEE80211_ELEMID_VENDOR, - .wme_len = sizeof(struct ieee80211_wme_info) - 2, - .wme_oui = { WME_OUI_BYTES }, - .wme_type = WME_OUI_TYPE, - .wme_subtype = WME_INFO_OUI_SUBTYPE, - .wme_version = WME_VERSION, - .wme_info = 0, - }; - memcpy(frm, &info, sizeof(info)); - return frm + sizeof(info); + static const uint8_t oui[4] = { WME_OUI_BYTES, WME_OUI_TYPE }; + struct ieee80211vap *vap = ni->ni_vap; + + *frm++ = IEEE80211_ELEMID_VENDOR; + *frm++ = sizeof(struct ieee80211_wme_info) - 2; + memcpy(frm, oui, sizeof(oui)); + frm += sizeof(oui); + *frm++ = WME_INFO_OUI_SUBTYPE; + *frm++ = WME_VERSION; + + /* QoS info field depends upon operating mode */ + switch (vap->iv_opmode) { + case IEEE80211_M_HOSTAP: + *frm = wme->wme_bssChanParams.cap_info; + if (vap->iv_flags_ext & IEEE80211_FEXT_UAPSD) + *frm |= WME_CAPINFO_UAPSD_EN; + frm++; + break; + case IEEE80211_M_STA: + /* + * NB: UAPSD drivers must set this up in their + * VAP creation method. + */ + *frm++ = vap->iv_uapsdinfo; + break; + default: + *frm++ = 0; + break; + } + + return frm; } /* * Add a WME parameters element to a frame. */ static uint8_t * -ieee80211_add_wme_param(uint8_t *frm, struct ieee80211_wme_state *wme) +ieee80211_add_wme_param(uint8_t *frm, struct ieee80211_wme_state *wme, + int uapsd_enable) { #define SM(_v, _f) (((_v) << _f##_S) & _f) #define ADDSHORT(frm, v) do { \ @@ -2195,8 +2217,12 @@ ieee80211_add_wme_param(uint8_t *frm, struct ieee80211 memcpy(frm, ¶m, sizeof(param)); frm += __offsetof(struct ieee80211_wme_info, wme_info); - *frm++ = wme->wme_bssChanParams.cap_info; /* AC info */ + *frm = wme->wme_bssChanParams.cap_info; /* AC info */ + if (uapsd_enable) + *frm |= WME_CAPINFO_UAPSD_EN; + frm++; *frm++ = 0; /* reserved field */ + /* XXX TODO - U-APSD bits - SP, flags below */ for (i = 0; i < WME_NUM_AC; i++) { const struct wmeParams *ac = &wme->wme_bssChanParams.cap_wmeParams[i]; @@ -2789,7 +2815,7 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int typ frm = ieee80211_add_wpa(frm, vap); if ((ic->ic_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) - frm = ieee80211_add_wme_info(frm, &ic->ic_wme); + frm = ieee80211_add_wme_info(frm, &ic->ic_wme, ni); /* * Same deal - only send HT info if we're on an 11n @@ -2881,7 +2907,8 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int typ } if ((vap->iv_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) - frm = ieee80211_add_wme_param(frm, &ic->ic_wme); + frm = ieee80211_add_wme_param(frm, &ic->ic_wme, + !! (vap->iv_flags_ext & IEEE80211_FEXT_UAPSD)); if ((ni->ni_flags & HTFLAGS) == HTFLAGS) { frm = ieee80211_add_htcap_vendor(frm, ni); frm = ieee80211_add_htinfo_vendor(frm, ni); @@ -3092,7 +3119,8 @@ ieee80211_alloc_proberesp(struct ieee80211_node *bss, } frm = ieee80211_add_wpa(frm, vap); if (vap->iv_flags & IEEE80211_F_WME) - frm = ieee80211_add_wme_param(frm, &ic->ic_wme); + frm = ieee80211_add_wme_param(frm, &ic->ic_wme, + !! (vap->iv_flags_ext & IEEE80211_FEXT_UAPSD)); if (IEEE80211_IS_CHAN_HT(bss->ni_chan) && (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT) && legacy != IEEE80211_SEND_LEGACY_11B) { @@ -3490,7 +3518,8 @@ ieee80211_beacon_construct(struct mbuf *m, uint8_t *fr frm = ieee80211_add_wpa(frm, vap); if (vap->iv_flags & IEEE80211_F_WME) { bo->bo_wme = frm; - frm = ieee80211_add_wme_param(frm, &ic->ic_wme); + frm = ieee80211_add_wme_param(frm, &ic->ic_wme, + !! (vap->iv_flags_ext & IEEE80211_FEXT_UAPSD)); } if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT)) { @@ -3782,7 +3811,8 @@ ieee80211_beacon_update(struct ieee80211_node *ni, str wme->wme_hipri_switch_hysteresis; } if (isset(bo->bo_flags, IEEE80211_BEACON_WME)) { - (void) ieee80211_add_wme_param(bo->bo_wme, wme); + (void) ieee80211_add_wme_param(bo->bo_wme, wme, + vap->iv_flags_ext & IEEE80211_FEXT_UAPSD); clrbit(bo->bo_flags, IEEE80211_BEACON_WME); } } Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_proto.c Tue Jun 16 00:27:32 2020 (r362210) @@ -1147,8 +1147,11 @@ ieee80211_wme_initparams_locked(struct ieee80211vap *v * field and updates hardware when said field changes. * Otherwise the hardware is programmed with defaults, not what * the beacon actually announces. + * + * Note that we can't ever have 0xff as an actual value; + * the only valid values are 0..15. */ - wme->wme_wmeChanParams.cap_info = 0; + wme->wme_wmeChanParams.cap_info = 0xfe; /* * Select mode; we can be called early in which case we Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_sta.c Tue Jun 16 00:27:32 2020 (r362210) @@ -1129,25 +1129,56 @@ bad: IEEE80211_SCAN_FAIL_STATUS); } +/* + * Parse the WME IE for QoS and U-APSD information. + * + * Returns -1 if the IE isn't found, 1 if it's found. + */ int +ieee80211_parse_wmeie(uint8_t *frm, const struct ieee80211_frame *wh, + struct ieee80211_node *ni) +{ + u_int len = frm[1]; + + ni->ni_uapsd = 0; + + if (len < sizeof(struct ieee80211_wme_param)-2) { + IEEE80211_DISCARD_IE(ni->ni_vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WME, + wh, "WME", "too short, len %u", len); + return -1; + } + + ni->ni_uapsd = frm[WME_CAPINFO_IE_OFFSET]; + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_POWER | IEEE80211_MSG_ASSOC, + ni, "U-APSD settings from STA: 0x%02x", ni->ni_uapsd); + + return 1; +} + +int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, - const struct ieee80211_frame *wh) + const struct ieee80211_frame *wh, uint8_t *qosinfo) { #define MS(_v, _f) (((_v) & _f) >> _f##_S) struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; - u_int len = frm[1], qosinfo; + u_int len = frm[1], qosinfo_count; int i; + *qosinfo = 0; + if (len < sizeof(struct ieee80211_wme_param)-2) { IEEE80211_DISCARD_IE(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WME, wh, "WME", "too short, len %u", len); return -1; } - qosinfo = frm[__offsetof(struct ieee80211_wme_param, param_qosInfo)]; - qosinfo &= WME_QOSINFO_COUNT; + *qosinfo = frm[__offsetof(struct ieee80211_wme_param, param_qosInfo)]; + qosinfo_count = *qosinfo & WME_QOSINFO_COUNT; + /* XXX do proper check for wraparound */ - if (qosinfo == wme->wme_wmeChanParams.cap_info) + if (qosinfo_count == wme->wme_wmeChanParams.cap_info) return 0; frm += __offsetof(struct ieee80211_wme_param, params_acParams); for (i = 0; i < WME_NUM_AC; i++) { @@ -1159,9 +1190,18 @@ ieee80211_parse_wmeparams(struct ieee80211vap *vap, ui wmep->wmep_logcwmin = MS(frm[1], WME_PARAM_LOGCWMIN); wmep->wmep_logcwmax = MS(frm[1], WME_PARAM_LOGCWMAX); wmep->wmep_txopLimit = le16dec(frm+2); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, + "%s: WME: %d: acm=%d aifsn=%d logcwmin=%d logcwmax=%d txopLimit=%d\n", + __func__, + i, + wmep->wmep_acm, + wmep->wmep_aifsn, + wmep->wmep_logcwmin, + wmep->wmep_logcwmax, + wmep->wmep_txopLimit); frm += 4; } - wme->wme_wmeChanParams.cap_info = qosinfo; + wme->wme_wmeChanParams.cap_info = qosinfo_count; return 1; #undef MS } @@ -1350,11 +1390,12 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf * struct ieee80211com *ic = ni->ni_ic; struct ieee80211_channel *rxchan = ic->ic_curchan; struct ieee80211_frame *wh; + int ht_state_change = 0, do_ht = 0; uint8_t *frm, *efrm; uint8_t *rates, *xrates, *wme, *htcap, *htinfo; uint8_t *vhtcap, *vhtopmode; uint8_t rate; - int ht_state_change = 0, do_ht = 0; + uint8_t qosinfo; wh = mtod(m0, struct ieee80211_frame *); frm = (uint8_t *)&wh[1]; @@ -1443,9 +1484,18 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf * /* XXX statistic */ } if (scan.wme != NULL && - (ni->ni_flags & IEEE80211_NODE_QOS) && - ieee80211_parse_wmeparams(vap, scan.wme, wh) > 0) - ieee80211_wme_updateparams(vap); + (ni->ni_flags & IEEE80211_NODE_QOS)) { + int _retval; + if ((_retval = ieee80211_parse_wmeparams(vap, + scan.wme, wh, &qosinfo)) >= 0) { + if (qosinfo & WME_CAPINFO_UAPSD_EN) + ni->ni_flags |= + IEEE80211_NODE_UAPSD; + if (_retval > 0) + ieee80211_wme_updateparams(vap); + } + } else + ni->ni_flags &= ~IEEE80211_NODE_UAPSD; #ifdef IEEE80211_SUPPORT_SUPERG if (scan.ath != NULL) ieee80211_parse_athparams(ni, scan.ath, wh); @@ -1782,7 +1832,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf * if (ni->ni_jointime == 0) ni->ni_jointime = time_uptime; if (wme != NULL && - ieee80211_parse_wmeparams(vap, wme, wh) >= 0) { + ieee80211_parse_wmeparams(vap, wme, wh, &qosinfo) >= 0) { ni->ni_flags |= IEEE80211_NODE_QOS; ieee80211_wme_updateparams(vap); } else Modified: head/sys/net80211/ieee80211_sta.h ============================================================================== --- head/sys/net80211/ieee80211_sta.h Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_sta.h Tue Jun 16 00:27:32 2020 (r362210) @@ -40,5 +40,12 @@ void ieee80211_sta_vattach(struct ieee80211vap *); * Used by the adhoc/mesh/tdma paths. */ extern int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, - const struct ieee80211_frame *wh); + const struct ieee80211_frame *wh, uint8_t *qosinfo); + +/* + * Used in the hostap path. + */ +extern int ieee80211_parse_wmeie(uint8_t *frm, + const struct ieee80211_frame *wh, struct ieee80211_node *ni); + #endif /* !_NET80211_IEEE80211_STA_H_ */ Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Jun 15 22:43:46 2020 (r362209) +++ head/sys/net80211/ieee80211_var.h Tue Jun 16 00:27:32 2020 (r362210) @@ -581,6 +581,9 @@ struct ieee80211vap { void (*iv_updateslot)(struct ieee80211vap *); struct task iv_slot_task; /* deferred slot time update */ + /* per-vap U-APSD state */ + uint8_t iv_uapsdinfo; /* sta mode QoS Info flags */ + uint64_t iv_spare[6]; }; MALLOC_DECLARE(M_80211_VAP); @@ -662,6 +665,7 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FEXT_FRAG_OFFLOAD 0x00200000 /* CONF: hardware does 802.11 fragmentation + assignment */ #define IEEE80211_FEXT_VHT 0x00400000 /* CONF: VHT support */ #define IEEE80211_FEXT_QUIET_IE 0x00800000 /* STATUS: quiet IE in a beacon has been added */ +#define IEEE80211_FEXT_UAPSD 0x01000000 /* CONF: enable U-APSD */ #define IEEE80211_FEXT_BITS \ "\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ From owner-svn-src-all@freebsd.org Tue Jun 16 00:28:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B74C34839D; Tue, 16 Jun 2020 00:28:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m8Dm6Zc4z41Tl; Tue, 16 Jun 2020 00:28:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD05E26501; Tue, 16 Jun 2020 00:28:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G0S8jZ010454; Tue, 16 Jun 2020 00:28:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G0S8hD010453; Tue, 16 Jun 2020 00:28:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006160028.05G0S8hD010453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Jun 2020 00:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362211 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 362211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 00:28:09 -0000 Author: adrian Date: Tue Jun 16 00:28:08 2020 New Revision: 362211 URL: https://svnweb.freebsd.org/changeset/base/362211 Log: [net80211] Add uapsd option to ifconfig Add an enable/disable option for controlling uapsd. I'm not yet controlling the individual AC configs or the service period. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Jun 16 00:27:32 2020 (r362210) +++ head/sbin/ifconfig/ifieee80211.c Tue Jun 16 00:28:08 2020 (r362211) @@ -1804,6 +1804,12 @@ set80211ldpc(const char *val, int d, int s, const stru set80211(s, IEEE80211_IOC_LDPC, ldpc, 0, NULL); } +static void +set80211uapsd(const char *val, int d, int s, const struct afswtch *rafp) +{ + set80211(s, IEEE80211_IOC_UAPSD, d, 0, NULL); +} + static DECL_CMD_FUNC(set80211ampdulimit, val, d) { @@ -5288,6 +5294,16 @@ end: break; } } + if (get80211val(s, IEEE80211_IOC_UAPSD, &val) != -1) { + switch (val) { + case 0: + LINE_CHECK("-uapsd"); + break; + case 1: + LINE_CHECK("uapsd"); + break; + } + } } if (IEEE80211_IS_CHAN_VHT(c) || verbose) { @@ -5872,6 +5888,8 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-ldpctx", -1, set80211ldpc), DEF_CMD("ldpc", 3, set80211ldpc), /* NB: tx+rx */ DEF_CMD("-ldpc", -3, set80211ldpc), + DEF_CMD("uapsd", 1, set80211uapsd), + DEF_CMD("-uapsd", 0, set80211uapsd), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), From owner-svn-src-all@freebsd.org Tue Jun 16 00:28:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39C0434832F; Tue, 16 Jun 2020 00:28:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m8FV0YY7z41pN; Tue, 16 Jun 2020 00:28:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E65625FCC; Tue, 16 Jun 2020 00:28:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G0SjF9010521; Tue, 16 Jun 2020 00:28:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G0SjUv010520; Tue, 16 Jun 2020 00:28:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006160028.05G0SjUv010520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Jun 2020 00:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362212 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 362212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 00:28:46 -0000 Author: adrian Date: Tue Jun 16 00:28:45 2020 New Revision: 362212 URL: https://svnweb.freebsd.org/changeset/base/362212 Log: [net80211] Add missing commit to previous-1 uapsd commit. Whoops; somehow my big commit line didn't include this.. cue the tree breakage emails. Modified: head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Tue Jun 16 00:28:08 2020 (r362211) +++ head/sys/net80211/ieee80211_proto.h Tue Jun 16 00:28:45 2020 (r362212) @@ -152,7 +152,8 @@ uint8_t *ieee80211_add_qos(uint8_t *, const struct iee uint16_t ieee80211_getcapinfo(struct ieee80211vap *, struct ieee80211_channel *); struct ieee80211_wme_state; -uint8_t * ieee80211_add_wme_info(uint8_t *frm, struct ieee80211_wme_state *wme); +uint8_t * ieee80211_add_wme_info(uint8_t *frm, struct ieee80211_wme_state *wme, + struct ieee80211_node *ni); void ieee80211_vap_reset_erp(struct ieee80211vap *); void ieee80211_reset_erp(struct ieee80211com *); From owner-svn-src-all@freebsd.org Tue Jun 16 01:11:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 827A13488FF; Tue, 16 Jun 2020 01:11:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49m9C12xrdz443y; Tue, 16 Jun 2020 01:11:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E23B26CA0; Tue, 16 Jun 2020 01:11:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G1BfMg039650; Tue, 16 Jun 2020 01:11:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G1BfA2039649; Tue, 16 Jun 2020 01:11:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006160111.05G1BfA2039649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Jun 2020 01:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362213 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 362213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 01:11:41 -0000 Author: adrian Date: Tue Jun 16 01:11:40 2020 New Revision: 362213 URL: https://svnweb.freebsd.org/changeset/base/362213 Log: [rsu] Update wme ie API use. Whoops, forgot to land this one too! Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Tue Jun 16 00:28:45 2020 (r362212) +++ head/sys/dev/usb/wlan/if_rsu.c Tue Jun 16 01:11:40 2020 (r362213) @@ -1982,7 +1982,7 @@ rsu_join_bss(struct rsu_softc *sc, struct ieee80211_no frm = ieee80211_add_qos(frm, ni); if ((ic->ic_flags & IEEE80211_F_WME) && (ni->ni_ies.wme_ie != NULL)) - frm = ieee80211_add_wme_info(frm, &ic->ic_wme); + frm = ieee80211_add_wme_info(frm, &ic->ic_wme, ni); if (ni->ni_flags & IEEE80211_NODE_HT) { frm = ieee80211_add_htcap(frm, ni); frm = ieee80211_add_htinfo(frm, ni); From owner-svn-src-all@freebsd.org Tue Jun 16 02:31:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 892CE34AD7E; Tue, 16 Jun 2020 02:31:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mByz2xQMz48r3; Tue, 16 Jun 2020 02:31:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6037B279B5; Tue, 16 Jun 2020 02:31:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G2VNBm091583; Tue, 16 Jun 2020 02:31:23 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G2VN7P091582; Tue, 16 Jun 2020 02:31:23 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006160231.05G2VN7P091582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 16 Jun 2020 02:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362214 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 362214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 02:31:23 -0000 Author: rmacklem Date: Tue Jun 16 02:31:22 2020 New Revision: 362214 URL: https://svnweb.freebsd.org/changeset/base/362214 Log: Expose UID_xxx and GID_xxx definitions to userspace. This patch moves the UID_xxx and GID_xxx definitions out of the #ifdef _KERNEL section, so that userspace programs like mountd can use them. There are a couple of userspace programs that do define UID_ROOT, but they do not include sys/conf.h. Since they are defined as the same value, maybe they should be changed to include sys/conf.h. Reviewed by: kib Differential Revision: https:/reviews.freebsd.org/D25281 Modified: head/sys/sys/conf.h Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Tue Jun 16 01:11:40 2020 (r362213) +++ head/sys/sys/conf.h Tue Jun 16 02:31:22 2020 (r362214) @@ -147,6 +147,23 @@ typedef int dumper_hdr_t(struct dumperinfo *di, struct #define D_TTY 0x0004 #define D_MEM 0x0008 /* /dev/(k)mem */ +/* Defined uid and gid values. */ +#define UID_ROOT 0 +#define UID_BIN 3 +#define UID_UUCP 66 +#define UID_NOBODY 65534 + +#define GID_WHEEL 0 +#define GID_KMEM 2 +#define GID_TTY 4 +#define GID_OPERATOR 5 +#define GID_BIN 7 +#define GID_GAMES 13 +#define GID_VIDEO 44 +#define GID_DIALER 68 +#define GID_NOGROUP 65533 +#define GID_NOBODY 65534 + #ifdef _KERNEL #define D_TYPEMASK 0xffff @@ -308,22 +325,6 @@ void devfs_clear_cdevpriv(void); ino_t devfs_alloc_cdp_inode(void); void devfs_free_cdp_inode(ino_t ino); - -#define UID_ROOT 0 -#define UID_BIN 3 -#define UID_UUCP 66 -#define UID_NOBODY 65534 - -#define GID_WHEEL 0 -#define GID_KMEM 2 -#define GID_TTY 4 -#define GID_OPERATOR 5 -#define GID_BIN 7 -#define GID_GAMES 13 -#define GID_VIDEO 44 -#define GID_DIALER 68 -#define GID_NOGROUP 65533 -#define GID_NOBODY 65534 typedef void (*dev_clone_fn)(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **result); From owner-svn-src-all@freebsd.org Tue Jun 16 02:35:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7B8234B10D; Tue, 16 Jun 2020 02:35:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mC3k5FGsz48s1; Tue, 16 Jun 2020 02:35:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF3A2274F7; Tue, 16 Jun 2020 02:35:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G2ZUOI091842; Tue, 16 Jun 2020 02:35:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G2ZUHx091841; Tue, 16 Jun 2020 02:35:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006160235.05G2ZUHx091841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 16 Jun 2020 02:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362215 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 362215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 02:35:30 -0000 Author: rmacklem Date: Tue Jun 16 02:35:30 2020 New Revision: 362215 URL: https://svnweb.freebsd.org/changeset/base/362215 Log: Make use of the UID_NOBODY and GID_NOGROUP definitions in sys/conf.h. r362214 exposed UID_NOBODY and GID_NOGROUP to userspace, so use them instead of the numbers. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25281 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue Jun 16 02:31:22 2020 (r362214) +++ head/usr.sbin/mountd/mountd.c Tue Jun 16 02:35:30 2020 (r362215) @@ -48,6 +48,7 @@ static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5 __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -1525,9 +1526,9 @@ get_exportlist_one(int passno) * Set defaults. */ has_host = FALSE; - anon.cr_uid = 65534; + anon.cr_uid = UID_NOBODY; anon.cr_ngroups = 1; - anon.cr_groups[0] = 65533; + anon.cr_groups[0] = GID_NOGROUP; exflags = MNT_EXPORTED; got_nondir = 0; opt_flags = 0; @@ -3456,8 +3457,8 @@ parsecred(char *namelist, struct expcred *cr) /* * Set up the unprivileged user. */ - cr->cr_uid = 65534; - cr->cr_groups[0] = 65533; + cr->cr_uid = UID_NOBODY; + cr->cr_groups[0] = GID_NOGROUP; cr->cr_ngroups = 1; /* * Get the user's password table entry. From owner-svn-src-all@freebsd.org Tue Jun 16 04:17:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58AF534E9F0; Tue, 16 Jun 2020 04:17:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mFK11l0Kz4GZM; Tue, 16 Jun 2020 04:17:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36E839395; Tue, 16 Jun 2020 04:17:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G4H9UG053909; Tue, 16 Jun 2020 04:17:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G4H9eY053908; Tue, 16 Jun 2020 04:17:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006160417.05G4H9eY053908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Jun 2020 04:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362216 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 362216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 04:17:09 -0000 Author: adrian Date: Tue Jun 16 04:17:08 2020 New Revision: 362216 URL: https://svnweb.freebsd.org/changeset/base/362216 Log: [ifconfig] add UAPSD and LPDC flags * Add UAPSD and LDPC flags * expand the FLAGS section; it's kinda grown since I started hacking on net80211.. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Jun 16 02:35:30 2020 (r362215) +++ head/sbin/ifconfig/ifieee80211.c Tue Jun 16 04:17:08 2020 (r362216) @@ -125,6 +125,8 @@ #define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */ #define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ #define IEEE80211_NODE_VHT 0x100000 /* VHT enabled */ +#define IEEE80211_NODE_LDPC 0x200000 /* LDPC enabled */ +#define IEEE80211_NODE_UAPSD 0x400000 /* UAPSD enabled */ #endif #define MAXCHAN 1536 /* max 1.5K channels */ @@ -2637,6 +2639,10 @@ getflags(int flags) *cp++ = 't'; if (flags & IEEE80211_NODE_AMSDU_RX) *cp++ = 'r'; + if (flags & IEEE80211_NODE_UAPSD) + *cp++ = 'U'; + if (flags & IEEE80211_NODE_LDPC) + *cp++ = 'L'; *cp = '\0'; return flagstring; } @@ -3846,8 +3852,8 @@ list_stations(int s) , "TXSEQ" , "RXSEQ" ); - else - printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n" + else + printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-12s\n" , "ADDR" , "AID" , "CHAN" @@ -3881,8 +3887,8 @@ list_stations(int s) , gettxseq(si) , getrxseq(si) ); - else - printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-7.7s" + else + printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-12.12s" , ether_ntoa((const struct ether_addr*) si->isi_macaddr) , IEEE80211_AID(si->isi_associd) From owner-svn-src-all@freebsd.org Tue Jun 16 06:41:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 840EC32A3AD; Tue, 16 Jun 2020 06:41:31 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mJWZ3Zbhz4PR7; Tue, 16 Jun 2020 06:41:30 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ed1-f46.google.com with SMTP id s28so11326847edw.11; Mon, 15 Jun 2020 23:41:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SkWEKvoGj7u4Uz21l4A8I7jkND7ENTWZFeX9IP3+q0I=; b=F5jSx+ks1oighrozwsMJRffP7w1ghhjP2tXuj/yOuykDOnRzyKrrDPI7I/fwAHOolY yxy0HdCyqwGt1VYgW3zeaAo5dMJhi+HLfwGlU2/u5GYOJVRNt9Ignqh43+72aLdEu0SO mx7a03BVFO/n+bESZCF0atL6UBdY2M2gRVT6vDnp1USASTW5RJkAYUXmFSDAmK1Kdmrb yHOOfiyGTFwADcdV+/pWP96ySXh/aT9Nwy3LdBdY03+p/NbJh14Xujcb8sTvQJKDqHPL mlxpZI+8qTS3ufP1CL47FJkIQt6ZzC/d+S5gU8Q0ewFAZQXl4IlT+4CNqMo1m5KpsM5e +jGg== X-Gm-Message-State: AOAM5309os5itZJoJvpbZLQ97ZJIQ5j3Rjc/1rfuvyVDjzuvBjBeFTKN IJXox/tsUaWz6ODAQN1lxP1J2w1V X-Google-Smtp-Source: ABdhPJxyMSVqiOqeqDTdo4LxdMEPBP8SFeGJENdLymd/ED8FHWYcTm6B37T3Iq8GznP6BQhB7dUVug== X-Received: by 2002:a50:e08c:: with SMTP id f12mr1185956edl.233.1592289688475; Mon, 15 Jun 2020 23:41:28 -0700 (PDT) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id a13sm9644970edk.58.2020.06.15.23.41.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jun 2020 23:41:27 -0700 (PDT) Subject: Re: svn commit: r362211 - head/sbin/ifconfig To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006160028.05G0S8hD010453@repo.freebsd.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: <07843b9d-cc62-0092-fa16-44edffc74736@FreeBSD.org> Date: Tue, 16 Jun 2020 08:41:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <202006160028.05G0S8hD010453@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49mJWZ3Zbhz4PR7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-1.68 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.77)[-0.766]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.84)[-0.837]; NEURAL_HAM_SHORT(-0.08)[-0.078]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.46:from]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.46:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 06:41:31 -0000 On 6/16/20 2:28 AM, Adrian Chadd wrote: > Author: adrian > Date: Tue Jun 16 00:28:08 2020 > New Revision: 362211 > URL: https://svnweb.freebsd.org/changeset/base/362211 > > Log: > [net80211] Add uapsd option to ifconfig > > Add an enable/disable option for controlling uapsd. I'm not yet controlling > the individual AC configs or the service period. > > Modified: > head/sbin/ifconfig/ifieee80211.c > > Modified: head/sbin/ifconfig/ifieee80211.c > ============================================================================== Should we document it now, or wait a while to see it is here to stay? Cheers, Mateusz From owner-svn-src-all@freebsd.org Tue Jun 16 07:05:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A899232A9E5; Tue, 16 Jun 2020 07:05:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mK2l42LDz4QxV; Tue, 16 Jun 2020 07:05:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85B6AB41B; Tue, 16 Jun 2020 07:05:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G753VK057973; Tue, 16 Jun 2020 07:05:03 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G753T4057972; Tue, 16 Jun 2020 07:05:03 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006160705.05G753T4057972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 16 Jun 2020 07:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362217 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 362217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 07:05:03 -0000 Author: tsoome Date: Tue Jun 16 07:05:03 2020 New Revision: 362217 URL: https://svnweb.freebsd.org/changeset/base/362217 Log: loader: variable i is unused without MBR/GPT support built in Because i is only used as index in for loop, declare it in for statement. Sponsored by: Netflix, Klara Inc. Modified: head/stand/common/part.c Modified: head/stand/common/part.c ============================================================================== --- head/stand/common/part.c Tue Jun 16 04:17:08 2020 (r362216) +++ head/stand/common/part.c Tue Jun 16 07:05:03 2020 (r362217) @@ -647,7 +647,6 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect struct dos_partition *dp; struct ptable *table; uint8_t *buf; - int i; #ifdef LOADER_MBR_SUPPORT struct pentry *entry; uint32_t start, end; @@ -720,7 +719,7 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect * start sector 1. After DOSPTYP_PMBR, there may be other partitions. * UEFI compliant PMBR has no other partitions. */ - for (i = 0; i < NDOSPART; i++) { + for (int i = 0; i < NDOSPART; i++) { if (dp[i].dp_flag != 0 && dp[i].dp_flag != 0x80) { DPRINTF("invalid partition flag %x", dp[i].dp_flag); goto out; @@ -742,7 +741,7 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect /* Read MBR. */ DPRINTF("MBR detected"); table->type = PTABLE_MBR; - for (i = has_ext = 0; i < NDOSPART; i++) { + for (int i = has_ext = 0; i < NDOSPART; i++) { if (dp[i].dp_typ == 0) continue; start = le32dec(&(dp[i].dp_start)); From owner-svn-src-all@freebsd.org Tue Jun 16 07:30:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5DBA32B779; Tue, 16 Jun 2020 07:30:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mKcB5sTsz4SCB; Tue, 16 Jun 2020 07:30:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4A5EB779; Tue, 16 Jun 2020 07:30:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G7UY1l070443; Tue, 16 Jun 2020 07:30:34 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G7UYBe070442; Tue, 16 Jun 2020 07:30:34 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006160730.05G7UYBe070442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 16 Jun 2020 07:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362218 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 362218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 07:30:35 -0000 Author: tsoome Date: Tue Jun 16 07:30:34 2020 New Revision: 362218 URL: https://svnweb.freebsd.org/changeset/base/362218 Log: loader: zfs_cmd.c does not really compile without libzfs.h Having libzfs.h wrapped in LOADER_ZFS_SUPPORT check does not really make sense, because we do need function declarations with C99. Sponsored by: Netflix, Klara Inc. Modified: head/stand/common/zfs_cmd.c Modified: head/stand/common/zfs_cmd.c ============================================================================== --- head/stand/common/zfs_cmd.c Tue Jun 16 07:05:03 2020 (r362217) +++ head/stand/common/zfs_cmd.c Tue Jun 16 07:30:34 2020 (r362218) @@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" - -#ifdef LOADER_ZFS_SUPPORT #include "libzfs.h" -#endif COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", command_lszfs); From owner-svn-src-all@freebsd.org Tue Jun 16 08:57:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53E5932E34A; Tue, 16 Jun 2020 08:57:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mMXB1WvVz4Xgx; Tue, 16 Jun 2020 08:57:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1626BC91B; Tue, 16 Jun 2020 08:57:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G8vD5T025652; Tue, 16 Jun 2020 08:57:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G8vD1q025651; Tue, 16 Jun 2020 08:57:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006160857.05G8vD1q025651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 16 Jun 2020 08:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362219 - head/contrib/opencsd X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/contrib/opencsd X-SVN-Commit-Revision: 362219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 08:57:14 -0000 Author: andrew Date: Tue Jun 16 08:57:13 2020 New Revision: 362219 URL: https://svnweb.freebsd.org/changeset/base/362219 Log: Remove opencsd so I can re-import it with the correct ancestry Sponsored by: Innovate UK Deleted: head/contrib/opencsd/ From owner-svn-src-all@freebsd.org Tue Jun 16 08:59:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 067F432E65B; Tue, 16 Jun 2020 08:59:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mMb46PWvz4Y76; Tue, 16 Jun 2020 08:59:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D71F5CA63; Tue, 16 Jun 2020 08:59:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05G8xiAW025808; Tue, 16 Jun 2020 08:59:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05G8xiMe025807; Tue, 16 Jun 2020 08:59:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006160859.05G8xiMe025807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 16 Jun 2020 08:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362220 - in head/contrib/opencsd: . decoder/build decoder/docs decoder/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/contrib/opencsd: . decoder/build decoder/docs decoder/tests X-SVN-Commit-Revision: 362220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 08:59:45 -0000 Author: andrew Date: Tue Jun 16 08:59:44 2020 New Revision: 362220 URL: https://svnweb.freebsd.org/changeset/base/362220 Log: Re-add opencsd as a vendor import from the dist directory Sponsored by: Innovate UK Added: head/contrib/opencsd/ - copied from r353392, vendor/opencsd/dist/ Deleted: head/contrib/opencsd/.gitignore head/contrib/opencsd/HOWTO.md head/contrib/opencsd/LICENSE head/contrib/opencsd/README.md head/contrib/opencsd/TODO head/contrib/opencsd/decoder/build/ head/contrib/opencsd/decoder/docs/ head/contrib/opencsd/decoder/tests/ From owner-svn-src-all@freebsd.org Tue Jun 16 12:10:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8073F3358C4; Tue, 16 Jun 2020 12:10:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mRpz2smRz3Yy0; Tue, 16 Jun 2020 12:10:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DB3AED1E; Tue, 16 Jun 2020 12:10:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCAJwd042003; Tue, 16 Jun 2020 12:10:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCAJ5e042002; Tue, 16 Jun 2020 12:10:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006161210.05GCAJ5e042002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Jun 2020 12:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362221 - stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Commit-Revision: 362221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:10:19 -0000 Author: gjb Date: Tue Jun 16 12:10:18 2020 New Revision: 362221 URL: https://svnweb.freebsd.org/changeset/base/362221 Log: Wrap long lines. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jun 16 08:59:44 2020 (r362220) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jun 16 12:10:18 2020 (r362221) @@ -96,15 +96,16 @@ - [2020-06-11] Source-based upgrades from &os; 11.2 on the - &arch.i386; architecture may fail to compile + [2020-06-11] Source-based upgrades from &os; 11.2 + on the &arch.i386; architecture may fail to compile clang due to the amount of RAM consumed. Adding CFLAGS+=-O1 to /etc/make.conf or /etc/src.conf has been observed to work - around the compile-time RAM exhaustion. + around the compile-time RAM + exhaustion. See Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0E07336188; Tue, 16 Jun 2020 12:12:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mRsz41mpz3ZDv; Tue, 16 Jun 2020 12:12:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8566EF1B5; Tue, 16 Jun 2020 12:12:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCCtq9047727; Tue, 16 Jun 2020 12:12:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCCtdh047726; Tue, 16 Jun 2020 12:12:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006161212.05GCCtdh047726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Jun 2020 12:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362222 - stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Commit-Revision: 362222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:12:55 -0000 Author: gjb Date: Tue Jun 16 12:12:55 2020 New Revision: 362222 URL: https://svnweb.freebsd.org/changeset/base/362222 Log: Add a note about a typo in a version number in the 11.4 release notes. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jun 16 12:10:18 2020 (r362221) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jun 16 12:12:55 2020 (r362222) @@ -112,6 +112,14 @@ xlink:href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246274">PR 246274 for additional details. + + + [2020-06-16] The &os; 11.4 release notes + erroneously state the KDE + desktop environment has been updated to version + 5.8.4.1.19.12.3. The correct version is + 5.18.4.1.19.12.3. + From owner-svn-src-all@freebsd.org Tue Jun 16 12:16:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 315D9336276; Tue, 16 Jun 2020 12:16:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mRyD0Vnbz3Zmj; Tue, 16 Jun 2020 12:16:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C7A4EF3C; Tue, 16 Jun 2020 12:16:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCGZZq048356; Tue, 16 Jun 2020 12:16:35 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCGZxr048355; Tue, 16 Jun 2020 12:16:35 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006161216.05GCGZxr048355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Jun 2020 12:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362223 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 362223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:16:36 -0000 Author: gjb Date: Tue Jun 16 12:16:35 2020 New Revision: 362223 URL: https://svnweb.freebsd.org/changeset/base/362223 Log: Fix version number entities. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/release.ent Modified: stable/11/release/doc/share/xml/release.ent ============================================================================== --- stable/11/release/doc/share/xml/release.ent Tue Jun 16 12:12:55 2020 (r362222) +++ stable/11/release/doc/share/xml/release.ent Tue Jun 16 12:16:35 2020 (r362223) @@ -6,7 +6,7 @@ - + - - + + From owner-svn-src-all@freebsd.org Tue Jun 16 12:21:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27673336D84; Tue, 16 Jun 2020 12:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mS4P0Ckkz3bfC; Tue, 16 Jun 2020 12:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0293EED57; Tue, 16 Jun 2020 12:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCLu5O052526; Tue, 16 Jun 2020 12:21:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCLu7V052522; Tue, 16 Jun 2020 12:21:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202006161221.05GCLu7V052522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 16 Jun 2020 12:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r362224 - in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Group: stable-10 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Commit-Revision: 362224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:21:57 -0000 Author: kevans Date: Tue Jun 16 12:21:55 2020 New Revision: 362224 URL: https://svnweb.freebsd.org/changeset/base/362224 Log: MFC r361977: libusb: improve compatibility Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Modified: stable/10/lib/libusb/Makefile stable/10/lib/libusb/libusb.3 stable/10/lib/libusb/libusb.h stable/10/lib/libusb/libusb10.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libusb/Makefile stable/11/lib/libusb/libusb.3 stable/11/lib/libusb/libusb.h stable/11/lib/libusb/libusb10.c stable/12/lib/libusb/Makefile stable/12/lib/libusb/libusb.3 stable/12/lib/libusb/libusb.h stable/12/lib/libusb/libusb10.c stable/9/lib/libusb/Makefile stable/9/lib/libusb/libusb.3 stable/9/lib/libusb/libusb.h stable/9/lib/libusb/libusb10.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/10/lib/libusb/Makefile ============================================================================== --- stable/10/lib/libusb/Makefile Tue Jun 16 12:16:35 2020 (r362223) +++ stable/10/lib/libusb/Makefile Tue Jun 16 12:21:55 2020 (r362224) @@ -71,6 +71,7 @@ CFLAGS+= -I ../../sys MLINKS += libusb.3 libusb_get_version.3 MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 +MLINKS += libusb.3 libusb_has_capability.3 MLINKS += libusb.3 libusb_strerror.3 MLINKS += libusb.3 libusb_error_name.3 MLINKS += libusb.3 libusb_set_debug.3 Modified: stable/10/lib/libusb/libusb.3 ============================================================================== --- stable/10/lib/libusb/libusb.3 Tue Jun 16 12:16:35 2020 (r362223) +++ stable/10/lib/libusb/libusb.3 Tue Jun 16 12:21:55 2020 (r362224) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2016 +.Dd June 16, 2020 .Dt LIBUSB 3 .Os .Sh NAME @@ -60,6 +60,33 @@ failure. Deinitialise libusb. Must be called at the end of the application. Other libusb routines may not be called after this function. +.Pp +.Ft int +.Fn libusb_has_capability "uint32_t capability" +This function checks the runtime capabilities of +.Nm . +This function will return non-zero if the given +.Fa capability +is supported, 0 if it is not supported. +The valid values for +.Fa capability +are: +.Bl -tag -width LIBUSB_CAP -offset indent +.It Va LIBUSB_CAP_HAS_CAPABILITY +.Nm +supports +.Fn libusb_has_capability . +.It Va LIBUSB_CAP_HAS_HOTPLUG +.Nm +supports hotplug notifications. +.It Va LIBUSB_CAP_HAS_HID_ACCESS +.Nm +can access HID devices without requiring user intervention. +.It Va LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER +.Nm +supports detaching of the default USB driver with +.Fn libusb_detach_kernel_driver . +.El .Pp .Ft const char * .Fn libusb_strerror "int code" Modified: stable/10/lib/libusb/libusb.h ============================================================================== --- stable/10/lib/libusb/libusb.h Tue Jun 16 12:16:35 2020 (r362223) +++ stable/10/lib/libusb/libusb.h Tue Jun 16 12:21:55 2020 (r362224) @@ -52,6 +52,7 @@ enum libusb_class_code { LIBUSB_CLASS_AUDIO = 1, LIBUSB_CLASS_COMM = 2, LIBUSB_CLASS_HID = 3, + LIBUSB_CLASS_PHYSICAL = 5, LIBUSB_CLASS_PTP = 6, LIBUSB_CLASS_IMAGE = 6, LIBUSB_CLASS_PRINTER = 7, @@ -176,6 +177,21 @@ enum libusb_bos_type { LIBUSB_BT_CONTAINER_ID = 4, }; +enum libusb_capability { + /* libusb supports libusb_has_capability(). */ + LIBUSB_CAP_HAS_CAPABILITY = 0, + /* Hotplug support is available. */ + LIBUSB_CAP_HAS_HOTPLUG, + /* Can access HID devices without requiring user intervention. */ + LIBUSB_CAP_HAS_HID_ACCESS, + + /* + * Supports detaching of the default USB driver with + * libusb_detach_kernel_driver(). + */ + LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER, +}; + enum libusb_error { LIBUSB_SUCCESS = 0, LIBUSB_ERROR_IO = -1, @@ -447,6 +463,7 @@ const char *libusb_strerror(int code); const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); +int libusb_has_capability(uint32_t capability); /* Device handling and enumeration */ Modified: stable/10/lib/libusb/libusb10.c ============================================================================== --- stable/10/lib/libusb/libusb10.c Tue Jun 16 12:16:35 2020 (r362223) +++ stable/10/lib/libusb/libusb10.c Tue Jun 16 12:21:55 2020 (r362224) @@ -1706,3 +1706,18 @@ libusb_error_name(int code) return ("LIBUSB_ERROR_UNKNOWN"); } } + +int +libusb_has_capability(uint32_t capability) +{ + + switch (capability) { + case LIBUSB_CAP_HAS_CAPABILITY: + case LIBUSB_CAP_HAS_HOTPLUG: + case LIBUSB_CAP_HAS_HID_ACCESS: + case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER: + return (1); + default: + return (0); + } +} From owner-svn-src-all@freebsd.org Tue Jun 16 12:21:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F37A6336AB1; Tue, 16 Jun 2020 12:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mS4P6DmFz3brB; Tue, 16 Jun 2020 12:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D15CDEEBD; Tue, 16 Jun 2020 12:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCLvMM052535; Tue, 16 Jun 2020 12:21:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCLvGn052531; Tue, 16 Jun 2020 12:21:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202006161221.05GCLvGn052531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 16 Jun 2020 12:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362224 - in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Commit-Revision: 362224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:21:58 -0000 Author: kevans Date: Tue Jun 16 12:21:55 2020 New Revision: 362224 URL: https://svnweb.freebsd.org/changeset/base/362224 Log: MFC r361977: libusb: improve compatibility Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Modified: stable/11/lib/libusb/Makefile stable/11/lib/libusb/libusb.3 stable/11/lib/libusb/libusb.h stable/11/lib/libusb/libusb10.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libusb/Makefile stable/10/lib/libusb/libusb.3 stable/10/lib/libusb/libusb.h stable/10/lib/libusb/libusb10.c stable/12/lib/libusb/Makefile stable/12/lib/libusb/libusb.3 stable/12/lib/libusb/libusb.h stable/12/lib/libusb/libusb10.c stable/9/lib/libusb/Makefile stable/9/lib/libusb/libusb.3 stable/9/lib/libusb/libusb.h stable/9/lib/libusb/libusb10.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/11/lib/libusb/Makefile ============================================================================== --- stable/11/lib/libusb/Makefile Tue Jun 16 12:16:35 2020 (r362223) +++ stable/11/lib/libusb/Makefile Tue Jun 16 12:21:55 2020 (r362224) @@ -69,6 +69,7 @@ CFLAGS+= -I ../../sys MLINKS += libusb.3 libusb_get_version.3 MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 +MLINKS += libusb.3 libusb_has_capability.3 MLINKS += libusb.3 libusb_strerror.3 MLINKS += libusb.3 libusb_error_name.3 MLINKS += libusb.3 libusb_set_debug.3 Modified: stable/11/lib/libusb/libusb.3 ============================================================================== --- stable/11/lib/libusb/libusb.3 Tue Jun 16 12:16:35 2020 (r362223) +++ stable/11/lib/libusb/libusb.3 Tue Jun 16 12:21:55 2020 (r362224) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2016 +.Dd June 16, 2020 .Dt LIBUSB 3 .Os .Sh NAME @@ -60,6 +60,33 @@ failure. Deinitialise libusb. Must be called at the end of the application. Other libusb routines may not be called after this function. +.Pp +.Ft int +.Fn libusb_has_capability "uint32_t capability" +This function checks the runtime capabilities of +.Nm . +This function will return non-zero if the given +.Fa capability +is supported, 0 if it is not supported. +The valid values for +.Fa capability +are: +.Bl -tag -width LIBUSB_CAP -offset indent +.It Va LIBUSB_CAP_HAS_CAPABILITY +.Nm +supports +.Fn libusb_has_capability . +.It Va LIBUSB_CAP_HAS_HOTPLUG +.Nm +supports hotplug notifications. +.It Va LIBUSB_CAP_HAS_HID_ACCESS +.Nm +can access HID devices without requiring user intervention. +.It Va LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER +.Nm +supports detaching of the default USB driver with +.Fn libusb_detach_kernel_driver . +.El .Pp .Ft const char * .Fn libusb_strerror "int code" Modified: stable/11/lib/libusb/libusb.h ============================================================================== --- stable/11/lib/libusb/libusb.h Tue Jun 16 12:16:35 2020 (r362223) +++ stable/11/lib/libusb/libusb.h Tue Jun 16 12:21:55 2020 (r362224) @@ -52,6 +52,7 @@ enum libusb_class_code { LIBUSB_CLASS_AUDIO = 1, LIBUSB_CLASS_COMM = 2, LIBUSB_CLASS_HID = 3, + LIBUSB_CLASS_PHYSICAL = 5, LIBUSB_CLASS_PTP = 6, LIBUSB_CLASS_IMAGE = 6, LIBUSB_CLASS_PRINTER = 7, @@ -176,6 +177,21 @@ enum libusb_bos_type { LIBUSB_BT_CONTAINER_ID = 4, }; +enum libusb_capability { + /* libusb supports libusb_has_capability(). */ + LIBUSB_CAP_HAS_CAPABILITY = 0, + /* Hotplug support is available. */ + LIBUSB_CAP_HAS_HOTPLUG, + /* Can access HID devices without requiring user intervention. */ + LIBUSB_CAP_HAS_HID_ACCESS, + + /* + * Supports detaching of the default USB driver with + * libusb_detach_kernel_driver(). + */ + LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER, +}; + enum libusb_error { LIBUSB_SUCCESS = 0, LIBUSB_ERROR_IO = -1, @@ -448,6 +464,7 @@ const char *libusb_strerror(int code); const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); +int libusb_has_capability(uint32_t capability); /* Device handling and enumeration */ Modified: stable/11/lib/libusb/libusb10.c ============================================================================== --- stable/11/lib/libusb/libusb10.c Tue Jun 16 12:16:35 2020 (r362223) +++ stable/11/lib/libusb/libusb10.c Tue Jun 16 12:21:55 2020 (r362224) @@ -1714,3 +1714,18 @@ libusb_error_name(int code) return ("LIBUSB_ERROR_UNKNOWN"); } } + +int +libusb_has_capability(uint32_t capability) +{ + + switch (capability) { + case LIBUSB_CAP_HAS_CAPABILITY: + case LIBUSB_CAP_HAS_HOTPLUG: + case LIBUSB_CAP_HAS_HID_ACCESS: + case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER: + return (1); + default: + return (0); + } +} From owner-svn-src-all@freebsd.org Tue Jun 16 12:21:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A7EA336BC2; Tue, 16 Jun 2020 12:21:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mS4R05Skz3brK; Tue, 16 Jun 2020 12:21:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC70BF269; Tue, 16 Jun 2020 12:21:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCLwDn052545; Tue, 16 Jun 2020 12:21:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCLwif052540; Tue, 16 Jun 2020 12:21:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202006161221.05GCLwif052540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 16 Jun 2020 12:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362224 - in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Commit-Revision: 362224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:21:59 -0000 Author: kevans Date: Tue Jun 16 12:21:55 2020 New Revision: 362224 URL: https://svnweb.freebsd.org/changeset/base/362224 Log: MFC r361977: libusb: improve compatibility Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Modified: stable/12/lib/libusb/Makefile stable/12/lib/libusb/libusb.3 stable/12/lib/libusb/libusb.h stable/12/lib/libusb/libusb10.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libusb/Makefile stable/10/lib/libusb/libusb.3 stable/10/lib/libusb/libusb.h stable/10/lib/libusb/libusb10.c stable/11/lib/libusb/Makefile stable/11/lib/libusb/libusb.3 stable/11/lib/libusb/libusb.h stable/11/lib/libusb/libusb10.c stable/9/lib/libusb/Makefile stable/9/lib/libusb/libusb.3 stable/9/lib/libusb/libusb.h stable/9/lib/libusb/libusb10.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/12/lib/libusb/Makefile ============================================================================== --- stable/12/lib/libusb/Makefile Tue Jun 16 12:16:35 2020 (r362223) +++ stable/12/lib/libusb/Makefile Tue Jun 16 12:21:55 2020 (r362224) @@ -69,6 +69,7 @@ CFLAGS+= -I ../../sys MLINKS += libusb.3 libusb_get_version.3 MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 +MLINKS += libusb.3 libusb_has_capability.3 MLINKS += libusb.3 libusb_strerror.3 MLINKS += libusb.3 libusb_error_name.3 MLINKS += libusb.3 libusb_set_debug.3 Modified: stable/12/lib/libusb/libusb.3 ============================================================================== --- stable/12/lib/libusb/libusb.3 Tue Jun 16 12:16:35 2020 (r362223) +++ stable/12/lib/libusb/libusb.3 Tue Jun 16 12:21:55 2020 (r362224) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2018 +.Dd June 9, 2020 .Dt LIBUSB 3 .Os .Sh NAME @@ -60,6 +60,33 @@ failure. Deinitialise libusb. Must be called at the end of the application. Other libusb routines may not be called after this function. +.Pp +.Ft int +.Fn libusb_has_capability "uint32_t capability" +This function checks the runtime capabilities of +.Nm . +This function will return non-zero if the given +.Fa capability +is supported, 0 if it is not supported. +The valid values for +.Fa capability +are: +.Bl -tag -width LIBUSB_CAP -offset indent +.It Va LIBUSB_CAP_HAS_CAPABILITY +.Nm +supports +.Fn libusb_has_capability . +.It Va LIBUSB_CAP_HAS_HOTPLUG +.Nm +supports hotplug notifications. +.It Va LIBUSB_CAP_HAS_HID_ACCESS +.Nm +can access HID devices without requiring user intervention. +.It Va LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER +.Nm +supports detaching of the default USB driver with +.Fn libusb_detach_kernel_driver . +.El .Pp .Ft const char * .Fn libusb_strerror "int code" Modified: stable/12/lib/libusb/libusb.h ============================================================================== --- stable/12/lib/libusb/libusb.h Tue Jun 16 12:16:35 2020 (r362223) +++ stable/12/lib/libusb/libusb.h Tue Jun 16 12:21:55 2020 (r362224) @@ -54,6 +54,7 @@ enum libusb_class_code { LIBUSB_CLASS_AUDIO = 1, LIBUSB_CLASS_COMM = 2, LIBUSB_CLASS_HID = 3, + LIBUSB_CLASS_PHYSICAL = 5, LIBUSB_CLASS_PTP = 6, LIBUSB_CLASS_IMAGE = 6, LIBUSB_CLASS_PRINTER = 7, @@ -178,6 +179,21 @@ enum libusb_bos_type { LIBUSB_BT_CONTAINER_ID = 4, }; +enum libusb_capability { + /* libusb supports libusb_has_capability(). */ + LIBUSB_CAP_HAS_CAPABILITY = 0, + /* Hotplug support is available. */ + LIBUSB_CAP_HAS_HOTPLUG, + /* Can access HID devices without requiring user intervention. */ + LIBUSB_CAP_HAS_HID_ACCESS, + + /* + * Supports detaching of the default USB driver with + * libusb_detach_kernel_driver(). + */ + LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER, +}; + enum libusb_error { LIBUSB_SUCCESS = 0, LIBUSB_ERROR_IO = -1, @@ -450,6 +466,7 @@ const char *libusb_strerror(int code); const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); +int libusb_has_capability(uint32_t capability); /* Device handling and enumeration */ Modified: stable/12/lib/libusb/libusb10.c ============================================================================== --- stable/12/lib/libusb/libusb10.c Tue Jun 16 12:16:35 2020 (r362223) +++ stable/12/lib/libusb/libusb10.c Tue Jun 16 12:21:55 2020 (r362224) @@ -1716,3 +1716,18 @@ libusb_error_name(int code) return ("LIBUSB_ERROR_UNKNOWN"); } } + +int +libusb_has_capability(uint32_t capability) +{ + + switch (capability) { + case LIBUSB_CAP_HAS_CAPABILITY: + case LIBUSB_CAP_HAS_HOTPLUG: + case LIBUSB_CAP_HAS_HID_ACCESS: + case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER: + return (1); + default: + return (0); + } +} From owner-svn-src-all@freebsd.org Tue Jun 16 12:22:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 706F633645F; Tue, 16 Jun 2020 12:22:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mS4T1gG7z3bl0; Tue, 16 Jun 2020 12:22:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12E13F26A; Tue, 16 Jun 2020 12:21:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCLxgQ053032; Tue, 16 Jun 2020 12:21:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCLx1Q052550; Tue, 16 Jun 2020 12:21:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202006161221.05GCLx1Q052550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 16 Jun 2020 12:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r362224 - in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Group: stable-9 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 10/lib/libusb 11/lib/libusb 12/lib/libusb 9/lib/libusb X-SVN-Commit-Revision: 362224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:22:06 -0000 Author: kevans Date: Tue Jun 16 12:21:55 2020 New Revision: 362224 URL: https://svnweb.freebsd.org/changeset/base/362224 Log: MFC r361977: libusb: improve compatibility Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Modified: stable/9/lib/libusb/Makefile stable/9/lib/libusb/libusb.3 stable/9/lib/libusb/libusb.h stable/9/lib/libusb/libusb10.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libusb/Makefile stable/10/lib/libusb/libusb.3 stable/10/lib/libusb/libusb.h stable/10/lib/libusb/libusb10.c stable/11/lib/libusb/Makefile stable/11/lib/libusb/libusb.3 stable/11/lib/libusb/libusb.h stable/11/lib/libusb/libusb10.c stable/12/lib/libusb/Makefile stable/12/lib/libusb/libusb.3 stable/12/lib/libusb/libusb.h stable/12/lib/libusb/libusb10.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/12/ (props changed) Modified: stable/9/lib/libusb/Makefile ============================================================================== --- stable/9/lib/libusb/Makefile Tue Jun 16 12:16:35 2020 (r362223) +++ stable/9/lib/libusb/Makefile Tue Jun 16 12:21:55 2020 (r362224) @@ -44,6 +44,7 @@ CFLAGS+= -DCOMPAT_32BIT MLINKS += libusb.3 libusb_get_version.3 MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 +MLINKS += libusb.3 libusb_has_capability.3 MLINKS += libusb.3 libusb_strerror.3 MLINKS += libusb.3 libusb_error_name.3 MLINKS += libusb.3 libusb_set_debug.3 Modified: stable/9/lib/libusb/libusb.3 ============================================================================== --- stable/9/lib/libusb/libusb.3 Tue Jun 16 12:16:35 2020 (r362223) +++ stable/9/lib/libusb/libusb.3 Tue Jun 16 12:21:55 2020 (r362224) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2016 +.Dd June 16, 2020 .Dt LIBUSB 3 .Os .Sh NAME @@ -60,6 +60,33 @@ failure. Deinitialise libusb. Must be called at the end of the application. Other libusb routines may not be called after this function. +.Pp +.Ft int +.Fn libusb_has_capability "uint32_t capability" +This function checks the runtime capabilities of +.Nm . +This function will return non-zero if the given +.Fa capability +is supported, 0 if it is not supported. +The valid values for +.Fa capability +are: +.Bl -tag -width LIBUSB_CAP -offset indent +.It Va LIBUSB_CAP_HAS_CAPABILITY +.Nm +supports +.Fn libusb_has_capability . +.It Va LIBUSB_CAP_HAS_HOTPLUG +.Nm +supports hotplug notifications. +.It Va LIBUSB_CAP_HAS_HID_ACCESS +.Nm +can access HID devices without requiring user intervention. +.It Va LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER +.Nm +supports detaching of the default USB driver with +.Fn libusb_detach_kernel_driver . +.El .Pp .Ft const char * .Fn libusb_strerror "int code" Modified: stable/9/lib/libusb/libusb.h ============================================================================== --- stable/9/lib/libusb/libusb.h Tue Jun 16 12:16:35 2020 (r362223) +++ stable/9/lib/libusb/libusb.h Tue Jun 16 12:21:55 2020 (r362224) @@ -49,6 +49,7 @@ enum libusb_class_code { LIBUSB_CLASS_AUDIO = 1, LIBUSB_CLASS_COMM = 2, LIBUSB_CLASS_HID = 3, + LIBUSB_CLASS_PHYSICAL = 5, LIBUSB_CLASS_PTP = 6, LIBUSB_CLASS_IMAGE = 6, LIBUSB_CLASS_PRINTER = 7, @@ -173,6 +174,21 @@ enum libusb_bos_type { LIBUSB_BT_CONTAINER_ID = 4, }; +enum libusb_capability { + /* libusb supports libusb_has_capability(). */ + LIBUSB_CAP_HAS_CAPABILITY = 0, + /* Hotplug support is available. */ + LIBUSB_CAP_HAS_HOTPLUG, + /* Can access HID devices without requiring user intervention. */ + LIBUSB_CAP_HAS_HID_ACCESS, + + /* + * Supports detaching of the default USB driver with + * libusb_detach_kernel_driver(). + */ + LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER, +}; + enum libusb_error { LIBUSB_SUCCESS = 0, LIBUSB_ERROR_IO = -1, @@ -432,6 +448,7 @@ const char *libusb_strerror(int code); const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); +int libusb_has_capability(uint32_t capability); /* Device handling and enumeration */ Modified: stable/9/lib/libusb/libusb10.c ============================================================================== --- stable/9/lib/libusb/libusb10.c Tue Jun 16 12:16:35 2020 (r362223) +++ stable/9/lib/libusb/libusb10.c Tue Jun 16 12:21:55 2020 (r362224) @@ -1705,3 +1705,18 @@ libusb_error_name(int code) return ("LIBUSB_ERROR_UNKNOWN"); } } + +int +libusb_has_capability(uint32_t capability) +{ + + switch (capability) { + case LIBUSB_CAP_HAS_CAPABILITY: + case LIBUSB_CAP_HAS_HOTPLUG: + case LIBUSB_CAP_HAS_HID_ACCESS: + case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER: + return (1); + default: + return (0); + } +} From owner-svn-src-all@freebsd.org Tue Jun 16 12:26:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92CC63370D4; Tue, 16 Jun 2020 12:26:24 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mS9X3M7xz3cdZ; Tue, 16 Jun 2020 12:26:24 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E4D5F365; Tue, 16 Jun 2020 12:26:24 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCQOda054416; Tue, 16 Jun 2020 12:26:24 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCQOEY054415; Tue, 16 Jun 2020 12:26:24 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202006161226.05GCQOEY054415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Jun 2020 12:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362225 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 362225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:26:24 -0000 Author: rrs Date: Tue Jun 16 12:26:23 2020 New Revision: 362225 URL: https://svnweb.freebsd.org/changeset/base/362225 Log: So it turns out rack has a shortcoming in dup-ack counting. It counts the dupacks but then does not properly respond to them. This is because a few missing bits are not present. BBR actually does properly respond (though it also sends a TLP which is interesting and maybe something to fix).. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D25294 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Tue Jun 16 12:21:55 2020 (r362224) +++ head/sys/netinet/tcp_stacks/rack.c Tue Jun 16 12:26:23 2020 (r362225) @@ -4588,7 +4588,7 @@ activate_rxt: goto activate_rxt; } /* Convert from ms to usecs */ - if (rsm->r_flags & RACK_SACK_PASSED) { + if ((rsm->r_flags & RACK_SACK_PASSED) || (rsm->r_dupack >= DUP_ACK_THRESHOLD)) { if ((tp->t_flags & TF_SENTFIN) && ((tp->snd_max - tp->snd_una) == 1) && (rsm->r_flags & RACK_HAS_FIN)) { @@ -6237,7 +6237,7 @@ rack_log_output(struct tcpcb *tp, struct tcpopt *to, i * or FIN if seq_out is adding more on and a FIN is present * (and we are not resending). */ - if ((th_flags & TH_SYN) && (seq_out == tp->iss)) + if ((th_flags & TH_SYN) && (seq_out == tp->iss)) len++; if (th_flags & TH_FIN) len++; @@ -8190,6 +8190,7 @@ rack_strike_dupack(struct tcp_rack *rack) rsm->r_dupack++; if (rsm->r_dupack >= DUP_ACK_THRESHOLD) { rack->r_wanted_output = 1; + rack->r_timer_override = 1; rack_log_retran_reason(rack, rsm, __LINE__, 1, 3); } else { rack_log_retran_reason(rack, rsm, __LINE__, 0, 3); @@ -11359,7 +11360,8 @@ check_it: if (rsm->r_flags & RACK_ACKED) { return (NULL); } - if ((rsm->r_flags & RACK_SACK_PASSED) == 0) { + if (((rsm->r_flags & RACK_SACK_PASSED) == 0) && + (rsm->r_dupack < DUP_ACK_THRESHOLD)) { /* Its not yet ready */ return (NULL); } From owner-svn-src-all@freebsd.org Tue Jun 16 12:40:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 801C5337919; Tue, 16 Jun 2020 12:40:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mSTc2phGz3dDx; Tue, 16 Jun 2020 12:40:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BAC9F050; Tue, 16 Jun 2020 12:40:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GCeKr5060893; Tue, 16 Jun 2020 12:40:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GCeKCk060892; Tue, 16 Jun 2020 12:40:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202006161240.05GCeKCk060892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 16 Jun 2020 12:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362226 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 362226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 12:40:20 -0000 Author: bapt Date: Tue Jun 16 12:40:19 2020 New Revision: 362226 URL: https://svnweb.freebsd.org/changeset/base/362226 Log: Fix typo in the documentation about the daily ntpd status PR: 245679 Submitted by: Taylor Stearns MFC after: 3 days Modified: head/share/man/man5/periodic.conf.5 Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Tue Jun 16 12:26:23 2020 (r362225) +++ head/share/man/man5/periodic.conf.5 Tue Jun 16 12:40:19 2020 (r362226) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2018 +.Dd June 16, 2020 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -518,7 +518,7 @@ for the previous day. .Pq Vt num Set to the number of maillog files that should be checked for yesterday's mail rejects. -.It Va daily_status_ntpd +.It Va daily_status_ntpd_enable .Pq Vt bool Set to .Dq Li YES From owner-svn-src-all@freebsd.org Tue Jun 16 13:59:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EF3533A412; Tue, 16 Jun 2020 13:59:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mVFN1gyGz42kc; Tue, 16 Jun 2020 13:59:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DED210136; Tue, 16 Jun 2020 13:59:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GDxpVT010203; Tue, 16 Jun 2020 13:59:51 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GDxpo8010202; Tue, 16 Jun 2020 13:59:51 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006161359.05GDxpo8010202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Jun 2020 13:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-release@freebsd.org Subject: svn commit: r362227 - release/11.4.0 X-SVN-Group: release X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: release/11.4.0 X-SVN-Commit-Revision: 362227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 13:59:52 -0000 Author: gjb Date: Tue Jun 16 13:59:51 2020 New Revision: 362227 URL: https://svnweb.freebsd.org/changeset/base/362227 Log: Tag releng/11.4@r362094 as release/11.4.0 (11.4-RELEASE). Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Added: release/11.4.0/ - copied from r362094, releng/11.4/ From owner-svn-src-all@freebsd.org Tue Jun 16 14:02:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D8BC33A89E; Tue, 16 Jun 2020 14:02:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mVJr0Rngz43H5; Tue, 16 Jun 2020 14:02:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A419104B6; Tue, 16 Jun 2020 14:02:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GE2p95015795; Tue, 16 Jun 2020 14:02:51 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GE2pd4015793; Tue, 16 Jun 2020 14:02:51 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006161402.05GE2pd4015793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Jun 2020 14:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362228 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 362228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 14:02:52 -0000 Author: gjb Date: Tue Jun 16 14:02:51 2020 New Revision: 362228 URL: https://svnweb.freebsd.org/changeset/base/362228 Log: Prune the SA/EN entries for the 11.4 errata page. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Tue Jun 16 13:59:51 2020 (r362227) +++ stable/11/release/doc/share/xml/errata.xml Tue Jun 16 14:02:51 2020 (r362228) @@ -19,92 +19,9 @@ - FreeBSD-EN-19:13.mds - 24 July 2019 - System crash from Intel CPU vulnerability - mitigation - - - - FreeBSD-EN-19:15.libunwind - 6 August 2019 - Incorrect exception handling - - - - FreeBSD-EN-19:16.bhyve - 20 August 2019 - Instruction emulation improvements - - - - FreeBSD-EN-19:17.ipfw - 20 August 2019 - "jail" keyword fix - - - - FreeBSD-EN-19:18.tzdata - 23 October 2019 - Timezone database information - update - - - - FreeBSD-EN-20:01.ssp - 28 January 2020 - Imprecise orderring of canary - initialization - - - - FreeBSD-EN-20:02.nmount - 28 January 2020 - Invalid pointer dereference - - - - FreeBSD-EN-20:04.pfctl - 18 March 2020 - Missing &man.pfctl.8; tunable - - - - FreeBSD-EN-20:06.ipv6 - 18 March 2020 - Incorrect checksum calculations - - - - FreeBSD-EN-20:07.quotad - 21 April 2020 - Regression with certain NFS - servers - - - - FreeBSD-EN-20:08.tzdata - 12 May 2020 - Timezone database update - - - - FreeBSD-EN-20:10.build - 12 May 2020 - Incorrect build host clang version - detection + No notices. +   +   Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Jun 16 13:59:51 2020 (r362227) +++ stable/11/release/doc/share/xml/security.xml Tue Jun 16 14:02:51 2020 (r362228) @@ -19,209 +19,9 @@ - FreeBSD-SA-19:12.telnet - 24 July 2019 - Multiple vulnerabilities - - - - FreeBSD-SA-19:13.pts - 24 July 2019 - Write-after-free vulnerability - - - - FreeBSD-SA-19:14.freebsd32 - 24 July 2019 - Kernel memory disclosure - - - - FreeBSD-SA-19:15.mqueuefs - 24 July 2019 - Reference count overflow - - - - FreeBSD-SA-19:16.bhyve - 24 July 2019 - &man.xhci.4; out-of-bounds read - - - - FreeBSD-SA-19:17.fd - 24 July 2019 - Reference count leak - - - - FreeBSD-SA-19:18.bzip2 - 6 August 2019 - Multiple vulnerabilities - - - - FreeBSD-SA-19:19.mldv2 - 6 August 2019 - Out-of-bounds memory access - - - - FreeBSD-SA-19:20.bsnmp - 6 August 2019 - Insufficient message length - validation - - - - FreeBSD-SA-19:21.bhyve - 6 August 2019 - Insufficient validation of guest-supplied - data - - - - FreeBSD-SA-19:22.mbuf - 20 August 2019 - IPv6 remove denial-of-service - - - - FreeBSD-SA-19:23.midi - 20 August 2019 - Kernel memory disclosure - - - - FreeBSD-SA-19:24.mqueuefs - 20 August 2019 - Reference count overflow - - - - FreeBSD-SA-19:25.mcepce - 12 November 2019 - Machine Check Exception on Page Size - Change - - - - FreeBSD-SA-19:26.mcu - 12 November 2019 - Intel CPU Microcode Update - - - - FreeBSD-SA-20:01.libfetch - 28 January 2020 - &man.fetch.3; buffer overflow - - - - FreeBSD-SA-20:03.thrmisc - 28 January 2020 - Kernel stack data disclosure - - - - FreeBSD-SA-20:04.tcp - 18 March 2020 - TCP IPv6 SYN cache kernel information - disclosure - - - - FreeBSD-SA-20:05.if_oce_ioctl - 18 March 2020 - Insufficient &man.ioctl.2; privilege - checking - - - - FreeBSD-SA-20:07.epair - 18 March 2020 - Incorrect user-controlled pointer - use - - - - FreeBSD-SA-20:08.jail - 18 March 2020 - Kernel memory disclosure with nested - jails - - - - FreeBSD-SA-20:09.ntp - 18 March 2020 - Multiple denial of service - - - - FreeBSD-SA-20:10.ipfw - 21 April 2020 - Invalid &man.mbuf.9; handling - - - - FreeBSD-SA-20:12.libalias - 12 May 2020 - Insufficient packet length - validation - - - - FreeBSD-SA-20:13.libalias - 12 May 2020 - Memory disclosure vulnerability - - - - FreeBSD-SA-20:14.sctp - 12 May 2020 - Improper checking in shared key - update - - - - FreeBSD-SA-20:15.cryptodev - 12 May 2020 - Use-after-free condition - - - - FreeBSD-SA-20:17.usb - 9 June 2020 - HID descriptor parsing - error + No advisories. +   +   From owner-svn-src-all@freebsd.org Tue Jun 16 15:55:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6850633FF3D; Tue, 16 Jun 2020 15:55:00 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mXpD28JVz4DMJ; Tue, 16 Jun 2020 15:55:00 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 433F31182F; Tue, 16 Jun 2020 15:55:00 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GFt0Zh084529; Tue, 16 Jun 2020 15:55:00 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GFt03C084528; Tue, 16 Jun 2020 15:55:00 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006161555.05GFt03C084528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Tue, 16 Jun 2020 15:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362229 - head/usr.bin/cmp X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/cmp X-SVN-Commit-Revision: 362229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 15:55:00 -0000 Author: fernape (ports committer) Date: Tue Jun 16 15:54:59 2020 New Revision: 362229 URL: https://svnweb.freebsd.org/changeset/base/362229 Log: cmp(1): Add EXAMPLES section Add simple examples showing the use of -l, -z, stdin and offsets Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D25280 Modified: head/usr.bin/cmp/cmp.1 Modified: head/usr.bin/cmp/cmp.1 ============================================================================== --- head/usr.bin/cmp/cmp.1 Tue Jun 16 14:02:51 2020 (r362228) +++ head/usr.bin/cmp/cmp.1 Tue Jun 16 15:54:59 2020 (r362229) @@ -31,7 +31,7 @@ .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 1, 2018 +.Dd June 16, 2020 .Dt CMP 1 .Os .Sh NAME @@ -106,6 +106,40 @@ file (before any differences were found). .It >1 An error occurred. .El +.Sh EXAMPLES +Assuming a file named example.txt with the following contents: +.Bd -literal -offset indent +a +b +c +.Ed +.Pp +Compare stdin with example.txt: +.Bd -literal -offset indent +$ echo -e "a\\nb\\nc" | cmp - example.txt +.Ed +.Pp +Same as above but introducing a change in byte three in stdin. +Show the byte number (decimal) and differing byte (octal): +.Bd -literal -offset indent +$ echo -e "a\\nR\\nc" | cmp -l - example.txt + 3 122 142 +.Ed +.Pp +Compare example.txt and /boot/loader.conf exiting if size differs. +Note that +.Fl z +can only be used with regular files: +.Bd -literal -offset indent +$ cmp -z example.txt /boot/loader.conf +example.txt /boot/loader.conf differ: size +.Ed +.Pp +Compare stdin with file example.txt omitting the 4 first bytes from stdin and +the 2 first bytes from example.txt: +.Bd -literal -offset indent +$ echo -e "a\\nR\\nb\\nc" | cmp - example.txt 4 2 +.Ed .Sh SEE ALSO .Xr diff 1 , .Xr diff3 1 From owner-svn-src-all@freebsd.org Tue Jun 16 16:48:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56B0D3438E9; Tue, 16 Jun 2020 16:48:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZ0S1fl1z4LxF; Tue, 16 Jun 2020 16:48:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 340C612588; Tue, 16 Jun 2020 16:48:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GGmufd016358; Tue, 16 Jun 2020 16:48:56 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GGmrsR016342; Tue, 16 Jun 2020 16:48:53 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006161648.05GGmrsR016342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 16 Jun 2020 16:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362230 - in head/lib: libc/capability libc/gen libc/sys libcasper/libcasper libcasper/services/cap_dns libcasper/services/cap_fileargs libcasper/services/cap_grp libcasper/services/cap... X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head/lib: libc/capability libc/gen libc/sys libcasper/libcasper libcasper/services/cap_dns libcasper/services/cap_fileargs libcasper/services/cap_grp libcasper/services/cap_pwd libcasper/services/c... X-SVN-Commit-Revision: 362230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 16:48:56 -0000 Author: gbe (doc committer) Date: Tue Jun 16 16:48:52 2020 New Revision: 362230 URL: https://svnweb.freebsd.org/changeset/base/362230 Log: libcasper(3): Document HISTORY within the manpages Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D24695 Modified: head/lib/libc/capability/cap_rights_init.3 head/lib/libc/gen/cap_rights_get.3 head/lib/libc/gen/cap_sandboxed.3 head/lib/libc/sys/cap_enter.2 head/lib/libc/sys/cap_fcntls_limit.2 head/lib/libc/sys/cap_ioctls_limit.2 head/lib/libc/sys/cap_rights_limit.2 head/lib/libcasper/libcasper/libcasper.3 head/lib/libcasper/libcasper/libcasper_service.3 head/lib/libcasper/services/cap_dns/cap_dns.3 head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 head/lib/libcasper/services/cap_grp/cap_grp.3 head/lib/libcasper/services/cap_pwd/cap_pwd.3 head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 head/lib/libcasper/services/cap_syslog/cap_syslog.3 Modified: head/lib/libc/capability/cap_rights_init.3 ============================================================================== --- head/lib/libc/capability/cap_rights_init.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libc/capability/cap_rights_init.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd May 5, 2020 .Dt CAP_RIGHTS_INIT 3 .Os .Sh NAME @@ -232,6 +232,18 @@ if (cap_rights_limit(fd, &rights) < 0 && errno != ENOS .Xr capsicum 4 , .Xr rights 4 .Sh HISTORY +The functions +.Fn cap_rights_init , +.Fn cap_rights_set , +.Fn cap_rights_clear , +.Fn cap_rights_is_set , +.Fn cap_rights_is_valid , +.Fn cap_rights_merge , +.Fn cap_rights_remove +and +.Fn cap_rights_contains +first appeared in +.Fx 8.3 . Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Project. Modified: head/lib/libc/gen/cap_rights_get.3 ============================================================================== --- head/lib/libc/gen/cap_rights_get.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libc/gen/cap_rights_get.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd May 5, 2020 .Dt CAP_RIGHTS_GET 3 .Os .Sh NAME @@ -110,6 +110,10 @@ argument points at an invalid address. .Xr capsicum 4 , .Xr rights 4 .Sh HISTORY +The +.Fn cap_rights_get +function first appeared in +.Fx 9.2 . Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Project. Modified: head/lib/libc/gen/cap_sandboxed.3 ============================================================================== --- head/lib/libc/gen/cap_sandboxed.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libc/gen/cap_sandboxed.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd May 5, 2020 .Dt CAP_SANDBOXED 3 .Os .Sh NAME @@ -65,6 +65,11 @@ or .Sh SEE ALSO .Xr cap_enter 2 , .Xr capsicum 4 +.Sh HISTORY +The +.Fn cap_sandboxed +function first appeared in +.Fx 9.2 . .Sh AUTHORS This function was implemented and manual page was written by .An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net Modified: head/lib/libc/sys/cap_enter.2 ============================================================================== --- head/lib/libc/sys/cap_enter.2 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libc/sys/cap_enter.2 Tue Jun 16 16:48:52 2020 (r362230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2017 +.Dd May 5, 2020 .Dt CAP_ENTER 2 .Os .Sh NAME @@ -150,6 +150,10 @@ points outside the process's allocated address space. .Xr capsicum 4 , .Xr sysctl 9 .Sh HISTORY +The +.Fn cap_getmode +system call first appeared in +.Fx 8.3 . Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Project. Modified: head/lib/libc/sys/cap_fcntls_limit.2 ============================================================================== --- head/lib/libc/sys/cap_fcntls_limit.2 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libc/sys/cap_fcntls_limit.2 Tue Jun 16 16:48:52 2020 (r362230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd May 5, 2020 .Dt CAP_FCNTLS_LIMIT 2 .Os .Sh NAME @@ -117,6 +117,12 @@ argument points at an invalid address. .Xr cap_rights_limit 2 , .Xr fcntl 2 .Sh HISTORY +The +.Fn cap_fcntls_get +and +.Fn cap_fcntls_limit +system calls first appeared in +.Fx 8.3 . Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Project. Modified: head/lib/libc/sys/cap_ioctls_limit.2 ============================================================================== --- head/lib/libc/sys/cap_ioctls_limit.2 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libc/sys/cap_ioctls_limit.2 Tue Jun 16 16:48:52 2020 (r362230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2015 +.Dd May 5, 2020 .Dt CAP_IOCTLS_LIMIT 2 .Os .Sh NAME @@ -150,6 +150,12 @@ argument points at invalid address. .Xr cap_rights_limit 2 , .Xr ioctl 2 .Sh HISTORY +The +.Fn cap_ioctls_get +and +.Fn cap_ioctls_limit +system calls first appeared in +.Fx 8.3 . Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Project. Modified: head/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- head/lib/libc/sys/cap_rights_limit.2 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libc/sys/cap_rights_limit.2 Tue Jun 16 16:48:52 2020 (r362230) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd May 5, 2020 .Dt CAP_RIGHTS_LIMIT 2 .Os .Sh NAME @@ -148,6 +148,10 @@ Capability rights list can only be reduced, never expa .Xr capsicum 4 , .Xr rights 4 .Sh HISTORY +The +.Fn cap_rights_limit +function first appeared in +.Fx 8.3 . Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Project. Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/libcasper/libcasper.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2019 +.Dd May 5, 2020 .Dt LIBCASPER 3 .Os .Sh NAME @@ -267,6 +267,11 @@ functions always succeed. .Xr capsicum 4 , .Xr unix 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm libcasper +library first appeared in +.Fx 10.3 . .Sh AUTHORS The .Nm libcasper Modified: head/lib/libcasper/libcasper/libcasper_service.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/libcasper/libcasper_service.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2018 +.Dd May 5, 2020 .Dt LIBCASPER 3 .Os .Sh NAME @@ -103,6 +103,11 @@ flag. .Xr libcasper 3 , .Xr capsicum 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm libcasper +library first appeared in +.Fx 10.3 . .Sh AUTHORS The .Nm libcasper Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2020 +.Dd May 5, 2020 .Dt CAP_DNS 3 .Os .Sh NAME @@ -223,6 +223,11 @@ printf("Name associated with %s is %s.\\n", ipstr, hna .Xr getnameinfo 3 , .Xr capsicum 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm cap_dns +service first appeared in +.Fx 10.3 . .Sh AUTHORS The .Nm cap_dns Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2019 +.Dd May 5, 2020 .Dt CAP_FILEARGS 3 .Os .Sh NAME @@ -263,6 +263,11 @@ fileargs_free(fa); .Xr getopt 3 , .Xr capsicum 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm cap_fileargs +service first appeared in +.Fx 10.3 . .Sh BUGS The .Lb cap_fileargs Modified: head/lib/libcasper/services/cap_grp/cap_grp.3 ============================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/services/cap_grp/cap_grp.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2018 +.Dd May 5, 2020 .Dt CAP_GRP 3 .Os .Sh NAME @@ -217,6 +217,11 @@ cap_close(capgrp); .Xr setgroupent 3 , .Xr capsicum 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm cap_grp +service first appeared in +.Fx 10.3 . .Sh AUTHORS The .Nm cap_grp Modified: head/lib/libcasper/services/cap_pwd/cap_pwd.3 ============================================================================== --- head/lib/libcasper/services/cap_pwd/cap_pwd.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/services/cap_pwd/cap_pwd.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2018 +.Dd May 5, 2020 .Dt CAP_PWD 3 .Os .Sh NAME @@ -223,6 +223,11 @@ cap_close(cappwd); .Xr setpwent 3 , .Xr capsicum 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm cap_pwd +service first appeared in +.Fx 10.3 . .Sh AUTHORS The .Nm cap_pwd Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 ============================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 6, 2020 +.Dd May 5, 2020 .Dt CAP_SYSCTL 3 .Os .Sh NAME @@ -175,6 +175,11 @@ cap_close(capsysctl); .Xr sysctlnametomib 3 , .Xr capsicum 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm cap_sysctl +service first appeared in +.Fx 10.3 . .Sh AUTHORS The .Nm cap_sysctl Modified: head/lib/libcasper/services/cap_syslog/cap_syslog.3 ============================================================================== --- head/lib/libcasper/services/cap_syslog/cap_syslog.3 Tue Jun 16 15:54:59 2020 (r362229) +++ head/lib/libcasper/services/cap_syslog/cap_syslog.3 Tue Jun 16 16:48:52 2020 (r362230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2018 +.Dd May 5, 2020 .Dt CAP_SYSLOG 3 .Os .Sh NAME @@ -103,5 +103,10 @@ cap_syslog(capsyslog, LOG_NOTICE, "System logs from ca .Xr vsyslog 3 , .Xr capsicum 4 , .Xr nv 9 +.Sh HISTORY +The +.Nm cap_syslog +service first appeared in +.Fx 10.3 . .Sh AUTHORS .An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org From owner-svn-src-all@freebsd.org Tue Jun 16 17:01:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0C0E3443A1 for ; Tue, 16 Jun 2020 17:01:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZGb25JNz4NB5 for ; Tue, 16 Jun 2020 17:01:11 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1592326864; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=XqMv++iO0yzx2lt+38yYO64ZdNAbcfT0rWDJuoCbI1+3AAQ1WZhnaXFYXlg6rcz4i9zYdjBr2eQ8E 63ohE3N2Pvj+e0vFCjL3ftyDEXC/2VYkkGMqkfxkSKT1WHH1E4jcD7BNjy5kNjh4LFo7iEutkcwhKI U5k4URnJhm2fUiqGm/5cJTrYbbd6GzzQFfAn6pHz6LySDahB3wnGO5BEEHqBof7Kxn2F8Tqy8Mw3C3 qVdYOLNH94AkIeA8f8GWLCh4q9WvqFYOXsFMKx54itnwKpOJwg1AjK4OeSKMr4UgzE0CpJbhNluDfp wXdVihXQXzT+G7LuZMFsYfidhWHuiwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=IElVbtlvOPe5q5w4ZuyqH4cDrF4xi3OE5/TC/C28KGE=; b=DJdRBJMwGRtEcz4y1urtKMgqbgJEvC+xW1GeYYQK8Rjld9uWcaXxrlYkmzFortPanBfJc17Ze36JU AGFdVT9++Ch4IJ/xYs7VsuEGZVKgl0hhGUD5k6oWe1WzEdq5t+g1+7gEfggrIXrQ8VpcKznhx5OMiZ E6+gR90f9v11OtHDPdNszqERTGc/xFSrFoezpSomzXOILjhGxipLvOpxMBstQOTYAXql91v/jnzcng cL6uO5Rxoyd8abJXmfW7Hh5MlzHPpeQfAxUmJpDCmTl5+NJRw0BGB7OxwAGp29cKfk6ZQym5hswMXO eYt9l4Lma0ghd+d8J+nFNrQ6bkpQoMA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=IElVbtlvOPe5q5w4ZuyqH4cDrF4xi3OE5/TC/C28KGE=; b=kT/Saov9aAczVEhLFIe3tFQ5sMfdA0gZ3Ega46xMDwGIUOfDQdWa79DOfIjGeos6oSXBeFyjTH/VB VrKWTS1hUokxpDqWatugpRMz/vnwnq9sp579bhgJm0poN6HgkGumgjv9gybY78zGh/upzEdMxNKIGb hv02+IHmOLzxyyIciJBkrc34o8NryqdSSO5zcmpz4p7Tm5ZT1cJ8AqFDa8pDJOvxnqY1AQ1da10i1D z1PZqYZ6DOqOgMVaBggT0wB4FJQm19Ht++FUyfeI58v1eksy7zJ+omFsOSsmBmlLNSWttkrFK7gIXA 7Jq17RvKo4cZsOoPDJa3irZVKbqxqsA== X-MHO-RoutePath: aGlwcGll X-MHO-User: f57921e8-aff2-11ea-b10c-b5956a7dd1a1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id f57921e8-aff2-11ea-b10c-b5956a7dd1a1; Tue, 16 Jun 2020 17:01:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 05GH12uo025322; Tue, 16 Jun 2020 11:01:02 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> Subject: Re: svn commit: r362217 - head/stand/common From: Ian Lepore To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 16 Jun 2020 11:01:02 -0600 In-Reply-To: <202006160705.05G753T4057972@repo.freebsd.org> References: <202006160705.05G753T4057972@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49mZGb25JNz4NB5 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:01:12 -0000 On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote: > Author: tsoome > Date: Tue Jun 16 07:05:03 2020 > New Revision: 362217 > URL: https://svnweb.freebsd.org/changeset/base/362217 > > Log: > loader: variable i is unused without MBR/GPT support built in > > Because i is only used as index in for loop, declare it in for > statement. > As much as I prefer doing it this way, style(9) doesn't allow for variable declarations inside a for() statement (or even inside a local block, which is just too 1980s for me, but it is still our standard). -- Ian From owner-svn-src-all@freebsd.org Tue Jun 16 17:02:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E36F3344651; Tue, 16 Jun 2020 17:02:56 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZJc5gj6z4NN9; Tue, 16 Jun 2020 17:02:56 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE0AE128F3; Tue, 16 Jun 2020 17:02:56 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GH2urj028120; Tue, 16 Jun 2020 17:02:56 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GH2uI8028119; Tue, 16 Jun 2020 17:02:56 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202006161702.05GH2uI8028119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 16 Jun 2020 17:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362231 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 362231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:02:57 -0000 Author: sjg Date: Tue Jun 16 17:02:56 2020 New Revision: 362231 URL: https://svnweb.freebsd.org/changeset/base/362231 Log: Make KENV_MVALLEN tunable When doing secure boot, loader wants to export loader.ve.hashed the value of which typically exceeds KENV_MVALLEN. Replace use of KENV_MVALLEN with tunable kenv_mvallen. Add getenv_string_buffer() for the case where a stack buffer cannot be created and use uma_zone_t kenv_zone for suitably sized buffers. Reviewed by: stevek, kevans Obtained from: Abhishek Kulkarni MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D25259 Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Tue Jun 16 16:48:52 2020 (r362230) +++ head/sys/kern/kern_environment.c Tue Jun 16 17:02:56 2020 (r362231) @@ -63,6 +63,9 @@ static MALLOC_DEFINE(M_KENV, "kenv", "kernel environme #define KENV_SIZE 512 /* Maximum number of environment strings */ +static uma_zone_t kenv_zone; +static int kenv_mvallen = KENV_MVALLEN; + /* pointer to the config-generated static environment */ char *kern_envp; @@ -85,6 +88,8 @@ bool dynamic_kenv; #define KENV_CHECK if (!dynamic_kenv) \ panic("%s: called before SI_SUB_KMEM", __func__) +static char *getenv_string_buffer(const char *); + int sys_kenv(td, uap) struct thread *td; @@ -110,9 +115,9 @@ sys_kenv(td, uap) #endif done = needed = 0; buflen = uap->len; - if (buflen > KENV_SIZE * (KENV_MNAMELEN + KENV_MVALLEN + 2)) + if (buflen > KENV_SIZE * (KENV_MNAMELEN + kenv_mvallen + 2)) buflen = KENV_SIZE * (KENV_MNAMELEN + - KENV_MVALLEN + 2); + kenv_mvallen + 2); if (uap->len > 0 && uap->value != NULL) buffer = malloc(buflen, M_TEMP, M_WAITOK|M_ZERO); mtx_lock(&kenv_lock); @@ -185,8 +190,8 @@ sys_kenv(td, uap) error = EINVAL; goto done; } - if (len > KENV_MVALLEN + 1) - len = KENV_MVALLEN + 1; + if (len > kenv_mvallen + 1) + len = kenv_mvallen + 1; value = malloc(len, M_TEMP, M_WAITOK); error = copyinstr(uap->value, value, len, NULL); if (error) { @@ -327,7 +332,7 @@ init_dynamic_kenv_from(char *init_env, int *curpos) for (cp = init_env; cp != NULL; cp = cpnext) { cpnext = kernenv_next(cp); len = strlen(cp) + 1; - if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { + if (len > KENV_MNAMELEN + 1 + kenv_mvallen + 1) { printf( "WARNING: too long kenv string, ignoring %s\n", cp); @@ -375,7 +380,14 @@ static void init_dynamic_kenv(void *data __unused) { int dynamic_envpos; + int size; + TUNABLE_INT_FETCH("kenv_mvallen", &kenv_mvallen); + size = KENV_MNAMELEN + 1 + kenv_mvallen + 1; + + kenv_zone = uma_zcreate("kenv", size, NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); @@ -395,7 +407,7 @@ freeenv(char *env) if (dynamic_kenv && env != NULL) { explicit_bzero(env, strlen(env)); - free(env, M_KENV); + uma_zfree(kenv_zone, env); } } @@ -470,14 +482,11 @@ _getenv_static(const char *name) char * kern_getenv(const char *name) { - char buf[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1]; char *ret; if (dynamic_kenv) { - if (getenv_string(name, buf, sizeof(buf))) { - ret = strdup(buf, M_KENV); - } else { - ret = NULL; + ret = getenv_string_buffer(name); + if (ret == NULL) { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "getenv"); } @@ -548,7 +557,7 @@ kern_setenv(const char *name, const char *value) if (namelen > KENV_MNAMELEN + 1) return (-1); vallen = strlen(value) + 1; - if (vallen > KENV_MVALLEN + 1) + if (vallen > kenv_mvallen + 1) return (-1); buf = malloc(namelen + vallen, M_KENV, M_WAITOK); sprintf(buf, "%s=%s", name, value); @@ -607,6 +616,33 @@ kern_unsetenv(const char *name) } /* + * Return a buffer containing the string value from an environment variable + */ +static char * +getenv_string_buffer(const char *name) +{ + char *cp, *ret; + int len; + + if (dynamic_kenv) { + len = KENV_MNAMELEN + 1 + kenv_mvallen + 1; + ret = uma_zalloc(kenv_zone, M_WAITOK | M_ZERO); + mtx_lock(&kenv_lock); + cp = _getenv_dynamic(name, NULL); + if (cp != NULL) + strlcpy(ret, cp, len); + mtx_unlock(&kenv_lock); + if (cp == NULL) { + uma_zfree(kenv_zone, ret); + ret = NULL; + } + } else + ret = _getenv_static(name); + + return (ret); +} + +/* * Return a string value from an environment variable. */ int @@ -635,17 +671,19 @@ int getenv_array(const char *name, void *pdata, int size, int *psize, int type_size, bool allow_signed) { - char buf[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1]; uint8_t shift; int64_t value; int64_t old; + char *buf; char *end; char *ptr; int n; + int rc; - if (getenv_string(name, buf, sizeof(buf)) == 0) + if ((buf = getenv_string_buffer(name)) == NULL) return (0); + rc = 0; /* assume failure */ /* get maximum number of elements */ size /= type_size; @@ -758,9 +796,11 @@ getenv_array(const char *name, void *pdata, int size, *psize = n * type_size; if (n != 0) - return (1); /* success */ + rc = 1; /* success */ error: - return (0); /* failure */ + if (dynamic_kenv) + uma_zfree(kenv_zone, buf); + return (rc); } /* @@ -859,15 +899,17 @@ getenv_ulong(const char *name, unsigned long *data) int getenv_quad(const char *name, quad_t *data) { - char value[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1]; - char *vtp; + char *value, *vtp; quad_t iv; - if (!getenv_string(name, value, sizeof(value))) + value = getenv_string_buffer(name); + if (value == NULL) return (0); iv = strtoq(value, &vtp, 0); - if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) + if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { + freeenv(value); return (0); + } switch (vtp[0]) { case 't': case 'T': iv *= 1024; @@ -883,8 +925,10 @@ getenv_quad(const char *name, quad_t *data) case '\0': break; default: + freeenv(value); return (0); } + freeenv(value); *data = iv; return (1); } From owner-svn-src-all@freebsd.org Tue Jun 16 17:05:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CB57344745; Tue, 16 Jun 2020 17:05:39 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZMl0PLBz4Nfr; Tue, 16 Jun 2020 17:05:39 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0880D124FE; Tue, 16 Jun 2020 17:05:39 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GH5c01028286; Tue, 16 Jun 2020 17:05:38 GMT (envelope-from blackend@FreeBSD.org) Received: (from blackend@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GH5cbB028285; Tue, 16 Jun 2020 17:05:38 GMT (envelope-from blackend@FreeBSD.org) Message-Id: <202006161705.05GH5cbB028285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: blackend set sender to blackend@FreeBSD.org using -f From: Marc Fonvieille Date: Tue, 16 Jun 2020 17:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362232 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: blackend X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 362232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:05:39 -0000 Author: blackend (doc committer) Date: Tue Jun 16 17:05:38 2020 New Revision: 362232 URL: https://svnweb.freebsd.org/changeset/base/362232 Log: Fix pointer name to match the name used in the function prototype above (and in termios.c). Discussed with: Rodney W. Grimes Modified: head/lib/libc/gen/tcsetattr.3 Modified: head/lib/libc/gen/tcsetattr.3 ============================================================================== --- head/lib/libc/gen/tcsetattr.3 Tue Jun 16 17:02:56 2020 (r362231) +++ head/lib/libc/gen/tcsetattr.3 Tue Jun 16 17:05:38 2020 (r362232) @@ -126,24 +126,24 @@ represented, however, the following symbolic values ar The .Fn cfgetispeed function returns the input baud rate in the termios structure referenced by -.Fa tp . +.Fa t . .Pp The .Fn cfsetispeed function sets the input baud rate in the termios structure referenced by -.Fa tp +.Fa t to .Fa speed . .Pp The .Fn cfgetospeed function returns the output baud rate in the termios structure referenced by -.Fa tp . +.Fa t . .Pp The .Fn cfsetospeed function sets the output baud rate in the termios structure referenced by -.Fa tp +.Fa t to .Fa speed . .Pp @@ -151,7 +151,7 @@ The .Fn cfsetspeed function sets both the input and output baud rate in the termios structure referenced by -.Fa tp +.Fa t to .Fa speed . .Pp @@ -210,7 +210,7 @@ function copies the parameters associated with the ter by .Fa fd in the termios structure referenced by -.Fa tp . +.Fa t . This function is allowed from a background process, however, the terminal attributes may be subsequently changed by a foreground process. .Pp @@ -218,7 +218,7 @@ The .Fn tcsetattr function sets the parameters associated with the terminal from the termios structure referenced by -.Fa tp . +.Fa t . The .Fa action argument is created by From owner-svn-src-all@freebsd.org Tue Jun 16 17:08:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CC9E34486F; Tue, 16 Jun 2020 17:08:52 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZRR2zG3z4PH8; Tue, 16 Jun 2020 17:08:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id lF4ojFvs5ng7KlF4pjQ80V; Tue, 16 Jun 2020 11:08:48 -0600 X-Authority-Analysis: v=2.3 cv=ecemg4MH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=nTHF0DUjJn0A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=7HFaC1jlLhaPMhqbVQkA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 3C83E40B; Tue, 16 Jun 2020 10:08:45 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 05GH8i6n019564; Tue, 16 Jun 2020 10:08:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 05GH8ibS019561; Tue, 16 Jun 2020 10:08:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202006161708.05GH8ibS019561@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ian Lepore cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362217 - head/stand/common In-reply-to: <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> Comments: In-reply-to Ian Lepore message dated "Tue, 16 Jun 2020 11:01:02 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 16 Jun 2020 10:08:44 -0700 X-CMAE-Envelope: MS4wfDqB0mL8zaufKyc1+W26v6YKj82HnwVMsq9baS4aS6TCdXib7Z06j2ioj23A9y++uZqYnMer9utfmmpsRSBMSAgjYDitI/vPNGwCQHvmXUmgTiIoCD6D RVw+4vfChuPIWanxQy4iri5YtAXOaQZvBIGi3nLxwg66aBx5+p4AFyXJzsCp3MYqyaqXOwFb35/uYunLdzIUs6cG6bx9CZcIzXEhVibhrwuGYFErJQZ3cVzk lDQO9kGMQqg9HZzBdOZV/VzP+nLGP4IQYv7UrIxtKxLRGT7n97UfG57NtIbUzdL2w1LH5wByK4jGbgBlJHP+Qg== X-Rspamd-Queue-Id: 49mZRR2zG3z4PH8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:08:52 -0000 In message <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org>, Ian Le pore writes: > On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote: > > Author: tsoome > > Date: Tue Jun 16 07:05:03 2020 > > New Revision: 362217 > > URL: https://svnweb.freebsd.org/changeset/base/362217 > > > > Log: > > loader: variable i is unused without MBR/GPT support built in > > > > Because i is only used as index in for loop, declare it in for > > statement. > > > > As much as I prefer doing it this way, style(9) doesn't allow for > variable declarations inside a for() statement (or even inside a local > block, which is just too 1980s for me, but it is still our standard). Doesn't this use stack for a shorter period of time or does the compiler optimize this, making this change moot? The tradeoff is a few extra bytes of stack for a longer period of time vs a few extra instructions incrementing and decrementing the stack pointer. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Jun 16 17:11:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A2C53448CC; Tue, 16 Jun 2020 17:11:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZVg1Prnz4PGK; Tue, 16 Jun 2020 17:11:38 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f47.google.com with SMTP id o5so22747495iow.8; Tue, 16 Jun 2020 10:11:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xJr3bvMCkST8xqH4j0vV2mbfA1hyZhfLMYuQcGKUtuk=; b=SUz3Mxeo53hCwVRO1Sm6XmV6oNn4rfTie0lmMlUmsUIXi4oNiFRvcYzTp4hI6E9HMp 1dbYG+F18vuFgLvscfVUSfNhN1GKOCoNcQ6EkVK2eBljI7i0Gnzzx0dtnpbNUX3k/z2G gEtL3abHHKtEB/POB3YYN9jnhc4Arr5/Lt46ky4VwfJkFQ2D0S/gr9DoohPj2pqn+k/y sA9dHeUBKwTSpWiuMZXgIoW9LHt5dcKxyX8KN46U3GLLWO9eBJii/0XWpFjr2a/YzYtW cPFTDLgi2MB8SzPm56qOCSC85/UcOZXAPpViPtjPYKZIwj5m+S/+UpsvqlhedV3Had8x ayCQ== X-Gm-Message-State: AOAM531PiC0vTjiBaoVz3am4SQbadRiAL/rYWwYBZhDYMTkj/JBaVsJO AkNVR1RdXxTMlmMk0llFa3+R0CRdlM9uedDd8DsgoQ== X-Google-Smtp-Source: ABdhPJyNTdoHueFCekl4mGb/bhd3pcuTcdqnukm9lx4OVvA0JWjXRLMqspA5sx8PeLN3VCRGMChG2eCtZg4MCaw54yo= X-Received: by 2002:a02:a68b:: with SMTP id j11mr20902129jam.128.1592327497474; Tue, 16 Jun 2020 10:11:37 -0700 (PDT) MIME-Version: 1.0 References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> In-Reply-To: <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> From: Ed Maste Date: Tue, 16 Jun 2020 13:11:24 -0400 Message-ID: Subject: Re: svn commit: r362217 - head/stand/common To: Ian Lepore Cc: Toomas Soome , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49mZVg1Prnz4PGK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:11:39 -0000 On Tue, 16 Jun 2020 at 13:01, Ian Lepore wrote: > > As much as I prefer doing it this way, style(9) doesn't allow for > variable declarations inside a for() statement (or even inside a local > block, which is just too 1980s for me, but it is still our standard). Perhaps it's time to update style(9) to at least permit these uses, as we've done with the blank line at the beginning of functions with no local variables, and with braces around single-line bodies. From owner-svn-src-all@freebsd.org Tue Jun 16 17:12:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF422344A35; Tue, 16 Jun 2020 17:12:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZX14HxDz4PSG; Tue, 16 Jun 2020 17:12:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 0A8A713F3C; Tue, 16 Jun 2020 17:12:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r362217 - head/stand/common To: Ian Lepore , Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Tue, 16 Jun 2020 12:12:49 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:12:49 -0000 On 16/06/2020 12:01, Ian Lepore wrote: > On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote: >> Author: tsoome >> Date: Tue Jun 16 07:05:03 2020 >> New Revision: 362217 >> URL: https://svnweb.freebsd.org/changeset/base/362217 >> >> Log: >> loader: variable i is unused without MBR/GPT support built in >> >> Because i is only used as index in for loop, declare it in for >> statement. >> > As much as I prefer doing it this way, style(9) doesn't allow for > variable declarations inside a for() statement (or even inside a local > block, which is just too 1980s for me, but it is still our standard). Perhaps style(9) needs updating? I think KNF is mandatory for kernel code only, and is only suggested for userland. Pedro. From owner-svn-src-all@freebsd.org Tue Jun 16 17:30:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C6B8344FB4; Tue, 16 Jun 2020 17:30:44 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49mZwg35Qxz4QP2; Tue, 16 Jun 2020 17:30:43 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05GHUco2082018; Tue, 16 Jun 2020 10:30:38 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05GHUc9B082017; Tue, 16 Jun 2020 10:30:38 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006161730.05GHUc9B082017@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362217 - head/stand/common In-Reply-To: <202006161708.05GH8ibS019561@slippy.cwsent.com> To: Cy Schubert Date: Tue, 16 Jun 2020 10:30:38 -0700 (PDT) CC: Ian Lepore , Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49mZwg35Qxz4QP2 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.27 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.24)[0.238]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_SPAM_MEDIUM(0.51)[0.507]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.62)[0.620]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:30:44 -0000 > In message <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org>, > Ian Le > pore writes: > > On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote: > > > Author: tsoome > > > Date: Tue Jun 16 07:05:03 2020 > > > New Revision: 362217 > > > URL: https://svnweb.freebsd.org/changeset/base/362217 > > > > > > Log: > > > loader: variable i is unused without MBR/GPT support built in > > > > > > Because i is only used as index in for loop, declare it in for > > > statement. > > > > > > > As much as I prefer doing it this way, style(9) doesn't allow for > > variable declarations inside a for() statement (or even inside a local > > block, which is just too 1980s for me, but it is still our standard). Last time I tried to assert that bit of style(9) with respect to inside a local block I was over ridden, so it is probably time to atleast revisit that part of style(9). > Doesn't this use stack for a shorter period of time or does the compiler > optimize this, making this change moot? > > The tradeoff is a few extra bytes of stack for a longer period of time vs a > few extra instructions incrementing and decrementing the stack pointer. I do not think the reasoning had to do with stack space vs instuctions, but more about being able to clearly know about variable reuse and not do it as that can create fun bugs. Tools have modernized since that part of style was written. > -- > Cy Schubert -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 16 17:34:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31D5D34514E; Tue, 16 Jun 2020 17:34:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mb1J0bkwz4QhB; Tue, 16 Jun 2020 17:34:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id E9998136F7; Tue, 16 Jun 2020 17:34:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 9E44310E72; Tue, 16 Jun 2020 19:34:41 +0200 (CEST) From: "Kristof Provost" To: "Ed Maste" Cc: "Ian Lepore" , "Toomas Soome" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r362217 - head/stand/common Date: Tue, 16 Jun 2020 19:34:41 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: In-Reply-To: References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:34:44 -0000 On 16 Jun 2020, at 19:11, Ed Maste wrote: > On Tue, 16 Jun 2020 at 13:01, Ian Lepore wrote: >> >> As much as I prefer doing it this way, style(9) doesn't allow for >> variable declarations inside a for() statement (or even inside a >> local >> block, which is just too 1980s for me, but it is still our standard). > > Perhaps it's time to update style(9) to at least permit these uses, as > we've done with the blank line at the beginning of functions with no > local variables, and with braces around single-line bodies. We have 431 instances of `for (int i` in sys alone. It’s not so much a question of allowing it as acknowledging reality at this point. Best regards, Kristof From owner-svn-src-all@freebsd.org Tue Jun 16 17:45:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80C8E345877; Tue, 16 Jun 2020 17:45:24 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mbFc2hm2z4RtQ; Tue, 16 Jun 2020 17:45:24 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5360E12F9B; Tue, 16 Jun 2020 17:45:24 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GHjOHM053570; Tue, 16 Jun 2020 17:45:24 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GHjOpT053569; Tue, 16 Jun 2020 17:45:24 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202006161745.05GHjOpT053569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 16 Jun 2020 17:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362233 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 362233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 17:45:24 -0000 Author: eugen Date: Tue Jun 16 17:45:23 2020 New Revision: 362233 URL: https://svnweb.freebsd.org/changeset/base/362233 Log: newsyslog(8): make configuration parser more robust. Currently newsyslog supports directive that is used in our default /etc/newsyslog.conf in the following form: /usr/local/etc/newsyslog.conf.d/* While this is suitable for ports installing their own rules for logs rotation, this also makes newsyslog break entire processing of all files if it encounters single line it cannot parse. This includes lines referring to nonexistent username/group for log ownership, so newsyslog stops calling errx() function in the parser. With this fix, newsyslog uses warnx() instead of errx() in such cases to print a warning, recover gracefully and continue with execution. Among other cases, this unbreaks initial creation of log files having flag "C" at boot time (newsyslog -CN). This is most important for systems having RAM-based /var file system like nanobsd(8)-based that rely on newsyslog to bring system log files into existence. MFC after: 1 month Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Tue Jun 16 17:05:38 2020 (r362232) +++ head/usr.sbin/newsyslog/newsyslog.c Tue Jun 16 17:45:23 2020 (r362233) @@ -1078,9 +1078,11 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl q = parse = missing_field(sob(line), errline); parse = son(line); - if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + if (!*parse) { + warnx("malformed line (missing fields):\n%s", errline); + continue; + } *parse = '\0'; /* @@ -1132,22 +1134,24 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl continue; } +#define badline(msg, ...) do { \ + warnx(msg, __VA_ARGS__); \ + goto cleanup; \ +} while (0) + special = 0; working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (*defconf_p != NULL) { - warnx("Ignoring duplicate entry for %s!", q); - free_entry(working); - continue; - } + if (*defconf_p != NULL) + badline("Ignoring duplicate entry for %s!", q); *defconf_p = working; } q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; if ((group = strchr(q, ':')) != NULL || @@ -1156,7 +1160,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl if (*q) { if (!(isnumberstr(q))) { if ((pwd = getpwnam(q)) == NULL) - errx(1, + badline( "error in config file; unknown user:\n%s", errline); working->uid = pwd->pw_uid; @@ -1169,7 +1173,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl if (*q) { if (!(isnumberstr(q))) { if ((grp = getgrnam(q)) == NULL) - errx(1, + badline( "error in config file; unknown group:\n%s", errline); working->gid = grp->gr_gid; @@ -1181,7 +1185,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; } else { @@ -1190,7 +1194,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl } if (!sscanf(q, "%o", &working->permissions)) - errx(1, "error in config file; bad permissions:\n%s", + badline("error in config file; bad permissions:\n%s", errline); if ((working->permissions & ~DEFFILEMODE) != 0) { warnx("File mode bits 0%o changed to 0%o in line:\n%s", @@ -1202,17 +1206,17 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; if (!sscanf(q, "%d", &working->numlogs) || working->numlogs < 0) - errx(1, "error in config file; bad value for count of logs to save:\n%s", + badline("error in config file; bad value for count of logs to save:\n%s", errline); q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; if (isdigitch(*q)) @@ -1241,14 +1245,14 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl else if (*ep == '*') working->hours = -1; else if (ul > INT_MAX) - errx(1, "interval is too large:\n%s", errline); + badline("interval is too large:\n%s", errline); else working->hours = ul; if (*ep == '\0' || strcmp(ep, "*") == 0) goto no_trimat; if (*ep != '@' && *ep != '$') - errx(1, "malformed interval/at:\n%s", errline); + badline("malformed interval/at:\n%s", errline); working->flags |= CE_TRIMAT; working->trim_at = ptime_init(NULL); @@ -1259,10 +1263,10 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl res = ptime_relparse(working->trim_at, ptm_opts, ptimeget_secs(timenow), ep + 1); if (res == -2) - errx(1, "nonexistent time for 'at' value:\n%s", + badline("nonexistent time for 'at' value:\n%s", errline); else if (res < 0) - errx(1, "malformed 'at' value:\n%s", errline); + badline("malformed 'at' value:\n%s", errline); } no_trimat: @@ -1325,7 +1329,7 @@ no_trimat: case 'f': /* Used by OpenBSD for "CE_FOLLOW" */ case 'm': /* Used by OpenBSD for "CE_MONITOR" */ default: - errx(1, "illegal flag in config file -- %c", + badline("illegal flag in config file -- %c", *q); } } @@ -1347,7 +1351,7 @@ no_trimat: else if (isalnum(*q)) goto got_sig; else { - errx(1, + badline( "illegal pid file or signal in config file:\n%s", errline); } @@ -1365,7 +1369,7 @@ no_trimat: got_sig: working->sig = parse_signal(q); if (working->sig < 1 || working->sig >= sys_nsig) { - errx(1, + badline( "illegal signal in config file:\n%s", errline); } @@ -1416,7 +1420,11 @@ got_sig: } else { STAILQ_INSERT_TAIL(work_p, working, cf_nextp); } - } + continue; +cleanup: + free_entry(working); +#undef badline + } /* while (fgets(line, BUFSIZ, cf)) */ if (errline != NULL) free(errline); } From owner-svn-src-all@freebsd.org Tue Jun 16 18:16:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1BB63466F1; Tue, 16 Jun 2020 18:16:46 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mbxp4HNzz4TbC; Tue, 16 Jun 2020 18:16:46 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E44C131FD; Tue, 16 Jun 2020 18:16:46 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GIGknb072317; Tue, 16 Jun 2020 18:16:46 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GIGkAm072315; Tue, 16 Jun 2020 18:16:46 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202006161816.05GIGkAm072315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Jun 2020 18:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362234 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 362234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 18:16:46 -0000 Author: rrs Date: Tue Jun 16 18:16:45 2020 New Revision: 362234 URL: https://svnweb.freebsd.org/changeset/base/362234 Log: iSo in doing final checks on OCA firmware with all the latest tweaks the dup-ack checking packet drill script was failing with a number of unexpected acks. So it turns out if you have the default recvwin set up to 1Meg (like OCA's do) and you have no window scaling (like the dupack checking code) then we have another case where we are always trying to update the rwnd and sending an ack when we should not. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D25298 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Tue Jun 16 17:45:23 2020 (r362233) +++ head/sys/netinet/tcp_stacks/bbr.c Tue Jun 16 18:16:45 2020 (r362234) @@ -12157,8 +12157,8 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva * have gotten more data into the socket buffer to * send. */ - recwin = min(max(sbspace(&so->so_rcv), 0), - TCP_MAXWIN << tp->rcv_scale); + recwin = lmin(lmax(sbspace(&so->so_rcv), 0), + (long)TCP_MAXWIN << tp->rcv_scale); if ((bbr_window_update_needed(tp, so, recwin, maxseg) == 0) && ((tcp_outflags[tp->t_state] & TH_RST) == 0) && ((sbavail(sb) + ((tcp_outflags[tp->t_state] & TH_FIN) ? 1 : 0)) <= @@ -12839,8 +12839,8 @@ recheck_resend: ipoptlen == 0) tso = 1; - recwin = min(max(sbspace(&so->so_rcv), 0), - TCP_MAXWIN << tp->rcv_scale); + recwin = lmin(lmax(sbspace(&so->so_rcv), 0), + (long)TCP_MAXWIN << tp->rcv_scale); /* * Sender silly window avoidance. We transmit under the following * conditions when len is non-zero: Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Tue Jun 16 17:45:23 2020 (r362233) +++ head/sys/netinet/tcp_stacks/rack.c Tue Jun 16 18:16:45 2020 (r362234) @@ -12750,7 +12750,8 @@ again: flags &= ~TH_FIN; } } - recwin = sbspace(&so->so_rcv); + recwin = lmin(lmax(sbspace(&so->so_rcv), 0), + (long)TCP_MAXWIN << tp->rcv_scale); /* * Sender silly window avoidance. We transmit under the following @@ -13656,8 +13657,6 @@ send: if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) recwin = (long)(tp->rcv_adv - tp->rcv_nxt); - if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) - recwin = (long)TCP_MAXWIN << tp->rcv_scale; } /* From owner-svn-src-all@freebsd.org Tue Jun 16 18:39:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9EA634728C; Tue, 16 Jun 2020 18:39:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mcSX4zPLz4WNZ; Tue, 16 Jun 2020 18:39:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A64C913B9B; Tue, 16 Jun 2020 18:39:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GIduIY084931; Tue, 16 Jun 2020 18:39:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GIdua2084930; Tue, 16 Jun 2020 18:39:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202006161839.05GIdua2084930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 16 Jun 2020 18:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362235 - head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch X-SVN-Commit-Revision: 362235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 18:39:56 -0000 Author: kp Date: Tue Jun 16 18:39:56 2020 New Revision: 362235 URL: https://svnweb.freebsd.org/changeset/base/362235 Log: llvm: Default to -mno-relax on RISC-V Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax'. Our default linker (ld.lld) doesn't support relaxation, so default to no-relax so we don't generate object files the linker can't handle. Reviewed by: mhorne Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25210 Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp Tue Jun 16 18:16:45 2020 (r362234) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp Tue Jun 16 18:39:56 2020 (r362235) @@ -426,8 +426,9 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co if (Args.hasArg(options::OPT_ffixed_x31)) Features.push_back("+reserve-x31"); - // -mrelax is default, unless -mno-relax is specified. - if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true)) + // FreeBSD local, because ld.lld doesn't support relaxations + // -mno-relax is default, unless -mrelax is specified. + if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, false)) Features.push_back("+relax"); else Features.push_back("-relax"); From owner-svn-src-all@freebsd.org Tue Jun 16 19:21:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E87613308A7; Tue, 16 Jun 2020 19:21:28 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mdNS5v4Wz4Ypn; Tue, 16 Jun 2020 19:21:28 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5C65141FF; Tue, 16 Jun 2020 19:21:28 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GJLSb5010971; Tue, 16 Jun 2020 19:21:28 GMT (envelope-from jmallett@FreeBSD.org) Received: (from jmallett@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GJLSpa010970; Tue, 16 Jun 2020 19:21:28 GMT (envelope-from jmallett@FreeBSD.org) Message-Id: <202006161921.05GJLSpa010970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmallett set sender to jmallett@FreeBSD.org using -f From: Juli Mallett Date: Tue, 16 Jun 2020 19:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362236 - head/usr.sbin/mpsutil X-SVN-Group: head X-SVN-Commit-Author: jmallett X-SVN-Commit-Paths: head/usr.sbin/mpsutil X-SVN-Commit-Revision: 362236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 19:21:29 -0000 Author: jmallett Date: Tue Jun 16 19:21:28 2020 New Revision: 362236 URL: https://svnweb.freebsd.org/changeset/base/362236 Log: Improve unit parsing of mpsutil. Previously, it used atoi(3) to parse the unit parameter, which would silently yield a unit of 0 in the presence of an invalid unit number. As most users of mpsutil(8) are likely to have at least a unit 0, this is could have confusing results. This behaviour was particularly unintuitive if one incorrectly passed an adapter device name, or a device path, instead of a unit number. In addition to using strtoumax(3) instead of atoi(3) to parse unit numbers, support stripping a device name (e.g. mps1) or path (e.g. /dev/mps2) to just its unit number. Reviewed by: scottl (earlier version) Modified: head/usr.sbin/mpsutil/mpsutil.c Modified: head/usr.sbin/mpsutil/mpsutil.c ============================================================================== --- head/usr.sbin/mpsutil/mpsutil.c Tue Jun 16 18:39:56 2020 (r362235) +++ head/usr.sbin/mpsutil/mpsutil.c Tue Jun 16 19:21:28 2020 (r362236) @@ -37,6 +37,8 @@ __RCSID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -91,6 +93,8 @@ int main(int ac, char **av) { struct mpsutil_command **cmd; + uintmax_t unit; + char *end; int ch; is_mps = !strcmp(getprogname(), "mpsutil"); @@ -98,7 +102,17 @@ main(int ac, char **av) while ((ch = getopt(ac, av, "u:h?")) != -1) { switch (ch) { case 'u': - mps_unit = atoi(optarg); + if (strncmp(optarg, _PATH_DEV, strlen(_PATH_DEV)) == 0) { + optarg += strlen(_PATH_DEV); + if (strncmp(optarg, is_mps ? "mps" : "mpr", 3) != 0) + errx(1, "Invalid device: %s", optarg); + } + if (strncmp(optarg, is_mps ? "mps" : "mpr", 3) == 0) + optarg += 3; + unit = strtoumax(optarg, &end, 10); + if (*end != '\0' || unit == UINTMAX_MAX || unit > INT_MAX) + errx(1, "Invalid unit: %s", optarg); + mps_unit = unit; break; case 'h': case '?': From owner-svn-src-all@freebsd.org Tue Jun 16 20:22:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0F7A3329F9; Tue, 16 Jun 2020 20:22:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mflP58Wfz4dSw; Tue, 16 Jun 2020 20:22:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9364B14E22; Tue, 16 Jun 2020 20:22:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKMvRB051332; Tue, 16 Jun 2020 20:22:57 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKMuwK051329; Tue, 16 Jun 2020 20:22:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162022.05GKMuwK051329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362237 - in stable/12: share/man/man9 sys/conf sys/dev/ofw X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/conf sys/dev/ofw X-SVN-Commit-Revision: 362237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:22:57 -0000 Author: manu Date: Tue Jun 16 20:22:56 2020 New Revision: 362237 URL: https://svnweb.freebsd.org/changeset/base/362237 Log: MFC r346332: ofw_graph: Add functions for graph bindings Those functions are helpers to work on graph bindings. graphs are mostly use with video related devices. See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/graph.txt?id=4436a3711e3249840e0679e92d3c951bcaf25515 Differential Revision: https://reviews.freebsd.org/D19877 Added: stable/12/share/man/man9/ofw_graph.9 - copied unchanged from r346332, head/share/man/man9/ofw_graph.9 stable/12/sys/dev/ofw/ofw_graph.c - copied unchanged from r346332, head/sys/dev/ofw/ofw_graph.c stable/12/sys/dev/ofw/ofw_graph.h - copied unchanged from r346332, head/sys/dev/ofw/ofw_graph.h Modified: stable/12/sys/conf/files Directory Properties: stable/12/ (props changed) Copied: stable/12/share/man/man9/ofw_graph.9 (from r346332, head/share/man/man9/ofw_graph.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man9/ofw_graph.9 Tue Jun 16 20:22:56 2020 (r362237, copy of r346332, head/share/man/man9/ofw_graph.9) @@ -0,0 +1,106 @@ +.\" Copyright (c) 2019 Emmanuel Vadot +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 10, 2019 +.Dt ofw_graph 9 +.Os +.Sh NAME +.Nm ofw_graph , +.Nm ofw_graph_get_port_by_idx , +.Nm ofw_graph_port_get_num_endpoints , +.Nm ofw_graph_get_endpoint_by_idx , +.Nm ofw_graph_get_remote_endpoint , +.Nm ofw_graph_get_remote_parent , +.Nm ofw_graph_get_device_by_port_ep , +.Nd Helpers for the graph bindings +.Sh SYNOPSIS +.In dev/ofw/openfirm.h +.In dev/ofw/ofw_graph.h +.Ft phandle_t +.Fn ofw_graph_get_port_by_idx "phandle_t node" "uint32_t idx" +.Ft size_t +.Fn ofw_graph_port_get_num_endpoints "phandle_t port" +.Ft phandle_t +.Fn ofw_graph_get_endpoint_by_idx "phandle_t port" "uint32_t idx" +.Ft phandle_t +.Fn ofw_graph_get_remote_endpoint "phandle_t endpoint" +.Ft phandle_t +.Fn ofw_graph_get_remote_parent "phandle_t remote" +.Ft device_t +.Fn ofw_graph_get_device_by_port_ep "phandle_t node" "uint32_t port_id" "uin32_t ep_id" +.Sh DESCRIPTION +.Pp +The ofw_graph functions are helpers to parse the DTS graph bindings +.Pp +.Fn ofw_graph_get_port_by_idx +return the port with id +.Fa idx . +It will first check node named +.Fa port@idx +and then fallback on checking the +.Fa ports +child for a child node matching the id. If no ports matching +.Fa idx +is found the function return 0. +.Pp +.Fn ofw_graph_port_get_num_endpoints +returns the number of endpoints a port node have. +.Pp +.Fn ofw_graph_get_endpoint_by_idx +return the endpoint with id +.Fa idx . +It will first check if there is a single child named +.Fa endpoint +and returns it if there is. If there is multiple endpoints it will check +the +.Fa reg +property and returns the correct +.Fa phandle_t +or 0 if none match. +.Pp +.Fn ofw_graph_get_remote_endpoint +returns the +.Fa remote-endpoint +property if it exists or 0. +.Pp +.Fn ofw_graph_get_remote_parent +returns the device node corresponding to the +.Fa remote-endpoint +phandle or 0 if none. +.Fn ofw_graph_get_device_by_port_ep +returns the device associated with the port and endpoint or +.Fa NULL +if none. The device driver should have called +.Fn OF_device_register_xref +before. +.Fn +.Sh HISTORY +The +.Nm ofw_graph +functions first appeared in +.Fx 13.0 . +The +.Nm ofw_graph +functions and manual page were written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Tue Jun 16 19:21:28 2020 (r362236) +++ stable/12/sys/conf/files Tue Jun 16 20:22:56 2020 (r362237) @@ -2628,6 +2628,7 @@ dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt +dev/ofw/ofw_graph.c optional fdt dev/ofw/ofw_subr.c optional fdt dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt Copied: stable/12/sys/dev/ofw/ofw_graph.c (from r346332, head/sys/dev/ofw/ofw_graph.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/ofw/ofw_graph.c Tue Jun 16 20:22:56 2020 (r362237, copy of r346332, head/sys/dev/ofw/ofw_graph.c) @@ -0,0 +1,186 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "ofw_bus_if.h" + +#define PORT_MAX_NAME 8 + +phandle_t +ofw_graph_get_port_by_idx(phandle_t node, uint32_t idx) +{ + phandle_t ports, child; + uint32_t reg; + char portnode[PORT_MAX_NAME]; + + /* First try to find a port@ node */ + snprintf(portnode, sizeof(portnode), "port@%d", idx); + child = ofw_bus_find_child(node, portnode); + if (child != 0) + return (child); + + /* Next try to look under ports */ + ports = ofw_bus_find_child(node, "ports"); + if (ports == 0) + return (0); + + for (child = OF_child(ports); child != 0; child = OF_peer(child)) { + if (OF_getencprop(child, "reg", ®, sizeof(uint32_t)) <= 0 || + reg != idx) + continue; + + return (child); + } + + return (0); +} + +size_t +ofw_graph_port_get_num_endpoints(phandle_t port) +{ + phandle_t child; + char *name; + size_t num = 0; + int ret; + + for (num = 0, child = OF_child(port); child != 0; + child = OF_peer(child)) { + ret = OF_getprop_alloc(child, "name", (void **)&name); + if (ret == -1) + continue; + if (strcmp(name, "endpoint") == 0) + num++; + else if (strncmp(name, "endpoint@", 9) == 0) + num++; + free(name, M_OFWPROP); + } + + return (num); +} + +phandle_t +ofw_graph_get_endpoint_by_idx(phandle_t port, uint32_t idx) +{ + phandle_t endpoint, child; + uint32_t reg; + + /* First test if we have only one endpoint */ + endpoint = ofw_bus_find_child(port, "endpoint"); + if (endpoint != 0) + return (endpoint); + + /* Then test all childs based on the reg property */ + for (child = OF_child(port); child != 0; child = OF_peer(child)) { + if (OF_getencprop(child, "reg", ®, sizeof(uint32_t)) <= 0 || + reg != idx) + continue; + + return (child); + } + + return (0); +} + +phandle_t +ofw_graph_get_remote_endpoint(phandle_t endpoint) +{ + phandle_t remote; + + if (OF_getencprop(endpoint, "remote-endpoint", &remote, + sizeof(phandle_t)) <= 0) + return (0); + + return (remote); +} + +phandle_t +ofw_graph_get_remote_parent(phandle_t remote) +{ + phandle_t node; + char *name; + int ret; + + /* get the endpoint node */ + node = OF_node_from_xref(remote); + + /* go to the port@X node */ + node = OF_parent(node); + /* go to the ports node or parent */ + node = OF_parent(node); + + /* if the node name is 'ports' we need to go up one last time */ + ret = OF_getprop_alloc(node, "name", (void **)&name); + if (ret == -1) { + printf("%s: Node %x don't have a name, abort\n", __func__, node); + node = 0; + goto end; + } + if (strcmp("ports", name) == 0) + node = OF_parent(node); + +end: + free(name, M_OFWPROP); + return (node); +} + +device_t +ofw_graph_get_device_by_port_ep(phandle_t node, uint32_t port_id, uint32_t ep_id) +{ + phandle_t outport, port, endpoint, remote; + + port = ofw_graph_get_port_by_idx(node, port_id); + if (port == 0) + return (NULL); + endpoint = ofw_graph_get_endpoint_by_idx(port, ep_id); + if (endpoint == 0) + return NULL; + remote = ofw_graph_get_remote_endpoint(endpoint); + if (remote == 0) + return (NULL); + outport = ofw_graph_get_remote_parent(remote); + if (outport == 0) + return (NULL); + + return (OF_device_from_xref(OF_xref_from_node(outport))); +} Copied: stable/12/sys/dev/ofw/ofw_graph.h (from r346332, head/sys/dev/ofw/ofw_graph.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/ofw/ofw_graph.h Tue Jun 16 20:22:56 2020 (r362237, copy of r346332, head/sys/dev/ofw/ofw_graph.h) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OFW_GRAPH_H_ +#define _OFW_GRAPH_H_ + +phandle_t ofw_graph_get_port_by_idx(phandle_t node, uint32_t idx); +phandle_t ofw_graph_get_remote_endpoint(phandle_t endpoint); +size_t ofw_graph_port_get_num_endpoints(phandle_t port); +phandle_t ofw_graph_get_endpoint_by_idx(phandle_t port, uint32_t idx); +phandle_t ofw_graph_get_remote_parent(phandle_t remote); + +device_t ofw_graph_get_device_by_port_ep(phandle_t node, uint32_t port_id, uint32_t ep_id); + +#endif /* _OFW_GRAPH_H_ */ + From owner-svn-src-all@freebsd.org Tue Jun 16 20:23:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1A0A332C99; Tue, 16 Jun 2020 20:23:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mfmZ3JH5z4dlR; Tue, 16 Jun 2020 20:23:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C4A714FA3; Tue, 16 Jun 2020 20:23:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKNwA4051431; Tue, 16 Jun 2020 20:23:58 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKNw2e051430; Tue, 16 Jun 2020 20:23:58 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162023.05GKNw2e051430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362238 - stable/12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 362238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:23:58 -0000 Author: manu Date: Tue Jun 16 20:23:57 2020 New Revision: 362238 URL: https://svnweb.freebsd.org/changeset/base/362238 Log: MFC r346683: bsdinstall: up the interface before calling dhclient Modified: stable/12/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Tue Jun 16 20:22:56 2020 (r362237) +++ stable/12/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Tue Jun 16 20:23:57 2020 (r362238) @@ -49,6 +49,7 @@ esac dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 if [ $? -eq $DIALOG_OK ]; then if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then + ifconfig $INTERFACE up dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 err=$( dhclient $INTERFACE 2>&1 ) if [ $? -ne 0 ]; then From owner-svn-src-all@freebsd.org Tue Jun 16 20:35:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9752E33338B; Tue, 16 Jun 2020 20:35:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mg1J3WQpz4fGL; Tue, 16 Jun 2020 20:35:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73C5B14E42; Tue, 16 Jun 2020 20:35:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKZ0hP057422; Tue, 16 Jun 2020 20:35:00 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKZ0hH057421; Tue, 16 Jun 2020 20:35:00 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006162035.05GKZ0hH057421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 16 Jun 2020 20:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362239 - head/stand/i386/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/common X-SVN-Commit-Revision: 362239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:35:00 -0000 Author: tsoome Date: Tue Jun 16 20:35:00 2020 New Revision: 362239 URL: https://svnweb.freebsd.org/changeset/base/362239 Log: boot2: need to expand tab output and mask getchar The BIOS ouput char function does not expand tab. Mask getchar with 0xFF. Sponsored by: Netflix, Klara Inc. Modified: head/stand/i386/common/cons.c Modified: head/stand/i386/common/cons.c ============================================================================== --- head/stand/i386/common/cons.c Tue Jun 16 20:23:57 2020 (r362238) +++ head/stand/i386/common/cons.c Tue Jun 16 20:35:00 2020 (r362239) @@ -53,12 +53,38 @@ xputc(int c) sio_putc(c); } +static void +getcursor(int *row, int *col) +{ + v86.ctl = V86_FLAGS; + v86.addr = 0x10; + v86.eax = 0x300; + v86.ebx = 0x7; + v86int(); + + if (row != NULL) + *row = v86.edx >> 8; + if (col != NULL) + *col = v86.edx & 0xff; +} + void putchar(int c) { + int i, col; - if (c == '\n') + switch (c) { + case '\n': xputc('\r'); + break; + case '\t': + col = 0; + getcursor(NULL, &col); + col = 8 - (col % 8); + for (i = 0; i < col; i++) + xputc(' '); + return; + } xputc(c); } @@ -100,7 +126,7 @@ int getchar(void) { - return (xgetc(0)); + return (xgetc(0) & 0xff); } int From owner-svn-src-all@freebsd.org Tue Jun 16 20:35:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF9CB332EE0; Tue, 16 Jun 2020 20:35:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mg1M3b03z4fWS; Tue, 16 Jun 2020 20:35:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 550021513B; Tue, 16 Jun 2020 20:35:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKZ288057473; Tue, 16 Jun 2020 20:35:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKZ29N057468; Tue, 16 Jun 2020 20:35:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162035.05GKZ29N057468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362240 - in stable/12/sys: arm64/arm64 dev/ahci dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm64/arm64 dev/ahci dev/pci X-SVN-Commit-Revision: 362240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:35:03 -0000 Author: manu Date: Tue Jun 16 20:35:01 2020 New Revision: 362240 URL: https://svnweb.freebsd.org/changeset/base/362240 Log: MFC r347440, r347929-r347930, r349588 r347440: ahci: Check if bus is cache-coherent We do this for FDT systems but not for ACPI ones. Check the presence of the _CCA attribute. Sponsored by: Ampere Computing, LLC Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D20144 r347929: pci: ecam: Do not warn on mismatch of bus_end We cannot know the bus end number before parsing the MCFG table so don't set the bus_end before that. If the MCFG table doesn't exist we will set the configuration base address based on the _CBA value and set the bus_end to the maximal number allowed by PCI. Sponsored by: Ampere Computing, LLC Differential Revision: https://reviews.freebsd.org/D20213 r347930: pci: ecam: Correctly parse memory and IO region When activating a resource do not compare the resource id to the adress. Treat IO region as MEMORY region too. Submitted by: Tuan Phan (Original Version) Sponsored by: Ampere Computing, LLC Differential Revision: https://reviews.freebsd.org/D20214 r349588: arm64: efi: Map memory IO region as device Reviewed by: andrew Sponsored by: Ampere Computing, LLC Modified: stable/12/sys/arm64/arm64/efirt_machdep.c stable/12/sys/dev/ahci/ahci_generic.c stable/12/sys/dev/pci/pci_host_generic.c stable/12/sys/dev/pci/pci_host_generic_acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/efirt_machdep.c Tue Jun 16 20:35:00 2020 (r362239) +++ stable/12/sys/arm64/arm64/efirt_machdep.c Tue Jun 16 20:35:01 2020 (r362240) @@ -208,20 +208,14 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int mode = VM_MEMATTR_WRITE_THROUGH; else if ((p->md_attr & EFI_MD_ATTR_WC) != 0) mode = VM_MEMATTR_WRITE_COMBINING; - else if ((p->md_attr & EFI_MD_ATTR_UC) != 0) + else mode = VM_MEMATTR_DEVICE; - else { - if (bootverbose) - printf("EFI Runtime entry %d mapping " - "attributes unsupported\n", i); - mode = VM_MEMATTR_UNCACHEABLE; - } printf("MAP %lx mode %x pages %lu\n", p->md_phys, mode, p->md_pages); l3_attr = ATTR_DEFAULT | ATTR_IDX(mode) | ATTR_AP(ATTR_AP_RW) | L3_PAGE; - if (mode == VM_MEMATTR_DEVICE) + if (mode == VM_MEMATTR_DEVICE || p->md_attr & EFI_MD_ATTR_XP) l3_attr |= ATTR_UXN | ATTR_PXN; VM_OBJECT_WLOCK(obj_1t1_pt); Modified: stable/12/sys/dev/ahci/ahci_generic.c ============================================================================== --- stable/12/sys/dev/ahci/ahci_generic.c Tue Jun 16 20:35:00 2020 (r362239) +++ stable/12/sys/dev/ahci/ahci_generic.c Tue Jun 16 20:35:01 2020 (r362240) @@ -89,6 +89,7 @@ ahci_fdt_probe(device_t dev) static int ahci_acpi_probe(device_t dev) { + struct ahci_controller *ctlr = device_get_softc(dev); ACPI_HANDLE h; if ((h = acpi_get_handle(dev)) == NULL) @@ -98,6 +99,12 @@ ahci_acpi_probe(device_t dev) pci_get_subclass(dev) == PCIS_STORAGE_SATA && pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) { device_set_desc_copy(dev, "AHCI SATA controller"); + if (ACPI_FAILURE(acpi_GetInteger(h, "_CCA", + &ctlr->dma_coherent))) + ctlr->dma_coherent = 0; + if (bootverbose) + device_printf(dev, "Bus is%s cache-coherent\n", + ctlr->dma_coherent ? "" : " not"); return (BUS_PROBE_DEFAULT); } Modified: stable/12/sys/dev/pci/pci_host_generic.c ============================================================================== --- stable/12/sys/dev/pci/pci_host_generic.c Tue Jun 16 20:35:00 2020 (r362239) +++ stable/12/sys/dev/pci/pci_host_generic.c Tue Jun 16 20:35:01 2020 (r362240) @@ -359,29 +359,30 @@ generic_pcie_activate_resource(device_t dev, device_t switch (type) { case SYS_RES_IOPORT: + case SYS_RES_MEMORY: found = 0; for (i = 0; i < MAX_RANGES_TUPLES; i++) { pci_base = sc->ranges[i].pci_base; phys_base = sc->ranges[i].phys_base; size = sc->ranges[i].size; - if ((rid > pci_base) && (rid < (pci_base + size))) { + if ((rman_get_start(r) >= pci_base) && (rman_get_start(r) < (pci_base + size))) { found = 1; break; } } if (found) { - rman_set_start(r, rman_get_start(r) + phys_base); - rman_set_end(r, rman_get_end(r) + phys_base); + rman_set_start(r, rman_get_start(r) - pci_base + phys_base); + rman_set_end(r, rman_get_end(r) - pci_base + phys_base); res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); } else { device_printf(dev, - "Failed to activate IOPORT resource\n"); + "Failed to activate %s resource\n", + type == SYS_RES_IOPORT ? "IOPORT" : "MEMORY"); res = 0; } break; - case SYS_RES_MEMORY: case SYS_RES_IRQ: res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); Modified: stable/12/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- stable/12/sys/dev/pci/pci_host_generic_acpi.c Tue Jun 16 20:35:00 2020 (r362239) +++ stable/12/sys/dev/pci/pci_host_generic_acpi.c Tue Jun 16 20:35:01 2020 (r362240) @@ -148,8 +148,6 @@ pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *re off = res->Data.Address32.Address.TranslationOffset; break; case ACPI_RESOURCE_TYPE_ADDRESS64: - if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE) - break; min = res->Data.Address64.Address.Minimum; max = res->Data.Address64.Address.Maximum; off = res->Data.Address64.Address.TranslationOffset; @@ -207,11 +205,7 @@ pci_host_acpi_get_ecam_resource(device_t dev) mcfg_entry++; } if (found) { - if (mcfg_entry->EndBusNumber < sc->base.bus_end) { - device_printf(dev, "bus end mismatch! expected %d found %d.\n", - sc->base.bus_end, (int)mcfg_entry->EndBusNumber); - sc->base.bus_end = mcfg_entry->EndBusNumber; - } + sc->base.bus_end = mcfg_entry->EndBusNumber; base = mcfg_entry->Address; } else { device_printf(dev, "MCFG exists, but does not have bus %d-%d\n", @@ -220,9 +214,10 @@ pci_host_acpi_get_ecam_resource(device_t dev) } } else { status = acpi_GetInteger(handle, "_CBA", &val); - if (ACPI_SUCCESS(status)) + if (ACPI_SUCCESS(status)) { base = val; - else + sc->base.bus_end = 255; + } else return (ENXIO); } @@ -259,7 +254,6 @@ pci_host_generic_acpi_attach(device_t dev) device_printf(dev, "No _BBN, using start bus 0\n"); sc->base.bus_start = 0; } - sc->base.bus_end = 255; /* Get PCI Segment (domain) needed for MCFG lookup */ status = acpi_GetInteger(handle, "_SEG", &sc->base.ecam); @@ -297,7 +291,7 @@ pci_host_generic_acpi_attach(device_t dev) continue; /* empty range element */ if (sc->base.ranges[tuple].flags & FLAG_MEM) { error = rman_manage_region(&sc->base.mem_rman, - phys_base, phys_base + size - 1); + pci_base, pci_base + size - 1); } else if (sc->base.ranges[tuple].flags & FLAG_IO) { error = rman_manage_region(&sc->base.io_rman, pci_base + PCI_IO_WINDOW_OFFSET, From owner-svn-src-all@freebsd.org Tue Jun 16 20:36:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED10A333345; Tue, 16 Jun 2020 20:36:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mg2t62DCz4fk9; Tue, 16 Jun 2020 20:36:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA37A152CB; Tue, 16 Jun 2020 20:36:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKaMr6057586; Tue, 16 Jun 2020 20:36:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKaMKp057584; Tue, 16 Jun 2020 20:36:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162036.05GKaMKp057584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362241 - in stable/12/sys: arm64/conf modules/dtb/mv X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm64/conf modules/dtb/mv X-SVN-Commit-Revision: 362241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:36:23 -0000 Author: manu Date: Tue Jun 16 20:36:22 2020 New Revision: 362241 URL: https://svnweb.freebsd.org/changeset/base/362241 Log: MFC r351144: arm64: Add EspressoBin DTB to the build This will compile the espressobin dts to a dtb file and this will be install in /boot/dtb/marvell/ during installkernel. Modified: stable/12/sys/arm64/conf/GENERIC stable/12/sys/modules/dtb/mv/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Tue Jun 16 20:35:01 2020 (r362240) +++ stable/12/sys/arm64/conf/GENERIC Tue Jun 16 20:36:22 2020 (r362241) @@ -308,4 +308,4 @@ options FDT device acpi # DTBs -makeoptions MODULES_EXTRA="dtb/allwinner dtb/rockchip dtb/rpi" +makeoptions MODULES_EXTRA="dtb/allwinner dtb/mv dtb/rockchip dtb/rpi" Modified: stable/12/sys/modules/dtb/mv/Makefile ============================================================================== --- stable/12/sys/modules/dtb/mv/Makefile Tue Jun 16 20:35:01 2020 (r362240) +++ stable/12/sys/modules/dtb/mv/Makefile Tue Jun 16 20:36:22 2020 (r362241) @@ -1,7 +1,13 @@ # $FreeBSD$ # All the dts files for Marvell systems we support. + +.if ${MACHINE_ARCH} == "armv7" DTS= \ armada-388-clearfog.dts \ armada-388-gp.dts +.elif ${MACHINE_ARCH} == "aarch64" +DTS= \ + marvell/armada-3720-espressobin.dts +.endif .include From owner-svn-src-all@freebsd.org Tue Jun 16 20:38:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E5303330E5; Tue, 16 Jun 2020 20:38:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mg5r2r3wz4fxt; Tue, 16 Jun 2020 20:38:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CA27152CC; Tue, 16 Jun 2020 20:38:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKcuMv057737; Tue, 16 Jun 2020 20:38:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKcuPM057736; Tue, 16 Jun 2020 20:38:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162038.05GKcuPM057736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362242 - stable/12/usr.sbin/efibootmgr X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/usr.sbin/efibootmgr X-SVN-Commit-Revision: 362242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:38:56 -0000 Author: manu Date: Tue Jun 16 20:38:55 2020 New Revision: 362242 URL: https://svnweb.freebsd.org/changeset/base/362242 Log: MFC r347441: efibootmgr: Do not add the new boot entry in dry-run is specified While here fix a typo. Sponsored-by: Ampere Computing, LLC Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20212 Modified: stable/12/usr.sbin/efibootmgr/efibootmgr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- stable/12/usr.sbin/efibootmgr/efibootmgr.c Tue Jun 16 20:36:22 2020 (r362241) +++ stable/12/usr.sbin/efibootmgr/efibootmgr.c Tue Jun 16 20:38:55 2020 (r362242) @@ -673,7 +673,7 @@ make_boot_var(const char *label, const char *loader, c lopt_size = create_loadopt(load_opt_buf, MAX_LOADOPT_LEN, load_attrs, dp, llen + klen, label, env, env ? strlen(env) + 1 : 0); if (lopt_size == BAD_LENGTH) - errx(1, "Can't crate loadopt"); + errx(1, "Can't create loadopt"); ret = 0; if (!dry_run) { @@ -684,7 +684,8 @@ make_boot_var(const char *label, const char *loader, c if (ret) err(1, "efi_set_variable"); - add_to_boot_order(bootvar); /* first, still not active */ + if (!dry_run) + add_to_boot_order(bootvar); /* first, still not active */ new_ent = malloc(sizeof(struct entry)); if (new_ent == NULL) err(1, "malloc"); From owner-svn-src-all@freebsd.org Tue Jun 16 20:42:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BFD03334CC; Tue, 16 Jun 2020 20:42:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mg9N1nyXz4g3K; Tue, 16 Jun 2020 20:42:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 390E4152DB; Tue, 16 Jun 2020 20:42:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKg0PU060393; Tue, 16 Jun 2020 20:42:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKg0lw060390; Tue, 16 Jun 2020 20:42:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162042.05GKg0lw060390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362243 - stable/12/sys/dev/extres/regulator X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/extres/regulator X-SVN-Commit-Revision: 362243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:42:00 -0000 Author: manu Date: Tue Jun 16 20:41:59 2020 New Revision: 362243 URL: https://svnweb.freebsd.org/changeset/base/362243 Log: MFC r356487: regulator: fix regnode_method_get_voltage This method is supposed to write the voltage into uvolt and return an errno compatible value. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D23006 Modified: stable/12/sys/dev/extres/regulator/regulator.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/extres/regulator/regulator.c ============================================================================== --- stable/12/sys/dev/extres/regulator/regulator.c Tue Jun 16 20:38:55 2020 (r362242) +++ stable/12/sys/dev/extres/regulator/regulator.c Tue Jun 16 20:41:59 2020 (r362243) @@ -295,8 +295,9 @@ static int regnode_method_get_voltage(struct regnode *regnode, int *uvolt) { - return (regnode->std_param.min_uvolt + - (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2); + *uvolt = regnode->std_param.min_uvolt + + (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2; + return (0); } int From owner-svn-src-all@freebsd.org Tue Jun 16 20:43:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E155333817; Tue, 16 Jun 2020 20:43:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mgCM1t7lz4gKc; Tue, 16 Jun 2020 20:43:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B8B514FF4; Tue, 16 Jun 2020 20:43:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKhhKk063706; Tue, 16 Jun 2020 20:43:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKhhP4063705; Tue, 16 Jun 2020 20:43:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162043.05GKhhP4063705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362244 - stable/12/sys/modules/dtb/rockchip X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/modules/dtb/rockchip X-SVN-Commit-Revision: 362244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:43:43 -0000 Author: manu Date: Tue Jun 16 20:43:42 2020 New Revision: 362244 URL: https://svnweb.freebsd.org/changeset/base/362244 Log: MFC r354117: arm64: rockchip: dts: Build the Khadas board DTS We boot on thoses boards so build them. Submitted by: s199p.wa1k9r@gmail.com Differential Revision: https://reviews.freebsd.org/D22158 Modified: stable/12/sys/modules/dtb/rockchip/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/modules/dtb/rockchip/Makefile ============================================================================== --- stable/12/sys/modules/dtb/rockchip/Makefile Tue Jun 16 20:41:59 2020 (r362243) +++ stable/12/sys/modules/dtb/rockchip/Makefile Tue Jun 16 20:43:42 2020 (r362244) @@ -1,6 +1,9 @@ # $FreeBSD$ DTS= \ + rockchip/rk3399-khadas-edge-captain.dts \ + rockchip/rk3399-khadas-edge.dts \ + rockchip/rk3399-khadas-edge-v.dts \ rockchip/rk3328-rock64.dts \ rockchip/rk3399-rockpro64.dts From owner-svn-src-all@freebsd.org Tue Jun 16 20:44:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57B3133382E; Tue, 16 Jun 2020 20:44:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mgDh1g3bz4gLY; Tue, 16 Jun 2020 20:44:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A6D7151CA; Tue, 16 Jun 2020 20:44:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKiptO063841; Tue, 16 Jun 2020 20:44:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKipqc063840; Tue, 16 Jun 2020 20:44:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006162044.05GKipqc063840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Jun 2020 20:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362245 - stable/12/sys/gnu/dts/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/gnu/dts/riscv X-SVN-Commit-Revision: 362245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:44:52 -0000 Author: manu Date: Tue Jun 16 20:44:51 2020 New Revision: 362245 URL: https://svnweb.freebsd.org/changeset/base/362245 Log: MFC r355324: Import DTS files for riscv from Linux 5.4 Requested by: mhorne Added: stable/12/sys/gnu/dts/riscv/ - copied from r355324, head/sys/gnu/dts/riscv/ Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Tue Jun 16 20:51:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35B243339F5; Tue, 16 Jun 2020 20:51:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mgNK0kknz3Ry6; Tue, 16 Jun 2020 20:51:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F014D154A4; Tue, 16 Jun 2020 20:51:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKpS38065075; Tue, 16 Jun 2020 20:51:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKpSYX065074; Tue, 16 Jun 2020 20:51:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006162051.05GKpSYX065074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 16 Jun 2020 20:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362246 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 362246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:51:29 -0000 Author: rmacklem Date: Tue Jun 16 20:51:28 2020 New Revision: 362246 URL: https://svnweb.freebsd.org/changeset/base/362246 Log: Update VFS_CHECKEXP.9 for the argument changes done by r362158. The arguments for VFS_CHECKEXP() were changed by r362158. Also, the numsecflavors and secflavors arguments were not documented, so add these as well. This is a content change. Modified: head/share/man/man9/VFS_CHECKEXP.9 Modified: head/share/man/man9/VFS_CHECKEXP.9 ============================================================================== --- head/share/man/man9/VFS_CHECKEXP.9 Tue Jun 16 20:44:51 2020 (r362245) +++ head/share/man/man9/VFS_CHECKEXP.9 Tue Jun 16 20:51:28 2020 (r362246) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2010 +.Dd June 16, 2020 .Dt VFS_CHECKEXP 9 .Os .Sh NAME @@ -34,7 +34,13 @@ .In sys/param.h .In sys/mount.h .Ft int -.Fn VFS_CHECKEXP "struct mount *mp" "struct sockaddr *nam" "int *exflagsp" "struct ucred **credanonp" +.Fo VFS_CHECKEXP +.Fa "struct mount *mp" +.Fa "struct sockaddr *nam" +.Fa "uint64_t *exflagsp" +.Fa "struct ucred **credanonp" +.Fa "int *numsecflavor" +.Fa "int *secflavors" .Sh DESCRIPTION The .Fn VFS_CHECKEXP @@ -51,6 +57,11 @@ An mbuf containing the network address of the client. Return parameter for the export flags for this client. .It Fa credanonp Return parameter for the anonymous credentials for this client. +.It Fa numsecflavors +Return value for the number of security flavors for this client. +.It Fa secflavors +Must be an array of size MAXSECFLAVORS, in which the security flavors +for this client are returned. .El .Pp The @@ -71,13 +82,15 @@ structure and the address of the client, .Fa nam , to verify that the client can access this file system. .Sh RETURN VALUES -The export flags and anonymous credentials specific to the client (returned -by +The export flags, anonymous credentials and security flavors specific to the +client (returned by .Xr vfs_export_lookup 9 ) will be returned in -.Fa *exflagsp +.Fa *exflagsp , +.Fa *credanonp , +.Fa *numsecflavors and -.Fa *credanonp . +.Fa *secflavors . .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_FHTOVP 9 , From owner-svn-src-all@freebsd.org Tue Jun 16 20:55:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9472A333CF9; Tue, 16 Jun 2020 20:55:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mgSq3MhYz3SS5; Tue, 16 Jun 2020 20:55:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A69914E70; Tue, 16 Jun 2020 20:55:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GKtNEM070131; Tue, 16 Jun 2020 20:55:23 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GKtN9P070130; Tue, 16 Jun 2020 20:55:23 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006162055.05GKtN9P070130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 16 Jun 2020 20:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362247 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 362247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 20:55:23 -0000 Author: rmacklem Date: Tue Jun 16 20:55:22 2020 New Revision: 362247 URL: https://svnweb.freebsd.org/changeset/base/362247 Log: Add an entry for r362158, r362163, which changes struct export_args. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue Jun 16 20:51:28 2020 (r362246) +++ head/RELNOTES Tue Jun 16 20:55:22 2020 (r362247) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r362158, r362163: + struct export_args has changed so that the "user" specified for + the -maproot and -mapall exports(5) options may be in more than + 16 groups. + r361884: sed(1) has learned about hex escapes (e.g. \x27) and will now do the right thing with them, removing the need for printf magic or obnoxious From owner-svn-src-all@freebsd.org Tue Jun 16 21:07:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29EDD3349B1; Tue, 16 Jun 2020 21:07:52 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mglD05nJz3Tg6; Tue, 16 Jun 2020 21:07:52 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2D70154DE; Tue, 16 Jun 2020 21:07:51 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GL7piw076376; Tue, 16 Jun 2020 21:07:51 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GL7pVt076375; Tue, 16 Jun 2020 21:07:51 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <202006162107.05GL7pVt076375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 16 Jun 2020 21:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362248 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: pluknet X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 362248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 21:07:52 -0000 Author: pluknet Date: Tue Jun 16 21:07:51 2020 New Revision: 362248 URL: https://svnweb.freebsd.org/changeset/base/362248 Log: Complete a function block with Fc, no content change. Notably, unbreaks rendering with groff. Modified: head/share/man/man9/VFS_CHECKEXP.9 Modified: head/share/man/man9/VFS_CHECKEXP.9 ============================================================================== --- head/share/man/man9/VFS_CHECKEXP.9 Tue Jun 16 20:55:22 2020 (r362247) +++ head/share/man/man9/VFS_CHECKEXP.9 Tue Jun 16 21:07:51 2020 (r362248) @@ -41,6 +41,7 @@ .Fa "struct ucred **credanonp" .Fa "int *numsecflavor" .Fa "int *secflavors" +.Fc .Sh DESCRIPTION The .Fn VFS_CHECKEXP From owner-svn-src-all@freebsd.org Tue Jun 16 21:23:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2387335418; Tue, 16 Jun 2020 21:23:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mh5R4HWHz3VTn; Tue, 16 Jun 2020 21:23:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E50415C81; Tue, 16 Jun 2020 21:23:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GLNdbR088573; Tue, 16 Jun 2020 21:23:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GLNdVw088572; Tue, 16 Jun 2020 21:23:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006162123.05GLNdVw088572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Jun 2020 21:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362249 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 362249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 21:23:39 -0000 Author: kib Date: Tue Jun 16 21:23:39 2020 New Revision: 362249 URL: https://svnweb.freebsd.org/changeset/base/362249 Log: Systematically pass RTLD_LO_TRACE to load_needed_objects(). Which makes all calls to load_object() to observe the flag, except the calls for preloaded DSOs. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jun 16 21:07:51 2020 (r362248) +++ head/libexec/rtld-elf/rtld.c Tue Jun 16 21:23:39 2020 (r362249) @@ -721,7 +721,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr preload_tail = globallist_curr(TAILQ_LAST(&obj_list, obj_entry_q)); dbg("loading needed objects"); - if (load_needed_objects(obj_main, 0) == -1) + if (load_needed_objects(obj_main, ld_tracing != NULL ? RTLD_LO_TRACE : + 0) == -1) rtld_die(); /* Make a list of all objects loaded at startup. */ @@ -3472,7 +3473,7 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref } if (result != -1) result = load_needed_objects(obj, lo_flags & (RTLD_LO_DLOPEN | - RTLD_LO_EARLY | RTLD_LO_IGNSTLS)); + RTLD_LO_EARLY | RTLD_LO_IGNSTLS | RTLD_LO_TRACE)); init_dag(obj); ref_dag(obj); if (result != -1) From owner-svn-src-all@freebsd.org Tue Jun 16 21:25:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 798F33351E2; Tue, 16 Jun 2020 21:25:43 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) by mx1.freebsd.org (Postfix) with ESMTP id 49mh7q0z3kz3Vq4; Tue, 16 Jun 2020 21:25:42 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id 2CD1A16054; Tue, 16 Jun 2020 23:18:32 +0200 (CEST) Date: Tue, 16 Jun 2020 23:18:32 +0200 From: Steffen Nurpmeso To: Rick Macklem Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362246 - head/share/man/man9 Message-ID: <20200616211832.XaaRx%steffen@sdaoden.eu> In-Reply-To: <202006162051.05GKpSYX065074@repo.freebsd.org> References: <202006162051.05GKpSYX065074@repo.freebsd.org> Mail-Followup-To: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org User-Agent: s-nail v14.9.19-60-g74aff022 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 49mh7q0z3kz3Vq4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 21:25:43 -0000 Hello. I seem to have nothing else to do but looking at trivial commits. Sorry for that. Rick Macklem wrote in <202006162051.05GKpSYX065074@repo.freebsd.org>: |Author: rmacklem |Date: Tue Jun 16 20:51:28 2020 |New Revision: 362246 |URL: https://svnweb.freebsd.org/changeset/base/362246 | |Log: | Update VFS_CHECKEXP.9 for the argument changes done by r362158. ... | This is a content change. ... |+++ head/share/man/man9/VFS_CHECKEXP.9 Tue Jun 16 20:51:28 2020 \ ... |-.Fn VFS_CHECKEXP "struct mount *mp" "struct sockaddr *nam" "int *exflag\ |sp" "struct ucred **credanonp" |+.Fo VFS_CHECKEXP |+.Fa "struct mount *mp" |+.Fa "struct sockaddr *nam" |+.Fa "uint64_t *exflagsp" |+.Fa "struct ucred **credanonp" |+.Fa "int *numsecflavor" |+.Fa "int *secflavors" .Fo needs .Fc. | .Sh DESCRIPTION Ok .Sh resets it all, but .Fo opens and .Fc closes. I currently deal with MusicBrainz data (since that single query alone is not offered via JSON but only via XML, so then all and only XML, yippieh), and i get for something like this not well-formed (invalid token) at line 2, column 2968, byte 3007 at /usr/lib/perl5/site_perl/5.28/linux-thread-multi/XML/Parser.pm line 187. (Caused by a tmux mouse-selection copy and paste problem only, everything all right.) I wonder why mandoc lint does not catch such things. Don't you have git commit hooks which catch that. I mean, i do not, but then i am not a professional ^_^ --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From owner-svn-src-all@freebsd.org Tue Jun 16 21:25:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BED0D3354A4; Tue, 16 Jun 2020 21:25:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mh8649rdz3Vqt; Tue, 16 Jun 2020 21:25:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AAE615AA2; Tue, 16 Jun 2020 21:25:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GLPwdK088741; Tue, 16 Jun 2020 21:25:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GLPw3g088740; Tue, 16 Jun 2020 21:25:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006162125.05GLPw3g088740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Jun 2020 21:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362250 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 362250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 21:25:58 -0000 Author: kib Date: Tue Jun 16 21:25:58 2020 New Revision: 362250 URL: https://svnweb.freebsd.org/changeset/base/362250 Log: rtld: Add debug line for dlopen_object(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jun 16 21:23:39 2020 (r362249) +++ head/libexec/rtld-elf/rtld.c Tue Jun 16 21:25:58 2020 (r362250) @@ -3438,6 +3438,9 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref RtldLockState mlockstate; int result; + dbg("dlopen_object name \"%s\" fd %d refobj \"%s\" lo_flags %#x mode %#x", + name != NULL ? name : "", fd, refobj == NULL ? "" : + refobj->path, lo_flags, mode); objlist_init(&initlist); if (lockstate == NULL && !(lo_flags & RTLD_LO_EARLY)) { From owner-svn-src-all@freebsd.org Tue Jun 16 21:29:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D6B2335411; Tue, 16 Jun 2020 21:29:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mhCf740zz3WFT; Tue, 16 Jun 2020 21:29:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDA7A15476; Tue, 16 Jun 2020 21:29:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GLT2s2089039; Tue, 16 Jun 2020 21:29:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GLT2GM089038; Tue, 16 Jun 2020 21:29:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006162129.05GLT2GM089038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Jun 2020 21:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362251 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 362251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 21:29:03 -0000 Author: kib Date: Tue Jun 16 21:29:02 2020 New Revision: 362251 URL: https://svnweb.freebsd.org/changeset/base/362251 Log: rtld: Allow to load ET_DYN && DF_1_PIE when tracing. This makes old ldd to still work on newer tagged PIE binaries. Also move debug line for hashes before both decisions to not load are done, so that the end of digest_dynamic() processing and reason to not load or load is seen in debug trace. Noted by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jun 16 21:25:58 2020 (r362250) +++ head/libexec/rtld-elf/rtld.c Tue Jun 16 21:29:02 2020 (r362251) @@ -2612,12 +2612,13 @@ do_load_object(int fd, const char *name, char *path, s obj->path = path; if (!digest_dynamic(obj, 0)) goto errp; - if (obj->z_pie) { + dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path, + obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount); + if (obj->z_pie && (flags & RTLD_LO_TRACE) == 0) { + dbg("refusing to load PIE executable \"%s\"", obj->path); _rtld_error("Cannot load PIE binary %s as DSO", obj->path); goto errp; } - dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path, - obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount); if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == RTLD_LO_DLOPEN) { dbg("refusing to load non-loadable \"%s\"", obj->path); From owner-svn-src-all@freebsd.org Tue Jun 16 21:30:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15C593355BD; Tue, 16 Jun 2020 21:30:31 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mhFL6rkfz3WGW; Tue, 16 Jun 2020 21:30:30 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC051158D8; Tue, 16 Jun 2020 21:30:30 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GLUUGQ089196; Tue, 16 Jun 2020 21:30:30 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GLUUJc089194; Tue, 16 Jun 2020 21:30:30 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202006162130.05GLUUJc089194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 16 Jun 2020 21:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362252 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 362252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 21:30:31 -0000 Author: freqlabs Date: Tue Jun 16 21:30:30 2020 New Revision: 362252 URL: https://svnweb.freebsd.org/changeset/base/362252 Log: Apply default security flavor in vfs_export There may be some version of mountd out there that does not supply a default security flavor when none is given for an export. Set the default security flavor in vfs_export if none is given, and remove the workaround for oexport compat. Reported by: npn Reviewed by: rmacklem Approved by: mav (mentor) MFC after: 3 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25300 Modified: head/sys/kern/vfs_export.c head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Tue Jun 16 21:29:02 2020 (r362251) +++ head/sys/kern/vfs_export.c Tue Jun 16 21:30:30 2020 (r362252) @@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); #if defined(INET) || defined(INET6) @@ -303,7 +306,7 @@ vfs_export(struct mount *mp, struct export_args *argp) return (EINVAL); if ((argp->ex_flags & MNT_EXPORTED) != 0 && - (argp->ex_numsecflavors <= 0 + (argp->ex_numsecflavors < 0 || argp->ex_numsecflavors >= MAXSECFLAVORS)) return (EINVAL); @@ -340,6 +343,10 @@ vfs_export(struct mount *mp, struct export_args *argp) MNT_ILOCK(mp); mp->mnt_flag |= MNT_EXPUBLIC; MNT_IUNLOCK(mp); + } + if (argp->ex_numsecflavors == 0) { + argp->ex_numsecflavors = 1; + argp->ex_secflavors[0] = AUTH_SYS; } if ((error = vfs_hang_addrlist(mp, nep, argp))) goto out; Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Jun 16 21:29:02 2020 (r362251) +++ head/sys/kern/vfs_mount.c Tue Jun 16 21:30:30 2020 (r362252) @@ -70,9 +70,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include - #include #include @@ -1131,8 +1128,6 @@ vfs_domount_update( switch (len) { case (sizeof(struct oexport_args)): bzero(&o2export, sizeof(o2export)); - o2export.ex_numsecflavors = 1; - o2export.ex_secflavors[0] = AUTH_SYS; /* FALLTHROUGH */ case (sizeof(o2export)): bcopy(bufp, &o2export, len); From owner-svn-src-all@freebsd.org Tue Jun 16 22:53:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 984693382EA; Tue, 16 Jun 2020 22:53:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mk5c3PSQz3cpJ; Tue, 16 Jun 2020 22:53:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FF201684C; Tue, 16 Jun 2020 22:53:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05GMruNm046201; Tue, 16 Jun 2020 22:53:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05GMruKi046200; Tue, 16 Jun 2020 22:53:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202006162253.05GMruKi046200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 16 Jun 2020 22:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362253 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 362253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 22:53:56 -0000 Author: cem Date: Tue Jun 16 22:53:56 2020 New Revision: 362253 URL: https://svnweb.freebsd.org/changeset/base/362253 Log: vm: Drop vm_map_clip_{start,end} macro wrappers No functional change. Reviewed by: dougm, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25282 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Jun 16 21:30:30 2020 (r362252) +++ head/sys/vm/vm_map.c Tue Jun 16 22:53:56 2020 (r362253) @@ -2377,24 +2377,17 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry) * the specified address; if necessary, * it splits the entry into two. */ -#define vm_map_clip_start(map, entry, startaddr) \ -{ \ - if (startaddr > entry->start) \ - _vm_map_clip_start(map, entry, startaddr); \ -} - -/* - * This routine is called only when it is known that - * the entry must be split. - */ static inline void -_vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) +vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) { vm_map_entry_t new_entry; + if (start <= entry->start) + return; + VM_MAP_ASSERT_LOCKED(map); KASSERT(entry->end > start && entry->start < start, - ("_vm_map_clip_start: invalid clip of entry %p", entry)); + ("%s: invalid clip of entry %p", __func__, entry)); new_entry = vm_map_entry_clone(map, entry); @@ -2435,24 +2428,17 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta * the specified address; if necessary, * it splits the entry into two. */ -#define vm_map_clip_end(map, entry, endaddr) \ -{ \ - if ((endaddr) < (entry->end)) \ - _vm_map_clip_end((map), (entry), (endaddr)); \ -} - -/* - * This routine is called only when it is known that - * the entry must be split. - */ static inline void -_vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) +vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) { vm_map_entry_t new_entry; + if (end >= entry->end) + return; + VM_MAP_ASSERT_LOCKED(map); KASSERT(entry->start < end && entry->end > end, - ("_vm_map_clip_end: invalid clip of entry %p", entry)); + ("%s: invalid clip of entry %p", __func__, entry)); new_entry = vm_map_entry_clone(map, entry); From owner-svn-src-all@freebsd.org Wed Jun 17 01:11:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7F3F33C3A4; Wed, 17 Jun 2020 01:11:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mn8K5kb0z42xx; Wed, 17 Jun 2020 01:11:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFB6718618; Wed, 17 Jun 2020 01:11:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05H1BTIW030931; Wed, 17 Jun 2020 01:11:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05H1BQ9n029244; Wed, 17 Jun 2020 01:11:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202006170111.05H1BQ9n029244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Jun 2020 01:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362254 - in vendor/file/dist: . doc magic magic/Magdir src X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in vendor/file/dist: . doc magic magic/Magdir src X-SVN-Commit-Revision: 362254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 01:11:29 -0000 Author: delphij Date: Wed Jun 17 01:11:26 2020 New Revision: 362254 URL: https://svnweb.freebsd.org/changeset/base/362254 Log: Vendor import of file 5.39. Added: vendor/file/dist/libmagic.pc.in (contents, props changed) vendor/file/dist/magic/Magdir/asf vendor/file/dist/magic/Magdir/dif vendor/file/dist/magic/Magdir/sylk vendor/file/dist/magic/Magdir/unisig vendor/file/dist/magic/Magdir/usd vendor/file/dist/magic/Magdir/web Modified: vendor/file/dist/ChangeLog vendor/file/dist/Makefile.am vendor/file/dist/Makefile.in vendor/file/dist/configure vendor/file/dist/configure.ac vendor/file/dist/doc/file.man vendor/file/dist/doc/magic.man vendor/file/dist/magic/Magdir/animation vendor/file/dist/magic/Magdir/archive vendor/file/dist/magic/Magdir/cad vendor/file/dist/magic/Magdir/commands vendor/file/dist/magic/Magdir/compress vendor/file/dist/magic/Magdir/console vendor/file/dist/magic/Magdir/database vendor/file/dist/magic/Magdir/der vendor/file/dist/magic/Magdir/elf vendor/file/dist/magic/Magdir/filesystems vendor/file/dist/magic/Magdir/games vendor/file/dist/magic/Magdir/gnu vendor/file/dist/magic/Magdir/images vendor/file/dist/magic/Magdir/intel vendor/file/dist/magic/Magdir/kicad vendor/file/dist/magic/Magdir/linux vendor/file/dist/magic/Magdir/msdos vendor/file/dist/magic/Magdir/ole2compounddocs vendor/file/dist/magic/Magdir/parix vendor/file/dist/magic/Magdir/pascal vendor/file/dist/magic/Magdir/pdf vendor/file/dist/magic/Magdir/pgp vendor/file/dist/magic/Magdir/python vendor/file/dist/magic/Magdir/riff vendor/file/dist/magic/Magdir/rst vendor/file/dist/magic/Magdir/rtf vendor/file/dist/magic/Magdir/sgml vendor/file/dist/magic/Magdir/sniffer vendor/file/dist/magic/Magdir/ssh vendor/file/dist/magic/Magdir/ti-8x vendor/file/dist/magic/Magdir/tplink vendor/file/dist/magic/Magdir/troff vendor/file/dist/magic/Magdir/virtual vendor/file/dist/magic/Magdir/windows vendor/file/dist/magic/Magdir/wordprocessors vendor/file/dist/magic/Magdir/zip vendor/file/dist/magic/Makefile.am vendor/file/dist/magic/Makefile.in vendor/file/dist/src/apprentice.c vendor/file/dist/src/ascmagic.c vendor/file/dist/src/buffer.c vendor/file/dist/src/compress.c vendor/file/dist/src/der.c vendor/file/dist/src/file.c vendor/file/dist/src/file.h vendor/file/dist/src/file_opts.h vendor/file/dist/src/funcs.c vendor/file/dist/src/is_json.c vendor/file/dist/src/magic.c vendor/file/dist/src/print.c vendor/file/dist/src/readelf.c vendor/file/dist/src/seccomp.c vendor/file/dist/src/softmagic.c Modified: vendor/file/dist/ChangeLog ============================================================================== --- vendor/file/dist/ChangeLog Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/ChangeLog Wed Jun 17 01:11:26 2020 (r362254) @@ -1,3 +1,83 @@ +2020-06-14 20:02 Christos Zoulas + + * release 5.39 + +2020-06-07 20:00 Christos Zoulas + + * Remove unused subtype_mime (Steve Grubb) + * Remove unused check in okstat (Steve Grubb) + * Fix mime-type in elf binaries by making sure $x is set + * Fix indirect negative offsets broken by OFFNEGATIVE + * Fix GUID equality check + * PR/165: Handle empty array and strings in JSON + * PR/162: Add --exclude-quiet + +2020-06-06 15:33 Christos Zoulas + + * Fix memory leak in ascmagic (Steve Grubb) + +2020-06-04 00:21 Christos Zoulas + + * Fix string comparison length with ignore whitespace + +2020-05-31 00:11 Christos Zoulas + + * Fix mingwin 64 compilation + +2020-05-30 23:56 Christos Zoulas + + * PR/159: whitelist getpid needed for file_pipe2file() + +2020-05-09 18:57 Christos Zoulas + + * Indicate negative offsets with a flag OFFNEGATIVE + so that -0 works. + * Introduce "offset" magic type that can be used to + detect the file size, and bail on short files. + * document DER better in the magic man page. + +2020-03-11 21:53 Christos Zoulas + + * fix memory leaks (SonarQube) + +2020-03-08 21:33 Christos Zoulas + + * fix memory leaks (SonarQube) + * rewrite confusing loops (SonarQube) + * fix bogus test (SonarQube) + * pass a sized buffer to file_fmttime() (SonarQube) + + * fix memory leaks (SonarQube) + +2020-02-20 15:50 Christos Zoulas + + * Don't allow * in printf formats, or the code itself (Christoph Biedl) + * Introduce a printf output size checker to avoid DoS attacks + +2020-02-17 17:22 Christos Zoulas + + * Avoid memory leak on error (oss-fuzz) + * Check length of string on DER before derefercing and add new types + * Add missing DER string (oss-fuzz) + +2020-02-16 20:45 Christos Zoulas + + * Add missing DER types, and debugging + +2020-02-13 13:10 Christos Zoulas + + * PR/140: Avoid abort with hand-crafted magic file (gockelhahn) + * PR/139 Avoid DoS in printf with hand-crafted magic file (gockelhahn) + * PR/138: Avoid crash with hand-crafted magic file (gockelhahn) + +2020-02-12 17:30 Christos Zoulas + + * PR/136: Fix static build by adding a libmagic.pc (Fabrice Fontaine) + +2019-12-24 14:16 Christos Zoulas + + * add guid support + 2019-12-16 21:11 Christos Zoulas * release 5.38 Modified: vendor/file/dist/Makefile.am ============================================================================== --- vendor/file/dist/Makefile.am Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/Makefile.am Wed Jun 17 01:11:26 2020 (r362254) @@ -3,3 +3,8 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = MAINT SUBDIRS = src magic tests doc python + +# This variable must have 'exec' in its name, in order to be installed +# by 'install-exec' target (instead of default 'install-data') +pkgconfigexecdir = $(libdir)/pkgconfig +pkgconfigexec_DATA = libmagic.pc Modified: vendor/file/dist/Makefile.in ============================================================================== --- vendor/file/dist/Makefile.in Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/Makefile.in Wed Jun 17 01:11:26 2020 (r362254) @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -100,7 +101,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cach configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = libmagic.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -129,6 +130,35 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigexecdir)" +DATA = $(pkgconfigexec_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -159,9 +189,10 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ - COPYING ChangeLog INSTALL NEWS README TODO compile \ - config.guess config.sub install-sh ltmain.sh missing +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libmagic.pc.in AUTHORS COPYING ChangeLog INSTALL \ + NEWS README TODO compile config.guess config.sub install-sh \ + ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -328,6 +359,11 @@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = MAINT SUBDIRS = src magic tests doc python + +# This variable must have 'exec' in its name, in order to be installed +# by 'install-exec' target (instead of default 'install-data') +pkgconfigexecdir = $(libdir)/pkgconfig +pkgconfigexec_DATA = libmagic.pc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -380,6 +416,8 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 +libmagic.pc: $(top_builddir)/config.status $(srcdir)/libmagic.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -389,7 +427,28 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt +install-pkgconfigexecDATA: $(pkgconfigexec_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfigexec_DATA)'; test -n "$(pkgconfigexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigexecdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigexecdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigexecdir)" || exit $$?; \ + done +uninstall-pkgconfigexecDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfigexec_DATA)'; test -n "$(pkgconfigexecdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigexecdir)'; $(am__uninstall_files_from_dir) + # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, @@ -689,9 +748,12 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile config.h +all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -750,7 +812,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: +install-exec-am: install-pkgconfigexecDATA install-html: install-html-recursive @@ -790,7 +852,7 @@ ps: ps-recursive ps-am: -uninstall-am: +uninstall-am: uninstall-pkgconfigexecDATA .MAKE: $(am__recursive_targets) all install-am install-strip @@ -804,12 +866,13 @@ uninstall-am: info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am + install-man install-pdf install-pdf-am \ + install-pkgconfigexecDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-pkgconfigexecDATA .PRECIOUS: Makefile Modified: vendor/file/dist/configure ============================================================================== --- vendor/file/dist/configure Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/configure Wed Jun 17 01:11:26 2020 (r362254) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.38. +# Generated by GNU Autoconf 2.69 for file 5.39. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.38' -PACKAGE_STRING='file 5.38' +PACKAGE_VERSION='5.39' +PACKAGE_STRING='file 5.39' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1334,7 +1334,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.38 to adapt to many kinds of systems. +\`configure' configures file 5.39 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1404,7 +1404,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.38:";; + short | recursive ) echo "Configuration of file 5.39:";; esac cat <<\_ACEOF @@ -1524,7 +1524,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.38 +file configure 5.39 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2180,7 +2180,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.38, which was +It was created by file $as_me 5.39, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3046,7 +3046,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.38' + VERSION='5.39' cat >>confdefs.h <<_ACEOF @@ -15167,7 +15167,7 @@ $as_echo "#define XZLIBSUPPORT 1" >>confdefs.h fi -ac_config_files="$ac_config_files Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -15712,7 +15712,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.38, which was +This file was extended by file $as_me 5.39, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15778,7 +15778,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.38 +file config.status 5.39 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16199,6 +16199,7 @@ do "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; + "libmagic.pc") CONFIG_FILES="$CONFIG_FILES libmagic.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac Modified: vendor/file/dist/configure.ac ============================================================================== --- vendor/file/dist/configure.ac Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/configure.ac Wed Jun 17 01:11:26 2020 (r362254) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.38],[christos@astron.com]) +AC_INIT([file],[5.39],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -217,5 +217,5 @@ if test "$ac_cv_header_lzma_h$ac_cv_lib_lzma_lzma_str AC_DEFINE([XZLIBSUPPORT], 1, [Enable xzlib compression support]) fi -AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc]) AC_OUTPUT Modified: vendor/file/dist/doc/file.man ============================================================================== --- vendor/file/dist/doc/file.man Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/doc/file.man Wed Jun 17 01:11:26 2020 (r362254) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.138 2019/10/15 18:00:40 christos Exp $ -.Dd July 13, 2019 +.\" $File: file.man,v 1.140 2020/06/07 17:41:07 christos Exp $ +.Dd June 7, 2020 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -10,6 +10,7 @@ .Bk -words .Op Fl bcdEhiklLNnprsSvzZ0 .Op Fl Fl apple +.Op Fl Fl exclude-quiet .Op Fl Fl extension .Op Fl Fl mime-encoding .Op Fl Fl mime-type @@ -229,6 +230,14 @@ the soft magic method. A synonym for .Sq ascii . .El +.It Fl Fl exclude-quiet +Like +.Fl Fl exclude +but ignore tests that +.Nm +does not know about. +This is intended for compatilibity with older versions of +.Nm . .It Fl Fl extension Print a slash-separated list of valid extensions for the file type found. .It Fl F , Fl Fl separator Ar separator @@ -326,13 +335,13 @@ never read them. Set various parameter limits. .Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent .It Sy "Name" Ta Sy "Default" Ta Sy "Explanation" -.It Li indir Ta 15 Ta recursion limit for indirect magic -.It Li name Ta 30 Ta use count limit for name/use magic +.It Li bytes Ta 1048576 Ta max number of bytes to read from file .It Li elf_notes Ta 256 Ta max ELF notes processed -.It Li elf_phnum Ta 128 Ta max ELF program sections processed +.It Li elf_phnum Ta 2048 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed +.It Li indir Ta 50 Ta recursion limit for indirect magic +.It Li name Ta 50 Ta use count limit for name/use magic .It Li regex Ta 8192 Ta length limit for regex searches -.It Li bytes Ta 1048576 Ta max number of bytes to read from file .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. Modified: vendor/file/dist/doc/magic.man ============================================================================== --- vendor/file/dist/doc/magic.man Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/doc/magic.man Wed Jun 17 01:11:26 2020 (r362254) @@ -1,5 +1,5 @@ -.\" $File: magic.man,v 1.97 2019/11/15 21:03:14 christos Exp $ -.Dd January 21, 2019 +.\" $File: magic.man,v 1.98 2020/05/09 18:55:23 christos Exp $ +.Dd May 9, 2020 .Dt MAGIC __FSECTION__ .Os .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. @@ -300,6 +300,62 @@ This test is always true and clears the match flag for It is intended to be used with the .Dv default test. +.It Dv der +Parse the file as a DER Certificate file. +The test field is used as a der type that needs to be matched. +The DER types are: +.Dv eoc , +.Dv bool , +.Dv int , +.Dv bit_str , +.Dv octet_str , +.Dv null , +.Dv obj_id , +.Dv obj_desc , +.Dv ext , +.Dv real , +.Dv enum , +.Dv embed , +.Dv utf8_str , +.Dv rel_oid , +.Dv time , +.Dv res2 , +.Dv seq , +.Dv set , +.Dv num_str , +.Dv prt_str , +.Dv t61_str , +.Dv vid_str , +.Dv ia5_str , +.Dv utc_time , +.Dv gen_time , +.Dv gr_str , +.Dv vis_str , +.Dv gen_str , +.Dv univ_str , +.Dv char_str , +.Dv bmp_str , +.Dv date , +.Dv tod , +.Dv datetime , +.Dv duration , +.Dv oid-iri , +.Dv rel-oid-iri . +These types can be followed by an optional numeric size, which indicates +the field width in bytes. +.It Dv guid +A Globally Unique Identifier, parsed and printed as +XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. +It's format is a string. +.It Dv offset +This is a quad value indicating the current offset of the file. +It can be used to determine the size of the file or the magic buffer. +For example the magic entries: +.Bd -literal -offset indent +-0 offset x this file is %lld bytes +-0 offset <=100 must be more than 100 \e + bytes and is only %lld +.Ed .El .Pp For compatibility with the Single Added: vendor/file/dist/libmagic.pc.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/file/dist/libmagic.pc.in Wed Jun 17 01:11:26 2020 (r362254) @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmagic +Description: Magic number recognition library +Version: @VERSION@ +Libs: -L${libdir} -lmagic +Libs.private: @LIBS@ Modified: vendor/file/dist/magic/Magdir/animation ============================================================================== --- vendor/file/dist/magic/Magdir/animation Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/magic/Magdir/animation Wed Jun 17 01:11:26 2020 (r362254) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.74 2019/10/29 01:06:20 christos Exp $ +# $File: animation,v 1.77 2020/04/26 15:23:43 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -159,7 +159,7 @@ >8 string mqt \b, Sony / Mobile QuickTime (.MQV) US Pat 7,477,830 !:mime video/quicktime >8 string MSNV \b, MPEG-4 (.MP4) for SonyPSP -!:mime audio/mp4 +!:mime video/mp4 >8 string NDAS \b, MP4 v2 [ISO 14496-14] Nero Digital AAC Audio !:mime audio/mp4 >8 string NDSC \b, MPEG-4 (.MP4) Nero Cinema Profile @@ -854,10 +854,6 @@ >4 byte ^0x01 (DV) movie file >3 byte &0x80 (PAL) >3 byte ^0x80 (NTSC) - -# Microsoft Advanced Streaming Format (ASF) -0 belong 0x3026b275 Microsoft ASF -!:mime video/x-ms-asf # MNG Video Format, 0 string \x8aMNG MNG video data, Modified: vendor/file/dist/magic/Magdir/archive ============================================================================== --- vendor/file/dist/magic/Magdir/archive Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/magic/Magdir/archive Wed Jun 17 01:11:26 2020 (r362254) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.133 2019/11/15 21:03:14 christos Exp $ +# $File: archive,v 1.138 2020/06/07 23:29:26 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -236,7 +236,8 @@ !:ext deb/udeb >14 string -binary Debian binary package !:mime application/vnd.debian.binary-package -!:ext deb/udeb +# For ipk packager see also https://en.wikipedia.org/wiki/Opkg +!:ext deb/udeb/ipk # This should not happen >14 default x Unknown Debian package # NL terminated version; for most Debian cases this is 2.0 or 2.1 for splitted @@ -250,7 +251,16 @@ >>0 search/0x93e4f data.tar. \b, data compression # the above line only works if FILE_BYTES_MAX in ../../src/file.h is raised # for example like libreoffice-dev-doc_1%3a5.2.7-1+rpi1+deb9u3_all.deb ->>>&0 string x %.4s +>>>&0 string x %.2s +# skip space (0x20 BSD) and slash (0x2f System V) character marking end of name +>>>&2 ubyte !0x20 +>>>>&-1 ubyte !0x2f +# display 3rd character of file name extension like 2 of bz2 or m of lzma +>>>>>&-1 ubyte x \b%c +>>>>>>&0 ubyte !0x20 +>>>>>>>&-1 ubyte !0x2f +# display 4th character of file name extension like a of lzma +>>>>>>>>&-1 ubyte x \b%c # splitted debian package case >68 string =2.1\n # dpkg-1.18.25/dpkg-split/info.c @@ -1124,71 +1134,120 @@ # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7) # (mimetype contains "application/vnd.sun.xml.") +# URL: https://en.wikipedia.org/wiki/OpenOffice.org_XML +# reference: http://fileformats.archiveteam.org/wiki/OpenOffice.org_XML >>50 string vnd.sun.xml. OpenOffice.org 1.x >>>62 string writer Writer >>>>68 byte !0x2e document +!:mime application/vnd.sun.xml.writer +!:ext sxw >>>>68 string .template template +!:mime application/vnd.sun.xml.writer.template +!:ext stw +>>>>68 string .web Web template +!:mime application/vnd.sun.xml.writer.web +!:ext stw >>>>68 string .global global document +!:mime application/vnd.sun.xml.writer.global +!:ext sxg >>>62 string calc Calc >>>>66 byte !0x2e spreadsheet +!:mime application/vnd.sun.xml.calc +!:ext sxc >>>>66 string .template template +!:mime application/vnd.sun.xml.calc.template +!:ext stc >>>62 string draw Draw >>>>66 byte !0x2e document +!:mime application/vnd.sun.xml.draw +!:ext sxd >>>>66 string .template template +!:mime application/vnd.sun.xml.draw.template +!:ext std >>>62 string impress Impress >>>>69 byte !0x2e presentation +!:mime application/vnd.sun.xml.impress +!:ext sxi >>>>69 string .template template +!:mime application/vnd.sun.xml.impress.template +!:ext sti >>>62 string math Math document +!:mime application/vnd.sun.xml.math +!:ext sxm >>>62 string base Database file +!:mime application/vnd.sun.xml.base +!:ext sdb # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8) +# URL: http://fileformats.archiveteam.org/wiki/OpenDocument # https://lists.oasis-open.org/archives/office/200505/msg00006.html # (mimetype contains "application/vnd.oasis.opendocument.") >>50 string vnd.oasis.opendocument. OpenDocument >>>73 string text >>>>77 byte !0x2d Text !:mime application/vnd.oasis.opendocument.text +!:ext odt >>>>77 string -template Text Template !:mime application/vnd.oasis.opendocument.text-template +!:ext ott >>>>77 string -web HTML Document Template !:mime application/vnd.oasis.opendocument.text-web +!:ext oth >>>>77 string -master Master Document !:mime application/vnd.oasis.opendocument.text-master +!:ext odm >>>73 string graphics >>>>81 byte !0x2d Drawing !:mime application/vnd.oasis.opendocument.graphics ->>>>81 string -template Template +!:ext odg +>>>>81 string -template Drawing Template !:mime application/vnd.oasis.opendocument.graphics-template +!:ext otg >>>73 string presentation >>>>85 byte !0x2d Presentation !:mime application/vnd.oasis.opendocument.presentation ->>>>85 string -template Template +!:ext odp +>>>>85 string -template Presentation Template !:mime application/vnd.oasis.opendocument.presentation-template +!:ext otp >>>73 string spreadsheet >>>>84 byte !0x2d Spreadsheet !:mime application/vnd.oasis.opendocument.spreadsheet ->>>>84 string -template Template +!:ext ods +>>>>84 string -template Spreadsheet Template !:mime application/vnd.oasis.opendocument.spreadsheet-template +!:ext ots >>>73 string chart >>>>78 byte !0x2d Chart !:mime application/vnd.oasis.opendocument.chart ->>>>78 string -template Template +!:ext odc +>>>>78 string -template Chart Template !:mime application/vnd.oasis.opendocument.chart-template +!:ext otc >>>73 string formula >>>>80 byte !0x2d Formula !:mime application/vnd.oasis.opendocument.formula ->>>>80 string -template Template +!:ext odf +>>>>80 string -template Formula Template !:mime application/vnd.oasis.opendocument.formula-template +!:ext otf +# https://www.loc.gov/preservation/digital/formats/fdd/fdd000441.shtml >>>73 string database Database !:mime application/vnd.oasis.opendocument.database +!:ext odb # Valid for LibreOffice Base 6.0.1.1 at least >>>73 string base Database -!:mime application/vnd.oasis.opendocument.base +# https://bugs.documentfoundation.org/show_bug.cgi?id=45854 +!:mime application/vnd.oasis.opendocument.database +#!:mime application/vnd.oasis.opendocument.base +!:ext odb >>>73 string image >>>>78 byte !0x2d Image !:mime application/vnd.oasis.opendocument.image ->>>>78 string -template Template +!:ext odi +>>>>78 string -template Image Template !:mime application/vnd.oasis.opendocument.image-template +!:ext oti # EPUB (OEBPS) books using OCF (OEBPS Container Format) # https://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4. @@ -1206,12 +1265,33 @@ >>>62 string draw.template+zip Draw template, version 14-16 !:mime application/x-vnd.corel.draw.template+zip !:ext cdrt ->>>62 string zcf.draw.document+zip Draw drawing, version 17-21 +>>>62 string zcf.draw.document+zip Draw drawing, version 17-22 !:mime application/x-vnd.corel.zcf.draw.document+zip !:ext cdr ->>>62 string zcf.draw.template+zip Draw template, version 17-21 +>>>62 string zcf.draw.template+zip Draw template, version 17-22 !:mime application/x-vnd.corel.zcf.draw.template+zip !:ext cdt/cdrt +# URL: http://product.corel.com/help/CorelDRAW/540240626/Main/EN/Doc/CorelDRAW-Other-file-formats.html +>>>62 string zcf.pattern+zip Draw pattern, version 22 +!:mime application/x-vnd.corel.zcf.pattern+zip +!:ext pat +# URL: https://en.wikipedia.org/wiki/Corel_Designer +# Reference: http://fileformats.archiveteam.org/wiki/Corel_Designer +# Note: called by TrID "Corel DESIGN graphics" +>>>62 string designer.document+zip DESIGNER graphics, version 14-16 +!:mime application/x-vnd.corel.designer.document+zip +!:ext des +>>>62 string zcf.designer.document+zip DESIGNER graphics, version 17-21 +!:mime application/x-vnd.corel.zcf.designer.document+zip +!:ext des +# URL: http://product.corel.com/help/CorelDRAW/540223850/Main/EN/Documentation/ +# CorelDRAW-Corel-Symbol-Library-CSL.html +>>>62 string symbol.library+zip Symbol Library, version 6-16.3 +!:mime application/x-vnd.corel.symbol.library+zip +!:ext csl +>>>62 string zcf.symbol.library+zip Symbol Library, version 17-22 +!:mime application/x-vnd.corel.zcf.symbol.library+zip +!:ext csl # Catch other ZIP-with-mimetype formats # In a ZIP file, the bytes immediately after a member's contents are @@ -1239,16 +1319,19 @@ >>>>38 search/64 .app/ iOS App !:mime application/x-ios-app +>30 search/100/b application/epub+zip EPUB document +!:mime application/epub+zip # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) # Next line excludes specialized formats: >(26.s+30) leshort !0xcafe ->>26 string !\x8\0\0\0mimetype Zip archive data +>>30 search/100/b !application/epub+zip +>>>26 string !\x8\0\0\0mimetype Zip archive data !:mime application/zip ->>>4 beshort x \b, at least ->>>4 use zipversion ->>>4 beshort x to extract ->>>0x161 string WINZIP \b, WinZIP self-extracting +>>>>4 beshort x \b, at least +>>>>4 use zipversion +>>>>4 beshort x to extract +>>>>0x161 string WINZIP \b, WinZIP self-extracting # StarView Metafile # From Pierre Ducroquet Added: vendor/file/dist/magic/Magdir/asf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/file/dist/magic/Magdir/asf Wed Jun 17 01:11:26 2020 (r362254) @@ -0,0 +1,132 @@ + +#------------------------------------------------------------------------------ +# $File: asf,v 1.1 2019/12/26 02:07:53 christos Exp $ +# asf: file(1) magic for Microsoft Advanced Systems Format (ASF) files +# http://www.staroceans.org/e-book/ASF_Specification.pdf + +0 name asf-name +# ASF_Data_Object +#>0 guid 75B22636-668E-11CF-A6D9-00AA0062CE6C +#>16 lequad >0 +#>>(16.q) use asf-object +# ASF_Simple_Index_Object +>0 guid 33000890-E5B1-11CF-89F4-00A0C90349CB +>0 guid D6E229D3-35DA-11D1-9034-00A0C90349BE ASF_Index_Object +>0 guid FEB103F8-12AD-4C64-840F-2A1D2F7AD48C ASF_Media_Object_Index_Object +>0 guid 3CB73FD0-0C4A-4803-953D-EDF7B6228F0C ASF_Timecode_Index_Object + +# ASF_File_Properties_Object +>0 guid 8CABDCA1-A947-11CF-8EE4-00C00C205365 + +# ASF_Stream_Properties_Object +>0 guid B7DC0791-A9B7-11CF-8EE6-00C00C205365 +#>>56 lequad x Time Offset %lld +#>>64 lelong x Type-Specicic Data Length %d +#>>68 lelong x Error Correction Data Length %d +#>>72 leshort x Flags 0x%x +#>>74 lelong x Reserved %x +# ASF_Audio_Media +>>24 guid F8699E40-5B4D-11CF-A8FD-00805F5C442B \b, Audio Media ( +>>>78 leshort x \bCodec Id %d +>>>80 leshort x \b, Number of channels %d +>>>82 lelong x \b, Samples Per Second %d +>>>86 lelong x \b, Average Number of Bytes Per Second %d +>>>90 lelong x \b, Block Alignment %d +>>>94 leshort x \b, Bits Per Sample %d +# ASF_Video_Media +>>24 guid BC19EFC0-5B4D-11CF-A8FD-00805F5C442B \b, Video Media ( +>>>78 lelong x \bEncoded Image Width %d +>>>82 lelong x \b, Encoded Image Height %d +#>>>85 leshort x \b, Format Data Size %x +>>>93 lelong x \b, Image Width %d +>>>97 lelong x \b, Image Height %d +#>>>101 leshort x \b, Reserved 0x%x +>>>103 leshort x \b, Bits Per Pixel Count %d +#>>>105 lelong x \b, Compression ID %d +#>>>109 lelong x \b, Image Size %d +#>>>113 lelong x \b, Horizontal Pixels Per Meter %d +#>>>117 lelong x \b, Vertical Pixels Per Meter %d +#>>>121 lelong x \b, Colors Used Count %d +#>>>125 lelong x \b, Important Colors Count %d +>>0 lelong x \b, Error correction type +>>40 use asf-name +>>0 lelong x \b) +#ASF_Header_Extension_Object +>0 guid 5FBF03B5-A92E-11CF-8EE3-00C00C205365 +# ASF_Codec_List_Object +>0 guid 86D15240-311D-11D0-A3A4-00A0C90348F6 +>0 guid 1EFB1A30-0B62-11D0-A39B-00A0C90348F6 ASF_Script_Command_Object +>0 guid F487CD01-A951-11CF-8EE6-00C00C205365 ASF_Marker_Object +>0 guid D6E229DC-35DA-11D1-9034-00A0C90349BE ASF_Bitrate_Mutual_Exclusion_Object +>0 guid 75B22635-668E-11CF-A6D9-00AA0062CE6C ASF_Error_Correction_Object +# ASF_Content_Description_Object +>0 guid 75B22633-668E-11CF-A6D9-00AA0062CE6C +#>>24 leshort title length %d +#>>26 leshort author length %d +#>>28 leshort copyright length %d +#>>30 leshort descriptor length %d +#>>32 leshort rating length %d +>0 guid D2D0A440-E307-11D2-97F0-00A0C95EA850 ASF_Extended_Content_Description_Object +>0 guid 2211B3FA-BD23-11D2-B4B7-00A0C955FC6E ASF_Content_Branding_Object +>0 guid 7BF875CE-468D-11D1-8D82-006097C9A2B2 ASF_Stream_Bitrate_Properties_Object +>0 guid 2211B3FB-BD23-11D2-B4B7-00A0C955FC6E ASF_Content_Encryption_Object +>0 guid 298AE614-2622-4C17-B935-DAE07EE9289C ASF_Extended_Content_Encryption_Object +>0 guid 2211B3FC-BD23-11D2-B4B7-00A0C955FC6E ASF_Digital_Signature_Object +# ASF_Padding_Object +>0 guid 1806D474-CADF-4509-A4BA-9AABCB96AAE8 +>0 guid 14E6A5CB-C672-4332-8399-A96952065B5A ASF_Extended_Stream_Properties_Object +>0 guid A08649CF-4775-4670-8A16-6E35357566CD ASF_Advanced_Mutual_Exclusion_Object +>0 guid D1465A40-5A79-4338-B71B-E36B8FD6C249 ASF_Group_Mutual_Exclusion_Object +>0 guid D4FED15B-88D3-454F-81F0-ED5C45999E24 ASF_Stream_Prioritization_Object +>0 guid A69609E6-517B-11D2-B6AF-00C04FD908E9 ASF_Bandwidth_Sharing_Object +>0 guid 7C4346A9-EFE0-4BFC-B229-393EDE415C85 ASF_Language_List_Object +>0 guid C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA ASF_Metadata_Object +>0 guid 44231C94-9498-49D1-A141-1D134E457054 ASF_Metadata_Library_Object +>0 guid D6E229DF-35DA-11D1-9034-00A0C90349BE ASF_Index_Parameters_Object +>0 guid 6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7 ASF_Media_Object_Index_Parameters_Object +>0 guid F55E496D-9797-4B5D-8C8B-604DFE9BFB24 ASF_Timecode_Index_Parameters_Object +>0 guid 26F18B5D-4584-47EC-9F5F-0E651F0452C9 ASF_Compatibility_Object +>0 guid 43058533-6981-49E6-9B74-AD12CB86D58C ASF_Advanced_Content_Encryption_Object +>0 guid 59DACFC0-59E6-11D0-A3AC-00A0C90348F6 ASF_Command_Media +>0 guid B61BE100-5B4E-11CF-A8FD-00805F5C44 ASF_JFIF_Media +>0 guid 35907DE0-E415-11CF-A917-00805F5C442B ASF_Degradable_JPEG_Media +>0 guid 91BD222C-F21C-497A-8B6D-5AA86BFC0185 ASF_File_Transfer_Media +>0 guid 3AFB65E2-47EF-40F2-AC2C-70A90D71D343 ASF_Binary_Media +>0 guid 776257D4-C627-41CB-8F81-7AC7FF1C40CC ASF_Web_Stream_Media_Subtype +>0 guid DA1E6B13-8359-4050-B398-388E965BF00C ASF_Web_Stream_Format +>0 guid 20FB5700-5B55-11CF-A8FD-00805F5C442B ASF_No_Error_Correction +>0 guid BFC3CD50-618F-11CF-8BB2-00AA00B4E220 ASF_Audio_Spread +>0 guid ABD3D211-A9BA-11cf-8EE6-00C00C205365 ASF_Reserved_1 +>0 guid 7A079BB6-DAA4-4e12-A5CA-91D38DC11A8D ASF_Content_Encryption_System_Windows_Media_DRM +# _Network_Devices +>0 guid 86D15241-311D-11D0-A3A4-00A0C90348F6 ASF_Reserved_2 +>0 guid 4B1ACBE3-100B-11D0-A39B-00A0C90348F6 ASF_Reserved_3 +>0 guid 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB ASF_Reserved_4 +>0 guid D6E22A00-35DA-11D1-9034-00A0C90349BE ASF_Mutex_Language +>0 guid D6E22A01-35DA-11D1-9034-00A0C90349BE ASF_Mutex_Bitrate +>0 guid D6E22A02-35DA-11D1-9034-00A0C90349BE ASF_Mutex_Unknown +>0 guid AF6060AA-5197-11D2-B6AF-00C04FD908E9 ASF_Bandwidth_Sharing_Exclusive +>0 guid AF6060AB-5197-11D2-B6AF-00C04FD908E9 ASF_Bandwidth_Sharing_Partial +>0 guid 399595EC-8667-4E2D-8FDB-98814CE76C1E ASF_Payload_Extension_System_Timecode +>0 guid E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B ASF_Payload_Extension_System_File_Name +>0 guid D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC ASF_Payload_Extension_System_Content_Type +>0 guid 1B1EE554-F9EA-4BC8-821A-376B74E4C4B8 ASF_Payload_Extension_System_Pixel_Aspect_Ratio +>0 guid C6BD9450-867F-4907-83A3-C77921B733AD ASF_Payload_Extension_System_Sample_Duration +>0 guid 6698B84E-0AFA-4330-AEB2-1C0A98D7A44D ASF_Payload_Extension_System_Encryption_Sample_ID +>0 guid 00E1AF06-7BEC-11D1-A582-00C04FC29CFB ASF_Payload_Extension_System_Degradable_JPEG + +0 name asf-object +>0 use asf-name +#>>16 lequad >0 (size %lld) [ +>>16 lequad >0 +>>>(16.q) use asf-object +#>>16 lequad 0 ] + +# Microsoft Advanced Streaming Format (ASF) +0 guid 75B22630-668E-11CF-A6D9-00AA0062CE6C Microsoft ASF +!:mime video/x-ms-asf +#>16 lequad >0 (size %lld +#>>24 lelong x \b, %d header objects) +>16 lequad >0 +>>30 use asf-object +>>(16.q) use asf-object Modified: vendor/file/dist/magic/Magdir/cad ============================================================================== --- vendor/file/dist/magic/Magdir/cad Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/magic/Magdir/cad Wed Jun 17 01:11:26 2020 (r362254) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: cad,v 1.20 2019/08/10 13:34:17 christos Exp $ +# $File: cad,v 1.23 2020/05/30 23:58:07 christos Exp $ # autocad: file(1) magic for cad files # @@ -229,9 +229,13 @@ !:mime image/vnd.dwg 0 string AC1024 DWG AutoDesk AutoCAD 2010/2011/2012 !:mime image/vnd.dwg -0 string AC1027 DWG AutoDesk AutoCAD 2013/2014 +0 string AC1027 DWG AutoDesk AutoCAD 2013-2017 !:mime image/vnd.dwg +# From GNU LibreDWG +0 string AC1032 DWG AutoDesk AutoCAD 2018/2019 +!:mime image/vnd.dwg + # KOMPAS 2D drawing from ASCON # This is KOMPAS 2D drawing or fragment of drawing but is not detailed nor # gathered nor specification @@ -315,3 +319,6 @@ 0 string \xff\xfe\xff\x0e\x53\x00\x6b\x00\x65\x00\x74\x00\x63\x00\x68\x00\x55\x00\x70\x00\x20\x00\x4d\x00\x6f\x00\x64\x00\x65\x00\x6c\x00 SketchUp Model !:mime application/vnd.sketchup.skp !:ext skp + +4 regex/b P[0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9] NAXOS CAD System file from version %s +!:strength +40 Modified: vendor/file/dist/magic/Magdir/commands ============================================================================== --- vendor/file/dist/magic/Magdir/commands Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/magic/Magdir/commands Wed Jun 17 01:11:26 2020 (r362254) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: commands,v 1.61 2019/10/30 03:16:43 christos Exp $ +# $File: commands,v 1.63 2020/06/06 15:36:30 christos Exp $ # commands: file(1) magic for various shells and interpreters # #0 string/w : shell archive or script for antique kernel text @@ -83,6 +83,30 @@ !:mime text/x-shellscript 0 string/wt #!\ /usr/bin/env\ bash Bourne-Again shell script text executable !:mime text/x-shellscript + +# Fish shell magic +# From: Benjamin Lowry +0 string/wt #!\ /usr/local/bin/fish fish shell script text executable +!:mime text/x-shellscript +0 string/wt #!\ /usr/bin/fish fish shell script text executable +!:mime text/x-shellscript +0 string/wt #!\ /usr/bin/env\ fish fish shell script text executable +!:mime text/x-shellscript + + +0 search/1/wt #!\ /usr/bin/tclsh Tcl/Tk script text executable +!:mime text/x-tcl + +0 search/1/wt #!\ /usr/bin/texlua LuaTex script text executable +!:mime text/x-luatex + +0 search/1/wt #!\ /usr/bin/luatex LuaTex script text executable +!:mime text/x-luatex + +0 search/1/wt #!\ /usr/bin/stap Systemtap script text executable +!:mime text/x-systemtap + + # PHP scripts # Ulf Harnhammar Modified: vendor/file/dist/magic/Magdir/compress ============================================================================== --- vendor/file/dist/magic/Magdir/compress Tue Jun 16 22:53:56 2020 (r362253) +++ vendor/file/dist/magic/Magdir/compress Wed Jun 17 01:11:26 2020 (r362254) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: compress,v 1.77 2019/10/08 20:25:13 christos Exp $ +# $File: compress,v 1.79 2020/05/30 23:53:04 christos Exp $ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. @@ -61,7 +61,9 @@ !:mime application/gzip >>>0 use gzip-info # size of the original (uncompressed) input data modulo 2^32 +>>-0 offset >48 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 17 01:11:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C407B33BE65; Wed, 17 Jun 2020 01:11:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mn8g4Vf1z43Df; Wed, 17 Jun 2020 01:11:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B88C1861E; Wed, 17 Jun 2020 01:11:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05H1BlEt032507; Wed, 17 Jun 2020 01:11:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05H1BlPM032506; Wed, 17 Jun 2020 01:11:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202006170111.05H1BlPM032506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Jun 2020 01:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362255 - vendor/file/5.39 X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/file/5.39 X-SVN-Commit-Revision: 362255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 01:11:47 -0000 Author: delphij Date: Wed Jun 17 01:11:47 2020 New Revision: 362255 URL: https://svnweb.freebsd.org/changeset/base/362255 Log: Tag file 5.39. Added: vendor/file/5.39/ - copied from r362254, vendor/file/dist/ From owner-svn-src-all@freebsd.org Wed Jun 17 02:33:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 850CA33F6B5 for ; Wed, 17 Jun 2020 02:33:15 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49mpyf6Zp0z4867 for ; Wed, 17 Jun 2020 02:33:14 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1592361193; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=cENQ5UkAH+EgeXyUuGNppWdKiJnG+7/7bxi6JWAza4UKzINAtw0ofyqlmonM6UL5maYikoJ1O7gx0 VUVW/oylLSLQ0Q9ypq3vtKDwHiOP41FlU6U3hvmn1YFjNKP2g477taL/HwVm+6nmuwA3SdqG45QyYQ LK8QI9OlXyWa2aLyUeB4B54YBrR7n/X4701KSq4OpLosougaNNS93Uu5ul6mmz/EzrZTYcDwkLvGcr CwXx1ZQKtky0ooKJgGe7Bq7LPJ7pvj3SW29VviAT8Rdg50jJ3Wzxku07xgngSHaUd3hbiP5bx0Ox+i o0Qz0zybvxrHJq2NLxHDr7zfmDlbvCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=EgKyVA8g/wjRjCXO+zei1uWV6cKm9YVudzyNbQBjryI=; b=GrALHqOW1ZmWTFyxKCuUF/Exj+wF1HrExVQYZfhkEGCqTxLcr9YWPFlyEP1x8UYYsnIAzlD5ibVRf S/wBQYtivplXeHIdugF9cJSgvMYYpOahKhmuCH2qkVKHvcvyyPJgy35upLjMAEaivpntUk4uKO7BmS uFDq5aBelPrjyHELvJU4Qr6t2Jc38ZzGG+6EwrqTbx9432QjEDH+zbCo8HbFGIqjLb0erRYPxUM6k7 GzHEr9SLU4uQXRZ+A5q+9n3H75cmy7albrsyfggcRZ3YP0ja978M7mBJjkAWNIkMMyvEsoOXPl7XFN /lsZFkqqBTWr4aSti2Po3d9Nr7f7ECw== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=EgKyVA8g/wjRjCXO+zei1uWV6cKm9YVudzyNbQBjryI=; b=EXkvis60u29R46P569aMgqdpZMy+uigYMKiC4nHQFUGRQ7coiwD8Xe1vFGmgV8e38d7ioQSBsAcCC qd2tYZw5icKEze9bQgcnzUMA4Lo8S0Q3L04t8vapU+LorYcr75PFcO9/F8Gjj5Fe8awcwsLFjuK+MT ht0DDtjLn2Q+hjB5+WwwxH11QkOzYva3hWyfnFBalD+h+/MpgHBFIrPKKi1LsY44zuWL++RsVFxniK /RCpv9Q1mBIsMJ36eeczgGd1SR+PHggFmTmALqAVTp9L0d78yYFjvkjbij0saHzfpE0g8C6Os68ezu /zjUDIm6BTQSUCluqL82HvyT3xTIP+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: e307363d-b042-11ea-a067-6d02e42e573a X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id e307363d-b042-11ea-a067-6d02e42e573a; Wed, 17 Jun 2020 02:33:12 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 05H2XALm027670; Tue, 16 Jun 2020 20:33:10 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <8948411d5bb0ab7ffae4c9cba06bda7b8943e0cd.camel@freebsd.org> Subject: Re: svn commit: r362217 - head/stand/common From: Ian Lepore To: Kristof Provost , Ed Maste Cc: Toomas Soome , src-committers , svn-src-all , svn-src-head Date: Tue, 16 Jun 2020 20:33:10 -0600 In-Reply-To: References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49mpyf6Zp0z4867 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 02:33:15 -0000 On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote: > On 16 Jun 2020, at 19:11, Ed Maste wrote: > > On Tue, 16 Jun 2020 at 13:01, Ian Lepore wrote: > > > > > > As much as I prefer doing it this way, style(9) doesn't allow for > > > variable declarations inside a for() statement (or even inside a > > > local > > > block, which is just too 1980s for me, but it is still our standard). > > > > Perhaps it's time to update style(9) to at least permit these uses, as > > we've done with the blank line at the beginning of functions with no > > local variables, and with braces around single-line bodies. > > We have 431 instances of `for (int i` in sys alone. It¢s not so much a > question of allowing it as acknowledging reality at this point. > > Best regards, > Kristof Hmm, so we do. If you weed out sys/contrib, and device drivers contributed by vendors, the number is a lot smaller, but still big enough that we should just change the rules I think. -- Ian From owner-svn-src-all@freebsd.org Wed Jun 17 02:39:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA00B33FCA9 for ; Wed, 17 Jun 2020 02:39:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49mq642hrpz48K4 for ; Wed, 17 Jun 2020 02:39:40 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1592361579; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=sRRyoPHlwv/cq+tq/KXysJLqcXO5mq2Y0DWofFiLDPQACq445ZZO0hnRh/uGWifyQjAVlCfGgd7Kj W+I1ywdO7aHx1+nwYgQ01gHzYIelgCUl7qt3sycsZcXtbXFCPe+qrsSYKcrN+NdfV+QueM73owS+lZ iYwLTAktboweuzYZBE0Z4T3j8Qs7t68btwAcIM5i5Ad1Uh3ZSjzCjsUAXtyH1KDWH31RfNrLMHnF1b 05fJXC8FNZzpV3vaCmlRSdVybzwiw/RDpqgPFQXz+ztk8Ji+w7k/RWGumxkzOhCwnIGbCWpMcat4FW +vYLTGklyo6QmpAyvboTvbdG/7CCaRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=413L/30VUu8RfhaLwbW45QL8tptFqBIxv/TlAtoGqvc=; b=rgr9LEtDIouA9IX7FYluNGXYH1Lz0mHRc3JHtTuVBzAbnJ0A7F4M6nN8Q/3nfXlvhrY8911kfnY2j vIjwMcbldEzNlroZAWN/vAyRwK5PbL4vpuOyr+fDHoOHSP8dxehbHA2uU5bL9M46AzNm2Ve8mp2sAI ZYbpLuHhvqHSl5lAoXaG+pfHTJErvSZnRCy39BbwSKTtBxxWTroh9CY/O3htMwTfdHYlGfhLkeNa5a LcxNrnKy2x+Om6vzfXUYDc4DLFWONPfwICW+AY9/QGeQDGgxRifwjq27sGKCrM57G0Bh/KSnKKfFuj EUg10SE1O0h4dW90iSGiGAGOy628tjQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=413L/30VUu8RfhaLwbW45QL8tptFqBIxv/TlAtoGqvc=; b=m90L8tOA40RZfQlPYAUQRZP7CeKz86rR3TCB3q13Jup0aMsddCHs1k18Fzq+HmIrrGGwBqhHfr55B CxmoP/AzZEX/rHeR9BtH0gEBt3JvrKMHyYJ4BbVKYTgPzVyc/8MUKag8XITh4I8vrAC8QAYhg8IYL+ ihAQp8WJx4F2AZps5lNIYDrwFj8Pa9+xU+JsafEAXAsepQ1wMUbEbMjk5r4Wuw3+pPPTvz0gftIM04 HsERsElyMNkGhIng072rTOZdDX+LAK/RtLUWD0GIdOjCgz6x+j5FiBYzaagg6ug4Z3sZX2qF7Y86Ux XxSTjduPyjRp/0cXIRh/Okm5ZY+j7xg== X-MHO-RoutePath: aGlwcGll X-MHO-User: c8bbdc3f-b043-11ea-a067-6d02e42e573a X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id c8bbdc3f-b043-11ea-a067-6d02e42e573a; Wed, 17 Jun 2020 02:39:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 05H2daah027683; Tue, 16 Jun 2020 20:39:36 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <337eaa72d621d514583c776f70d4a3d1c4a7cf83.camel@freebsd.org> Subject: Re: svn commit: r362217 - head/stand/common From: Ian Lepore To: rgrimes@freebsd.org, Cy Schubert Cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 16 Jun 2020 20:39:36 -0600 In-Reply-To: <202006161730.05GHUc9B082017@gndrsh.dnsmgr.net> References: <202006161730.05GHUc9B082017@gndrsh.dnsmgr.net> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49mq642hrpz48K4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 02:39:40 -0000 On Tue, 2020-06-16 at 10:30 -0700, Rodney W. Grimes wrote: > > In message < > > 55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org>, > > Ian Le > > pore writes: > > > On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote: > > > > Author: tsoome > > > > Date: Tue Jun 16 07:05:03 2020 > > > > New Revision: 362217 > > > > URL: https://svnweb.freebsd.org/changeset/base/362217 > > > > > > > > Log: > > > > loader: variable i is unused without MBR/GPT support built in > > > > > > > > Because i is only used as index in for loop, declare it in > > > > for > > > > statement. > > > > > > > > > > As much as I prefer doing it this way, style(9) doesn't allow for > > > variable declarations inside a for() statement (or even inside a > > > local > > > block, which is just too 1980s for me, but it is still our > > > standard). > > Last time I tried to assert that bit of style(9) with respect to > inside a local block I was over ridden, so it is probably time > to atleast revisit that part of style(9). > > > Doesn't this use stack for a shorter period of time or does the > > compiler > > optimize this, making this change moot? > > > > The tradeoff is a few extra bytes of stack for a longer period of > > time vs a > > few extra instructions incrementing and decrementing the stack > > pointer. > > I do not think the reasoning had to do with stack space vs > instuctions, > but more about being able to clearly know about variable reuse and > not > do it as that can create fun bugs. > > Tools have modernized since that part of style was written. I think a modern compiler will likely emit one of those "declaration of foo here shadows declaration in outer scope" type messages. Not that it should; IMO, part of the point of keeping definitions confined to as local a scope as possible is to help ensure you're using the variable you think you are in that local scope and not accidentally perturbing something used elsewhere. -- Ian From owner-svn-src-all@freebsd.org Wed Jun 17 03:12:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8D453406E0; Wed, 17 Jun 2020 03:12:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mqrC5sF9z4BQR; Wed, 17 Jun 2020 03:12:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C456819D28; Wed, 17 Jun 2020 03:12:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05H3ChCB008033; Wed, 17 Jun 2020 03:12:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05H3ChQB008032; Wed, 17 Jun 2020 03:12:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006170312.05H3ChQB008032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 17 Jun 2020 03:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362256 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 362256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 03:12:44 -0000 Author: adrian Date: Wed Jun 17 03:12:43 2020 New Revision: 362256 URL: https://svnweb.freebsd.org/changeset/base/362256 Log: [run] mention that some 11n functionality is now available. A-MPDU, short-gi and 40MHz mode is currently not supported, but hey, it supports enough 11n to be useful. Modified: head/share/man/man4/run.4 Modified: head/share/man/man4/run.4 ============================================================================== --- head/share/man/man4/run.4 Wed Jun 17 01:11:47 2020 (r362255) +++ head/share/man/man4/run.4 Wed Jun 17 03:12:43 2020 (r362256) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2018 +.Dd June 16, 2020 .Dt RUN 4 .Os .Sh NAME @@ -251,5 +251,5 @@ driver was written by .Sh CAVEATS The .Nm -driver does not support any of the 802.11n capabilities offered by the +driver supports some of the 11n capabilities found in the RT2800, RT3000 and RT3900 chipsets. From owner-svn-src-all@freebsd.org Wed Jun 17 03:16:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AFFE34036C; Wed, 17 Jun 2020 03:16:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mqwP29nbz4BRP; Wed, 17 Jun 2020 03:16:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45E9419F13; Wed, 17 Jun 2020 03:16:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05H3GLx6008234; Wed, 17 Jun 2020 03:16:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05H3GLjK008233; Wed, 17 Jun 2020 03:16:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006170316.05H3GLjK008233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 17 Jun 2020 03:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362257 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 362257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 03:16:21 -0000 Author: adrian Date: Wed Jun 17 03:16:20 2020 New Revision: 362257 URL: https://svnweb.freebsd.org/changeset/base/362257 Log: [ath] Mention DWDS, expresscard and minipcie. I use all of these.. Modified: head/share/man/man4/ath.4 Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Wed Jun 17 03:12:43 2020 (r362256) +++ head/share/man/man4/ath.4 Wed Jun 17 03:16:20 2020 (r362257) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd January 25, 2019 +.Dd June 16, 2020 .Dt ATH 4 .Os .Sh NAME @@ -59,10 +59,10 @@ The driver provides support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs. These APIs are used by a wide variety of chips; most all chips with -a PCI and/or CardBus interface are supported. +a PCI, PCIe and/or CardBus interface are supported. .Pp Supported features include 802.11 and 802.3 frames, power management, BSS, -IBSS, MBSS, TDMA, and host-based access point operation modes. +IBSS, MBSS, WDS/DWDS TDMA, and host-based access point operation modes. All host/device interaction is via DMA. .Pp Please note that from FreeBSD-9.0, the @@ -147,12 +147,13 @@ For more information on configuring this device, see .Pp Devices supported by the .Nm -driver come in either Cardbus or mini-PCI packages. -Wireless cards in Cardbus slots may be inserted and ejected on the fly. +driver come in Cardbus, ExpressCard, Mini-PCI and Mini-PCIe packages. +Wireless cards in Cardbus and ExpressCard slots may be inserted and +ejected on the fly. .Sh HARDWARE The .Nm -driver supports all Atheros Cardbus and PCI cards, +driver supports all Atheros Cardbus, ExpressCard, PCI and PCIe cards, except those that are based on the AR5005VL chipset. .Sh EXAMPLES Join a specific BSS network with WEP encryption: @@ -292,8 +293,7 @@ device driver first appeared in Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an Intersil PrismGT chip and are not supported by this driver. .Sh BUGS -The driver does not fully enable power-save operation of the chip -in station mode; consequently power use is suboptimal (e.g. on a laptop). +The driver does supports optional station mode power-save operation. .Pp The AR5210 can only do WEP in hardware; consequently hardware assisted WEP is disabled in order to allow software implementations of TKIP and CCMP to From owner-svn-src-all@freebsd.org Wed Jun 17 03:54:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E43E3413A8 for ; Wed, 17 Jun 2020 03:54:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mrlr5xYXz4DW7 for ; Wed, 17 Jun 2020 03:54:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf30.google.com with SMTP id cv17so379613qvb.13 for ; Tue, 16 Jun 2020 20:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u6ySZo3ICappC9OKl9BUe1M7XGf7Ejn8Yhc6ifTE5z0=; b=HBYCcsAp/Q79HY/Xd/Hgl1m2381ltTQQq+LIMUzDiJ15RKuPV8HXqhr+nGxXlzCE0h qCc8XCHjWIqvvenTKGwN4ge11EpkAidWHFurQbzsImXMm2IXeklrdqAEUZX9FNU2/Nj3 iTy1PuIIlPWvUDHNkbC8dHhYK2jxmg0wnu7RBo7+nNjMC7GewlsdAOQipLegFLFKiNtl t2UJdVpyxhyv1QiPbuMmimOWlPktDbMEnuRTJSGbdtw0/8UnenRgrPnLcvTQlUmGIHeq zekVPGoRH9R2KolplUQqzeIM4H+jyOJ9J/aAHPzeEGeZwbzkBIKwnceRBqACnC+lqrtl 7uRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u6ySZo3ICappC9OKl9BUe1M7XGf7Ejn8Yhc6ifTE5z0=; b=HxwYax3lvcl156xxraTVytXfYdLOamaMvhmO22gFiBsT9NcA4YIullc6pUed0l99LP yCb3uPxXtLN0cvfxIxdyWeuE0OiM+PFjdA9cLFEdF8jkJhh8gxbHAwthjXvsXPU09TTN 1qcdtGKeq/zDsRHJ32R+MU7djC4fzDhzM8avWLf1ku8dcvAmm/CRSlzdl7I7SdQplo9F a4pjoK3idU0W54MURooG8RaU/SNGbWLOjolJkhSECVurkiGHo9RZBZnfW0cmT7+pO4i4 l4zI5W51Jw3fksctfm3vM7WLSD+iuWHr08moJjKxC9wbdDRUIkloq8ukKbOmbX/M8/V5 /+hg== X-Gm-Message-State: AOAM531UBhKZtY2jOzkrEKVovP9uQAPMmZ9CcX4EBP8vh0ZapfaONgcE 7OcKbpCb0mW4iwj2MkyfBqCswQ/zUZA5xUF3rvtItw== X-Google-Smtp-Source: ABdhPJwLlHb2kVJGkivZEOD4b79a3IdtY4fg5XwUdZM+/xYlVOgSHn5H+tb6Tstjg1bZ5j0D7EuHxD3/XQIEU+bpP/Y= X-Received: by 2002:a05:6214:17cb:: with SMTP id cu11mr5560517qvb.202.1592366039720; Tue, 16 Jun 2020 20:53:59 -0700 (PDT) MIME-Version: 1.0 References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> <8948411d5bb0ab7ffae4c9cba06bda7b8943e0cd.camel@freebsd.org> In-Reply-To: <8948411d5bb0ab7ffae4c9cba06bda7b8943e0cd.camel@freebsd.org> From: Warner Losh Date: Tue, 16 Jun 2020 21:53:48 -0600 Message-ID: Subject: Re: svn commit: r362217 - head/stand/common To: Ian Lepore Cc: Kristof Provost , Ed Maste , Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49mrlr5xYXz4DW7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=HBYCcsAp; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f30) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.86 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.91)[-0.914]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.76)[-0.756]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.19)[-0.192]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f30:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 03:54:02 -0000 On Tue, Jun 16, 2020 at 8:33 PM Ian Lepore wrote: > On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote: > > On 16 Jun 2020, at 19:11, Ed Maste wrote: > > > On Tue, 16 Jun 2020 at 13:01, Ian Lepore wrote: > > > > > > > > As much as I prefer doing it this way, style(9) doesn't allow for > > > > variable declarations inside a for() statement (or even inside a > > > > local > > > > block, which is just too 1980s for me, but it is still our standard= ). > > > > > > Perhaps it's time to update style(9) to at least permit these uses, a= s > > > we've done with the blank line at the beginning of functions with no > > > local variables, and with braces around single-line bodies. > > > > We have 431 instances of `for (int i` in sys alone. It=E2=80=99s not so= much a > > question of allowing it as acknowledging reality at this point. > > > > Best regards, > > Kristof > > Hmm, so we do. If you weed out sys/contrib, and device drivers > contributed by vendors, the number is a lot smaller, but still big > enough that we should just change the rules I think. > We should definitely just change the rules. There's no point in prohibiting it. Contributors have already voted with their feet diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 4e801bbcbe70..fd23d573eb00 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -592,8 +592,6 @@ not Parts of a .Ic for loop may be left empty. -Do not put declarations -inside blocks unless the routine is unusually complicated. .Bd -literal for (; cnt < 15; cnt++) { stmt1; Although the block doesn't start until { so int i; in the commit technically doesn't violate this rule. We violate it in dozens of other ways than this. Warner From owner-svn-src-all@freebsd.org Wed Jun 17 04:17:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67FE73420AE for ; Wed, 17 Jun 2020 04:17:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49msGN338Cz4FDT for ; Wed, 17 Jun 2020 04:17:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id y1so522011qtv.12 for ; Tue, 16 Jun 2020 21:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/WAvljUKN7xCkvFdbA85nyl41BnO1X02Q2zDbGfEoO4=; b=C8hhhE3S5NvCknjZQdmWKd8SOKu5TVl9HA8QvB1jGgme1O7e3Rgdb7oIledWuUnIIg kyBfndoAVLCxPj/vuOgHnLxDcrOFCItRHYcDhcc1OBlfeMQKO6M5kjjGl0AV4bBa35pi lyADwrkAjvWTAVC9+Ckxo/tNYY1oRXgljUKkkGh5g8UxLEN7imjQGC13NNYDvrq9TpEQ KnnPc51SxAKeNW9GU48DXav2LTtlFuq/NaxbM4L7l+Won642lDN+4vwgDfJ7vYfx96ry KUZ956lULI/iu1S478lew2Z1RTf2HgtsU+uX0M/UJ0g015nEdMScA47BX+A+Unfo47UM +vzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/WAvljUKN7xCkvFdbA85nyl41BnO1X02Q2zDbGfEoO4=; b=NmGFqfr1rQMVHaVgTYptjUAwgPmunirxudNVunqeFI6Vt7Be86dhMSGo82tOv8tKd8 +HZFmbbmZ+j5d82LICj7KRrSJ6nENik+l3AHX2R8PkpyfSB/oFucJP8kfQlN/s29AeHn JfeCx0mgx949Ce0HEs8s1Bqa0uOzwjdvXldSHFlEvnCSisgQ1qNiHVli9ArGegJHXEqb nE9hXrKUIjHnbMY22BbQVQ7z4K3hzM375jdyaLl6OtFCEuX3fcL+6+zyO3x2VJQg0TGj VLZW3lFdIJXOSMyIjWDK3wPdXp8dUqFHmJW5448Av7Q6BNLuvuXfKqxhm5SEX+7ur7wF nDSA== X-Gm-Message-State: AOAM533bUPMMLC6BL/pWJrvhoGDUzzobMjEAfDRVwcYk57xQhhgEDm1y h5FFiCNjTJu6GATrfCSfFsj+/O43Zz0i9AR9cljg8A== X-Google-Smtp-Source: ABdhPJxb8etHLCOEJONXj2aic4dwsgLRbqMSAPcNAJBgUT+cwmJDMJV0v99sHqUV2aJjP4n/G0zH2gnkn+89MppWCT4= X-Received: by 2002:ac8:6f55:: with SMTP id n21mr24529700qtv.175.1592367419431; Tue, 16 Jun 2020 21:16:59 -0700 (PDT) MIME-Version: 1.0 References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> <8948411d5bb0ab7ffae4c9cba06bda7b8943e0cd.camel@freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 16 Jun 2020 22:16:48 -0600 Message-ID: Subject: Re: svn commit: r362217 - head/stand/common To: Ian Lepore Cc: Kristof Provost , Ed Maste , Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49msGN338Cz4FDT X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=C8hhhE3S; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82b) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.72 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.90)[-0.901]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.79)[-0.788]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.03)[-0.035]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82b:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 04:17:01 -0000 On Tue, Jun 16, 2020 at 9:53 PM Warner Losh wrote: > > > On Tue, Jun 16, 2020 at 8:33 PM Ian Lepore wrote: > >> On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote: >> > On 16 Jun 2020, at 19:11, Ed Maste wrote: >> > > On Tue, 16 Jun 2020 at 13:01, Ian Lepore wrote: >> > > > >> > > > As much as I prefer doing it this way, style(9) doesn't allow for >> > > > variable declarations inside a for() statement (or even inside a >> > > > local >> > > > block, which is just too 1980s for me, but it is still our >> standard). >> > > >> > > Perhaps it's time to update style(9) to at least permit these uses, = as >> > > we've done with the blank line at the beginning of functions with no >> > > local variables, and with braces around single-line bodies. >> > >> > We have 431 instances of `for (int i` in sys alone. It=E2=80=99s not s= o much a >> > question of allowing it as acknowledging reality at this point. >> > >> > Best regards, >> > Kristof >> >> Hmm, so we do. If you weed out sys/contrib, and device drivers >> contributed by vendors, the number is a lot smaller, but still big >> enough that we should just change the rules I think. >> > > We should definitely just change the rules. There's no point in > prohibiting it. Contributors have already voted with their feet > > diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 > index 4e801bbcbe70..fd23d573eb00 100644 > --- a/share/man/man9/style.9 > +++ b/share/man/man9/style.9 > @@ -592,8 +592,6 @@ not > Parts of a > .Ic for > loop may be left empty. > -Do not put declarations > -inside blocks unless the routine is unusually complicated. > .Bd -literal > for (; cnt < 15; cnt++) { > stmt1; > > Though the block doesn't start until { so int i; in the commit technicall= y > doesn't violate this rule. We violate it in dozens of other ways than thi= s. > Re-reading the thread, it seems there's a consensus to change. https://reviews.freebsd.org/D25312 > Warner > > > From owner-svn-src-all@freebsd.org Wed Jun 17 07:41:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E20AA3469E2; Wed, 17 Jun 2020 07:41:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mxpM5hxMz4QcS; Wed, 17 Jun 2020 07:41:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A346A1CEDD; Wed, 17 Jun 2020 07:41:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05H7fVMp070238; Wed, 17 Jun 2020 07:41:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05H7fSkG070224; Wed, 17 Jun 2020 07:41:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202006170741.05H7fSkG070224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Jun 2020 07:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362258 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src lib/libmagic X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src lib/libmagic X-SVN-Commit-Revision: 362258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 07:41:31 -0000 Author: delphij Date: Wed Jun 17 07:41:28 2020 New Revision: 362258 URL: https://svnweb.freebsd.org/changeset/base/362258 Log: MFV r362254: file 5.39. MFC after: 2 weeks Added: head/contrib/file/libmagic.pc.in - copied unchanged from r362254, vendor/file/dist/libmagic.pc.in head/contrib/file/magic/Magdir/asf - copied unchanged from r362254, vendor/file/dist/magic/Magdir/asf head/contrib/file/magic/Magdir/dif - copied unchanged from r362254, vendor/file/dist/magic/Magdir/dif head/contrib/file/magic/Magdir/sylk - copied unchanged from r362254, vendor/file/dist/magic/Magdir/sylk head/contrib/file/magic/Magdir/unisig - copied unchanged from r362254, vendor/file/dist/magic/Magdir/unisig head/contrib/file/magic/Magdir/usd - copied unchanged from r362254, vendor/file/dist/magic/Magdir/usd head/contrib/file/magic/Magdir/web - copied unchanged from r362254, vendor/file/dist/magic/Magdir/web Modified: head/contrib/file/ChangeLog head/contrib/file/Makefile.am head/contrib/file/Makefile.in head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/doc/file.man head/contrib/file/doc/magic.man head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/archive head/contrib/file/magic/Magdir/cad head/contrib/file/magic/Magdir/commands head/contrib/file/magic/Magdir/compress head/contrib/file/magic/Magdir/console head/contrib/file/magic/Magdir/database head/contrib/file/magic/Magdir/der head/contrib/file/magic/Magdir/elf head/contrib/file/magic/Magdir/filesystems head/contrib/file/magic/Magdir/games head/contrib/file/magic/Magdir/gnu head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/intel head/contrib/file/magic/Magdir/kicad head/contrib/file/magic/Magdir/linux head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/ole2compounddocs head/contrib/file/magic/Magdir/parix head/contrib/file/magic/Magdir/pascal head/contrib/file/magic/Magdir/pdf head/contrib/file/magic/Magdir/pgp head/contrib/file/magic/Magdir/python head/contrib/file/magic/Magdir/riff head/contrib/file/magic/Magdir/rst head/contrib/file/magic/Magdir/rtf head/contrib/file/magic/Magdir/sgml head/contrib/file/magic/Magdir/sniffer head/contrib/file/magic/Magdir/ssh head/contrib/file/magic/Magdir/ti-8x head/contrib/file/magic/Magdir/tplink head/contrib/file/magic/Magdir/troff head/contrib/file/magic/Magdir/virtual head/contrib/file/magic/Magdir/windows head/contrib/file/magic/Magdir/wordprocessors head/contrib/file/magic/Magdir/zip head/contrib/file/magic/Makefile.am head/contrib/file/magic/Makefile.in head/contrib/file/src/apprentice.c head/contrib/file/src/ascmagic.c head/contrib/file/src/buffer.c head/contrib/file/src/compress.c head/contrib/file/src/der.c head/contrib/file/src/file.c head/contrib/file/src/file.h head/contrib/file/src/file_opts.h head/contrib/file/src/funcs.c head/contrib/file/src/is_json.c head/contrib/file/src/magic.c head/contrib/file/src/print.c head/contrib/file/src/readelf.c head/contrib/file/src/seccomp.c head/contrib/file/src/softmagic.c head/lib/libmagic/Makefile head/lib/libmagic/config.h Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/ChangeLog Wed Jun 17 07:41:28 2020 (r362258) @@ -1,3 +1,83 @@ +2020-06-14 20:02 Christos Zoulas + + * release 5.39 + +2020-06-07 20:00 Christos Zoulas + + * Remove unused subtype_mime (Steve Grubb) + * Remove unused check in okstat (Steve Grubb) + * Fix mime-type in elf binaries by making sure $x is set + * Fix indirect negative offsets broken by OFFNEGATIVE + * Fix GUID equality check + * PR/165: Handle empty array and strings in JSON + * PR/162: Add --exclude-quiet + +2020-06-06 15:33 Christos Zoulas + + * Fix memory leak in ascmagic (Steve Grubb) + +2020-06-04 00:21 Christos Zoulas + + * Fix string comparison length with ignore whitespace + +2020-05-31 00:11 Christos Zoulas + + * Fix mingwin 64 compilation + +2020-05-30 23:56 Christos Zoulas + + * PR/159: whitelist getpid needed for file_pipe2file() + +2020-05-09 18:57 Christos Zoulas + + * Indicate negative offsets with a flag OFFNEGATIVE + so that -0 works. + * Introduce "offset" magic type that can be used to + detect the file size, and bail on short files. + * document DER better in the magic man page. + +2020-03-11 21:53 Christos Zoulas + + * fix memory leaks (SonarQube) + +2020-03-08 21:33 Christos Zoulas + + * fix memory leaks (SonarQube) + * rewrite confusing loops (SonarQube) + * fix bogus test (SonarQube) + * pass a sized buffer to file_fmttime() (SonarQube) + + * fix memory leaks (SonarQube) + +2020-02-20 15:50 Christos Zoulas + + * Don't allow * in printf formats, or the code itself (Christoph Biedl) + * Introduce a printf output size checker to avoid DoS attacks + +2020-02-17 17:22 Christos Zoulas + + * Avoid memory leak on error (oss-fuzz) + * Check length of string on DER before derefercing and add new types + * Add missing DER string (oss-fuzz) + +2020-02-16 20:45 Christos Zoulas + + * Add missing DER types, and debugging + +2020-02-13 13:10 Christos Zoulas + + * PR/140: Avoid abort with hand-crafted magic file (gockelhahn) + * PR/139 Avoid DoS in printf with hand-crafted magic file (gockelhahn) + * PR/138: Avoid crash with hand-crafted magic file (gockelhahn) + +2020-02-12 17:30 Christos Zoulas + + * PR/136: Fix static build by adding a libmagic.pc (Fabrice Fontaine) + +2019-12-24 14:16 Christos Zoulas + + * add guid support + 2019-12-16 21:11 Christos Zoulas * release 5.38 Modified: head/contrib/file/Makefile.am ============================================================================== --- head/contrib/file/Makefile.am Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/Makefile.am Wed Jun 17 07:41:28 2020 (r362258) @@ -3,3 +3,8 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = MAINT SUBDIRS = src magic tests doc python + +# This variable must have 'exec' in its name, in order to be installed +# by 'install-exec' target (instead of default 'install-data') +pkgconfigexecdir = $(libdir)/pkgconfig +pkgconfigexec_DATA = libmagic.pc Modified: head/contrib/file/Makefile.in ============================================================================== --- head/contrib/file/Makefile.in Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/Makefile.in Wed Jun 17 07:41:28 2020 (r362258) @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -100,7 +101,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cach configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = libmagic.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -129,6 +130,35 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigexecdir)" +DATA = $(pkgconfigexec_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -159,9 +189,10 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ - COPYING ChangeLog INSTALL NEWS README TODO compile \ - config.guess config.sub install-sh ltmain.sh missing +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libmagic.pc.in AUTHORS COPYING ChangeLog INSTALL \ + NEWS README TODO compile config.guess config.sub install-sh \ + ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -328,6 +359,11 @@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = MAINT SUBDIRS = src magic tests doc python + +# This variable must have 'exec' in its name, in order to be installed +# by 'install-exec' target (instead of default 'install-data') +pkgconfigexecdir = $(libdir)/pkgconfig +pkgconfigexec_DATA = libmagic.pc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -380,6 +416,8 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 +libmagic.pc: $(top_builddir)/config.status $(srcdir)/libmagic.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -389,7 +427,28 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt +install-pkgconfigexecDATA: $(pkgconfigexec_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfigexec_DATA)'; test -n "$(pkgconfigexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigexecdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigexecdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigexecdir)" || exit $$?; \ + done +uninstall-pkgconfigexecDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfigexec_DATA)'; test -n "$(pkgconfigexecdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigexecdir)'; $(am__uninstall_files_from_dir) + # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, @@ -689,9 +748,12 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile config.h +all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -750,7 +812,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: +install-exec-am: install-pkgconfigexecDATA install-html: install-html-recursive @@ -790,7 +852,7 @@ ps: ps-recursive ps-am: -uninstall-am: +uninstall-am: uninstall-pkgconfigexecDATA .MAKE: $(am__recursive_targets) all install-am install-strip @@ -804,12 +866,13 @@ uninstall-am: info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am + install-man install-pdf install-pdf-am \ + install-pkgconfigexecDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-pkgconfigexecDATA .PRECIOUS: Makefile Modified: head/contrib/file/configure ============================================================================== --- head/contrib/file/configure Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/configure Wed Jun 17 07:41:28 2020 (r362258) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.38. +# Generated by GNU Autoconf 2.69 for file 5.39. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.38' -PACKAGE_STRING='file 5.38' +PACKAGE_VERSION='5.39' +PACKAGE_STRING='file 5.39' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1334,7 +1334,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.38 to adapt to many kinds of systems. +\`configure' configures file 5.39 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1404,7 +1404,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.38:";; + short | recursive ) echo "Configuration of file 5.39:";; esac cat <<\_ACEOF @@ -1524,7 +1524,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.38 +file configure 5.39 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2180,7 +2180,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.38, which was +It was created by file $as_me 5.39, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3046,7 +3046,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.38' + VERSION='5.39' cat >>confdefs.h <<_ACEOF @@ -15167,7 +15167,7 @@ $as_echo "#define XZLIBSUPPORT 1" >>confdefs.h fi -ac_config_files="$ac_config_files Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -15712,7 +15712,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.38, which was +This file was extended by file $as_me 5.39, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15778,7 +15778,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.38 +file config.status 5.39 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16199,6 +16199,7 @@ do "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; + "libmagic.pc") CONFIG_FILES="$CONFIG_FILES libmagic.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac Modified: head/contrib/file/configure.ac ============================================================================== --- head/contrib/file/configure.ac Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/configure.ac Wed Jun 17 07:41:28 2020 (r362258) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.38],[christos@astron.com]) +AC_INIT([file],[5.39],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -217,5 +217,5 @@ if test "$ac_cv_header_lzma_h$ac_cv_lib_lzma_lzma_str AC_DEFINE([XZLIBSUPPORT], 1, [Enable xzlib compression support]) fi -AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc]) AC_OUTPUT Modified: head/contrib/file/doc/file.man ============================================================================== --- head/contrib/file/doc/file.man Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/doc/file.man Wed Jun 17 07:41:28 2020 (r362258) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.138 2019/10/15 18:00:40 christos Exp $ -.Dd July 13, 2019 +.\" $File: file.man,v 1.140 2020/06/07 17:41:07 christos Exp $ +.Dd June 7, 2020 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -10,6 +10,7 @@ .Bk -words .Op Fl bcdEhiklLNnprsSvzZ0 .Op Fl Fl apple +.Op Fl Fl exclude-quiet .Op Fl Fl extension .Op Fl Fl mime-encoding .Op Fl Fl mime-type @@ -229,6 +230,14 @@ the soft magic method. A synonym for .Sq ascii . .El +.It Fl Fl exclude-quiet +Like +.Fl Fl exclude +but ignore tests that +.Nm +does not know about. +This is intended for compatilibity with older versions of +.Nm . .It Fl Fl extension Print a slash-separated list of valid extensions for the file type found. .It Fl F , Fl Fl separator Ar separator @@ -326,13 +335,13 @@ never read them. Set various parameter limits. .Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent .It Sy "Name" Ta Sy "Default" Ta Sy "Explanation" -.It Li indir Ta 15 Ta recursion limit for indirect magic -.It Li name Ta 30 Ta use count limit for name/use magic +.It Li bytes Ta 1048576 Ta max number of bytes to read from file .It Li elf_notes Ta 256 Ta max ELF notes processed -.It Li elf_phnum Ta 128 Ta max ELF program sections processed +.It Li elf_phnum Ta 2048 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed +.It Li indir Ta 50 Ta recursion limit for indirect magic +.It Li name Ta 50 Ta use count limit for name/use magic .It Li regex Ta 8192 Ta length limit for regex searches -.It Li bytes Ta 1048576 Ta max number of bytes to read from file .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. Modified: head/contrib/file/doc/magic.man ============================================================================== --- head/contrib/file/doc/magic.man Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/doc/magic.man Wed Jun 17 07:41:28 2020 (r362258) @@ -1,5 +1,5 @@ -.\" $File: magic.man,v 1.97 2019/11/15 21:03:14 christos Exp $ -.Dd January 21, 2019 +.\" $File: magic.man,v 1.98 2020/05/09 18:55:23 christos Exp $ +.Dd May 9, 2020 .Dt MAGIC __FSECTION__ .Os .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. @@ -300,6 +300,62 @@ This test is always true and clears the match flag for It is intended to be used with the .Dv default test. +.It Dv der +Parse the file as a DER Certificate file. +The test field is used as a der type that needs to be matched. +The DER types are: +.Dv eoc , +.Dv bool , +.Dv int , +.Dv bit_str , +.Dv octet_str , +.Dv null , +.Dv obj_id , +.Dv obj_desc , +.Dv ext , +.Dv real , +.Dv enum , +.Dv embed , +.Dv utf8_str , +.Dv rel_oid , +.Dv time , +.Dv res2 , +.Dv seq , +.Dv set , +.Dv num_str , +.Dv prt_str , +.Dv t61_str , +.Dv vid_str , +.Dv ia5_str , +.Dv utc_time , +.Dv gen_time , +.Dv gr_str , +.Dv vis_str , +.Dv gen_str , +.Dv univ_str , +.Dv char_str , +.Dv bmp_str , +.Dv date , +.Dv tod , +.Dv datetime , +.Dv duration , +.Dv oid-iri , +.Dv rel-oid-iri . +These types can be followed by an optional numeric size, which indicates +the field width in bytes. +.It Dv guid +A Globally Unique Identifier, parsed and printed as +XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. +It's format is a string. +.It Dv offset +This is a quad value indicating the current offset of the file. +It can be used to determine the size of the file or the magic buffer. +For example the magic entries: +.Bd -literal -offset indent +-0 offset x this file is %lld bytes +-0 offset <=100 must be more than 100 \e + bytes and is only %lld +.Ed .El .Pp For compatibility with the Single Copied: head/contrib/file/libmagic.pc.in (from r362254, vendor/file/dist/libmagic.pc.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/file/libmagic.pc.in Wed Jun 17 07:41:28 2020 (r362258, copy of r362254, vendor/file/dist/libmagic.pc.in) @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmagic +Description: Magic number recognition library +Version: @VERSION@ +Libs: -L${libdir} -lmagic +Libs.private: @LIBS@ Modified: head/contrib/file/magic/Magdir/animation ============================================================================== --- head/contrib/file/magic/Magdir/animation Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/magic/Magdir/animation Wed Jun 17 07:41:28 2020 (r362258) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.74 2019/10/29 01:06:20 christos Exp $ +# $File: animation,v 1.77 2020/04/26 15:23:43 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -159,7 +159,7 @@ >8 string mqt \b, Sony / Mobile QuickTime (.MQV) US Pat 7,477,830 !:mime video/quicktime >8 string MSNV \b, MPEG-4 (.MP4) for SonyPSP -!:mime audio/mp4 +!:mime video/mp4 >8 string NDAS \b, MP4 v2 [ISO 14496-14] Nero Digital AAC Audio !:mime audio/mp4 >8 string NDSC \b, MPEG-4 (.MP4) Nero Cinema Profile @@ -854,10 +854,6 @@ >4 byte ^0x01 (DV) movie file >3 byte &0x80 (PAL) >3 byte ^0x80 (NTSC) - -# Microsoft Advanced Streaming Format (ASF) -0 belong 0x3026b275 Microsoft ASF -!:mime video/x-ms-asf # MNG Video Format, 0 string \x8aMNG MNG video data, Modified: head/contrib/file/magic/Magdir/archive ============================================================================== --- head/contrib/file/magic/Magdir/archive Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/magic/Magdir/archive Wed Jun 17 07:41:28 2020 (r362258) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.133 2019/11/15 21:03:14 christos Exp $ +# $File: archive,v 1.138 2020/06/07 23:29:26 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -236,7 +236,8 @@ !:ext deb/udeb >14 string -binary Debian binary package !:mime application/vnd.debian.binary-package -!:ext deb/udeb +# For ipk packager see also https://en.wikipedia.org/wiki/Opkg +!:ext deb/udeb/ipk # This should not happen >14 default x Unknown Debian package # NL terminated version; for most Debian cases this is 2.0 or 2.1 for splitted @@ -250,7 +251,16 @@ >>0 search/0x93e4f data.tar. \b, data compression # the above line only works if FILE_BYTES_MAX in ../../src/file.h is raised # for example like libreoffice-dev-doc_1%3a5.2.7-1+rpi1+deb9u3_all.deb ->>>&0 string x %.4s +>>>&0 string x %.2s +# skip space (0x20 BSD) and slash (0x2f System V) character marking end of name +>>>&2 ubyte !0x20 +>>>>&-1 ubyte !0x2f +# display 3rd character of file name extension like 2 of bz2 or m of lzma +>>>>>&-1 ubyte x \b%c +>>>>>>&0 ubyte !0x20 +>>>>>>>&-1 ubyte !0x2f +# display 4th character of file name extension like a of lzma +>>>>>>>>&-1 ubyte x \b%c # splitted debian package case >68 string =2.1\n # dpkg-1.18.25/dpkg-split/info.c @@ -1124,71 +1134,120 @@ # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7) # (mimetype contains "application/vnd.sun.xml.") +# URL: https://en.wikipedia.org/wiki/OpenOffice.org_XML +# reference: http://fileformats.archiveteam.org/wiki/OpenOffice.org_XML >>50 string vnd.sun.xml. OpenOffice.org 1.x >>>62 string writer Writer >>>>68 byte !0x2e document +!:mime application/vnd.sun.xml.writer +!:ext sxw >>>>68 string .template template +!:mime application/vnd.sun.xml.writer.template +!:ext stw +>>>>68 string .web Web template +!:mime application/vnd.sun.xml.writer.web +!:ext stw >>>>68 string .global global document +!:mime application/vnd.sun.xml.writer.global +!:ext sxg >>>62 string calc Calc >>>>66 byte !0x2e spreadsheet +!:mime application/vnd.sun.xml.calc +!:ext sxc >>>>66 string .template template +!:mime application/vnd.sun.xml.calc.template +!:ext stc >>>62 string draw Draw >>>>66 byte !0x2e document +!:mime application/vnd.sun.xml.draw +!:ext sxd >>>>66 string .template template +!:mime application/vnd.sun.xml.draw.template +!:ext std >>>62 string impress Impress >>>>69 byte !0x2e presentation +!:mime application/vnd.sun.xml.impress +!:ext sxi >>>>69 string .template template +!:mime application/vnd.sun.xml.impress.template +!:ext sti >>>62 string math Math document +!:mime application/vnd.sun.xml.math +!:ext sxm >>>62 string base Database file +!:mime application/vnd.sun.xml.base +!:ext sdb # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8) +# URL: http://fileformats.archiveteam.org/wiki/OpenDocument # https://lists.oasis-open.org/archives/office/200505/msg00006.html # (mimetype contains "application/vnd.oasis.opendocument.") >>50 string vnd.oasis.opendocument. OpenDocument >>>73 string text >>>>77 byte !0x2d Text !:mime application/vnd.oasis.opendocument.text +!:ext odt >>>>77 string -template Text Template !:mime application/vnd.oasis.opendocument.text-template +!:ext ott >>>>77 string -web HTML Document Template !:mime application/vnd.oasis.opendocument.text-web +!:ext oth >>>>77 string -master Master Document !:mime application/vnd.oasis.opendocument.text-master +!:ext odm >>>73 string graphics >>>>81 byte !0x2d Drawing !:mime application/vnd.oasis.opendocument.graphics ->>>>81 string -template Template +!:ext odg +>>>>81 string -template Drawing Template !:mime application/vnd.oasis.opendocument.graphics-template +!:ext otg >>>73 string presentation >>>>85 byte !0x2d Presentation !:mime application/vnd.oasis.opendocument.presentation ->>>>85 string -template Template +!:ext odp +>>>>85 string -template Presentation Template !:mime application/vnd.oasis.opendocument.presentation-template +!:ext otp >>>73 string spreadsheet >>>>84 byte !0x2d Spreadsheet !:mime application/vnd.oasis.opendocument.spreadsheet ->>>>84 string -template Template +!:ext ods +>>>>84 string -template Spreadsheet Template !:mime application/vnd.oasis.opendocument.spreadsheet-template +!:ext ots >>>73 string chart >>>>78 byte !0x2d Chart !:mime application/vnd.oasis.opendocument.chart ->>>>78 string -template Template +!:ext odc +>>>>78 string -template Chart Template !:mime application/vnd.oasis.opendocument.chart-template +!:ext otc >>>73 string formula >>>>80 byte !0x2d Formula !:mime application/vnd.oasis.opendocument.formula ->>>>80 string -template Template +!:ext odf +>>>>80 string -template Formula Template !:mime application/vnd.oasis.opendocument.formula-template +!:ext otf +# https://www.loc.gov/preservation/digital/formats/fdd/fdd000441.shtml >>>73 string database Database !:mime application/vnd.oasis.opendocument.database +!:ext odb # Valid for LibreOffice Base 6.0.1.1 at least >>>73 string base Database -!:mime application/vnd.oasis.opendocument.base +# https://bugs.documentfoundation.org/show_bug.cgi?id=45854 +!:mime application/vnd.oasis.opendocument.database +#!:mime application/vnd.oasis.opendocument.base +!:ext odb >>>73 string image >>>>78 byte !0x2d Image !:mime application/vnd.oasis.opendocument.image ->>>>78 string -template Template +!:ext odi +>>>>78 string -template Image Template !:mime application/vnd.oasis.opendocument.image-template +!:ext oti # EPUB (OEBPS) books using OCF (OEBPS Container Format) # https://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4. @@ -1206,12 +1265,33 @@ >>>62 string draw.template+zip Draw template, version 14-16 !:mime application/x-vnd.corel.draw.template+zip !:ext cdrt ->>>62 string zcf.draw.document+zip Draw drawing, version 17-21 +>>>62 string zcf.draw.document+zip Draw drawing, version 17-22 !:mime application/x-vnd.corel.zcf.draw.document+zip !:ext cdr ->>>62 string zcf.draw.template+zip Draw template, version 17-21 +>>>62 string zcf.draw.template+zip Draw template, version 17-22 !:mime application/x-vnd.corel.zcf.draw.template+zip !:ext cdt/cdrt +# URL: http://product.corel.com/help/CorelDRAW/540240626/Main/EN/Doc/CorelDRAW-Other-file-formats.html +>>>62 string zcf.pattern+zip Draw pattern, version 22 +!:mime application/x-vnd.corel.zcf.pattern+zip +!:ext pat +# URL: https://en.wikipedia.org/wiki/Corel_Designer +# Reference: http://fileformats.archiveteam.org/wiki/Corel_Designer +# Note: called by TrID "Corel DESIGN graphics" +>>>62 string designer.document+zip DESIGNER graphics, version 14-16 +!:mime application/x-vnd.corel.designer.document+zip +!:ext des +>>>62 string zcf.designer.document+zip DESIGNER graphics, version 17-21 +!:mime application/x-vnd.corel.zcf.designer.document+zip +!:ext des +# URL: http://product.corel.com/help/CorelDRAW/540223850/Main/EN/Documentation/ +# CorelDRAW-Corel-Symbol-Library-CSL.html +>>>62 string symbol.library+zip Symbol Library, version 6-16.3 +!:mime application/x-vnd.corel.symbol.library+zip +!:ext csl +>>>62 string zcf.symbol.library+zip Symbol Library, version 17-22 +!:mime application/x-vnd.corel.zcf.symbol.library+zip +!:ext csl # Catch other ZIP-with-mimetype formats # In a ZIP file, the bytes immediately after a member's contents are @@ -1239,16 +1319,19 @@ >>>>38 search/64 .app/ iOS App !:mime application/x-ios-app +>30 search/100/b application/epub+zip EPUB document +!:mime application/epub+zip # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) # Next line excludes specialized formats: >(26.s+30) leshort !0xcafe ->>26 string !\x8\0\0\0mimetype Zip archive data +>>30 search/100/b !application/epub+zip +>>>26 string !\x8\0\0\0mimetype Zip archive data !:mime application/zip ->>>4 beshort x \b, at least ->>>4 use zipversion ->>>4 beshort x to extract ->>>0x161 string WINZIP \b, WinZIP self-extracting +>>>>4 beshort x \b, at least +>>>>4 use zipversion +>>>>4 beshort x to extract +>>>>0x161 string WINZIP \b, WinZIP self-extracting # StarView Metafile # From Pierre Ducroquet Copied: head/contrib/file/magic/Magdir/asf (from r362254, vendor/file/dist/magic/Magdir/asf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/file/magic/Magdir/asf Wed Jun 17 07:41:28 2020 (r362258, copy of r362254, vendor/file/dist/magic/Magdir/asf) @@ -0,0 +1,132 @@ + +#------------------------------------------------------------------------------ +# $File: asf,v 1.1 2019/12/26 02:07:53 christos Exp $ +# asf: file(1) magic for Microsoft Advanced Systems Format (ASF) files +# http://www.staroceans.org/e-book/ASF_Specification.pdf + +0 name asf-name +# ASF_Data_Object +#>0 guid 75B22636-668E-11CF-A6D9-00AA0062CE6C +#>16 lequad >0 +#>>(16.q) use asf-object +# ASF_Simple_Index_Object +>0 guid 33000890-E5B1-11CF-89F4-00A0C90349CB +>0 guid D6E229D3-35DA-11D1-9034-00A0C90349BE ASF_Index_Object +>0 guid FEB103F8-12AD-4C64-840F-2A1D2F7AD48C ASF_Media_Object_Index_Object +>0 guid 3CB73FD0-0C4A-4803-953D-EDF7B6228F0C ASF_Timecode_Index_Object + +# ASF_File_Properties_Object +>0 guid 8CABDCA1-A947-11CF-8EE4-00C00C205365 + +# ASF_Stream_Properties_Object +>0 guid B7DC0791-A9B7-11CF-8EE6-00C00C205365 +#>>56 lequad x Time Offset %lld +#>>64 lelong x Type-Specicic Data Length %d +#>>68 lelong x Error Correction Data Length %d +#>>72 leshort x Flags 0x%x +#>>74 lelong x Reserved %x +# ASF_Audio_Media +>>24 guid F8699E40-5B4D-11CF-A8FD-00805F5C442B \b, Audio Media ( +>>>78 leshort x \bCodec Id %d +>>>80 leshort x \b, Number of channels %d +>>>82 lelong x \b, Samples Per Second %d +>>>86 lelong x \b, Average Number of Bytes Per Second %d +>>>90 lelong x \b, Block Alignment %d +>>>94 leshort x \b, Bits Per Sample %d +# ASF_Video_Media +>>24 guid BC19EFC0-5B4D-11CF-A8FD-00805F5C442B \b, Video Media ( +>>>78 lelong x \bEncoded Image Width %d +>>>82 lelong x \b, Encoded Image Height %d +#>>>85 leshort x \b, Format Data Size %x +>>>93 lelong x \b, Image Width %d +>>>97 lelong x \b, Image Height %d +#>>>101 leshort x \b, Reserved 0x%x +>>>103 leshort x \b, Bits Per Pixel Count %d +#>>>105 lelong x \b, Compression ID %d +#>>>109 lelong x \b, Image Size %d +#>>>113 lelong x \b, Horizontal Pixels Per Meter %d +#>>>117 lelong x \b, Vertical Pixels Per Meter %d +#>>>121 lelong x \b, Colors Used Count %d +#>>>125 lelong x \b, Important Colors Count %d +>>0 lelong x \b, Error correction type +>>40 use asf-name +>>0 lelong x \b) +#ASF_Header_Extension_Object +>0 guid 5FBF03B5-A92E-11CF-8EE3-00C00C205365 +# ASF_Codec_List_Object +>0 guid 86D15240-311D-11D0-A3A4-00A0C90348F6 +>0 guid 1EFB1A30-0B62-11D0-A39B-00A0C90348F6 ASF_Script_Command_Object +>0 guid F487CD01-A951-11CF-8EE6-00C00C205365 ASF_Marker_Object +>0 guid D6E229DC-35DA-11D1-9034-00A0C90349BE ASF_Bitrate_Mutual_Exclusion_Object +>0 guid 75B22635-668E-11CF-A6D9-00AA0062CE6C ASF_Error_Correction_Object +# ASF_Content_Description_Object +>0 guid 75B22633-668E-11CF-A6D9-00AA0062CE6C +#>>24 leshort title length %d +#>>26 leshort author length %d +#>>28 leshort copyright length %d +#>>30 leshort descriptor length %d +#>>32 leshort rating length %d +>0 guid D2D0A440-E307-11D2-97F0-00A0C95EA850 ASF_Extended_Content_Description_Object +>0 guid 2211B3FA-BD23-11D2-B4B7-00A0C955FC6E ASF_Content_Branding_Object +>0 guid 7BF875CE-468D-11D1-8D82-006097C9A2B2 ASF_Stream_Bitrate_Properties_Object +>0 guid 2211B3FB-BD23-11D2-B4B7-00A0C955FC6E ASF_Content_Encryption_Object +>0 guid 298AE614-2622-4C17-B935-DAE07EE9289C ASF_Extended_Content_Encryption_Object +>0 guid 2211B3FC-BD23-11D2-B4B7-00A0C955FC6E ASF_Digital_Signature_Object +# ASF_Padding_Object +>0 guid 1806D474-CADF-4509-A4BA-9AABCB96AAE8 +>0 guid 14E6A5CB-C672-4332-8399-A96952065B5A ASF_Extended_Stream_Properties_Object +>0 guid A08649CF-4775-4670-8A16-6E35357566CD ASF_Advanced_Mutual_Exclusion_Object +>0 guid D1465A40-5A79-4338-B71B-E36B8FD6C249 ASF_Group_Mutual_Exclusion_Object +>0 guid D4FED15B-88D3-454F-81F0-ED5C45999E24 ASF_Stream_Prioritization_Object +>0 guid A69609E6-517B-11D2-B6AF-00C04FD908E9 ASF_Bandwidth_Sharing_Object +>0 guid 7C4346A9-EFE0-4BFC-B229-393EDE415C85 ASF_Language_List_Object +>0 guid C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA ASF_Metadata_Object +>0 guid 44231C94-9498-49D1-A141-1D134E457054 ASF_Metadata_Library_Object +>0 guid D6E229DF-35DA-11D1-9034-00A0C90349BE ASF_Index_Parameters_Object +>0 guid 6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7 ASF_Media_Object_Index_Parameters_Object +>0 guid F55E496D-9797-4B5D-8C8B-604DFE9BFB24 ASF_Timecode_Index_Parameters_Object +>0 guid 26F18B5D-4584-47EC-9F5F-0E651F0452C9 ASF_Compatibility_Object +>0 guid 43058533-6981-49E6-9B74-AD12CB86D58C ASF_Advanced_Content_Encryption_Object +>0 guid 59DACFC0-59E6-11D0-A3AC-00A0C90348F6 ASF_Command_Media +>0 guid B61BE100-5B4E-11CF-A8FD-00805F5C44 ASF_JFIF_Media +>0 guid 35907DE0-E415-11CF-A917-00805F5C442B ASF_Degradable_JPEG_Media +>0 guid 91BD222C-F21C-497A-8B6D-5AA86BFC0185 ASF_File_Transfer_Media +>0 guid 3AFB65E2-47EF-40F2-AC2C-70A90D71D343 ASF_Binary_Media +>0 guid 776257D4-C627-41CB-8F81-7AC7FF1C40CC ASF_Web_Stream_Media_Subtype +>0 guid DA1E6B13-8359-4050-B398-388E965BF00C ASF_Web_Stream_Format +>0 guid 20FB5700-5B55-11CF-A8FD-00805F5C442B ASF_No_Error_Correction +>0 guid BFC3CD50-618F-11CF-8BB2-00AA00B4E220 ASF_Audio_Spread +>0 guid ABD3D211-A9BA-11cf-8EE6-00C00C205365 ASF_Reserved_1 +>0 guid 7A079BB6-DAA4-4e12-A5CA-91D38DC11A8D ASF_Content_Encryption_System_Windows_Media_DRM +# _Network_Devices +>0 guid 86D15241-311D-11D0-A3A4-00A0C90348F6 ASF_Reserved_2 +>0 guid 4B1ACBE3-100B-11D0-A39B-00A0C90348F6 ASF_Reserved_3 +>0 guid 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB ASF_Reserved_4 +>0 guid D6E22A00-35DA-11D1-9034-00A0C90349BE ASF_Mutex_Language +>0 guid D6E22A01-35DA-11D1-9034-00A0C90349BE ASF_Mutex_Bitrate +>0 guid D6E22A02-35DA-11D1-9034-00A0C90349BE ASF_Mutex_Unknown +>0 guid AF6060AA-5197-11D2-B6AF-00C04FD908E9 ASF_Bandwidth_Sharing_Exclusive +>0 guid AF6060AB-5197-11D2-B6AF-00C04FD908E9 ASF_Bandwidth_Sharing_Partial +>0 guid 399595EC-8667-4E2D-8FDB-98814CE76C1E ASF_Payload_Extension_System_Timecode +>0 guid E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B ASF_Payload_Extension_System_File_Name +>0 guid D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC ASF_Payload_Extension_System_Content_Type +>0 guid 1B1EE554-F9EA-4BC8-821A-376B74E4C4B8 ASF_Payload_Extension_System_Pixel_Aspect_Ratio +>0 guid C6BD9450-867F-4907-83A3-C77921B733AD ASF_Payload_Extension_System_Sample_Duration +>0 guid 6698B84E-0AFA-4330-AEB2-1C0A98D7A44D ASF_Payload_Extension_System_Encryption_Sample_ID +>0 guid 00E1AF06-7BEC-11D1-A582-00C04FC29CFB ASF_Payload_Extension_System_Degradable_JPEG + +0 name asf-object +>0 use asf-name +#>>16 lequad >0 (size %lld) [ +>>16 lequad >0 +>>>(16.q) use asf-object +#>>16 lequad 0 ] + +# Microsoft Advanced Streaming Format (ASF) +0 guid 75B22630-668E-11CF-A6D9-00AA0062CE6C Microsoft ASF +!:mime video/x-ms-asf +#>16 lequad >0 (size %lld +#>>24 lelong x \b, %d header objects) +>16 lequad >0 +>>30 use asf-object +>>(16.q) use asf-object Modified: head/contrib/file/magic/Magdir/cad ============================================================================== --- head/contrib/file/magic/Magdir/cad Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/magic/Magdir/cad Wed Jun 17 07:41:28 2020 (r362258) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: cad,v 1.20 2019/08/10 13:34:17 christos Exp $ +# $File: cad,v 1.23 2020/05/30 23:58:07 christos Exp $ # autocad: file(1) magic for cad files # @@ -229,9 +229,13 @@ !:mime image/vnd.dwg 0 string AC1024 DWG AutoDesk AutoCAD 2010/2011/2012 !:mime image/vnd.dwg -0 string AC1027 DWG AutoDesk AutoCAD 2013/2014 +0 string AC1027 DWG AutoDesk AutoCAD 2013-2017 !:mime image/vnd.dwg +# From GNU LibreDWG +0 string AC1032 DWG AutoDesk AutoCAD 2018/2019 +!:mime image/vnd.dwg + # KOMPAS 2D drawing from ASCON # This is KOMPAS 2D drawing or fragment of drawing but is not detailed nor # gathered nor specification @@ -315,3 +319,6 @@ 0 string \xff\xfe\xff\x0e\x53\x00\x6b\x00\x65\x00\x74\x00\x63\x00\x68\x00\x55\x00\x70\x00\x20\x00\x4d\x00\x6f\x00\x64\x00\x65\x00\x6c\x00 SketchUp Model !:mime application/vnd.sketchup.skp !:ext skp + +4 regex/b P[0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9] NAXOS CAD System file from version %s +!:strength +40 Modified: head/contrib/file/magic/Magdir/commands ============================================================================== --- head/contrib/file/magic/Magdir/commands Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/magic/Magdir/commands Wed Jun 17 07:41:28 2020 (r362258) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: commands,v 1.61 2019/10/30 03:16:43 christos Exp $ +# $File: commands,v 1.63 2020/06/06 15:36:30 christos Exp $ # commands: file(1) magic for various shells and interpreters # #0 string/w : shell archive or script for antique kernel text @@ -83,6 +83,30 @@ !:mime text/x-shellscript 0 string/wt #!\ /usr/bin/env\ bash Bourne-Again shell script text executable !:mime text/x-shellscript + +# Fish shell magic +# From: Benjamin Lowry +0 string/wt #!\ /usr/local/bin/fish fish shell script text executable +!:mime text/x-shellscript +0 string/wt #!\ /usr/bin/fish fish shell script text executable +!:mime text/x-shellscript +0 string/wt #!\ /usr/bin/env\ fish fish shell script text executable +!:mime text/x-shellscript + + +0 search/1/wt #!\ /usr/bin/tclsh Tcl/Tk script text executable +!:mime text/x-tcl + +0 search/1/wt #!\ /usr/bin/texlua LuaTex script text executable +!:mime text/x-luatex + +0 search/1/wt #!\ /usr/bin/luatex LuaTex script text executable +!:mime text/x-luatex + +0 search/1/wt #!\ /usr/bin/stap Systemtap script text executable +!:mime text/x-systemtap + + # PHP scripts # Ulf Harnhammar Modified: head/contrib/file/magic/Magdir/compress ============================================================================== --- head/contrib/file/magic/Magdir/compress Wed Jun 17 03:16:20 2020 (r362257) +++ head/contrib/file/magic/Magdir/compress Wed Jun 17 07:41:28 2020 (r362258) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: compress,v 1.77 2019/10/08 20:25:13 christos Exp $ +# $File: compress,v 1.79 2020/05/30 23:53:04 christos Exp $ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. @@ -61,7 +61,9 @@ !:mime application/gzip >>>0 use gzip-info # size of the original (uncompressed) input data modulo 2^32 +>>-0 offset >48 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 17 07:49:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F490346AD7; Wed, 17 Jun 2020 07:49:13 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mxzD5lNfz4R7C; Wed, 17 Jun 2020 07:49:12 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-qt1-f196.google.com with SMTP id k22so807553qtm.6; Wed, 17 Jun 2020 00:49:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=elif/c+s+TMtSOrr9qADaf5zVTlu8yIJbWM7yz/EmNg=; b=VxnD64K+9I9efICE8l2w4l/3zaddEX6DpUR0KEkwsoBmi6BDOtFtmRgp398irYpRb2 G7Z3/N6iaNb+TQjVn4rXwo7FpYMk3O+Tb5BxjCT5/NfGTBoYv2hbKFzQiwryge3p4MiB 0PWMNVWFhEVC5M79s1hcQC00kZXNm8e3xBD7mI23+Rha879evRS/vpRA2zWPOHadwdye zb1/+WTROhgR7UnpsLKWOB0419Gp1etVrc/fn6q1yLJOv8bKz7+sdL+wAt3Mqeq5xdyY DRubTtVOfFAlnPdn6EjorUMbWAYWwf8NkVH4FZJt/WNinUIrQQdGlFMg+6VNyoeCcJdG 8JWg== X-Gm-Message-State: AOAM531HUAZfwBkwKNS++hl2UHezk/Nz4Zok0BC5IXBCCerQfhDPAgmJ eCQncCXR68lyKr/qLI3aQGRK7M5r8SYd1FOKnhP1h9Ur X-Google-Smtp-Source: ABdhPJxyy+j40u7Xol8xY7KWEKDj7rur+a3eF0DDHL1eqHORV1v6SwLpvFi16UfyiTiQfa9Zoaz/QmOSPRjwpOvUy9U= X-Received: by 2002:ac8:7cc:: with SMTP id m12mr25680428qth.369.1592380151329; Wed, 17 Jun 2020 00:49:11 -0700 (PDT) MIME-Version: 1.0 References: <202006170741.05H7fSkG070224@repo.freebsd.org> In-Reply-To: <202006170741.05H7fSkG070224@repo.freebsd.org> From: Antoine Brodin Date: Wed, 17 Jun 2020 09:49:00 +0200 Message-ID: Subject: Re: svn commit: r362258 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src lib/libmagic To: Xin LI Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49mxzD5lNfz4R7C X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 07:49:13 -0000 On Wed, Jun 17, 2020 at 9:41 AM Xin LI wrote: > > Author: delphij > Date: Wed Jun 17 07:41:28 2020 > New Revision: 362258 > URL: https://svnweb.freebsd.org/changeset/base/362258 > > Log: > MFV r362254: file 5.39. > > MFC after: 2 weeks Hi, Please re-apply r333944 Antoine From owner-svn-src-all@freebsd.org Wed Jun 17 08:08:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B2DF3471F7; Wed, 17 Jun 2020 08:08:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49myQ22dM5z4SWr; Wed, 17 Jun 2020 08:08:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50B521D338; Wed, 17 Jun 2020 08:08:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05H88wqh084588; Wed, 17 Jun 2020 08:08:58 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05H88wnK084587; Wed, 17 Jun 2020 08:08:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006170808.05H88wnK084587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 17 Jun 2020 08:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362259 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 362259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 08:08:58 -0000 Author: tsoome Date: Wed Jun 17 08:08:57 2020 New Revision: 362259 URL: https://svnweb.freebsd.org/changeset/base/362259 Log: loader: vidc_init should also erase the screen Inject \e[J to erase the initial loader screen. We have two options, find where out cursor is and use BIOS scroll for data from boot2 or erase the display and start from origin. Erasing the screen is easier and we also get the screen buffer initialized. Sponsored by: Netflix, Klara Inc. Modified: head/stand/i386/libi386/vidconsole.c Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Wed Jun 17 07:41:28 2020 (r362258) +++ head/stand/i386/libi386/vidconsole.c Wed Jun 17 08:08:57 2020 (r362259) @@ -709,11 +709,8 @@ vidc_init(int arg) env_setenv("teken.bg_color", EV_VOLATILE, env, vidc_set_colors, env_nounset); - for (int row = 0; row < tp.tp_row; row++) - for (int col = 0; col < tp.tp_col; col++) { - buffer[col + row * tp.tp_col].c = ' '; - buffer[col + row * tp.tp_col].a = *a; - } + /* Erase display, this will also fill our screen buffer. */ + teken_input(&teken, "\e[J", 3); for (int i = 0; i < 10 && vidc_ischar(); i++) (void) vidc_getchar(); From owner-svn-src-all@freebsd.org Wed Jun 17 08:35:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C9D0347D33; Wed, 17 Jun 2020 08:35:36 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mz0m1l9fz4TPW; Wed, 17 Jun 2020 08:35:36 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36EA21DA2A; Wed, 17 Jun 2020 08:35:36 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05H8ZaMS003082; Wed, 17 Jun 2020 08:35:36 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05H8ZaNB003081; Wed, 17 Jun 2020 08:35:36 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202006170835.05H8ZaNB003081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Wed, 17 Jun 2020 08:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362260 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 362260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 08:35:36 -0000 Author: wulf Date: Wed Jun 17 08:35:35 2020 New Revision: 362260 URL: https://svnweb.freebsd.org/changeset/base/362260 Log: evdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys. PR: 247292 Submitted by: Yuichiro NAITO MFC after: 1 week Modified: head/sys/dev/evdev/evdev_utils.c Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Wed Jun 17 08:08:57 2020 (r362259) +++ head/sys/dev/evdev/evdev_utils.c Wed Jun 17 08:35:35 2020 (r362260) @@ -146,7 +146,7 @@ static uint16_t evdev_at_set1_scancodes[] = { NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, - KEY_KATAKANAHIRAGANA, NONE, NONE, KEY_RO, + KEY_KATAKANAHIRAGANA, KEY_HANGEUL, KEY_HANJA, KEY_RO, NONE, NONE, KEY_ZENKAKUHANKAKU, KEY_HIRAGANA, KEY_KATAKANA, KEY_HENKAN, NONE, KEY_MUHENKAN, NONE, KEY_YEN, KEY_KPCOMMA, NONE, From owner-svn-src-all@freebsd.org Wed Jun 17 10:11:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A33DF34A096; Wed, 17 Jun 2020 10:11:54 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n17t3t44z4Z4q; Wed, 17 Jun 2020 10:11:54 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8037D1E5FD; Wed, 17 Jun 2020 10:11:54 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HABs2Q061358; Wed, 17 Jun 2020 10:11:54 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HABsxP061357; Wed, 17 Jun 2020 10:11:54 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <202006171011.05HABsxP061357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Wed, 17 Jun 2020 10:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362261 - head/contrib/file/magic/Magdir X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head/contrib/file/magic/Magdir X-SVN-Commit-Revision: 362261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 10:11:54 -0000 Author: antoine Date: Wed Jun 17 10:11:54 2020 New Revision: 362261 URL: https://svnweb.freebsd.org/changeset/base/362261 Log: Re-apply r333944 to unbreak ports Modified: head/contrib/file/magic/Magdir/elf Modified: head/contrib/file/magic/Magdir/elf ============================================================================== --- head/contrib/file/magic/Magdir/elf Wed Jun 17 08:35:35 2020 (r362260) +++ head/contrib/file/magic/Magdir/elf Wed Jun 17 10:11:54 2020 (r362261) @@ -50,9 +50,8 @@ !:mime application/x-object >16 leshort 2 executable, !:mime application/x-executable ->16 leshort 3 ${x?pie executable:shared object}, - -!:mime application/x-${x?pie-executable:sharedlib} +>16 leshort 3 shared object, +!:mime application/x-sharedlib >16 leshort 4 core file, !:mime application/x-coredump # OS-specific From owner-svn-src-all@freebsd.org Wed Jun 17 10:20:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8401D34A15D; Wed, 17 Jun 2020 10:20:24 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n1Kg4CGcz4ZYg; Wed, 17 Jun 2020 10:20:23 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id l12so1700189ejn.10; Wed, 17 Jun 2020 03:20:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XUb2lUkzxqfGiO9QMycj6rNs8YikUGUK4sb/u/Rs538=; b=sLKaEBvT90i9UwVe+v8QIlSjkbrlAKDHrxoHjw6O/wjfrII0wksbAtZ1tdVdiUVGkp 15XlshWqaCsDZRu2xNquw1DR12jPdm2dWlC4cw67D3vM03F35Mg70m8dZ+U96vYM+Cfu Xi55mQ+lSM2w2aiegFhgwA/xAOMnFzLKKACFXcOWf9URZuH8pRPawF7j63N65gwqYr+X yiSvXM89QZDatmmluYATbPXC+m9/fGWGQ5QlnfBl9QEJcqI1gWr3+ymXSBpY57iFOxWI Ka8/LX5kMRCt/3f3Zr4SfnO7XEjS0g4NBv4BKLJqUbaNRhe3ffcffxiYn/2pDMe39Ri7 Ltgw== X-Gm-Message-State: AOAM5320+bp8NnCp0GS+4IZThb6ChRsUupAbSTQIAnijZXad6/3AWFR+ 0QhdWMHs4uF6JZmCMc2WXU698lXD+ewT4Q== X-Google-Smtp-Source: ABdhPJyGIKgogHTK0Av5NTQQJQwCguXQxDpPt7ZcMeKh1+dAfg+ifNZ2Qoyqmk7Gn9GfBYLuyPaA7g== X-Received: by 2002:a17:906:468e:: with SMTP id a14mr6796710ejr.124.1592389221511; Wed, 17 Jun 2020 03:20:21 -0700 (PDT) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com. [209.85.221.41]) by smtp.gmail.com with ESMTPSA id q14sm11707170edj.47.2020.06.17.03.20.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 03:20:21 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id q11so1739548wrp.3; Wed, 17 Jun 2020 03:20:20 -0700 (PDT) X-Received: by 2002:a5d:630f:: with SMTP id i15mr7554208wru.309.1592389220650; Wed, 17 Jun 2020 03:20:20 -0700 (PDT) MIME-Version: 1.0 References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> <202006161708.05GH8ibS019561@slippy.cwsent.com> In-Reply-To: <202006161708.05GH8ibS019561@slippy.cwsent.com> From: Alexander Richardson Date: Wed, 17 Jun 2020 11:20:09 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r362217 - head/stand/common To: Cy Schubert Cc: Ian Lepore , Toomas Soome , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49n1Kg4CGcz4ZYg X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of arichardsonkde@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-2.31 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.41:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-0.90)[-0.896]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.79)[-0.789]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.41:from]; NEURAL_HAM_MEDIUM(-0.62)[-0.623]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 10:20:24 -0000 On Tue, 16 Jun 2020 at 18:09, Cy Schubert wrote: > > In message <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org>, > Ian Le > pore writes: > > On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote: > > > Author: tsoome > > > Date: Tue Jun 16 07:05:03 2020 > > > New Revision: 362217 > > > URL: https://svnweb.freebsd.org/changeset/base/362217 > > > > > > Log: > > > loader: variable i is unused without MBR/GPT support built in > > > > > > Because i is only used as index in for loop, declare it in for > > > statement. > > > > > > > As much as I prefer doing it this way, style(9) doesn't allow for > > variable declarations inside a for() statement (or even inside a local > > block, which is just too 1980s for me, but it is still our standard). > > Doesn't this use stack for a shorter period of time or does the compiler > optimize this, making this change moot? > > The tradeoff is a few extra bytes of stack for a longer period of time vs a > few extra instructions incrementing and decrementing the stack pointer. > > At least for LLVM it makes no difference where you declare the variable: it will always be represented by an alloca instruction at the start of the IR function: https://godbolt.org/z/NFG3hN There will also not be any changes to the stack pointer since the stack frame size is fixed no matter where the variables are declared (unless you use variable-length arrays or __builtin_alloca()). LLVM will also merge variables that have non-overlapping lifetimes to reuse the same stack slot if possible. I'm almost certain GCC performs the same optimizations (as will any other compiler written in the last 20 years). Alex From owner-svn-src-all@freebsd.org Wed Jun 17 10:41:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E21DA34A45F; Wed, 17 Jun 2020 10:41:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n1nT5jCSz4bZf; Wed, 17 Jun 2020 10:41:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A616F1EEBC; Wed, 17 Jun 2020 10:41:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HAf1xf080228; Wed, 17 Jun 2020 10:41:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HAf1RA080227; Wed, 17 Jun 2020 10:41:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006171041.05HAf1RA080227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 17 Jun 2020 10:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362262 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 362262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 10:41:02 -0000 Author: tsoome Date: Wed Jun 17 10:41:01 2020 New Revision: 362262 URL: https://svnweb.freebsd.org/changeset/base/362262 Log: loader: strings in nvlist are counted strings, not c-strings We need to fetch both string size and data, then handle the data. Reviewed by: allanjude Sponsored by: Netflix, Klara Inc. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Wed Jun 17 10:11:54 2020 (r362261) +++ head/stand/libsa/zfs/zfsimpl.c Wed Jun 17 10:41:01 2020 (r362262) @@ -198,7 +198,7 @@ xdr_uint64_t(const unsigned char **xdr, uint64_t *lp) static int nvlist_find(const unsigned char *nvlist, const char *name, int type, - int *elementsp, void *valuep) + int *elementsp, void *valuep, int *sizep) { const unsigned char *p, *pair; int junk; @@ -230,6 +230,8 @@ nvlist_find(const unsigned char *nvlist, const char *n } else if (type == DATA_TYPE_STRING) { int len; xdr_int(&p, &len); + if (sizep != NULL) + *sizep = len; (*(const char **)valuep) = (const char *)p; return (0); } else if (type == DATA_TYPE_NVLIST || @@ -394,7 +396,7 @@ nvlist_print(const unsigned char *nvlist, unsigned int for (i = 0; i < indent; i++) printf(" "); - printf("%s %s", typenames[pairtype], pairname); + printf("%s %.*s", typenames[pairtype], namelen, pairname); xdr_int(&p, &elements); switch (pairtype) { @@ -408,7 +410,7 @@ nvlist_print(const unsigned char *nvlist, unsigned int case DATA_TYPE_STRING: { int len; xdr_int(&p, &len); - printf(" = \"%s\"\n", p); + printf(" = \"%.*s\"\n", len, p); break; } @@ -424,8 +426,8 @@ nvlist_print(const unsigned char *nvlist, unsigned int if (j != elements - 1) { for (i = 0; i < indent; i++) printf(" "); - printf("%s %s", typenames[pairtype], - pairname); + printf("%s %.*s", typenames[pairtype], + namelen, pairname); } } break; @@ -1088,17 +1090,17 @@ vdev_set_initial_state(vdev_t *vdev, const unsigned ch is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0; is_log = 0; (void) nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL, - &is_offline); + &is_offline, NULL); (void) nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL, - &is_removed); + &is_removed, NULL); (void) nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL, - &is_faulted); + &is_faulted, NULL); (void) nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, - NULL, &is_degraded); + NULL, &is_degraded, NULL); (void) nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, - NULL, &isnt_present); + NULL, &isnt_present, NULL); (void) nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, - &is_log); + &is_log, NULL); if (is_offline != 0) vdev->v_state = VDEV_STATE_OFFLINE; @@ -1120,34 +1122,37 @@ vdev_init(uint64_t guid, const unsigned char *nvlist, uint64_t id, ashift, asize, nparity; const char *path; const char *type; + int len, pathlen; + char *name; vdev_t *vdev; - if (nvlist_find(nvlist, ZPOOL_CONFIG_ID, DATA_TYPE_UINT64, NULL, &id) || + if (nvlist_find(nvlist, ZPOOL_CONFIG_ID, DATA_TYPE_UINT64, NULL, &id, + NULL) || nvlist_find(nvlist, ZPOOL_CONFIG_TYPE, DATA_TYPE_STRING, - NULL, &type)) { + NULL, &type, &len)) { return (ENOENT); } - if (strcmp(type, VDEV_TYPE_MIRROR) != 0 && - strcmp(type, VDEV_TYPE_DISK) != 0 && + if (memcmp(type, VDEV_TYPE_MIRROR, len) != 0 && + memcmp(type, VDEV_TYPE_DISK, len) != 0 && #ifdef ZFS_TEST - strcmp(type, VDEV_TYPE_FILE) != 0 && + memcmp(type, VDEV_TYPE_FILE, len) != 0 && #endif - strcmp(type, VDEV_TYPE_RAIDZ) != 0 && - strcmp(type, VDEV_TYPE_INDIRECT) != 0 && - strcmp(type, VDEV_TYPE_REPLACING) != 0) { + memcmp(type, VDEV_TYPE_RAIDZ, len) != 0 && + memcmp(type, VDEV_TYPE_INDIRECT, len) != 0 && + memcmp(type, VDEV_TYPE_REPLACING, len) != 0) { printf("ZFS: can only boot from disk, mirror, raidz1, " "raidz2 and raidz3 vdevs\n"); return (EIO); } - if (strcmp(type, VDEV_TYPE_MIRROR) == 0) + if (memcmp(type, VDEV_TYPE_MIRROR, len) == 0) vdev = vdev_create(guid, vdev_mirror_read); - else if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) + else if (memcmp(type, VDEV_TYPE_RAIDZ, len) == 0) vdev = vdev_create(guid, vdev_raidz_read); - else if (strcmp(type, VDEV_TYPE_REPLACING) == 0) + else if (memcmp(type, VDEV_TYPE_REPLACING, len) == 0) vdev = vdev_create(guid, vdev_replacing_read); - else if (strcmp(type, VDEV_TYPE_INDIRECT) == 0) { + else if (memcmp(type, VDEV_TYPE_INDIRECT, len) == 0) { vdev_indirect_config_t *vic; vdev = vdev_create(guid, vdev_indirect_read); @@ -1158,15 +1163,15 @@ vdev_init(uint64_t guid, const unsigned char *nvlist, nvlist_find(nvlist, ZPOOL_CONFIG_INDIRECT_OBJECT, DATA_TYPE_UINT64, - NULL, &vic->vic_mapping_object); + NULL, &vic->vic_mapping_object, NULL); nvlist_find(nvlist, ZPOOL_CONFIG_INDIRECT_BIRTHS, DATA_TYPE_UINT64, - NULL, &vic->vic_births_object); + NULL, &vic->vic_births_object, NULL); nvlist_find(nvlist, ZPOOL_CONFIG_PREV_INDIRECT_VDEV, DATA_TYPE_UINT64, - NULL, &vic->vic_prev_indirect_vdev); + NULL, &vic->vic_prev_indirect_vdev, NULL); } } else { vdev = vdev_create(guid, vdev_disk_read); @@ -1178,39 +1183,45 @@ vdev_init(uint64_t guid, const unsigned char *nvlist, vdev_set_initial_state(vdev, nvlist); vdev->v_id = id; if (nvlist_find(nvlist, ZPOOL_CONFIG_ASHIFT, - DATA_TYPE_UINT64, NULL, &ashift) == 0) + DATA_TYPE_UINT64, NULL, &ashift, NULL) == 0) vdev->v_ashift = ashift; if (nvlist_find(nvlist, ZPOOL_CONFIG_ASIZE, - DATA_TYPE_UINT64, NULL, &asize) == 0) { + DATA_TYPE_UINT64, NULL, &asize, NULL) == 0) { vdev->v_psize = asize + VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; } if (nvlist_find(nvlist, ZPOOL_CONFIG_NPARITY, - DATA_TYPE_UINT64, NULL, &nparity) == 0) + DATA_TYPE_UINT64, NULL, &nparity, NULL) == 0) vdev->v_nparity = nparity; if (nvlist_find(nvlist, ZPOOL_CONFIG_PATH, - DATA_TYPE_STRING, NULL, &path) == 0) { - if (strncmp(path, "/dev/", 5) == 0) - path += 5; - vdev->v_name = strdup(path); - } else { - char *name; + DATA_TYPE_STRING, NULL, &path, &pathlen) == 0) { + char prefix[] = "/dev/"; + len = strlen(prefix); + if (memcmp(path, prefix, len) == 0) { + path += len; + pathlen -= len; + } + name = malloc(pathlen + 1); + bcopy(path, name, pathlen); + name[pathlen] = '\0'; + vdev->v_name = name; + } else { name = NULL; - if (strcmp(type, "raidz") == 0) { + if (memcmp(type, VDEV_TYPE_RAIDZ, len) == 0) { if (vdev->v_nparity < 1 || vdev->v_nparity > 3) { printf("ZFS: invalid raidz parity: %d\n", vdev->v_nparity); return (EIO); } - (void) asprintf(&name, "%s%d-%" PRIu64, type, + (void) asprintf(&name, "%.*s%d-%" PRIu64, len, type, vdev->v_nparity, id); } else { - (void) asprintf(&name, "%s-%" PRIu64, type, id); + (void) asprintf(&name, "%.*s-%" PRIu64, len, type, id); } vdev->v_name = name; } @@ -1314,13 +1325,13 @@ vdev_from_nvlist(spa_t *spa, uint64_t top_guid, const /* Add children if there are any. */ rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, - &nkids, &kids); + &nkids, &kids, NULL); if (rc == 0) { for (int i = 0; i < nkids; i++) { uint64_t guid; rc = nvlist_find(kids, ZPOOL_CONFIG_GUID, - DATA_TYPE_UINT64, NULL, &guid); + DATA_TYPE_UINT64, NULL, &guid, NULL); if (rc != 0) return (rc); rc = vdev_init(guid, kids, &vdev); @@ -1351,11 +1362,11 @@ vdev_init_from_label(spa_t *spa, const unsigned char * const unsigned char *vdevs; if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, - NULL, &pool_guid) || + NULL, &pool_guid, NULL) || nvlist_find(nvlist, ZPOOL_CONFIG_TOP_GUID, DATA_TYPE_UINT64, - NULL, &top_guid) || + NULL, &top_guid, NULL) || nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, - NULL, &vdevs)) { + NULL, &vdevs, NULL)) { printf("ZFS: can't find vdev details\n"); return (ENOENT); } @@ -1422,13 +1433,13 @@ vdev_update_from_nvlist(uint64_t top_guid, const unsig /* Update children if there are any. */ rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, - &nkids, &kids); + &nkids, &kids, NULL); if (rc == 0) { for (int i = 0; i < nkids; i++) { uint64_t guid; rc = nvlist_find(kids, ZPOOL_CONFIG_GUID, - DATA_TYPE_UINT64, NULL, &guid); + DATA_TYPE_UINT64, NULL, &guid, NULL); if (rc != 0) break; @@ -1453,11 +1464,11 @@ vdev_init_from_nvlist(spa_t *spa, const unsigned char int rc, nkids; if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, - NULL, &pool_guid) || + NULL, &pool_guid, NULL) || nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_CHILDREN, DATA_TYPE_UINT64, - NULL, &vdev_children) || + NULL, &vdev_children, NULL) || nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, - NULL, &vdevs)) { + NULL, &vdevs, NULL)) { printf("ZFS: can't find vdev details\n"); return (ENOENT); } @@ -1469,7 +1480,7 @@ vdev_init_from_nvlist(spa_t *spa, const unsigned char spa->spa_root_vdev->v_nchildren = vdev_children; rc = nvlist_find(vdevs, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, - &nkids, &kids); + &nkids, &kids, NULL); /* * MOS config has at least one child for root vdev. @@ -1482,7 +1493,7 @@ vdev_init_from_nvlist(spa_t *spa, const unsigned char vdev_t *vdev; rc = nvlist_find(kids, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, - NULL, &guid); + NULL, &guid, NULL); if (rc != 0) break; vdev = vdev_find(guid); @@ -1841,7 +1852,7 @@ vdev_label_read_config(vdev_t *vd, uint64_t txg) nvlist = (const unsigned char *) label->vp_nvlist + 4; error = nvlist_find(nvlist, ZPOOL_CONFIG_POOL_TXG, - DATA_TYPE_UINT64, NULL, &label_txg); + DATA_TYPE_UINT64, NULL, &label_txg, NULL); if (error != 0 || label_txg == 0) { memcpy(nvl, nvlist, nvl_size); goto done; @@ -1856,7 +1867,7 @@ vdev_label_read_config(vdev_t *vd, uint64_t txg) * because we can get bad value from BIOS. */ if (nvlist_find(nvlist, ZPOOL_CONFIG_ASIZE, - DATA_TYPE_UINT64, NULL, &asize) == 0) { + DATA_TYPE_UINT64, NULL, &asize, NULL) == 0) { vd->v_psize = asize + VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; } @@ -1909,7 +1920,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s uint64_t pool_txg, pool_guid; const char *pool_name; const unsigned char *features; - int rc; + int rc, namelen; /* * Load the vdev label and figure out which @@ -1930,7 +1941,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s return (EIO); if (nvlist_find(nvlist, ZPOOL_CONFIG_VERSION, DATA_TYPE_UINT64, - NULL, &val) != 0) { + NULL, &val, NULL) != 0) { free(nvlist); return (EIO); } @@ -1944,14 +1955,14 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s /* Check ZFS features for read */ if (nvlist_find(nvlist, ZPOOL_CONFIG_FEATURES_FOR_READ, - DATA_TYPE_NVLIST, NULL, &features) == 0 && + DATA_TYPE_NVLIST, NULL, &features, NULL) == 0 && nvlist_check_features_for_read(features) != 0) { free(nvlist); return (EIO); } if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_STATE, DATA_TYPE_UINT64, - NULL, &val) != 0) { + NULL, &val, NULL) != 0) { free(nvlist); return (EIO); } @@ -1963,11 +1974,11 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s } if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_TXG, DATA_TYPE_UINT64, - NULL, &pool_txg) != 0 || + NULL, &pool_txg, NULL) != 0 || nvlist_find(nvlist, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, - NULL, &pool_guid) != 0 || + NULL, &pool_guid, NULL) != 0 || nvlist_find(nvlist, ZPOOL_CONFIG_POOL_NAME, DATA_TYPE_STRING, - NULL, &pool_name) != 0) { + NULL, &pool_name, &namelen) != 0) { /* * Cache and spare devices end up here - just ignore * them. @@ -1981,9 +1992,19 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s */ spa = spa_find_by_guid(pool_guid); if (spa == NULL) { + char *name; + nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_CHILDREN, - DATA_TYPE_UINT64, NULL, &vdev_children); - spa = spa_create(pool_guid, pool_name); + DATA_TYPE_UINT64, NULL, &vdev_children, NULL); + name = malloc(namelen + 1); + if (name == NULL) { + free(nvlist); + return (ENOMEM); + } + bcopy(pool_name, name, namelen); + name[namelen] = '\0'; + spa = spa_create(pool_guid, name); + free(name); if (spa == NULL) { free(nvlist); return (ENOMEM); @@ -2000,7 +2021,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s * disks etc). */ if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, - NULL, &guid) != 0) { + NULL, &guid, NULL) != 0) { free(nvlist); return (EIO); } From owner-svn-src-all@freebsd.org Wed Jun 17 10:42:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFBFB34A7E8; Wed, 17 Jun 2020 10:42:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n1q44VBRz4bbv; Wed, 17 Jun 2020 10:42:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AD961EEDE; Wed, 17 Jun 2020 10:42:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HAgOwZ083701; Wed, 17 Jun 2020 10:42:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HAgKkO083681; Wed, 17 Jun 2020 10:42:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006171042.05HAgKkO083681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 17 Jun 2020 10:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362263 - in head: . contrib/opencsd/decoder/include/common contrib/opencsd/decoder/include/i_dec contrib/opencsd/decoder/include/mem_acc contrib/opencsd/decoder/include/opencsd contrib... X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: . contrib/opencsd/decoder/include/common contrib/opencsd/decoder/include/i_dec contrib/opencsd/decoder/include/mem_acc contrib/opencsd/decoder/include/opencsd contrib/opencsd/decoder/include/... X-SVN-Commit-Revision: 362263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 10:42:24 -0000 Author: andrew Date: Wed Jun 17 10:42:20 2020 New Revision: 362263 URL: https://svnweb.freebsd.org/changeset/base/362263 Log: Update opencsd to 0.14.2 Sponsored by: Innovate UK Added: head/contrib/opencsd/decoder/include/common/ocsd_gen_elem_stack.h - copied unchanged from r362220, vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_stack.h head/contrib/opencsd/decoder/include/common/trc_raw_buffer.h - copied unchanged from r362220, vendor/opencsd/dist/decoder/include/common/trc_raw_buffer.h head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h - copied unchanged from r362220, vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h head/contrib/opencsd/decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp - copied unchanged from r362220, vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp head/contrib/opencsd/decoder/source/ocsd_gen_elem_stack.cpp - copied unchanged from r362220, vendor/opencsd/dist/decoder/source/ocsd_gen_elem_stack.cpp Deleted: head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4d.h head/contrib/opencsd/decoder/source/etmv4/trc_pkt_elem_etmv4d.cpp head/contrib/opencsd/decoder/source/etmv4/trc_pkt_proc_etmv4.cpp head/contrib/opencsd/decoder/source/etmv4/trc_pkt_proc_etmv4d_impl.h head/contrib/opencsd/decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp head/contrib/opencsd/decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.h Modified: head/ObsoleteFiles.inc head/contrib/opencsd/decoder/include/common/ocsd_dcd_mngr.h head/contrib/opencsd/decoder/include/common/ocsd_gen_elem_list.h head/contrib/opencsd/decoder/include/common/trc_core_arch_map.h head/contrib/opencsd/decoder/include/common/trc_gen_elem.h head/contrib/opencsd/decoder/include/common/trc_pkt_decode_base.h head/contrib/opencsd/decoder/include/i_dec/trc_i_decode.h head/contrib/opencsd/decoder/include/i_dec/trc_idec_arminst.h head/contrib/opencsd/decoder/include/mem_acc/trc_mem_acc_bufptr.h head/contrib/opencsd/decoder/include/opencsd/etmv3/trc_pkt_decode_etmv3.h head/contrib/opencsd/decoder/include/opencsd/etmv4/etmv4_decoder.h head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_etmv4_stack_elem.h head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_decode_etmv4i.h head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4.h head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h head/contrib/opencsd/decoder/include/opencsd/ocsd_if_types.h head/contrib/opencsd/decoder/include/opencsd/ocsd_if_version.h head/contrib/opencsd/decoder/include/opencsd/ptm/trc_pkt_decode_ptm.h head/contrib/opencsd/decoder/include/opencsd/stm/trc_pkt_decode_stm.h head/contrib/opencsd/decoder/include/opencsd/trc_gen_elem_types.h head/contrib/opencsd/decoder/include/pkt_printers/pkt_printer_t.h head/contrib/opencsd/decoder/source/etmv3/trc_pkt_decode_etmv3.cpp head/contrib/opencsd/decoder/source/etmv4/trc_etmv4_stack_elem.cpp head/contrib/opencsd/decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp head/contrib/opencsd/decoder/source/etmv4/trc_pkt_elem_etmv4i.cpp head/contrib/opencsd/decoder/source/i_dec/trc_i_decode.cpp head/contrib/opencsd/decoder/source/i_dec/trc_idec_arminst.cpp head/contrib/opencsd/decoder/source/mem_acc/trc_mem_acc_bufptr.cpp head/contrib/opencsd/decoder/source/ocsd_dcd_tree.cpp head/contrib/opencsd/decoder/source/ocsd_error.cpp head/contrib/opencsd/decoder/source/ptm/trc_pkt_decode_ptm.cpp head/contrib/opencsd/decoder/source/stm/trc_pkt_decode_stm.cpp head/contrib/opencsd/decoder/source/trc_component.cpp head/contrib/opencsd/decoder/source/trc_core_arch_map.cpp head/contrib/opencsd/decoder/source/trc_gen_elem.cpp head/lib/libopencsd/Makefile Directory Properties: head/contrib/opencsd/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jun 17 10:41:01 2020 (r362262) +++ head/ObsoleteFiles.inc Wed Jun 17 10:42:20 2020 (r362263) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20200617: update opencsd to 0.14.2 +OLD_FILES+=usr/include/opencsd/etmv4/trc_pkt_elem_etmv4d.h + # 20200606: retire binutils build infrastructure .if !defined(WITH_PORT_BASE_BINUTILS) OLD_FILES+=usr/bin/as Modified: head/contrib/opencsd/decoder/include/common/ocsd_dcd_mngr.h ============================================================================== --- head/contrib/opencsd/decoder/include/common/ocsd_dcd_mngr.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/common/ocsd_dcd_mngr.h Wed Jun 17 10:42:20 2020 (r362263) @@ -115,6 +115,9 @@ ocsd_err_t DecoderMngrBase::createDecoder(co if(!pkt_proc) return OCSD_ERR_MEM; + // set the op mode flags + pkt_proc->setComponentOpMode(create_flags & (OCSD_OPFLG_COMP_MODE_MASK | OCSD_OPFLG_PKTPROC_COMMON)); + // set the configuration TrcPktProcBase *pProcBase = dynamic_cast< TrcPktProcBase *>(pkt_proc); if(pProcBase == 0) @@ -132,6 +135,9 @@ ocsd_err_t DecoderMngrBase::createDecoder(co pkt_dcd = createPktDecode(bUseInstID, instID); if(!pkt_dcd) return OCSD_ERR_MEM; + + // set the op mode flags + pkt_dcd->setComponentOpMode(create_flags & (OCSD_OPFLG_COMP_MODE_MASK | OCSD_OPFLG_PKTDEC_COMMON)); // get the decoder base TrcPktDecodeBase *pBase = dynamic_cast< TrcPktDecodeBase *>(pkt_dcd); Modified: head/contrib/opencsd/decoder/include/common/ocsd_gen_elem_list.h ============================================================================== --- head/contrib/opencsd/decoder/include/common/ocsd_gen_elem_list.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/common/ocsd_gen_elem_list.h Wed Jun 17 10:42:20 2020 (r362263) @@ -1,6 +1,6 @@ /* - * \file ocsd_gen_elem_stack.h - * \brief OpenCSD : Generic element output stack. + * \file ocsd_gen_elem_list.h + * \brief OpenCSD : Generic element output list. * * \copyright Copyright (c) 2016, ARM Limited. All Rights Reserved. */ @@ -47,7 +47,7 @@ * This should remove some of the requirement on the packet processing to be re-enterant, * simplifying this code. * - * Last element(s) on this stack can be marked pending to allow for later cancellation. + * Last element(s) on this list can be marked pending to allow for later cancellation. * (This required for cancel element in ETMv3 exeception branch). * * The "list" is actually a ring buffer - maintaining pointers to indicate current valid elements. @@ -150,4 +150,4 @@ inline void OcsdGenElemList::initSendIf(componentAttac m_sendIf = pGenElemIf; } -/* End of File ocsd_gen_elem_stack.h */ +/* End of File ocsd_gen_elem_list.h */ Copied: head/contrib/opencsd/decoder/include/common/ocsd_gen_elem_stack.h (from r362220, vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_stack.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/opencsd/decoder/include/common/ocsd_gen_elem_stack.h Wed Jun 17 10:42:20 2020 (r362263, copy of r362220, vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_stack.h) @@ -0,0 +1,109 @@ +/* +* \file ocsd_gen_elem_stack.h +* \brief OpenCSD : Generic element output stack. +* +* \copyright Copyright (c) 2020, ARM Limited. All Rights Reserved. +*/ + +/* +* Redistribution and use in source and binary forms, with or without modification, +* are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* +* 3. Neither the name of the copyright holder nor the names of its contributors +* may be used to endorse or promote products derived from this software without +* specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "trc_gen_elem.h" +#include "comp_attach_pt_t.h" +#include "interfaces/trc_gen_elem_in_i.h" + +/* element stack to handle cases where a trace element can generate multiple output packets + + maintains the "current" element, which might be sent independently of this stack, and also + ensures that persistent data in the output elements is maintained between elements. +*/ +class OcsdGenElemStack +{ +public: + OcsdGenElemStack(); + ~OcsdGenElemStack(); + + void initSendIf(componentAttachPt *pGenElemIf); + void initCSID(const uint8_t CSID) { m_CSID = CSID; }; + + OcsdTraceElement &getCurrElem(); //!< get the current element. + ocsd_err_t resetElemStack(); //!< set pointers to base of stack + ocsd_err_t addElem(const ocsd_trc_index_t trc_pkt_idx); //!< add elem to stack and set current. + void setCurrElemIdx(const ocsd_trc_index_t trc_pkt_idx); //!< packet index for this element + ocsd_err_t addElemType(const ocsd_trc_index_t trc_pkt_idx, ocsd_gen_trc_elem_t elem_type); + + ocsd_datapath_resp_t sendElements(); //!< send elements on the stack + const int numElemToSend() const; + +private: + typedef struct _elemPtr { + OcsdTraceElement *pElem; //!< pointer to the listed trace element + ocsd_trc_index_t trc_pkt_idx; //!< packet index in the trace stream + } elemPtr_t; + + const bool isInit(); //!< check correctly initialised. + + ocsd_err_t growArray(); + void copyPersistentData(int src, int dst); //!< copy across persistent state data between elements + void resetIndexes(); //!< clear down all indexes - reset or send complete. + + elemPtr_t *m_pElemArray; //!< an array of pointers to elements. + int m_elemArraySize; //!< number of element pointers in the array + + int m_elem_to_send; //!< number of live elements in the stack - init to 1. + int m_curr_elem_idx; //!< index into the element array. + int m_send_elem_idx; //!< next element to send. + + //!< send packet info + uint8_t m_CSID; + componentAttachPt *m_sendIf; //!< element send interface. + + bool m_is_init; +}; + +inline const int OcsdGenElemStack::numElemToSend() const +{ + return m_elem_to_send; +} + +inline void OcsdGenElemStack::initSendIf(componentAttachPt *pGenElemIf) +{ + m_sendIf = pGenElemIf; +} + +inline void OcsdGenElemStack::setCurrElemIdx(const ocsd_trc_index_t trc_pkt_idx) +{ + m_pElemArray[m_curr_elem_idx].trc_pkt_idx = trc_pkt_idx; +} + +inline OcsdTraceElement &OcsdGenElemStack::getCurrElem() +{ + return *(m_pElemArray[m_curr_elem_idx].pElem); +} + + +/* End of File ocsd_gen_elem_stack.h */ Modified: head/contrib/opencsd/decoder/include/common/trc_core_arch_map.h ============================================================================== --- head/contrib/opencsd/decoder/include/common/trc_core_arch_map.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/common/trc_core_arch_map.h Wed Jun 17 10:42:20 2020 (r362263) @@ -39,6 +39,23 @@ #include #include "opencsd/ocsd_if_types.h" +/** @class CoreArchProfileMap + * + * @brief Map core / arch name to profile for decoder. + * + * Helper class for library clients to map core or architecture version names onto + * a profile / arch version pair suitable for use with the decode library. + * + * Valid core names are:- + * - Cortex-Axx : where xx = 5,7,12,15,17,32,35,53,55,57,65,72,73,75,76,77; + * - Cortex-Rxx : where xx = 5,7,8,52; + * - Cortex-Mxx : where xx = 0,0+,3,4,23,33; + * + * Valid architecture profile names are:- + * - ARMv7-A, ARMv7-R, ARMv7-M; + * - ARMv8-A, ARMv8.3A, ARMv8-R, ARMv8-M; + * + */ class CoreArchProfileMap { public: @@ -50,16 +67,31 @@ class CoreArchProfileMap (public) private: std::map core_profiles; + std::map arch_profiles; }; inline ocsd_arch_profile_t CoreArchProfileMap::getArchProfile(const std::string &coreName) { ocsd_arch_profile_t ap = { ARCH_UNKNOWN, profile_Unknown }; + bool bFound = false; std::map::const_iterator it; + + /* match against the core name map. */ it = core_profiles.find(coreName); - if(it != core_profiles.end()) + if (it != core_profiles.end()) + { ap = it->second; + bFound = true; + } + + /* scan architecture profiles on no core name match */ + if (!bFound) + { + it = arch_profiles.find(coreName); + if (it != arch_profiles.end()) + ap = it->second; + } return ap; } Modified: head/contrib/opencsd/decoder/include/common/trc_gen_elem.h ============================================================================== --- head/contrib/opencsd/decoder/include/common/trc_gen_elem.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/common/trc_gen_elem.h Wed Jun 17 10:42:20 2020 (r362263) @@ -72,6 +72,7 @@ class OcsdTraceElement : public trcPrintableElem, publ void setTraceOnReason(const trace_on_reason_t reason); + void setUnSyncEOTReason(const unsync_info_t reason); void setAddrRange(const ocsd_vaddr_t st_addr, const ocsd_vaddr_t en_addr, const int num_instr = 1); void setLastInstrInfo(const bool exec, const ocsd_instr_type last_i_type, const ocsd_instr_subtype last_i_subtype, const uint8_t size); @@ -94,7 +95,8 @@ class OcsdTraceElement : public trcPrintableElem, publ // return current context const ocsd_pe_context &getContext() const { return context; }; - + void copyPersistentData(const OcsdTraceElement &src); + private: void printSWInfoPkt(std::ostringstream &oss) const; void clearPerPktData(); //!< clear flags that indicate validity / have values on a per packet basis @@ -171,8 +173,8 @@ inline void OcsdTraceElement::init() inline void OcsdTraceElement::clearPerPktData() { - flag_bits = 0; // union with trace_on_reason / trace_event - + flag_bits = 0; // bit-field with various flags. + exception_number = 0; // union with trace_on_reason / trace_event ptr_extended_data = 0; // extended data pointer } @@ -181,6 +183,11 @@ inline void OcsdTraceElement::setTraceOnReason(const t trace_on_reason = reason; } +inline void OcsdTraceElement::setUnSyncEOTReason(const unsync_info_t reason) +{ + unsync_eot_info = reason; +} + inline void OcsdTraceElement::setISA(const ocsd_isa isa_update) { isa = isa_update; @@ -201,6 +208,12 @@ inline void OcsdTraceElement::setExtendedDataPtr(const ptr_extended_data = data_ptr; } +// set persistent data between output packets. +inline void OcsdTraceElement::copyPersistentData(const OcsdTraceElement &src) +{ + isa = src.isa; + context = src.context; +} /** @}*/ Modified: head/contrib/opencsd/decoder/include/common/trc_pkt_decode_base.h ============================================================================== --- head/contrib/opencsd/decoder/include/common/trc_pkt_decode_base.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/common/trc_pkt_decode_base.h Wed Jun 17 10:42:20 2020 (r362263) @@ -85,7 +85,10 @@ class TrcPktDecodeI : public TraceComponent (protected virtual ocsd_err_t onProtocolConfig() = 0; virtual const uint8_t getCoreSightTraceID() = 0; + /* init handling */ const bool checkInit(); + /* Called on first init confirmation */ + virtual void onFirstInitOK() {}; /* data output */ ocsd_datapath_resp_t outputTraceElement(const OcsdTraceElement &elem); // use current index @@ -147,6 +150,8 @@ inline const bool TrcPktDecodeI::checkInit() init_err_msg = "No instruction decoder interface attached and enabled"; else m_decode_init_ok = true; + if (m_decode_init_ok) + onFirstInitOK(); } return m_decode_init_ok; } Copied: head/contrib/opencsd/decoder/include/common/trc_raw_buffer.h (from r362220, vendor/opencsd/dist/decoder/include/common/trc_raw_buffer.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/opencsd/decoder/include/common/trc_raw_buffer.h Wed Jun 17 10:42:20 2020 (r362263, copy of r362220, vendor/opencsd/dist/decoder/include/common/trc_raw_buffer.h) @@ -0,0 +1,96 @@ +/* +* \file trc_raw_buffer.h +* \brief OpenCSD : Trace raw data byte buffer +* +* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved. +*/ + +/* +* Redistribution and use in source and binary forms, with or without modification, +* are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* +* 3. Neither the name of the copyright holder nor the names of its contributors +* may be used to endorse or promote products derived from this software without +* specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ARM_TRC_RAW_BUFFER_H_INCLUDED +#define ARM_TRC_RAW_BUFFER_H_INCLUDED + +#include + +class TraceRawBuffer +{ +public: + TraceRawBuffer() : + m_bufSize(0), + m_bufProcessed(0), + m_pBuffer(0), + pkt(0) + {}; + ~TraceRawBuffer() {}; + + // init the buffer + void init(const uint32_t size, const uint8_t *rawtrace, std::vector *out_packet); + void copyByteToPkt(); // move a byte to the packet buffer + uint8_t peekNextByte(); // value of next byte in buffer. + + bool empty() { return m_bufProcessed == m_bufSize; }; + // bytes processed. + uint32_t processed() { return m_bufProcessed; }; + // buffer size; + uint32_t size() { return m_bufSize; } + +private: + uint32_t m_bufSize; + uint32_t m_bufProcessed; + const uint8_t *m_pBuffer; + std::vector *pkt; + +}; + +// init the buffer +inline void TraceRawBuffer::init(const uint32_t size, const uint8_t *rawtrace, std::vector *out_packet) +{ + m_bufSize = size; + m_bufProcessed = 0; + m_pBuffer = rawtrace; + pkt = out_packet; +} + +inline void TraceRawBuffer::copyByteToPkt() +{ + if (!empty()) { + pkt->push_back(m_pBuffer[m_bufProcessed]); + m_bufProcessed++; + } +} + +inline uint8_t TraceRawBuffer::peekNextByte() +{ + uint8_t val = 0; + if (!empty()) + val = m_pBuffer[m_bufProcessed]; + return val; +} + +#endif // ARM_TRC_RAW_BUFFER_H_INCLUDED + Modified: head/contrib/opencsd/decoder/include/i_dec/trc_i_decode.h ============================================================================== --- head/contrib/opencsd/decoder/include/i_dec/trc_i_decode.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/i_dec/trc_i_decode.h Wed Jun 17 10:42:20 2020 (r362263) @@ -46,10 +46,9 @@ class TrcIDecode : public IInstrDecode (public) virtual ocsd_err_t DecodeInstruction(ocsd_instr_info *instr_info); private: - ocsd_err_t DecodeA32(ocsd_instr_info *instr_info); - ocsd_err_t DecodeA64(ocsd_instr_info *instr_info); - ocsd_err_t DecodeT32(ocsd_instr_info *instr_info); - void SetArchVersion(ocsd_instr_info *instr_info); + ocsd_err_t DecodeA32(ocsd_instr_info *instr_info, struct decode_info *info); + ocsd_err_t DecodeA64(ocsd_instr_info *instr_info, struct decode_info *info); + ocsd_err_t DecodeT32(ocsd_instr_info *instr_info, struct decode_info *info); }; #endif // ARM_TRC_I_DECODE_H_INCLUDED Modified: head/contrib/opencsd/decoder/include/i_dec/trc_idec_arminst.h ============================================================================== --- head/contrib/opencsd/decoder/include/i_dec/trc_idec_arminst.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/i_dec/trc_idec_arminst.h Wed Jun 17 10:42:20 2020 (r362263) @@ -42,6 +42,12 @@ #include "opencsd/ocsd_if_types.h" #include +/* supplementary decode information */ +struct decode_info { + uint16_t arch_version; + ocsd_instr_subtype instr_sub_type; +}; + /* For Thumb2, test if a halfword is the first half of a 32-bit instruction, as opposed to a complete 16-bit instruction. @@ -63,19 +69,19 @@ instructions that write to the PC. It does not includ instructions such as SVC, HVC and SMC. (Performance event 0x0C includes these.) */ -int inst_ARM_is_branch(uint32_t inst); -int inst_Thumb_is_branch(uint32_t inst); -int inst_A64_is_branch(uint32_t inst); +int inst_ARM_is_branch(uint32_t inst, struct decode_info *info); +int inst_Thumb_is_branch(uint32_t inst, struct decode_info *info); +int inst_A64_is_branch(uint32_t inst, struct decode_info *info); /* Test whether an instruction is a direct (aka immediate) branch. Performance event 0x0D counts these. */ int inst_ARM_is_direct_branch(uint32_t inst); -int inst_Thumb_is_direct_branch(uint32_t inst); -int inst_Thumb_is_direct_branch_link(uint32_t inst, uint8_t *is_link, uint8_t *is_cond); -int inst_A64_is_direct_branch(uint32_t inst); -int inst_A64_is_direct_branch_link(uint32_t inst, uint8_t *is_link); +int inst_Thumb_is_direct_branch(uint32_t inst, struct decode_info *info); +int inst_Thumb_is_direct_branch_link(uint32_t inst, uint8_t *is_link, uint8_t *is_cond, struct decode_info *info); +int inst_A64_is_direct_branch(uint32_t inst, struct decode_info *info); +int inst_A64_is_direct_branch_link(uint32_t inst, uint8_t *is_link, struct decode_info *info); /* Get branch destination for a direct branch. @@ -84,15 +90,15 @@ int inst_ARM_branch_destination(uint32_t addr, uint32_ int inst_Thumb_branch_destination(uint32_t addr, uint32_t inst, uint32_t *pnpc); int inst_A64_branch_destination(uint64_t addr, uint32_t inst, uint64_t *pnpc); -int inst_ARM_is_indirect_branch(uint32_t inst); -int inst_Thumb_is_indirect_branch_link(uint32_t inst, uint8_t *is_link); -int inst_Thumb_is_indirect_branch(uint32_t inst); -int inst_A64_is_indirect_branch_link(uint32_t inst, uint8_t *is_link); -int inst_A64_is_indirect_branch(uint32_t inst); +int inst_ARM_is_indirect_branch(uint32_t inst, struct decode_info *info); +int inst_Thumb_is_indirect_branch_link(uint32_t inst, uint8_t *is_link, struct decode_info *info); +int inst_Thumb_is_indirect_branch(uint32_t inst, struct decode_info *info); +int inst_A64_is_indirect_branch_link(uint32_t inst, uint8_t *is_link, struct decode_info *info); +int inst_A64_is_indirect_branch(uint32_t inst, struct decode_info *info); -int inst_ARM_is_branch_and_link(uint32_t inst); -int inst_Thumb_is_branch_and_link(uint32_t inst); -int inst_A64_is_branch_and_link(uint32_t inst); +int inst_ARM_is_branch_and_link(uint32_t inst, struct decode_info *info); +int inst_Thumb_is_branch_and_link(uint32_t inst, struct decode_info *info); +int inst_A64_is_branch_and_link(uint32_t inst, struct decode_info *info); int inst_ARM_is_conditional(uint32_t inst); int inst_Thumb_is_conditional(uint32_t inst); @@ -127,14 +133,6 @@ intended to be helpful in 'runaway decode' prevention. int inst_ARM_is_UDF(uint32_t inst); int inst_Thumb_is_UDF(uint32_t inst); int inst_A64_is_UDF(uint32_t inst); - - -/* access sub-type information */ -ocsd_instr_subtype get_instr_subtype(); -void clear_instr_subtype(); - -/* set arch version info. */ -void set_arch_version(uint16_t version); #endif // ARM_TRC_IDEC_ARMINST_H_INCLUDED Modified: head/contrib/opencsd/decoder/include/mem_acc/trc_mem_acc_bufptr.h ============================================================================== --- head/contrib/opencsd/decoder/include/mem_acc/trc_mem_acc_bufptr.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/mem_acc/trc_mem_acc_bufptr.h Wed Jun 17 10:42:20 2020 (r362263) @@ -68,7 +68,6 @@ class TrcMemAccBufPtr: public TrcMemAccessorBase (publ private: const uint8_t *m_p_buffer; /**< pointer to the memory buffer */ - const uint32_t m_size; /**< size of the memory buffer. */ }; #endif // ARM_TRC_MEM_ACC_BUFPTR_H_INCLUDED Modified: head/contrib/opencsd/decoder/include/opencsd/etmv3/trc_pkt_decode_etmv3.h ============================================================================== --- head/contrib/opencsd/decoder/include/opencsd/etmv3/trc_pkt_decode_etmv3.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/opencsd/etmv3/trc_pkt_decode_etmv3.h Wed Jun 17 10:42:20 2020 (r362263) @@ -264,6 +264,7 @@ class TrcPktDecodeEtmV3 : public TrcPktDecodeBase m_P0_stack; //!< P0 decode element stack std::vector m_popped_elem; //!< save list of popped but not deleted elements. - + std::deque::iterator m_iter; //!< iterate across the list w/o removing stuff }; inline EtmV4P0Stack::~EtmV4P0Stack() @@ -293,12 +354,20 @@ inline void EtmV4P0Stack::push_back(TrcStackElem *pEle } // pop last element pointer off the stack and stash it for later deletion -inline void EtmV4P0Stack::pop_back() +inline void EtmV4P0Stack::pop_back(bool pend_delete /* = true */) { - m_popped_elem.push_back(m_P0_stack.back()); + if (pend_delete) + m_popped_elem.push_back(m_P0_stack.back()); m_P0_stack.pop_back(); } +inline void EtmV4P0Stack::pop_front(bool pend_delete /* = true */) +{ + if (pend_delete) + m_popped_elem.push_back(m_P0_stack.front()); + m_P0_stack.pop_front(); +} + // pop last element pointer off the stack and delete immediately inline void EtmV4P0Stack::delete_back() { @@ -310,10 +379,28 @@ inline void EtmV4P0Stack::delete_back() } } +// pop first element pointer off the stack and delete immediately +inline void EtmV4P0Stack::delete_front() +{ + if (m_P0_stack.size() > 0) + { + TrcStackElem* pElem = m_P0_stack.front(); + delete pElem; + m_P0_stack.pop_front(); + } +} + + + // get a pointer to the last element on the stack inline TrcStackElem *EtmV4P0Stack::back() { return m_P0_stack.back(); +} + +inline TrcStackElem *EtmV4P0Stack::front() +{ + return m_P0_stack.front(); } // remove and delete all the elements left on the stack Modified: head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_decode_etmv4i.h ============================================================================== --- head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_decode_etmv4i.h Wed Jun 17 10:41:01 2020 (r362262) +++ head/contrib/opencsd/decoder/include/opencsd/etmv4/trc_pkt_decode_etmv4i.h Wed Jun 17 10:42:20 2020 (r362263) @@ -40,6 +40,7 @@ #include "opencsd/etmv4/trc_cmp_cfg_etmv4.h" #include "common/trc_gen_elem.h" #include "common/trc_ret_stack.h" +#include "common/ocsd_gen_elem_stack.h" #include "opencsd/etmv4/trc_etmv4_stack_elem.h" class TrcStackElem; @@ -65,36 +66,70 @@ class TrcPktDecodeEtmV4I : public TrcPktDecodeBase Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8144434ACA1; Wed, 17 Jun 2020 10:50:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n20x2tPXz4cVN; Wed, 17 Jun 2020 10:50:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E2401F123; Wed, 17 Jun 2020 10:50:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HAovL4086843; Wed, 17 Jun 2020 10:50:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HAoujn086836; Wed, 17 Jun 2020 10:50:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006171050.05HAoujn086836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Jun 2020 10:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362264 - in stable/12: include lib/libc/include lib/libthr lib/libthr/thread share/man/man3 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: include lib/libc/include lib/libthr lib/libthr/thread share/man/man3 X-SVN-Commit-Revision: 362264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 10:50:57 -0000 Author: kib Date: Wed Jun 17 10:50:55 2020 New Revision: 362264 URL: https://svnweb.freebsd.org/changeset/base/362264 Log: MFC r361770, r361784, r362032: Add pthread_getname_np() and pthread_setname_np() aliases for pthread_get_name_np() and pthread_set_name_np(). Modified: stable/12/include/pthread.h stable/12/lib/libc/include/namespace.h stable/12/lib/libc/include/un-namespace.h stable/12/lib/libthr/pthread.map stable/12/lib/libthr/thread/thr_info.c stable/12/share/man/man3/Makefile stable/12/share/man/man3/pthread_set_name_np.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/include/pthread.h ============================================================================== --- stable/12/include/pthread.h Wed Jun 17 10:42:20 2020 (r362263) +++ stable/12/include/pthread.h Wed Jun 17 10:50:55 2020 (r362264) @@ -301,6 +301,9 @@ void pthread_testcancel(void); int pthread_getprio(pthread_t); int pthread_setprio(pthread_t, int); void pthread_yield(void); + +int pthread_getname_np(pthread_t, char *, size_t); +int pthread_setname_np(pthread_t, const char *); #endif int pthread_mutexattr_getprioceiling( Modified: stable/12/lib/libc/include/namespace.h ============================================================================== --- stable/12/lib/libc/include/namespace.h Wed Jun 17 10:42:20 2020 (r362263) +++ stable/12/lib/libc/include/namespace.h Wed Jun 17 10:50:55 2020 (r362264) @@ -138,6 +138,7 @@ #define pthread_getaffinity_np _pthread_getaffinity_np #define pthread_getconcurrency _pthread_getconcurrency #define pthread_getcpuclockid _pthread_getcpuclockid +#define pthread_getname_np _pthread_getname_np #define pthread_getprio _pthread_getprio #define pthread_getschedparam _pthread_getschedparam #define pthread_getspecific _pthread_getspecific @@ -191,6 +192,7 @@ #define pthread_setcancelstate _pthread_setcancelstate #define pthread_setcanceltype _pthread_setcanceltype #define pthread_setconcurrency _pthread_setconcurrency +#define pthread_setname_np _pthread_setname_np #define pthread_setprio _pthread_setprio #define pthread_setschedparam _pthread_setschedparam #define pthread_setspecific _pthread_setspecific Modified: stable/12/lib/libc/include/un-namespace.h ============================================================================== --- stable/12/lib/libc/include/un-namespace.h Wed Jun 17 10:42:20 2020 (r362263) +++ stable/12/lib/libc/include/un-namespace.h Wed Jun 17 10:50:55 2020 (r362264) @@ -119,6 +119,7 @@ #undef pthread_getaffinity_np #undef pthread_getconcurrency #undef pthread_getcpuclockid +#undef pthread_getname_np #undef pthread_getprio #undef pthread_getschedparam #undef pthread_getspecific @@ -172,6 +173,7 @@ #undef pthread_setcancelstate #undef pthread_setcanceltype #undef pthread_setconcurrency +#undef pthread_setname_np #undef pthread_setprio #undef pthread_setschedparam #undef pthread_setspecific Modified: stable/12/lib/libthr/pthread.map ============================================================================== --- stable/12/lib/libthr/pthread.map Wed Jun 17 10:42:20 2020 (r362263) +++ stable/12/lib/libthr/pthread.map Wed Jun 17 10:50:55 2020 (r362264) @@ -328,5 +328,7 @@ FBSD_1.5 { }; FBSD_1.6 { + pthread_getname_np; pthread_peekjoin_np; + pthread_setname_np; }; Modified: stable/12/lib/libthr/thread/thr_info.c ============================================================================== --- stable/12/lib/libthr/thread/thr_info.c Wed Jun 17 10:42:20 2020 (r362263) +++ stable/12/lib/libthr/thread/thr_info.c Wed Jun 17 10:50:55 2020 (r362264) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include #include #include @@ -45,39 +46,66 @@ __FBSDID("$FreeBSD$"); #include "thr_private.h" -__weak_reference(_pthread_set_name_np, pthread_set_name_np); - static void -thr_set_name_np(struct pthread *thread, const char *name) +thr_set_name_np(struct pthread *thread, char **tmp_name) { free(thread->name); - thread->name = name != NULL ? strdup(name) : NULL; + thread->name = *tmp_name; + *tmp_name = NULL; } -/* Set the thread name for debug. */ -void -_pthread_set_name_np(pthread_t thread, const char *name) +/* Set the thread name. */ +__weak_reference(_pthread_setname_np, pthread_setname_np); +int +_pthread_setname_np(pthread_t thread, const char *name) { struct pthread *curthread; + char *tmp_name; + int res; + if (name != NULL) { + tmp_name = strdup(name); + if (tmp_name == NULL) + return (ENOMEM); + } else { + tmp_name = NULL; + } curthread = _get_curthread(); if (curthread == thread) { + res = 0; THR_THREAD_LOCK(curthread, thread); - thr_set_name(thread->tid, name); - thr_set_name_np(thread, name); + if (thr_set_name(thread->tid, name) == -1) + res = errno; + else + thr_set_name_np(thread, &tmp_name); THR_THREAD_UNLOCK(curthread, thread); } else { + res = ESRCH; if (_thr_find_thread(curthread, thread, 0) == 0) { if (thread->state != PS_DEAD) { - thr_set_name(thread->tid, name); - thr_set_name_np(thread, name); + if (thr_set_name(thread->tid, name) == -1) { + res = errno; + } else { + thr_set_name_np(thread, &tmp_name); + res = 0; + } } THR_THREAD_UNLOCK(curthread, thread); } } + free(tmp_name); + return (res); } +/* Set the thread name for debug. */ +__weak_reference(_pthread_set_name_np, pthread_set_name_np); +void +_pthread_set_name_np(pthread_t thread, const char *name) +{ + (void)_pthread_setname_np(thread, name); +} + static void thr_get_name_np(struct pthread *thread, char *buf, size_t len) { @@ -88,13 +116,14 @@ thr_get_name_np(struct pthread *thread, char *buf, siz buf[0] = '\0'; } -__weak_reference(_pthread_get_name_np, pthread_get_name_np); - -void -_pthread_get_name_np(pthread_t thread, char *buf, size_t len) +__weak_reference(_pthread_getname_np, pthread_getname_np); +int +_pthread_getname_np(pthread_t thread, char *buf, size_t len) { struct pthread *curthread; + int res; + res = 0; curthread = _get_curthread(); if (curthread == thread) { THR_THREAD_LOCK(curthread, thread); @@ -104,8 +133,21 @@ _pthread_get_name_np(pthread_t thread, char *buf, size if (_thr_find_thread(curthread, thread, 0) == 0) { if (thread->state != PS_DEAD) thr_get_name_np(thread, buf, len); + else + res = ESRCH; THR_THREAD_UNLOCK(curthread, thread); - } else if (len > 0) - buf[0] = '\0'; + } else { + res = ESRCH; + if (len > 0) + buf[0] = '\0'; + } } + return (res); +} + +__weak_reference(_pthread_get_name_np, pthread_get_name_np); +void +_pthread_get_name_np(pthread_t thread, char *buf, size_t len) +{ + (void)_pthread_getname_np(thread, buf, len); } Modified: stable/12/share/man/man3/Makefile ============================================================================== --- stable/12/share/man/man3/Makefile Wed Jun 17 10:42:20 2020 (r362263) +++ stable/12/share/man/man3/Makefile Wed Jun 17 10:50:55 2020 (r362264) @@ -361,7 +361,9 @@ PTHREAD_MLINKS+=pthread_rwlock_rdlock.3 pthread_rwlock PTHREAD_MLINKS+=pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3 PTHREAD_MLINKS+=pthread_schedparam.3 pthread_getschedparam.3 \ pthread_schedparam.3 pthread_setschedparam.3 -PTHREAD_MLINKS+=pthread_set_name_np.3 pthread_get_name_np.3 +PTHREAD_MLINKS+=pthread_set_name_np.3 pthread_get_name_np.3 \ + pthread_set_name_np.3 pthread_getname_np.3 \ + pthread_set_name_np.3 pthread_setname_np.3 PTHREAD_MLINKS+=pthread_spin_init.3 pthread_spin_destroy.3 \ pthread_spin_lock.3 pthread_spin_trylock.3 \ pthread_spin_lock.3 pthread_spin_unlock.3 Modified: stable/12/share/man/man3/pthread_set_name_np.3 ============================================================================== --- stable/12/share/man/man3/pthread_set_name_np.3 Wed Jun 17 10:42:20 2020 (r362263) +++ stable/12/share/man/man3/pthread_set_name_np.3 Wed Jun 17 10:50:55 2020 (r362264) @@ -24,12 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2018 +.Dd June 3, 2020 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME .Nm pthread_get_name_np , +.Nm pthread_getname_np , .Nm pthread_set_name_np +.Nm pthread_setname_np .Nd set and retrieve the thread name .Sh LIBRARY .Lb libpthread @@ -37,19 +39,27 @@ .In pthread_np.h .Ft void .Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len" +.Ft int +.Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len" .Ft void .Fn pthread_set_name_np "pthread_t thread" "const char *name" +.Ft int +.Fn pthread_setname_np "pthread_t thread" "const char *name" .Sh DESCRIPTION The .Fn pthread_set_name_np -function applies a copy of the given +and +.Fn pthread_setname_np +functions apply a copy of the given .Fa name to the given .Fa thread . .Pp The .Fn pthread_get_name_np -function retrieves the +and +.Fn pthread_getname_np +functions retrieve the .Fa name associated with .Fa thread . @@ -61,7 +71,23 @@ the buffer pointed to by .Fa name will be empty. .Sh ERRORS -Because of the debugging nature of these functions, all errors that may +The +.Nm pthread_getname_np +and +.Nm pthread_setname_np +will fail if +.Bl -tag -width Er +.It Bq Er ESRCH +No thread could be found in the current process corresponding to that +specified by the given thread ID +.Fa thread . +.El +.Pp +Because of the debugging nature of +.Nm pthread_get_name_np +and +.Nm pthread_set_name_np +functions, all errors that may appear inside are silently ignored. .Sh SEE ALSO .Xr thr_set_name 2 @@ -70,6 +96,11 @@ appear inside are silently ignored. and .Fn pthread_get_name_np are non-standard extensions. +.Fn pthread_setname_np +and +.Fn pthread_getname_np +are also non-standard, but are implemented by larger number of operating +systems so they are in fact more portable. .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org From owner-svn-src-all@freebsd.org Wed Jun 17 10:56:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBA6F34ABD5; Wed, 17 Jun 2020 10:56:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n27t4pFsz4cnr; Wed, 17 Jun 2020 10:56:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BD591F404; Wed, 17 Jun 2020 10:56:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HAuwXN093027; Wed, 17 Jun 2020 10:56:58 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HAuwlj093026; Wed, 17 Jun 2020 10:56:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006171056.05HAuwlj093026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 17 Jun 2020 10:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362265 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 362265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 10:56:58 -0000 Author: tsoome Date: Wed Jun 17 10:56:58 2020 New Revision: 362265 URL: https://svnweb.freebsd.org/changeset/base/362265 Log: loader: r362262 did miss the pathlen check While we are checking the "/dev/" prefix, we can skip the paths shorter than this prefix. Sponsored by: Netflix, Klara Inc. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Wed Jun 17 10:50:55 2020 (r362264) +++ head/stand/libsa/zfs/zfsimpl.c Wed Jun 17 10:56:58 2020 (r362265) @@ -1201,7 +1201,7 @@ vdev_init(uint64_t guid, const unsigned char *nvlist, char prefix[] = "/dev/"; len = strlen(prefix); - if (memcmp(path, prefix, len) == 0) { + if (len < pathlen && memcmp(path, prefix, len) == 0) { path += len; pathlen -= len; } From owner-svn-src-all@freebsd.org Wed Jun 17 11:04:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66BE334AE43; Wed, 17 Jun 2020 11:04:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49n2JY5TSjz4dP5; Wed, 17 Jun 2020 11:04:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 05HB4KE7031730 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 17 Jun 2020 14:04:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 05HB4KE7031730 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 05HB4KiM031729; Wed, 17 Jun 2020 14:04:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Jun 2020 14:04:19 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362253 - head/sys/vm Message-ID: <20200617110419.GF45690@kib.kiev.ua> References: <202006162253.05GMruKi046200@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202006162253.05GMruKi046200@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49n2JY5TSjz4dP5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 11:04:30 -0000 On Tue, Jun 16, 2020 at 10:53:56PM +0000, Conrad Meyer wrote: > Author: cem > Date: Tue Jun 16 22:53:56 2020 > New Revision: 362253 > URL: https://svnweb.freebsd.org/changeset/base/362253 > > Log: > vm: Drop vm_map_clip_{start,end} macro wrappers > > No functional change. > > Reviewed by: dougm, markj > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D25282 > > Modified: > head/sys/vm/vm_map.c > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Tue Jun 16 21:30:30 2020 (r362252) > +++ head/sys/vm/vm_map.c Tue Jun 16 22:53:56 2020 (r362253) > @@ -2377,24 +2377,17 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry) > * the specified address; if necessary, > * it splits the entry into two. > */ > -#define vm_map_clip_start(map, entry, startaddr) \ > -{ \ > - if (startaddr > entry->start) \ > - _vm_map_clip_start(map, entry, startaddr); \ > -} > - > -/* > - * This routine is called only when it is known that > - * the entry must be split. > - */ > static inline void > -_vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) > +vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) > { > vm_map_entry_t new_entry; > > + if (start <= entry->start) > + return; > + > VM_MAP_ASSERT_LOCKED(map); > KASSERT(entry->end > start && entry->start < start, > - ("_vm_map_clip_start: invalid clip of entry %p", entry)); > + ("%s: invalid clip of entry %p", __func__, entry)); > > new_entry = vm_map_entry_clone(map, entry); > > @@ -2435,24 +2428,17 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta > * the specified address; if necessary, > * it splits the entry into two. > */ > -#define vm_map_clip_end(map, entry, endaddr) \ > -{ \ > - if ((endaddr) < (entry->end)) \ > - _vm_map_clip_end((map), (entry), (endaddr)); \ > -} > - > -/* > - * This routine is called only when it is known that > - * the entry must be split. > - */ > static inline void > -_vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) > +vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) > { > vm_map_entry_t new_entry; > > + if (end >= entry->end) > + return; > + > VM_MAP_ASSERT_LOCKED(map); > KASSERT(entry->start < end && entry->end > end, > - ("_vm_map_clip_end: invalid clip of entry %p", entry)); > + ("%s: invalid clip of entry %p", __func__, entry)); > > new_entry = vm_map_entry_clone(map, entry); > I would highly appreciate if you revert this commit. It conflicts with https://reviews.freebsd.org/D24652, which must revert your change to remain functional. I probably should not allowed that review to rott silently. From owner-svn-src-all@freebsd.org Wed Jun 17 11:12:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E290734B22D; Wed, 17 Jun 2020 11:12:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n2TQ5c61z4fK5; Wed, 17 Jun 2020 11:12:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB68D1F6B5; Wed, 17 Jun 2020 11:12:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HBCAUl004367; Wed, 17 Jun 2020 11:12:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HBCA56004366; Wed, 17 Jun 2020 11:12:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006171112.05HBCA56004366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 17 Jun 2020 11:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362271 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 362271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 11:12:10 -0000 Author: hselasky Date: Wed Jun 17 11:12:10 2020 New Revision: 362271 URL: https://svnweb.freebsd.org/changeset/base/362271 Log: Allow multicast packets to be received in promiscious mode, in mlx4en(4). Make sure we disable the multicast filter in promiscious mode aswell as when the all multicast flag is set. MFC after: 1 week Found by: Tycho Nightingale Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Wed Jun 17 11:05:13 2020 (r362270) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Wed Jun 17 11:12:10 2020 (r362271) @@ -850,9 +850,11 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv * int err = 0; u64 mcast_addr = 0; - - /* Enable/disable the multicast filter according to IFF_ALLMULTI */ - if (dev->if_flags & IFF_ALLMULTI) { + /* + * Enable/disable the multicast filter according to + * IFF_ALLMULTI and IFF_PROMISC: + */ + if (dev->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 0, MLX4_MCAST_DISABLE); if (err) From owner-svn-src-all@freebsd.org Wed Jun 17 11:14:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E123534B43E; Wed, 17 Jun 2020 11:14:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n2XZ5cc7z4fJZ; Wed, 17 Jun 2020 11:14:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A36611F828; Wed, 17 Jun 2020 11:14:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HBEsD7005481; Wed, 17 Jun 2020 11:14:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HBEsKD005480; Wed, 17 Jun 2020 11:14:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006171114.05HBEsKD005480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 17 Jun 2020 11:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362272 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 11:14:54 -0000 Author: hselasky Date: Wed Jun 17 11:14:54 2020 New Revision: 362272 URL: https://svnweb.freebsd.org/changeset/base/362272 Log: Fix HW TLS offload regression issue after r359919, in mlx5en(4). Changes in the mbuf layout regarding HW TLS, resulted in wrong detection of starting mbuf. Use a boolean variable to handle this and pass m_adj() the top mbuf, so that the packet header is adjusted correctly. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Wed Jun 17 11:12:10 2020 (r362271) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Wed Jun 17 11:14:54 2020 (r362272) @@ -610,7 +610,7 @@ mlx5e_tls_send_nop(struct mlx5e_sq *sq, struct mlx5e_t #define SBTLS_MBUF_NO_DATA ((struct mbuf *)1) static struct mbuf * -sbtls_recover_record(struct mbuf *mb, int wait, uint32_t tcp_old, uint32_t *ptcp_seq) +sbtls_recover_record(struct mbuf *mb, int wait, uint32_t tcp_old, uint32_t *ptcp_seq, bool *pis_start) { struct mbuf *mr, *top; uint32_t offset; @@ -629,6 +629,7 @@ sbtls_recover_record(struct mbuf *mb, int wait, uint32 /* check if we don't need to re-transmit anything */ if (offset == 0) { top = SBTLS_MBUF_NO_DATA; + *pis_start = true; goto done; } @@ -653,13 +654,19 @@ sbtls_recover_record(struct mbuf *mb, int wait, uint32 /* setup packet header length */ top->m_pkthdr.len = mr->m_len = offset; + top->m_len = 0; /* check for partial re-transmit */ delta = *ptcp_seq - tcp_old; if (delta < offset) { - m_adj(mr, offset - delta); + m_adj(top, offset - delta); offset = delta; + + /* continue where we left off */ + *pis_start = false; + } else { + *pis_start = true; } /* @@ -745,10 +752,11 @@ mlx5e_sq_tls_xmit(struct mlx5e_sq *sq, struct mlx5e_xm } if (unlikely(ptls_tag->expected_seq != mb_seq)) { + bool is_start; struct mbuf *r_mb; uint32_t tcp_seq = mb_seq; - r_mb = sbtls_recover_record(mb, M_NOWAIT, ptls_tag->expected_seq, &tcp_seq); + r_mb = sbtls_recover_record(mb, M_NOWAIT, ptls_tag->expected_seq, &tcp_seq, &is_start); if (r_mb == NULL) { MLX5E_TLS_STAT_INC(ptls_tag, tx_error, 1); return (MLX5E_TLS_FAILURE); @@ -757,7 +765,7 @@ mlx5e_sq_tls_xmit(struct mlx5e_sq *sq, struct mlx5e_xm MLX5E_TLS_STAT_INC(ptls_tag, tx_packets_ooo, 1); /* check if this is the first fragment of a TLS record */ - if (r_mb == SBTLS_MBUF_NO_DATA || r_mb->m_data == NULL) { + if (is_start) { /* setup TLS static parameters */ MLX5_SET64(sw_tls_cntx, ptls_tag->crypto_params, param.initial_record_number, rcd_sn); From owner-svn-src-all@freebsd.org Wed Jun 17 11:56:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E12734C260; Wed, 17 Jun 2020 11:56:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n3SB6ZbYz3SPW; Wed, 17 Jun 2020 11:56:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C28791FD2A; Wed, 17 Jun 2020 11:56:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HBuAXF029959; Wed, 17 Jun 2020 11:56:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HBuAvi029958; Wed, 17 Jun 2020 11:56:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006171156.05HBuAvi029958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 17 Jun 2020 11:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362273 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 362273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 11:56:11 -0000 Author: andrew Date: Wed Jun 17 11:56:10 2020 New Revision: 362273 URL: https://svnweb.freebsd.org/changeset/base/362273 Log: Add all the TCR_EL1 fields These will be used when adding support for new Armv8 extensions. Sponsored by: Innovate UK Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Wed Jun 17 11:14:54 2020 (r362272) +++ head/sys/arm64/include/armreg.h Wed Jun 17 11:56:10 2020 (r362273) @@ -736,61 +736,108 @@ #define PSR_FLAGS 0xf0000000 /* TCR_EL1 - Translation Control Register */ -#define TCR_HD_SHIFT 40 -#define TCR_HD (0x1UL << TCR_HD_SHIFT) -#define TCR_HA_SHIFT 39 -#define TCR_HA (0x1UL << TCR_HA_SHIFT) +/* Bits 63:59 are reserved */ +#define TCR_TCMA1_SHIFT 58 +#define TCR_TCMA1 (1UL << TCR_TCMA1_SHIFT) +#define TCR_TCMA0_SHIFT 57 +#define TCR_TCMA0 (1UL << TCR_TCMA0_SHIFT) +#define TCR_E0PD1_SHIFT 56 +#define TCR_E0PD1 (1UL << TCR_E0PD1_SHIFT) +#define TCR_E0PD0_SHIFT 55 +#define TCR_E0PD0 (1UL << TCR_E0PD0_SHIFT) +#define TCR_NFD1_SHIFT 54 +#define TCR_NFD1 (1UL << TCR_NFD1_SHIFT) +#define TCR_NFD0_SHIFT 53 +#define TCR_NFD0 (1UL << TCR_NFD0_SHIFT) +#define TCR_TBID1_SHIFT 52 +#define TCR_TBID1 (1UL << TCR_TBID1_SHIFT) +#define TCR_TBID0_SHIFT 51 +#define TCR_TBID0 (1UL << TCR_TBID0_SHIFT) +#define TCR_HWU162_SHIFT 50 +#define TCR_HWU162 (1UL << TCR_HWU162_SHIFT) +#define TCR_HWU161_SHIFT 49 +#define TCR_HWU161 (1UL << TCR_HWU161_SHIFT) +#define TCR_HWU160_SHIFT 48 +#define TCR_HWU160 (1UL << TCR_HWU160_SHIFT) +#define TCR_HWU159_SHIFT 47 +#define TCR_HWU159 (1UL << TCR_HWU159_SHIFT) +#define TCR_HWU1 \ + (TCR_HWU159 | TCR_HWU160 | TCR_HWU161 | TCR_HWU162) +#define TCR_HWU062_SHIFT 46 +#define TCR_HWU062 (1UL << TCR_HWU062_SHIFT) +#define TCR_HWU061_SHIFT 45 +#define TCR_HWU061 (1UL << TCR_HWU061_SHIFT) +#define TCR_HWU060_SHIFT 44 +#define TCR_HWU060 (1UL << TCR_HWU060_SHIFT) +#define TCR_HWU059_SHIFT 43 +#define TCR_HWU059 (1UL << TCR_HWU059_SHIFT) +#define TCR_HWU0 \ + (TCR_HWU059 | TCR_HWU060 | TCR_HWU061 | TCR_HWU062) +#define TCR_HPD1_SHIFT 42 +#define TCR_HPD1 (1UL << TCR_HPD1_SHIFT) +#define TCR_HPD0_SHIFT 41 +#define TCR_HPD0 (1UL << TCR_HPD0_SHIFT) +#define TCR_HD_SHIFT 40 +#define TCR_HD (1UL << TCR_HD_SHIFT) +#define TCR_HA_SHIFT 39 +#define TCR_HA (1UL << TCR_HA_SHIFT) +#define TCR_TBI1_SHIFT 38 +#define TCR_TBI1 (1UL << TCR_TBI1_SHIFT +#define TCR_TBI0_SHIFT 37 +#define TCR_TBI0 (1U << TCR_TBI0_SHIFT) +#define TCR_ASID_SHIFT 36 +#define TCR_ASID_WIDTH 1 +#define TCR_ASID_16 (1UL << TCR_ASID_SHIFT) +/* Bit 35 is reserved */ +#define TCR_IPS_SHIFT 32 +#define TCR_IPS_WIDTH 3 +#define TCR_IPS_32BIT (0UL << TCR_IPS_SHIFT) +#define TCR_IPS_36BIT (1UL << TCR_IPS_SHIFT) +#define TCR_IPS_40BIT (2UL << TCR_IPS_SHIFT) +#define TCR_IPS_42BIT (3UL << TCR_IPS_SHIFT) +#define TCR_IPS_44BIT (4UL << TCR_IPS_SHIFT) +#define TCR_IPS_48BIT (5UL << TCR_IPS_SHIFT) +#define TCR_TG1_SHIFT 30 +#define TCR_TG1_16K (1UL << TCR_TG1_SHIFT) +#define TCR_TG1_4K (2UL << TCR_TG1_SHIFT) +#define TCR_TG1_64K (3UL << TCR_TG1_SHIFT) +#define TCR_SH1_SHIFT 28 +#define TCR_SH1_IS (3UL << TCR_SH1_SHIFT) +#define TCR_ORGN1_SHIFT 26 +#define TCR_ORGN1_WBWA (1UL << TCR_ORGN1_SHIFT) +#define TCR_IRGN1_SHIFT 24 +#define TCR_IRGN1_WBWA (1UL << TCR_IRGN1_SHIFT) +#define TCR_EPD1_SHIFT 23 +#define TCR_EPD1 (1UL << TCR_EPD1_SHIFT) +#define TCR_A1_SHIFT 22 +#define TCR_A1 (0x1UL << TCR_A1_SHIFT) +#define TCR_T1SZ_SHIFT 16 +#define TCR_T1SZ(x) ((x) << TCR_T1SZ_SHIFT) +#define TCR_TG0_SHIFT 14 +#define TCR_TG0_16K (1UL << TCR_TG0_SHIFT) +#define TCR_TG0_4K (2UL << TCR_TG0_SHIFT) +#define TCR_TG0_64K (3UL << TCR_TG0_SHIFT) +#define TCR_SH0_SHIFT 12 +#define TCR_SH0_IS (3UL << TCR_SH0_SHIFT) +#define TCR_ORGN0_SHIFT 10 +#define TCR_ORGN0_WBWA (1UL << TCR_ORGN0_SHIFT) +#define TCR_IRGN0_SHIFT 8 +#define TCR_IRGN0_WBWA (1UL << TCR_IRGN0_SHIFT) +#define TCR_EPD0_SHIFT 7 +#define TCR_EPD0 (1UL << TCR_EPD1_SHIFT) +/* Bit 6 is reserved */ +#define TCR_T0SZ_SHIFT 0 +#define TCR_T0SZ_MASK 0x3f +#define TCR_T0SZ(x) ((x) << TCR_T0SZ_SHIFT) +#define TCR_TxSZ(x) (TCR_T1SZ(x) | TCR_T0SZ(x)) -#define TCR_ASID_SHIFT 36 -#define TCR_ASID_WIDTH 1 -#define TCR_ASID_16 (0x1UL << TCR_ASID_SHIFT) - -#define TCR_IPS_SHIFT 32 -#define TCR_IPS_WIDTH 3 -#define TCR_IPS_32BIT (0 << TCR_IPS_SHIFT) -#define TCR_IPS_36BIT (1 << TCR_IPS_SHIFT) -#define TCR_IPS_40BIT (2 << TCR_IPS_SHIFT) -#define TCR_IPS_42BIT (3 << TCR_IPS_SHIFT) -#define TCR_IPS_44BIT (4 << TCR_IPS_SHIFT) -#define TCR_IPS_48BIT (5 << TCR_IPS_SHIFT) - -#define TCR_TG1_SHIFT 30 -#define TCR_TG1_16K (1 << TCR_TG1_SHIFT) -#define TCR_TG1_4K (2 << TCR_TG1_SHIFT) -#define TCR_TG1_64K (3 << TCR_TG1_SHIFT) - -#define TCR_TG0_MASK 0x000000000000c000 - -#define TCR_SH1_SHIFT 28 -#define TCR_SH1_IS (0x3UL << TCR_SH1_SHIFT) -#define TCR_ORGN1_SHIFT 26 -#define TCR_ORGN1_WBWA (0x1UL << TCR_ORGN1_SHIFT) -#define TCR_IRGN1_SHIFT 24 -#define TCR_IRGN1_WBWA (0x1UL << TCR_IRGN1_SHIFT) -#define TCR_A1_SHIFT 22 -#define TCR_A1 (0x1UL << TCR_A1_SHIFT) -#define TCR_SH0_SHIFT 12 -#define TCR_SH0_IS (0x3UL << TCR_SH0_SHIFT) -#define TCR_ORGN0_SHIFT 10 -#define TCR_ORGN0_WBWA (0x1UL << TCR_ORGN0_SHIFT) -#define TCR_IRGN0_SHIFT 8 -#define TCR_IRGN0_WBWA (0x1UL << TCR_IRGN0_SHIFT) - #define TCR_CACHE_ATTRS ((TCR_IRGN0_WBWA | TCR_IRGN1_WBWA) |\ (TCR_ORGN0_WBWA | TCR_ORGN1_WBWA)) - #ifdef SMP #define TCR_SMP_ATTRS (TCR_SH0_IS | TCR_SH1_IS) #else #define TCR_SMP_ATTRS 0 #endif - -#define TCR_T1SZ_SHIFT 16 -#define TCR_T0SZ_SHIFT 0 -#define TCR_T0SZ_MASK 0x3f -#define TCR_T1SZ(x) ((x) << TCR_T1SZ_SHIFT) -#define TCR_T0SZ(x) ((x) << TCR_T0SZ_SHIFT) -#define TCR_TxSZ(x) (TCR_T1SZ(x) | TCR_T0SZ(x)) /* Saved Program Status Register */ #define DBG_SPSR_SS (0x1 << 21) From owner-svn-src-all@freebsd.org Wed Jun 17 11:57:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDE3D34C701; Wed, 17 Jun 2020 11:57:48 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n3V44cy6z3SVJ; Wed, 17 Jun 2020 11:57:48 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9954920080; Wed, 17 Jun 2020 11:57:48 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HBvmRD030076; Wed, 17 Jun 2020 11:57:48 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HBvmk8030075; Wed, 17 Jun 2020 11:57:48 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006171157.05HBvmk8030075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Wed, 17 Jun 2020 11:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362274 - head/contrib/tzcode/stdtime X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/contrib/tzcode/stdtime X-SVN-Commit-Revision: 362274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 11:57:48 -0000 Author: gbe (doc committer) Date: Wed Jun 17 11:57:48 2020 New Revision: 362274 URL: https://svnweb.freebsd.org/changeset/base/362274 Log: ctime(3): Bump .Dd after r362165 Reported by: bcr (mentor) Reviewed by: bcr (mentor) Approved by: bcr (mentor) X-MFC-With: r362165 Modified: head/contrib/tzcode/stdtime/ctime.3 Modified: head/contrib/tzcode/stdtime/ctime.3 ============================================================================== --- head/contrib/tzcode/stdtime/ctime.3 Wed Jun 17 11:56:10 2020 (r362273) +++ head/contrib/tzcode/stdtime/ctime.3 Wed Jun 17 11:57:48 2020 (r362274) @@ -30,7 +30,7 @@ .\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 22, 2020 +.Dd June 14, 2020 .Dt CTIME 3 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Jun 17 13:27:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C55C34EF24; Wed, 17 Jun 2020 13:27:13 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n5TF3mYbz3Y36; Wed, 17 Jun 2020 13:27:13 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7979D21089; Wed, 17 Jun 2020 13:27:13 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HDRDYG085207; Wed, 17 Jun 2020 13:27:13 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HDRDPL085206; Wed, 17 Jun 2020 13:27:13 GMT (envelope-from thj@FreeBSD.org) Message-Id: <202006171327.05HDRDPL085206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Wed, 17 Jun 2020 13:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362275 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 13:27:13 -0000 Author: thj Date: Wed Jun 17 13:27:13 2020 New Revision: 362275 URL: https://svnweb.freebsd.org/changeset/base/362275 Log: Add header definition for RFC4340, Datagram Congestion Control Protocol Add a header definition for DCCP as defined in RFC4340. This header definition is required to perform validation when receiving and forwarding DCCP packets. We do not currently support DCCP. Reviewed by: gallatin, bz Approved by: bz (co-mentor) MFC after: 1 week MFC with: 350749 Differential Revision: https://reviews.freebsd.org/D21179 Added: head/sys/netinet/dccp.h (contents, props changed) Added: head/sys/netinet/dccp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/dccp.h Wed Jun 17 13:27:13 2020 (r362275) @@ -0,0 +1,78 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Tom Jones + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_DCCP_H_ +#define _NETINET_DCCP_H_ + +/* DCCP protocol header as per RFC4340 */ +struct dccphdr { + uint16_t d_sport; + uint16_t d_dport; + uint8_t d_doff; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t d_cscov:4, + d_ccval:4; +#endif +#if BYTE_ORDER == BIG_ENDIAN + uint8_t d_ccval:4, + d_cscov:4; +#endif + uint8_t d_cksum[2]; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t d_res:3, + d_type:4, + d_x:1; +#endif +#if BYTE_ORDER == BIG_ENDIAN + uint8_t d_x:1, + d_type:4, + d_res:3; +#endif + /* + * Provide enough space for both the short (24 bit) sequence number and + * the long (48 bit) sequene number and a leading reserved byte in + * front of the long sequence number. + */ + union dccp_seqno { + uint8_t shortseq[3]; + struct dccp_long_seqno { + uint8_t res; + uint8_t seq[6]; + } longseq; + } d_seqno; +}; + +#define d_seqno_short d_seqno.shortseq; +#define d_seqno_long d_seqno.longseq.seq; + +#define DCCP_SHORTHDR 12 +#define DCCP_LONGHDR 16 +#define DCCP_EXTHDR 0x80 + +#endif /* _NETINET_DCCP_H */ From owner-svn-src-all@freebsd.org Wed Jun 17 13:46:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F185C34F918; Wed, 17 Jun 2020 13:46:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n5v165Xvz3Yhk; Wed, 17 Jun 2020 13:46:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C829621408; Wed, 17 Jun 2020 13:46:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HDk5Lw096921; Wed, 17 Jun 2020 13:46:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HDk5AF096920; Wed, 17 Jun 2020 13:46:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006171346.05HDk5AF096920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jun 2020 13:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362276 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 362276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 13:46:06 -0000 Author: markj Date: Wed Jun 17 13:46:05 2020 New Revision: 362276 URL: https://svnweb.freebsd.org/changeset/base/362276 Log: MFC r362037: Fix a couple of nits in Linux sysinfo(2) emulation. Modified: stable/12/sys/compat/linux/linux_misc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Wed Jun 17 13:27:13 2020 (r362275) +++ stable/12/sys/compat/linux/linux_misc.c Wed Jun 17 13:46:05 2020 (r362276) @@ -131,8 +131,8 @@ struct l_sysinfo { l_ulong freeswap; /* swap space still available */ l_ushort procs; /* Number of current processes */ l_ushort pads; - l_ulong totalbig; - l_ulong freebig; + l_ulong totalhigh; + l_ulong freehigh; l_uint mem_unit; char _f[20-2*sizeof(l_long)-sizeof(l_int)]; /* padding */ }; @@ -164,7 +164,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; sysinfo.totalram = physmem * PAGE_SIZE; - sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; + sysinfo.freeram = (u_long)vm_free_count() * PAGE_SIZE; /* * sharedram counts pages allocated to named, swap-backed objects such @@ -181,9 +181,13 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ sysinfo.procs = nprocs; - /* The following are only present in newer Linux kernels. */ - sysinfo.totalbig = 0; - sysinfo.freebig = 0; + /* + * Platforms supported by the emulation layer do not have a notion of + * high memory. + */ + sysinfo.totalhigh = 0; + sysinfo.freehigh = 0; + sysinfo.mem_unit = 1; return (copyout(&sysinfo, args->info, sizeof(sysinfo))); From owner-svn-src-all@freebsd.org Wed Jun 17 15:16:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C285C351454; Wed, 17 Jun 2020 15:16:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n7tt4pKJz3fNR; Wed, 17 Jun 2020 15:16:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 9A7491DB54; Wed, 17 Jun 2020 15:16:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f52.google.com with SMTP id d12so1198568qvn.0; Wed, 17 Jun 2020 08:16:06 -0700 (PDT) X-Gm-Message-State: AOAM530P4pDkG4vFB8jdT1yTXHXzfOrBGMs6yv2vbqZ1EuffW15JmNXr Mj6FnBubRV7yYSUuRy583NuxdC39O8UjICn6wj4= X-Google-Smtp-Source: ABdhPJwDPKqFJP4NLdidJNCmHtf/LKGloRq9d03QKSXdbrwyEz+gu4Com25V/J0S01IGHQMY/nZscmTyiPa3NKc5xkE= X-Received: by 2002:a0c:9ba0:: with SMTP id o32mr8059774qve.129.1592406965782; Wed, 17 Jun 2020 08:16:05 -0700 (PDT) MIME-Version: 1.0 References: <202006091517.059FHNS9050196@repo.freebsd.org> In-Reply-To: <202006091517.059FHNS9050196@repo.freebsd.org> From: Kyle Evans Date: Wed, 17 Jun 2020 10:15:53 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361967 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 15:16:06 -0000 On Tue, Jun 9, 2020 at 10:17 AM Mateusz Guzik wrote: > > Author: mjg > Date: Tue Jun 9 15:17:23 2020 > New Revision: 361967 > URL: https://svnweb.freebsd.org/changeset/base/361967 > > Log: > Assert on pg_jobc state. > > Stolen from NetBSD. > > Modified: > head/sys/kern/kern_proc.c > > Modified: head/sys/kern/kern_proc.c > ============================================================================== > --- head/sys/kern/kern_proc.c Tue Jun 9 14:20:16 2020 (r361966) > +++ head/sys/kern/kern_proc.c Tue Jun 9 15:17:23 2020 (r361967) > @@ -751,9 +751,11 @@ pgadjustjobc(struct pgrp *pgrp, int entering) > { > > PGRP_LOCK(pgrp); > - if (entering) > + if (entering) { > + MPASS(pgrp->pg_jobc >= 0); > pgrp->pg_jobc++; > - else { > + } else { > + MPASS(pgrp->pg_jobc > 0); > --pgrp->pg_jobc; > if (pgrp->pg_jobc == 0) > orphanpg(pgrp); We seem to be doing something wrong here, but I'm still working on reproducing it on a machine that actually has usable swap configured to get a dump. I've hit one of these asserts just from hitting the power button to shutoff from within xfce (hitting the latter branch with pgrp->pg_jobc == 0 IIRC) and another laptop panicked sometime overnight -- I wasn't able to catch the second one at all, because it's hooked up to a switch that loses its mind once that laptop panicks and it had to be rebooted before I could attend to it to revive network for the other machines on the switch. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed Jun 17 15:21:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1327535162A; Wed, 17 Jun 2020 15:21:32 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n8175KCZz3fSH; Wed, 17 Jun 2020 15:21:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id b6so2747727wrs.11; Wed, 17 Jun 2020 08:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7DOieZxSPzOesXmGB831iUe8+s/KMxTVMzadqxkXk7Q=; b=ZjHLDj4+IY79BX423WWkJRHLHxLNPPRb2cs5xRpi9YjQPxPPsC2ZHo3yJJ0mXht4cQ R2LxjvBr6903VIKpBjcDPRqMRXMMfsziwdjhWRdfN5AMKXqvbyZLgG7InxuvScaUaMN4 JK65Zzgfclrj1RNmZ39QLhdjGv5Iaci99AhxMxbW+EK9DnOaRJ8fH/gWVqnGGB2U2FSO n5h3FzdSzwhmAMmxmrxaMl4B/YffVCChlI611tpDU8NcQiPvgWr7X0SvSYKHljuXUl75 Ca+lqv5F2UXT7KnhHDaBfvgAj4k3AP/ci+Wx58W1swvhnyXNRvWSpWJc0SktyIh6DktO JsOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7DOieZxSPzOesXmGB831iUe8+s/KMxTVMzadqxkXk7Q=; b=YIaBMyWeWcax23IRX8G7t033T2Bxv8nb5NBSXxdQw/S0lgU6mAfmljpb7fcZxIUm5k ZOOnzOzp3CN6sd3YsPbAv13FyLUEUohwEbxwMFrzYzXEsby4zTBBcNRdVWgUfqdqGCfc I6Xphm91edxx7ArzBywkN78VzI0tNlbQG/EncYWxBAtR/cnF/LumiKJWaZSt+tgEesiF LEWnImzHY6N+s8TXDddrHR7mZEx8VsWctZYEKjC4FPhi4tIID2gO1jf+kEukwMlV+H65 fqzzLQAyJncr66yaJNJ7EeV3nGQwx78BRF15QvywRvgvuMD8N32mzEy/hQhEJss71Gwl r0Lg== X-Gm-Message-State: AOAM5338DSjUea9zZ9Jaws3Vrl4hSfAm5dPcm3QX+BQqSHClCT4a4MRw oL22uZvqs2KiaLNwveBiYDMnCo01lVDpdC4GWKU9lBLA X-Google-Smtp-Source: ABdhPJxqCvtp7DVCYnTR1Kr9ljcI/CjCPugSzPKj/WBD2dYP8KO/M5Boh2HrnTLY0pNc5aOC9cI2AgX+yaGREkQQXmA= X-Received: by 2002:adf:a350:: with SMTP id d16mr9348816wrb.237.1592407288849; Wed, 17 Jun 2020 08:21:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:45c9:0:0:0:0:0 with HTTP; Wed, 17 Jun 2020 08:21:27 -0700 (PDT) In-Reply-To: References: <202006091517.059FHNS9050196@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 17 Jun 2020 17:21:27 +0200 Message-ID: Subject: Re: svn commit: r361967 - head/sys/kern To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49n8175KCZz3fSH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 15:21:32 -0000 pho@ reported triggering one of the asserts: https://people.freebsd.org/~pho/stress/log/mjguzik028.txt I did not have the time to properly investigate this yet and this does not reproduce for me. That said, I may either revert the assert (or degrade to a warning) or add some commentary if I don't sort this out this week. On 6/17/20, Kyle Evans wrote: > On Tue, Jun 9, 2020 at 10:17 AM Mateusz Guzik wrote: >> >> Author: mjg >> Date: Tue Jun 9 15:17:23 2020 >> New Revision: 361967 >> URL: https://svnweb.freebsd.org/changeset/base/361967 >> >> Log: >> Assert on pg_jobc state. >> >> Stolen from NetBSD. >> >> Modified: >> head/sys/kern/kern_proc.c >> >> Modified: head/sys/kern/kern_proc.c >> ============================================================================== >> --- head/sys/kern/kern_proc.c Tue Jun 9 14:20:16 2020 (r361966) >> +++ head/sys/kern/kern_proc.c Tue Jun 9 15:17:23 2020 (r361967) >> @@ -751,9 +751,11 @@ pgadjustjobc(struct pgrp *pgrp, int entering) >> { >> >> PGRP_LOCK(pgrp); >> - if (entering) >> + if (entering) { >> + MPASS(pgrp->pg_jobc >= 0); >> pgrp->pg_jobc++; >> - else { >> + } else { >> + MPASS(pgrp->pg_jobc > 0); >> --pgrp->pg_jobc; >> if (pgrp->pg_jobc == 0) >> orphanpg(pgrp); > > We seem to be doing something wrong here, but I'm still working on > reproducing it on a machine that actually has usable swap configured > to get a dump. I've hit one of these asserts just from hitting the > power button to shutoff from within xfce (hitting the latter branch > with pgrp->pg_jobc == 0 IIRC) and another laptop panicked sometime > overnight -- I wasn't able to catch the second one at all, because > it's hooked up to a switch that loses its mind once that laptop > panicks and it had to be rebooted before I could attend to it to > revive network for the other machines on the switch. > > Thanks, > > Kyle Evans > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Wed Jun 17 15:27:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2639435184F; Wed, 17 Jun 2020 15:27:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n88L0DYpz3g4k; Wed, 17 Jun 2020 15:27:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 030B922453; Wed, 17 Jun 2020 15:27:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HFRjx4057675; Wed, 17 Jun 2020 15:27:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HFRj4N057674; Wed, 17 Jun 2020 15:27:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006171527.05HFRj4N057674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Jun 2020 15:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362277 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 15:27:46 -0000 Author: tuexen Date: Wed Jun 17 15:27:45 2020 New Revision: 362277 URL: https://svnweb.freebsd.org/changeset/base/362277 Log: Allow the self reference to be NULL in case the timer was stopped. Submitted by: Timo Voelker MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Jun 17 13:46:05 2020 (r362276) +++ head/sys/netinet/sctputil.c Wed Jun 17 15:27:45 2020 (r362277) @@ -1730,7 +1730,7 @@ sctp_timeout_handler(void *t) #endif /* sanity checks... */ - KASSERT(tmr->self == tmr, + KASSERT(tmr->self == NULL || tmr->self == tmr, ("sctp_timeout_handler: tmr->self corrupted")); KASSERT(SCTP_IS_TIMER_TYPE_VALID(tmr->type), ("sctp_timeout_handler: invalid timer type %d", tmr->type)); From owner-svn-src-all@freebsd.org Wed Jun 17 15:54:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0940352297; Wed, 17 Jun 2020 15:54:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n8ld43WMz3y1B; Wed, 17 Jun 2020 15:54:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C248229EF; Wed, 17 Jun 2020 15:54:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HFsrSj075948; Wed, 17 Jun 2020 15:54:53 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HFspLc075936; Wed, 17 Jun 2020 15:54:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <202006171554.05HFspLc075936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Jun 2020 15:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362278 - in head/sys: arm64/coresight conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: arm64/coresight conf X-SVN-Commit-Revision: 362278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 15:54:53 -0000 Author: br Date: Wed Jun 17 15:54:51 2020 New Revision: 362278 URL: https://svnweb.freebsd.org/changeset/base/362278 Log: Complete the ACPI support for ARM Coresight: o Parse the ACPI DSD (Device Specific Data) graph property and record device connections. o Split-out FDT support to a separate file. o Get the corresponding (FDT/ACPI) Coresight platform data in the device drivers. Sponsored by: DARPA, AFRL Added: head/sys/arm64/coresight/coresight_acpi.c (contents, props changed) head/sys/arm64/coresight/coresight_fdt.c (contents, props changed) Modified: head/sys/arm64/coresight/coresight.c head/sys/arm64/coresight/coresight.h head/sys/arm64/coresight/coresight_cmd.c head/sys/arm64/coresight/coresight_cpu_debug.c head/sys/arm64/coresight/coresight_etm4x.c head/sys/arm64/coresight/coresight_etm4x.h head/sys/arm64/coresight/coresight_etm4x_acpi.c head/sys/arm64/coresight/coresight_etm4x_fdt.c head/sys/arm64/coresight/coresight_funnel.c head/sys/arm64/coresight/coresight_funnel.h head/sys/arm64/coresight/coresight_funnel_acpi.c head/sys/arm64/coresight/coresight_funnel_fdt.c head/sys/arm64/coresight/coresight_replicator.c head/sys/arm64/coresight/coresight_replicator.h head/sys/arm64/coresight/coresight_replicator_acpi.c head/sys/arm64/coresight/coresight_replicator_fdt.c head/sys/arm64/coresight/coresight_tmc.c head/sys/arm64/coresight/coresight_tmc.h head/sys/arm64/coresight/coresight_tmc_acpi.c head/sys/arm64/coresight/coresight_tmc_fdt.c head/sys/conf/files.arm64 Modified: head/sys/arm64/coresight/coresight.c ============================================================================== --- head/sys/arm64/coresight/coresight.c Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight.c Wed Jun 17 15:54:51 2020 (r362278) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2020 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -41,78 +41,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include -MALLOC_DEFINE(M_CORESIGHT, "coresight", "ARM Coresight"); static struct mtx cs_mtx; - struct coresight_device_list cs_devs; -static int -coresight_get_ports(phandle_t dev_node, - struct coresight_platform_data *pdata) -{ - phandle_t node, child; - pcell_t port_reg; - phandle_t xref; - char *name; - int ret; - phandle_t endpoint_child; - struct endpoint *endp; - - child = ofw_bus_find_child(dev_node, "ports"); - if (child) - node = child; - else - node = dev_node; - - for (child = OF_child(node); child != 0; child = OF_peer(child)) { - ret = OF_getprop_alloc(child, "name", (void **)&name); - if (ret == -1) - continue; - - if (strcasecmp(name, "port") || - strncasecmp(name, "port@", 6)) { - - port_reg = -1; - OF_getencprop(child, "reg", (void *)&port_reg, - sizeof(port_reg)); - - endpoint_child = ofw_bus_find_child(child, "endpoint"); - if (endpoint_child) { - if (OF_getencprop(endpoint_child, - "remote-endpoint", &xref, - sizeof(xref)) == -1) { - printf("failed\n"); - continue; - } - endp = malloc(sizeof(struct endpoint), - M_CORESIGHT, M_WAITOK | M_ZERO); - endp->my_node = endpoint_child; - endp->their_node = OF_node_from_xref(xref); - endp->dev_node = dev_node; - endp->reg = port_reg; - if (OF_getproplen(endpoint_child, - "slave-mode") >= 0) { - pdata->in_ports++; - endp->slave = 1; - } else - pdata->out_ports++; - - mtx_lock(&pdata->mtx_lock); - TAILQ_INSERT_TAIL(&pdata->endpoints, - endp, link); - mtx_unlock(&pdata->mtx_lock); - } - } - } - - return (0); -} - int coresight_register(struct coresight_desc *desc) { @@ -121,7 +54,6 @@ coresight_register(struct coresight_desc *desc) cs_dev = malloc(sizeof(struct coresight_device), M_CORESIGHT, M_WAITOK | M_ZERO); cs_dev->dev = desc->dev; - cs_dev->node = ofw_bus_get_node(desc->dev); cs_dev->pdata = desc->pdata; cs_dev->dev_type = desc->dev_type; @@ -141,7 +73,7 @@ coresight_get_output_endpoint(struct coresight_platfor return (NULL); TAILQ_FOREACH(endp, &pdata->endpoints, link) { - if (endp->slave == 0) + if (endp->input == 0) return (endp); } @@ -151,62 +83,36 @@ coresight_get_output_endpoint(struct coresight_platfor struct coresight_device * coresight_get_output_device(struct endpoint *endp, struct endpoint **out_endp) { + struct coresight_platform_data *pdata; struct coresight_device *cs_dev; struct endpoint *endp2; TAILQ_FOREACH(cs_dev, &cs_devs, link) { + pdata = cs_dev->pdata; TAILQ_FOREACH(endp2, &cs_dev->pdata->endpoints, link) { - if (endp->their_node == endp2->my_node) { - *out_endp = endp2; - return (cs_dev); + switch (pdata->bus_type) { + case CORESIGHT_BUS_FDT: +#ifdef FDT + if (endp->their_node == endp2->my_node) { + *out_endp = endp2; + return (cs_dev); + } +#endif + break; + + case CORESIGHT_BUS_ACPI: +#ifdef DEV_ACPI + if (endp->their_handle == endp2->my_handle) { + *out_endp = endp2; + return (cs_dev); + } +#endif + break; } } } return (NULL); -} - -static int -coresight_get_cpu(phandle_t node, - struct coresight_platform_data *pdata) -{ - phandle_t cpu_node; - pcell_t xref; - pcell_t cpu_reg; - - if (OF_getencprop(node, "cpu", &xref, sizeof(xref)) != -1) { - cpu_node = OF_node_from_xref(xref); - if (OF_getencprop(cpu_node, "reg", (void *)&cpu_reg, - sizeof(cpu_reg)) > 0) { - pdata->cpu = cpu_reg; - return (0); - } - } - - return (-1); -} - -struct coresight_platform_data * -coresight_get_platform_data(device_t dev) -{ - struct coresight_platform_data *pdata; - phandle_t node; - - node = ofw_bus_get_node(dev); - - pdata = malloc(sizeof(struct coresight_platform_data), - M_CORESIGHT, M_WAITOK | M_ZERO); - mtx_init(&pdata->mtx_lock, "Coresight Platform Data", NULL, MTX_DEF); - TAILQ_INIT(&pdata->endpoints); - - coresight_get_cpu(node, pdata); - coresight_get_ports(node, pdata); - - if (bootverbose) - printf("Total ports: in %d out %d\n", - pdata->in_ports, pdata->out_ports); - - return (pdata); } static void Modified: head/sys/arm64/coresight/coresight.h ============================================================================== --- head/sys/arm64/coresight/coresight.h Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight.h Wed Jun 17 15:54:51 2020 (r362278) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2020 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -33,8 +33,20 @@ #ifndef _ARM64_CORESIGHT_CORESIGHT_H_ #define _ARM64_CORESIGHT_CORESIGHT_H_ +#include "opt_acpi.h" +#include "opt_platform.h" + +#include + +#ifdef FDT #include +#endif +#ifdef DEV_ACPI +#include +#include +#endif + #define CORESIGHT_ITCTRL 0xf00 #define CORESIGHT_CLAIMSET 0xfa0 #define CORESIGHT_CLAIMCLR 0xfa4 @@ -53,20 +65,30 @@ enum cs_dev_type { CORESIGHT_CPU_DEBUG, }; +enum cs_bus_type { + CORESIGHT_BUS_ACPI, + CORESIGHT_BUS_FDT, +}; + struct coresight_device { TAILQ_ENTRY(coresight_device) link; device_t dev; - phandle_t node; enum cs_dev_type dev_type; struct coresight_platform_data *pdata; }; struct endpoint { TAILQ_ENTRY(endpoint) link; +#ifdef FDT phandle_t my_node; phandle_t their_node; phandle_t dev_node; - boolean_t slave; +#endif +#ifdef DEV_ACPI + ACPI_HANDLE their_handle; + ACPI_HANDLE my_handle; +#endif + boolean_t input; int reg; struct coresight_device *cs_dev; LIST_ENTRY(endpoint) endplink; @@ -78,6 +100,7 @@ struct coresight_platform_data { int out_ports; struct mtx mtx_lock; TAILQ_HEAD(endpoint_list, endpoint) endpoints; + enum cs_bus_type bus_type; }; struct coresight_desc { @@ -125,7 +148,10 @@ struct etm_config { uint8_t excp_level; }; -struct coresight_platform_data * coresight_get_platform_data(device_t dev); +static MALLOC_DEFINE(M_CORESIGHT, "coresight", "ARM Coresight"); + +struct coresight_platform_data *coresight_fdt_get_platform_data(device_t dev); +struct coresight_platform_data *coresight_acpi_get_platform_data(device_t dev); struct endpoint * coresight_get_output_endpoint(struct coresight_platform_data *pdata); struct coresight_device * coresight_get_output_device(struct endpoint *endp, struct endpoint **); int coresight_register(struct coresight_desc *desc); Added: head/sys/arm64/coresight/coresight_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight_acpi.c Wed Jun 17 15:54:51 2020 (r362278) @@ -0,0 +1,373 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define ACPI_CORESIGHT_LINK_OUTPUT 1 +#define ACPI_CORESIGHT_LINK_INPUT 0 + +static const struct uuid acpi_graph_uuid = { + 0xab02a46b, 0x74c7, 0x45a2, 0xbd, 0x68, + { 0xf7, 0xd3, 0x44, 0xef, 0x21, 0x53 }, +}; + +static const struct uuid coresight_graph_uuid = { + 0x3ecbc8b6, 0x1d0e, 0x4fb3, 0x81, 0x07, + { 0xe6, 0x27, 0xf8, 0x05, 0xc6, 0xcd }, +}; + +static inline bool +cs_acpi_validate_dsd_graph(const union acpi_object *graph) +{ + const union acpi_object *rev, *nr_graphs; + const union acpi_object *obj; + int i, n; + + if (graph->Package.Count < 2) + return (false); + + rev = &graph->Package.Elements[0]; + nr_graphs = &graph->Package.Elements[1]; + + if (rev->Type != ACPI_TYPE_INTEGER || + nr_graphs->Type != ACPI_TYPE_INTEGER) + return (false); + + /* Revision 0 supported only. */ + if (rev->Integer.Value != 0) + return (false); + + /* We are looking for a single graph. */ + n = nr_graphs->Integer.Value; + if (n != 1) + return (false); + + /* Check the number of elements. */ + if (graph->Package.Count != (n + 2)) + return (false); + + for (i = 2; i < n + 2; i++) { + obj = &graph->Package.Elements[i]; + if (obj->Type != ACPI_TYPE_PACKAGE || obj->Package.Count < 3) + return (false); + } + + return (true); +} + +static inline bool +cs_is_acpi_guid(const union acpi_object *obj) +{ + + return (obj->Type == ACPI_TYPE_BUFFER) && (obj->Buffer.Length == 16); +} + +static inline bool +cs_guid_equal(const struct uuid *u1, const struct uuid *u2) +{ + + if (memcmp(u1, u2, 16) == 0) + return (true); + + return (false); +} + +static inline bool +cs_acpi_guid_matches(const union acpi_object *obj, const struct uuid *guid) +{ + + if (cs_is_acpi_guid(obj) && + cs_guid_equal((struct uuid *)obj->Buffer.Pointer, guid)) + return (true); + + return (false); +} + +static inline bool +is_acpi_dsd_graph_guid(const union acpi_object *obj) +{ + + return (cs_acpi_guid_matches(obj, &acpi_graph_uuid)); +} + +static inline bool +cs_is_acpi_coresight_graph_guid(const union acpi_object *obj) +{ + + return (cs_acpi_guid_matches(obj, &coresight_graph_uuid)); +} + +static inline bool +cs_is_acpi_coresight_graph(const union acpi_object *obj) +{ + const union acpi_object *graphid, *guid, *links; + + if (obj->Type != ACPI_TYPE_PACKAGE || + obj->Package.Count < 3) + return (false); + + graphid = &obj->Package.Elements[0]; + guid = &obj->Package.Elements[1]; + links = &obj->Package.Elements[2]; + + if (graphid->Type != ACPI_TYPE_INTEGER || + links->Type != ACPI_TYPE_INTEGER) + return (false); + + if (cs_is_acpi_coresight_graph_guid(guid)) + return (true); + + return (false); +} + +static const union acpi_object * +cs_get_dsd_graph(device_t dev) +{ + const union acpi_object *guid, *package; + union acpi_object *dsd; + ACPI_STATUS status; + ACPI_BUFFER buf; + device_t bus; + int i; + + buf.Length = PAGE_SIZE; + buf.Pointer = malloc(buf.Length, M_TEMP, M_NOWAIT | M_ZERO); + if (buf.Pointer == NULL) { + printf("Failed to allocate memory.\n"); + return (NULL); + } + + bus = device_get_parent(dev); + status = ACPI_EVALUATE_OBJECT(bus, dev, "_DSD", NULL, &buf); + if (ACPI_FAILURE(status)) { + printf("Failed to evaluate object.\n"); + return (NULL); + } + + dsd = buf.Pointer; + + for (i = 0; i + 1 < dsd->Package.Count; i += 2) { + guid = &dsd->Package.Elements[i]; + package = &dsd->Package.Elements[i + 1]; + + if (!cs_is_acpi_guid(guid) || + package->Type != ACPI_TYPE_PACKAGE) + break; + + if (!is_acpi_dsd_graph_guid(guid)) + continue; + + if (cs_acpi_validate_dsd_graph(package)) + return (package); + } + + return (NULL); +} + +static inline bool +cs_acpi_validate_coresight_graph(const union acpi_object *cs_graph) +{ + int nlinks; + + nlinks = cs_graph->Package.Elements[2].Integer.Value; + if (cs_graph->Package.Count != (nlinks + 3)) + return (false); + + return (true); +} + +static const union acpi_object * +cs_get_coresight_graph(device_t dev) +{ + const union acpi_object *graph_list, *graph; + int i, nr_graphs; + + graph_list = cs_get_dsd_graph(dev); + if (!graph_list) { + printf("failed to get graph list\n"); + return (NULL); + } + + nr_graphs = graph_list->Package.Elements[1].Integer.Value; + for (i = 2; i < nr_graphs + 2; i++) { + graph = &graph_list->Package.Elements[i]; + if (!cs_is_acpi_coresight_graph(graph)) + continue; + if (cs_acpi_validate_coresight_graph(graph)) + return (graph); + break; + } + + return (NULL); +} + +static int +cs_acpi_record_endpoint(device_t dev, + struct coresight_platform_data *pdata, + const union acpi_object *link) +{ + const union acpi_object *fields; + struct endpoint *endp; + ACPI_HANDLE handle; + int dir; + + if (link->Type != ACPI_TYPE_PACKAGE || + link->Package.Count != 4) + return (ENXIO); + + fields = link->Package.Elements; + if (fields[0].Type != ACPI_TYPE_INTEGER || + fields[1].Type != ACPI_TYPE_INTEGER || + fields[2].Type != ACPI_TYPE_LOCAL_REFERENCE || + fields[3].Type != ACPI_TYPE_INTEGER) + return (ENXIO); + + handle = fields[2].Reference.Handle; + dir = fields[3].Integer.Value; + + endp = malloc(sizeof(struct endpoint), + M_CORESIGHT, M_WAITOK | M_ZERO); + if (endp == NULL) { + device_printf(dev, "Failed to allocate memory.\n"); + return (ENXIO); + } + + endp->their_handle = handle; + endp->my_handle = acpi_get_handle(dev); + + mtx_lock(&pdata->mtx_lock); + TAILQ_INSERT_TAIL(&pdata->endpoints, endp, link); + mtx_unlock(&pdata->mtx_lock); + + if (dir == ACPI_CORESIGHT_LINK_OUTPUT) { + pdata->out_ports++; + } else { + endp->input = true; + pdata->in_ports++; + } + + return (0); +} + +static int +coresight_acpi_get_ports(device_t dev, + struct coresight_platform_data *pdata) +{ + const union acpi_object *graph; + const union acpi_object *link; + int nlinks; + int error; + int i; + + graph = cs_get_coresight_graph(dev); + if (graph == NULL) { + device_printf(dev, "Coresight graph not found.\n"); + return (ENXIO); + } + + nlinks = graph->Package.Elements[2].Integer.Value; + if (!nlinks) + return (0); + + for (i = 0; i < nlinks; i++) { + link = &graph->Package.Elements[3 + i]; + error = cs_acpi_record_endpoint(dev, pdata, link); + if (error < 0) + return (error); + } + + return (0); +} + +static int +coresight_acpi_get_cpu(device_t dev, struct coresight_platform_data *pdata) +{ + ACPI_HANDLE handle, parent; + ACPI_STATUS status; + int cpuid; + + handle = acpi_get_handle(dev); + + status = AcpiGetParent(handle, &parent); + if (!ACPI_SUCCESS(status)) + return (ENXIO); + + if (!acpi_MatchHid(parent, "ACPI0007")) + return (ENXIO); + + status = acpi_GetInteger(parent, "_UID", &cpuid); + if (ACPI_SUCCESS(status)) { + pdata->cpu = cpuid; + return (0); + } + + return (ENXIO); +} + +struct coresight_platform_data * +coresight_acpi_get_platform_data(device_t dev) +{ + struct coresight_platform_data *pdata; + + pdata = malloc(sizeof(struct coresight_platform_data), + M_CORESIGHT, M_WAITOK | M_ZERO); + pdata->bus_type = CORESIGHT_BUS_ACPI; + + mtx_init(&pdata->mtx_lock, "Coresight Platform Data", NULL, MTX_DEF); + TAILQ_INIT(&pdata->endpoints); + + coresight_acpi_get_cpu(dev, pdata); + coresight_acpi_get_ports(dev, pdata); + + if (bootverbose) + printf("Total ports: in %d out %d\n", + pdata->in_ports, pdata->out_ports); + + return (pdata); +} Modified: head/sys/arm64/coresight/coresight_cmd.c ============================================================================== --- head/sys/arm64/coresight/coresight_cmd.c Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight_cmd.c Wed Jun 17 15:54:51 2020 (r362278) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2020 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -54,7 +54,7 @@ coresight_next_device(struct coresight_device *cs_dev, struct endpoint *endp; TAILQ_FOREACH(endp, &cs_dev->pdata->endpoints, link) { - if (endp->slave != 0) + if (endp->input != 0) continue; out = coresight_get_output_device(endp, &out_endp); @@ -67,6 +67,9 @@ coresight_next_device(struct coresight_device *cs_dev, } /* Add output device */ + if (bootverbose) + printf("Adding device %s to the chain\n", + device_get_nameunit(out->dev)); out_endp->cs_dev = out; LIST_INSERT_HEAD(&event->endplist, out_endp, endplink); Modified: head/sys/arm64/coresight/coresight_cpu_debug.c ============================================================================== --- head/sys/arm64/coresight/coresight_cpu_debug.c Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight_cpu_debug.c Wed Jun 17 15:54:51 2020 (r362278) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2020 Ruslan Bukin * All rights reserved. * * This software was developed by BAE Systems, the University of Cambridge @@ -132,7 +132,7 @@ debug_attach(device_t dev) return (ENXIO); } - sc->pdata = coresight_get_platform_data(dev); + sc->pdata = coresight_fdt_get_platform_data(dev); desc.pdata = sc->pdata; desc.dev = dev; desc.dev_type = CORESIGHT_CPU_DEBUG; Modified: head/sys/arm64/coresight/coresight_etm4x.c ============================================================================== --- head/sys/arm64/coresight/coresight_etm4x.c Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight_etm4x.c Wed Jun 17 15:54:51 2020 (r362278) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2020 Ruslan Bukin * All rights reserved. * * This software was developed by BAE Systems, the University of Cambridge @@ -234,7 +234,7 @@ etm_disable(device_t dev, struct endpoint *endp, } while ((reg & TRCSTATR_IDLE) == 0); } -static int +int etm_attach(device_t dev) { struct coresight_desc desc; @@ -247,7 +247,6 @@ etm_attach(device_t dev) return (ENXIO); } - sc->pdata = coresight_get_platform_data(dev); desc.pdata = sc->pdata; desc.dev = dev; desc.dev_type = CORESIGHT_ETMV4; @@ -257,8 +256,6 @@ etm_attach(device_t dev) } static device_method_t etm_methods[] = { - /* Device interface */ - DEVMETHOD(device_attach, etm_attach), /* Coresight interface */ DEVMETHOD(coresight_init, etm_init), Modified: head/sys/arm64/coresight/coresight_etm4x.h ============================================================================== --- head/sys/arm64/coresight/coresight_etm4x.h Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight_etm4x.h Wed Jun 17 15:54:51 2020 (r362278) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2020 Ruslan Bukin * All rights reserved. * * This software was developed by BAE Systems, the University of Cambridge @@ -34,13 +34,6 @@ #ifndef _ARM64_CORESIGHT_ETM4X_H_ #define _ARM64_CORESIGHT_ETM4X_H_ -DECLARE_CLASS(etm_driver); - -struct etm_softc { - struct resource *res; - struct coresight_platform_data *pdata; -}; - #define TRCPRGCTLR 0x004 /* Trace Programming Control Register */ #define TRCPRGCTLR_EN (1 << 0) /* Trace unit enable bit */ #define TRCPROCSELR 0x008 /* Trace PE Select Control Register */ @@ -178,5 +171,14 @@ struct etm_softc { #define TRCPIDR(n) (0xFE0 + (n) * 0x4) /* Management Peripheral IDn Register [n=0-3] */ #define TRCPIDR567(n) (0xFD4 + ((n) - 5) * 0x4) /* Management Peripheral ID5 to Peripheral ID7 Registers */ #define TRCCIDR(n) (0xFF0 + (n) * 0x4) /* Management Component IDn Register [n=0-4] */ + +DECLARE_CLASS(etm_driver); + +struct etm_softc { + struct resource *res; + struct coresight_platform_data *pdata; +}; + +int etm_attach(device_t dev); #endif /* !_ARM64_CORESIGHT_ETM4X_H_ */ Modified: head/sys/arm64/coresight/coresight_etm4x_acpi.c ============================================================================== --- head/sys/arm64/coresight/coresight_etm4x_acpi.c Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight_etm4x_acpi.c Wed Jun 17 15:54:51 2020 (r362278) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include static int @@ -62,9 +63,21 @@ etm_acpi_probe(device_t dev) return (error); } +static int +etm_acpi_attach(device_t dev) +{ + struct etm_softc *sc; + + sc = device_get_softc(dev); + sc->pdata = coresight_acpi_get_platform_data(dev); + + return (etm_attach(dev)); +} + static device_method_t etm_acpi_methods[] = { /* Device interface */ DEVMETHOD(device_probe, etm_acpi_probe), + DEVMETHOD(device_attach, etm_acpi_attach), /* End */ DEVMETHOD_END Modified: head/sys/arm64/coresight/coresight_etm4x_fdt.c ============================================================================== --- head/sys/arm64/coresight/coresight_etm4x_fdt.c Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight_etm4x_fdt.c Wed Jun 17 15:54:51 2020 (r362278) @@ -67,9 +67,21 @@ etm_fdt_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static int +etm_fdt_attach(device_t dev) +{ + struct etm_softc *sc; + + sc = device_get_softc(dev); + sc->pdata = coresight_fdt_get_platform_data(dev); + + return (etm_attach(dev)); +} + static device_method_t etm_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, etm_fdt_probe), + DEVMETHOD(device_attach, etm_fdt_attach), DEVMETHOD_END }; Added: head/sys/arm64/coresight/coresight_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight_fdt.c Wed Jun 17 15:54:51 2020 (r362278) @@ -0,0 +1,154 @@ +/*- + * Copyright (c) 2018-2020 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int +coresight_fdt_get_ports(phandle_t dev_node, + struct coresight_platform_data *pdata) +{ + phandle_t node, child; + pcell_t port_reg; + phandle_t xref; + char *name; + int ret; + phandle_t endpoint_child; + struct endpoint *endp; + + child = ofw_bus_find_child(dev_node, "ports"); + if (child) + node = child; + else + node = dev_node; + + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + ret = OF_getprop_alloc(child, "name", (void **)&name); + if (ret == -1) + continue; + + if (strcasecmp(name, "port") || + strncasecmp(name, "port@", 6)) { + + port_reg = -1; + OF_getencprop(child, "reg", (void *)&port_reg, + sizeof(port_reg)); + + endpoint_child = ofw_bus_find_child(child, "endpoint"); + if (endpoint_child) { + if (OF_getencprop(endpoint_child, + "remote-endpoint", &xref, + sizeof(xref)) == -1) { + printf("failed\n"); + continue; + } + endp = malloc(sizeof(struct endpoint), + M_CORESIGHT, M_WAITOK | M_ZERO); + endp->my_node = endpoint_child; + endp->their_node = OF_node_from_xref(xref); + endp->dev_node = dev_node; + endp->reg = port_reg; + if (OF_getproplen(endpoint_child, + "slave-mode") >= 0) { + pdata->in_ports++; + endp->input = 1; + } else + pdata->out_ports++; + + mtx_lock(&pdata->mtx_lock); + TAILQ_INSERT_TAIL(&pdata->endpoints, + endp, link); + mtx_unlock(&pdata->mtx_lock); + } + } + } + + return (0); +} + +static int +coresight_fdt_get_cpu(phandle_t node, + struct coresight_platform_data *pdata) +{ + phandle_t cpu_node; + pcell_t xref; + pcell_t cpu_reg; + + if (OF_getencprop(node, "cpu", &xref, sizeof(xref)) != -1) { + cpu_node = OF_node_from_xref(xref); + if (OF_getencprop(cpu_node, "reg", (void *)&cpu_reg, + sizeof(cpu_reg)) > 0) { + pdata->cpu = cpu_reg; + return (0); + } + } + + return (-1); +} + +struct coresight_platform_data * +coresight_fdt_get_platform_data(device_t dev) +{ + struct coresight_platform_data *pdata; + phandle_t node; + + node = ofw_bus_get_node(dev); + + pdata = malloc(sizeof(struct coresight_platform_data), + M_CORESIGHT, M_WAITOK | M_ZERO); + pdata->bus_type = CORESIGHT_BUS_FDT; + + mtx_init(&pdata->mtx_lock, "Coresight Platform Data", NULL, MTX_DEF); + TAILQ_INIT(&pdata->endpoints); + + coresight_fdt_get_cpu(node, pdata); + coresight_fdt_get_ports(node, pdata); + + if (bootverbose) + printf("Total ports: in %d out %d\n", + pdata->in_ports, pdata->out_ports); + + return (pdata); +} Modified: head/sys/arm64/coresight/coresight_funnel.c ============================================================================== --- head/sys/arm64/coresight/coresight_funnel.c Wed Jun 17 15:27:45 2020 (r362277) +++ head/sys/arm64/coresight/coresight_funnel.c Wed Jun 17 15:54:51 2020 (r362278) @@ -111,7 +111,7 @@ funnel_disable(device_t dev, struct endpoint *endp, bus_write_4(sc->res, FUNNEL_FUNCTL, reg); } -static int +int funnel_attach(device_t dev) { struct coresight_desc desc; @@ -124,7 +124,6 @@ funnel_attach(device_t dev) return (ENXIO); } - sc->pdata = coresight_get_platform_data(dev); desc.pdata = sc->pdata; desc.dev = dev; desc.dev_type = CORESIGHT_FUNNEL; @@ -134,9 +133,6 @@ funnel_attach(device_t dev) } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 17 15:58:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E109352056; Wed, 17 Jun 2020 15:58:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n8qD3lsPz3yMT; Wed, 17 Jun 2020 15:58:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C33522BA4; Wed, 17 Jun 2020 15:58:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HFw0ch076299; Wed, 17 Jun 2020 15:58:00 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HFw0GG076298; Wed, 17 Jun 2020 15:58:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202006171558.05HFw0GG076298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Jun 2020 15:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362279 - head/lib/libmagic X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libmagic X-SVN-Commit-Revision: 362279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 15:58:00 -0000 Author: delphij Date: Wed Jun 17 15:57:59 2020 New Revision: 362279 URL: https://svnweb.freebsd.org/changeset/base/362279 Log: Fix installation of magic file. Reported by: lwhsu MFC after: 2 weeks X-MFC-with: r362258 Modified: head/lib/libmagic/Makefile Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Wed Jun 17 15:54:51 2020 (r362278) +++ head/lib/libmagic/Makefile Wed Jun 17 15:57:59 2020 (r362279) @@ -86,7 +86,7 @@ ${inc}: ${inc}.in sed -e 's,X.YY,${FILEVER:S,",,g:S,.,,g},g' ${.ALLSRC} > ${.TARGET} .endfor -FILES= libmagic.pc -FILESDIR= ${LIBDATADIR}/pkgconfig +FILES+= libmagic.pc +FILESDIR_libmagic.pc= ${LIBDATADIR}/pkgconfig .include From owner-svn-src-all@freebsd.org Wed Jun 17 16:05:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF567352076; Wed, 17 Jun 2020 16:05:36 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49n8zz3dL2z40BK; Wed, 17 Jun 2020 16:05:34 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05HG5RKv085965; Wed, 17 Jun 2020 09:05:27 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05HG5Rtu085964; Wed, 17 Jun 2020 09:05:27 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006171605.05HG5Rtu085964@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362217 - head/stand/common In-Reply-To: To: Warner Losh Date: Wed, 17 Jun 2020 09:05:27 -0700 (PDT) CC: Ian Lepore , Kristof Provost , Ed Maste , Toomas Soome , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49n8zz3dL2z40BK X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.26 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.25)[0.246]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.66)[0.664]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.45)[0.453]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:05:37 -0000 [ Charset UTF-8 unsupported, converting... ] > On Tue, Jun 16, 2020 at 8:33 PM Ian Lepore wrote: > > > On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote: > > > On 16 Jun 2020, at 19:11, Ed Maste wrote: > > > > On Tue, 16 Jun 2020 at 13:01, Ian Lepore wrote: > > > > > > > > > > As much as I prefer doing it this way, style(9) doesn't allow for > > > > > variable declarations inside a for() statement (or even inside a > > > > > local > > > > > block, which is just too 1980s for me, but it is still our standard). > > > > > > > > Perhaps it's time to update style(9) to at least permit these uses, as > > > > we've done with the blank line at the beginning of functions with no > > > > local variables, and with braces around single-line bodies. > > > > > > We have 431 instances of `for (int i` in sys alone. It?s not so much a > > > question of allowing it as acknowledging reality at this point. > > > > > > Best regards, > > > Kristof > > > > Hmm, so we do. If you weed out sys/contrib, and device drivers > > contributed by vendors, the number is a lot smaller, but still big > > enough that we should just change the rules I think. > > > > We should definitely just change the rules. There's no point in > prohibiting it. Contributors have already voted with their feet > > diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 > index 4e801bbcbe70..fd23d573eb00 100644 > --- a/share/man/man9/style.9 > +++ b/share/man/man9/style.9 > @@ -592,8 +592,6 @@ not > Parts of a > .Ic for > loop may be left empty. > -Do not put declarations > -inside blocks unless the routine is unusually complicated. Perhaps some wording here that makes it explicit that block scope variables are allowed, and that the for() case is allowed. > .Bd -literal > for (; cnt < 15; cnt++) { + for (int cnt = 0; cnt < 15; cnt++) { + char *p; > stmt1; This updates the example to reflect the new accepted style. > > Although the block doesn't start until { so int i; in the commit > technically doesn't violate this rule. We violate it in dozens of other > ways than this. I think it violates some other rule about declarations being in order of size sorted at the top of a routine, perhaps that needs looked at as well for some change. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Jun 17 16:10:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DAAB3528C2; Wed, 17 Jun 2020 16:10:26 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n95Y5N3yz40Hr; Wed, 17 Jun 2020 16:10:25 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from p51.home.us.delphij.net (unknown [IPv6:2601:646:8600:58ba:e670:b8ff:fe5c:4e69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 99B6433551; Wed, 17 Jun 2020 09:10:18 -0700 (PDT) Reply-To: d@delphij.net Subject: Re: svn commit: r362261 - head/contrib/file/magic/Magdir To: Antoine Brodin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, christos@netbsd.org References: <202006171011.05HABsxP061357@repo.freebsd.org> From: Xin Li Autocrypt: addr=delphij@delphij.net; keydata= mQINBFuSR4oBEACvvEgwRIHs6IcSP/yaDtySF78Ji3rP29qdiQsxhMsOtvtffdbS56VApIWO UFb3/iN2gA8HwLvrmjijN0HEoLVX7na1WARmxRYzQMtApsZIUTtx7hnUYlsi2F5odZa6CDW9 a954DLRzYxiUwYDcu5Zjl9bglK1H8e/N9uC0Vuigr4teWfh86brzOyf819QzwFVYfMIK4ihw QGwMvTzbyVuCFy+LENkmcVYni70oQy6rZ5ktSuYbuOFvu7inRRfhSWPHziV7k+bW88sJ7xhv lBlegcnhkSudWX2M8tZ3MO1PJOcyys0CJlsBY5Weiog2lIPi05h/E9pZ9mc1Vud17iqDaL6w RaggOUhuPfDGCdO5ro82W4BZGeQMRnRF5Ntk+t2ShIH4nn3xRLV0E5nziCiKlgiMqOrz/ZTL QTVbHrCuiwD+fSK14y0oHbkOLYTYLlgh1JbwfY2Ty7elOYiWzyeJ7sJh2dF91NSEneWIOys3 mBpuvtU3nSzzTvAB48VV+Nbg1CpIOgNlPjj7uhIum/Z/VjUaJEyaLpTIRh0MVJVcbP7hXSqZ NA35EEZZVnWEOYdycm4CmEdeNPWkrAf2Ya77iR5VLGypwMlsUMQPh+sKVWDD38M8stFGBBNm d01Hi74Bsq5hKan654dOqMt5eYklrVj0ucMzFQtus7oE502UswARAQABtBxYaW4gTEkgPGRl bHBoaWpAZGVscGhpai5uZXQ+iQJUBBMBCgA+FiEEceNg5NEMZIki80nQQHl/fJX0g08FAluS R/YCGwMFCQmuhAAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQQHl/fJX0g0+2Og//bWpE F2V5/M5l6YW1T8oLcT9rIOH6oq9M0LMNRgFeiNNnilGIeeIgtOGBRueG4CZiZAvsRPJkrO70 1R2SrdkCIvwGUzUAxx1NfBWb+vgm4fgkW/MotGonceM5v0qfSKKXasWvDctkK28aG+IoQzmi FjXNW4+ju4zeQFYwD4ZDWqw9MqO0hVb24uW3dxtQhbfmOLgJ/PEDMQaFuANbW1c+iR0BQA3D Go/EeMY4kpN8on6Aqt/S/4JVltudfQ9OXdjQsC7netSaB9K3mHGt9aKAAB7RzlRY00DKkYS/ /eQwLzGPmK7yX13M68mMDjBs6mIR8t/E1S5OdBNhHRPNPlEbwugR4KaiCsN5yqzJoSV99fKY z2VyxjWPaG8yhHE+jmKUgIBKTfFUQEfkriQR4EASoeJ+soaMTiFDBij1Zw5n3ndLRFMB1ZCl fZLER36mAgW4m4kP83TWnDiJLxOxSOxifV8HpTFjff902H85cybg9KMwrfPDr6W19GGk5Vo1 fkza5krRMGbKWb7+74Evusi0ZxJLIOFwp5Y8eVqUMZaAD3f1ZX1M3pgXOp20QgAy+2KvMHij rLa4q+tMGRzYYD1BnFVSVdXAX5VOoTmHBcDz67DkuRwk2Byp1sgd407oEOmSwrNJlKS0TPCm xUJ2fdSQF+1/MMSRfee49vtMvz7cOrC5Ag0EW5JHigEQANiBmIFAfRNH3nzYNWC0yC+tfx3z sUwAsH1VaBM/cTib+yKtbBOSIlXWjJZWX3MHwoI/1LeGghB2mxkkX1L0pJ/vj1eXNR+sFZ32 0pYcl61Fxg/5fioG4QDTM4i3i7NR5PxDnc6UVaynSlII93DedRhZ1ROtdn4vyMgzsDiqhbL7 BthDOt5KxjqdRk4qRPSw7BovEqZLOcG5IJtf/zZUzRbM7SBljEbOAfekDGx1Br+RrYSD7/Ef Pwwzou9T8315IpBpIHyQF/dZNk3iFiB9Ed5CA71ZRYV5YoLWE9lL0j9kxOLQ5vHnX3mVq7QZ Bc7nzwZ6UhQgYmrG5+RWvuiPpGwvDRIsugJUGXucYkAQh5kuNblmkwpv6u9rNMjCNbzAylOa qdogra5EW+RUSbRz0b4iIr8nnZeAlh7BihCe7JjOwbDjoBEEEtSfVc4hD/LENqpcYVrChphf aOLB9YIXhnVDTVvMc9OklWT/81HzAaDQqOQCzEfY92199Ct9/CwRoQ2OpO8TO5+8A7b9Nb33 nmxMn09mb48ruRacMrfHxCWbgU4w9SEfbip4GcS5wGG6yTC+hw55Iwnnwus40NrJ0GEr8a4r cdsLbkvlyoNHB8ZGgyJ4aFCQ1V4qE1BnlTk7Z8BYBUkJM1odPSkVvHpCnMUjVpJ3hEOC+73Z YH1dh7lZABEBAAGJAjwEGAEKACYWIQRx42Dk0QxkiSLzSdBAeX98lfSDTwUCW5JHigIbDAUJ Ca6EAAAKCRBAeX98lfSDTz8DEACMh3poeUb+gWNF4RWFZuLteZVo0+E1JLYXQkmtrRBLXviP +Qy0pXyFAVxLM4hNIBoIDYfK9BcwrBYf7AwSKrH0GiNwFpgHCkbZd6qoZy2gB+adTnCpVCTJ KJetsH/8awkrChJWMK0ckGf3EeWMPvawG7kW7FBz70NYEZ0pOMiaEZNVtzD3wwbYWUiDFYth 83XGglOExg+1ShTW5XjQPRrdyJAO+aUW4o3lVjfyUJXMgI4rmhMiLVm06GuNrbpKIF0s+4Vd jQAjhrDQjfoXi9CkfsA/cONseuHNv1JGj3RqHiqHJq1dbrpodXp925zGDAnUGxCOBPoFopAH gVzR89GTut059GpwqsddZmU6y7rqifuam/ekJ+QRwc16vgt7pHqCrTY8WPxRZr2UpFU1wlTo COdeiFep1gq1F9jzFjJnoMaAdmC6k7bgAA+RQusOgIhJL0jIej7DoAHxmxFFCfRy+lDtpXwF gQ8HMvzHI65QWmQnMo7s6SQH/ZH5s1yR6SJq8+3lDz+dCuT42qJVqIPVvxd10LW0FNN+t7HF eLadU6ekSgD13/EYMYXlvNHkw7dAItSDxIzgRyykLz0bCU9xwNWoS4Z43+ifF9anJ+uR0ltW El1j++h6ZrD3LLuCgJIt1so0m49GzdcSpOI7LCwMlacyvafiEyjUn+tSNDsnfw== Organization: The FreeBSD Project Message-ID: Date: Wed, 17 Jun 2020 09:10:11 -0700 MIME-Version: 1.0 In-Reply-To: <202006171011.05HABsxP061357@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KCTnoByEwdiX5hefSoz8DrZkLpDZV4Gn5" X-Rspamd-Queue-Id: 49n95Y5N3yz40Hr X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:64.62.128.0/18, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:10:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KCTnoByEwdiX5hefSoz8DrZkLpDZV4Gn5 Content-Type: multipart/mixed; boundary="ww3xjtJwp7ymFWBFcYU0QK3kEuDQFhZXx"; protected-headers="v1" From: Xin Li Reply-To: d@delphij.net To: Antoine Brodin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, christos@netbsd.org Message-ID: Subject: Re: svn commit: r362261 - head/contrib/file/magic/Magdir References: <202006171011.05HABsxP061357@repo.freebsd.org> In-Reply-To: <202006171011.05HABsxP061357@repo.freebsd.org> --ww3xjtJwp7ymFWBFcYU0QK3kEuDQFhZXx Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, On 6/17/20 3:11 AM, Antoine Brodin wrote: > Author: antoine > Date: Wed Jun 17 10:11:54 2020 > New Revision: 362261 > URL: https://svnweb.freebsd.org/changeset/base/362261 >=20 > Log: > Re-apply r333944 to unbreak ports Could you please file a bug against the upstream (Christos cc'ed), as it may also affect other users? > Modified: > head/contrib/file/magic/Magdir/elf >=20 > Modified: head/contrib/file/magic/Magdir/elf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/contrib/file/magic/Magdir/elf Wed Jun 17 08:35:35 2020 (r36226= 0) > +++ head/contrib/file/magic/Magdir/elf Wed Jun 17 10:11:54 2020 (r36226= 1) > @@ -50,9 +50,8 @@ > !:mime application/x-object > >16 leshort 2 executable, > !:mime application/x-executable > ->16 leshort 3 ${x?pie executable:shared object}, > - > -!:mime application/x-${x?pie-executable:sharedlib} > +>16 leshort 3 shared object, > +!:mime application/x-sharedlib > >16 leshort 4 core file, > !:mime application/x-coredump > # OS-specific >=20 --ww3xjtJwp7ymFWBFcYU0QK3kEuDQFhZXx-- --KCTnoByEwdiX5hefSoz8DrZkLpDZV4Gn5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.2.20 (FreeBSD) iQIzBAEBCgAdFiEEceNg5NEMZIki80nQQHl/fJX0g08FAl7qQGkACgkQQHl/fJX0 g08/Pw//RxGBaZndiWbQ9uNWhivxYtagRgFyLpgTUhL7Mxfq6XjiyQXZVHLaL1S2 xBp5cOSSL3hOYgWy3nwUy8DAwidBtj+3Ex7ZyYLGssnvdDu9VMkLkpnELIL+4fll RNmqBdvuurPq54fsZO9EI4UdGA/B/LpOaEh5p5Nt5Y6GqopLVhiTJam3yC5t0urT uHg6dtsCr7pVIlRCGqxob1SH4TSJV8qJWNQLH8EgOdjjA+ZoMQvscwn1Bjs1htvY cE6m8lsbfwCubDNCCyUsANIRkPj4ST1s6TWMo3zQG91UNV8tdfHVsSkcAXyl0ILU nOs9foRqLecSdQgbbWrCavZN7ntcV9rb+k3hvTlEy7IB2b9UvlGlJ0+daRm3HYrT gM2mBsgE6Tp9OW+98CnPp/KnTsoKVWrgPrzV2qzuqBqSmGRGhHHc+Tc4rB1lrH/m TcrAEpjOHg4c0lZ0+Qqh3M3DtUIpj0orzOwwQb5bizXAdIrE9eHQTdZRmCafxMDF o8XKXjX83NX+KJOhanNEAK4GCBOP1/dL84OtuM3tYI7WaDiwDcNR8jJbLiDffuic Bp72VhygeH+8Tdnd04DUxDVRv4AMttua4NIgKvnG+I8nJldhdWqEVbhZ+xTL6KfJ 0EjQRR1qWtT3KTkbcOWUiaYACQnowXR8TNsaTpoojp0AttTtqsY= =DzJG -----END PGP SIGNATURE----- --KCTnoByEwdiX5hefSoz8DrZkLpDZV4Gn5-- From owner-svn-src-all@freebsd.org Wed Jun 17 16:20:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13E81352D12; Wed, 17 Jun 2020 16:20:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n9K175Tsz413j; Wed, 17 Jun 2020 16:20:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA2762286B; Wed, 17 Jun 2020 16:20:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HGKLvL089257; Wed, 17 Jun 2020 16:20:21 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HGKKu8089249; Wed, 17 Jun 2020 16:20:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202006171620.05HGKKu8089249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 17 Jun 2020 16:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362280 - in head/sys/fs: nfs nfsclient nfsserver X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 362280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:20:22 -0000 Author: asomers Date: Wed Jun 17 16:20:19 2020 New Revision: 362280 URL: https://svnweb.freebsd.org/changeset/base/362280 Log: Remove vfs_statfs and vnode_mount macros from NFS These macro definitions are no longer needed as the NFS OSX port is long dead. The vfs_statfs macro conflicts with the vfsops field of the same name. Submitted by: shivank@ Reviewed by: rmacklem MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2020) Differential Revision: https://reviews.freebsd.org/D25263 Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfsdport.h head/sys/fs/nfs/nfskpiport.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfs/nfs_commonsubs.c Wed Jun 17 16:20:19 2020 (r362280) @@ -1402,9 +1402,9 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (compare) { if (*retcmpp == 0) { if (thyp != (u_int64_t) - vfs_statfs(vnode_mount(vp))->f_fsid.val[0] || + vp->v_mount->mnt_stat.f_fsid.val[0] || thyp2 != (u_int64_t) - vfs_statfs(vnode_mount(vp))->f_fsid.val[1]) + vp->v_mount->mnt_stat.f_fsid.val[1]) *retcmpp = NFSERR_NOTSAME; } } else if (nap != NULL) { @@ -1876,7 +1876,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, */ savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; - if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, + if (!VFS_QUOTACTL(vp->v_mount,QCMD(Q_GETQUOTA, USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) freenum = min(dqb.dqb_bhardlimit, freenum); p->p_cred->p_ruid = savuid; @@ -1905,7 +1905,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, */ savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; - if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, + if (!VFS_QUOTACTL(vp->v_mount,QCMD(Q_GETQUOTA, USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) freenum = min(dqb.dqb_bsoftlimit, freenum); p->p_cred->p_ruid = savuid; @@ -1931,7 +1931,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, */ savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; - if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, + if (!VFS_QUOTACTL(vp->v_mount,QCMD(Q_GETQUOTA, USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) freenum = dqb.dqb_curblocks; p->p_cred->p_ruid = savuid; Modified: head/sys/fs/nfs/nfsdport.h ============================================================================== --- head/sys/fs/nfs/nfsdport.h Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfs/nfsdport.h Wed Jun 17 16:20:19 2020 (r362280) @@ -101,12 +101,6 @@ struct nfsexstuff { (n)->cn_flags = (f); \ } while (0) -/* - * A little bit of Darwin vfs kpi. - */ -#define vnode_mount(v) ((v)->v_mount) -#define vfs_statfs(m) (&((m)->mnt_stat)) - #define NFSPATHLEN_T size_t /* Modified: head/sys/fs/nfs/nfskpiport.h ============================================================================== --- head/sys/fs/nfs/nfskpiport.h Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfs/nfskpiport.h Wed Jun 17 16:20:19 2020 (r362280) @@ -36,11 +36,9 @@ * Darwin8 and hopefully subsequent releases from Apple.) */ typedef struct mount * mount_t; -#define vfs_statfs(m) (&((m)->mnt_stat)) #define vfs_flags(m) ((m)->mnt_flag) typedef struct vnode * vnode_t; -#define vnode_mount(v) ((v)->v_mount) #define vnode_vtype(v) ((v)->v_type) #endif /* _NFS_NFSKPIPORT_H */ Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfs/nfsport.h Wed Jun 17 16:20:19 2020 (r362280) @@ -1052,11 +1052,6 @@ bool ncl_pager_setsize(struct vnode *vp, u_quad_t *nsi (n)->nm_minorvers > 0) /* - * Gets the stats field out of the mount structure. - */ -#define vfs_statfs(m) (&((m)->mnt_stat)) - -/* * Set boottime. */ #define NFSSETBOOTTIME(b) (getboottime(&b)) Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed Jun 17 16:20:19 2020 (r362280) @@ -1572,7 +1572,7 @@ ncl_doio_directwrite(struct buf *bp) if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { struct nfsnode *np = VTONFS(bp->b_vp); NFSLOCKNODE(np); - if (NFSHASPNFS(VFSTONFS(vnode_mount(bp->b_vp)))) { + if (NFSHASPNFS(VFSTONFS(bp->b_vp->v_mount))) { /* * Invalidate the attribute cache, since writes to a DS * won't update the size attribute. Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Wed Jun 17 16:20:19 2020 (r362280) @@ -356,7 +356,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, struct nfscldeleg *dp; struct nfsfh *nfhp; struct nfsnode *np = VTONFS(vp); - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); u_int32_t mode, clidrev; int ret, newone, error, expireret = 0, retrycnt; @@ -694,7 +694,7 @@ nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struc NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); - if (NFSHASNFSV4N(VFSTONFS(vnode_mount(vp)))) + if (NFSHASNFSV4N(VFSTONFS(vp->v_mount))) *tl++ = 0; else *tl++ = op->nfso_stateid.seqid; @@ -894,7 +894,7 @@ nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhl struct nfsmount *nmp; int error; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (NFSHASNFSV4N(nmp)) return (0); /* No confirmation for NFSv4.1. */ nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, @@ -1258,7 +1258,7 @@ nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T { int error, expireret = 0, openerr, retrycnt; u_int32_t clidrev = 0, mode; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsfh *nfhp; nfsv4stateid_t stateid; void *lckp; @@ -1395,7 +1395,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct *dattrflagp = 0; if (vnode_vtype(dvp) != VDIR) return (ENOTDIR); - nmp = VFSTONFS(vnode_mount(dvp)); + nmp = VFSTONFS(dvp->v_mount); if (len > NFS_MAXNAMLEN) return (ENAMETOOLONG); if (NFSHASNFSV4(nmp) && len == 1 && @@ -1543,7 +1543,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred { int error, expireret = 0, retrycnt; u_int32_t clidrev = 0; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *np = VTONFS(vp); struct ucred *newcred; struct nfsfh *nfhp = NULL; @@ -1609,7 +1609,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct uc u_int32_t *tl; int error = 0, len, retlen, tsiz, eof = 0; struct nfsrv_descript nfsd; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsrv_descript *nd = &nfsd; int rsize; off_t tmp_off; @@ -1702,7 +1702,7 @@ nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode { int error, expireret = 0, retrycnt, nostateid; u_int32_t clidrev = 0; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *np = VTONFS(vp); struct ucred *newcred; struct nfsfh *nfhp = NULL; @@ -1779,7 +1779,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iom NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { u_int32_t *tl; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *np = VTONFS(vp); int error = 0, len, tsiz, rlen, commit, committed = NFSWRITE_FILESYNC; int wccflag = 0, wsize; @@ -2049,7 +2049,7 @@ nfsrpc_create(vnode_t dvp, char *name, int namelen, st int error = 0, newone, expireret = 0, retrycnt, unlocked; struct nfsclowner *owp; struct nfscldeleg *dp; - struct nfsmount *nmp = VFSTONFS(vnode_mount(dvp)); + struct nfsmount *nmp = VFSTONFS(dvp->v_mount); u_int32_t clidrev; if (NFSHASNFSV4(nmp)) { @@ -2369,7 +2369,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, (owp->nfsow_clp->nfsc_flags & NFSCLFLAGS_GOTDELEG) && !error && dp == NULL) { do { - ret = nfsrpc_openrpc(VFSTONFS(vnode_mount(dvp)), dvp, + ret = nfsrpc_openrpc(VFSTONFS(dvp->v_mount), dvp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, nfhp->nfh_fh, nfhp->nfh_len, (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), op, @@ -2422,7 +2422,7 @@ nfsrpc_remove(vnode_t dvp, char *name, int namelen, vn *dattrflagp = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - nmp = VFSTONFS(vnode_mount(dvp)); + nmp = VFSTONFS(dvp->v_mount); tryagain: if (NFSHASNFSV4(nmp) && ret == 0) { ret = nfscl_removedeleg(vp, p, &dstateid); @@ -2500,7 +2500,7 @@ nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnamept *fattrflagp = 0; *tattrflagp = 0; - nmp = VFSTONFS(vnode_mount(fdvp)); + nmp = VFSTONFS(fdvp->v_mount); if (fnamelen > NFS_MAXNAMLEN || tnamelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); tryagain: @@ -2719,7 +2719,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c *nfhpp = NULL; *attrflagp = 0; *dattrflagp = 0; - nmp = VFSTONFS(vnode_mount(dvp)); + nmp = VFSTONFS(dvp->v_mount); slen = strlen(target); if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); @@ -2782,7 +2782,7 @@ nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, str *nfhpp = NULL; *attrflagp = 0; *dattrflagp = 0; - nmp = VFSTONFS(vnode_mount(dvp)); + nmp = VFSTONFS(dvp->v_mount); fhp = VTONFS(dvp)->n_fhp; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); @@ -2913,7 +2913,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 struct dirent *dp = NULL; u_int32_t *tl; nfsquad_t cookie, ncookie; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *dnp = VTONFS(vp); struct nfsvattr nfsva; struct nfsrv_descript nfsd, *nd = &nfsd; @@ -3363,7 +3363,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui struct nfsrv_descript nfsd, *nd = &nfsd; struct nameidata nami, *ndp = &nami; struct componentname *cnp = &ndp->ni_cnd; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *dnp = VTONFS(vp), *np; struct nfsvattr nfsva; struct nfsfh *nfhp; @@ -3740,7 +3740,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ free(nfhp, M_NFSFH); } else { - error = nfscl_nget(vnode_mount(vp), vp, + error = nfscl_nget(vp->v_mount, vp, nfhp, cnp, p, &np, NULL, LK_EXCLUSIVE); if (!error) { newvp = NFSTOV(np); @@ -3868,7 +3868,7 @@ nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, st struct nfsrv_descript nfsd, *nd = &nfsd; nfsattrbit_t attrbits; int error; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); *attrflagp = 0; NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp); @@ -3919,7 +3919,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct struct nfsclclient *clp; struct nfsfh *nfhp; struct nfsrv_descript nfsd, *nd = &nfsd; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); u_int64_t off, len; off_t start, end; u_int32_t clidrev = 0; @@ -3962,7 +3962,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct do { nd->nd_repstat = 0; if (op == F_GETLK) { - error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp); if (error) return (error); error = nfscl_lockt(vp, clp, off, len, fl, p, id, flags); @@ -3979,7 +3979,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct * We must loop around for all lockowner cases. */ callcnt = 0; - error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp); if (error) return (error); do { @@ -4304,7 +4304,7 @@ nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struc int error; *attrflagp = 0; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (NFSHASNFSV4(nmp)) { /* * For V4, you actually do a getattr. @@ -4383,7 +4383,7 @@ nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, int error; *attrflagp = 0; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (NFSHASNFSV4(nmp)) { /* * For V4, you actually do a getattr. @@ -4673,7 +4673,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_ struct nfsrv_descript nfsd, *nd = &nfsd; int error; nfsattrbit_t attrbits; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) return (EOPNOTSUPP); @@ -4701,7 +4701,7 @@ nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_ struct acl *aclp, void *stuff) { int error; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) return (EOPNOTSUPP); @@ -4719,7 +4719,7 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPR struct nfsrv_descript nfsd, *nd = &nfsd; int error; nfsattrbit_t attrbits; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return (EOPNOTSUPP); @@ -4727,7 +4727,7 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPR nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); - (void) nfsv4_fillattr(nd, vnode_mount(vp), vp, aclp, NULL, NULL, 0, + (void) nfsv4_fillattr(nd, vp->v_mount, vp, aclp, NULL, NULL, 0, &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); error = nfscl_request(nd, vp, p, cred, stuff); if (error) @@ -5748,7 +5748,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode uint32_t rwaccess, int docommit, struct ucred *cred, NFSPROC_T *p) { struct nfsnode *np = VTONFS(vp); - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfscllayout *layp; struct nfscldevinfo *dip; struct nfsclflayout *rflp; @@ -6292,7 +6292,7 @@ nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4state uint32_t *tl; int attrflag, error, retlen; struct nfsrv_descript nfsd; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsrv_descript *nd = &nfsd; struct nfssockreq *nrp; struct nfsvattr na; @@ -6362,7 +6362,7 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo struct ucred *cred, NFSPROC_T *p) { uint32_t *tl; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); int attrflag, error, rlen, commit, committed = NFSWRITE_FILESYNC; int32_t backup; struct nfsrv_descript nfsd; @@ -6493,7 +6493,7 @@ nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c struct ucred *cred, NFSPROC_T *p) { uint32_t *tl; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); int attrflag, error, commit, committed = NFSWRITE_FILESYNC, rlen; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; @@ -6724,7 +6724,7 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfssockreq *nrp; struct nfsvattr na; int attrflag, error; @@ -6872,7 +6872,7 @@ nfsrpc_adviseds(vnode_t vp, uint64_t offset, int cnt, { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfssockreq *nrp; nfsattrbit_t hints; int error; @@ -6976,7 +6976,7 @@ nfsrpc_allocate(vnode_t vp, off_t off, off_t len, stru { int error, expireret = 0, retrycnt, nostateid; uint32_t clidrev = 0; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsfh *nfhp = NULL; nfsv4stateid_t stateid; off_t tmp_off; @@ -8085,7 +8085,7 @@ nfsrpc_copy_file_range(vnode_t invp, off_t *inoffp, vn { int commit, error, expireret = 0, retrycnt; u_int32_t clidrev = 0; - struct nfsmount *nmp = VFSTONFS(vnode_mount(invp)); + struct nfsmount *nmp = VFSTONFS(invp->v_mount); struct nfsfh *innfhp = NULL, *outnfhp = NULL; nfsv4stateid_t instateid, outstateid; void *inlckp, *outlckp; @@ -8277,7 +8277,7 @@ nfsrpc_seek(vnode_t vp, off_t *offp, bool *eofp, int c { int error, expireret = 0, retrycnt; u_int32_t clidrev = 0; - struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *np = VTONFS(vp); struct nfsfh *nfhp = NULL; nfsv4stateid_t stateid; Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfsclient/nfs_clstate.c Wed Jun 17 16:20:19 2020 (r362280) @@ -238,7 +238,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_in if (nfhp != NULL) nop = malloc(sizeof (struct nfsclopen) + fhlen - 1, M_NFSCLOPEN, M_WAITOK); - ret = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); + ret = nfscl_getcl(vp->v_mount, cred, p, 1, &clp); if (ret != 0) { free(nowp, M_NFSCLOWNER); if (nop != NULL) @@ -272,7 +272,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_in ohp = &dp->nfsdl_owner; } else { /* For NFSv4.1 and this option, use a single open_owner. */ - if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) + if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount))) nfscl_filllockowner(NULL, own, F_POSIX); else nfscl_filllockowner(p->td_proc, own, F_POSIX); @@ -315,7 +315,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_in * exclusive lock for this case. */ if (lockit != 0) { - if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) { + if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount))) { /* * Get a shared lock on the OpenOwner, but first * wait for any pending exclusive lock, so that the @@ -525,7 +525,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen if (vnode_vtype(vp) != VREG) return (EISDIR); np = VTONFS(vp); - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { @@ -574,7 +574,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen * If p != NULL, we want to search the parentage tree * for a matching OpenOwner and use that. */ - if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) + if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount))) nfscl_filllockowner(NULL, own, F_POSIX); else nfscl_filllockowner(p->td_proc, own, F_POSIX); @@ -1031,7 +1031,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t if (recovery) clp = rclp; else - error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp); } if (error) { free(nlp, M_NFSCLLOCKOWNER); @@ -1047,7 +1047,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t } else { nfscl_filllockowner(id, own, flags); ownp = own; - if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) + if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount))) nfscl_filllockowner(NULL, openown, F_POSIX); else nfscl_filllockowner(p->td_proc, openown, F_POSIX); @@ -1369,7 +1369,7 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, end = NFS64BITSSET; } - error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp); if (error) return (1); nfscl_filllockowner(id, own, flags); @@ -2984,7 +2984,7 @@ nfscl_dupopen(vnode_t vp, int dupopens) struct nfsclopen *op, *op2; struct nfsfh *nfhp; - clp = VFSTONFS(vnode_mount(vp))->nm_clp; + clp = VFSTONFS(vp->v_mount)->nm_clp; if (clp == NULL) { printf("nfscl dupopen NULL clp\n"); return; @@ -3003,7 +3003,7 @@ nfscl_dupopen(vnode_t vp, int dupopens) NFSV4CL_LOCKNAMELEN)) { NFSUNLOCKCLSTATE(); printf("DUP OWNER\n"); - nfscl_dumpstate(VFSTONFS(vnode_mount(vp)), 1, 1, 0, 0); + nfscl_dumpstate(VFSTONFS(vp->v_mount), 1, 1, 0, 0); return; } } @@ -3026,8 +3026,7 @@ nfscl_dupopen(vnode_t vp, int dupopens) op->nfso_stateid.other[2] == op2->nfso_stateid.other[2]) { NFSUNLOCKCLSTATE(); printf("DUP STATEID\n"); - nfscl_dumpstate(VFSTONFS(vnode_mount(vp)), 1, 1, 0, - 0); + nfscl_dumpstate(VFSTONFS(vp->v_mount), 1, 1, 0, 0); return; } } @@ -3061,8 +3060,8 @@ nfscl_dupopen(vnode_t vp, int dupopens) NFSUNLOCKCLSTATE(); printf("DUP OPEN\n"); } - nfscl_dumpstate(VFSTONFS(vnode_mount(vp)), 1, 1, - 0, 0); + nfscl_dumpstate(VFSTONFS(vp->v_mount), 1, 1, 0, + 0); return; } } @@ -3095,7 +3094,7 @@ nfscl_getclose(vnode_t vp, struct nfsclclient **clpp) struct nfsfh *nfhp; int error, notdecr; - error = nfscl_getcl(vnode_mount(vp), NULL, NULL, 1, &clp); + error = nfscl_getcl(vp->v_mount, NULL, NULL, 1, &clp); if (error) return (error); *clpp = clp; @@ -3170,7 +3169,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, N struct nfsclrecalllayout *recallp; int error; - error = nfscl_getcl(vnode_mount(vp), NULL, NULL, 1, &clp); + error = nfscl_getcl(vp->v_mount, NULL, NULL, 1, &clp); if (error) return (error); *clpp = clp; @@ -3213,8 +3212,7 @@ lookformore: op->nfso_opencnt)); #endif NFSUNLOCKCLSTATE(); - nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op, - p); + nfsrpc_doclose(VFSTONFS(vp->v_mount), op, p); NFSLOCKCLSTATE(); goto lookformore; } @@ -4341,7 +4339,7 @@ nfscl_mustflush(vnode_t vp) struct nfsmount *nmp; np = VTONFS(vp); - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return (1); NFSLOCKCLSTATE(); @@ -4375,7 +4373,7 @@ nfscl_nodeleg(vnode_t vp, int writedeleg) struct nfsmount *nmp; np = VTONFS(vp); - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return (1); NFSLOCKCLSTATE(); @@ -4411,7 +4409,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4state struct nfsnode *np; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); np = VTONFS(vp); NFSLOCKCLSTATE(); /* @@ -4508,7 +4506,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, i struct nfsnode *np; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; - nmp = VFSTONFS(vnode_mount(fvp)); + nmp = VFSTONFS(fvp->v_mount); *gotfdp = 0; *gottdp = 0; NFSLOCKCLSTATE(); @@ -4677,7 +4675,7 @@ nfscl_reclaimnode(vnode_t vp) struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; NFSLOCKCLSTATE(); @@ -4704,7 +4702,7 @@ nfscl_newnode(vnode_t vp) struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; NFSLOCKCLSTATE(); @@ -4731,7 +4729,7 @@ nfscl_delegmodtime(vnode_t vp) struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; NFSLOCKCLSTATE(); @@ -4760,7 +4758,7 @@ nfscl_deleggetmodtime(vnode_t vp, struct timespec *mti struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; NFSLOCKCLSTATE(); @@ -4974,7 +4972,7 @@ nfscl_retoncloselayout(vnode_t vp, struct nfsclclient struct nfscllayout *lyp; uint32_t iomode; - if (vp->v_type != VREG || !NFSHASPNFS(VFSTONFS(vnode_mount(vp))) || + if (vp->v_type != VREG || !NFSHASPNFS(VFSTONFS(vp->v_mount)) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 || (VTONFS(vp)->n_flag & NNOLAYOUT) != 0) return; @@ -5448,7 +5446,7 @@ nfscl_layoutcommit(vnode_t vp, NFSPROC_T *p) mount_t mp; struct nfsmount *nmp; - mp = vnode_mount(vp); + mp = vp->v_mount; nmp = VFSTONFS(mp); if (NFSHASNOLAYOUTCOMMIT(nmp)) return (0); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jun 17 16:20:19 2020 (r362280) @@ -1498,7 +1498,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct struct nfsvattr nfsva; struct nfsmount *nmp; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); error = EIO; attrflag = 0; if (NFSHASPNFS(nmp)) @@ -1529,7 +1529,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struc int error, attrflag, ret; struct nfsmount *nmp; - nmp = VFSTONFS(vnode_mount(vp)); + nmp = VFSTONFS(vp->v_mount); error = EIO; attrflag = 0; if (NFSHASPNFS(nmp)) @@ -1687,7 +1687,7 @@ nfs_create(struct vop_create_args *ap) if (vap->va_vaflags & VA_EXCLUSIVE) fmode |= O_EXCL; dnp = VTONFS(dvp); - nmp = VFSTONFS(vnode_mount(dvp)); + nmp = VFSTONFS(dvp->v_mount); again: /* For NFSv4, wait until any remove is done. */ NFSLOCKNODE(dnp); Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Wed Jun 17 15:57:59 2020 (r362279) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Wed Jun 17 16:20:19 2020 (r362280) @@ -422,7 +422,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int if (!nd->nd_repstat) { if (NFSVNO_NOTSETSIZE(&nva)) { if (NFSVNO_EXRDONLY(exp) || - (vfs_flags(vnode_mount(vp)) & MNT_RDONLY)) + (vfs_flags(vp->v_mount) & MNT_RDONLY)) nd->nd_repstat = EROFS; } else { if (vnode_vtype(vp) != VREG) From owner-svn-src-all@freebsd.org Wed Jun 17 16:22:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4762352C51; Wed, 17 Jun 2020 16:22:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n9M53qJnz41Lh; Wed, 17 Jun 2020 16:22:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6417222F10; Wed, 17 Jun 2020 16:22:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HGM9qf094879; Wed, 17 Jun 2020 16:22:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HGM80J094874; Wed, 17 Jun 2020 16:22:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202006171622.05HGM80J094874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 17 Jun 2020 16:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362281 - in stable: 11/lib/libc/gen 11/lib/libc/tests/gen 12/lib/libc/gen 12/lib/libc/tests/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/gen 11/lib/libc/tests/gen 12/lib/libc/gen 12/lib/libc/tests/gen X-SVN-Commit-Revision: 362281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:22:09 -0000 Author: kevans Date: Wed Jun 17 16:22:08 2020 New Revision: 362281 URL: https://svnweb.freebsd.org/changeset/base/362281 Log: MFC r361995-r361996, r361999, r362111: posix_spawnp fixes r361995: execvp: fix up the ENOEXEC fallback If execve fails with ENOEXEC, execvp is expected to rebuild the command with /bin/sh instead and try again. The previous version did this, but overlooked two details: argv[0] can conceivably be NULL, in which case memp would never get terminated. We must allocate no less than three * sizeof(char *) so we can properly terminate at all times. For the non-NULL argv standard case, we count all the non-NULL elements and actually skip the first argument, so we end up capturing the NULL terminator in our bcopy(). The second detail is that the spec is actually worded such that we should have been preserving argv[0] as passed to execvp: "[...] executed command shall be as if the process invoked the sh utility using execl() as follows: execl(, arg0, file, arg1, ..., (char *)0); where is an unspecified pathname for the sh utility, file is the process image file, and for execvp(), where arg0, arg1, and so on correspond to the values passed to execvp() in argv[0], argv[1], and so on." So we make this change at this time as well, while we're already touching it. We decidedly can't preserve a NULL argv[0] as this would be incredibly, incredibly fragile, so we retain our legacy behavior of using "sh" for argv[] in this specific instance. Some light tests are added to try and detect some components of handling the ENOEXEC fallback; posix_spawnp_enoexec_fallback_null_argv0 is likely not 100% reliable, but it at least won't raise false-alarms and it did result in useful failures with pre-change libc on my machine. This is a secondary change in D25038. r361996: execvPe: obviate the need for potentially large stack allocations Some environments in which execvPe may be called have a limited amount of stack available. Currently, it avoidably allocates a segment on the stack large enough to hold PATH so that it may be mutated and use strsep() for easy parsing. This logic is now rewritten to just operate on the immutable string passed in and do the necessary math to extract individual paths, since it will be copying out those segments to another buffer anyways and piecing them together with the name for a full path. Additional size is also needed for the stack in posix_spawnp(), because it may need to push all of argv to the stack and rebuild the command with sh in front of it. We'll make sure it's properly aligned for the new thread, but future work should likely make rfork_thread a little easier to use by ensuring proper alignment. Some trivial cleanup has been done with a couple of error writes, moving strings into char arrays for use with the less fragile sizeof(). r361999: Add missing shell script from r361995 r362111: posix_spawn: fix for some custom allocator setups libc cannot assume that aligned_alloc and free come from jemalloc, or that any application providing its own malloc and free is actually providing aligned_alloc. Switch back to malloc and just make sure we're passing a properly aligned stack into rfork_thread, as an application perhaps can't reasonably replace just malloc or just free without headaches. This unbreaks ksh93 after r361996, which provides malloc/free but no aligned_alloc. Added: stable/11/lib/libc/tests/gen/spawnp_enoexec.sh - copied unchanged from r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh Modified: stable/11/lib/libc/gen/exec.c stable/11/lib/libc/gen/posix_spawn.c stable/11/lib/libc/tests/gen/Makefile stable/11/lib/libc/tests/gen/posix_spawn_test.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/lib/libc/tests/gen/spawnp_enoexec.sh - copied unchanged from r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh Modified: stable/12/lib/libc/gen/exec.c stable/12/lib/libc/gen/posix_spawn.c stable/12/lib/libc/tests/gen/Makefile stable/12/lib/libc/tests/gen/posix_spawn_test.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/gen/exec.c ============================================================================== --- stable/11/lib/libc/gen/exec.c Wed Jun 17 16:20:19 2020 (r362280) +++ stable/11/lib/libc/gen/exec.c Wed Jun 17 16:22:08 2020 (r362281) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); extern char **environ; +static const char execvPe_err_preamble[] = "execvP: "; +static const char execvPe_err_trailer[] = ": path too long\n"; + int execl(const char *name, const char *arg, ...) { @@ -149,8 +152,8 @@ execvPe(const char *name, const char *path, char * con const char **memp; size_t cnt, lp, ln; int eacces, save_errno; - char *cur, buf[MAXPATHLEN]; - const char *p, *bp; + char buf[MAXPATHLEN]; + const char *bp, *np, *op, *p; struct stat sb; eacces = 0; @@ -158,7 +161,7 @@ execvPe(const char *name, const char *path, char * con /* If it's an absolute or relative path name, it's easy. */ if (strchr(name, '/')) { bp = name; - cur = NULL; + op = NULL; goto retry; } bp = buf; @@ -169,34 +172,42 @@ execvPe(const char *name, const char *path, char * con return (-1); } - cur = alloca(strlen(path) + 1); - if (cur == NULL) { - errno = ENOMEM; - return (-1); - } - strcpy(cur, path); - while ((p = strsep(&cur, ":")) != NULL) { + op = path; + ln = strlen(name); + while (op != NULL) { + np = strchrnul(op, ':'); + /* * It's a SHELL path -- double, leading and trailing colons * mean the current directory. */ - if (*p == '\0') { + if (np == op) { + /* Empty component. */ p = "."; lp = 1; - } else - lp = strlen(p); - ln = strlen(name); + } else { + /* Non-empty component. */ + p = op; + lp = np - op; + } + /* Advance to the next component or terminate after this. */ + if (*np == '\0') + op = NULL; + else + op = np + 1; + /* * If the path is too long complain. This is a possible * security issue; given a way to make the path too long * the user may execute the wrong program. */ if (lp + ln + 2 > sizeof(buf)) { - (void)_write(STDERR_FILENO, "execvP: ", 8); + (void)_write(STDERR_FILENO, execvPe_err_preamble, + sizeof(execvPe_err_preamble) - 1); (void)_write(STDERR_FILENO, p, lp); - (void)_write(STDERR_FILENO, ": path too long\n", - 16); + (void)_write(STDERR_FILENO, execvPe_err_trailer, + sizeof(execvPe_err_trailer) - 1); continue; } bcopy(p, buf, lp); @@ -215,14 +226,28 @@ retry: (void)_execve(bp, argv, envp); case ENOEXEC: for (cnt = 0; argv[cnt]; ++cnt) ; - memp = alloca((cnt + 2) * sizeof(char *)); + + /* + * cnt may be 0 above; always allocate at least + * 3 entries so that we can at least fit "sh", bp, and + * the NULL terminator. We can rely on cnt to take into + * account the NULL terminator in all other scenarios, + * as we drop argv[0]. + */ + memp = alloca(MAX(3, cnt + 2) * sizeof(char *)); if (memp == NULL) { /* errno = ENOMEM; XXX override ENOEXEC? */ goto done; } - memp[0] = "sh"; - memp[1] = bp; - bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); + if (cnt > 0) { + memp[0] = argv[0]; + memp[1] = bp; + bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); + } else { + memp[0] = "sh"; + memp[1] = bp; + memp[2] = NULL; + } (void)_execve(_PATH_BSHELL, __DECONST(char **, memp), envp); goto done; Modified: stable/11/lib/libc/gen/posix_spawn.c ============================================================================== --- stable/11/lib/libc/gen/posix_spawn.c Wed Jun 17 16:20:19 2020 (r362280) +++ stable/11/lib/libc/gen/posix_spawn.c Wed Jun 17 16:22:08 2020 (r362281) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include #include @@ -202,8 +203,20 @@ struct posix_spawn_args { volatile int error; }; +#define PSPAWN_STACK_ALIGNMENT 16 +#define PSPAWN_STACK_ALIGNBYTES (PSPAWN_STACK_ALIGNMENT - 1) +#define PSPAWN_STACK_ALIGN(sz) \ + (((sz) + PSPAWN_STACK_ALIGNBYTES) & ~PSPAWN_STACK_ALIGNBYTES) + #if defined(__i386__) || defined(__amd64__) +/* + * Below we'll assume that _RFORK_THREAD_STACK_SIZE is appropriately aligned for + * the posix_spawn() case where we do not end up calling _execvpe and won't ever + * try to allocate space on the stack for argv[]. + */ #define _RFORK_THREAD_STACK_SIZE 4096 +_Static_assert((_RFORK_THREAD_STACK_SIZE % PSPAWN_STACK_ALIGNMENT) == 0, + "Inappropriate stack size alignment"); #endif static int @@ -244,10 +257,36 @@ do_posix_spawn(pid_t *pid, const char *path, pid_t p; #ifdef _RFORK_THREAD_STACK_SIZE char *stack; + size_t cnt, stacksz; - stack = malloc(_RFORK_THREAD_STACK_SIZE); + stacksz = _RFORK_THREAD_STACK_SIZE; + if (use_env_path) { + /* + * We need to make sure we have enough room on the stack for the + * potential alloca() in execvPe if it gets kicked back an + * ENOEXEC from execve(2), plus the original buffer we gave + * ourselves; this protects us in the event that the caller + * intentionally or inadvertently supplies enough arguments to + * make us blow past the stack we've allocated from it. + */ + for (cnt = 0; argv[cnt] != NULL; ++cnt) + ; + stacksz += MAX(3, cnt + 2) * sizeof(char *); + stacksz = PSPAWN_STACK_ALIGN(stacksz); + } + + /* + * aligned_alloc is not safe to use here, because we can't guarantee + * that aligned_alloc and free will be provided by the same + * implementation. We've actively hit at least one application that + * will provide its own malloc/free but not aligned_alloc leading to + * a free by the wrong allocator. + */ + stack = malloc(stacksz); if (stack == NULL) return (ENOMEM); + stacksz = (((uintptr_t)stack + stacksz) & ~PSPAWN_STACK_ALIGNBYTES) - + (uintptr_t)stack; #endif psa.path = path; psa.fa = fa; @@ -271,8 +310,7 @@ do_posix_spawn(pid_t *pid, const char *path, * parent. Because of this, we must use rfork_thread instead while * almost every other arch stores the return address in a register. */ - p = rfork_thread(RFSPAWN, stack + _RFORK_THREAD_STACK_SIZE, - _posix_spawn_thr, &psa); + p = rfork_thread(RFSPAWN, stack + stacksz, _posix_spawn_thr, &psa); free(stack); #else p = rfork(RFSPAWN); Modified: stable/11/lib/libc/tests/gen/Makefile ============================================================================== --- stable/11/lib/libc/tests/gen/Makefile Wed Jun 17 16:20:19 2020 (r362280) +++ stable/11/lib/libc/tests/gen/Makefile Wed Jun 17 16:22:08 2020 (r362281) @@ -20,6 +20,15 @@ ATF_TESTS_C+= wordexp_test # TODO: t_siginfo (fixes require further inspection) # TODO: t_sethostname_test (consistently screws up the hostname) +FILESGROUPS+= posix_spawn_test_FILES + +posix_spawn_test_FILES= spawnp_enoexec.sh +posix_spawn_test_FILESDIR= ${TESTSDIR} +posix_spawn_test_FILESMODE= 0755 +posix_spawn_test_FILESOWN= root +posix_spawn_test_FILESGRP= wheel +posix_spawn_test_FILESPACKAGE= ${PACKAGE} + CFLAGS+= -DTEST_LONG_DOUBLE # Not sure why this isn't defined for all architectures, since most Modified: stable/11/lib/libc/tests/gen/posix_spawn_test.c ============================================================================== --- stable/11/lib/libc/tests/gen/posix_spawn_test.c Wed Jun 17 16:20:19 2020 (r362280) +++ stable/11/lib/libc/tests/gen/posix_spawn_test.c Wed Jun 17 16:22:08 2020 (r362281) @@ -93,11 +93,50 @@ ATF_TC_BODY(posix_spawn_no_such_command_negative_test, } } +ATF_TC_WITHOUT_HEAD(posix_spawnp_enoexec_fallback); +ATF_TC_BODY(posix_spawnp_enoexec_fallback, tc) +{ + char buf[FILENAME_MAX]; + char *myargs[2]; + int error, status; + pid_t pid, waitres; + + snprintf(buf, sizeof(buf), "%s/spawnp_enoexec.sh", + atf_tc_get_config_var(tc, "srcdir")); + myargs[0] = buf; + myargs[1] = NULL; + error = posix_spawnp(&pid, myargs[0], NULL, NULL, myargs, myenv); + ATF_REQUIRE(error == 0); + waitres = waitpid(pid, &status, 0); + ATF_REQUIRE(waitres == pid); + ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 42); +} + +ATF_TC_WITHOUT_HEAD(posix_spawnp_enoexec_fallback_null_argv0); +ATF_TC_BODY(posix_spawnp_enoexec_fallback_null_argv0, tc) +{ + char buf[FILENAME_MAX]; + char *myargs[1]; + int error, status; + pid_t pid, waitres; + + snprintf(buf, sizeof(buf), "%s/spawnp_enoexec.sh", + atf_tc_get_config_var(tc, "srcdir")); + myargs[0] = NULL; + error = posix_spawnp(&pid, buf, NULL, NULL, myargs, myenv); + ATF_REQUIRE(error == 0); + waitres = waitpid(pid, &status, 0); + ATF_REQUIRE(waitres == pid); + ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 42); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, posix_spawn_simple_test); ATF_TP_ADD_TC(tp, posix_spawn_no_such_command_negative_test); + ATF_TP_ADD_TC(tp, posix_spawnp_enoexec_fallback); + ATF_TP_ADD_TC(tp, posix_spawnp_enoexec_fallback_null_argv0); return (atf_no_error()); } Copied: stable/11/lib/libc/tests/gen/spawnp_enoexec.sh (from r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/tests/gen/spawnp_enoexec.sh Wed Jun 17 16:22:08 2020 (r362281, copy of r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh) @@ -0,0 +1,4 @@ +# $FreeBSD$ +# Intentionally no interpreter + +exit 42 From owner-svn-src-all@freebsd.org Wed Jun 17 16:22:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4252352A7E; Wed, 17 Jun 2020 16:22:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n9M65l2zz41B2; Wed, 17 Jun 2020 16:22:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A763C2287C; Wed, 17 Jun 2020 16:22:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HGMATG094889; Wed, 17 Jun 2020 16:22:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HGM9mY094884; Wed, 17 Jun 2020 16:22:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202006171622.05HGM9mY094884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 17 Jun 2020 16:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362281 - in stable: 11/lib/libc/gen 11/lib/libc/tests/gen 12/lib/libc/gen 12/lib/libc/tests/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/gen 11/lib/libc/tests/gen 12/lib/libc/gen 12/lib/libc/tests/gen X-SVN-Commit-Revision: 362281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:22:11 -0000 Author: kevans Date: Wed Jun 17 16:22:08 2020 New Revision: 362281 URL: https://svnweb.freebsd.org/changeset/base/362281 Log: MFC r361995-r361996, r361999, r362111: posix_spawnp fixes r361995: execvp: fix up the ENOEXEC fallback If execve fails with ENOEXEC, execvp is expected to rebuild the command with /bin/sh instead and try again. The previous version did this, but overlooked two details: argv[0] can conceivably be NULL, in which case memp would never get terminated. We must allocate no less than three * sizeof(char *) so we can properly terminate at all times. For the non-NULL argv standard case, we count all the non-NULL elements and actually skip the first argument, so we end up capturing the NULL terminator in our bcopy(). The second detail is that the spec is actually worded such that we should have been preserving argv[0] as passed to execvp: "[...] executed command shall be as if the process invoked the sh utility using execl() as follows: execl(, arg0, file, arg1, ..., (char *)0); where is an unspecified pathname for the sh utility, file is the process image file, and for execvp(), where arg0, arg1, and so on correspond to the values passed to execvp() in argv[0], argv[1], and so on." So we make this change at this time as well, while we're already touching it. We decidedly can't preserve a NULL argv[0] as this would be incredibly, incredibly fragile, so we retain our legacy behavior of using "sh" for argv[] in this specific instance. Some light tests are added to try and detect some components of handling the ENOEXEC fallback; posix_spawnp_enoexec_fallback_null_argv0 is likely not 100% reliable, but it at least won't raise false-alarms and it did result in useful failures with pre-change libc on my machine. This is a secondary change in D25038. r361996: execvPe: obviate the need for potentially large stack allocations Some environments in which execvPe may be called have a limited amount of stack available. Currently, it avoidably allocates a segment on the stack large enough to hold PATH so that it may be mutated and use strsep() for easy parsing. This logic is now rewritten to just operate on the immutable string passed in and do the necessary math to extract individual paths, since it will be copying out those segments to another buffer anyways and piecing them together with the name for a full path. Additional size is also needed for the stack in posix_spawnp(), because it may need to push all of argv to the stack and rebuild the command with sh in front of it. We'll make sure it's properly aligned for the new thread, but future work should likely make rfork_thread a little easier to use by ensuring proper alignment. Some trivial cleanup has been done with a couple of error writes, moving strings into char arrays for use with the less fragile sizeof(). r361999: Add missing shell script from r361995 r362111: posix_spawn: fix for some custom allocator setups libc cannot assume that aligned_alloc and free come from jemalloc, or that any application providing its own malloc and free is actually providing aligned_alloc. Switch back to malloc and just make sure we're passing a properly aligned stack into rfork_thread, as an application perhaps can't reasonably replace just malloc or just free without headaches. This unbreaks ksh93 after r361996, which provides malloc/free but no aligned_alloc. Added: stable/12/lib/libc/tests/gen/spawnp_enoexec.sh - copied unchanged from r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh Modified: stable/12/lib/libc/gen/exec.c stable/12/lib/libc/gen/posix_spawn.c stable/12/lib/libc/tests/gen/Makefile stable/12/lib/libc/tests/gen/posix_spawn_test.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/lib/libc/tests/gen/spawnp_enoexec.sh - copied unchanged from r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh Modified: stable/11/lib/libc/gen/exec.c stable/11/lib/libc/gen/posix_spawn.c stable/11/lib/libc/tests/gen/Makefile stable/11/lib/libc/tests/gen/posix_spawn_test.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/gen/exec.c ============================================================================== --- stable/12/lib/libc/gen/exec.c Wed Jun 17 16:20:19 2020 (r362280) +++ stable/12/lib/libc/gen/exec.c Wed Jun 17 16:22:08 2020 (r362281) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); extern char **environ; +static const char execvPe_err_preamble[] = "execvP: "; +static const char execvPe_err_trailer[] = ": path too long\n"; + int execl(const char *name, const char *arg, ...) { @@ -149,8 +152,8 @@ execvPe(const char *name, const char *path, char * con const char **memp; size_t cnt, lp, ln; int eacces, save_errno; - char *cur, buf[MAXPATHLEN]; - const char *p, *bp; + char buf[MAXPATHLEN]; + const char *bp, *np, *op, *p; struct stat sb; eacces = 0; @@ -158,7 +161,7 @@ execvPe(const char *name, const char *path, char * con /* If it's an absolute or relative path name, it's easy. */ if (strchr(name, '/')) { bp = name; - cur = NULL; + op = NULL; goto retry; } bp = buf; @@ -169,34 +172,42 @@ execvPe(const char *name, const char *path, char * con return (-1); } - cur = alloca(strlen(path) + 1); - if (cur == NULL) { - errno = ENOMEM; - return (-1); - } - strcpy(cur, path); - while ((p = strsep(&cur, ":")) != NULL) { + op = path; + ln = strlen(name); + while (op != NULL) { + np = strchrnul(op, ':'); + /* * It's a SHELL path -- double, leading and trailing colons * mean the current directory. */ - if (*p == '\0') { + if (np == op) { + /* Empty component. */ p = "."; lp = 1; - } else - lp = strlen(p); - ln = strlen(name); + } else { + /* Non-empty component. */ + p = op; + lp = np - op; + } + /* Advance to the next component or terminate after this. */ + if (*np == '\0') + op = NULL; + else + op = np + 1; + /* * If the path is too long complain. This is a possible * security issue; given a way to make the path too long * the user may execute the wrong program. */ if (lp + ln + 2 > sizeof(buf)) { - (void)_write(STDERR_FILENO, "execvP: ", 8); + (void)_write(STDERR_FILENO, execvPe_err_preamble, + sizeof(execvPe_err_preamble) - 1); (void)_write(STDERR_FILENO, p, lp); - (void)_write(STDERR_FILENO, ": path too long\n", - 16); + (void)_write(STDERR_FILENO, execvPe_err_trailer, + sizeof(execvPe_err_trailer) - 1); continue; } bcopy(p, buf, lp); @@ -215,14 +226,28 @@ retry: (void)_execve(bp, argv, envp); case ENOEXEC: for (cnt = 0; argv[cnt]; ++cnt) ; - memp = alloca((cnt + 2) * sizeof(char *)); + + /* + * cnt may be 0 above; always allocate at least + * 3 entries so that we can at least fit "sh", bp, and + * the NULL terminator. We can rely on cnt to take into + * account the NULL terminator in all other scenarios, + * as we drop argv[0]. + */ + memp = alloca(MAX(3, cnt + 2) * sizeof(char *)); if (memp == NULL) { /* errno = ENOMEM; XXX override ENOEXEC? */ goto done; } - memp[0] = "sh"; - memp[1] = bp; - bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); + if (cnt > 0) { + memp[0] = argv[0]; + memp[1] = bp; + bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); + } else { + memp[0] = "sh"; + memp[1] = bp; + memp[2] = NULL; + } (void)_execve(_PATH_BSHELL, __DECONST(char **, memp), envp); goto done; Modified: stable/12/lib/libc/gen/posix_spawn.c ============================================================================== --- stable/12/lib/libc/gen/posix_spawn.c Wed Jun 17 16:20:19 2020 (r362280) +++ stable/12/lib/libc/gen/posix_spawn.c Wed Jun 17 16:22:08 2020 (r362281) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include #include @@ -204,8 +205,20 @@ struct posix_spawn_args { volatile int error; }; +#define PSPAWN_STACK_ALIGNMENT 16 +#define PSPAWN_STACK_ALIGNBYTES (PSPAWN_STACK_ALIGNMENT - 1) +#define PSPAWN_STACK_ALIGN(sz) \ + (((sz) + PSPAWN_STACK_ALIGNBYTES) & ~PSPAWN_STACK_ALIGNBYTES) + #if defined(__i386__) || defined(__amd64__) +/* + * Below we'll assume that _RFORK_THREAD_STACK_SIZE is appropriately aligned for + * the posix_spawn() case where we do not end up calling _execvpe and won't ever + * try to allocate space on the stack for argv[]. + */ #define _RFORK_THREAD_STACK_SIZE 4096 +_Static_assert((_RFORK_THREAD_STACK_SIZE % PSPAWN_STACK_ALIGNMENT) == 0, + "Inappropriate stack size alignment"); #endif static int @@ -246,10 +259,36 @@ do_posix_spawn(pid_t *pid, const char *path, pid_t p; #ifdef _RFORK_THREAD_STACK_SIZE char *stack; + size_t cnt, stacksz; - stack = malloc(_RFORK_THREAD_STACK_SIZE); + stacksz = _RFORK_THREAD_STACK_SIZE; + if (use_env_path) { + /* + * We need to make sure we have enough room on the stack for the + * potential alloca() in execvPe if it gets kicked back an + * ENOEXEC from execve(2), plus the original buffer we gave + * ourselves; this protects us in the event that the caller + * intentionally or inadvertently supplies enough arguments to + * make us blow past the stack we've allocated from it. + */ + for (cnt = 0; argv[cnt] != NULL; ++cnt) + ; + stacksz += MAX(3, cnt + 2) * sizeof(char *); + stacksz = PSPAWN_STACK_ALIGN(stacksz); + } + + /* + * aligned_alloc is not safe to use here, because we can't guarantee + * that aligned_alloc and free will be provided by the same + * implementation. We've actively hit at least one application that + * will provide its own malloc/free but not aligned_alloc leading to + * a free by the wrong allocator. + */ + stack = malloc(stacksz); if (stack == NULL) return (ENOMEM); + stacksz = (((uintptr_t)stack + stacksz) & ~PSPAWN_STACK_ALIGNBYTES) - + (uintptr_t)stack; #endif psa.path = path; psa.fa = fa; @@ -273,8 +312,7 @@ do_posix_spawn(pid_t *pid, const char *path, * parent. Because of this, we must use rfork_thread instead while * almost every other arch stores the return address in a register. */ - p = rfork_thread(RFSPAWN, stack + _RFORK_THREAD_STACK_SIZE, - _posix_spawn_thr, &psa); + p = rfork_thread(RFSPAWN, stack + stacksz, _posix_spawn_thr, &psa); free(stack); #else p = rfork(RFSPAWN); Modified: stable/12/lib/libc/tests/gen/Makefile ============================================================================== --- stable/12/lib/libc/tests/gen/Makefile Wed Jun 17 16:20:19 2020 (r362280) +++ stable/12/lib/libc/tests/gen/Makefile Wed Jun 17 16:22:08 2020 (r362281) @@ -24,6 +24,15 @@ ATF_TESTS_C+= wordexp_test # TODO: t_siginfo (fixes require further inspection) # TODO: t_sethostname_test (consistently screws up the hostname) +FILESGROUPS+= posix_spawn_test_FILES + +posix_spawn_test_FILES= spawnp_enoexec.sh +posix_spawn_test_FILESDIR= ${TESTSDIR} +posix_spawn_test_FILESMODE= 0755 +posix_spawn_test_FILESOWN= root +posix_spawn_test_FILESGRP= wheel +posix_spawn_test_FILESPACKAGE= ${PACKAGE} + CFLAGS+= -DTEST_LONG_DOUBLE # Not sure why this isn't defined for all architectures, since most Modified: stable/12/lib/libc/tests/gen/posix_spawn_test.c ============================================================================== --- stable/12/lib/libc/tests/gen/posix_spawn_test.c Wed Jun 17 16:20:19 2020 (r362280) +++ stable/12/lib/libc/tests/gen/posix_spawn_test.c Wed Jun 17 16:22:08 2020 (r362281) @@ -93,11 +93,50 @@ ATF_TC_BODY(posix_spawn_no_such_command_negative_test, } } +ATF_TC_WITHOUT_HEAD(posix_spawnp_enoexec_fallback); +ATF_TC_BODY(posix_spawnp_enoexec_fallback, tc) +{ + char buf[FILENAME_MAX]; + char *myargs[2]; + int error, status; + pid_t pid, waitres; + + snprintf(buf, sizeof(buf), "%s/spawnp_enoexec.sh", + atf_tc_get_config_var(tc, "srcdir")); + myargs[0] = buf; + myargs[1] = NULL; + error = posix_spawnp(&pid, myargs[0], NULL, NULL, myargs, myenv); + ATF_REQUIRE(error == 0); + waitres = waitpid(pid, &status, 0); + ATF_REQUIRE(waitres == pid); + ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 42); +} + +ATF_TC_WITHOUT_HEAD(posix_spawnp_enoexec_fallback_null_argv0); +ATF_TC_BODY(posix_spawnp_enoexec_fallback_null_argv0, tc) +{ + char buf[FILENAME_MAX]; + char *myargs[1]; + int error, status; + pid_t pid, waitres; + + snprintf(buf, sizeof(buf), "%s/spawnp_enoexec.sh", + atf_tc_get_config_var(tc, "srcdir")); + myargs[0] = NULL; + error = posix_spawnp(&pid, buf, NULL, NULL, myargs, myenv); + ATF_REQUIRE(error == 0); + waitres = waitpid(pid, &status, 0); + ATF_REQUIRE(waitres == pid); + ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 42); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, posix_spawn_simple_test); ATF_TP_ADD_TC(tp, posix_spawn_no_such_command_negative_test); + ATF_TP_ADD_TC(tp, posix_spawnp_enoexec_fallback); + ATF_TP_ADD_TC(tp, posix_spawnp_enoexec_fallback_null_argv0); return (atf_no_error()); } Copied: stable/12/lib/libc/tests/gen/spawnp_enoexec.sh (from r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libc/tests/gen/spawnp_enoexec.sh Wed Jun 17 16:22:08 2020 (r362281, copy of r361999, head/lib/libc/tests/gen/spawnp_enoexec.sh) @@ -0,0 +1,4 @@ +# $FreeBSD$ +# Intentionally no interpreter + +exit 42 From owner-svn-src-all@freebsd.org Wed Jun 17 16:39:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07541353807; Wed, 17 Jun 2020 16:39:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n9lW6RYQz42nb; Wed, 17 Jun 2020 16:39:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CED6E1E799; Wed, 17 Jun 2020 16:39:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f178.google.com with SMTP id q14so2008669qtr.9; Wed, 17 Jun 2020 09:39:51 -0700 (PDT) X-Gm-Message-State: AOAM530Jzq3nHgljP0eX45yZxrIphecsgcb7mfuHauG5X9jVa4fvIm6c /ZZr0Gv99AkpUh6ARa6zqBT49FW5Gq1GvkOkCGk= X-Google-Smtp-Source: ABdhPJzL62bIhI5mL5lfmjOYw+tJ2QRLLoiSZXC/RYR2ZWiS/bCWgO7q/fLVGPua2A4ij5jhXzOjEd9A3y/E4li+/fA= X-Received: by 2002:ac8:311d:: with SMTP id g29mr28484268qtb.242.1592411991315; Wed, 17 Jun 2020 09:39:51 -0700 (PDT) MIME-Version: 1.0 References: <202006091517.059FHNS9050196@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 17 Jun 2020 11:39:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361967 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:39:52 -0000 On Wed, Jun 17, 2020 at 10:21 AM Mateusz Guzik wrote: > > pho@ reported triggering one of the asserts: > https://people.freebsd.org/~pho/stress/log/mjguzik028.txt > > I did not have the time to properly investigate this yet and this does > not reproduce for me. > Ah, this is good to know that he's reproduced it. There's only so many places that we touch these. I can't quite envision how, but the only scenario this would seem to be possible in is doenterpgrp() -> fixjobc(p, p->p_grp, 0) -> adjusts some child with a different process group without actually changing it, orphans the group, then we manage to finalize killjobc() on a freshly-orphaned process, which hasn't had its p_pgrp nullified. I haven't yet traced it through completely enough to determine if there's any way that can even happen. > That said, I may either revert the assert (or degrade to a warning) or > add some commentary if I don't sort this out this week. > > On 6/17/20, Kyle Evans wrote: > > On Tue, Jun 9, 2020 at 10:17 AM Mateusz Guzik wrote: > >> > >> Author: mjg > >> Date: Tue Jun 9 15:17:23 2020 > >> New Revision: 361967 > >> URL: https://svnweb.freebsd.org/changeset/base/361967 > >> > >> Log: > >> Assert on pg_jobc state. > >> > >> Stolen from NetBSD. > >> > >> Modified: > >> head/sys/kern/kern_proc.c > >> > >> Modified: head/sys/kern/kern_proc.c > >> ============================================================================== > >> --- head/sys/kern/kern_proc.c Tue Jun 9 14:20:16 2020 (r361966) > >> +++ head/sys/kern/kern_proc.c Tue Jun 9 15:17:23 2020 (r361967) > >> @@ -751,9 +751,11 @@ pgadjustjobc(struct pgrp *pgrp, int entering) > >> { > >> > >> PGRP_LOCK(pgrp); > >> - if (entering) > >> + if (entering) { > >> + MPASS(pgrp->pg_jobc >= 0); > >> pgrp->pg_jobc++; > >> - else { > >> + } else { > >> + MPASS(pgrp->pg_jobc > 0); > >> --pgrp->pg_jobc; > >> if (pgrp->pg_jobc == 0) > >> orphanpg(pgrp); > > > > We seem to be doing something wrong here, but I'm still working on > > reproducing it on a machine that actually has usable swap configured > > to get a dump. I've hit one of these asserts just from hitting the > > power button to shutoff from within xfce (hitting the latter branch > > with pgrp->pg_jobc == 0 IIRC) and another laptop panicked sometime > > overnight -- I wasn't able to catch the second one at all, because > > it's hooked up to a switch that loses its mind once that laptop > > panicks and it had to be rebooted before I could attend to it to > > revive network for the other machines on the switch. > > > > Thanks, > > > > Kyle Evans > > > > > -- > Mateusz Guzik From owner-svn-src-all@freebsd.org Wed Jun 17 17:50:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ED3035516C; Wed, 17 Jun 2020 17:50:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nCJg01gjz47sr; Wed, 17 Jun 2020 17:50:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:45bc:45e4:28ce:b5c5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 6B3A61F38C; Wed, 17 Jun 2020 17:50:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r362126 - head/sys/vm To: cem@freebsd.org, Eric van Gyzen Cc: src-committers , svn-src-all , svn-src-head References: <202006122153.05CLr8JN091722@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 17 Jun 2020 10:50:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 17:50:11 -0000 On 6/12/20 3:33 PM, Conrad Meyer wrote: > On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen wrote: >> Honor db_pager_quit in some vm_object ddb commands >> >> These can be rather verbose. > > We also have this (?)hack in OneFS, which eliminates the need for > every debug function to check the db_pager globals: > > https://people.freebsd.org/~cem/db_pager.patch > > I'm not sure how objectionable it is. I don't think this addresses that. I think this patch makes printf turn into db_printf when a function is invoked from DDB which is orthogonal. db_printf() itself doesn't check the pager. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jun 17 17:51:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AD103554E4; Wed, 17 Jun 2020 17:51:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nCLP3Fblz48Hs; Wed, 17 Jun 2020 17:51:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5192423A72; Wed, 17 Jun 2020 17:51:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HHpfsv048380; Wed, 17 Jun 2020 17:51:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HHpelr048377; Wed, 17 Jun 2020 17:51:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006171751.05HHpelr048377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Jun 2020 17:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362282 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 362282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 17:51:41 -0000 Author: mav Date: Wed Jun 17 17:51:40 2020 New Revision: 362282 URL: https://svnweb.freebsd.org/changeset/base/362282 Log: Fix admin qpair leak if detached during initial reset. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Jun 17 16:22:08 2020 (r362281) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Jun 17 17:51:40 2020 (r362282) @@ -1458,8 +1458,8 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, dev nvme_io_qpair_destroy(&ctrlr->ioq[i]); free(ctrlr->ioq, M_NVME); nvme_ctrlr_hmb_free(ctrlr); - nvme_admin_qpair_destroy(&ctrlr->adminq); } + nvme_admin_qpair_destroy(&ctrlr->adminq); /* * Notify the controller of a shutdown, even though this is due to Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Wed Jun 17 16:22:08 2020 (r362281) +++ head/sys/dev/nvme/nvme_qpair.c Wed Jun 17 17:51:40 2020 (r362282) @@ -729,6 +729,8 @@ nvme_qpair_construct(struct nvme_qpair *qpair, if (bus_dmamap_load(qpair->dma_tag, qpair->queuemem_map, queuemem, allocsz, nvme_single_map, &queuemem_phys, 0) != 0) { nvme_printf(ctrlr, "failed to load qpair memory\n"); + bus_dmamem_free(qpair->dma_tag, qpair->cmd, + qpair->queuemem_map); goto out; } @@ -811,24 +813,15 @@ nvme_qpair_destroy(struct nvme_qpair *qpair) { struct nvme_tracker *tr; - if (qpair->tag) + if (qpair->tag) { bus_teardown_intr(qpair->ctrlr->dev, qpair->res, qpair->tag); - - if (mtx_initialized(&qpair->lock)) - mtx_destroy(&qpair->lock); - - if (qpair->res) - bus_release_resource(qpair->ctrlr->dev, SYS_RES_IRQ, - rman_get_rid(qpair->res), qpair->res); - - if (qpair->cmd != NULL) { - bus_dmamap_unload(qpair->dma_tag, qpair->queuemem_map); - bus_dmamem_free(qpair->dma_tag, qpair->cmd, - qpair->queuemem_map); + qpair->tag = NULL; } - if (qpair->act_tr) + if (qpair->act_tr) { free_domain(qpair->act_tr, M_NVME); + qpair->act_tr = NULL; + } while (!TAILQ_EMPTY(&qpair->free_tr)) { tr = TAILQ_FIRST(&qpair->free_tr); @@ -838,11 +831,31 @@ nvme_qpair_destroy(struct nvme_qpair *qpair) free_domain(tr, M_NVME); } - if (qpair->dma_tag) + if (qpair->cmd != NULL) { + bus_dmamap_unload(qpair->dma_tag, qpair->queuemem_map); + bus_dmamem_free(qpair->dma_tag, qpair->cmd, + qpair->queuemem_map); + qpair->cmd = NULL; + } + + if (qpair->dma_tag) { bus_dma_tag_destroy(qpair->dma_tag); + qpair->dma_tag = NULL; + } - if (qpair->dma_tag_payload) + if (qpair->dma_tag_payload) { bus_dma_tag_destroy(qpair->dma_tag_payload); + qpair->dma_tag_payload = NULL; + } + + if (mtx_initialized(&qpair->lock)) + mtx_destroy(&qpair->lock); + + if (qpair->res) { + bus_release_resource(qpair->ctrlr->dev, SYS_RES_IRQ, + rman_get_rid(qpair->res), qpair->res); + qpair->res = NULL; + } } static void From owner-svn-src-all@freebsd.org Wed Jun 17 17:56:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B7F4355575; Wed, 17 Jun 2020 17:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nCRN2JjTz48lb; Wed, 17 Jun 2020 17:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:956d:aaea:1d3d:2765]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id B3F641EC38; Wed, 17 Jun 2020 17:55:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361967 - head/sys/kern To: Kyle Evans , Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head References: <202006091517.059FHNS9050196@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <0101b152-e3a6-61af-3748-04e73b631f51@FreeBSD.org> Date: Wed, 17 Jun 2020 10:55:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 17:56:00 -0000 On 6/17/20 9:39 AM, Kyle Evans wrote: > On Wed, Jun 17, 2020 at 10:21 AM Mateusz Guzik wrote: >> >> pho@ reported triggering one of the asserts: >> https://people.freebsd.org/~pho/stress/log/mjguzik028.txt >> >> I did not have the time to properly investigate this yet and this does >> not reproduce for me. >> > > Ah, this is good to know that he's reproduced it. There's only so many > places that we touch these. I can't quite envision how, but the only > scenario this would seem to be possible in is doenterpgrp() -> > fixjobc(p, p->p_grp, 0) -> adjusts some child with a different process > group without actually changing it, orphans the group, then we manage > to finalize killjobc() on a freshly-orphaned process, which hasn't had > its p_pgrp nullified. > > I haven't yet traced it through completely enough to determine if > there's any way that can even happen. I reproduced it three times yesterday in a head VM by exiting GDB while it was attached to a live process (which kills the process), something like: gdb /bin/ls start ^D Should be enough to reproduce. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jun 17 18:47:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5845357BF6; Wed, 17 Jun 2020 18:47:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nDbM4RvXz4K4V; Wed, 17 Jun 2020 18:47:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93FA224B38; Wed, 17 Jun 2020 18:47:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HIlxfM089664; Wed, 17 Jun 2020 18:47:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HIlxUs089663; Wed, 17 Jun 2020 18:47:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006171847.05HIlxUs089663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jun 2020 18:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362283 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 362283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 18:47:59 -0000 Author: markj Date: Wed Jun 17 18:47:59 2020 New Revision: 362283 URL: https://svnweb.freebsd.org/changeset/base/362283 Log: MFC r362035: Remove the FIRMWARE_MAX limit. Modified: stable/12/sys/kern/subr_firmware.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_firmware.c ============================================================================== --- stable/12/sys/kern/subr_firmware.c Wed Jun 17 17:51:40 2020 (r362282) +++ stable/12/sys/kern/subr_firmware.c Wed Jun 17 18:47:59 2020 (r362283) @@ -53,12 +53,10 @@ __FBSDID("$FreeBSD$"); * form more details on the subsystem. * * 'struct firmware' is the user-visible part of the firmware table. - * Additional internal information is stored in a 'struct priv_fw' - * (currently a static array). A slot is in use if FW_INUSE is true: + * Additional internal information is stored in a 'struct priv_fw', + * which embeds the public firmware structure. */ -#define FW_INUSE(p) ((p)->file != NULL || (p)->fw.name != NULL) - /* * fw.name != NULL when an image is registered; file != NULL for * autoloaded images whose handling has not been completed. @@ -82,6 +80,7 @@ __FBSDID("$FreeBSD$"); struct priv_fw { int refcnt; /* reference count */ + LIST_ENTRY(priv_fw) link; /* table linkage */ /* * parent entry, see above. Set on firmware_register(), @@ -118,13 +117,9 @@ struct priv_fw { ((intptr_t)(x) - offsetof(struct priv_fw, fw)) ) /* - * At the moment we use a static array as backing store for the registry. - * Should we move to a dynamic structure, keep in mind that we cannot - * reallocate the array because pointers are held externally. - * A list may work, though. + * Global firmware image registry. */ -#define FIRMWARE_MAX 50 -static struct priv_fw firmware_table[FIRMWARE_MAX]; +static LIST_HEAD(, priv_fw) firmware_table; /* * Firmware module operations are handled in a separate task as they @@ -139,6 +134,8 @@ static struct task firmware_unload_task; static struct mtx firmware_mtx; MTX_SYSINIT(firmware, &firmware_mtx, "firmware table", MTX_DEF); +static MALLOC_DEFINE(M_FIRMWARE, "firmware", "device firmware images"); + /* * Helper function to lookup a name. * As a side effect, it sets the pointer to a free slot, if any. @@ -147,23 +144,17 @@ MTX_SYSINIT(firmware, &firmware_mtx, "firmware table", * with some other data structure. */ static struct priv_fw * -lookup(const char *name, struct priv_fw **empty_slot) +lookup(const char *name) { - struct priv_fw *fp = NULL; - struct priv_fw *dummy; - int i; + struct priv_fw *fp; - if (empty_slot == NULL) - empty_slot = &dummy; - *empty_slot = NULL; - for (i = 0; i < FIRMWARE_MAX; i++) { - fp = &firmware_table[i]; + mtx_assert(&firmware_mtx, MA_OWNED); + + LIST_FOREACH(fp, &firmware_table, link) { if (fp->fw.name != NULL && strcasecmp(name, fp->fw.name) == 0) break; - else if (!FW_INUSE(fp)) - *empty_slot = fp; } - return (i < FIRMWARE_MAX ) ? fp : NULL; + return (fp); } /* @@ -176,42 +167,42 @@ const struct firmware * firmware_register(const char *imagename, const void *data, size_t datasize, unsigned int version, const struct firmware *parent) { - struct priv_fw *match, *frp; - char *str; + struct priv_fw *frp; + char *name; - str = strdup(imagename, M_TEMP); - mtx_lock(&firmware_mtx); - /* - * Do a lookup to make sure the name is unique or find a free slot. - */ - match = lookup(imagename, &frp); - if (match != NULL) { + frp = lookup(imagename); + if (frp != NULL) { mtx_unlock(&firmware_mtx); printf("%s: image %s already registered!\n", - __func__, imagename); - free(str, M_TEMP); - return NULL; + __func__, imagename); + return (NULL); } - if (frp == NULL) { + mtx_unlock(&firmware_mtx); + + frp = malloc(sizeof(*frp), M_FIRMWARE, M_WAITOK | M_ZERO); + name = strdup(imagename, M_FIRMWARE); + + mtx_lock(&firmware_mtx); + if (lookup(imagename) != NULL) { + /* We lost a race. */ mtx_unlock(&firmware_mtx); - printf("%s: cannot register image %s, firmware table full!\n", - __func__, imagename); - free(str, M_TEMP); - return NULL; + free(name, M_FIRMWARE); + free(frp, M_FIRMWARE); + return (NULL); } - bzero(frp, sizeof(*frp)); /* start from a clean record */ - frp->fw.name = str; + frp->fw.name = name; frp->fw.data = data; frp->fw.datasize = datasize; frp->fw.version = version; if (parent != NULL) frp->parent = PRIV_FW(parent); + LIST_INSERT_HEAD(&firmware_table, frp, link); mtx_unlock(&firmware_mtx); if (bootverbose) printf("firmware: '%s' version %u: %zu bytes loaded at %p\n", imagename, version, datasize, data); - return &frp->fw; + return (&frp->fw); } /* @@ -226,7 +217,7 @@ firmware_unregister(const char *imagename) int err; mtx_lock(&firmware_mtx); - fp = lookup(imagename, NULL); + fp = lookup(imagename); if (fp == NULL) { /* * It is ok for the lookup to fail; this can happen @@ -238,20 +229,13 @@ firmware_unregister(const char *imagename) } else if (fp->refcnt != 0) { /* cannot unregister */ err = EBUSY; } else { - linker_file_t x = fp->file; /* save value */ - - /* - * Clear the whole entry with bzero to make sure we - * do not forget anything. Then restore 'file' which is - * non-null for autoloaded images. - */ - free((void *) (uintptr_t) fp->fw.name, M_TEMP); - bzero(fp, sizeof(struct priv_fw)); - fp->file = x; + LIST_REMOVE(fp, link); + free(__DECONST(char *, fp->fw.name), M_FIRMWARE); + free(fp, M_FIRMWARE); err = 0; } mtx_unlock(&firmware_mtx); - return err; + return (err); } static void @@ -262,31 +246,29 @@ loadimage(void *arg, int npending) linker_file_t result; int error; - /* synchronize with the thread that dispatched us */ - mtx_lock(&firmware_mtx); - mtx_unlock(&firmware_mtx); - error = linker_reference_module(imagename, NULL, &result); if (error != 0) { printf("%s: could not load firmware image, error %d\n", imagename, error); + mtx_lock(&firmware_mtx); goto done; } mtx_lock(&firmware_mtx); - fp = lookup(imagename, NULL); + fp = lookup(imagename); if (fp == NULL || fp->file != NULL) { mtx_unlock(&firmware_mtx); if (fp == NULL) printf("%s: firmware image loaded, " "but did not register\n", imagename); (void) linker_release_module(imagename, NULL, NULL); + mtx_lock(&firmware_mtx); goto done; } fp->file = result; /* record the module identity */ - mtx_unlock(&firmware_mtx); done: - wakeup_one(imagename); /* we're done */ + wakeup_one(imagename); + mtx_unlock(&firmware_mtx); } /* @@ -304,7 +286,7 @@ firmware_get(const char *imagename) struct priv_fw *fp; mtx_lock(&firmware_mtx); - fp = lookup(imagename, NULL); + fp = lookup(imagename); if (fp != NULL) goto found; /* @@ -318,7 +300,7 @@ firmware_get(const char *imagename) "load firmware image %s\n", __func__, imagename); return NULL; } - /* + /* * Defer load to a thread with known context. linker_reference_module * may do filesystem i/o which requires root & current dirs, etc. * Also we must not hold any mtx's over this call which is problematic. @@ -333,7 +315,7 @@ firmware_get(const char *imagename) /* * After attempting to load the module, see if the image is registered. */ - fp = lookup(imagename, NULL); + fp = lookup(imagename); if (fp == NULL) { mtx_unlock(&firmware_mtx); return NULL; @@ -381,7 +363,6 @@ set_rootvnode(void *arg, int npending) { pwd_ensure_dirs(); - free(arg, M_TEMP); } @@ -413,50 +394,39 @@ EVENTHANDLER_DEFINE(mountroot, firmware_mountroot, NUL static void unloadentry(void *unused1, int unused2) { - int limit = FIRMWARE_MAX; - int i; /* current cycle */ + struct priv_fw *fp, *tmp; + int err; + bool changed; mtx_lock(&firmware_mtx); - /* - * Scan the table. limit is set to make sure we make another - * full sweep after matching an entry that requires unloading. - */ - for (i = 0; i < limit; i++) { - struct priv_fw *fp; - int err; - - fp = &firmware_table[i % FIRMWARE_MAX]; - if (fp->fw.name == NULL || fp->file == NULL || - fp->refcnt != 0 || (fp->flags & FW_UNLOAD) == 0) + changed = false; +restart: + LIST_FOREACH_SAFE(fp, &firmware_table, link, tmp) { + if (fp->file == NULL || fp->refcnt != 0 || + (fp->flags & FW_UNLOAD) == 0) continue; /* * Found an entry. Now: - * 1. bump up limit to make sure we make another full round; + * 1. make sure we scan the table again * 2. clear FW_UNLOAD so we don't try this entry again. * 3. release the lock while trying to unload the module. - * 'file' remains set so that the entry cannot be reused - * in the meantime (it also means that fp->file will - * not change while we release the lock). */ - limit = i + FIRMWARE_MAX; /* make another full round */ + changed = true; fp->flags &= ~FW_UNLOAD; /* do not try again */ - mtx_unlock(&firmware_mtx); - err = linker_release_module(NULL, NULL, fp->file); - mtx_lock(&firmware_mtx); - /* * We rely on the module to call firmware_unregister() - * on unload to actually release the entry. - * If err = 0 we can drop our reference as the system - * accepted it. Otherwise unloading failed (e.g. the - * module itself gave an error) so our reference is - * still valid. + * on unload to actually free the entry. */ - if (err == 0) - fp->file = NULL; + mtx_unlock(&firmware_mtx); + err = linker_release_module(NULL, NULL, fp->file); + mtx_lock(&firmware_mtx); } + if (changed) { + changed = false; + goto restart; + } mtx_unlock(&firmware_mtx); } @@ -467,8 +437,9 @@ static int firmware_modevent(module_t mod, int type, void *unused) { struct priv_fw *fp; - int i, err; + int err; + err = 0; switch (type) { case MOD_LOAD: TASK_INIT(&firmware_unload_task, 0, unloadentry, NULL); @@ -478,39 +449,39 @@ firmware_modevent(module_t mod, int type, void *unused (void) taskqueue_start_threads(&firmware_tq, 1, PWAIT, "firmware taskq"); if (rootvnode != NULL) { - /* + /* * Root is already mounted so we won't get an event; * simulate one here. */ firmware_mountroot(NULL); } - return 0; + break; case MOD_UNLOAD: /* request all autoloaded modules to be released */ mtx_lock(&firmware_mtx); - for (i = 0; i < FIRMWARE_MAX; i++) { - fp = &firmware_table[i]; + LIST_FOREACH(fp, &firmware_table, link) fp->flags |= FW_UNLOAD; - } mtx_unlock(&firmware_mtx); taskqueue_enqueue(firmware_tq, &firmware_unload_task); taskqueue_drain(firmware_tq, &firmware_unload_task); - err = 0; - for (i = 0; i < FIRMWARE_MAX; i++) { - fp = &firmware_table[i]; + + LIST_FOREACH(fp, &firmware_table, link) { if (fp->fw.name != NULL) { - printf("%s: image %p ref %d still active slot %d\n", - __func__, fp->fw.name, - fp->refcnt, i); + printf("%s: image %s still active, %d refs\n", + __func__, fp->fw.name, fp->refcnt); err = EINVAL; } } if (err == 0) taskqueue_free(firmware_tq); - return err; + break; + + default: + err = EOPNOTSUPP; + break; } - return EINVAL; + return (err); } static moduledata_t firmware_mod = { From owner-svn-src-all@freebsd.org Wed Jun 17 19:45:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BACE33320D; Wed, 17 Jun 2020 19:45:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nFsF6fkkz4Nd7; Wed, 17 Jun 2020 19:45:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB35C250C3; Wed, 17 Jun 2020 19:45:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HJj5YK025705; Wed, 17 Jun 2020 19:45:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HJj5Ia025704; Wed, 17 Jun 2020 19:45:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006171945.05HJj5Ia025704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 17 Jun 2020 19:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362284 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 362284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 19:45:06 -0000 Author: andrew Date: Wed Jun 17 19:45:05 2020 New Revision: 362284 URL: https://svnweb.freebsd.org/changeset/base/362284 Log: Support pmap_extract_and_hold on arm64 stage 2 mappings Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D24469 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Jun 17 18:47:59 2020 (r362283) +++ head/sys/arm64/arm64/pmap.c Wed Jun 17 19:45:05 2020 (r362284) @@ -1228,9 +1228,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ vm_offset_t off; vm_page_t m; int lvl; + bool use; - PMAP_ASSERT_STAGE1(pmap); - m = NULL; PMAP_LOCK(pmap); pte = pmap_pte(pmap, va, &lvl); @@ -1244,8 +1243,19 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ (lvl < 3 && (tpte & ATTR_DESCR_MASK) == L1_BLOCK), ("pmap_extract_and_hold: Invalid pte at L%d: %lx", lvl, tpte & ATTR_DESCR_MASK)); - if (((tpte & ATTR_S1_AP_RW_BIT) == ATTR_S1_AP(ATTR_S1_AP_RW)) || - ((prot & VM_PROT_WRITE) == 0)) { + + use = false; + if ((prot & VM_PROT_WRITE) == 0) + use = true; + else if (pmap->pm_stage == PM_STAGE1 && + (tpte & ATTR_S1_AP_RW_BIT) == ATTR_S1_AP(ATTR_S1_AP_RW)) + use = true; + else if (pmap->pm_stage == PM_STAGE2 && + ((tpte & ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE)) == + ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE))) + use = true; + + if (use) { switch(lvl) { case 1: off = va & L1_OFFSET; From owner-svn-src-all@freebsd.org Wed Jun 17 19:56:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A0523333FB; Wed, 17 Jun 2020 19:56:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nG6B1JTCz4Pt7; Wed, 17 Jun 2020 19:56:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 281BE25811; Wed, 17 Jun 2020 19:56:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HJuIql032158; Wed, 17 Jun 2020 19:56:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HJuH8B032154; Wed, 17 Jun 2020 19:56:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006171956.05HJuH8B032154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 17 Jun 2020 19:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362285 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 362285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 19:56:18 -0000 Author: andrew Date: Wed Jun 17 19:56:17 2020 New Revision: 362285 URL: https://svnweb.freebsd.org/changeset/base/362285 Log: Clean up the pci host generic driver - Support Prefetchable Memory. - Use the correct rman when allocating memory and ioports. - Translate PCI addresses in bus_alloc_resource to allow physical addresses that are different than pci addresses. Reviewed by: Robert Crowston Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25121 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h head/sys/dev/pci/pci_host_generic_acpi.c head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Wed Jun 17 19:45:05 2020 (r362284) +++ head/sys/dev/pci/pci_host_generic.c Wed Jun 17 19:56:17 2020 (r362285) @@ -70,8 +70,11 @@ int pci_host_generic_core_attach(device_t dev) { struct generic_pcie_core_softc *sc; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; int error; - int rid; + int rid, tuple; sc = device_get_softc(dev); sc->dev = dev; @@ -101,12 +104,23 @@ pci_host_generic_core_attach(device_t dev) sc->bst = rman_get_bustag(sc->res); sc->bsh = rman_get_bushandle(sc->res); + sc->has_pmem = false; + sc->pmem_rman.rm_type = RMAN_ARRAY; + sc->pmem_rman.rm_descr = "PCIe Prefetch Memory"; + sc->mem_rman.rm_type = RMAN_ARRAY; sc->mem_rman.rm_descr = "PCIe Memory"; + sc->io_rman.rm_type = RMAN_ARRAY; sc->io_rman.rm_descr = "PCIe IO window"; /* Initialize rman and allocate memory regions */ + error = rman_init(&sc->pmem_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + return (error); + } + error = rman_init(&sc->mem_rman); if (error) { device_printf(dev, "rman_init() failed. error = %d\n", error); @@ -119,6 +133,39 @@ pci_host_generic_core_attach(device_t dev) return (error); } + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + phys_base = sc->ranges[tuple].phys_base; + pci_base = sc->ranges[tuple].pci_base; + size = sc->ranges[tuple].size; + if (phys_base == 0 || size == 0) + continue; /* empty range element */ + switch (FLAG_TYPE(sc->ranges[tuple].flags)) { + case FLAG_TYPE_PMEM: + sc->has_pmem = true; + error = rman_manage_region(&sc->pmem_rman, + phys_base, phys_base + size - 1); + break; + case FLAG_TYPE_MEM: + error = rman_manage_region(&sc->mem_rman, + phys_base, phys_base + size - 1); + break; + case FLAG_TYPE_IO: + error = rman_manage_region(&sc->io_rman, + phys_base, phys_base + size - 1); + break; + default: + continue; + } + if (error) { + device_printf(dev, "rman_manage_region() failed." + "error = %d\n", error); + rman_fini(&sc->pmem_rman); + rman_fini(&sc->mem_rman); + rman_fini(&sc->io_rman); + return (error); + } + } + return (0); } @@ -236,13 +283,15 @@ generic_pcie_write_ivar(device_t dev, device_t child, } static struct rman * -generic_pcie_rman(struct generic_pcie_core_softc *sc, int type) +generic_pcie_rman(struct generic_pcie_core_softc *sc, int type, int flags) { switch (type) { case SYS_RES_IOPORT: return (&sc->io_rman); case SYS_RES_MEMORY: + if (sc->has_pmem && (flags & RF_PREFETCHABLE) != 0) + return (&sc->pmem_rman); return (&sc->mem_rman); default: break; @@ -266,7 +315,7 @@ pci_host_generic_core_release_resource(device_t dev, d } #endif - rm = generic_pcie_rman(sc, type); + rm = generic_pcie_rman(sc, type, rman_get_flags(res)); if (rm != NULL) { KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); rman_release_resource(res); @@ -282,6 +331,11 @@ pci_host_generic_core_alloc_resource(device_t dev, dev struct generic_pcie_core_softc *sc; struct resource *res; struct rman *rm; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; + int i, space; + bool found; sc = device_get_softc(dev); @@ -292,11 +346,56 @@ pci_host_generic_core_alloc_resource(device_t dev, dev } #endif - rm = generic_pcie_rman(sc, type); + rm = generic_pcie_rman(sc, type, flags); if (rm == NULL) return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags)); + /* Translate the address from a PCI address to a physical address */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + found = false; + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + pci_base = sc->ranges[i].pci_base; + phys_base = sc->ranges[i].phys_base; + size = sc->ranges[i].size; + + if (start < pci_base || start >= pci_base + size) + continue; + + switch (FLAG_TYPE(sc->ranges[i].flags)) { + case FLAG_TYPE_MEM: + case FLAG_TYPE_PMEM: + space = SYS_RES_MEMORY; + break; + case FLAG_TYPE_IO: + space = SYS_RES_IOPORT; + break; + default: + space = -1; + continue; + } + + if (type == space) { + start = start - pci_base + phys_base; + end = end - pci_base + phys_base; + found = true; + break; + } + } + if (!found) { + device_printf(dev, + "Failed to allocate %s resource %lx-%lx for %s\n", + type == SYS_RES_IOPORT ? "IOPORT" : "MEMORY", + start, end, device_get_nameunit(child)); + return (NULL); + } + break; + default: + break; + } + if (bootverbose) { device_printf(dev, "rman_reserve_resource: start=%#jx, end=%#jx, count=%#jx\n", @@ -330,53 +429,15 @@ generic_pcie_activate_resource(device_t dev, device_t int rid, struct resource *r) { struct generic_pcie_core_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; - int found; int res; - int i; sc = device_get_softc(dev); if ((res = rman_activate_resource(r)) != 0) return (res); - switch (type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - found = 0; - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - pci_base = sc->ranges[i].pci_base; - phys_base = sc->ranges[i].phys_base; - size = sc->ranges[i].size; - - if ((rman_get_start(r) >= pci_base) && (rman_get_start(r) < (pci_base + size))) { - found = 1; - break; - } - } - if (found) { - rman_set_start(r, rman_get_start(r) - pci_base + phys_base); - rman_set_end(r, rman_get_end(r) - pci_base + phys_base); - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), - child, type, rid, r); - } else { - device_printf(dev, - "Failed to activate %s resource\n", - type == SYS_RES_IOPORT ? "IOPORT" : "MEMORY"); - res = ENXIO; - } - break; - case SYS_RES_IRQ: - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); + return (BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, + rid, r)); } static int @@ -416,7 +477,7 @@ generic_pcie_adjust_resource(device_t dev, device_t ch end)); #endif - rm = generic_pcie_rman(sc, type); + rm = generic_pcie_rman(sc, type, rman_get_flags(res)); if (rm != NULL) return (rman_adjust_resource(res, start, end)); return (bus_generic_adjust_resource(dev, child, type, res, start, end)); Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Wed Jun 17 19:45:05 2020 (r362284) +++ head/sys/dev/pci/pci_host_generic.h Wed Jun 17 19:56:17 2020 (r362285) @@ -59,14 +59,20 @@ struct pcie_range { uint64_t phys_base; uint64_t size; uint64_t flags; -#define FLAG_IO (1 << 0) -#define FLAG_MEM (1 << 1) +#define FLAG_TYPE(x) ((x) & FLAG_TYPE_MASK) +#define FLAG_TYPE_MASK 0x3 +#define FLAG_TYPE_INVALID 0x0 +#define FLAG_TYPE_IO 0x1 +#define FLAG_TYPE_MEM 0x2 +#define FLAG_TYPE_PMEM 0x3 }; struct generic_pcie_core_softc { struct pcie_range ranges[MAX_RANGES_TUPLES]; int nranges; int coherent; + bool has_pmem; + struct rman pmem_rman; struct rman mem_rman; struct rman io_rman; struct resource *res; Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Wed Jun 17 19:45:05 2020 (r362284) +++ head/sys/dev/pci/pci_host_generic_acpi.c Wed Jun 17 19:56:17 2020 (r362285) @@ -159,9 +159,9 @@ pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *re sc->base.ranges[r].phys_base = min + off; sc->base.ranges[r].size = max - min + 1; if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) - sc->base.ranges[r].flags |= FLAG_MEM; + sc->base.ranges[r].flags |= FLAG_TYPE_MEM; else if (res->Data.Address.ResourceType == ACPI_IO_RANGE) - sc->base.ranges[r].flags |= FLAG_IO; + sc->base.ranges[r].flags |= FLAG_TYPE_IO; sc->base.nranges++; } else if (res->Data.Address.ResourceType == ACPI_BUS_NUMBER_RANGE) { sc->base.bus_start = min; @@ -234,12 +234,8 @@ pci_host_generic_acpi_init(device_t dev) { struct generic_pcie_acpi_softc *sc; ACPI_HANDLE handle; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; ACPI_STATUS status; int error; - int tuple; sc = device_get_softc(dev); handle = acpi_get_handle(dev); @@ -278,29 +274,6 @@ pci_host_generic_acpi_init(device_t dev) error = pci_host_generic_core_attach(dev); if (error != 0) return (error); - - for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { - phys_base = sc->base.ranges[tuple].phys_base; - pci_base = sc->base.ranges[tuple].pci_base; - size = sc->base.ranges[tuple].size; - if (phys_base == 0 || size == 0) - continue; /* empty range element */ - if (sc->base.ranges[tuple].flags & FLAG_MEM) { - error = rman_manage_region(&sc->base.mem_rman, - pci_base, pci_base + size - 1); - } else if (sc->base.ranges[tuple].flags & FLAG_IO) { - error = rman_manage_region(&sc->base.io_rman, - pci_base + PCI_IO_WINDOW_OFFSET, - pci_base + PCI_IO_WINDOW_OFFSET + size - 1); - } else - continue; - if (error) { - device_printf(dev, "rman_manage_region() failed." - "error = %d\n", error); - rman_fini(&sc->base.mem_rman); - return (error); - } - } return (0); } Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Wed Jun 17 19:45:05 2020 (r362284) +++ head/sys/dev/pci/pci_host_generic_fdt.c Wed Jun 17 19:56:17 2020 (r362285) @@ -123,12 +123,8 @@ int pci_host_generic_attach(device_t dev) { struct generic_pcie_fdt_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; phandle_t node; int error; - int tuple; sc = device_get_softc(dev); @@ -157,28 +153,6 @@ pci_host_generic_attach(device_t dev) if (error != 0) return (error); - for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { - phys_base = sc->base.ranges[tuple].phys_base; - pci_base = sc->base.ranges[tuple].pci_base; - size = sc->base.ranges[tuple].size; - if (phys_base == 0 || size == 0) - continue; /* empty range element */ - if (sc->base.ranges[tuple].flags & FLAG_MEM) { - error = rman_manage_region(&sc->base.mem_rman, - pci_base, pci_base + size - 1); - } else if (sc->base.ranges[tuple].flags & FLAG_IO) { - error = rman_manage_region(&sc->base.io_rman, - pci_base, pci_base + size - 1); - } else - continue; - if (error) { - device_printf(dev, "rman_manage_region() failed." - "error = %d\n", error); - rman_fini(&sc->base.mem_rman); - return (error); - } - } - ofw_bus_setup_iinfo(node, &sc->pci_iinfo, sizeof(cell_t)); device_add_child(dev, "pci", -1); @@ -221,9 +195,9 @@ parse_pci_mem_ranges(device_t dev, struct generic_pcie attributes = (base_ranges[j++] >> SPACE_CODE_SHIFT) & \ SPACE_CODE_MASK; if (attributes == SPACE_CODE_IO_SPACE) { - sc->ranges[i].flags |= FLAG_IO; + sc->ranges[i].flags |= FLAG_TYPE_IO; } else { - sc->ranges[i].flags |= FLAG_MEM; + sc->ranges[i].flags |= FLAG_TYPE_MEM; } sc->ranges[i].pci_base = 0; From owner-svn-src-all@freebsd.org Wed Jun 17 19:57:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F6E3338CA; Wed, 17 Jun 2020 19:57:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nG7N0cmwz4Pr4; Wed, 17 Jun 2020 19:57:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1001C25812; Wed, 17 Jun 2020 19:57:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HJvKea032248; Wed, 17 Jun 2020 19:57:20 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HJvJvM032245; Wed, 17 Jun 2020 19:57:19 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202006171957.05HJvJvM032245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 17 Jun 2020 19:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362286 - in vendor/flex: . dist dist/src X-SVN-Group: vendor X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor/flex: . dist dist/src X-SVN-Commit-Revision: 362286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 19:57:20 -0000 Author: jkim Date: Wed Jun 17 19:57:19 2020 New Revision: 362286 URL: https://svnweb.freebsd.org/changeset/base/362286 Log: Import flex 2.6.4. Added: vendor/flex/dist/README.md vendor/flex/dist/configure.ac vendor/flex/dist/src/ vendor/flex/dist/src/FlexLexer.h - copied, changed from r362285, vendor/flex/dist/FlexLexer.h vendor/flex/dist/src/Makefile.am vendor/flex/dist/src/Makefile.in vendor/flex/dist/src/buf.c - copied, changed from r362285, vendor/flex/dist/buf.c vendor/flex/dist/src/ccl.c - copied, changed from r362285, vendor/flex/dist/ccl.c vendor/flex/dist/src/config.h.in vendor/flex/dist/src/dfa.c - copied, changed from r362285, vendor/flex/dist/dfa.c vendor/flex/dist/src/ecs.c - copied, changed from r362285, vendor/flex/dist/ecs.c vendor/flex/dist/src/filter.c - copied, changed from r362285, vendor/flex/dist/filter.c vendor/flex/dist/src/flex.skl - copied, changed from r362285, vendor/flex/dist/flex.skl vendor/flex/dist/src/flexdef.h - copied, changed from r362285, vendor/flex/dist/flexdef.h vendor/flex/dist/src/flexint.h - copied, changed from r362285, vendor/flex/dist/flexint.h vendor/flex/dist/src/gen.c - copied, changed from r362285, vendor/flex/dist/gen.c vendor/flex/dist/src/gettext.h - copied unchanged from r362285, vendor/flex/dist/gettext.h vendor/flex/dist/src/libmain.c - copied, changed from r362285, vendor/flex/dist/libmain.c vendor/flex/dist/src/libyywrap.c - copied, changed from r362285, vendor/flex/dist/libyywrap.c vendor/flex/dist/src/main.c - copied, changed from r362285, vendor/flex/dist/main.c vendor/flex/dist/src/misc.c - copied, changed from r362285, vendor/flex/dist/misc.c vendor/flex/dist/src/mkskel.sh - copied, changed from r362285, vendor/flex/dist/mkskel.sh vendor/flex/dist/src/nfa.c - copied, changed from r362285, vendor/flex/dist/nfa.c vendor/flex/dist/src/options.c - copied, changed from r362285, vendor/flex/dist/options.c vendor/flex/dist/src/options.h - copied, changed from r362285, vendor/flex/dist/options.h vendor/flex/dist/src/parse.c - copied, changed from r362285, vendor/flex/dist/parse.c vendor/flex/dist/src/parse.h - copied, changed from r362285, vendor/flex/dist/parse.h vendor/flex/dist/src/parse.y - copied, changed from r362285, vendor/flex/dist/parse.y vendor/flex/dist/src/regex.c - copied, changed from r362285, vendor/flex/dist/regex.c vendor/flex/dist/src/scan.c - copied, changed from r362285, vendor/flex/dist/scan.c vendor/flex/dist/src/scan.l - copied, changed from r362285, vendor/flex/dist/scan.l vendor/flex/dist/src/scanflags.c - copied, changed from r362285, vendor/flex/dist/scanflags.c vendor/flex/dist/src/scanopt.c - copied, changed from r362285, vendor/flex/dist/scanopt.c vendor/flex/dist/src/scanopt.h - copied, changed from r362285, vendor/flex/dist/scanopt.h vendor/flex/dist/src/skel.c - copied, changed from r362285, vendor/flex/dist/skel.c vendor/flex/dist/src/sym.c - copied, changed from r362285, vendor/flex/dist/sym.c vendor/flex/dist/src/tables.c - copied, changed from r362285, vendor/flex/dist/tables.c vendor/flex/dist/src/tables.h - copied, changed from r362285, vendor/flex/dist/tables.h vendor/flex/dist/src/tables_shared.c - copied, changed from r362285, vendor/flex/dist/tables_shared.c vendor/flex/dist/src/tables_shared.h - copied unchanged from r362285, vendor/flex/dist/tables_shared.h vendor/flex/dist/src/tblcmp.c - copied, changed from r362285, vendor/flex/dist/tblcmp.c vendor/flex/dist/src/version.h - copied unchanged from r362285, vendor/flex/dist/version.h vendor/flex/dist/src/yylex.c - copied, changed from r362285, vendor/flex/dist/yylex.c Deleted: vendor/flex/dist/FlexLexer.h vendor/flex/dist/INSTALL vendor/flex/dist/README vendor/flex/dist/README-alpha vendor/flex/dist/README.cvs vendor/flex/dist/TODO vendor/flex/dist/buf.c vendor/flex/dist/ccl.c vendor/flex/dist/compile vendor/flex/dist/conf.in vendor/flex/dist/config.guess vendor/flex/dist/config.rpath vendor/flex/dist/config.sub vendor/flex/dist/configure.in vendor/flex/dist/depcomp vendor/flex/dist/dfa.c vendor/flex/dist/ecs.c vendor/flex/dist/filter.c vendor/flex/dist/flex.skl vendor/flex/dist/flexdef.h vendor/flex/dist/flexint.h vendor/flex/dist/gen.c vendor/flex/dist/gettext.h vendor/flex/dist/install-sh vendor/flex/dist/libmain.c vendor/flex/dist/libyywrap.c vendor/flex/dist/main.c vendor/flex/dist/misc.c vendor/flex/dist/missing vendor/flex/dist/mkinstalldirs vendor/flex/dist/mkskel.sh vendor/flex/dist/nfa.c vendor/flex/dist/options.c vendor/flex/dist/options.h vendor/flex/dist/parse.c vendor/flex/dist/parse.h vendor/flex/dist/parse.y vendor/flex/dist/regex.c vendor/flex/dist/scan.c vendor/flex/dist/scan.l vendor/flex/dist/scanflags.c vendor/flex/dist/scanopt.c vendor/flex/dist/scanopt.h vendor/flex/dist/skel.c vendor/flex/dist/sym.c vendor/flex/dist/tables.c vendor/flex/dist/tables.h vendor/flex/dist/tables_shared.c vendor/flex/dist/tables_shared.h vendor/flex/dist/tblcmp.c vendor/flex/dist/version.h vendor/flex/dist/ylwrap vendor/flex/dist/yylex.c Modified: vendor/flex/FREEBSD-Xlist vendor/flex/dist/ABOUT-NLS vendor/flex/dist/ChangeLog vendor/flex/dist/Makefile.am vendor/flex/dist/Makefile.in vendor/flex/dist/NEWS vendor/flex/dist/autogen.sh vendor/flex/dist/configure Modified: vendor/flex/FREEBSD-Xlist ============================================================================== --- vendor/flex/FREEBSD-Xlist Wed Jun 17 19:56:17 2020 (r362285) +++ vendor/flex/FREEBSD-Xlist Wed Jun 17 19:57:19 2020 (r362286) @@ -1,3 +1,4 @@ +*/build-aux */doc */examples */lib Modified: vendor/flex/dist/ABOUT-NLS ============================================================================== --- vendor/flex/dist/ABOUT-NLS Wed Jun 17 19:56:17 2020 (r362285) +++ vendor/flex/dist/ABOUT-NLS Wed Jun 17 19:57:19 2020 (r362286) @@ -1,10 +1,11 @@ -Notes on the Free Translation Project -************************************* +1 Notes on the Free Translation Project +*************************************** - Free software is going international! The Free Translation Project -is a way to get maintainers of free software, translators, and users all -together, so that will gradually become able to speak many languages. -A few packages already provide translations for their messages. +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, @@ -15,17 +16,17 @@ this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and -work at translations should contact the appropriate team. +work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. -Quick configuration advice -========================== +1.1 Quick configuration advice +============================== - If you want to exploit the full power of internationalization, you +If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext @@ -45,37 +46,37 @@ to change to GNU `gettext' as soon as possible. you have installed a recent copy of the GNU gettext package with the included `libintl'. -INSTALL Matters -=============== +1.2 INSTALL Matters +=================== - Some packages are "localizable" when properly installed; the -programs they contain can be made to speak your own native language. -Most such packages use GNU `gettext'. Other packages have their own -ways to internationalization, predating GNU `gettext'. +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already -provides the GNU `gettext' functions. If not, the GNU `gettext' own -library will be used. This library is wholly contained within this -package, usually in the `intl/' subdirectory, so prior installation of -the GNU `gettext' package is _not_ required. Installers may use -special options at configuration time for changing the default -behaviour. The commands: +provides the GNU `gettext' functions. If not, the included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls -will respectively bypass any pre-existing `gettext' to use the +will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and -will decide to use this. This might be not what is desirable. You -should use the more recent version of the GNU `gettext' library. I.e. -if the file `intl/VERSION' shows that the library which comes with this -package is more recent, you should use +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use ./configure --with-included-gettext @@ -86,7 +87,7 @@ and therefore it will not be used. The reason is that emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. - Internationalized packages have usually many `po/LL.po' files, where + Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed @@ -95,13 +96,16 @@ may be set, prior to configuration, to limit the insta `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. -Using This Package -================== +1.3 Using This Package +====================== - As a user, if your language has been installed for this package, you +As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate -`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, -and `CC' is an ISO 3166 two-letter country code. For example, let's +`LL_CC' combination. If you happen to have the `LC_ALL' or some other +`LC_xxx' environment variables set, you should unset them before +setting `LANG', otherwise the setting of `LANG' will not have the +desired effect. Here `LL' is an ISO 639 two-letter language code, and +`CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). @@ -117,8 +121,8 @@ country code serves to distinguish the dialects. language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of -locales supported by your system for your country by running the command -`locale -a | grep '^LL''. +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you @@ -131,22 +135,28 @@ system libraries. For example, some Swedish users who read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. -Translating Teams -================= +1.4 Translating Teams +===================== - For the Free Translation Project to be a success, we need interested +For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, -`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" -area. +`http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. @@ -160,434 +170,1126 @@ message to `sv-request@li.org', having this message bo _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to -get started, please write to `translation@iro.umontreal.ca' to reach the -coordinator for all translator teams. +get started, please write to `coordinator@translationproject.org' to +reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing -the terminology in use. Proven linguistic skill are praised more than -programming skill, here. +the terminology in use. Proven linguistic skills are praised more than +programming skills, here. -Available Packages -================== +1.5 Available Packages +====================== - Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of May 2003. +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of May 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. - Ready PO files am az be bg ca cs da de el en en_GB eo es - +-------------------------------------------+ - a2ps | [] [] [] [] | - aegis | () | - anubis | | - ap-utils | | - bash | [] [] [] | - batchelor | | - bfd | [] [] | - binutils | [] [] | - bison | [] [] [] | - bluez-pin | [] [] | - clisp | | - clisp | [] [] [] | - coreutils | [] [] [] [] | - cpio | [] [] [] | - darkstat | () [] | - diffutils | [] [] [] [] [] [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] | - error | [] [] [] [] [] | - fetchmail | [] () [] [] [] [] | - fileutils | [] [] [] | - findutils | [] [] [] [] [] [] | - flex | [] [] [] [] | - gas | [] | - gawk | [] [] [] [] | - gcal | [] | - gcc | [] [] | - gettext | [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] | - gettext-tools | [] [] | - gimp-print | [] [] [] [] [] | - gliv | | - glunarclock | [] [] [] | - gnucash | () [] | - gnucash-glossary | [] () [] | - gnupg | [] () [] [] [] [] | - gpe-calendar | [] | - gpe-conf | [] | - gpe-contacts | [] | - gpe-edit | | - gpe-login | [] | - gpe-ownerinfo | [] | - gpe-sketchbook | [] | - gpe-timesheet | | - gpe-today | [] | - gpe-todo | [] | - gphoto2 | [] [] [] [] | - gprof | [] [] | - gpsdrive | () () () | - grep | [] [] [] [] [] | - gretl | [] | - hello | [] [] [] [] [] [] | - id-utils | [] [] | - indent | [] [] [] [] | - jpilot | [] [] [] [] | - jwhois | [] | - kbd | [] [] [] [] [] | - ld | [] [] | - libc | [] [] [] [] [] [] | - libgpewidget | [] | - libiconv | [] [] [] [] [] | - lifelines | [] () | - lilypond | [] | - lingoteach | | - lingoteach_lessons | () () | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailutils | [] [] | - make | [] [] [] | - man-db | [] () [] [] () | - mysecretdiary | [] [] [] | - nano | [] () [] [] [] | - nano_1_0 | [] () [] [] [] | - opcodes | [] [] | - parted | [] [] [] [] [] | - ptx | [] [] [] [] [] | - python | | - radius | | - recode | [] [] [] [] [] [] | - screem | | - sed | [] [] [] [] [] | - sh-utils | [] [] [] | - sharutils | [] [] [] [] [] [] | - sketch | [] () [] | - soundtracker | [] [] [] | - sp | [] | - tar | [] [] [] [] | - texinfo | [] [] [] [] | - textutils | [] [] [] [] | - tin | () () | - util-linux | [] [] [] [] [] | - vorbis-tools | [] [] [] | - wastesedge | () | - wdiff | [] [] [] [] | - wget | [] [] [] [] [] [] [] | - xchat | [] [] [] | - xpad | | - +-------------------------------------------+ - am az be bg ca cs da de el en en_GB eo es - 0 1 4 2 31 17 54 60 14 1 4 12 56 - - et fa fi fr ga gl he hr hu id it ja ko - +----------------------------------------+ - a2ps | [] [] [] () () | - aegis | | - anubis | [] | - ap-utils | [] | - bash | [] [] | - batchelor | [] | - bfd | [] [] | - binutils | [] [] | - bison | [] [] [] [] | - bluez-pin | [] [] [] [] | - clisp | | - clisp | [] | - coreutils | [] [] [] [] | - cpio | [] [] [] [] | - darkstat | () [] [] [] | - diffutils | [] [] [] [] [] [] [] | - e2fsprogs | | - enscript | [] [] | - error | [] [] [] [] | - fetchmail | [] | - fileutils | [] [] [] [] [] | - findutils | [] [] [] [] [] [] [] [] [] [] [] | - flex | [] [] | - gas | [] | - gawk | [] [] | - gcal | [] | - gcc | [] | - gettext | [] [] [] | - gettext-runtime | [] [] [] [] | - gettext-tools | [] | - gimp-print | [] [] | - gliv | () | - glunarclock | [] [] [] [] | - gnucash | [] | - gnucash-glossary | [] | - gnupg | [] [] [] [] [] [] [] | - gpe-calendar | [] | - gpe-conf | | - gpe-contacts | [] | - gpe-edit | [] [] | - gpe-login | [] | - gpe-ownerinfo | [] [] [] | - gpe-sketchbook | [] | - gpe-timesheet | [] [] [] | - gpe-today | [] [] | - gpe-todo | [] [] | - gphoto2 | [] [] [] | - gprof | [] [] | - gpsdrive | () [] () () | - grep | [] [] [] [] [] [] [] [] [] [] [] | - gretl | [] | - hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | - id-utils | [] [] [] | - indent | [] [] [] [] [] [] [] [] | - jpilot | [] () | - jwhois | [] [] [] [] | - kbd | [] | - ld | [] | - libc | [] [] [] [] [] [] | - libgpewidget | [] [] [] | - libiconv | [] [] [] [] [] [] [] [] | - lifelines | () | - lilypond | [] | - lingoteach | [] [] | - lingoteach_lessons | | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailutils | | - make | [] [] [] [] [] [] | - man-db | [] () () | - mysecretdiary | [] [] | - nano | [] [] [] [] | - nano_1_0 | [] [] [] [] | - opcodes | [] [] | - parted | [] [] [] | - ptx | [] [] [] [] [] [] [] | - python | | - radius | | - recode | [] [] [] [] [] [] | - screem | | - sed | [] [] [] [] [] [] [] [] | - sh-utils | [] [] [] [] [] [] | - sharutils | [] [] [] [] [] | - sketch | [] | - soundtracker | [] [] [] | - sp | [] () | - tar | [] [] [] [] [] [] [] [] [] | - texinfo | [] [] [] [] | - textutils | [] [] [] [] [] | - tin | [] () | - util-linux | [] [] [] [] () [] | - vorbis-tools | [] | - wastesedge | () | - wdiff | [] [] [] [] [] | - wget | [] [] [] [] [] [] [] [] | - xchat | [] [] [] | - xpad | | - +----------------------------------------+ - et fa fi fr ga gl he hr hu id it ja ko - 20 1 15 73 14 24 8 10 30 31 19 31 9 - - lg lt lv ms nb nl nn no pl pt pt_BR ro - +----------------------------------------+ - a2ps | [] [] () () () [] [] | - aegis | () | - anubis | [] [] | - ap-utils | () | - bash | [] | - batchelor | | - bfd | | - binutils | | - bison | [] [] [] [] | - bluez-pin | [] | - clisp | | - clisp | [] | - coreutils | [] | - cpio | [] [] [] | - darkstat | [] [] [] [] | - diffutils | [] [] [] | - e2fsprogs | | - enscript | [] [] | - error | [] [] | - fetchmail | () () | - fileutils | [] | - findutils | [] [] [] [] | - flex | [] | - gas | | - gawk | [] | - gcal | | - gcc | | - gettext | [] | - gettext-runtime | [] | - gettext-tools | | - gimp-print | [] | - gliv | [] | - glunarclock | [] | - gnucash | | - gnucash-glossary | [] [] | - gnupg | | - gpe-calendar | [] [] | - gpe-conf | [] [] | - gpe-contacts | [] | - gpe-edit | [] [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] | - gpe-sketchbook | [] [] | - gpe-timesheet | [] [] | - gpe-today | [] [] | - gpe-todo | [] [] | - gphoto2 | | - gprof | [] | - gpsdrive | () () () | - grep | [] [] [] [] | - gretl | | - hello | [] [] [] [] [] [] [] [] [] | - id-utils | [] [] [] | - indent | [] [] [] | - jpilot | () () | - jwhois | [] [] [] | - kbd | | - ld | | - libc | [] [] [] [] | - libgpewidget | [] [] | - libiconv | [] [] | - lifelines | | - lilypond | [] | - lingoteach | | - lingoteach_lessons | | - lynx | [] [] | - m4 | [] [] [] [] | - mailutils | | - make | [] [] | - man-db | [] | - mysecretdiary | [] | - nano | [] [] [] [] | - nano_1_0 | [] [] [] [] | - opcodes | [] [] [] | - parted | [] [] [] | - ptx | [] [] [] [] [] [] [] | - python | | - radius | | - recode | [] [] [] | - screem | | - sed | [] [] | - sh-utils | [] | - sharutils | [] | - sketch | [] | - soundtracker | | - sp | | - tar | [] [] [] [] [] [] | - texinfo | [] | - textutils | [] | - tin | | - util-linux | [] [] | - vorbis-tools | [] [] | - wastesedge | | - wdiff | [] [] [] [] | - wget | [] [] [] | - xchat | [] [] | - xpad | [] | - +----------------------------------------+ - lg lt lv ms nb nl nn no pl pt pt_BR ro - 0 0 2 11 7 26 3 4 18 15 34 34 - - ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW - +-------------------------------------------+ - a2ps | [] [] [] [] [] | 16 - aegis | () | 0 - anubis | [] [] | 5 - ap-utils | () | 1 - bash | [] | 7 - batchelor | | 1 - bfd | [] [] [] | 7 - binutils | [] [] [] | 7 - bison | [] [] | 13 - bluez-pin | | 7 - clisp | | 0 - clisp | | 5 - coreutils | [] [] [] [] [] | 14 - cpio | [] [] [] | 13 - darkstat | [] () () | 9 - diffutils | [] [] [] [] | 21 - e2fsprogs | [] | 3 - enscript | [] [] [] | 11 - error | [] [] [] | 14 - fetchmail | [] | 7 - fileutils | [] [] [] [] [] [] | 15 - findutils | [] [] [] [] [] [] | 27 - flex | [] [] [] | 10 - gas | [] | 3 - gawk | [] [] | 9 - gcal | [] [] | 4 - gcc | [] | 4 - gettext | [] [] [] [] [] [] | 15 - gettext-runtime | [] [] [] [] [] [] | 16 - gettext-tools | [] [] | 5 - gimp-print | [] [] | 10 - gliv | | 1 - glunarclock | [] [] [] | 11 - gnucash | [] [] | 4 - gnucash-glossary | [] [] [] | 8 - gnupg | [] [] [] [] | 16 - gpe-calendar | [] | 5 - gpe-conf | | 3 - gpe-contacts | [] | 4 - gpe-edit | [] | 5 - gpe-login | [] | 5 - gpe-ownerinfo | [] | 7 - gpe-sketchbook | [] | 5 - gpe-timesheet | [] | 6 - gpe-today | [] | 6 - gpe-todo | [] | 6 - gphoto2 | [] [] | 9 - gprof | [] [] | 7 - gpsdrive | [] [] | 3 - grep | [] [] [] [] | 24 - gretl | | 2 - hello | [] [] [] [] [] | 33 - id-utils | [] [] [] | 11 - indent | [] [] [] [] | 19 - jpilot | [] [] [] [] [] | 10 - jwhois | () () [] [] | 10 - kbd | [] [] | 8 - ld | [] [] | 5 - libc | [] [] [] [] | 20 - libgpewidget | | 6 - libiconv | [] [] [] [] [] [] | 21 - lifelines | [] | 2 - lilypond | [] | 4 - lingoteach | | 2 - lingoteach_lessons | () | 0 - lynx | [] [] [] [] | 14 - m4 | [] [] [] | 15 - mailutils | | 2 - make | [] [] [] [] | 15 - man-db | [] | 6 - mysecretdiary | [] [] | 8 - nano | [] [] [] | 15 - nano_1_0 | [] [] [] | 15 - opcodes | [] [] | 9 - parted | [] [] | 13 - ptx | [] [] [] | 22 - python | | 0 - radius | | 0 - recode | [] [] [] [] | 19 - screem | [] | 1 - sed | [] [] [] [] [] | 20 - sh-utils | [] [] [] | 13 - sharutils | [] [] [] [] | 16 - sketch | [] | 5 - soundtracker | [] | 7 - sp | [] | 3 - tar | [] [] [] [] [] | 24 - texinfo | [] [] [] [] | 13 - textutils | [] [] [] [] [] | 15 - tin | | 1 - util-linux | [] [] | 14 - vorbis-tools | [] | 7 - wastesedge | | 0 - wdiff | [] [] [] [] | 17 - wget | [] [] [] [] [] [] [] | 25 - xchat | [] [] [] | 11 - xpad | | 1 - +-------------------------------------------+ - 50 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW - 97 domains 32 19 16 0 56 0 48 10 1 1 12 23 913 + Ready PO files af am ar as ast az be be@latin bg bn_IN bs ca crh + +---------------------------------------------------+ + a2ps | [] [] | + aegis | | + ant-phone | | + anubis | | + aspell | [] [] | + bash | | + bfd | | + bibshelf | [] | + binutils | | + bison | | + bison-runtime | [] | + bluez-pin | [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] [] | + cpio | | + cppi | | + cpplib | [] | + cryptsetup | | + dfarc | | + dialog | [] [] | + dico | | + diffutils | [] | + dink | | + doodle | | + e2fsprogs | [] | + enscript | [] | + exif | | + fetchmail | [] | + findutils | [] | + flex | [] | + freedink | | + gas | | + gawk | [] [] | + gcal | [] | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gip | [] | + gjay | | + gliv | [] | + glunarclock | [] [] | + gnubiff | | + gnucash | [] | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | | + gold | | + gpe-aerial | | + gpe-beam | | + gpe-bluetooth | | + gpe-calendar | | + gpe-clock | [] | + gpe-conf | | + gpe-contacts | | + gpe-edit | | + gpe-filemanager | | + gpe-go | | + gpe-login | | + gpe-ownerinfo | [] | + gpe-package | | + gpe-sketchbook | | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | [] [] | + gsasl | | + gss | | + gst-plugins-bad | [] | + gst-plugins-base | [] | + gst-plugins-good | [] | + gst-plugins-ugly | [] | + gstreamer | [] [] [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] [] | + gutenprint | | + hello | [] | + help2man | | + hylafax | | + idutils | | + indent | [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | | + iso_639 | [] [] [] [] [] | + iso_639_3 | [] | + jwhois | | + kbd | | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | | + ld | [] | + leafpad | [] [] | + libc | [] [] | + libexif | () | + libextractor | | + libgnutls | | + libgpewidget | | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | [] | + libidn | | + lifelines | | + liferea | [] [] | + lilypond | | + linkdr | [] | + lordsawar | | + lprng | | + lynx | [] | + m4 | | + mailfromd | | + mailutils | | + make | | + man-db | | + man-db-manpages | | + minicom | | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | | + psmisc | | + pspp | [] | + pwdutils | | + radius | [] | + recode | [] [] | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] | + sharutils | [] [] | + shishi | | + skencil | | + solfege | | + solfege-manual | | + soundtracker | | + sp | | + sysstat | | + tar | [] | + texinfo | | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] [] | + wyslij-po | | + xchat | [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +---------------------------------------------------+ + af am ar as ast az be be@latin bg bn_IN bs ca crh + 6 0 2 3 19 1 11 3 28 3 1 38 5 + cs da de el en en_GB en_ZA eo es et eu fa fi + +-------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] () | + anubis | [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] | + bibshelf | [] [] [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] | + bombono-dvd | [] [] | + buzztard | [] [] [] | + cflow | [] [] [] | + clisp | [] [] [] [] | + coreutils | [] [] [] [] | + cpio | [] | + cppi | [] | + cpplib | [] [] [] | + cryptsetup | [] | + dfarc | [] [] [] [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] | + dink | [] [] [] | + doodle | [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + exif | () [] [] [] | + fetchmail | [] [] () [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + freedink | [] [] [] [] | + gas | [] | + gawk | [] [] [] | + gcal | [] | + gcc | [] [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gip | [] [] [] [] [] | + gjay | [] [] | + gliv | [] [] [] [] | + glunarclock | [] [] [] | + gnubiff | () | + gnucash | [] () () () () () | + gnuedu | [] [] | + gnulib | [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] [] | + gpe-aerial | [] [] [] [] [] | + gpe-beam | [] [] [] [] [] | + gpe-bluetooth | [] [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] [] | + gpe-go | [] [] [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] [] [] [] | + gpe-sketchbook | [] [] [] [] [] | + gpe-su | [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] | + gpe-today | [] [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] [] () [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] [] | + grub | [] [] [] | + gsasl | [] [] | + gss | [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] | + gtick | [] () [] [] | + gtkam | [] [] () [] [] | + gtkorphan | [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] | + hello | [] [] [] [] [] | + help2man | [] [] | + hylafax | [] [] | + idutils | [] [] [] | + indent | [] [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] [] | + iso_3166 | [] [] [] () [] [] [] () [] | + iso_3166_2 | () | + iso_4217 | [] [] [] () [] [] [] | + iso_639 | [] [] [] () [] [] [] | + iso_639_3 | | + jwhois | [] [] | + kbd | [] [] [] [] [] | + keytouch | [] [] [] | + keytouch-editor | [] [] [] | + keytouch-keyboa... | [] [] | + klavaro | [] [] [] [] | + latrine | [] () [] | + ld | [] [] [] | + leafpad | [] [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] [] () | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] () | + libgphoto2_port | [] () [] | + libgsasl | [] | + libiconv | [] [] [] [] [] [] | + libidn | [] [] [] [] | + lifelines | [] () | + liferea | [] [] [] [] [] | + lilypond | [] [] [] [] | + linkdr | [] [] [] [] | + lordsawar | [] | + lprng | | + lynx | [] [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | | + mailutils | [] | + make | [] [] [] [] | + man-db | | + man-db-manpages | | + minicom | [] [] [] [] [] | + mkisofs | [] | + myserver | | + nano | [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] | + pies | | + popt | [] [] [] [] [] [] | + psmisc | [] [] [] [] | + pspp | [] | + pwdutils | [] | + radius | [] | + recode | [] [] [] [] [] [] [] | + rosegarden | () () () () | + rpm | [] [] [] | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] | + shishi | | + skencil | [] () [] | + solfege | [] [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] [] | + sp | [] | + sysstat | [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] | + tin | [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] [] | + vice | () () | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] [] | + wget | [] [] [] [] | + wyslij-po | [] | + xchat | [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + +-------------------------------------------------+ + cs da de el en en_GB en_ZA eo es et eu fa fi + 64 105 117 18 1 8 0 28 89 18 19 0 104 + + fr ga gl gu he hi hr hu hy id is it ja ka kn + +------------------------------------------------+ + a2ps | [] [] [] | + aegis | [] [] | + ant-phone | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] | + bash | [] [] [] | + bfd | [] [] | + bibshelf | [] [] [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] | *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 17 19:57:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB85C3339DF; Wed, 17 Jun 2020 19:57:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nG875bwbz4QBS; Wed, 17 Jun 2020 19:57:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FA07256B6; Wed, 17 Jun 2020 19:57:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HJvxQX032316; Wed, 17 Jun 2020 19:57:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HJvx1R032315; Wed, 17 Jun 2020 19:57:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202006171957.05HJvx1R032315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 17 Jun 2020 19:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362287 - vendor/flex/2.6.4 X-SVN-Group: vendor X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor/flex/2.6.4 X-SVN-Commit-Revision: 362287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 19:57:59 -0000 Author: jkim Date: Wed Jun 17 19:57:59 2020 New Revision: 362287 URL: https://svnweb.freebsd.org/changeset/base/362287 Log: Tag flex 2.6.4. Added: vendor/flex/2.6.4/ - copied from r362286, vendor/flex/dist/ From owner-svn-src-all@freebsd.org Wed Jun 17 20:58:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72C83335FFF; Wed, 17 Jun 2020 20:58:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nHV62RSRz4VWL; Wed, 17 Jun 2020 20:58:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A59E2639B; Wed, 17 Jun 2020 20:58:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HKwcJC068855; Wed, 17 Jun 2020 20:58:38 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HKwcm7068854; Wed, 17 Jun 2020 20:58:38 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202006172058.05HKwcm7068854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 17 Jun 2020 20:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362288 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 20:58:38 -0000 Author: bz Date: Wed Jun 17 20:58:37 2020 New Revision: 362288 URL: https://svnweb.freebsd.org/changeset/base/362288 Log: The call into ifa_ifwithaddr() needs to be epoch protected; ortherwise we'll panic on an assertion. While here, leave a comment that the ifp was never protected and stable (as glebius pointed out) and this needs to be fixed properly. Discovered while working on: PR 246629 Reviewed by: glebius MFC after: 4 days Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Wed Jun 17 19:57:59 2020 (r362287) +++ head/sys/netinet/ip_mroute.c Wed Jun 17 20:58:37 2020 (r362288) @@ -879,13 +879,19 @@ add_vif(struct vifctl *vifcp) */ ifp = NULL; } else { + struct epoch_tracker et; + sin.sin_addr = vifcp->vifc_lcl_addr; + NET_EPOCH_ENTER(et); ifa = ifa_ifwithaddr((struct sockaddr *)&sin); if (ifa == NULL) { + NET_EPOCH_EXIT(et); VIF_UNLOCK(); return EADDRNOTAVAIL; } ifp = ifa->ifa_ifp; + /* XXX FIXME we need to take a ref on ifp and cleanup properly! */ + NET_EPOCH_EXIT(et); } if ((vifcp->vifc_flags & VIFF_TUNNEL) != 0) { From owner-svn-src-all@freebsd.org Wed Jun 17 21:04:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51A9633679E; Wed, 17 Jun 2020 21:04:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nHd31SnYz4WKQ; Wed, 17 Jun 2020 21:04:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D80526517; Wed, 17 Jun 2020 21:04:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HL4d1x074974; Wed, 17 Jun 2020 21:04:39 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HL4dTv074973; Wed, 17 Jun 2020 21:04:39 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202006172104.05HL4dTv074973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 17 Jun 2020 21:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362289 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 21:04:39 -0000 Author: bz Date: Wed Jun 17 21:04:38 2020 New Revision: 362289 URL: https://svnweb.freebsd.org/changeset/base/362289 Log: When converting the static arrays to mallocarray() in r356621 I missed one place where we now need to multiply the size of the struct with the number of entries. This lead to problems when restarting user space daemons, as the cleanup was never properly done, resulting in MRT_ADD_VIF EADDRINUSE. Properly zero all array elements to avoid this problem. PR: 246629, 206583 Reported by: (many) MFC after: 4 days Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Wed Jun 17 20:58:37 2020 (r362288) +++ head/sys/netinet/ip_mroute.c Wed Jun 17 21:04:38 2020 (r362289) @@ -740,7 +740,7 @@ X_ip_mrouter_done(void) if_allmulti(ifp, 0); } } - bzero((caddr_t)V_viftable, sizeof(V_viftable)); + bzero((caddr_t)V_viftable, sizeof(V_viftable) * MAXVIFS); V_numvifs = 0; V_pim_assert_enabled = 0; From owner-svn-src-all@freebsd.org Wed Jun 17 21:21:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF907337309; Wed, 17 Jun 2020 21:21:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nJ115Cfzz4XhH; Wed, 17 Jun 2020 21:21:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE0C1266BA; Wed, 17 Jun 2020 21:21:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HLLvou087365; Wed, 17 Jun 2020 21:21:57 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HLLvtC087364; Wed, 17 Jun 2020 21:21:57 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006172121.05HLLvtC087364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 17 Jun 2020 21:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362290 - head/usr.bin/fstat X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/fstat X-SVN-Commit-Revision: 362290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 21:21:57 -0000 Author: 0mp (doc,ports committer) Date: Wed Jun 17 21:21:57 2020 New Revision: 362290 URL: https://svnweb.freebsd.org/changeset/base/362290 Log: Clean up fstat.1 - Sort options in the list & indent for readability. - Pet linters - Use "\(em" instead of "--" - Remove Tn macros - Use Ql instead of Dq Li - Add arguments to the -M, -N, -p, and -u options in their descriptions. - Use Sy instead of Li for field names. Li is deprecated, and Ql makes no sense here. - Replace a literal block with a list for the table of special names related to FD. - Use Ql instead of ``X''. - Add a dot after etc. - Reference fuser(1). MFC after: 1 week Modified: head/usr.bin/fstat/fstat.1 Modified: head/usr.bin/fstat/fstat.1 ============================================================================== --- head/usr.bin/fstat/fstat.1 Wed Jun 17 21:04:38 2020 (r362289) +++ head/usr.bin/fstat/fstat.1 Wed Jun 17 21:21:57 2020 (r362290) @@ -28,7 +28,7 @@ .\" @(#)fstat.1 8.3 (Berkeley) 2/25/94 .\" $FreeBSD$ .\" -.Dd October 19, 2019 +.Dd June 17, 2020 .Dt FSTAT 1 .Os .Sh NAME @@ -54,7 +54,7 @@ If no options are specified, reports on all open files in the system. .Pp The following options are available: -.Bl -tag -width indent +.Bl -tag -width "-N system" .It Fl f Restrict examination to files open in the same file systems as the named file arguments, or to the file system containing the @@ -63,17 +63,17 @@ For example, to find all files open in the file system directory .Pa /usr/src resides, type -.Dq Li fstat -f /usr/src . -.It Fl M +.Ql fstat -f /usr/src . +.It Fl M Ar core Extract values associated with the name list from the specified core instead of the default .Pa /dev/kmem . -.It Fl N -Extract the name list from the specified system instead of the default, -which is the kernel image the system has booted from. .It Fl m Include memory-mapped files in the listing; normally these are excluded due to the extra processing required. +.It Fl N Ar system +Extract the name list from the specified system instead of the default, +which is the kernel image the system has booted from. .It Fl n Numerical format. Print the device number (maj,min) of the file system @@ -83,11 +83,11 @@ device number that the special device refers to rather in .Pa /dev ; and print the mode of the file in octal instead of symbolic form. -.It Fl p +.It Fl p Ar pid Report all files open by the specified process. .It Fl s Print socket endpoint information. -.It Fl u +.It Fl u Ar user Report all files open by the specified user. .It Fl v Verbose mode. @@ -108,46 +108,52 @@ Restrict reports to the specified files. .Pp The following fields are printed: .Bl -tag -width MOUNT -.It Li USER +.It Sy USER The username of the owner of the process (effective uid). -.It Li CMD +.It Sy CMD The command name of the process. -.It Li PID +.It Sy PID The process id. -.It Li FD +.It Sy FD The file number in the per-process open file table or one of the following special names: .Pp -.Bd -literal -offset indent -compact -jail - jail root directory -mmap - memory-mapped file -root - root inode -text - executable text inode -tr - kernel trace file -wd - current working directory -.Ed +.Bl -tag -offset indent -compact +.It Sy jail +jail root directory +.It Sy mmap +memory-mapped file +.It Sy root +root inode +.It Sy text +executable text inode +.It Sy tr +kernel trace file +.It Sy wd +current working directory +.El .Pp -If the file number is followed by an asterisk (``*''), the file is -not an inode, but rather a socket, -.Tn FIFO , -or there is an error. +If the file number is followed by an asterisk +.Pq Ql * , +the file is +not an inode, but rather a socket, FIFO, or there is an error. In this case the remainder of the line does not -correspond to the remaining headers -- the format of the line +correspond to the remaining headers\(em the format of the line is described later under .Sx SOCKETS . -.It Li MOUNT +.It Sy MOUNT If the .Fl n flag was not specified, this header is present and is the pathname that the file system the file resides in is mounted on. -.It Li DEV +.It Sy DEV If the .Fl n flag is specified, this header is present and is the number of the device that this file resides in. -.It Li INUM +.It Sy INUM The inode number of the file. -.It Li MODE +.It Sy MODE The mode of the file. If the .Fl n @@ -156,7 +162,7 @@ using a symbolic format (see .Xr strmode 3 ) ; otherwise, the mode is printed as an octal number. -.It Li SZ\&|DV +.It Sy SZ\&|DV If the file is a semaphore, prints the current value of the semaphore. If the file is not a character or block special, prints the size of @@ -171,13 +177,17 @@ located, or the .Fl n flag is specified, prints the major/minor device number that the special device refers to. -.It Li R/W +.It Sy R/W This column describes the access mode that the file allows. -The letter ``r'' indicates open for reading; -the letter ``w'' indicates open for writing. +The letter +.Ql r +indicates open for reading; +the letter +.Ql w +indicates open for writing. This field is useful when trying to find the processes that are preventing a file system from being down graded to read-only. -.It Li NAME +.It Sy NAME If filename arguments are specified and the .Fl f flag is not, then @@ -194,32 +204,39 @@ name that the process originally used to open that fil .Sh SOCKETS The formatting of open sockets depends on the protocol domain. In all cases the first field is the domain name, the second field -is the socket type (stream, dgram, etc), and the third is the socket +is the socket type (stream, dgram, etc.), and the third is the socket flags field (in hex). The remaining fields are protocol dependent. -For tcp, it is the address of the tcpcb, and for udp, the inpcb (socket pcb). -For unix domain sockets, its the address of the socket pcb and the address +For TCP, it is the address of the tcpcb, and for UDP, the inpcb (socket pcb). +For UNIX-domain sockets, its the address of the socket pcb and the address of the connected pcb (if connected). Otherwise the protocol number and address of the socket itself are printed. .Pp For example, the addresses mentioned above are the addresses which the -.Dq Li netstat -A -command would print for tcp, udp, and unixdomain. +.Ql netstat -A +command would print for TCP, UDP, and UNIX-domain. Note that since pipes are implemented using sockets, a pipe appears as a -connected unix domain stream socket. -A unidirectional unix domain socket indicates the direction of flow with -an arrow (``<-'' or ``->''), and a full duplex socket shows a double arrow -(``<->''). +connected UNIX-domain stream socket. +A unidirectional UNIX-domain socket indicates the direction of flow with +an arrow +.Po Ql <- +or +.Ql -> +.Pc , +and a full duplex socket shows a double arrow +.Pq Ql <-> . .Pp When the .Fl s flag is used, socket endpoint information is shown after the address of the socket. For internet sockets the local and remote addresses are shown, separated with -a double arrow (``<->''). -For unix/local sockets either the local or remote address is shown, depending +a double arrow +.Pq Ql <-> . +For UNIX/local sockets either the local or remote address is shown, depending on which one is available. .Sh SEE ALSO +.Xr fuser 1 , .Xr netstat 1 , .Xr nfsstat 1 , .Xr procstat 1 , From owner-svn-src-all@freebsd.org Wed Jun 17 21:51:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4C7033823B; Wed, 17 Jun 2020 21:51:32 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nJg85Nm3z4b8w; Wed, 17 Jun 2020 21:51:32 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B45A326AB9; Wed, 17 Jun 2020 21:51:32 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HLpWTZ002722; Wed, 17 Jun 2020 21:51:32 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HLpWwq002721; Wed, 17 Jun 2020 21:51:32 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006172151.05HLpWwq002721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 17 Jun 2020 21:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362291 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 362291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 21:51:32 -0000 Author: 0mp (doc,ports committer) Date: Wed Jun 17 21:51:32 2020 New Revision: 362291 URL: https://svnweb.freebsd.org/changeset/base/362291 Log: MFC 361920: Document that /lib is always in the list of shared library paths /lib was added to the list in r119011. Modified: stable/12/share/man/man5/rc.conf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man5/rc.conf.5 ============================================================================== --- stable/12/share/man/man5/rc.conf.5 Wed Jun 17 21:21:57 2020 (r362290) +++ stable/12/share/man/man5/rc.conf.5 Wed Jun 17 21:51:32 2020 (r362291) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2020 +.Dd June 8, 2020 .Dt RC.CONF 5 .Os .Sh NAME @@ -3637,8 +3637,10 @@ related programs. Set to the list of shared library paths to use with .Xr ldconfig 8 . NOTE: +.Pa /lib +and .Pa /usr/lib -will always be added first, so it need not appear in this list. +will always be added first, so they need not appear in this list. .It Va ldconfig32_paths .Pq Vt str Set to the list of 32-bit compatibility shared library paths to From owner-svn-src-all@freebsd.org Wed Jun 17 23:39:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CE43339D73; Wed, 17 Jun 2020 23:39:54 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nM4B1Dfgz3SXT; Wed, 17 Jun 2020 23:39:54 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07F3A27EA1; Wed, 17 Jun 2020 23:39:54 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HNdrei066850; Wed, 17 Jun 2020 23:39:53 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HNdr0C066846; Wed, 17 Jun 2020 23:39:53 GMT (envelope-from chs@FreeBSD.org) Message-Id: <202006172339.05HNdr0C066846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Wed, 17 Jun 2020 23:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362292 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 362292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 23:39:54 -0000 Author: chs Date: Wed Jun 17 23:39:52 2020 New Revision: 362292 URL: https://svnweb.freebsd.org/changeset/base/362292 Log: Move all of the functions in ffs_subr.c that are only used by the ufs kernel module from that file into ffs_vfsops.c. This fixes the build for kernel configs that don't include FFS. PR: 247256 Submitted by: glebius Reviewed by: mckusick (earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25285 Modified: head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Wed Jun 17 21:51:32 2020 (r362291) +++ head/sys/ufs/ffs/ffs_extern.h Wed Jun 17 23:39:52 2020 (r362292) @@ -61,7 +61,6 @@ int ffs_balloc_ufs1(struct vnode *a_vp, off_t a_starto struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_startoffset, int a_size, struct ucred *a_cred, int a_flags, struct buf **a_bpp); -int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *, u_long); ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); @@ -69,7 +68,6 @@ ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_ void ffs_blkrelease_finish(struct ufsmount *, u_long); u_long ffs_blkrelease_start(struct ufsmount *, struct vnode *, ino_t); uint32_t ffs_calc_sbhash(struct fs *); -int ffs_check_blkno(struct mount *, ino_t, ufs2_daddr_t, int); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); void ffs_clrblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_clusteracct(struct fs *, struct cg *, ufs1_daddr_t, int); @@ -84,7 +82,6 @@ int ffs_getcg(struct fs *, struct vnode *, u_int, int, struct cg **); int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); -int ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Wed Jun 17 21:51:32 2020 (r362291) +++ head/sys/ufs/ffs/ffs_subr.c Wed Jun 17 23:39:52 2020 (r362292) @@ -67,7 +67,6 @@ struct malloc_type; #include #include #include -#include #include #include @@ -81,216 +80,6 @@ struct malloc_type; #define UFS_FREE(ptr, type) free(ptr, type) #define UFS_TIME time_second -/* - * Return buffer with the contents of block "offset" from the beginning of - * directory "ip". If "res" is non-zero, fill it in with a pointer to the - * remaining space in the directory. - */ -int -ffs_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp) -{ - struct inode *ip; - struct fs *fs; - struct buf *bp; - ufs_lbn_t lbn; - int bsize, error; - - ip = VTOI(vp); - fs = ITOFS(ip); - lbn = lblkno(fs, offset); - bsize = blksize(fs, ip, lbn); - - *bpp = NULL; - error = bread(vp, lbn, bsize, NOCRED, &bp); - if (error) { - return (error); - } - if (res) - *res = (char *)bp->b_data + blkoff(fs, offset); - *bpp = bp; - return (0); -} - -/* - * Load up the contents of an inode and copy the appropriate pieces - * to the incore copy. - */ -int -ffs_load_inode(struct buf *bp, struct inode *ip, struct fs *fs, ino_t ino) -{ - struct ufs1_dinode *dip1; - struct ufs2_dinode *dip2; - int error; - - if (I_IS_UFS1(ip)) { - dip1 = ip->i_din1; - *dip1 = - *((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); - ip->i_mode = dip1->di_mode; - ip->i_nlink = dip1->di_nlink; - ip->i_effnlink = dip1->di_nlink; - ip->i_size = dip1->di_size; - ip->i_flags = dip1->di_flags; - ip->i_gen = dip1->di_gen; - ip->i_uid = dip1->di_uid; - ip->i_gid = dip1->di_gid; - return (0); - } - dip2 = ((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); - if ((error = ffs_verify_dinode_ckhash(fs, dip2)) != 0 && - !ffs_fsfail_cleanup(ITOUMP(ip), error)) { - printf("%s: inode %jd: check-hash failed\n", fs->fs_fsmnt, - (intmax_t)ino); - return (error); - } - *ip->i_din2 = *dip2; - dip2 = ip->i_din2; - ip->i_mode = dip2->di_mode; - ip->i_nlink = dip2->di_nlink; - ip->i_effnlink = dip2->di_nlink; - ip->i_size = dip2->di_size; - ip->i_flags = dip2->di_flags; - ip->i_gen = dip2->di_gen; - ip->i_uid = dip2->di_uid; - ip->i_gid = dip2->di_gid; - return (0); -} - -/* - * Verify that a filesystem block number is a valid data block. - * This routine is only called on untrusted filesystems. - */ -int -ffs_check_blkno(struct mount *mp, ino_t inum, ufs2_daddr_t daddr, int blksize) -{ - struct fs *fs; - struct ufsmount *ump; - ufs2_daddr_t end_daddr; - int cg, havemtx; - - KASSERT((mp->mnt_flag & MNT_UNTRUSTED) != 0, - ("ffs_check_blkno called on a trusted file system")); - ump = VFSTOUFS(mp); - fs = ump->um_fs; - cg = dtog(fs, daddr); - end_daddr = daddr + numfrags(fs, blksize); - /* - * Verify that the block number is a valid data block. Also check - * that it does not point to an inode block or a superblock. Accept - * blocks that are unalloacted (0) or part of snapshot metadata - * (BLK_NOCOPY or BLK_SNAP). - * - * Thus, the block must be in a valid range for the filesystem and - * either in the space before a backup superblock (except the first - * cylinder group where that space is used by the bootstrap code) or - * after the inode blocks and before the end of the cylinder group. - */ - if ((uint64_t)daddr <= BLK_SNAP || - ((uint64_t)end_daddr <= fs->fs_size && - ((cg > 0 && end_daddr <= cgsblock(fs, cg)) || - (daddr >= cgdmin(fs, cg) && - end_daddr <= cgbase(fs, cg) + fs->fs_fpg)))) - return (0); - if ((havemtx = mtx_owned(UFS_MTX(ump))) == 0) - UFS_LOCK(ump); - if (ppsratecheck(&ump->um_last_integritymsg, - &ump->um_secs_integritymsg, 1)) { - UFS_UNLOCK(ump); - uprintf("\n%s: inode %jd, out-of-range indirect block " - "number %jd\n", mp->mnt_stat.f_mntonname, inum, daddr); - if (havemtx) - UFS_LOCK(ump); - } else if (!havemtx) - UFS_UNLOCK(ump); - return (EINTEGRITY); -} - -/* - * Initiate a forcible unmount. - * Used to unmount filesystems whose underlying media has gone away. - */ -static void -ffs_fsfail_unmount(void *v, int pending) -{ - struct fsfail_task *etp; - struct mount *mp; - - etp = v; - - /* - * Find our mount and get a ref on it, then try to unmount. - */ - mp = vfs_getvfs(&etp->fsid); - if (mp != NULL) - dounmount(mp, MNT_FORCE, curthread); - free(etp, M_UFSMNT); -} - -/* - * On first ENXIO error, start a task that forcibly unmounts the filesystem. - * - * Return true if a cleanup is in progress. - */ -int -ffs_fsfail_cleanup(struct ufsmount *ump, int error) -{ - int retval; - - UFS_LOCK(ump); - retval = ffs_fsfail_cleanup_locked(ump, error); - UFS_UNLOCK(ump); - return (retval); -} - -int -ffs_fsfail_cleanup_locked(struct ufsmount *ump, int error) -{ - struct fsfail_task *etp; - struct task *tp; - - mtx_assert(UFS_MTX(ump), MA_OWNED); - if (error == ENXIO && (ump->um_flags & UM_FSFAIL_CLEANUP) == 0) { - ump->um_flags |= UM_FSFAIL_CLEANUP; - /* - * Queue an async forced unmount. - */ - etp = ump->um_fsfail_task; - ump->um_fsfail_task = NULL; - if (etp != NULL) { - tp = &etp->task; - TASK_INIT(tp, 0, ffs_fsfail_unmount, etp); - taskqueue_enqueue(taskqueue_thread, tp); - printf("UFS: forcibly unmounting %s from %s\n", - ump->um_mountp->mnt_stat.f_mntfromname, - ump->um_mountp->mnt_stat.f_mntonname); - } - } - return ((ump->um_flags & UM_FSFAIL_CLEANUP) != 0); -} - -/* - * Wrapper used during ENXIO cleanup to allocate empty buffers when - * the kernel is unable to read the real one. They are needed so that - * the soft updates code can use them to unwind its dependencies. - */ -int -ffs_breadz(struct ufsmount *ump, struct vnode *vp, daddr_t lblkno, - daddr_t dblkno, int size, daddr_t *rablkno, int *rabsize, int cnt, - struct ucred *cred, int flags, void (*ckhashfunc)(struct buf *), - struct buf **bpp) -{ - int error; - - flags |= GB_CVTENXIO; - error = breadn_flags(vp, lblkno, dblkno, size, rablkno, rabsize, cnt, - cred, flags, ckhashfunc, bpp); - if (error != 0 && ffs_fsfail_cleanup(ump, error)) { - error = getblkx(vp, lblkno, dblkno, size, 0, 0, flags, bpp); - KASSERT(error == 0, ("getblkx failed")); - vfs_bio_bzero_buf(*bpp, 0, size); - } - return (error); -} #endif /* _KERNEL */ /* Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Jun 17 21:51:32 2020 (r362291) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Jun 17 23:39:52 2020 (r362292) @@ -155,6 +155,217 @@ SYSCTL_INT(_vfs_ffs, OID_AUTO, enxio_enable, CTLFLAG_R &ffs_enxio_enable, 0, "enable mapping of other disk I/O errors to ENXIO"); +/* + * Return buffer with the contents of block "offset" from the beginning of + * directory "ip". If "res" is non-zero, fill it in with a pointer to the + * remaining space in the directory. + */ +static int +ffs_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp) +{ + struct inode *ip; + struct fs *fs; + struct buf *bp; + ufs_lbn_t lbn; + int bsize, error; + + ip = VTOI(vp); + fs = ITOFS(ip); + lbn = lblkno(fs, offset); + bsize = blksize(fs, ip, lbn); + + *bpp = NULL; + error = bread(vp, lbn, bsize, NOCRED, &bp); + if (error) { + return (error); + } + if (res) + *res = (char *)bp->b_data + blkoff(fs, offset); + *bpp = bp; + return (0); +} + +/* + * Load up the contents of an inode and copy the appropriate pieces + * to the incore copy. + */ +static int +ffs_load_inode(struct buf *bp, struct inode *ip, struct fs *fs, ino_t ino) +{ + struct ufs1_dinode *dip1; + struct ufs2_dinode *dip2; + int error; + + if (I_IS_UFS1(ip)) { + dip1 = ip->i_din1; + *dip1 = + *((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); + ip->i_mode = dip1->di_mode; + ip->i_nlink = dip1->di_nlink; + ip->i_effnlink = dip1->di_nlink; + ip->i_size = dip1->di_size; + ip->i_flags = dip1->di_flags; + ip->i_gen = dip1->di_gen; + ip->i_uid = dip1->di_uid; + ip->i_gid = dip1->di_gid; + return (0); + } + dip2 = ((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); + if ((error = ffs_verify_dinode_ckhash(fs, dip2)) != 0 && + !ffs_fsfail_cleanup(ITOUMP(ip), error)) { + printf("%s: inode %jd: check-hash failed\n", fs->fs_fsmnt, + (intmax_t)ino); + return (error); + } + *ip->i_din2 = *dip2; + dip2 = ip->i_din2; + ip->i_mode = dip2->di_mode; + ip->i_nlink = dip2->di_nlink; + ip->i_effnlink = dip2->di_nlink; + ip->i_size = dip2->di_size; + ip->i_flags = dip2->di_flags; + ip->i_gen = dip2->di_gen; + ip->i_uid = dip2->di_uid; + ip->i_gid = dip2->di_gid; + return (0); +} + +/* + * Verify that a filesystem block number is a valid data block. + * This routine is only called on untrusted filesystems. + */ +static int +ffs_check_blkno(struct mount *mp, ino_t inum, ufs2_daddr_t daddr, int blksize) +{ + struct fs *fs; + struct ufsmount *ump; + ufs2_daddr_t end_daddr; + int cg, havemtx; + + KASSERT((mp->mnt_flag & MNT_UNTRUSTED) != 0, + ("ffs_check_blkno called on a trusted file system")); + ump = VFSTOUFS(mp); + fs = ump->um_fs; + cg = dtog(fs, daddr); + end_daddr = daddr + numfrags(fs, blksize); + /* + * Verify that the block number is a valid data block. Also check + * that it does not point to an inode block or a superblock. Accept + * blocks that are unalloacted (0) or part of snapshot metadata + * (BLK_NOCOPY or BLK_SNAP). + * + * Thus, the block must be in a valid range for the filesystem and + * either in the space before a backup superblock (except the first + * cylinder group where that space is used by the bootstrap code) or + * after the inode blocks and before the end of the cylinder group. + */ + if ((uint64_t)daddr <= BLK_SNAP || + ((uint64_t)end_daddr <= fs->fs_size && + ((cg > 0 && end_daddr <= cgsblock(fs, cg)) || + (daddr >= cgdmin(fs, cg) && + end_daddr <= cgbase(fs, cg) + fs->fs_fpg)))) + return (0); + if ((havemtx = mtx_owned(UFS_MTX(ump))) == 0) + UFS_LOCK(ump); + if (ppsratecheck(&ump->um_last_integritymsg, + &ump->um_secs_integritymsg, 1)) { + UFS_UNLOCK(ump); + uprintf("\n%s: inode %jd, out-of-range indirect block " + "number %jd\n", mp->mnt_stat.f_mntonname, inum, daddr); + if (havemtx) + UFS_LOCK(ump); + } else if (!havemtx) + UFS_UNLOCK(ump); + return (EINTEGRITY); +} + +/* + * Initiate a forcible unmount. + * Used to unmount filesystems whose underlying media has gone away. + */ +static void +ffs_fsfail_unmount(void *v, int pending) +{ + struct fsfail_task *etp; + struct mount *mp; + + etp = v; + + /* + * Find our mount and get a ref on it, then try to unmount. + */ + mp = vfs_getvfs(&etp->fsid); + if (mp != NULL) + dounmount(mp, MNT_FORCE, curthread); + free(etp, M_UFSMNT); +} + +/* + * On first ENXIO error, start a task that forcibly unmounts the filesystem. + * + * Return true if a cleanup is in progress. + */ +int +ffs_fsfail_cleanup(struct ufsmount *ump, int error) +{ + int retval; + + UFS_LOCK(ump); + retval = ffs_fsfail_cleanup_locked(ump, error); + UFS_UNLOCK(ump); + return (retval); +} + +int +ffs_fsfail_cleanup_locked(struct ufsmount *ump, int error) +{ + struct fsfail_task *etp; + struct task *tp; + + mtx_assert(UFS_MTX(ump), MA_OWNED); + if (error == ENXIO && (ump->um_flags & UM_FSFAIL_CLEANUP) == 0) { + ump->um_flags |= UM_FSFAIL_CLEANUP; + /* + * Queue an async forced unmount. + */ + etp = ump->um_fsfail_task; + ump->um_fsfail_task = NULL; + if (etp != NULL) { + tp = &etp->task; + TASK_INIT(tp, 0, ffs_fsfail_unmount, etp); + taskqueue_enqueue(taskqueue_thread, tp); + printf("UFS: forcibly unmounting %s from %s\n", + ump->um_mountp->mnt_stat.f_mntfromname, + ump->um_mountp->mnt_stat.f_mntonname); + } + } + return ((ump->um_flags & UM_FSFAIL_CLEANUP) != 0); +} + +/* + * Wrapper used during ENXIO cleanup to allocate empty buffers when + * the kernel is unable to read the real one. They are needed so that + * the soft updates code can use them to unwind its dependencies. + */ +int +ffs_breadz(struct ufsmount *ump, struct vnode *vp, daddr_t lblkno, + daddr_t dblkno, int size, daddr_t *rablkno, int *rabsize, int cnt, + struct ucred *cred, int flags, void (*ckhashfunc)(struct buf *), + struct buf **bpp) +{ + int error; + + flags |= GB_CVTENXIO; + error = breadn_flags(vp, lblkno, dblkno, size, rablkno, rabsize, cnt, + cred, flags, ckhashfunc, bpp); + if (error != 0 && ffs_fsfail_cleanup(ump, error)) { + error = getblkx(vp, lblkno, dblkno, size, 0, 0, flags, bpp); + KASSERT(error == 0, ("getblkx failed")); + vfs_bio_bzero_buf(*bpp, 0, size); + } + return (error); +} + static int ffs_mount(struct mount *mp) { Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Jun 17 21:51:32 2020 (r362291) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Jun 17 23:39:52 2020 (r362292) @@ -2184,7 +2184,7 @@ ufs_readdir(ap) error = 0; while (error == 0 && uio->uio_resid > 0 && uio->uio_offset < ip->i_size) { - error = ffs_blkatoff(vp, uio->uio_offset, NULL, &bp); + error = UFS_BLKATOFF(vp, uio->uio_offset, NULL, &bp); if (error) break; if (bp->b_offset + bp->b_bcount > ip->i_size) From owner-svn-src-all@freebsd.org Wed Jun 17 23:41:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B80A833A43C; Wed, 17 Jun 2020 23:41:04 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nM5X3mfSz3SfZ; Wed, 17 Jun 2020 23:41:04 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CBC427EA7; Wed, 17 Jun 2020 23:41:04 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HNf4jR068693; Wed, 17 Jun 2020 23:41:04 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HNf45E068692; Wed, 17 Jun 2020 23:41:04 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006172341.05HNf45E068692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 17 Jun 2020 23:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362293 - stable/11/share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/share/man/man5 X-SVN-Commit-Revision: 362293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 23:41:04 -0000 Author: 0mp (doc,ports committer) Date: Wed Jun 17 23:41:04 2020 New Revision: 362293 URL: https://svnweb.freebsd.org/changeset/base/362293 Log: MFC 361920: Document that /lib is always in the list of shared library paths /lib was added to the list in r119011. Modified: stable/11/share/man/man5/rc.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man5/rc.conf.5 ============================================================================== --- stable/11/share/man/man5/rc.conf.5 Wed Jun 17 23:39:52 2020 (r362292) +++ stable/11/share/man/man5/rc.conf.5 Wed Jun 17 23:41:04 2020 (r362293) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2020 +.Dd June 8, 2020 .Dt RC.CONF 5 .Os .Sh NAME @@ -3787,8 +3787,10 @@ related programs. Set to the list of shared library paths to use with .Xr ldconfig 8 . NOTE: +.Pa /lib +and .Pa /usr/lib -will always be added first, so it need not appear in this list. +will always be added first, so they need not appear in this list. .It Va ldconfig32_paths .Pq Vt str Set to the list of 32-bit compatibility shared library paths to From owner-svn-src-all@freebsd.org Thu Jun 18 00:44:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D810F33BE47; Thu, 18 Jun 2020 00:44:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nNVM6CZfz3W36; Thu, 18 Jun 2020 00:44:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f54.google.com with SMTP id n5so3215885otj.1; Wed, 17 Jun 2020 17:44:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=wwFs//PNYHIXgdtARsgzZxkmklJbP77AECsO2XD2fxo=; b=klLX+uHDgAtu2/iepk/XxJoYhp7TJnN0NaLjgDp5org6owPnYZfJNgSglMs8Gcw4rA V+97NA7r9QtH4BzONvkLZmg5cfLL/lOzcm2D5+wqi3mVkRYvYiozQ2S20MAQL0W7o7rU xzPb6a/hn2xZ97/DthO+jgA3Akij8+1JCwsNtL06DR/0VAEF6salOPZ2kXE1BEMypoLF MTUJZXQa2EZCtiyAntFcuSE0wT8NH+aWGkcFdSyg9DRSLry0tR/adnWbcPV5nSGk2TE4 YwM+cwETv1ZIKuwbnqd5VVX8bbhArbwxzhi6OdQyLHNp/FL5UJ+PxXCmB6zjSHNIfXfA RqLA== X-Gm-Message-State: AOAM531yFEYPNFSd2l3h6QnNRxq1elMPVloBUMQPflvG1euk9emsCkMc RrRi6qDCALzc1fEUQgJHEKgOMa4J X-Google-Smtp-Source: ABdhPJyBbnhE0pBX6OaLJqR3K6oJl7kL1/SjrYUd4XbGdNyBPDm94iapAqmPmHwsY2X1S7jGg18/eg== X-Received: by 2002:a05:6830:1391:: with SMTP id d17mr1554717otq.48.1592441049832; Wed, 17 Jun 2020 17:44:09 -0700 (PDT) Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com. [209.85.161.45]) by smtp.gmail.com with ESMTPSA id i2sm371040otp.77.2020.06.17.17.44.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 17:44:09 -0700 (PDT) Received: by mail-oo1-f45.google.com with SMTP id e12so822571oou.2; Wed, 17 Jun 2020 17:44:09 -0700 (PDT) X-Received: by 2002:a4a:d1ca:: with SMTP id a10mr1917238oos.31.1592441049466; Wed, 17 Jun 2020 17:44:09 -0700 (PDT) MIME-Version: 1.0 References: <202006162253.05GMruKi046200@repo.freebsd.org> <20200617110419.GF45690@kib.kiev.ua> In-Reply-To: <20200617110419.GF45690@kib.kiev.ua> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 17 Jun 2020 17:43:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r362253 - head/sys/vm To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49nNVM6CZfz3W36 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.210.54 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-1.67 / 15.00]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.54:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.07)[-0.066]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.63)[-0.630]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.97)[-0.969]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.54:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 00:44:12 -0000 On Wed, Jun 17, 2020 at 4:04 AM Konstantin Belousov w= rote: > > On Tue, Jun 16, 2020 at 10:53:56PM +0000, Conrad Meyer wrote: > > Author: cem > > Date: Tue Jun 16 22:53:56 2020 > > New Revision: 362253 > > URL: https://svnweb.freebsd.org/changeset/base/362253 > > > > Log: > > vm: Drop vm_map_clip_{start,end} macro wrappers > > > > No functional change. > > > > Reviewed by: dougm, markj > > Sponsored by: Dell EMC Isilon > > Differential Revision: https://reviews.freebsd.org/D25282 > > I would highly appreciate if you revert this commit. > It conflicts with https://reviews.freebsd.org/D24652, which must revert y= our > change to remain functional. > I probably should not allowed that review to rott silently. Initially, I took a similar approach =E2=80=94 converting the macros to inl= ine functions. It was suggested in the review to just merge them, as they were both relatively small. I have a follow-up patch which will add a small amount of code to the former macros. (D25283) I don't think there is any functional reason your patch cannot be rebased over this change. You could choose to merge _vm_map_clip_start and vm_map_clip_start (and same for end) in your patch; nothing invokes the underscore variants except the wrappers. You could also choose to re-split the routines, although I'm not sure why. Either option seems acceptable to me. Best, Conrad From owner-svn-src-all@freebsd.org Thu Jun 18 00:48:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A089333C540; Thu, 18 Jun 2020 00:48:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nNbF2M65z3WvB; Thu, 18 Jun 2020 00:48:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f194.google.com with SMTP id b8so3555764oic.1; Wed, 17 Jun 2020 17:48:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=0km25gL505Ui7+zDolzn2LXI1AJSiJQaZsTA3Y0do/A=; b=aQWIq2YhSdM/tc0BZAD/kVY7AtrwYMNNWnvpJzuhwNhGFUK/xFD7AE4RQqGjU8Yp7v 6Yzb2/2rHF94s6jaKqJYDZaskCAOqcXh47fqZcDh9q9j7I5gR/DUFTskfMTYEywCkL6j SAyWcHO8E3Yy5J0jhad86xrs3JPwAp3FvLLAQbRz6DB20G5bH0dYTSSSfiIMi2+8vM9t l/EDhbHW5fliwuMsTumPVH2ZnyE6H0I/jnnu8qkFIIedGyCQ6aPksjdxfSlHOw8uVIn3 Ob98V5FB5drGrmmP09X5r4h7OpqeiJp1MGkntYh/hOmyrlO3i5RaSPshqZDcGd9yFp1Y upog== X-Gm-Message-State: AOAM531hP1Yv8Mcfk9UOdi22xjpb/+TKUgLnXFXORmd5+n7zTKEwMdRI 2boBtB1fhnm8ZjKs/6d8SaHegrxL X-Google-Smtp-Source: ABdhPJydYELtMJhS8AFFD0HZArK9n7F2W6Al25bW1lMbjP/qswReTe/3MDBwIU0TJtH8ti7HlSgvzw== X-Received: by 2002:aca:4ec3:: with SMTP id c186mr1066215oib.64.1592441304027; Wed, 17 Jun 2020 17:48:24 -0700 (PDT) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com. [209.85.210.45]) by smtp.gmail.com with ESMTPSA id j46sm372827ota.69.2020.06.17.17.48.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 17:48:23 -0700 (PDT) Received: by mail-ot1-f45.google.com with SMTP id k15so3195998otp.8; Wed, 17 Jun 2020 17:48:23 -0700 (PDT) X-Received: by 2002:a05:6830:18da:: with SMTP id v26mr1443358ote.135.1592441303644; Wed, 17 Jun 2020 17:48:23 -0700 (PDT) MIME-Version: 1.0 References: <202006122153.05CLr8JN091722@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 17 Jun 2020 17:48:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r362126 - head/sys/vm To: John Baldwin Cc: Eric van Gyzen , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49nNbF2M65z3WvB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 00:48:25 -0000 On Wed, Jun 17, 2020 at 10:50 AM John Baldwin wrote: > > On 6/12/20 3:33 PM, Conrad Meyer wrote: > > On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen wrote: > >> Honor db_pager_quit in some vm_object ddb commands > >> > >> These can be rather verbose. > > > > We also have this (?)hack in OneFS, which eliminates the need for > > every debug function to check the db_pager globals: > > > > https://people.freebsd.org/~cem/db_pager.patch > > > > I'm not sure how objectionable it is. > > I don't think this addresses that. I think this patch makes printf turn > into db_printf when a function is invoked from DDB which is orthogonal. > db_printf() itself doesn't check the pager. db_printf checks the pager, via db_putc. From owner-svn-src-all@freebsd.org Thu Jun 18 02:27:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9272C340214 for ; Thu, 18 Jun 2020 02:27:29 +0000 (UTC) (envelope-from bounces+16223586-551e-svn-src-all=freebsd.org@sendgrid.net) Received: from xtrwkkxd.outbound-mail.sendgrid.net (xtrwkkxd.outbound-mail.sendgrid.net [167.89.17.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49nQnX3FMwz3g8L for ; Thu, 18 Jun 2020 02:27:28 +0000 (UTC) (envelope-from bounces+16223586-551e-svn-src-all=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sendgrid.net; h=mime-version:from:reply-to:subject:to:content-type; s=smtpapi; bh=Tu5RAaBmdx8Ti3+Y+h7C9qojipNgdCM+Ova3nUPaSVI=; b=G6VPWMFpUccSBqhE+DhP4q2OP8Le5yudnRRVL6mVXEqLPE+8/0VmCWQxGqIwILbx4+Mi rz9cWiETjRkRLWGsKS68QvmFBxA+28VjdnuaT9GTdA+4JtK94kfhQ73q7NjhzFQ/oYzVir cUUKqdvUBkwT3RGR4ljSV/IiiHY+GpeL0= Received: by filter0076p3las1.sendgrid.net with SMTP id filter0076p3las1-15002-5EEACC9A-13 2020-06-18 02:08:26.184652222 +0000 UTC m=+91953.225763871 Received: from [169.254.57.70] (unknown) by ismtpd0091p1iad2.sendgrid.net (SG) with ESMTP id TiOKPH0KTfG47BNq6IVOvg for ; Thu, 18 Jun 2020 02:08:24.638 +0000 (UTC) Message-Id: <7SKFPD0U-UNJQ-R3QP-JRI0-1B3S4WECTMJT@marketplace.softtechhub.club> Mime-Version: 1.0 From: GOOD GOOGLE Reply-To: silio@dandies.rf.gd Precedence: Bulk Subject: GET SALES, LEADS ON.. AUTOMATION USING CHATTERPAL Date: Thu, 18 Jun 2020 02:08:26 +0000 (UTC) X-SG-EID: =?us-ascii?Q?2Lbm+mRqVo8FZgjiqKmBPl3h0T9jIvEnYUABIdQ=2FPOzQc2LPdGg+fmNhih1PDb?= =?us-ascii?Q?p6tuD9mvs4MLgELMIaJGp48vDnFYXffJD80EHM0?= =?us-ascii?Q?LXPX0gNwTocqy5TTTb8ntvHV3rrKxKqZaePJj0X?= =?us-ascii?Q?DioVrE2VbigRHQlEmw1B5+0T3Bm=2Fd2WUc9AW94y?= =?us-ascii?Q?LXQyBXt1xv9mbphTBlhQ7t5QyNDlgcuYvGKc1qx?= =?us-ascii?Q?AaMydl3PL0O5J8efzys=2FGxWY4zOiNI1y2bGqyEq?= =?us-ascii?Q?eRE+tioj1Wi0qLMK14ERQ=3D=3D?= To: svn-src-all@freebsd.org X-Rspamd-Queue-Id: 49nQnX3FMwz3g8L X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sendgrid.net header.s=smtpapi header.b=G6VPWMFp; dmarc=none; spf=pass (mx1.freebsd.org: domain of bounces@sendgrid.net designates 167.89.17.173 as permitted sender) smtp.mailfrom=bounces@sendgrid.net X-Spamd-Result: default: False [1.27 / 15.00]; HAS_REPLYTO(0.00)[silio@dandies.rf.gd]; R_SPF_ALLOW(-0.20)[+ip4:167.89.0.0/17:c]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[sendgrid.net:+]; NEURAL_HAM_SHORT(-0.32)[-0.325]; SUBJ_ALL_CAPS(3.00)[49]; FORGED_SENDER(0.30)[egoogle@marketplace.softtechhub.club,bounces@sendgrid.net]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11377, ipnet:167.89.0.0/18, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[16223586-551e-svn-src-all=freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.75)[-0.753]; R_DKIM_ALLOW(-0.20)[sendgrid.net:s=smtpapi]; FROM_NEQ_ENVFROM(0.00)[egoogle@marketplace.softtechhub.club,bounces@sendgrid.net]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PRECEDENCE_BULK(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.95)[-0.948]; DMARC_NA(0.00)[softtechhub.club]; RCVD_IN_DNSWL_NONE(0.00)[167.89.17.173:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[167.89.17.173:from]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 02:27:29 -0000 Hey Friend, I introduce to you CHATTERPAL today. Read below To find out more about this powerful sales and leads converting Software. Also see details via https://webcash.softtechhub.club/go/chatterp= al-commercial/ With ChatterPal you Rapidly Grow & Scale Your Business Using Next-Generatio= n Smart Chat Automation & Life-Like 3D-Animation! Convert Ordinary Websites, Blogs & Funnels into SMART Sales Machines. Engage And Captivate Attention With Interactive 3D Avatars & Award Winning = Text-to-Speech. Automate Leads and Sales Without Optin Forms or Landing Pages. Create Unlimited ChatterPals For Yourself or Sell To Clients Using Commerci= al License! ChatterPal GET CHATTERPAL NOW VIA https://webcash.softtechhub.club/go/chatterpal-comme= rcial/ EVERYTHING YOU NEED TO CONVERT PROSPECTS INTO SALES INSIDE ONE EASY TO USE PLATFORM! GET MORE LEADS/CONVERSIONS Without Websites, landing Pages, Funnels or Optin Forms. Overlay ChatterPals On Other Sites! MAXIMIZE REACH AND ENGAGEMENT Create UNLIMITED ChatterPals in ANY language with One-Click Translation! TURN TRAFFIC INTO SALES Use Use Interactive 3D Avatars & Smart Chat To Close Sales/leads, Handle Objections, Take Orders, Book Appointments And Handle Support Duties - Automatically! SAVE TIME & MONEY Replace Staff or Virtual Workers! Work Less. Spend Less. EARN MORE! SEE DETAILS VIA https://webcash.softtechhub.club/go/chatterpal-commercial/ ChatterPal Will Be Your Very Own Personal Assistant That's On The Job 24/7 = To Turn MORE of Your Visitors Into Sales! CHEERS Norma A Steele 2598 Tycos Dr, Toronto, Ontario. M5T 1T4 416-347-2269 From owner-svn-src-all@freebsd.org Thu Jun 18 06:12:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E65823450C7; Thu, 18 Jun 2020 06:12:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nWmk5vFhz48VF; Thu, 18 Jun 2020 06:12:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C58112C999; Thu, 18 Jun 2020 06:12:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I6C6tJ013038; Thu, 18 Jun 2020 06:12:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I6C6EE013037; Thu, 18 Jun 2020 06:12:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202006180612.05I6C6EE013037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 18 Jun 2020 06:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362294 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 362294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 06:12:07 -0000 Author: avg Date: Thu Jun 18 06:12:06 2020 New Revision: 362294 URL: https://svnweb.freebsd.org/changeset/base/362294 Log: hdac_intr_handler: keep working until global interrupt status clears It is plausible that the hardware interrupts a host only when GIS goes from zero to one. GIS is formed by OR-ing multiple hardware statuses, so it's possible that a previously cleared status gets set again while another status has not been cleared yet. Thus, there will be no new interrupt as GIS always stayed set. If we don't re-examine GIS then we can leave it set and never get another interrupt again. Without this change I frequently saw a problem where snd_hda would stop working. Setting dev.hdac.1.polling=1 would bring it back to life and afterwards I could set polling back to zero. Sometimes the problem started right after a boot, sometimes it happened after resuming from S3, frequently it would occur when sound output and input are active concurrently (such as during conferencing). I looked at HDAC_INTSTS while the sound was not working and I saw that both HDAC_INTSTS_GIS and HDAC_INTSTS_CIS were set, but there were no interrupts. I have collected some statistics over a period of several days about how many loops (calls to hdac_one_intr) the new code did for a single interrupt: +--------+--------------+ |Loops |Times Happened| +--------+--------------+ |0 |301 | |1 |12857746 | |2 |280 | |3 |2 | |4+ |0 | +--------+--------------+ I believe that previously the sound would get stuck each time we had to loop more than once. The tested hardware is: hdac1: mem 0xfe680000-0xfe687fff at device 0.6 on pci4 hdacc1: at cad 0 on hdac1 No objections: mav MFC after: 5 weeks Differential Revision: https://reviews.freebsd.org/D25128 Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Jun 17 23:41:04 2020 (r362293) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Jun 18 06:12:06 2020 (r362294) @@ -303,30 +303,13 @@ hdac_config_fetch(struct hdac_softc *sc, uint32_t *on, } } -/**************************************************************************** - * void hdac_intr_handler(void *) - * - * Interrupt handler. Processes interrupts received from the hdac. - ****************************************************************************/ static void -hdac_intr_handler(void *context) +hdac_one_intr(struct hdac_softc *sc, uint32_t intsts) { - struct hdac_softc *sc; device_t dev; - uint32_t intsts; uint8_t rirbsts; int i; - sc = (struct hdac_softc *)context; - hdac_lock(sc); - - /* Do we have anything to do? */ - intsts = HDAC_READ_4(&sc->mem, HDAC_INTSTS); - if ((intsts & HDAC_INTSTS_GIS) == 0) { - hdac_unlock(sc); - return; - } - /* Was this a controller interrupt? */ if (intsts & HDAC_INTSTS_CIS) { rirbsts = HDAC_READ_1(&sc->mem, HDAC_RIRBSTS); @@ -346,16 +329,45 @@ hdac_intr_handler(void *context) if ((intsts & (1 << i)) == 0) continue; HDAC_WRITE_1(&sc->mem, (i << 5) + HDAC_SDSTS, - HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | HDAC_SDSTS_BCIS ); + HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | HDAC_SDSTS_BCIS); if ((dev = sc->streams[i].dev) != NULL) { HDAC_STREAM_INTR(dev, sc->streams[i].dir, sc->streams[i].stream); } } } +} - HDAC_WRITE_4(&sc->mem, HDAC_INTSTS, intsts); - hdac_unlock(sc); +/**************************************************************************** + * void hdac_intr_handler(void *) + * + * Interrupt handler. Processes interrupts received from the hdac. + ****************************************************************************/ +static void +hdac_intr_handler(void *context) +{ + struct hdac_softc *sc; + uint32_t intsts; + + sc = (struct hdac_softc *)context; + + /* + * Loop until HDAC_INTSTS_GIS gets clear. + * It is plausible that hardware interrupts a host only when GIS goes + * from zero to one. GIS is formed by OR-ing multiple hardware + * statuses, so it's possible that a previously cleared status gets set + * again while another status has not been cleared yet. Thus, there + * will be no new interrupt as GIS always stayed set. If we don't + * re-examine GIS then we can leave it set and never get an interrupt + * again. + */ + intsts = HDAC_READ_4(&sc->mem, HDAC_INTSTS); + while ((intsts & HDAC_INTSTS_GIS) != 0) { + hdac_lock(sc); + hdac_one_intr(sc, intsts); + hdac_unlock(sc); + intsts = HDAC_READ_4(&sc->mem, HDAC_INTSTS); + } } static void From owner-svn-src-all@freebsd.org Thu Jun 18 06:21:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79CB1345112; Thu, 18 Jun 2020 06:21:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nWz12hqSz4900; Thu, 18 Jun 2020 06:21:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57E3A2CD0B; Thu, 18 Jun 2020 06:21:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I6L1B9015018; Thu, 18 Jun 2020 06:21:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I6L1IR015017; Thu, 18 Jun 2020 06:21:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006180621.05I6L1IR015017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 18 Jun 2020 06:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362295 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 362295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 06:21:01 -0000 Author: andrew Date: Thu Jun 18 06:21:00 2020 New Revision: 362295 URL: https://svnweb.freebsd.org/changeset/base/362295 Log: Stop assuming we can print rman_res_t with %lx This is not the case on armv6 and armv7, where we also build this driver. Fix by casting through uintmax_t and using %jx. Sponsored by: Innovate UK Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Thu Jun 18 06:12:06 2020 (r362294) +++ head/sys/dev/pci/pci_host_generic.c Thu Jun 18 06:21:00 2020 (r362295) @@ -386,9 +386,10 @@ pci_host_generic_core_alloc_resource(device_t dev, dev } if (!found) { device_printf(dev, - "Failed to allocate %s resource %lx-%lx for %s\n", + "Failed to allocate %s resource %jx-%jx for %s\n", type == SYS_RES_IOPORT ? "IOPORT" : "MEMORY", - start, end, device_get_nameunit(child)); + (uintmax_t)start, (uintmax_t)end, + device_get_nameunit(child)); return (NULL); } break; From owner-svn-src-all@freebsd.org Thu Jun 18 07:34:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC44C34769A; Thu, 18 Jun 2020 07:34:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nYbp44btz4FYZ; Thu, 18 Jun 2020 07:34:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 874542D72F; Thu, 18 Jun 2020 07:34:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I7YU7N064881; Thu, 18 Jun 2020 07:34:30 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I7YUPZ064880; Thu, 18 Jun 2020 07:34:30 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006180734.05I7YUPZ064880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 18 Jun 2020 07:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362296 - stable/12/usr.bin/mkimg X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/usr.bin/mkimg X-SVN-Commit-Revision: 362296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 07:34:30 -0000 Author: 0mp (doc,ports committer) Date: Thu Jun 18 07:34:30 2020 New Revision: 362296 URL: https://svnweb.freebsd.org/changeset/base/362296 Log: MFC 361940: Use Fl instead of Ar for long flags Also, bump date after r361935. Modified: stable/12/usr.bin/mkimg/mkimg.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/12/usr.bin/mkimg/mkimg.1 Thu Jun 18 06:21:00 2020 (r362295) +++ stable/12/usr.bin/mkimg/mkimg.1 Thu Jun 18 07:34:30 2020 (r362296) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd June 8, 2020 .Dt MKIMG 1 .Os .Sh NAME @@ -47,7 +47,7 @@ .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... .Nm -.Ar --formats | --schemes | --version +.Fl -formats | Fl -schemes | Fl -version .Sh DESCRIPTION The .Nm @@ -183,13 +183,13 @@ utility exits immediately after providing the requeste The version of the .Nm utility is printed when the -.Ar --version +.Fl -version option is given. The list of supported output formats is printed when the -.Ar --formats +.Fl -formats option is given and the list of supported partitioning schemes is printed when the -.Ar --schemes +.Fl -schemes option is given. Both the format and scheme lists a space-separated lists for easy handling in scripts. From owner-svn-src-all@freebsd.org Thu Jun 18 07:35:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8E183475ED; Thu, 18 Jun 2020 07:35:18 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nYck43PGz4Fl5; Thu, 18 Jun 2020 07:35:18 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 866E32DB02; Thu, 18 Jun 2020 07:35:18 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I7ZI3j064977; Thu, 18 Jun 2020 07:35:18 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I7ZIcE064976; Thu, 18 Jun 2020 07:35:18 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006180735.05I7ZIcE064976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 18 Jun 2020 07:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362297 - stable/11/usr.bin/mkimg X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/usr.bin/mkimg X-SVN-Commit-Revision: 362297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 07:35:18 -0000 Author: 0mp (doc,ports committer) Date: Thu Jun 18 07:35:18 2020 New Revision: 362297 URL: https://svnweb.freebsd.org/changeset/base/362297 Log: MFC 361940: Use Fl instead of Ar for long flags Also, bump date after r361935. Modified: stable/11/usr.bin/mkimg/mkimg.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.1 Thu Jun 18 07:34:30 2020 (r362296) +++ stable/11/usr.bin/mkimg/mkimg.1 Thu Jun 18 07:35:18 2020 (r362297) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd June 8, 2020 .Dt MKIMG 1 .Os .Sh NAME @@ -47,7 +47,7 @@ .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... .Nm -.Ar --formats | --schemes | --version +.Fl -formats | Fl -schemes | Fl -version .Sh DESCRIPTION The .Nm @@ -183,13 +183,13 @@ utility exits immediately after providing the requeste The version of the .Nm utility is printed when the -.Ar --version +.Fl -version option is given. The list of supported output formats is printed when the -.Ar --formats +.Fl -formats option is given and the list of supported partitioning schemes is printed when the -.Ar --schemes +.Fl -schemes option is given. Both the format and scheme lists a space-separated lists for easy handling in scripts. From owner-svn-src-all@freebsd.org Thu Jun 18 08:26:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54A3C348C4D; Thu, 18 Jun 2020 08:26:27 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nZll0gksz4JKF; Thu, 18 Jun 2020 08:26:27 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 119462E385; Thu, 18 Jun 2020 08:26:27 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I8QQ1K095616; Thu, 18 Jun 2020 08:26:26 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I8QQfc095615; Thu, 18 Jun 2020 08:26:26 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006180826.05I8QQfc095615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Thu, 18 Jun 2020 08:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362298 - head/usr.bin/nl X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/nl X-SVN-Commit-Revision: 362298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 08:26:27 -0000 Author: fernape (ports committer) Date: Thu Jun 18 08:26:26 2020 New Revision: 362298 URL: https://svnweb.freebsd.org/changeset/base/362298 Log: nl(1): Add EXAMPLES section Add EXAMPLES section covering flags -b[ap] -n -i -s -v Approved by: bcr@ Differential Revision: Add EXAMPLES section covering flags -b[ap] -n -i -s -v Modified: head/usr.bin/nl/nl.1 Modified: head/usr.bin/nl/nl.1 ============================================================================== --- head/usr.bin/nl/nl.1 Thu Jun 18 07:35:18 2020 (r362297) +++ head/usr.bin/nl/nl.1 Thu Jun 18 08:26:26 2020 (r362298) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 4, 2014 +.Dd June 18, 2020 .Dt NL 1 .Os .Sh NAME @@ -230,6 +230,42 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Number all non-blank lines: +.Bd -literal -offset indent +$ echo -e "This is\\n\\n\\na simple text" | nl + 1 This is + + + 2 a simple text +.Ed +.Pp +Number all lines including blank ones, with right justified line numbers with +leading zeroes, starting at 2, with increment of 2 and a custom multi-character +separator: +.Bd -literal -offset indent +$ echo -e "This\\nis\\nan\\n\\n\\nexample" | nl -ba -n rz -i2 -s "->" -v2 +000002->This +000004->is +000006->an +000008-> +000010-> +000012->example +.Ed +.Pp +Number lines matching regular expression for an +.Em i +.No followed by either +.Em m +.No or +.Em n +.Bd -literal -offset indent +$ echo -e "This is\\na simple text\\nwith multiple\\nlines" | nl -bp'i[mn]' + This is + 1 a simple text + with multiple + 2 lines +.Ed .Sh SEE ALSO .Xr jot 1 , .Xr pr 1 From owner-svn-src-all@freebsd.org Thu Jun 18 08:31:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8E63348D96; Thu, 18 Jun 2020 08:31:04 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nZs45rjkz4Jbm; Thu, 18 Jun 2020 08:31:04 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F6A2E0BF; Thu, 18 Jun 2020 08:31:04 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I8V4hE097326; Thu, 18 Jun 2020 08:31:04 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I8V4kR097325; Thu, 18 Jun 2020 08:31:04 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006180831.05I8V4kR097325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Thu, 18 Jun 2020 08:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362299 - head/usr.bin/lockf X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/lockf X-SVN-Commit-Revision: 362299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 08:31:05 -0000 Author: fernape (ports committer) Date: Thu Jun 18 08:31:04 2020 New Revision: 362299 URL: https://svnweb.freebsd.org/changeset/base/362299 Log: lockf(1): Add EXAMPLES section * Add pretty small EXAMPLES section * While here, fix a warning in line 98 (new sentence in new line) Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D25205 Modified: head/usr.bin/lockf/lockf.1 Modified: head/usr.bin/lockf/lockf.1 ============================================================================== --- head/usr.bin/lockf/lockf.1 Thu Jun 18 08:26:26 2020 (r362298) +++ head/usr.bin/lockf/lockf.1 Thu Jun 18 08:31:04 2020 (r362299) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 7, 1998 +.Dd June 18, 2020 .Dt LOCKF 1 .Os .Sh NAME @@ -95,7 +95,8 @@ Causes .Nm to fail if the specified lock .Ar file -does not exist. If +does not exist. +If .Fl n is not specified, .Nm @@ -160,6 +161,25 @@ The did not exit normally, but may have been signaled or stopped. .El +.Sh EXAMPLES +The first job takes a lock and sleeps for 5 seconds in the background. +The second job tries to get the lock and timeouts after 1 second (PID numbers +will differ): +.Bd -literal -offset indent +$ lockf mylock sleep 5 & lockf -t 1 mylock echo "Success" +[1] 94410 +lockf: mylock: already locked +.Ed +.Pp +The first job takes a lock and sleeps for 1 second in the background. +The second job waits up to 5 seconds to take the lock and echoes the message on +success (PID numbers will differ): +.Bd -literal -offset indent +$ lockf mylock sleep 1 & lockf -t 5 mylock echo "Success" +[1] 19995 +Success +[1]+ Done lockf mylock sleep 1 +.Ed .Sh SEE ALSO .Xr flock 2 , .Xr lockf 3 , From owner-svn-src-all@freebsd.org Thu Jun 18 08:33:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC9A6348F14; Thu, 18 Jun 2020 08:33:37 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nZw14XjJz4JpT; Thu, 18 Jun 2020 08:33:37 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9728D2E39D; Thu, 18 Jun 2020 08:33:37 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I8XbsS001913; Thu, 18 Jun 2020 08:33:37 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I8XbVb001911; Thu, 18 Jun 2020 08:33:37 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202006180833.05I8XbVb001911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 18 Jun 2020 08:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362300 - stable/12/sbin/ifconfig X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sbin/ifconfig X-SVN-Commit-Revision: 362300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 08:33:37 -0000 Author: eugen Date: Thu Jun 18 08:33:36 2020 New Revision: 362300 URL: https://svnweb.freebsd.org/changeset/base/362300 Log: MFC r361790: ifconfig(8): make it possible to filter output by interface group. Modified: stable/12/sbin/ifconfig/ifconfig.8 stable/12/sbin/ifconfig/ifconfig.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.8 Thu Jun 18 08:31:04 2020 (r362299) +++ stable/12/sbin/ifconfig/ifconfig.8 Thu Jun 18 08:33:36 2020 (r362300) @@ -56,6 +56,7 @@ .Fl a .Op Fl L .Op Fl d +.Op Fl [gG] Ar groupname .Op Fl m .Op Fl u .Op Fl v @@ -2859,9 +2860,26 @@ This flag instructs to display information about all interfaces in the system. The .Fl d -flag limits this to interfaces that are down, and +flag limits this to interfaces that are down, .Fl u -limits this to interfaces that are up. +limits this to interfaces that are up, +limits this to interfaces that are up, +.Fl g +limits this to members of the specified group of interfaces, and +.Fl G +excludes members of the specified group from the list. +Both +.Fl g +and +.Fl G +flags may be specified to apply both conditions. +Only one option +.Fl g +should be specified as later override previous ones +(same for +.Fl G ) . +.Sy groupname +may contain shell patterns in which case it should be quoted. When no arguments are given, .Fl a is implied. @@ -2985,6 +3003,9 @@ Display available wireless networks using .Pp Display inet and inet6 address subnet masks in CIDR notation .Dl # ifconfig -f inet:cidr,inet6:cidr +.Pp +Display interfaces that are up with the exception of loopback +.Dl # ifconfig -a -u -G lo .Sh DIAGNOSTICS Messages indicating the specified interface does not exist, the requested address is unknown, or the user is not privileged and Modified: stable/12/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.c Thu Jun 18 08:31:04 2020 (r362299) +++ stable/12/sbin/ifconfig/ifconfig.c Thu Jun 18 08:33:36 2020 (r362300) @@ -63,6 +63,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -105,6 +106,8 @@ int exit_code = 0; /* Formatter Strings */ char *f_inet, *f_inet6, *f_ether, *f_addr; +static bool group_member(const char *ifname, const char *match, + const char *nomatch); static int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp); static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, @@ -402,13 +405,14 @@ main(int argc, char *argv[]) char options[1024], *cp, *envformat, *namecp = NULL; struct ifa_queue q = TAILQ_HEAD_INITIALIZER(q); struct ifa_order_elt *cur, *tmp; - const char *ifname; + const char *ifname, *matchgroup, *nogroup; struct option *p; size_t iflen; int flags; all = downonly = uponly = namesonly = noload = verbose = 0; f_inet = f_inet6 = f_ether = f_addr = NULL; + matchgroup = nogroup = NULL; envformat = getenv("IFCONFIG_FORMAT"); if (envformat != NULL) @@ -421,7 +425,7 @@ main(int argc, char *argv[]) atexit(printifnamemaybe); /* Parse leading line options */ - strlcpy(options, "f:adklmnuv", sizeof(options)); + strlcpy(options, "G:adf:klmnuv", sizeof(options)); for (p = opts; p != NULL; p = p->next) strlcat(options, p->opt, sizeof(options)); while ((c = getopt(argc, argv, options)) != -1) { @@ -437,6 +441,11 @@ main(int argc, char *argv[]) usage(); setformat(optarg); break; + case 'G': + if (optarg == NULL || all == 0) + usage(); + nogroup = optarg; + break; case 'k': printkeys++; break; @@ -455,6 +464,14 @@ main(int argc, char *argv[]) case 'v': verbose++; break; + case 'g': + if (all) { + if (optarg == NULL) + usage(); + matchgroup = optarg; + break; + } + /* FALLTHROUGH */ default: for (p = opts; p != NULL; p = p->next) if (p->opt[0] == c) { @@ -626,6 +643,8 @@ main(int argc, char *argv[]) continue; if (uponly && (ifa->ifa_flags & IFF_UP) == 0) continue; + if (!group_member(ifa->ifa_name, matchgroup, nogroup)) + continue; /* * Are we just listing the interfaces? */ @@ -668,6 +687,73 @@ main(int argc, char *argv[]) done: freeformat(); exit(exit_code); +} + +/* + * Returns true if an interface should be listed because any its groups + * matches shell pattern "match" and none of groups matches pattern "nomatch". + * If any pattern is NULL, corresponding condition is skipped. + */ +static bool +group_member(const char *ifname, const char *match, const char *nomatch) +{ + static int sock = -1; + + struct ifgroupreq ifgr; + struct ifg_req *ifg; + int len; + bool matched, nomatched; + + /* Sanity checks. */ + if (match == NULL && nomatch == NULL) + return (true); + if (ifname == NULL) + return (false); + + memset(&ifgr, 0, sizeof(ifgr)); + strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ); + + /* The socket is opened once. Let _exit() close it. */ + if (sock == -1) { + sock = socket(AF_LOCAL, SOCK_DGRAM, 0); + if (sock == -1) + errx(1, "%s: socket(AF_LOCAL,SOCK_DGRAM)", __func__); + } + + /* Determine amount of memory for the list of groups. */ + if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) { + if (errno == EINVAL || errno == ENOTTY) + return (false); + else + errx(1, "%s: SIOCGIFGROUP", __func__); + } + + /* Obtain the list of groups. */ + len = ifgr.ifgr_len; + ifgr.ifgr_groups = + (struct ifg_req *)calloc(len / sizeof(*ifg), sizeof(*ifg)); + + if (ifgr.ifgr_groups == NULL) + errx(1, "%s: no memory", __func__); + if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) + errx(1, "%s: SIOCGIFGROUP", __func__); + + /* Perform matching. */ + matched = false; + nomatched = true; + for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(*ifg); ifg++) { + len -= sizeof(struct ifg_req); + if (match) + matched |= !fnmatch(match, ifg->ifgrq_group, 0); + if (nomatch) + nomatched &= fnmatch(nomatch, ifg->ifgrq_group, 0); + } + + if (match && !nomatch) + return (matched); + if (!match && nomatch) + return (nomatched); + return (matched && nomatched); } static struct afswtch *afs = NULL; From owner-svn-src-all@freebsd.org Thu Jun 18 08:35:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B41A0348EA7; Thu, 18 Jun 2020 08:35:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nZyc4L2Pz4Jmq; Thu, 18 Jun 2020 08:35:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 900EB2E609; Thu, 18 Jun 2020 08:35:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I8ZqZB002068; Thu, 18 Jun 2020 08:35:52 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I8Zqko002066; Thu, 18 Jun 2020 08:35:52 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202006180835.05I8Zqko002066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 18 Jun 2020 08:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362301 - stable/11/sbin/ifconfig X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sbin/ifconfig X-SVN-Commit-Revision: 362301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 08:35:52 -0000 Author: eugen Date: Thu Jun 18 08:35:51 2020 New Revision: 362301 URL: https://svnweb.freebsd.org/changeset/base/362301 Log: MFC r361790: ifconfig(8): make it possible to filter output by interface group. Modified: stable/11/sbin/ifconfig/ifconfig.8 stable/11/sbin/ifconfig/ifconfig.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/11/sbin/ifconfig/ifconfig.8 Thu Jun 18 08:33:36 2020 (r362300) +++ stable/11/sbin/ifconfig/ifconfig.8 Thu Jun 18 08:35:51 2020 (r362301) @@ -56,6 +56,7 @@ .Fl a .Op Fl L .Op Fl d +.Op Fl [gG] Ar groupname .Op Fl m .Op Fl u .Op Fl v @@ -2842,9 +2843,26 @@ This flag instructs to display information about all interfaces in the system. The .Fl d -flag limits this to interfaces that are down, and +flag limits this to interfaces that are down, .Fl u -limits this to interfaces that are up. +limits this to interfaces that are up, +limits this to interfaces that are up, +.Fl g +limits this to members of the specified group of interfaces, and +.Fl G +excludes members of the specified group from the list. +Both +.Fl g +and +.Fl G +flags may be specified to apply both conditions. +Only one option +.Fl g +should be specified as later override previous ones +(same for +.Fl G ) . +.Sy groupname +may contain shell patterns in which case it should be quoted. When no arguments are given, .Fl a is implied. @@ -2968,6 +2986,9 @@ Display available wireless networks using .Pp Display inet and inet6 address subnet masks in CIDR notation .Dl # ifconfig -f inet:cidr,inet6:cidr +.Pp +Display interfaces that are up with the exception of loopback +.Dl # ifconfig -a -u -G lo .Sh DIAGNOSTICS Messages indicating the specified interface does not exist, the requested address is unknown, or the user is not privileged and Modified: stable/11/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/11/sbin/ifconfig/ifconfig.c Thu Jun 18 08:33:36 2020 (r362300) +++ stable/11/sbin/ifconfig/ifconfig.c Thu Jun 18 08:35:51 2020 (r362301) @@ -61,6 +61,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -102,6 +103,8 @@ int printkeys = 0; /* Print keying material for inter /* Formatter Strings */ char *f_inet, *f_inet6, *f_ether, *f_addr; +static bool group_member(const char *ifname, const char *match, + const char *nomatch); static int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp); static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, @@ -389,12 +392,13 @@ main(int argc, char *argv[]) char options[1024], *cp, *envformat, *namecp = NULL; struct ifa_queue q = TAILQ_HEAD_INITIALIZER(q); struct ifa_order_elt *cur, *tmp; - const char *ifname; + const char *ifname, *matchgroup, *nogroup; struct option *p; size_t iflen; all = downonly = uponly = namesonly = noload = verbose = 0; f_inet = f_inet6 = f_ether = f_addr = NULL; + matchgroup = nogroup = NULL; envformat = getenv("IFCONFIG_FORMAT"); if (envformat != NULL) @@ -407,7 +411,7 @@ main(int argc, char *argv[]) atexit(printifnamemaybe); /* Parse leading line options */ - strlcpy(options, "f:adklmnuv", sizeof(options)); + strlcpy(options, "G:adf:klmnuv", sizeof(options)); for (p = opts; p != NULL; p = p->next) strlcat(options, p->opt, sizeof(options)); while ((c = getopt(argc, argv, options)) != -1) { @@ -423,6 +427,11 @@ main(int argc, char *argv[]) usage(); setformat(optarg); break; + case 'G': + if (optarg == NULL || all == 0) + usage(); + nogroup = optarg; + break; case 'k': printkeys++; break; @@ -441,6 +450,14 @@ main(int argc, char *argv[]) case 'v': verbose++; break; + case 'g': + if (all) { + if (optarg == NULL) + usage(); + matchgroup = optarg; + break; + } + /* FALLTHROUGH */ default: for (p = opts; p != NULL; p = p->next) if (p->opt[0] == c) { @@ -593,6 +610,8 @@ main(int argc, char *argv[]) continue; if (uponly && (ifa->ifa_flags & IFF_UP) == 0) continue; + if (!group_member(ifa->ifa_name, matchgroup, nogroup)) + continue; /* * Are we just listing the interfaces? */ @@ -634,6 +653,73 @@ main(int argc, char *argv[]) freeformat(); exit(0); +} + +/* + * Returns true if an interface should be listed because any its groups + * matches shell pattern "match" and none of groups matches pattern "nomatch". + * If any pattern is NULL, corresponding condition is skipped. + */ +static bool +group_member(const char *ifname, const char *match, const char *nomatch) +{ + static int sock = -1; + + struct ifgroupreq ifgr; + struct ifg_req *ifg; + int len; + bool matched, nomatched; + + /* Sanity checks. */ + if (match == NULL && nomatch == NULL) + return (true); + if (ifname == NULL) + return (false); + + memset(&ifgr, 0, sizeof(ifgr)); + strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ); + + /* The socket is opened once. Let _exit() close it. */ + if (sock == -1) { + sock = socket(AF_LOCAL, SOCK_DGRAM, 0); + if (sock == -1) + errx(1, "%s: socket(AF_LOCAL,SOCK_DGRAM)", __func__); + } + + /* Determine amount of memory for the list of groups. */ + if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) { + if (errno == EINVAL || errno == ENOTTY) + return (false); + else + errx(1, "%s: SIOCGIFGROUP", __func__); + } + + /* Obtain the list of groups. */ + len = ifgr.ifgr_len; + ifgr.ifgr_groups = + (struct ifg_req *)calloc(len / sizeof(*ifg), sizeof(*ifg)); + + if (ifgr.ifgr_groups == NULL) + errx(1, "%s: no memory", __func__); + if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) + errx(1, "%s: SIOCGIFGROUP", __func__); + + /* Perform matching. */ + matched = false; + nomatched = true; + for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(*ifg); ifg++) { + len -= sizeof(struct ifg_req); + if (match) + matched |= !fnmatch(match, ifg->ifgrq_group, 0); + if (nomatch) + nomatched &= fnmatch(nomatch, ifg->ifgrq_group, 0); + } + + if (match && !nomatch) + return (matched); + if (!match && nomatch) + return (nomatched); + return (matched && nomatched); } static struct afswtch *afs = NULL; From owner-svn-src-all@freebsd.org Thu Jun 18 08:37:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E781348CF2; Thu, 18 Jun 2020 08:37:57 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nb110SBZz4KFm; Thu, 18 Jun 2020 08:37:57 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AD392E040; Thu, 18 Jun 2020 08:37:57 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I8buEM002213; Thu, 18 Jun 2020 08:37:56 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I8buxA002212; Thu, 18 Jun 2020 08:37:56 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202006180837.05I8buxA002212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 18 Jun 2020 08:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362302 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 362302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 08:37:57 -0000 Author: eugen Date: Thu Jun 18 08:37:56 2020 New Revision: 362302 URL: https://svnweb.freebsd.org/changeset/base/362302 Log: MFC r361789: ipfw: unbreak matching with big table type flow. Modified: stable/12/sys/netpfil/ipfw/ip_fw_table_algo.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_table_algo.c Thu Jun 18 08:35:51 2020 (r362301) +++ stable/12/sys/netpfil/ipfw/ip_fw_table_algo.c Thu Jun 18 08:37:56 2020 (r362302) @@ -3204,7 +3204,8 @@ ta_lookup_fhash(struct table_info *ti, void *key, uint struct fhashentry *ent; struct fhashentry4 *m4; struct ipfw_flow_id *id; - uint16_t hash, hsize; + uint32_t hsize; + uint16_t hash; id = (struct ipfw_flow_id *)key; head = (struct fhashbhead *)ti->state; From owner-svn-src-all@freebsd.org Thu Jun 18 08:38:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E88E7348F42; Thu, 18 Jun 2020 08:38:54 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nb265pdQz4K9p; Thu, 18 Jun 2020 08:38:54 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C28AC2E60A; Thu, 18 Jun 2020 08:38:54 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05I8csOE002323; Thu, 18 Jun 2020 08:38:54 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05I8cscG002322; Thu, 18 Jun 2020 08:38:54 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202006180838.05I8cscG002322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 18 Jun 2020 08:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362303 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 362303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 08:38:55 -0000 Author: eugen Date: Thu Jun 18 08:38:54 2020 New Revision: 362303 URL: https://svnweb.freebsd.org/changeset/base/362303 Log: MFC r361789: ipfw: unbreak matching with big table type flow. Modified: stable/11/sys/netpfil/ipfw/ip_fw_table_algo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_table_algo.c Thu Jun 18 08:37:56 2020 (r362302) +++ stable/11/sys/netpfil/ipfw/ip_fw_table_algo.c Thu Jun 18 08:38:54 2020 (r362303) @@ -3205,7 +3205,8 @@ ta_lookup_fhash(struct table_info *ti, void *key, uint struct fhashentry *ent; struct fhashentry4 *m4; struct ipfw_flow_id *id; - uint16_t hash, hsize; + uint32_t hsize; + uint16_t hash; id = (struct ipfw_flow_id *)key; head = (struct fhashbhead *)ti->state; From owner-svn-src-all@freebsd.org Thu Jun 18 10:03:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBB3834AA69; Thu, 18 Jun 2020 10:03:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ncvV4Th3z4R6R; Thu, 18 Jun 2020 10:03:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94FAF2F5E2; Thu, 18 Jun 2020 10:03:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IA3IKY057015; Thu, 18 Jun 2020 10:03:18 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IA3I2n057013; Thu, 18 Jun 2020 10:03:18 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006181003.05IA3I2n057013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 18 Jun 2020 10:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362304 - in stable/12/sys/dev: netmap virtio/network X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12/sys/dev: netmap virtio/network X-SVN-Commit-Revision: 362304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:03:18 -0000 Author: vmaffione Date: Thu Jun 18 10:03:17 2020 New Revision: 362304 URL: https://svnweb.freebsd.org/changeset/base/362304 Log: MFC r362076 netmap: introduce netmap_kring_on() This function returns NULL if the ring identified by queue id and direction is in netmap mode. Otherwise return the corresponding kring. Use this function to replace vtnet_netmap_queue_on(). Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h stable/12/sys/dev/netmap/netmap_kern.h stable/12/sys/dev/virtio/network/if_vtnet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Thu Jun 18 08:38:54 2020 (r362303) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Thu Jun 18 10:03:17 2020 (r362304) @@ -33,25 +33,6 @@ #include /* vtophys ? */ #include -/* - * Return 1 if the queue identified by 't' and 'idx' is in netmap mode. - */ -static int -vtnet_netmap_queue_on(struct vtnet_softc *sc, enum txrx t, int idx) -{ - struct netmap_adapter *na = NA(sc->vtnet_ifp); - - if (!nm_native_on(na)) - return 0; - - if (t == NR_RX) - return !!(idx < na->num_rx_rings && - na->rx_rings[idx]->nr_mode == NKR_NETMAP_ON); - - return !!(idx < na->num_tx_rings && - na->tx_rings[idx]->nr_mode == NKR_NETMAP_ON); -} - /* Register and unregister. */ static int vtnet_netmap_reg(struct netmap_adapter *na, int state) Modified: stable/12/sys/dev/netmap/netmap_kern.h ============================================================================== --- stable/12/sys/dev/netmap/netmap_kern.h Thu Jun 18 08:38:54 2020 (r362303) +++ stable/12/sys/dev/netmap/netmap_kern.h Thu Jun 18 10:03:17 2020 (r362304) @@ -1353,6 +1353,24 @@ nm_native_on(struct netmap_adapter *na) return nm_netmap_on(na) && (na->na_flags & NAF_NATIVE); } +static inline struct netmap_kring * +netmap_kring_on(struct netmap_adapter *na, u_int q, enum txrx t) +{ + struct netmap_kring *kring = NULL; + + if (!nm_native_on(na)) + return NULL; + + if (t == NR_RX && q < na->num_rx_rings) + kring = na->rx_rings[q]; + else if (t == NR_TX && q < na->num_tx_rings) + kring = na->tx_rings[q]; + else + return NULL; + + return (kring->nr_mode == NKR_NETMAP_ON) ? kring : NULL; +} + static inline int nm_iszombie(struct netmap_adapter *na) { Modified: stable/12/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/12/sys/dev/virtio/network/if_vtnet.c Thu Jun 18 08:38:54 2020 (r362303) +++ stable/12/sys/dev/virtio/network/if_vtnet.c Thu Jun 18 10:03:17 2020 (r362304) @@ -1227,17 +1227,17 @@ vtnet_rxq_free_mbufs(struct vtnet_rxq *rxq) struct mbuf *m; int last; #ifdef DEV_NETMAP - int netmap_bufs = vtnet_netmap_queue_on(rxq->vtnrx_sc, NR_RX, - rxq->vtnrx_id); + struct netmap_kring *kring = netmap_kring_on(NA(rxq->vtnrx_sc->vtnet_ifp), + rxq->vtnrx_id, NR_RX); #else /* !DEV_NETMAP */ - int netmap_bufs = 0; + void *kring = NULL; #endif /* !DEV_NETMAP */ vq = rxq->vtnrx_vq; last = 0; while ((m = virtqueue_drain(vq, &last)) != NULL) { - if (!netmap_bufs) + if (kring == NULL) m_freem(m); } @@ -2007,17 +2007,17 @@ vtnet_txq_free_mbufs(struct vtnet_txq *txq) struct vtnet_tx_header *txhdr; int last; #ifdef DEV_NETMAP - int netmap_bufs = vtnet_netmap_queue_on(txq->vtntx_sc, NR_TX, - txq->vtntx_id); + struct netmap_kring *kring = netmap_kring_on(NA(txq->vtntx_sc->vtnet_ifp), + txq->vtntx_id, NR_TX); #else /* !DEV_NETMAP */ - int netmap_bufs = 0; + void *kring = NULL; #endif /* !DEV_NETMAP */ vq = txq->vtntx_vq; last = 0; while ((txhdr = virtqueue_drain(vq, &last)) != NULL) { - if (!netmap_bufs) { + if (kring == NULL) { m_freem(txhdr->vth_mbuf); uma_zfree(vtnet_tx_header_zone, txhdr); } From owner-svn-src-all@freebsd.org Thu Jun 18 10:08:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B83F34A9F6; Thu, 18 Jun 2020 10:08:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nd1k0Kppz4R9p; Thu, 18 Jun 2020 10:08:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E20F92F5EB; Thu, 18 Jun 2020 10:08:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IA8fhl057316; Thu, 18 Jun 2020 10:08:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IA8fac057315; Thu, 18 Jun 2020 10:08:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181008.05IA8fac057315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362305 - stable/12/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:08:42 -0000 Author: hselasky Date: Thu Jun 18 10:08:41 2020 New Revision: 362305 URL: https://svnweb.freebsd.org/changeset/base/362305 Log: MFC r362043: Use const keyword when parsing the TCP/IP header in the fast path in mlx5en(4). When parsing the TCP/IP header in the fast path, make it clear by using the const keyword, no fields are to be modified inside the transmitted packet. No functional change. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:03:17 2020 (r362304) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:08:41 2020 (r362305) @@ -214,18 +214,26 @@ max_inline: return (MIN(mb->m_pkthdr.len, sq->max_inline)); } +/* + * This function parse IPv4 and IPv6 packets looking for TCP and UDP + * headers. + * + * The return value indicates the number of bytes from the beginning + * of the packet until the first byte after the TCP or UDP header. If + * this function returns zero, the parsing failed. + */ static int -mlx5e_get_full_header_size(struct mbuf *mb) +mlx5e_get_full_header_size(const struct mbuf *mb) { - struct ether_vlan_header *eh; - struct tcphdr *th; - struct ip *ip; + const struct ether_vlan_header *eh; + const struct tcphdr *th; + const struct ip *ip; int ip_hlen, tcp_hlen; - struct ip6_hdr *ip6; + const struct ip6_hdr *ip6; uint16_t eth_type; int eth_hdr_len; - eh = mtod(mb, struct ether_vlan_header *); + eh = mtod(mb, const struct ether_vlan_header *); if (mb->m_len < ETHER_HDR_LEN) return (0); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { @@ -239,7 +247,7 @@ mlx5e_get_full_header_size(struct mbuf *mb) } switch (eth_type) { case ETHERTYPE_IP: - ip = (struct ip *)(mb->m_data + eth_hdr_len); + ip = (const struct ip *)(mb->m_data + eth_hdr_len); if (mb->m_len < eth_hdr_len + sizeof(*ip)) return (0); switch (ip->ip_p) { @@ -256,7 +264,7 @@ mlx5e_get_full_header_size(struct mbuf *mb) } break; case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(mb->m_data + eth_hdr_len); + ip6 = (const struct ip6_hdr *)(mb->m_data + eth_hdr_len); if (mb->m_len < eth_hdr_len + sizeof(*ip6)) return (0); switch (ip6->ip6_nxt) { @@ -275,7 +283,7 @@ mlx5e_get_full_header_size(struct mbuf *mb) } if (mb->m_len < eth_hdr_len + sizeof(*th)) return (0); - th = (struct tcphdr *)(mb->m_data + eth_hdr_len); + th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; done: From owner-svn-src-all@freebsd.org Thu Jun 18 10:12:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D0F834AE5D; Thu, 18 Jun 2020 10:12:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nd5t1MC2z4RNR; Thu, 18 Jun 2020 10:12:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 115392FCD6; Thu, 18 Jun 2020 10:12:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IACHfH061492; Thu, 18 Jun 2020 10:12:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IACHh6061491; Thu, 18 Jun 2020 10:12:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181012.05IACHh6061491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362306 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:12:18 -0000 Author: hselasky Date: Thu Jun 18 10:12:17 2020 New Revision: 362306 URL: https://svnweb.freebsd.org/changeset/base/362306 Log: MFC r362043: Use const keyword when parsing the TCP/IP header in the fast path in mlx5en(4). When parsing the TCP/IP header in the fast path, make it clear by using the const keyword, no fields are to be modified inside the transmitted packet. No functional change. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:08:41 2020 (r362305) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:12:17 2020 (r362306) @@ -173,18 +173,26 @@ max_inline: return (MIN(mb->m_pkthdr.len, sq->max_inline)); } +/* + * This function parse IPv4 and IPv6 packets looking for TCP and UDP + * headers. + * + * The return value indicates the number of bytes from the beginning + * of the packet until the first byte after the TCP or UDP header. If + * this function returns zero, the parsing failed. + */ static int -mlx5e_get_full_header_size(struct mbuf *mb) +mlx5e_get_full_header_size(const struct mbuf *mb) { - struct ether_vlan_header *eh; - struct tcphdr *th; - struct ip *ip; + const struct ether_vlan_header *eh; + const struct tcphdr *th; + const struct ip *ip; int ip_hlen, tcp_hlen; - struct ip6_hdr *ip6; + const struct ip6_hdr *ip6; uint16_t eth_type; int eth_hdr_len; - eh = mtod(mb, struct ether_vlan_header *); + eh = mtod(mb, const struct ether_vlan_header *); if (mb->m_len < ETHER_HDR_LEN) return (0); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { @@ -198,7 +206,7 @@ mlx5e_get_full_header_size(struct mbuf *mb) } switch (eth_type) { case ETHERTYPE_IP: - ip = (struct ip *)(mb->m_data + eth_hdr_len); + ip = (const struct ip *)(mb->m_data + eth_hdr_len); if (mb->m_len < eth_hdr_len + sizeof(*ip)) return (0); switch (ip->ip_p) { @@ -215,7 +223,7 @@ mlx5e_get_full_header_size(struct mbuf *mb) } break; case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(mb->m_data + eth_hdr_len); + ip6 = (const struct ip6_hdr *)(mb->m_data + eth_hdr_len); if (mb->m_len < eth_hdr_len + sizeof(*ip6)) return (0); switch (ip6->ip6_nxt) { @@ -234,7 +242,7 @@ mlx5e_get_full_header_size(struct mbuf *mb) } if (mb->m_len < eth_hdr_len + sizeof(*th)) return (0); - th = (struct tcphdr *)(mb->m_data + eth_hdr_len); + th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; done: From owner-svn-src-all@freebsd.org Thu Jun 18 10:17:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1709C34AF48; Thu, 18 Jun 2020 10:17:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndD06ngjz4RrW; Thu, 18 Jun 2020 10:17:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB2902FE1E; Thu, 18 Jun 2020 10:17:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAHaQ2063275; Thu, 18 Jun 2020 10:17:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAHadO063274; Thu, 18 Jun 2020 10:17:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181017.05IAHadO063274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r362307 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:17:37 -0000 Author: hselasky Date: Thu Jun 18 10:17:36 2020 New Revision: 362307 URL: https://svnweb.freebsd.org/changeset/base/362307 Log: MFC r362043: Use const keyword when parsing the TCP/IP header in the fast path in mlx5en(4). When parsing the TCP/IP header in the fast path, make it clear by using the const keyword, no fields are to be modified inside the transmitted packet. No functional change. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:12:17 2020 (r362306) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:17:36 2020 (r362307) @@ -176,18 +176,26 @@ mlx5e_get_inline_hdr_size(struct mlx5e_sq *sq, struct return (MIN(sq->max_inline, mb->m_pkthdr.len)); } +/* + * This function parse IPv4 and IPv6 packets looking for TCP and UDP + * headers. + * + * The return value indicates the number of bytes from the beginning + * of the packet until the first byte after the TCP or UDP header. If + * this function returns zero, the parsing failed. + */ static int -mlx5e_get_header_size(struct mbuf *mb) +mlx5e_get_header_size(const struct mbuf *mb) { - struct ether_vlan_header *eh; - struct tcphdr *th; - struct ip *ip; + const struct ether_vlan_header *eh; + const struct tcphdr *th; + const struct ip *ip; int ip_hlen, tcp_hlen; - struct ip6_hdr *ip6; + const struct ip6_hdr *ip6; uint16_t eth_type; int eth_hdr_len; - eh = mtod(mb, struct ether_vlan_header *); + eh = mtod(mb, const struct ether_vlan_header *); if (mb->m_len < ETHER_HDR_LEN) return (0); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { @@ -201,7 +209,7 @@ mlx5e_get_header_size(struct mbuf *mb) return (0); switch (eth_type) { case ETHERTYPE_IP: - ip = (struct ip *)(mb->m_data + eth_hdr_len); + ip = (const struct ip *)(mb->m_data + eth_hdr_len); if (mb->m_len < eth_hdr_len + sizeof(*ip)) return (0); if (ip->ip_p != IPPROTO_TCP) @@ -210,7 +218,7 @@ mlx5e_get_header_size(struct mbuf *mb) eth_hdr_len += ip_hlen; break; case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(mb->m_data + eth_hdr_len); + ip6 = (const struct ip6_hdr *)(mb->m_data + eth_hdr_len); if (mb->m_len < eth_hdr_len + sizeof(*ip6)) return (0); if (ip6->ip6_nxt != IPPROTO_TCP) @@ -222,7 +230,7 @@ mlx5e_get_header_size(struct mbuf *mb) } if (mb->m_len < eth_hdr_len + sizeof(*th)) return (0); - th = (struct tcphdr *)(mb->m_data + eth_hdr_len); + th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; if (mb->m_len < eth_hdr_len) From owner-svn-src-all@freebsd.org Thu Jun 18 10:19:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9987934B1ED; Thu, 18 Jun 2020 10:19:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndGK3Y4tz4S3c; Thu, 18 Jun 2020 10:19:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7509C2FF85; Thu, 18 Jun 2020 10:19:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAJb6Q063425; Thu, 18 Jun 2020 10:19:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAJbtv063424; Thu, 18 Jun 2020 10:19:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181019.05IAJbtv063424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362308 - stable/12/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:19:37 -0000 Author: hselasky Date: Thu Jun 18 10:19:37 2020 New Revision: 362308 URL: https://svnweb.freebsd.org/changeset/base/362308 Log: MFC r362044: Extend use of unlikely() in the fast path, in mlx5en(4). Typically the TCP/IP headers fit within the first mbuf and should not trigger any of the error cases. Use unlikely() for these cases. No functional change. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:17:36 2020 (r362307) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:19:37 2020 (r362308) @@ -234,10 +234,10 @@ mlx5e_get_full_header_size(const struct mbuf *mb) int eth_hdr_len; eh = mtod(mb, const struct ether_vlan_header *); - if (mb->m_len < ETHER_HDR_LEN) + if (unlikely(mb->m_len < ETHER_HDR_LEN)) return (0); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - if (mb->m_len < (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)) + if (unlikely(mb->m_len < (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN))) return (0); eth_type = ntohs(eh->evl_proto); eth_hdr_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; @@ -248,7 +248,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb) switch (eth_type) { case ETHERTYPE_IP: ip = (const struct ip *)(mb->m_data + eth_hdr_len); - if (mb->m_len < eth_hdr_len + sizeof(*ip)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*ip))) return (0); switch (ip->ip_p) { case IPPROTO_TCP: @@ -265,7 +265,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb) break; case ETHERTYPE_IPV6: ip6 = (const struct ip6_hdr *)(mb->m_data + eth_hdr_len); - if (mb->m_len < eth_hdr_len + sizeof(*ip6)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*ip6))) return (0); switch (ip6->ip6_nxt) { case IPPROTO_TCP: @@ -281,7 +281,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb) default: return (0); } - if (mb->m_len < eth_hdr_len + sizeof(*th)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) return (0); th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); tcp_hlen = th->th_off << 2; @@ -292,7 +292,7 @@ done: * does not need to reside within the first m_len bytes of * data: */ - if (mb->m_pkthdr.len < eth_hdr_len) + if (unlikely(mb->m_pkthdr.len < eth_hdr_len)) return (0); return (eth_hdr_len); } From owner-svn-src-all@freebsd.org Thu Jun 18 10:20:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC93834B409; Thu, 18 Jun 2020 10:20:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndH44YN7z4SKW; Thu, 18 Jun 2020 10:20:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9787A2FBCD; Thu, 18 Jun 2020 10:20:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAKGUs063555; Thu, 18 Jun 2020 10:20:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAKGr5063554; Thu, 18 Jun 2020 10:20:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181020.05IAKGr5063554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362309 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:20:16 -0000 Author: hselasky Date: Thu Jun 18 10:20:16 2020 New Revision: 362309 URL: https://svnweb.freebsd.org/changeset/base/362309 Log: MFC r362044: Extend use of unlikely() in the fast path, in mlx5en(4). Typically the TCP/IP headers fit within the first mbuf and should not trigger any of the error cases. Use unlikely() for these cases. No functional change. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:19:37 2020 (r362308) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:20:16 2020 (r362309) @@ -193,10 +193,10 @@ mlx5e_get_full_header_size(const struct mbuf *mb) int eth_hdr_len; eh = mtod(mb, const struct ether_vlan_header *); - if (mb->m_len < ETHER_HDR_LEN) + if (unlikely(mb->m_len < ETHER_HDR_LEN)) return (0); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - if (mb->m_len < (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)) + if (unlikely(mb->m_len < (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN))) return (0); eth_type = ntohs(eh->evl_proto); eth_hdr_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; @@ -207,7 +207,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb) switch (eth_type) { case ETHERTYPE_IP: ip = (const struct ip *)(mb->m_data + eth_hdr_len); - if (mb->m_len < eth_hdr_len + sizeof(*ip)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*ip))) return (0); switch (ip->ip_p) { case IPPROTO_TCP: @@ -224,7 +224,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb) break; case ETHERTYPE_IPV6: ip6 = (const struct ip6_hdr *)(mb->m_data + eth_hdr_len); - if (mb->m_len < eth_hdr_len + sizeof(*ip6)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*ip6))) return (0); switch (ip6->ip6_nxt) { case IPPROTO_TCP: @@ -240,7 +240,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb) default: return (0); } - if (mb->m_len < eth_hdr_len + sizeof(*th)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) return (0); th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); tcp_hlen = th->th_off << 2; @@ -251,7 +251,7 @@ done: * does not need to reside within the first m_len bytes of * data: */ - if (mb->m_pkthdr.len < eth_hdr_len) + if (unlikely(mb->m_pkthdr.len < eth_hdr_len)) return (0); return (eth_hdr_len); } From owner-svn-src-all@freebsd.org Thu Jun 18 10:31:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EE1934B660; Thu, 18 Jun 2020 10:31:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndWt1RYGz4Sqc; Thu, 18 Jun 2020 10:31:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 138D48327; Thu, 18 Jun 2020 10:31:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAVLS3069913; Thu, 18 Jun 2020 10:31:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAVLrG069912; Thu, 18 Jun 2020 10:31:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181031.05IAVLrG069912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r362310 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:31:22 -0000 Author: hselasky Date: Thu Jun 18 10:31:21 2020 New Revision: 362310 URL: https://svnweb.freebsd.org/changeset/base/362310 Log: MFC r362044: Extend use of unlikely() in the fast path, in mlx5en(4). Typically the TCP/IP headers fit within the first mbuf and should not trigger any of the error cases. Use unlikely() for these cases. No functional change. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:20:16 2020 (r362309) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:31:21 2020 (r362310) @@ -196,21 +196,21 @@ mlx5e_get_header_size(const struct mbuf *mb) int eth_hdr_len; eh = mtod(mb, const struct ether_vlan_header *); - if (mb->m_len < ETHER_HDR_LEN) + if (unlikely(mb->m_len < ETHER_HDR_LEN)) return (0); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { + if (unlikely(mb->m_len < (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN))) + return (0); eth_type = ntohs(eh->evl_proto); eth_hdr_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; } else { eth_type = ntohs(eh->evl_encap_proto); eth_hdr_len = ETHER_HDR_LEN; } - if (mb->m_len < eth_hdr_len) - return (0); switch (eth_type) { case ETHERTYPE_IP: ip = (const struct ip *)(mb->m_data + eth_hdr_len); - if (mb->m_len < eth_hdr_len + sizeof(*ip)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*ip))) return (0); if (ip->ip_p != IPPROTO_TCP) return (0); @@ -219,7 +219,7 @@ mlx5e_get_header_size(const struct mbuf *mb) break; case ETHERTYPE_IPV6: ip6 = (const struct ip6_hdr *)(mb->m_data + eth_hdr_len); - if (mb->m_len < eth_hdr_len + sizeof(*ip6)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*ip6))) return (0); if (ip6->ip6_nxt != IPPROTO_TCP) return (0); @@ -228,12 +228,17 @@ mlx5e_get_header_size(const struct mbuf *mb) default: return (0); } - if (mb->m_len < eth_hdr_len + sizeof(*th)) + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) return (0); th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; - if (mb->m_len < eth_hdr_len) + /* + * m_copydata() will be used on the remaining header which + * does not need to reside within the first m_len bytes of + * data: + */ + if (unlikely(mb->m_pkthdr.len < eth_hdr_len)) return (0); return (eth_hdr_len); } From owner-svn-src-all@freebsd.org Thu Jun 18 10:38:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3CCC34B844; Thu, 18 Jun 2020 10:38:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndgZ6CGFz4TJs; Thu, 18 Jun 2020 10:38:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D03378525; Thu, 18 Jun 2020 10:38:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAc2IE075665; Thu, 18 Jun 2020 10:38:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAc2Hm075664; Thu, 18 Jun 2020 10:38:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181038.05IAc2Hm075664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362311 - stable/12/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:38:03 -0000 Author: hselasky Date: Thu Jun 18 10:38:02 2020 New Revision: 362311 URL: https://svnweb.freebsd.org/changeset/base/362311 Log: MFC r362045: Make sure packets generated by raw IP code is let through by mlx5en(4). Allow the TCP header to reside in the mbuf following the IP header. Else such packets will get dropped. Backtrace: mlx5e_sq_xmit() mlx5e_xmit() ether_output_frame() ether_output() ip_output_send() ip_output() rip_output() sosend_generic() sosend() kern_sendit() sendit() sys_sendto() amd64_syscall() fast_syscall_common() Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:31:21 2020 (r362310) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:38:02 2020 (r362311) @@ -281,9 +281,15 @@ mlx5e_get_full_header_size(const struct mbuf *mb) default: return (0); } - if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) - return (0); - th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) { + const struct mbuf *m_th = mb->m_next; + if (unlikely(mb->m_len != eth_hdr_len || + m_th == NULL || m_th->m_len < sizeof(*th))) + return (0); + th = (const struct tcphdr *)(m_th->m_data); + } else { + th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + } tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; done: From owner-svn-src-all@freebsd.org Thu Jun 18 10:40:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A85FD34BB30; Thu, 18 Jun 2020 10:40:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndk83qsSz4TVx; Thu, 18 Jun 2020 10:40:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B47C8419; Thu, 18 Jun 2020 10:40:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAeGjt075860; Thu, 18 Jun 2020 10:40:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAeGfi075859; Thu, 18 Jun 2020 10:40:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181040.05IAeGfi075859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362312 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:40:16 -0000 Author: hselasky Date: Thu Jun 18 10:40:16 2020 New Revision: 362312 URL: https://svnweb.freebsd.org/changeset/base/362312 Log: MFC r362045: Make sure packets generated by raw IP code is let through by mlx5en(4). Allow the TCP header to reside in the mbuf following the IP header. Else such packets will get dropped. Backtrace: mlx5e_sq_xmit() mlx5e_xmit() ether_output_frame() ether_output() ip_output_send() ip_output() rip_output() sosend_generic() sosend() kern_sendit() sendit() sys_sendto() amd64_syscall() fast_syscall_common() Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:38:02 2020 (r362311) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:40:16 2020 (r362312) @@ -240,9 +240,15 @@ mlx5e_get_full_header_size(const struct mbuf *mb) default: return (0); } - if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) - return (0); - th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) { + const struct mbuf *m_th = mb->m_next; + if (unlikely(mb->m_len != eth_hdr_len || + m_th == NULL || m_th->m_len < sizeof(*th))) + return (0); + th = (const struct tcphdr *)(m_th->m_data); + } else { + th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + } tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; done: From owner-svn-src-all@freebsd.org Thu Jun 18 10:41:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C04834BBEF; Thu, 18 Jun 2020 10:41:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndlz73ZLz4Tb2; Thu, 18 Jun 2020 10:41:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED706842D; Thu, 18 Jun 2020 10:41:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAfpJZ080975; Thu, 18 Jun 2020 10:41:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAfpoC080974; Thu, 18 Jun 2020 10:41:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181041.05IAfpoC080974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r362313 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 362313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:41:52 -0000 Author: hselasky Date: Thu Jun 18 10:41:51 2020 New Revision: 362313 URL: https://svnweb.freebsd.org/changeset/base/362313 Log: MFC r362045: Make sure packets generated by raw IP code is let through by mlx5en(4). Allow the TCP header to reside in the mbuf following the IP header. Else such packets will get dropped. Backtrace: mlx5e_sq_xmit() mlx5e_xmit() ether_output_frame() ether_output() ip_output_send() ip_output() rip_output() sosend_generic() sosend() kern_sendit() sendit() sys_sendto() amd64_syscall() fast_syscall_common() Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:40:16 2020 (r362312) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:41:51 2020 (r362313) @@ -228,9 +228,15 @@ mlx5e_get_header_size(const struct mbuf *mb) default: return (0); } - if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) - return (0); - th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) { + const struct mbuf *m_th = mb->m_next; + if (unlikely(mb->m_len != eth_hdr_len || + m_th == NULL || m_th->m_len < sizeof(*th))) + return (0); + th = (const struct tcphdr *)(m_th->m_data); + } else { + th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + } tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; /* From owner-svn-src-all@freebsd.org Thu Jun 18 10:45:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F22A34C09A; Thu, 18 Jun 2020 10:45:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndrC2mmsz4Tyt; Thu, 18 Jun 2020 10:45:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59F7F2FF67; Thu, 18 Jun 2020 10:45:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAjVg0081896; Thu, 18 Jun 2020 10:45:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAjV5O081895; Thu, 18 Jun 2020 10:45:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181045.05IAjV5O081895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362314 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 362314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:45:31 -0000 Author: hselasky Date: Thu Jun 18 10:45:30 2020 New Revision: 362314 URL: https://svnweb.freebsd.org/changeset/base/362314 Log: MFC r361722: Implement BUILD_BUG_ON_ZERO() in the LinuxKPI. Tested using gcc and clang. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:41:51 2020 (r362313) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:45:30 2020 (r362314) @@ -94,6 +94,9 @@ #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) #define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } +extern const volatile int lkpi_build_bug_on_zero; +#define BUILD_BUG_ON_ZERO(x) ((x) ? lkpi_build_bug_on_zero : 0) + #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ if (cond) { \ From owner-svn-src-all@freebsd.org Thu Jun 18 10:46:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3323234C02C; Thu, 18 Jun 2020 10:46:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndrt0Wd9z4VFS; Thu, 18 Jun 2020 10:46:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AA2A85C4; Thu, 18 Jun 2020 10:46:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAk53R081985; Thu, 18 Jun 2020 10:46:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAk5nI081984; Thu, 18 Jun 2020 10:46:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181046.05IAk5nI081984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362315 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 362315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:46:06 -0000 Author: hselasky Date: Thu Jun 18 10:46:05 2020 New Revision: 362315 URL: https://svnweb.freebsd.org/changeset/base/362315 Log: MFC r361722: Implement BUILD_BUG_ON_ZERO() in the LinuxKPI. Tested using gcc and clang. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:45:30 2020 (r362314) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:46:05 2020 (r362315) @@ -94,6 +94,9 @@ #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) #define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } +extern const volatile int lkpi_build_bug_on_zero; +#define BUILD_BUG_ON_ZERO(x) ((x) ? lkpi_build_bug_on_zero : 0) + #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ if (cond) { \ From owner-svn-src-all@freebsd.org Thu Jun 18 10:46:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3C0834C120; Thu, 18 Jun 2020 10:46:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndst3xNvz4VDB; Thu, 18 Jun 2020 10:46:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 826C482B5; Thu, 18 Jun 2020 10:46:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAkwII082080; Thu, 18 Jun 2020 10:46:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAkwCo082079; Thu, 18 Jun 2020 10:46:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181046.05IAkwCo082079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362316 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 362316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:46:58 -0000 Author: hselasky Date: Thu Jun 18 10:46:58 2020 New Revision: 362316 URL: https://svnweb.freebsd.org/changeset/base/362316 Log: MFC r361723: Implement struct_size() function macro in the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:46:05 2020 (r362315) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:46:58 2020 (r362316) @@ -534,4 +534,10 @@ linux_ratelimited(linux_ratelimit_t *rl) return (ppsratecheck(&rl->lasttime, &rl->counter, 1)); } +#define struct_size(ptr, field, num) ({ \ + const size_t __size = offsetof(__typeof(*(ptr)), field); \ + const size_t __max = (SIZE_MAX - __size) / sizeof((ptr)->field[0]); \ + ((num) > __max) ? SIZE_MAX : (__size + sizeof((ptr)->field[0]) * (num)); \ +}) + #endif /* _LINUX_KERNEL_H_ */ From owner-svn-src-all@freebsd.org Thu Jun 18 10:47:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 916FF34C065; Thu, 18 Jun 2020 10:47:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndtV3GHkz4VMy; Thu, 18 Jun 2020 10:47:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B3802FF68; Thu, 18 Jun 2020 10:47:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAlUaS082167; Thu, 18 Jun 2020 10:47:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAlUKq082166; Thu, 18 Jun 2020 10:47:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181047.05IAlUKq082166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362317 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 362317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:47:30 -0000 Author: hselasky Date: Thu Jun 18 10:47:30 2020 New Revision: 362317 URL: https://svnweb.freebsd.org/changeset/base/362317 Log: MFC r361723: Implement struct_size() function macro in the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:46:58 2020 (r362316) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:47:30 2020 (r362317) @@ -527,4 +527,10 @@ linux_ratelimited(linux_ratelimit_t *rl) return (ppsratecheck(&rl->lasttime, &rl->counter, 1)); } +#define struct_size(ptr, field, num) ({ \ + const size_t __size = offsetof(__typeof(*(ptr)), field); \ + const size_t __max = (SIZE_MAX - __size) / sizeof((ptr)->field[0]); \ + ((num) > __max) ? SIZE_MAX : (__size + sizeof((ptr)->field[0]) * (num)); \ +}) + #endif /* _LINUX_KERNEL_H_ */ From owner-svn-src-all@freebsd.org Thu Jun 18 10:48:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7942D34C1C4; Thu, 18 Jun 2020 10:48:38 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndvp2gHTz4Vdf; Thu, 18 Jun 2020 10:48:38 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5662986B5; Thu, 18 Jun 2020 10:48:38 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAmcOU082276; Thu, 18 Jun 2020 10:48:38 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAmcXI082275; Thu, 18 Jun 2020 10:48:38 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006181048.05IAmcXI082275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Thu, 18 Jun 2020 10:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362318 - head/usr.bin/tee X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/tee X-SVN-Commit-Revision: 362318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:48:38 -0000 Author: fernape (ports committer) Date: Thu Jun 18 10:48:37 2020 New Revision: 362318 URL: https://svnweb.freebsd.org/changeset/base/362318 Log: tee(1): Add EXAMPLES section Probably the simplest one ever. Approved by: gbe@, 0mp@ Differential Revision: https://reviews.freebsd.org/D25206 Modified: head/usr.bin/tee/tee.1 Modified: head/usr.bin/tee/tee.1 ============================================================================== --- head/usr.bin/tee/tee.1 Thu Jun 18 10:47:30 2020 (r362317) +++ head/usr.bin/tee/tee.1 Thu Jun 18 10:48:37 2020 (r362318) @@ -31,7 +31,7 @@ .\" @(#)tee.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 13, 2007 +.Dd June 18, 2020 .Dt TEE 1 .Os .Sh NAME @@ -74,6 +74,12 @@ except in the event of the option. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Send echoed message both to stdout and to the greetings file: +.Bd -literal -offset indent +$ echo "Hello" | tee greetings.txt +Hello +.Ed .Sh STANDARDS The .Nm From owner-svn-src-all@freebsd.org Thu Jun 18 10:49:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB6AA34C07F; Thu, 18 Jun 2020 10:49:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndx94bCNz4Vhc; Thu, 18 Jun 2020 10:49:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98C4686B6; Thu, 18 Jun 2020 10:49:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAnnIX082381; Thu, 18 Jun 2020 10:49:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAnnPq082380; Thu, 18 Jun 2020 10:49:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181049.05IAnnPq082380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362319 - in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 362319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:49:49 -0000 Author: hselasky Date: Thu Jun 18 10:49:49 2020 New Revision: 362319 URL: https://svnweb.freebsd.org/changeset/base/362319 Log: MFC r361724: Implement __is_constexpr() function macro in the LinuxKPI. Bump the FreeBSD version. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:48:37 2020 (r362318) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:49:49 2020 (r362319) @@ -540,4 +540,7 @@ linux_ratelimited(linux_ratelimit_t *rl) ((num) > __max) ? SIZE_MAX : (__size + sizeof((ptr)->field[0]) * (num)); \ }) +#define __is_constexpr(x) \ + __builtin_constant_p(x) + #endif /* _LINUX_KERNEL_H_ */ Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Thu Jun 18 10:48:37 2020 (r362318) +++ stable/12/sys/sys/param.h Thu Jun 18 10:49:49 2020 (r362319) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201517 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201518 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Jun 18 10:50:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC85134C23D; Thu, 18 Jun 2020 10:50:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ndyW5VB1z4Vk2; Thu, 18 Jun 2020 10:50:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7AE486BC; Thu, 18 Jun 2020 10:50:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAoxkZ082528; Thu, 18 Jun 2020 10:50:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAoxJo082526; Thu, 18 Jun 2020 10:50:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181050.05IAoxJo082526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362320 - in stable/11/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 362320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:50:59 -0000 Author: hselasky Date: Thu Jun 18 10:50:59 2020 New Revision: 362320 URL: https://svnweb.freebsd.org/changeset/base/362320 Log: MFC r361724: Implement __is_constexpr() function macro in the LinuxKPI. Bump the FreeBSD version. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:49:49 2020 (r362319) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:50:59 2020 (r362320) @@ -533,4 +533,7 @@ linux_ratelimited(linux_ratelimit_t *rl) ((num) > __max) ? SIZE_MAX : (__size + sizeof((ptr)->field[0]) * (num)); \ }) +#define __is_constexpr(x) \ + __builtin_constant_p(x) + #endif /* _LINUX_KERNEL_H_ */ Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Thu Jun 18 10:49:49 2020 (r362319) +++ stable/11/sys/sys/param.h Thu Jun 18 10:50:59 2020 (r362320) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Jun 18 10:52:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56AA134C48F; Thu, 18 Jun 2020 10:52:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nf0h1bBSz4VyD; Thu, 18 Jun 2020 10:52:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31C9B82DC; Thu, 18 Jun 2020 10:52:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAqqJF088311; Thu, 18 Jun 2020 10:52:52 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAqqnB088310; Thu, 18 Jun 2020 10:52:52 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006181052.05IAqqnB088310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 18 Jun 2020 10:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362321 - head/usr.sbin/periodic X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.sbin/periodic X-SVN-Commit-Revision: 362321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:52:52 -0000 Author: 0mp (doc,ports committer) Date: Thu Jun 18 10:52:51 2020 New Revision: 362321 URL: https://svnweb.freebsd.org/changeset/base/362321 Log: Improve periodic(8) manual page presentation - Update synopsis to present all available arguments. - Consistently call the argument specifying an arbitrary directory a "directory". - Do not put macros into -width argument to Bl. They do not expand there. - Stylize command modifiers like "daily" with Cm instead of Pa. While technically periodic(8) operates on directories with such names, it is confusing from the perspective of the manual page reader as Pa and Ar are stylized the same way. Also, I cannot recall a single manual page where Pa would be used to describe the syntax of command-line arguments. MFC after: 2 weeks Modified: head/usr.sbin/periodic/periodic.8 Modified: head/usr.sbin/periodic/periodic.8 ============================================================================== --- head/usr.sbin/periodic/periodic.8 Thu Jun 18 10:50:59 2020 (r362320) +++ head/usr.sbin/periodic/periodic.8 Thu Jun 18 10:52:51 2020 (r362321) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2016 +.Dd June 18, 2020 .Dt PERIODIC 8 .Os .Sh NAME @@ -32,7 +32,10 @@ .Nd run periodic system functions .Sh SYNOPSIS .Nm -.Ar directory ... +.Sm off +.Cm daily | weekly | monthly | security | Ar directory +.Sm on +.Ar ... .Sh DESCRIPTION The .Nm @@ -42,22 +45,22 @@ to execute shell scripts located in the specified directory. .Pp One or more of the following arguments must be specified: -.Bl -tag -width ".Pa monthly" -.It Pa daily +.Bl -tag -width "directory" +.It Cm daily Perform the standard daily periodic executable run. This usually occurs early in the morning (local time). -.It Pa weekly +.It Cm weekly Perform the standard weekly periodic executable run. This usually occurs very early on Saturday mornings. -.It Pa monthly +.It Cm monthly Perform the standard monthly periodic executable run. This usually occurs on the first day of the month. -.It Pa security +.It Cm security Perform the standard daily security checks. This is usually spawned by the -.Pa daily +.Cm daily run. -.It Ar path +.It Ar directory An arbitrary directory containing a set of executables to be run. .El .Pp From owner-svn-src-all@freebsd.org Thu Jun 18 10:53:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB58634C680 for ; Thu, 18 Jun 2020 10:53:28 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-ua1-x935.google.com (mail-ua1-x935.google.com [IPv6:2607:f8b0:4864:20::935]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nf1M5wY7z4WQd for ; Thu, 18 Jun 2020 10:53:27 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-ua1-x935.google.com with SMTP id b13so1829075uav.3 for ; Thu, 18 Jun 2020 03:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wRV0WANJ0UAjldksoCXOpn4ro++rN0sqZaxobJZp8Ek=; b=bg7J2N/8q0/8F1Vu80dXTwyJXBznFRUGK1hoFx6wFPeId939iQ961C2a0vfWG7gDpn Z53GkcjZut8IEyysi6exylMcC+W5U0u+XXnR10dGZchxk796ckqTxlsd5L9v6rg/6NKQ agRSu7OSZC6EAVoEdGa1x1OJNkv/uSOW2zYplb6ze6Bhmwf1ITVlAS37PHrSWfHEvjBa dQQZbsp83KDUU/FRbq+nzWkfS222hq6KgtnsOGGGFsbItVWvWoU1u90DdvPeh86TR5yT m0ijqc5lxifZ1t52B4x/cUmePUEUyl8e7RxQAy6sB1ofXKZdfGOu1CoYQaPPdZ5gWO7m H4Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wRV0WANJ0UAjldksoCXOpn4ro++rN0sqZaxobJZp8Ek=; b=WWGluCrDugoimZbEv/+EIZeIinrj0V94fzCRtWVUJMkpY08s3WMNbX0a7YafrQ/m4f fq/xM+13l6xK6f0YaH1zWyy+y4MY2+VuQwPy7pRF6WbCDTTPFG8Lhy96vouL8pH1zYmZ OBNHhRgybWTUssgyYN1uHX7If/XlSBjubUBqz/0htxV0zjGbzs1wbwieJqfbwIL5lV66 tnNBohYp2E0n6mMSj8vbBMe59q0K8C6fKlDL8z/GRifRSd49jNAI5PWIoF0hXIxzi74k k1dkjA7DDka4o8jV1wJ1Dh0CPgOcZcAm0WAO6bjjenma+yJSHkqv6Be7zNLQL4ICTRsH Fwwg== X-Gm-Message-State: AOAM530yzD2E6dQDy/WqiDJrTkMwRHISQNsZOq1O8i0E9KZsHYIqFdbz L7PHporfCU2/uTjcCT9Dy+2Vlb/DvgZtSpTo+dIp8qb0Glk= X-Google-Smtp-Source: ABdhPJw6Wm+vQ+vWWo2p/Jxm6sFnrzziyyYwWip3FtDrAvXK0ghQM7pB0ceMOyO+jF6DdqmTcVStfNhgunw8SS3BAwI= X-Received: by 2002:a9f:236e:: with SMTP id 101mr2312612uae.103.1592477606511; Thu, 18 Jun 2020 03:53:26 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Thu, 18 Jun 2020 13:52:56 +0200 Message-ID: Subject: DR for r362298 To: svn-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49nf1M5wY7z4WQd X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=bg7J2N/8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of fernandoapesteguia@gmail.com designates 2607:f8b0:4864:20::935 as permitted sender) smtp.mailfrom=fernandoapesteguia@gmail.com X-Spamd-Result: default: False [-1.79 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.888]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.003]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::935:from]; NEURAL_SPAM_SHORT(0.10)[0.098]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; R_MIXED_CHARSET(1.00)[subject]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:53:28 -0000 DR for r362298 is https://reviews.freebsd.org/D25197 approved by bcr@ From owner-svn-src-all@freebsd.org Thu Jun 18 10:53:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7387234C373; Thu, 18 Jun 2020 10:53:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nf1d2XQcz4WD8; Thu, 18 Jun 2020 10:53:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5252F8746; Thu, 18 Jun 2020 10:53:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IArfjm088410; Thu, 18 Jun 2020 10:53:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IArf8X088409; Thu, 18 Jun 2020 10:53:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181053.05IArf8X088409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362322 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 362322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:53:41 -0000 Author: hselasky Date: Thu Jun 18 10:53:40 2020 New Revision: 362322 URL: https://svnweb.freebsd.org/changeset/base/362322 Log: MFC r361828: Ensure pci_channel_offline() actually queries the PCI register space, and not only the software cache of that register. Else pci_channel_offline() won't detect that the PCI device is gone when using the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Thu Jun 18 10:52:51 2020 (r362321) +++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Thu Jun 18 10:53:40 2020 (r362322) @@ -648,7 +648,7 @@ static inline int pci_channel_offline(struct pci_dev *pdev) { - return (pci_get_vendor(pdev->dev.bsddev) == PCIV_INVALID); + return (pci_read_config(pdev->dev.bsddev, PCIR_VENDOR, 2) == PCIV_INVALID); } static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) From owner-svn-src-all@freebsd.org Thu Jun 18 10:55:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C29834C3F2; Thu, 18 Jun 2020 10:55:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nf430qbwz4WXH; Thu, 18 Jun 2020 10:55:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17A9D888B; Thu, 18 Jun 2020 10:55:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IAtkvr088599; Thu, 18 Jun 2020 10:55:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IAtkr8088598; Thu, 18 Jun 2020 10:55:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006181055.05IAtkr8088598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Jun 2020 10:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362323 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 362323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:55:47 -0000 Author: hselasky Date: Thu Jun 18 10:55:46 2020 New Revision: 362323 URL: https://svnweb.freebsd.org/changeset/base/362323 Log: MFC r361828: Ensure pci_channel_offline() actually queries the PCI register space, and not only the software cache of that register. Else pci_channel_offline() won't detect that the PCI device is gone when using the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Thu Jun 18 10:53:40 2020 (r362322) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Thu Jun 18 10:55:46 2020 (r362323) @@ -664,7 +664,7 @@ static inline int pci_channel_offline(struct pci_dev *pdev) { - return (pci_get_vendor(pdev->dev.bsddev) == PCIV_INVALID); + return (pci_read_config(pdev->dev.bsddev, PCIR_VENDOR, 2) == PCIV_INVALID); } static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) From owner-svn-src-all@freebsd.org Thu Jun 18 10:56:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2B8B34C72F; Thu, 18 Jun 2020 10:56:57 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49nf5P4GFyz4WbT; Thu, 18 Jun 2020 10:56:57 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BF0A45C010D; Thu, 18 Jun 2020 06:56:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 18 Jun 2020 06:56:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.dev; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=G 5tUutLyR56sQd1V16zl5NQKlC7gbeOrq+rDVpNvPKg=; b=M21SoeMJ2H/tlUdZe wGsnRsEuD6HRRhV7wNSw+g0csLvK21IQxpEio5VfIa93TWOaLPssByZf9hGMqWk1 18jLBUIUu9r9XrgbBNnT3eUcxXR516VHDD1P+337Rhy6hwK3qEgM5z4USRgjo2mf ufFw+HFgg/DQCZFYOX4aRoowClOBJ4txZuq2nwKPrpSW1567t/qgZFFGtTbLeWyH bq6/gscF3tTCYW6KOqmTwVpcr5b+9F+dvLTc9fvf5SxAdkSMlEl2xl8FUUqbbJQ0 PBWxqR7DdXINKRZbBpfyJeHvq5khbQ7eDHBvlrH2pHzh3bU7gFfpju+WB2U4yenB E66ww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=G5tUutLyR56sQd1V16zl5NQKlC7gbeOrq+rDVpNvP Kg=; b=X9nkI5TkVILh0+OVhfDmNsZ6JWD0OakRoRaWvd2bkT88w9gXr2nSNS6Ub fr+l+uYR4p1AWLSuXLFX+my2Mn2LXC+lpHUOUhtjS1c2WIsH59ymD1VVk6l+YK4T KNbDyOUUsrn9qEipCk3KcwrhfvDr9hqIoXGE2wOwSwcATLSVsND3ZUW08H9FdxWq YdQpQqMro2nWag7gNZKNVa/xKUZCqanu1iJo2KYrOuU3VjU51hpqNNiDPkVA5+HE XTQv3iEqFCE7wQIBgPxeLKQJSpbPqZWoCxU+3ol/tCkn644uS5lFFUEDUEF/Yj7a fEwb5t83jUqm7YnnU7pHSa0VYRHhw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejgedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpegjuhhrihcurfgrnhhkohhvuceohihurhhiphhvseihuhhr ihhpvhdruggvvheqnecuggftrfgrthhtvghrnhepkeegieettdetudehtefhhfelvdefge evteevhedtfefgvedtvefhtefhvefhhfeknecuffhomhgrihhnpehfrhgvvggsshgurdho rhhgpdhtgihtrdgsugenucfkphepledurddvgedtrdduvdegrddufeejnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephihurhhiphhvseihuhhr ihhpvhdruggvvh X-ME-Proxy: Received: from [192.168.1.6] (unknown [91.240.124.137]) by mail.messagingengine.com (Postfix) with ESMTPA id B2DE5328005E; Thu, 18 Jun 2020 06:56:55 -0400 (EDT) Subject: Re: svn commit: r362318 - head/usr.bin/tee To: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006181048.05IAmcXI082275@repo.freebsd.org> From: Yuri Pankov Message-ID: <636fac36-30dd-42bf-02ab-4ebc5bf3a065@yuripv.dev> Date: Thu, 18 Jun 2020 13:56:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <202006181048.05IAmcXI082275@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49nf5P4GFyz4WbT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 10:56:57 -0000 Fernando Apesteguía wrote: > Author: fernape (ports committer) > Date: Thu Jun 18 10:48:37 2020 > New Revision: 362318 > URL: https://svnweb.freebsd.org/changeset/base/362318 > > Log: > tee(1): Add EXAMPLES section > > Probably the simplest one ever. > > Approved by: gbe@, 0mp@ > Differential Revision: https://reviews.freebsd.org/D25206 > > Modified: > head/usr.bin/tee/tee.1 > > Modified: head/usr.bin/tee/tee.1 > ============================================================================== > --- head/usr.bin/tee/tee.1 Thu Jun 18 10:47:30 2020 (r362317) > +++ head/usr.bin/tee/tee.1 Thu Jun 18 10:48:37 2020 (r362318) > @@ -31,7 +31,7 @@ > .\" @(#)tee.1 8.1 (Berkeley) 6/6/93 > .\" $FreeBSD$ > .\" > -.Dd November 13, 2007 > +.Dd June 18, 2020 > .Dt TEE 1 > .Os > .Sh NAME > @@ -74,6 +74,12 @@ except in the event of the > option. > .Sh EXIT STATUS > .Ex -std > +.Sh EXAMPLES > +Send echoed message both to stdout and to the greetings file: Should this be like the following, at least to get the filename right? Send echoed message both to stdout and to the file .Pa greetings.txt : > +.Bd -literal -offset indent > +$ echo "Hello" | tee greetings.txt > +Hello > +.Ed > .Sh STANDARDS > The > .Nm > From owner-svn-src-all@freebsd.org Thu Jun 18 11:18:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51A3C34CF59; Thu, 18 Jun 2020 11:18:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nfZC1WMMz4Xmk; Thu, 18 Jun 2020 11:18:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F2588A65; Thu, 18 Jun 2020 11:18:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IBIRJH001556; Thu, 18 Jun 2020 11:18:27 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IBIRsg001555; Thu, 18 Jun 2020 11:18:27 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006181118.05IBIRsg001555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 18 Jun 2020 11:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362324 - head/usr.bin/fstat X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/fstat X-SVN-Commit-Revision: 362324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 11:18:27 -0000 Author: 0mp (doc,ports committer) Date: Thu Jun 18 11:18:26 2020 New Revision: 362324 URL: https://svnweb.freebsd.org/changeset/base/362324 Log: Clean up and improve manual page for fuser(1) - Mention option's arguments in the list of options (so that now we mention "-N system" instead of just "-N"). - Stylize signals and other constants like O_APPEND with Dv. - Sort options. - Change indentation width for readability. - Fix a couple of typos. - Sort symbols list. - Use Sy instead of Cm for symbols. They are not command modifiers. - Use Ex -std in the EXIT STATUS section for consistency with other manual pages. - Use Ql instead of Dq Li for inline code examples as Li has recently been deprecated by mdoc. Reviewed by: bcr MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25332 Modified: head/usr.bin/fstat/fuser.1 Modified: head/usr.bin/fstat/fuser.1 ============================================================================== --- head/usr.bin/fstat/fuser.1 Thu Jun 18 10:55:46 2020 (r362323) +++ head/usr.bin/fstat/fuser.1 Thu Jun 18 11:18:26 2020 (r362324) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2011 +.Dd June 18, 2020 .Dt FUSER 1 .Os .Sh NAME @@ -57,63 +57,63 @@ utility will also look through mmapped files. The following options are available: .Bl -tag -width indent .It Fl c -Treat files as mount point and report on any files open in the file system. +Treat files as mount points and report on any files open in the file system. .It Fl f The report must be only for named files. .It Fl k Send signal to reported processes -.Pq SIGKILL by default . -.It Fl m -Search through mmapped files too. -.It Fl u -Write the user name associated with each process to stderr. -.It Fl M +.Pq Dv SIGKILL No by default . +.It Fl M Ar core Extract values associated with the name list from the specified core instead of the default .Pa /dev/kmem . -.It Fl N +.It Fl m +Search through mmapped files too. +.It Fl N Ar system Extract the name list from the specified system instead of the default, which is the kernel image the system has booted from. -.It Fl s -Use given signal name instead of default SIGKILL. +.It Fl s Ar signal +Use given signal name instead of default +.Dv SIGKILL . +.It Fl u +Write the user name associated with each process to stderr. .El .Pp -The following symbols, written to stderr will indicate how files is used: -.Bl -tag -width MOUNT -.It Cm r -The file is the root directory of the process. -.It Cm c -The file is the current workdir directory of the process. -.It Cm j -The file is the jail-root of the process. -.It Cm t -The file is the kernel tracing file for the process. -.It Cm x -The file is executable text of the process. -.It Cm y -The process use this file as its controlling tty. -.It Cm m -The file is mmapped. -.It Cm w -The file is open for writing. -.It Cm a +The following symbols, written to stderr will indicate how files are used: +.Pp +.Bl -tag -width indent -compact +.It Sy a The file is open as append only -.Pq O_APPEND was specified . -.It Cm d +.Pq Dv O_APPEND No was specified . +.It Sy c +The file is the current workdir directory of the process. +.It Sy d The process bypasses fs cache while writing to this file -.Pq O_DIRECT was specified . -.It Cm s -Shared lock is hold. -.It Cm e +.Pq Dv O_DIRECT No was specified . +.It Sy e Exclusive lock is hold. +.It Sy j +The file is the jail root of the process. +.It Sy m +The file is mmapped. +.It Sy r +The file is the root directory of the process. +.It Sy s +Shared lock is hold. +.It Sy t +The file is the kernel tracing file for the process. +.It Sy w +The file is open for writing. +.It Sy x +The file is executable text of the process. +.It Sy y +The process uses this file as its controlling tty. .El .Sh EXIT STATUS -The -.Nm -utility returns 0 on successful completion and >0 otherwise. +.Ex -std .Sh EXAMPLES -The command: -.Dq Li "fuser -fu ." +The command +.Ql "fuser -fu \&." writes to standard output the process IDs of processes that are using the current directory and writes to stderr an indication of how those processes are using the directory and user names associated with the processes that are using From owner-svn-src-all@freebsd.org Thu Jun 18 11:32:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0B6234D164; Thu, 18 Jun 2020 11:32:33 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nftS3wRlz4Yhv; Thu, 18 Jun 2020 11:32:32 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-vs1-f46.google.com with SMTP id k13so3286247vsm.13; Thu, 18 Jun 2020 04:32:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4JqhJ4Ma75dRSCIDx6eNhmIqq02bDlXV/b9KEsg+XW8=; b=bcdBrwzCwXNXyb/FUNB/XwGUsVfXjko32duv9GtPwGSuMOMAT9Ls/eAbxTFxcN035A y10v3CT4MtR+arHllQ7Ivg8O5fKd/AOeFyUBFRuM6d8jQsOIG1rKSo2jCaFuQy41P0TQ osYwTekcEGlPWDb+0Jfu9Sdjt+QzvV19zWc/2LNePlseGqkFYkpHHpkYE+KCKnd4jh/E c/TN83cTrRpgfZfRS5oQ8cz4SM+NoqnYxCeglD9Zid6GWvqn7t0mEKbCq6BmPausgpts WB5s1DVR4J7my+NOcKgaWlyEI/k3apU5kbqPtyx4zVRsrebBM21nYGKz6hgA9rKaookf zVLg== X-Gm-Message-State: AOAM530cPffSclQYwZNA6D3egw6J4rW5rgcfhsu4b/Yh531UoE6uz6Sf Kvea832s3Qr9S+A1MWxMbBTd1MFji9c= X-Google-Smtp-Source: ABdhPJxdxehVYjqUW6IhASasarq/+LewSBSjiRBF8Bk+V4b7jRYEVc6fffUOMH6AHV+RYJXkS368Hg== X-Received: by 2002:a67:4383:: with SMTP id q125mr2696964vsa.167.1592479951179; Thu, 18 Jun 2020 04:32:31 -0700 (PDT) Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com. [209.85.217.47]) by smtp.gmail.com with ESMTPSA id h190sm288720vka.53.2020.06.18.04.32.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2020 04:32:30 -0700 (PDT) Received: by mail-vs1-f47.google.com with SMTP id t132so3307559vst.2; Thu, 18 Jun 2020 04:32:30 -0700 (PDT) X-Received: by 2002:a05:6102:2254:: with SMTP id e20mr2689983vsb.142.1592479950462; Thu, 18 Jun 2020 04:32:30 -0700 (PDT) MIME-Version: 1.0 References: <202006181048.05IAmcXI082275@repo.freebsd.org> <636fac36-30dd-42bf-02ab-4ebc5bf3a065@yuripv.dev> In-Reply-To: <636fac36-30dd-42bf-02ab-4ebc5bf3a065@yuripv.dev> From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Thu, 18 Jun 2020 14:32:00 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r362318 - head/usr.bin/tee To: Yuri Pankov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49nftS3wRlz4Yhv X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of fernandoapesteguia@gmail.com designates 209.85.217.46 as permitted sender) smtp.mailfrom=fernandoapesteguia@gmail.com X-Spamd-Result: default: False [4.94 / 15.00]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; SEM_URIBL_FRESH15(3.00)[yuripv.dev:email]; BAD_REP_POLICIES(0.10)[]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.20)[0.203]; NEURAL_SPAM_MEDIUM(0.71)[0.712]; NEURAL_SPAM_LONG(0.73)[0.725]; RCVD_IN_DNSWL_NONE(0.00)[209.85.217.46:from]; FORGED_SENDER(0.30)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.217.46:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 11:32:33 -0000 On Thu, Jun 18, 2020 at 12:56 PM Yuri Pankov wrote: > > Fernando Apestegu=C3=ADa wrote: > > Author: fernape (ports committer) > > Date: Thu Jun 18 10:48:37 2020 > > New Revision: 362318 > > URL: https://svnweb.freebsd.org/changeset/base/362318 > > > > Log: > > tee(1): Add EXAMPLES section > > > > Probably the simplest one ever. > > > > Approved by: gbe@, 0mp@ > > Differential Revision: https://reviews.freebsd.org/D25206 > > > > Modified: > > head/usr.bin/tee/tee.1 > > > > Modified: head/usr.bin/tee/tee.1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.bin/tee/tee.1 Thu Jun 18 10:47:30 2020 (r362317) > > +++ head/usr.bin/tee/tee.1 Thu Jun 18 10:48:37 2020 (r362318) > > @@ -31,7 +31,7 @@ > > .\" @(#)tee.1 8.1 (Berkeley) 6/6/93 > > .\" $FreeBSD$ > > .\" > > -.Dd November 13, 2007 > > +.Dd June 18, 2020 > > .Dt TEE 1 > > .Os > > .Sh NAME > > @@ -74,6 +74,12 @@ except in the event of the > > option. > > .Sh EXIT STATUS > > .Ex -std > > +.Sh EXAMPLES > > +Send echoed message both to stdout and to the greetings file: > > Should this be like the following, at least to get the filename right? > > Send echoed message both to stdout and to the file > .Pa greetings.txt : It is probably better. I'm not a src/docs committer. Do you want me to create a new review for thi= s? > > > +.Bd -literal -offset indent > > +$ echo "Hello" | tee greetings.txt > > +Hello > > +.Ed > > .Sh STANDARDS > > The > > .Nm > > > From owner-svn-src-all@freebsd.org Thu Jun 18 12:03:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBECB34EABD; Thu, 18 Jun 2020 12:03:15 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ngYv077Xz4bNx; Thu, 18 Jun 2020 12:03:14 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id o15so6084826ejm.12; Thu, 18 Jun 2020 05:03:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BlI0BeHuHgEVMztZ9r+zWXNDTN81WCysbhrxi+9a2E8=; b=Au9qt7Hv6LfrWL+oj0+4FhIAH3O9Uu8X/GUxBsF3I7jkCN7WLN+UReu4BmDfHcj6vO yAumYNqybsQJ7heyXU7p8KVi/Crmo5LXLQSPlu9u4u2lR0RVNkpYdpBgY2jpUWOv0T8m Xi+DcdtUjAd4xSdq3Ip111qY4nl3Qz1sH3nZCBGz+aiybhdCsyvNH5OVhvlx3RPS3umR KqXCOGrMOr9MD1yzPmwrP/oZs5GJwJ3Q9buPLa3rJSShCcid0tpDO3Bh1Mp4k8r9MLX6 8Tqqb9oxXNGJex03i4Fo4VOuNx/twwvQ2t28zRFCJNaa+0VziI40kaEWdiczTOehCdkk HEfA== X-Gm-Message-State: AOAM5315/GkbpVX2hPsoR3gerN1MG+LHiGGrfjrKaSPQaJdAdGFt9iXr h7I1SMgKyIxRbKm+pkxipBL5PGsF X-Google-Smtp-Source: ABdhPJzAorrH+z06dDizCSyEbEolnFlO0Hi2u8fEHtfGQIWx32w0elcTQp2mHIUI9uYQnYFurPqRqw== X-Received: by 2002:a17:906:ca4e:: with SMTP id jx14mr3501963ejb.285.1592481793079; Thu, 18 Jun 2020 05:03:13 -0700 (PDT) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id k10sm2160668ejs.108.2020.06.18.05.03.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2020 05:03:12 -0700 (PDT) Subject: Re: svn commit: r362318 - head/usr.bin/tee To: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= , Yuri Pankov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006181048.05IAmcXI082275@repo.freebsd.org> <636fac36-30dd-42bf-02ab-4ebc5bf3a065@yuripv.dev> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: <49aa8040-2e71-8421-09af-4cedb6da47cc@FreeBSD.org> Date: Thu, 18 Jun 2020 14:03:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49ngYv077Xz4bNx X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [5.47 / 15.00]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:209.85.128.0/17]; NEURAL_SPAM_SHORT(0.50)[0.498]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; ARC_NA(0.00)[]; SEM_URIBL_FRESH15(3.00)[yuripv.dev:email]; RCPT_COUNT_FIVE(0.00)[5]; BAD_REP_POLICIES(0.10)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.77)[0.768]; NEURAL_SPAM_LONG(0.90)[0.902]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.50:from]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.50:from]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 12:03:15 -0000 On 6/18/20 2:32 PM, Fernando Apesteguía wrote: > On Thu, Jun 18, 2020 at 12:56 PM Yuri Pankov wrote: >> >> Fernando Apesteguía wrote: >>> Author: fernape (ports committer) >>> Date: Thu Jun 18 10:48:37 2020 >>> New Revision: 362318 >>> URL: https://svnweb.freebsd.org/changeset/base/362318 >>> >>> Log: >>> tee(1): Add EXAMPLES section [...] >>> +Send echoed message both to stdout and to the greetings file: >> >> Should this be like the following, at least to get the filename right? >> >> Send echoed message both to stdout and to the file >> .Pa greetings.txt : > > It is probably better. > > I'm not a src/docs committer. Do you want me to create a new review for this? Please do, feel free to add me as a reviewer :) From owner-svn-src-all@freebsd.org Thu Jun 18 12:24:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3936334F259; Thu, 18 Jun 2020 12:24:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nh1v6cmjz4cWW; Thu, 18 Jun 2020 12:24:03 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f68.google.com with SMTP id o5so6733714iow.8; Thu, 18 Jun 2020 05:24:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eFeoDwj03nEA/2f1pYz6nZQNnEKFF2pKCTCVW/9WE8c=; b=eATTcriK/5SFuYoNGDWXb/y7SPqeSDjLlFrM/7XbrhhdQb2roze5MUznL8UyqvRyZB qOtbo3+CU/DC/tX1bMte5L/FyWxA3iLO3kHGhqQNEqbn2GDL8dTuuJ6pinWgiNGjVpHV lmwIHFFIi8gWYa56LsytqSvyX8uwb4OyUou4ekLN6C7064seUbCQp1KeH+IHrLGXwn5S 9XXKn5wo7qpTfjRs+4y/7K4mk9VeTZ86N1i3+WpFcL/3KrQuB4hNLk9mmUZ5ZFyDXBi4 wtqrXXrNdQTUi/TlaOEfGMCleilI9g+iWyMhKYguK5GH6wC79R0747XNwNoEs56Z8k67 j1Tg== X-Gm-Message-State: AOAM533ofmdvA7pbn97EAnoPAcDDi/3WFu/V/tmmcn+Fg0Pky+6dkMEZ Im23YndXbFn5rvpZJ+IlT5t+gRolr3035ChEMqnqQIk8rrE= X-Google-Smtp-Source: ABdhPJzJuViAlWDU8QlXy8o89E0Tf33zRB5WArK5hNc1VflIg3bXA8RCHbyTvpW0TXzoB72osBujD99kNZuODiz5HdA= X-Received: by 2002:a6b:b252:: with SMTP id b79mr4670504iof.31.1592483041274; Thu, 18 Jun 2020 05:24:01 -0700 (PDT) MIME-Version: 1.0 References: <202006171956.05HJuH8B032154@repo.freebsd.org> In-Reply-To: <202006171956.05HJuH8B032154@repo.freebsd.org> From: Ed Maste Date: Thu, 18 Jun 2020 08:23:49 -0400 Message-ID: Subject: Re: svn commit: r362285 - head/sys/dev/pci To: Andrew Turner Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49nh1v6cmjz4cWW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 12:24:04 -0000 On Wed, 17 Jun 2020 at 15:56, Andrew Turner wrote: > > Author: andrew > Date: Wed Jun 17 19:56:17 2020 > New Revision: 362285 > URL: https://svnweb.freebsd.org/changeset/base/362285 > > Log: > Clean up the pci host generic driver ... > > + /* Translate the address from a PCI address to a physical address */ > + switch (type) { > + case SYS_RES_IOPORT: > + case SYS_RES_MEMORY: > + found = false; > + for (i = 0; i < MAX_RANGES_TUPLES; i++) { > + pci_base = sc->ranges[i].pci_base; > + phys_base = sc->ranges[i].phys_base; > + size = sc->ranges[i].size; > + > + if (start < pci_base || start >= pci_base + size) > + continue; Should the second condition be end instead? markj had this comment on the old version in review D20884. From owner-svn-src-all@freebsd.org Thu Jun 18 12:29:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B91CE34F1E9; Thu, 18 Jun 2020 12:29:24 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nh844X11z4cmC; Thu, 18 Jun 2020 12:29:24 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 969879AA3; Thu, 18 Jun 2020 12:29:24 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05ICTOaw044184; Thu, 18 Jun 2020 12:29:24 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05ICTO6Z044183; Thu, 18 Jun 2020 12:29:24 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006181229.05ICTO6Z044183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 18 Jun 2020 12:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362325 - head/usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.sbin/efivar X-SVN-Commit-Revision: 362325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 12:29:24 -0000 Author: 0mp (doc,ports committer) Date: Thu Jun 18 12:29:24 2020 New Revision: 362325 URL: https://svnweb.freebsd.org/changeset/base/362325 Log: Fix the --guid flag description MFC after: 2 weeks Modified: head/usr.sbin/efivar/efivar.8 Modified: head/usr.sbin/efivar/efivar.8 ============================================================================== --- head/usr.sbin/efivar/efivar.8 Thu Jun 18 11:18:26 2020 (r362324) +++ head/usr.sbin/efivar/efivar.8 Thu Jun 18 12:29:24 2020 (r362325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2019 +.Dd June 18, 2020 .Dt EFIVAR 8 .Os .Sh NAME @@ -132,9 +132,10 @@ may be specified. Interpret the variables printed as UEFI device paths and print the UEFI standard string representation. .It Fl g Fl -guid -flag is specified, guids are converted to names if they are known (and -show up in -.Fl -list-guids ). +Convert GUIDs to names if they are known +.Po and show them up in +.Fl -list-guids +.Pc . .It Fl H Fl -hex List variable data as a hex dump. .It Fl L Fl -list-guids From owner-svn-src-all@freebsd.org Thu Jun 18 12:48:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C26F234FB92 for ; Thu, 18 Jun 2020 12:48:47 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nhZR099Gz4fC4 for ; Thu, 18 Jun 2020 12:48:46 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f54.google.com with SMTP id q11so5941929wrp.3 for ; Thu, 18 Jun 2020 05:48:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=f+ZAqsfT0/F8kfTd1pjPB9MSd0DOvFSPOpbE+asyVqQ=; b=sPvnV5/kDkdBgAYo4vFJg2JHFwpibbnwUuA3egUZaPFHCSAd5G0pgWmne25iwYkyNd YOR/F5GJxf/tyYTW5+OMOmVKgVtshOFG/9zX4OszgR/Znw1R0SyIUR3AfH4I0shr3sOY d6hmEXzTRevizc5ehwv7F7brFQc4n7fqHjGG4tP40w/I/Oqfd3pi/Z8U+HPiKCK15ghe YzotRTDYrPccYngDOtsaeH3idOl+94+xHjDmQ3iWo0STSHIk/V7bb8fXSn7h7xRhhxpg bKMJuY+VM7kHX9S2Zsn5IRJV4QIOLVL/Z56VBwmPbDVb2+w3Qa5ANgDN5rrn6hnffd6f /aHg== X-Gm-Message-State: AOAM531rOoJ/itSkIgrCZBXsopmZB6WMLeWCIKZFQvtzNCVuPD9Ag2DA PtMIcdQkpwEYYB1QWFb8/IZP5Q== X-Google-Smtp-Source: ABdhPJw2c5/CuotaxEANOVt2taVIMBylnOlseCB+Braxc+WR/XVuyCF79TQ9aMRllfs8De2Ch0QQmA== X-Received: by 2002:a5d:67c8:: with SMTP id n8mr4451813wrw.343.1592484525512; Thu, 18 Jun 2020 05:48:45 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id o10sm3460706wrj.37.2020.06.18.05.48.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2020 05:48:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r362285 - head/sys/dev/pci From: Jessica Clarke In-Reply-To: Date: Thu, 18 Jun 2020 13:48:43 +0100 Cc: Andrew Turner , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <831631E9-2F54-4E5F-950A-B923B0A3DADA@freebsd.org> References: <202006171956.05HJuH8B032154@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49nhZR099Gz4fC4 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.59 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.97)[-0.970]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.12)[-0.121]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.54:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.002]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.54:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 12:48:47 -0000 On 18 Jun 2020, at 13:23, Ed Maste wrote: > On Wed, 17 Jun 2020 at 15:56, Andrew Turner = wrote: >>=20 >> Author: andrew >> Date: Wed Jun 17 19:56:17 2020 >> New Revision: 362285 >> URL: https://svnweb.freebsd.org/changeset/base/362285 >>=20 >> Log: >> Clean up the pci host generic driver > ... >>=20 >> + /* Translate the address from a PCI address to a physical = address */ >> + switch (type) { >> + case SYS_RES_IOPORT: >> + case SYS_RES_MEMORY: >> + found =3D false; >> + for (i =3D 0; i < MAX_RANGES_TUPLES; i++) { >> + pci_base =3D sc->ranges[i].pci_base; >> + phys_base =3D sc->ranges[i].phys_base; >> + size =3D sc->ranges[i].size; >> + >> + if (start < pci_base || start >=3D pci_base + = size) >> + continue; >=20 > Should the second condition be end instead? markj had this comment on > the old version in review D20884. The code previously had: > if ((rman_get_start(r) >=3D pci_base) && (rman_get_start(r) < = (pci_base + size))) > found =3D 1; > break; > } The new code is just the inverted form of that. Jess From owner-svn-src-all@freebsd.org Thu Jun 18 13:13:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85AF235053A; Thu, 18 Jun 2020 13:13:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nj6T330gz4h25; Thu, 18 Jun 2020 13:13:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63A58A314; Thu, 18 Jun 2020 13:13:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IDD56u074036; Thu, 18 Jun 2020 13:13:05 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IDD5ME074035; Thu, 18 Jun 2020 13:13:05 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006181313.05IDD5ME074035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 18 Jun 2020 13:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362326 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 362326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 13:13:05 -0000 Author: gbe (doc committer) Date: Thu Jun 18 13:13:04 2020 New Revision: 362326 URL: https://svnweb.freebsd.org/changeset/base/362326 Log: fgetln(3): Add a Caveats Section Reviewed by: yuripv, bcr (mentor) Approved by: bcr (mentror) Obtained from: OpenBSD MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D24916 Modified: head/lib/libc/stdio/fgetln.3 Modified: head/lib/libc/stdio/fgetln.3 ============================================================================== --- head/lib/libc/stdio/fgetln.3 Thu Jun 18 12:29:24 2020 (r362325) +++ head/lib/libc/stdio/fgetln.3 Thu Jun 18 13:13:04 2020 (r362326) @@ -28,7 +28,7 @@ .\" @(#)fgetln.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 15, 2016 +.Dd June 11, 2020 .Dt FGETLN 3 .Os .Sh NAME @@ -126,3 +126,33 @@ The .Fn fgetln function first appeared in .Bx 4.4 . +.Sh CAVEATS +Since the returned buffer is not a C string (it is not NUL terminated), a +common practice is to replace the newline character with +.Sq \e0 . +However, if the last line in a file does not contain a newline, +the returned text won't contain a newline either. +The following code demonstrates how to deal with this problem by allocating a +temporary buffer: +.Bd -literal + char *buf, *lbuf; + size_t len; + + lbuf = NULL; + while ((buf = fgetln(fp, &len)) != NULL) { + if (buf[len - 1] == '\en') + buf[len - 1] = '\e0'; + else { + /* EOF without EOL, copy and add the NUL */ + if ((lbuf = malloc(len + 1)) == NULL) + err(1, NULL); + memcpy(lbuf, buf, len); + lbuf[len] = '\e0'; + buf = lbuf; + } + printf("%s\en", buf); + } + free(lbuf); + if (ferror(fp)) + err(1, "fgetln"); +.Ed From owner-svn-src-all@freebsd.org Thu Jun 18 13:19:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AAD33506CA; Thu, 18 Jun 2020 13:19:58 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49njGQ0RBMz4hXd; Thu, 18 Jun 2020 13:19:58 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E09A99CDF; Thu, 18 Jun 2020 13:19:57 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IDJvB1074414; Thu, 18 Jun 2020 13:19:57 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IDJvZc074411; Thu, 18 Jun 2020 13:19:57 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202006181319.05IDJvZc074411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 18 Jun 2020 13:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362327 - in head/usr.bin: banner basename limits vmstat X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head/usr.bin: banner basename limits vmstat X-SVN-Commit-Revision: 362327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 13:19:58 -0000 Author: gbe (doc committer) Date: Thu Jun 18 13:19:56 2020 New Revision: 362327 URL: https://svnweb.freebsd.org/changeset/base/362327 Log: Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8) Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D25019 Modified: head/usr.bin/banner/banner.6 head/usr.bin/basename/basename.1 head/usr.bin/limits/limits.1 head/usr.bin/vmstat/vmstat.8 Modified: head/usr.bin/banner/banner.6 ============================================================================== --- head/usr.bin/banner/banner.6 Thu Jun 18 13:13:04 2020 (r362326) +++ head/usr.bin/banner/banner.6 Thu Jun 18 13:19:56 2020 (r362327) @@ -28,7 +28,7 @@ .\" From: @(#)banner.6 8.2 (Berkeley) 4/29/95 .\" $FreeBSD$ .\" -.Dd January 26, 2005 +.Dd May 26, 2020 .Dt BANNER 6 .Os .Sh NAME @@ -60,6 +60,11 @@ Change the output from a width of 132 to .Ar width , suitable for a narrow terminal. .El +.Sh HISTORY +The +.Nm +utility first appeared in +.Bx 4.4 . .Sh AUTHORS .An Mark Horton .Sh BUGS Modified: head/usr.bin/basename/basename.1 ============================================================================== --- head/usr.bin/basename/basename.1 Thu Jun 18 13:13:04 2020 (r362326) +++ head/usr.bin/basename/basename.1 Thu Jun 18 13:19:56 2020 (r362327) @@ -31,7 +31,7 @@ .\" @(#)basename.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 18, 1994 +.Dd May 26, 2020 .Dt BASENAME 1 .Os .Sh NAME @@ -111,3 +111,10 @@ and utilities are expected to be .St -p1003.2 compatible. +.Sh HISTORY +The +.Nm +and +.Nm dirname +utilities first appeared in +.Bx 4.4 . Modified: head/usr.bin/limits/limits.1 ============================================================================== --- head/usr.bin/limits/limits.1 Thu Jun 18 13:13:04 2020 (r362326) +++ head/usr.bin/limits/limits.1 Thu Jun 18 13:19:56 2020 (r362327) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2018 +.Dd May 26, 2020 .Dt LIMITS 1 .Os .Sh NAME @@ -387,6 +387,16 @@ will be whatever the executed program returns. .Xr login.conf 5 , .Xr rctl 8 , .Xr sysctl 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 2.1.7 . +.Sh AUTHORS +The +.Nm +utility was written by +.An David Nugent Aq Mt davidn@FreeBSD.org . .Sh BUGS The .Nm Modified: head/usr.bin/vmstat/vmstat.8 ============================================================================== --- head/usr.bin/vmstat/vmstat.8 Thu Jun 18 13:13:04 2020 (r362326) +++ head/usr.bin/vmstat/vmstat.8 Thu Jun 18 13:19:56 2020 (r362327) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 18, 2018 +.Dd May 26, 2020 .Dt VMSTAT 8 .Os .Sh NAME @@ -385,6 +385,11 @@ statistics every second. .Pp The sections starting with ``Interpreting system activity'' in .%T "Installing and Operating 4.3BSD" . +.Sh HISTORY +The +.Nm +utility first appeared in +.Bx 4.3 . .Sh BUGS The .Fl c From owner-svn-src-all@freebsd.org Thu Jun 18 14:36:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26ECA351E3B; Thu, 18 Jun 2020 14:36:13 +0000 (UTC) (envelope-from roger.pau@citrix.com) Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "esa6.hc3370-68.iphmx.com", Issuer "HydrantID SSL ICA G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nkyM6JmKz4mVB; Thu, 18 Jun 2020 14:36:11 +0000 (UTC) (envelope-from roger.pau@citrix.com) IronPort-SDR: 8U1E6oqFpgieEIuIDFa8RawLFyltdj4v68sDgCg2EBQuVRoshu5zYR2vKDZWMnUN2oOoqLFh3X N4VLwenolt1i5T74385bOjYUKR/MvSVNRv6ue83JWSFdFAfROH+aGfkefIi6Pas7XwWk1mJGpF 32x//BZX3BU8QbZ90cBqoGo/U7NEpGdStlsJe1cirxnvpFLf9wsosN7vpa7D0Ci/hYHoTxzaPD ooGnyj3+pSPcaCmCE4TEq9v2DU9W+jAaNZapvD2KYCKcsW+OhxZ2n+F4zzSDXmwHrs5VwIZJQU VQg= X-SBRS: 2.7 X-MesageID: 20724012 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,526,1583211600"; d="scan'208";a="20724012" Date: Thu, 18 Jun 2020 16:36:02 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Pawel Jakub Dawidek CC: , , Subject: Re: svn commit: r345726 - head/sys/dev/xen/blkfront Message-ID: <20200618143602.GE711@Air-de-Roger> References: <201903300720.x2U7KSmN086902@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <201903300720.x2U7KSmN086902@repo.freebsd.org> X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 49nkyM6JmKz4mVB X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=citrix.com; spf=pass (mx1.freebsd.org: domain of roger.pau@citrix.com designates 216.71.155.175 as permitted sender) smtp.mailfrom=roger.pau@citrix.com X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.004]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.976]; RCVD_IN_DNSWL_MED(-0.20)[216.71.155.175:from]; DMARC_POLICY_ALLOW(-0.50)[citrix.com,none]; NEURAL_HAM_SHORT(-0.65)[-0.647]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16417, ipnet:216.71.154.0/23, country:US]; MID_RHS_NOT_FQDN(0.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 14:36:13 -0000 On Sat, Mar 30, 2019 at 07:20:28AM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Sat Mar 30 07:20:28 2019 > New Revision: 345726 > URL: https://svnweb.freebsd.org/changeset/base/345726 > > Log: > Implement support for online disk capacity changes. > > Obtained from: Fudo Security > Tested in: AWS This breaks on i386 because the size of sectors is not wide enough and the calculation of d_mediasize is truncated. The fix is in r361579. Roger. From owner-svn-src-all@freebsd.org Thu Jun 18 15:14:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C5FD352D72; Thu, 18 Jun 2020 15:14:11 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nlpB6LCdz4qGf; Thu, 18 Jun 2020 15:14:10 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D462EB7F2; Thu, 18 Jun 2020 15:14:10 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IFEAC9048478; Thu, 18 Jun 2020 15:14:10 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IFEA1a048477; Thu, 18 Jun 2020 15:14:10 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006181514.05IFEA1a048477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Thu, 18 Jun 2020 15:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362328 - head/usr.bin/split X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/split X-SVN-Commit-Revision: 362328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 15:14:11 -0000 Author: fernape (ports committer) Date: Thu Jun 18 15:14:10 2020 New Revision: 362328 URL: https://svnweb.freebsd.org/changeset/base/362328 Log: split(1): Add EXAMPLES section Add EXAMPLES covering -d, -n and -p Include small explanation about the size of the chunks for the -n option Approved by: 0mp Differential Revision: https://reviews.freebsd.org/D25198 Modified: head/usr.bin/split/split.1 Modified: head/usr.bin/split/split.1 ============================================================================== --- head/usr.bin/split/split.1 Thu Jun 18 13:19:56 2020 (r362327) +++ head/usr.bin/split/split.1 Thu Jun 18 15:14:10 2020 (r362328) @@ -122,6 +122,12 @@ lines in length. Split file into .Ar chunk_count smaller files. +The first n - 1 files will be of size (size of +.Ar file +/ +.Ar chunk_count +) +and the last file will contain the remaining bytes. .It Fl p Ar pattern The file is split whenever an input line matches .Ar pattern , @@ -164,6 +170,36 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Split input into as many files as needed, so that each file contains at most 2 +lines: +.Bd -literal -offset indent +$ echo -e "first line\\nsecond line\\nthird line\\nforth line" | split -l2 +.Ed +.Pp +Split input in chunks of 10 bytes using numeric prefixes for file names. +This generates two files of 10 bytes (x00 and x01) and a third file (x02) with the +remaining 2 bytes: +.Bd -literal -offset indent +$ echo -e "This is 22 bytes long" | split -d -b10 +.Ed +.Pp +Split input generating 6 files: +.Bd -literal -offset indent +echo -e "This is 22 bytes long" | split -n 6 +.Ed +.Pp +Split input creating a new file every time a line matches the regular expression +for a +.Dq t +followed by either +.Dq a +or +.Dq u +thus creating two files: +.Bd -literal -offset indent +$ echo -e "stack\\nstock\\nstuck\\nanother line" | split -p 't[au]' +.Ed .Sh SEE ALSO .Xr csplit 1 , .Xr re_format 7 From owner-svn-src-all@freebsd.org Thu Jun 18 15:15:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECB41353213; Thu, 18 Jun 2020 15:15:06 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nlqF443lz4qcl; Thu, 18 Jun 2020 15:15:05 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DDF4B7F9; Thu, 18 Jun 2020 15:15:05 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IFF5iV048731; Thu, 18 Jun 2020 15:15:05 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IFF4m1048727; Thu, 18 Jun 2020 15:15:04 GMT (envelope-from royger@FreeBSD.org) Message-Id: <202006181515.05IFF4m1048727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 18 Jun 2020 15:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362329 - in stable/12/sys: dev/xen/console dev/xen/control dev/xen/evtchn x86/xen X-SVN-Group: stable-12 X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in stable/12/sys: dev/xen/console dev/xen/control dev/xen/evtchn x86/xen X-SVN-Commit-Revision: 362329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 15:15:09 -0000 Author: royger Date: Thu Jun 18 15:15:04 2020 New Revision: 362329 URL: https://svnweb.freebsd.org/changeset/base/362329 Log: MFC r352925: xen/ctrl: acknowledge all control requests MFC r357616: xen/console: fix priority of Xen console MFC r361274: dev/xenstore: fix return with locks held Note this should be dev/evtchn not dev/xenstore. MFC r361578: xenpv: do not use low 1MB for Xen mappings on i386 MFC r361580: xen/control: short circuit xctrl_on_watch_event on spurious event Those are all Xen related fixes or minor improvements that have been sitting on current for a reasonable time without complaints. Sponsored by: Citrix Systems R&D Modified: stable/12/sys/dev/xen/console/xen_console.c stable/12/sys/dev/xen/control/control.c stable/12/sys/dev/xen/evtchn/evtchn_dev.c stable/12/sys/x86/xen/xenpv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/xen/console/xen_console.c ============================================================================== --- stable/12/sys/dev/xen/console/xen_console.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/dev/xen/console/xen_console.c Thu Jun 18 15:15:04 2020 (r362329) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -589,7 +590,7 @@ xencons_cnprobe(struct consdev *cp) if (!xen_domain()) return; - cp->cn_pri = CN_REMOTE; + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; sprintf(cp->cn_name, "%s0", driver_name); } Modified: stable/12/sys/dev/xen/control/control.c ============================================================================== --- stable/12/sys/dev/xen/control/control.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/dev/xen/control/control.c Thu Jun 18 15:15:04 2020 (r362329) @@ -221,12 +221,6 @@ xctrl_suspend() KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0")); /* - * Clear our XenStore node so the toolstack knows we are - * responding to the suspend request. - */ - xs_write(XST_NIL, "control", "shutdown", ""); - - /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE * drivers need this. */ @@ -366,8 +360,13 @@ xctrl_on_watch_event(struct xs_watch *watch, const cha error = xs_read(XST_NIL, "control", "shutdown", &result_len, (void **)&result); - if (error != 0) + if (error != 0 || result_len == 0) return; + + /* Acknowledge the request by writing back an empty string. */ + error = xs_write(XST_NIL, "control", "shutdown", ""); + if (error != 0) + printf("unable to ack shutdown request, proceeding anyway\n"); reason = xctrl_shutdown_reasons; last_reason = reason + nitems(xctrl_shutdown_reasons); Modified: stable/12/sys/dev/xen/evtchn/evtchn_dev.c ============================================================================== --- stable/12/sys/dev/xen/evtchn/evtchn_dev.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/dev/xen/evtchn/evtchn_dev.c Thu Jun 18 15:15:04 2020 (r362329) @@ -261,9 +261,10 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof sx_xlock(&u->ring_cons_mutex); for (;;) { - error = EFBIG; - if (u->ring_overflow) + if (u->ring_overflow) { + error = EFBIG; goto unlock_out; + } c = u->ring_cons; p = u->ring_prod; @@ -271,13 +272,13 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof break; if (ioflag & IO_NDELAY) { - sx_xunlock(&u->ring_cons_mutex); - return (EWOULDBLOCK); + error = EWOULDBLOCK; + goto unlock_out; } error = sx_sleep(u, &u->ring_cons_mutex, PCATCH, "evtchw", 0); if ((error != 0) && (error != EWOULDBLOCK)) - return (error); + goto unlock_out; } /* Byte lengths of two chunks. Chunk split (if any) is at ring wrap. */ Modified: stable/12/sys/x86/xen/xenpv.c ============================================================================== --- stable/12/sys/x86/xen/xenpv.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/x86/xen/xenpv.c Thu Jun 18 15:15:04 2020 (r362329) @@ -54,12 +54,14 @@ __FBSDID("$FreeBSD$"); * prevent clashes with MMIO/ACPI regions. * * Since this is not possible on i386 just use any available memory - * chunk and hope we don't clash with anything else. + * chunk above 1MB and hope we don't clash with anything else. */ #ifdef __amd64__ #define LOW_MEM_LIMIT 0x100000000ul +#elif defined(__i386__) +#define LOW_MEM_LIMIT 0x100000ul #else -#define LOW_MEM_LIMIT 0 +#error "Unsupported architecture" #endif static devclass_t xenpv_devclass; From owner-svn-src-all@freebsd.org Thu Jun 18 15:41:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B694353B88; Thu, 18 Jun 2020 15:41:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nmPT1lj1z4rt1; Thu, 18 Jun 2020 15:41:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37899C032; Thu, 18 Jun 2020 15:41:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IFfHJl063980; Thu, 18 Jun 2020 15:41:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IFfH9P063979; Thu, 18 Jun 2020 15:41:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202006181541.05IFfH9P063979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 18 Jun 2020 15:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362330 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 362330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 15:41:17 -0000 Author: trasz Date: Thu Jun 18 15:41:16 2020 New Revision: 362330 URL: https://svnweb.freebsd.org/changeset/base/362330 Log: Make audit tests depend on /dev/auditpipe. This should fix some 416 failing tests on armv7: https://ci.freebsd.org/job/FreeBSD-head-armv7-test/lastCompletedBuild/testReport/ Reviewed by: asomers MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25144 Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Thu Jun 18 15:15:04 2020 (r362329) +++ head/tests/sys/audit/Makefile Thu Jun 18 15:41:16 2020 (r362330) @@ -49,7 +49,7 @@ SRCS.miscellaneous+= utils.c TEST_METADATA+= timeout="30" TEST_METADATA+= required_user="root" TEST_METADATA+= is_exclusive="true" -TEST_METADATA+= required_files="/etc/rc.d/auditd" +TEST_METADATA+= required_files="/etc/rc.d/auditd /dev/auditpipe" WARNS?= 6 From owner-svn-src-all@freebsd.org Thu Jun 18 15:44:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DE22353AC7; Thu, 18 Jun 2020 15:44:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nmTP2H5Pz4sKk; Thu, 18 Jun 2020 15:44:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49693C1B3; Thu, 18 Jun 2020 15:44:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IFifYN067781; Thu, 18 Jun 2020 15:44:41 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IFie34067776; Thu, 18 Jun 2020 15:44:40 GMT (envelope-from royger@FreeBSD.org) Message-Id: <202006181544.05IFie34067776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 18 Jun 2020 15:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362331 - in stable/11/sys: dev/xen/console dev/xen/control dev/xen/evtchn x86/xen X-SVN-Group: stable-11 X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in stable/11/sys: dev/xen/console dev/xen/control dev/xen/evtchn x86/xen X-SVN-Commit-Revision: 362331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 15:44:41 -0000 Author: royger Date: Thu Jun 18 15:44:40 2020 New Revision: 362331 URL: https://svnweb.freebsd.org/changeset/base/362331 Log: MFC r352925: xen/ctrl: acknowledge all control requests MFC r357616: xen/console: fix priority of Xen console MFC r361274: dev/xenstore: fix return with locks held Note this should be dev/evtchn not dev/xenstore. MFC r361578: xenpv: do not use low 1MB for Xen mappings on i386 MFC r361580: xen/control: short circuit xctrl_on_watch_event on spurious event Those are all Xen related fixes or minor improvements that have been sitting on current for a reasonable time without complaints. Sponsored by: Citrix Systems R&D Modified: stable/11/sys/dev/xen/console/xen_console.c stable/11/sys/dev/xen/control/control.c stable/11/sys/dev/xen/evtchn/evtchn_dev.c stable/11/sys/x86/xen/xenpv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/xen/console/xen_console.c ============================================================================== --- stable/11/sys/dev/xen/console/xen_console.c Thu Jun 18 15:41:16 2020 (r362330) +++ stable/11/sys/dev/xen/console/xen_console.c Thu Jun 18 15:44:40 2020 (r362331) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -592,7 +593,7 @@ xencons_cnprobe(struct consdev *cp) if (!xen_pv_domain()) return; - cp->cn_pri = CN_REMOTE; + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; sprintf(cp->cn_name, "%s0", driver_name); } Modified: stable/11/sys/dev/xen/control/control.c ============================================================================== --- stable/11/sys/dev/xen/control/control.c Thu Jun 18 15:41:16 2020 (r362330) +++ stable/11/sys/dev/xen/control/control.c Thu Jun 18 15:44:40 2020 (r362331) @@ -219,12 +219,6 @@ xctrl_suspend() KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0")); /* - * Clear our XenStore node so the toolstack knows we are - * responding to the suspend request. - */ - xs_write(XST_NIL, "control", "shutdown", ""); - - /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE * drivers need this. */ @@ -364,8 +358,13 @@ xctrl_on_watch_event(struct xs_watch *watch, const cha error = xs_read(XST_NIL, "control", "shutdown", &result_len, (void **)&result); - if (error != 0) + if (error != 0 || result_len == 0) return; + + /* Acknowledge the request by writing back an empty string. */ + error = xs_write(XST_NIL, "control", "shutdown", ""); + if (error != 0) + printf("unable to ack shutdown request, proceeding anyway\n"); reason = xctrl_shutdown_reasons; last_reason = reason + nitems(xctrl_shutdown_reasons); Modified: stable/11/sys/dev/xen/evtchn/evtchn_dev.c ============================================================================== --- stable/11/sys/dev/xen/evtchn/evtchn_dev.c Thu Jun 18 15:41:16 2020 (r362330) +++ stable/11/sys/dev/xen/evtchn/evtchn_dev.c Thu Jun 18 15:44:40 2020 (r362331) @@ -261,9 +261,10 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof sx_xlock(&u->ring_cons_mutex); for (;;) { - error = EFBIG; - if (u->ring_overflow) + if (u->ring_overflow) { + error = EFBIG; goto unlock_out; + } c = u->ring_cons; p = u->ring_prod; @@ -271,13 +272,13 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof break; if (ioflag & IO_NDELAY) { - sx_xunlock(&u->ring_cons_mutex); - return (EWOULDBLOCK); + error = EWOULDBLOCK; + goto unlock_out; } error = sx_sleep(u, &u->ring_cons_mutex, PCATCH, "evtchw", 0); if ((error != 0) && (error != EWOULDBLOCK)) - return (error); + goto unlock_out; } /* Byte lengths of two chunks. Chunk split (if any) is at ring wrap. */ Modified: stable/11/sys/x86/xen/xenpv.c ============================================================================== --- stable/11/sys/x86/xen/xenpv.c Thu Jun 18 15:41:16 2020 (r362330) +++ stable/11/sys/x86/xen/xenpv.c Thu Jun 18 15:44:40 2020 (r362331) @@ -54,12 +54,14 @@ __FBSDID("$FreeBSD$"); * prevent clashes with MMIO/ACPI regions. * * Since this is not possible on i386 just use any available memory - * chunk and hope we don't clash with anything else. + * chunk above 1MB and hope we don't clash with anything else. */ #ifdef __amd64__ #define LOW_MEM_LIMIT 0x100000000ul +#elif defined(__i386__) +#define LOW_MEM_LIMIT 0x100000ul #else -#define LOW_MEM_LIMIT 0 +#error "Unsupported architecture" #endif static devclass_t xenpv_devclass; From owner-svn-src-all@freebsd.org Thu Jun 18 16:22:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BC89354A0C; Thu, 18 Jun 2020 16:22:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nnJf1qwXz4vvh; Thu, 18 Jun 2020 16:22:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A028C99E; Thu, 18 Jun 2020 16:22:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IGMA4L091450; Thu, 18 Jun 2020 16:22:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IGMAvQ091449; Thu, 18 Jun 2020 16:22:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006181622.05IGMAvQ091449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Jun 2020 16:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362332 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 362332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 16:22:10 -0000 Author: tuexen Date: Thu Jun 18 16:22:09 2020 New Revision: 362332 URL: https://svnweb.freebsd.org/changeset/base/362332 Log: Whitespace changes, not functional change intended. MFC after: 1 week Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Thu Jun 18 15:44:40 2020 (r362331) +++ head/lib/libc/net/sctp_sys_calls.c Thu Jun 18 16:22:09 2020 (r362332) @@ -100,7 +100,7 @@ sctp_getaddrlen(sa_family_t family) int sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt, - sctp_assoc_t * id) + sctp_assoc_t *id) { char *buf; int i, ret, *aa; @@ -159,9 +159,9 @@ sctp_connectx(int sd, const struct sockaddr *addrs, in aa = (int *)buf; *aa = addrcnt; ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X, (void *)buf, - (socklen_t) len); + (socklen_t)len); if ((ret == 0) && (id != NULL)) { - *id = *(sctp_assoc_t *) buf; + *id = *(sctp_assoc_t *)buf; } free(buf); return (ret); @@ -269,7 +269,7 @@ sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt } } if (setsockopt(sd, IPPROTO_SCTP, flags, gaddrs, - (socklen_t) argsz) != 0) { + (socklen_t)argsz) != 0) { free(gaddrs); return (-1); } @@ -280,7 +280,7 @@ sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt } int -sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size) +sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t *size) { if (arg == NULL) { errno = EINVAL; @@ -409,13 +409,13 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockadd return (-1); } asoc = id; - opt_len = (socklen_t) sizeof(sctp_assoc_t); + opt_len = (socklen_t)sizeof(sctp_assoc_t); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE, &asoc, &opt_len) != 0) { return (-1); } /* size required is returned in 'asoc' */ - opt_len = (socklen_t) ((size_t)asoc + sizeof(sctp_assoc_t)); + opt_len = (socklen_t)((size_t)asoc + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; @@ -465,7 +465,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockadd return (-1); } size_of_addresses = 0; - opt_len = (socklen_t) sizeof(int); + opt_len = (socklen_t)sizeof(int); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDR_SIZE, &size_of_addresses, &opt_len) != 0) { errno = ENOMEM; @@ -475,7 +475,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockadd errno = ENOTCONN; return (-1); } - opt_len = (socklen_t) (size_of_addresses + sizeof(sctp_assoc_t)); + opt_len = (socklen_t)(size_of_addresses + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; @@ -586,6 +586,7 @@ sctp_sendmsg(int s, } who = (struct sockaddr *)&addr; } + iov.iov_base = (char *)data; iov.iov_len = len; @@ -632,7 +633,7 @@ sctp_getassocid(int sd, struct sockaddr *sa) if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDR_INFO, &sp, &siz) != 0) { /* We depend on the fact that 0 can never be returned */ - return ((sctp_assoc_t) 0); + return ((sctp_assoc_t)0); } return (sp.spinfo_assoc_id); } @@ -748,7 +749,7 @@ sctp_sendx(int sd, const void *msg, size_t msg_len, aa++; memcpy((caddr_t)aa, addrs, (size_t)(len - sizeof(int))); ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X_DELAYED, (void *)buf, - (socklen_t) len); + (socklen_t)len); free(buf); if (ret != 0) { @@ -766,7 +767,7 @@ continue_send: sinfo->sinfo_assoc_id = sctp_getassocid(sd, addrs); if (sinfo->sinfo_assoc_id == 0) { (void)setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X_COMPLETE, (void *)addrs, - (socklen_t) addrs->sa_len); + (socklen_t)addrs->sa_len); errno = ENOENT; return (-1); } @@ -774,7 +775,7 @@ continue_send: saved_errno = errno; if (no_end_cx == 0) (void)setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X_COMPLETE, (void *)addrs, - (socklen_t) addrs->sa_len); + (socklen_t)addrs->sa_len); errno = saved_errno; return (ret); @@ -808,7 +809,7 @@ sctp_recvmsg(int s, void *dbuf, size_t len, struct sockaddr *from, - socklen_t * fromlen, + socklen_t *fromlen, struct sctp_sndrcvinfo *sinfo, int *msg_flags) { @@ -878,14 +879,14 @@ sctp_recvmsg(int s, #endif } -ssize_t +ssize_t sctp_recvv(int sd, const struct iovec *iov, int iovlen, struct sockaddr *from, - socklen_t * fromlen, + socklen_t *fromlen, void *info, - socklen_t * infolen, + socklen_t *infolen, unsigned int *infotype, int *flags) { @@ -953,17 +954,17 @@ sctp_recvv(int sd, rn_info = (struct sctp_recvv_rn *)info; rn_info->recvv_rcvinfo = *rcvinfo; rn_info->recvv_nxtinfo = *nxtinfo; - *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); + *infolen = (socklen_t)sizeof(struct sctp_recvv_rn); *infotype = SCTP_RECVV_RN; } else if (*infolen >= sizeof(struct sctp_rcvinfo)) { memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); - *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); + *infolen = (socklen_t)sizeof(struct sctp_rcvinfo); *infotype = SCTP_RECVV_RCVINFO; } } else if (nxtinfo != NULL) { if (*infolen >= sizeof(struct sctp_nxtinfo)) { memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo)); - *infolen = (socklen_t) sizeof(struct sctp_nxtinfo); + *infolen = (socklen_t)sizeof(struct sctp_nxtinfo); *infotype = SCTP_RECVV_NXTINFO; } } @@ -1105,7 +1106,7 @@ sctp_sendv(int sd, for (i = 0; i < addrcnt; i++) { switch (addr->sa_family) { case AF_INET: - addr_len = (socklen_t) sizeof(struct sockaddr_in); + addr_len = (socklen_t)sizeof(struct sockaddr_in); addr_in = (struct sockaddr_in *)addr; if (addr_in->sin_len != addr_len) { free(cmsgbuf); @@ -1130,7 +1131,7 @@ sctp_sendv(int sd, } break; case AF_INET6: - addr_len = (socklen_t) sizeof(struct sockaddr_in6); + addr_len = (socklen_t)sizeof(struct sockaddr_in6); addr_in6 = (struct sockaddr_in6 *)addr; if (addr_in6->sin6_len != addr_len) { free(cmsgbuf); From owner-svn-src-all@freebsd.org Thu Jun 18 17:19:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A087135589B; Thu, 18 Jun 2020 17:19:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49npZc3pm0z3Twv; Thu, 18 Jun 2020 17:19:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:403:e9be:84e2:c1f9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id F18F5299A7; Thu, 18 Jun 2020 17:19:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r362126 - head/sys/vm To: cem@freebsd.org Cc: Eric van Gyzen , src-committers , svn-src-all , svn-src-head References: <202006122153.05CLr8JN091722@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 18 Jun 2020 10:19:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 17:19:20 -0000 On 6/17/20 5:48 PM, Conrad Meyer wrote: > On Wed, Jun 17, 2020 at 10:50 AM John Baldwin wrote: >> >> On 6/12/20 3:33 PM, Conrad Meyer wrote: >>> On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen wrote: >>>> Honor db_pager_quit in some vm_object ddb commands >>>> >>>> These can be rather verbose. >>> >>> We also have this (?)hack in OneFS, which eliminates the need for >>> every debug function to check the db_pager globals: >>> >>> https://people.freebsd.org/~cem/db_pager.patch >>> >>> I'm not sure how objectionable it is. >> >> I don't think this addresses that. I think this patch makes printf turn >> into db_printf when a function is invoked from DDB which is orthogonal. >> db_printf() itself doesn't check the pager. > > db_printf checks the pager, via db_putc. It doesn't break out of the loops for you though (e.g. via setjmp or the like). Commands still have to check db_pager_quit directly if they wish to abort early to honor a user entering 'q' at the pager prompt. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Jun 18 17:54:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA02C35679B; Thu, 18 Jun 2020 17:54:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nqLl2mZBz3X6P; Thu, 18 Jun 2020 17:54:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f53.google.com with SMTP id k15so5230463otp.8; Thu, 18 Jun 2020 10:54:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=qf6MWeyzaCGI3CBBBerdKwGI7FAV9KGe3vhVVbQ9SFA=; b=OQAqUyXC3V77iEJzzm5AVU291XSUm1mfjjGqEixxDF9EPDpkwXh2WLlxrUDsvrI9WM LtyPal7MMuMZMuzPYQyRcW6fatslFtzsrZ+PrGTuOrFk0IJau3nCcFLf+ZGkSbMaPPnV P6oVeq5NLsB2QpVsE/qwSs5mYUp4fSzPwvo5KdmjZeq5bJQ0bL+JXbGIG+jD3O32/XKK blAD6Hp7FtpihKl3uAIXhNgjaKYDnBdbgCp5ZJIigd/OuN7YbLjIc7u9PlqUVLJPd7iL 4pkpi8hZedgUIT7yVhI5Qp28GsuZQIpuFvuXgpoEsjm8ndkyviCiaTvKkw7m1DwRaxjf BifQ== X-Gm-Message-State: AOAM5301RbztUfqXMshM1TXx20F3TNh2DR/iNvPx6FZGxz5LLCaHXtqd uzAvJ3nGAw4mn3e85E4Pfq+R3eFd X-Google-Smtp-Source: ABdhPJw+0xpzEHmlncKRci+Y+rSsgmpXNNK87Y6LYMEE9AOpkr9dZlrVuDPTm9vPE+0syRIZMObnvQ== X-Received: by 2002:a9d:62da:: with SMTP id z26mr4800117otk.369.1592502846130; Thu, 18 Jun 2020 10:54:06 -0700 (PDT) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com. [209.85.210.49]) by smtp.gmail.com with ESMTPSA id g3sm854033oov.21.2020.06.18.10.54.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2020 10:54:05 -0700 (PDT) Received: by mail-ot1-f49.google.com with SMTP id u23so5226239otq.10; Thu, 18 Jun 2020 10:54:04 -0700 (PDT) X-Received: by 2002:a9d:2224:: with SMTP id o33mr4667703ota.216.1592502844511; Thu, 18 Jun 2020 10:54:04 -0700 (PDT) MIME-Version: 1.0 References: <202006122153.05CLr8JN091722@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 18 Jun 2020 10:53:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r362126 - head/sys/vm To: John Baldwin Cc: Eric van Gyzen , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49nqLl2mZBz3X6P X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 17:54:07 -0000 On Thu, Jun 18, 2020 at 10:19 AM John Baldwin wrote: > > On 6/17/20 5:48 PM, Conrad Meyer wrote: > > db_printf checks the pager, via db_putc. > > It doesn't break out of the loops for you though (e.g. via setjmp or the > like). Commands still have to check db_pager_quit directly if they wish > to abort early to honor a user entering 'q' at the pager prompt. It does for Ctrl-C, but not 'q', true. It could easily do the same for 'q' as Ctrl-C: db_error(NULL) => kdb_reenter_silent(). From owner-svn-src-all@freebsd.org Thu Jun 18 18:09:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0446356EF5; Thu, 18 Jun 2020 18:09:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nqhD41GZz3YlQ; Thu, 18 Jun 2020 18:09:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 849EADCEF; Thu, 18 Jun 2020 18:09:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05II9Gxx054026; Thu, 18 Jun 2020 18:09:16 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05II9G8p054025; Thu, 18 Jun 2020 18:09:16 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202006181809.05II9G8p054025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Jun 2020 18:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362333 - in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib X-SVN-Commit-Revision: 362333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 18:09:16 -0000 Author: jkim Date: Thu Jun 18 18:09:16 2020 New Revision: 362333 URL: https://svnweb.freebsd.org/changeset/base/362333 Log: MFV: r362286 Merge flex 2.6.4. Added: head/contrib/flex/README.md - copied unchanged from r362286, vendor/flex/dist/README.md head/contrib/flex/configure.ac - copied unchanged from r362286, vendor/flex/dist/configure.ac head/contrib/flex/src/ head/contrib/flex/src/FlexLexer.h - copied, changed from r362332, head/contrib/flex/FlexLexer.h head/contrib/flex/src/buf.c - copied, changed from r362332, head/contrib/flex/buf.c head/contrib/flex/src/ccl.c - copied, changed from r362332, head/contrib/flex/ccl.c head/contrib/flex/src/dfa.c - copied, changed from r362332, head/contrib/flex/dfa.c head/contrib/flex/src/ecs.c - copied, changed from r362332, head/contrib/flex/ecs.c head/contrib/flex/src/filter.c - copied, changed from r362332, head/contrib/flex/filter.c head/contrib/flex/src/flex.skl - copied, changed from r362332, head/contrib/flex/flex.skl head/contrib/flex/src/flexdef.h - copied, changed from r362332, head/contrib/flex/flexdef.h head/contrib/flex/src/flexint.h - copied, changed from r362332, head/contrib/flex/flexint.h head/contrib/flex/src/gen.c - copied, changed from r362332, head/contrib/flex/gen.c head/contrib/flex/src/libmain.c - copied, changed from r362332, head/contrib/flex/libmain.c head/contrib/flex/src/libyywrap.c - copied, changed from r362332, head/contrib/flex/libyywrap.c head/contrib/flex/src/main.c - copied, changed from r362332, head/contrib/flex/main.c head/contrib/flex/src/misc.c - copied, changed from r362332, head/contrib/flex/misc.c head/contrib/flex/src/mkskel.sh - copied, changed from r362332, head/contrib/flex/mkskel.sh head/contrib/flex/src/nfa.c - copied, changed from r362332, head/contrib/flex/nfa.c head/contrib/flex/src/options.c - copied, changed from r362332, head/contrib/flex/options.c head/contrib/flex/src/options.h - copied, changed from r362332, head/contrib/flex/options.h head/contrib/flex/src/parse.y - copied, changed from r362332, head/contrib/flex/parse.y head/contrib/flex/src/regex.c - copied, changed from r362332, head/contrib/flex/regex.c head/contrib/flex/src/scan.l - copied, changed from r362332, head/contrib/flex/scan.l head/contrib/flex/src/scanflags.c - copied, changed from r362332, head/contrib/flex/scanflags.c head/contrib/flex/src/scanopt.c - copied, changed from r362332, head/contrib/flex/scanopt.c head/contrib/flex/src/scanopt.h - copied, changed from r362332, head/contrib/flex/scanopt.h head/contrib/flex/src/sym.c - copied, changed from r362332, head/contrib/flex/sym.c head/contrib/flex/src/tables.c - copied, changed from r362332, head/contrib/flex/tables.c head/contrib/flex/src/tables.h - copied, changed from r362332, head/contrib/flex/tables.h head/contrib/flex/src/tables_shared.c - copied, changed from r362332, head/contrib/flex/tables_shared.c head/contrib/flex/src/tables_shared.h - copied unchanged from r362332, head/contrib/flex/tables_shared.h head/contrib/flex/src/tblcmp.c - copied, changed from r362332, head/contrib/flex/tblcmp.c head/contrib/flex/src/version.h - copied unchanged from r362332, head/contrib/flex/version.h head/contrib/flex/src/yylex.c - copied, changed from r362332, head/contrib/flex/yylex.c Deleted: head/contrib/flex/FlexLexer.h head/contrib/flex/README head/contrib/flex/buf.c head/contrib/flex/ccl.c head/contrib/flex/dfa.c head/contrib/flex/ecs.c head/contrib/flex/filter.c head/contrib/flex/flex.skl head/contrib/flex/flexdef.h head/contrib/flex/flexint.h head/contrib/flex/gen.c head/contrib/flex/libmain.c head/contrib/flex/libyywrap.c head/contrib/flex/main.c head/contrib/flex/misc.c head/contrib/flex/mkskel.sh head/contrib/flex/nfa.c head/contrib/flex/options.c head/contrib/flex/options.h head/contrib/flex/parse.y head/contrib/flex/regex.c head/contrib/flex/scan.l head/contrib/flex/scanflags.c head/contrib/flex/scanopt.c head/contrib/flex/scanopt.h head/contrib/flex/sym.c head/contrib/flex/tables.c head/contrib/flex/tables.h head/contrib/flex/tables_shared.c head/contrib/flex/tables_shared.h head/contrib/flex/tblcmp.c head/contrib/flex/version.h head/contrib/flex/yylex.c Modified: head/contrib/flex/ChangeLog head/contrib/flex/NEWS head/usr.bin/lex/Makefile head/usr.bin/lex/config.h head/usr.bin/lex/initparse.c head/usr.bin/lex/initparse.h head/usr.bin/lex/initscan.c head/usr.bin/lex/initskel.c head/usr.bin/lex/lex.1 head/usr.bin/lex/lib/Makefile head/usr.bin/lex/version.awk Directory Properties: head/contrib/flex/ (props changed) Modified: head/contrib/flex/ChangeLog ============================================================================== --- head/contrib/flex/ChangeLog Thu Jun 18 16:22:09 2020 (r362332) +++ head/contrib/flex/ChangeLog Thu Jun 18 18:09:16 2020 (r362333) @@ -1,3 +1,2775 @@ +2017-05-06 Will Estes + + * po/ca.po, po/da.po, po/de.po, po/eo.po, po/es.po, po/fi.po, + po/fr.po, po/ga.po, po/hr.po, po/ko.po, po/nl.po, po/pl.po, + po/pt_BR.po, po/ro.po, po/ru.po, po/sr.po, po/sv.po, po/tr.po, + po/vi.po, po/zh_CN.po, po/zh_TW.po: gettext: pulled latest + translations; recompiled against current sources + +2017-05-06 Will Estes + + * NEWS: version 2.6.4 * NEWS: Record release date. + +2017-05-06 Will Estes + + * .prev-version: note previous version + +2017-05-06 Will Estes + + * NEWS: doc: update NEWS for upcoming release + +2017-05-04 viktor.shepel + + * doc/flex.texi: doc: Correct typo in C code sample in manual + +2017-05-04 Explorer09 + + * src/flex.skl: scanner: Mention %# comments are removed when + building skel.c + +2017-05-02 Demi Obenour + + * src/flex.skl: Honor user definitions of yy_* macros The user may have defined the yy_* macros themselves. In that case, + don't clobber them. + +2017-05-02 Demi Obenour + + * src/flex.skl, src/main.c: Don't leak macro definitions into header + files This allowed unnamespaced definitions to leak into header files, + breaking client code. Fixes #142 + +2017-05-03 Demi Obenour + + * src/scan.l: scanner: Check for 0 bracecount when EOL ends quoted + literal. This can happen in the case of // comments (which Flex doesn't + handle specially). + +2017-05-03 Demi Obenour + + * src/scan.l: scanner: when bracelevel is negative, treat as zero. This really should never happen, but this at least fixes the + breakage on Verilator. + +2017-04-02 Jeff Smith + + * tests/Makefile.am, tests/tableopts.am, tests/tableopts.sh: test: + enable more silent building of tests. When running 'make V=0 check', some compile and link steps are made + less verbose and some are not. This cleans up most steps that are + not. These have no effect if V=0 is not specified. + +2017-05-03 Demi Obenour + + * src/Makefile.am, src/misc.c, src/mkskel.sh: build: Delete comments + from skeleton file. Since the comments in flex.skl are, by hypothesis, not needed in + skel.c, we remove them. THis reduces the size of the resulting + executable somewhat. + +2017-05-03 Explorer09 + + * Makefile.am, configure.ac, lib/Makefile.am: build: do not generate + lib/Makefile.in. Files in lib/ are picked up and built using makefile directives in + src/Makefile.am. Remove the need to generate lib/Makefile.in and the + stub lib/Makefile.am. + +2017-05-02 Will Estes + + * po/POTFILES.in: gettext: revert listing generated .c files + +2017-04-10 Jeff Smith + + * src/filter.c: FLEX_EXIT() is the preferred way to exit flex + +2017-04-11 Explorer09 + + * src/misc.c: Fix myesc() 'sptr' conditionals * Don't call isascii() here. It's deprecated in POSIX and not needed for myesc's case. * The check of the character class and range here should match + what's defined as {ESCSEQ} in scan.l, so for [[:xdigit:]] we use + isxdigit(); for [0-7] we check '0' <= c <= '7' (not isdigit(c) + because isdigit is locale-dependant in standard's sense) * Add missing length limit for "\x" ( is at most 2 digits) + +2017-04-11 Explorer09 + + * src/flexdef.h, src/misc.c: Obsolete htoui() and otoui(); use + strtoul(). No sense to keep these two function when libc's strtoul() can do the + same job, but better. + +2017-04-12 Todd C. Miller + + * src/flex.skl: scanner: update yy_buf_size after yyrealloc() + +2017-05-02 Simon Sobisch + + * configure.ac: build: use lowest versions for gettext, automake. + +2017-05-02 Simon Sobisch + + * po/Makevars, po/Rules-getpo, po/update_linguas.sh: gettext: more + recent makevars; new script to update po files. Previously, "make dist" and similar commands would cause the po + files to be updated, which is incorrect. The more recent version now + used should not do this. Replaced Rules-getpo by extra script to manually update and rebuild + all po files. + +2017-05-02 Simon Sobisch + + * po/POTFILES.in: gettext: list generated files instead of flex, + bison sources in POTFILES.in. Listing the flex and bison sources -- as the gettext manual suggests + -- causes warnings. Listing the generated C files for the lexer and + parser removes the warnings. Since both files contain line + directives, any translator who needs to refer back to those files + should be able to find the context in which strings are needed. + +2017-05-02 Simon Sobisch + + * autogen.sh: build: only touch ChangeLog if it does not exist + +2017-05-02 Simon Sobisch + + * configure.ac, doc/Makefile.am: build: list earliest useable + versions for automake + +2017-05-02 Simon Sobisch + + * autogen.sh: build: check for how to call libtoolize. Previously, we would call libtoolize and if that failed, we would + call glibtoolize since some platforms have the libtoolize program + under that name. Instead, we check to see if the environment variable LIBTOOLIZE is + set and use that if so. Otherwise, we try to find a program + "libtoolize" on the path and failing that glibtoolize. We alert the + user if no suitable program can be found. + +2017-01-06 Alastair Hughes + + * configure.ac, m4/ax_prog_cc_for_build.m4, src/Makefile.am: build: + support cross compiling. Check for cross compiling. If cross compiling, build stage1flex + using a custom link command. We also override LDADD since that adds + the replacement implementations that are cross compiled, and instead + always use the replacement library implementations. We don't use BUILD_OBJEXT and BUILD_EXEEXT since it seems that + automake does not support these. Fixes #78. + +2017-02-17 Explorer09 + + * configure.ac, src/flexdef.h: build: Include ; add + strcasecmp() check to configure. strings.h (not string.h) is the standard-defined include header for + strcasecmp(). Include for portability (even though glibc + exposes strcasecmp() declaration also in by default). + +2017-02-17 Explorer09 + + * configure.ac, src/flexdef.h: build: Let configure error if missing + required functions, headers.. `configure` will now error if a required header or function is not + found on the system. Also add comments on optional functions checks. Add sys/stats.h and sys/wait.h to list of required headers in + configure. This fixes issue #180. + +2017-02-12 Explorer09 + + * src/dfa.c, src/flexdef.h: scanner: compute powers of two faster. Replace the naive "for" loop in determining power of two with a + clever bitwise solution. This code is around the Internet already + and is in Public Domain. + +2017-02-07 Explorer09 + + * configure.ac, tests/Makefile.am, tests/pthread.l: test: skip + pthread test when needed files missing. "Unlisting" the pthread test when libpthread is not available is + never a good idea. Should let it compile into a stub program that + returns the "skip" status. configure.ac and tests/Makefile.am are edited so that pthread test + can be built anyway, but only works (not as the stub) when both + pthread.h and libpthread are detected on the system. Also fix a small typo in tests/pthread.l comments. + +2017-02-16 Will Estes + + * src/Makefile.am: build: mv scan.c when building dist. Revert change to copy scan.c when building the distribution archive. + Move it instead. This satisfies automake's notions of what should be + clean and ensures that the distribution archive contains a + just-built copy of scan.c. Fixes #186 + +2017-02-06 Will Estes + + * src/Makefile.am: build: don't assume distdir/scan.c is writeable + +2017-01-02 Explorer09 + + * src/Makefile.am: build: Add dist-hook to force remake scan.c. This will ensure the flex scanner included in release tarball being + generated by exactly the flex version to be released. Here's one catch after this change: You may not run "make dist" or + "make distdir" if you configure the flex source to be + cross-compiled. + +2017-01-02 Explorer09 + + * src/Makefile.am: build: respect '--localedir' from configure. Makefile shouldn't overwrite the 'localedir' variable, because + that's what '--localedir' option in 'configure' is for. + +2017-01-02 Explorer09 + + * src/Makefile.am: build: Remove "-I$(top_srcdir)/intl" from + CPPFLAGS. Revert commit e02c3d27eeb6b53ec82532ab080c23ce26813fd4 ("include the intl/ subdirectory when searching for include files") Flex doesn't come with libintl source code, so inclusion of + $(top_srcdir)/intl subdirectory during compiling is unnecessary. This flag seems to be left after "remove intl from dist" (commit + 8f45da06adbd7dbcdfdbdd5c20ff4c47fc504f35) without someone cleaning + this up. Users who need to build with gettext functionality from libintl + would use the '--with-libintl-prefix' configure option. + +2017-02-03 Explorer09 + + * src/regex.c: scanner: fix regcomp's error reporting, double + malloc. Fix unneeded double malloc - let regerror(). Write its message after + our "regcomp for (regex) failed: " string. Also, errbuf cannot be free()'d because of flexfatal containing a + longjmp. + +2017-01-03 Explorer09 + + * tests/Makefile.am, tests/no_bison_stub.c: test: Skip bison tests + if bison is not available + +2017-01-03 Explorer09 + + * configure.ac: build: remove repeated bison detection from + configure. AC_PROG_YACC already detects the bison program. We can just use it, + and make notice if [ $YACC != 'bison -y' ] Remove unused AC_SUBST([BISON], ...). Add AM_CONDITIONAL([HAVE_BISON], ...) so that we can skip bison + tests in testsuite when bison is absent. We don't make any attempt to detect other yacc implementations since + flex is developed with bison. While it would be possible, the need + isn't there right now. It would be possible to add a --with-parser + option that defaulted to bison if such a need cropped up. + +2017-01-01 Explorer09 + + * src/Makefile.am: build: fix Makefile parse.h dependency clauses. The current clauses stating "main.c: parse.h" and "yylex.c: parse.h" + do not work as expected. Make did not try to build parse.h upon + building flex-main.o as it would think main.c exist already and + ignore the clause. Fix this by explicitly stating that the .o files + depend on parse.h instead. This dependency bug only happens if user builds flex from a + checked-out repository. + +2017-01-03 Explorer09 + + * tests/Makefile.am: test: Remake *_scanner.c if *_scanner.h is + missing. If a ${foo}_scanner.c exists but the respective ${foo}_scanner.h is + missing, then 'make' can halt. Fix this by deleting the + ${foo}_scanner.c file and then remake it. This rule is the same as + the automake-generated rule for .c files that require LEX or YACC + (except automake will use ylwrap). + +2016-12-31 Explorer09 + + * tests/Makefile.am: test: remove BUILT_SOURCES; add missing + dependencies. Without BUILT_SOURCES in Makefile, no test sources in tests/ will be + built when using the default "make all" target. This is desireable + for people who are just building flex but who do not want to run, + and therefore, build any part of the test suite. Also fix missing sources dependencies: bison_nr_scanner.$(OBJEXT): bison_nr_parser.h bison_yylloc_scanner.$(OBJEXT): bison_yylloc_parser.h bison_yylval_scanner.$(OBJEXT): bison_yylval_parser.h + +2017-01-19 Explorer09 + + * configure.ac, lib/reallocarray.c, src/flexint.h, src/misc.c: + build: detect overflow for [re]allocate_array. Use reallocarray() when we have it (i.e. in OpenBSD system). When we + don't, use equivalent overflow detection for our allocate_array and + reallocate_array functions. Remove lib/reallocarray.c from our LIBOBJS as we no longer need it. Provide a fallback SIZE_MAX macro definition in flexint.h (not + preprocessor friendly, but enough for our reallocate_array use + case). + +2017-01-23 Will Estes + + * NEWS, configure.ac: doc: v2.6.4 + +2017-01-23 Thomas Klausner + + * src/Makefile.am: build: more BSD make and vpath build fixes. BSD make doesn't like $< with more than one source specified. + Additionally, make sure to specify srcdir when referring to source + files since vpath builds depend on this. + +2017-01-22 Thomas Klausner + + * src/Makefile.am: build: Fix skel.c generation with BSD make + +2017-01-22 Christos Zoulas + + * src/flex.skl: Add more defines in the non-reentrant part. Fix the reentrant part; don't "#define yyfoo yyfoo" because it + breaks code that does #ifndef yywrap .. + +2017-01-22 Christos Zoulas + + * src/flexdef.h: scanner: Add yyparse prototype + +2017-01-22 Thomas Klausner + + * src/flex.skl: scanner: move comment for consistency + +2017-01-22 Christos Zoulas + + * src/misc.c: scanner: Use array instead of pointer + +2017-01-22 Christos Zoulas + + * src/main.c: scanner: manage path to m4 better. Avoid alloca() for SSP; it is better anyway; since we don't need to + strdup the path. + +2017-01-22 Christos Zoulas + + * src/gen.c: scanner: Avoid creating unused label + +2017-01-22 Christos Zoulas + + * src/buf.c: Cast argument to avoid arithmetic on void *. + +2017-01-22 Christos Zoulas + + * src/scan.l: scanner: Use strncpy + +2017-01-22 Christos Zoulas + + * src/main.c: scanner: Use prefix when defining yywrap to avoid + redefinition. Fixes regression introduced in v2.6.3. + +2017-01-22 Christos Zoulas + + * src/flexdef.h, src/misc.c: scanner: Include stdarg.h for va_list + +2017-01-22 Christos Zoulas + + * src/flexdef.h, src/main.c, src/parse.y: scanner: Rename warn to + lwarn. This avoids a naming conflict in NetBSD's libc. + +2017-01-01 Explorer09 + + * tests/README: test: document automake convention for skipped exit + status. + +2017-01-03 Explorer09 + + * tests/Makefile.am: test: let testwrapper scripts be run by + ${SHELL}. This allows user to use a different shell if /bin/sh has problems. + The use of $SHELL (variable) to run scripts is already an Automake + convention. All shell scripts in build-aux are run by $SHELL. + +2017-01-02 Explorer09 + + * tests/options.cn, tests/tableopts.sh, + tests/testwrapper-direct.sh, tests/testwrapper.sh: test: Remove test + scripts bashisms. They now all work under a POSIX compliant sh. Specifically, 'dash' + can now be used for running "make check" tests. Note that none of these scripts has ever been using a pipe, so `set + -o pipefail` is unnecessary and removed. + +2017-01-02 Explorer09 + + * tests/testwrapper.sh: test: exit on '-1' test non-zero status. If a '-1' test program returns a non-zero status, don't go further + and compare it's (numeric) output values. This allows a '-1' test to + indicate a "skip" status or an otherwise error. (Currently no such + '-1' test would skip like this, though.) Shell syntax note: `set -e` will not exit with the syntax like this + `test $(false) = $(false);`. The exit statuses of `false` in the + example will be ignored instead. But putting the output in a + variable, such as `VAR=$(false)`, DOES exit. + +2017-01-02 Explorer09 + + * Makefile.am, src/Makefile.am: build: Fix 'make indent' target This 'make indent' target has not been working since the directories + reorganization in flex 2.6.0. Now make it work again. Note that the current indent profile breaks many styles of existing + code. The indent target should not be used until the .indent.pro + options are reviewed for desireability. + +2017-01-01 Explorer09 + + * configure.ac: build: Simplify indent program detection + +2017-01-12 Tobias Klauser + + * src/filter.c: filter: Don't emit #line if %option noline set One place emitting a #line directive to the generated header was + missed in commit 647a92b9f4 when resolving #55. Fix it to respect + gen_line_dirs as well. + +2017-01-12 Will Estes + + * po/ca.po, po/da.po, po/de.po, po/eo.po, po/es.po, po/fi.po, + po/fr.po, po/ga.po, po/hr.po, po/ko.po, po/nl.po, po/pl.po, + po/pt_BR.po, po/ro.po, po/ru.po, po/sr.po, po/sv.po, po/tr.po, + po/vi.po, po/zh_CN.po, po/zh_TW.po: translation: refresh po files + from translation project + +2017-01-10 Harald van Dijk + + * src/flex.skl: c++: Fix yyrestart(NULL) SEGV. Binding a reference to a dereferenced null pointer is invalid and + compilers optimise away the &file == 0 check. We need a real stream. yyin is available already, and yyrestart(NULL) is only supported + when yyin will not be used, so there is no harm in just passing in + that. Since we now always have a valid stream, we can skip the null + check too. Fixes #98. + +2017-01-09 luistung + + * src/scan.l: scanner: join symbol list. Removed a newline that caused a problem building the scanner in some + circumstances. Specifically: 'bad character' error when executing /bin/sh ../build-aux/ylwrap scan.l lex.yy.c scan.c -- flex + +2017-01-11 Will Estes + + * src/flex.skl: scanner: remove void cast before fprintf + +2016-12-30 Will Estes + + * NEWS: doc: update NEWS for 2.6.3 release + +2016-11-26 Explorer09 + + * configure.ac, src/Makefile.am: build: New configure option + '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex + won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to + fix the bootstrapping issues which are proving subtler and harder to + fix than anyone would like. + +2016-11-26 Explorer09 + + * src/Makefile.am: build: "make clean" deletes stage1scan.c, + stage1flex + +2016-11-26 Explorer09 + + * configure.ac, src/Makefile.am: build: allow building libfl even + with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when + configure has been run with the --disable-libfl option. This is + possible, now, via 'make -C src libfl.la'. + +2016-12-19 Alexis La Goutte + + * src/flex.skl: scanner: remove trailing whitespace in skeleton + +2016-12-01 Demi Obenour + + * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote + '[' and ']' in prefix + +2016-12-29 Samuel Thibault + + * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a + buffer overflow in some cases. Additionally, not all platforms + believe in PATH_MAX, so stop relying on it. Fixes #138 + +2016-11-24 Will Estes + + * NEWS: doc: note no more libcompat in NEWS + +2016-11-24 Will Estes + + * lib/Makefile.am: build: explain empty lib/Makefile.am + +2016-11-20 Explorer09 + + * configure.ac: build: warn about cross compiling with *alloc + +2016-11-19 Explorer09 + + * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: + Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to + bootstrapping and cross compilation. Now, we will simply link + individual object files as needed, which is simpler. + +2016-11-16 Explorer09 + + * src/Makefile.am: build: Let stage1flex respect LFLAGS + +2016-11-14 Will Estes + + * NEWS: doc: describe --disable-libfl in NEWS + +2016-10-31 Explorer09 + + * configure.ac, src/Makefile.am: build: Add --disable-libfl + configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 + +2016-11-09 Demi Obenour + + * src/flex.skl, tests/array_r.l: fix backwards incompatible changes + in 2.6.2. This patch addscompatibility `#defines` for all macros affected by + `%prefix`. Fixes #113. + +2016-11-08 Will Estes + + * tests/.gitignore: git: ignore quote_in_comment artifacts + +2016-11-08 Demi Obenour + + * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, + tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing + of literals. My changes caused Flex to mishandle string and character literals in + line comments. This commit fixes them. Fixes #113. + +2016-11-06 Thomas Klausner + + * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison + operator. + +2016-11-02 Demi Obenour + + * tests/quotes.l: Add more escaping tests + +2016-11-01 Demi Obenour + + * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. + +2016-10-28 Alastair Hughes + + * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will + never be zero length as they fall back to the missing script; check + for the fall back and warn on that instead of always warning. + +2016-10-28 Explorer09 + + * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the + next "configure and make" on the source directory will then require + help2man unnecessarily. + +2016-10-27 Alastair Hughes + + * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the + prerequisites from before 7cfb440. This prevents rebuilding the man + page whenever the flex binary is rebuilt, which causes problems if + help2man is not installed and will never work when cross compiling. Fixes #108. + +2016-10-26 Will Estes + + * NEWS, src/Makefile.am: build: no longer build PIC version of + libfl. The PIC version of libfl was not being built correctly. From the + lack of bug reports around this problem, we conclude that the PIC + version of libfl is not used and so we drop it from the build build + targets for flex. + +2016-10-25 Explorer09 + + * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look + lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung + +2016-10-25 Will Estes + + * NEWS, configure.ac: build: version 2.6.3 begins + +2016-10-24 Will Estes + + * NEWS: doc: mark 2.6.2 release date + +2016-10-24 Will Estes + + * .gitignore, NEWS, configure.ac: build: switch xz to lzip + +2016-10-20 Demi Obenour + + * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue + and refactor duplicated code + +2016-10-21 Alex Kennedy + + * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, + paragraph 2. + +2016-09-27 Demi Obenour + + * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, + src/scan.l, tests/bison_yylval_scanner.l, + tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in + section 3 of the input file only) and character literals. The new + quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it + unconditionally was defined to) instead. + +2016-10-19 Will Estes + + * Makefile.am, configure.ac: build: for automake, flex is foreign + +2016-10-19 Will Estes + + * README, README.md: doc: mv README to README.md + +2016-10-19 Will Estes + + * README: doc: touch up README + +2016-10-19 Will Estes + + * README: doc: README no longer mentions sourceforge + +2016-10-06 Will Estes + + * NEWS: doc: update NEWS with more post-2.6.1 additions + +2016-09-27 Demi Obenour + + * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, + src/options.c, src/options.h, src/scan.l, src/yylex.c, + tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, + tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, + tests/debug_r.l, tests/include_by_reentrant.direct.l, + tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, + tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, + tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, + tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including + escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to + quoting. Both escaping of quotes and quoting of potential + macro-start characters are tested. Existing tests were also fixed to + account for the new -- and now correct -- behavior. Many tests + relied on the old behavior of expanding M4 macros in section 3. + They needed to be updated for the new behavior. + +2016-10-03 Mightyjo + + * src/flex.skl, tests/.gitignore, tests/Makefile.am, + tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) + SEGV. + +2016-09-05 Demi Obenour + + * src/scan.l: scanner: M4 quoting fixes + +2016-09-05 Demi Obenour + + * src/Makefile.am: Support `make indent` for out of source builds + +2016-09-24 Demi Obenour + + * src/Makefile.am, src/mkskel.sh: Simplify some shell code + +2016-09-23 Demi Obenour + + * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, + src/options.c, src/options.h, src/scan.l, tests/.gitignore, + tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, + tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C + scanners + +2016-09-04 Demi Obenour + + * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to + bad interactions with m4. Also, don't break strings on newline, as GCC et al support + whitespace between a backslash and the subsequent newline. + +2016-06-20 Translation Project + + * NEWS, po/sv.po: new sv translation + +2016-05-23 Demetri Obenour + + * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when + run. + +2016-05-20 Will Estes + + * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct + tests from srcdir + +2016-01-11 Egor Pugin + + * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, + tests/include_by_reentrant.direct.l: Exited with error code on some + conditions in include tests + +2016-05-20 Will Estes + + * tests/testwrapper.sh: test: drop .exe when making input file names + +2016-05-20 Will Estes + + * tests/Makefile.am: test: removed dependencies for include tests + +2016-04-28 Tobias Klauser + + * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if + the maximum size _sf_max wasn't changed. As the indentation beneath + the "if" clause already indicates, the realloc() should only be + executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of + gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: + this ‘if’ clause does not guard... [-Wmisleading-indentation] if + (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this + statement, but the latter is misleadingly indented as if it is + guarded by the ‘if’ _sf_stk = realloc(_sf_stk, + sizeof(scanflags_t) * _sf_max); ^~~~~~~ + +2016-03-31 Will Estes + + * doc/Makefile.am: build: prettified command to build man page + +2016-03-31 Will Estes + + * doc/Makefile.am: build: added man page to DISTCLEANFILES + +2016-03-31 Will Estes + + * BUGS, TODO: remove unused TODO, BUGS files + +2016-03-31 Will Estes + + * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, + to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, + to.do/unicode/ccl.c, to.do/unicode/changes.txt, + to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, + to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, + to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: + removed to.do/ directory + +2016-03-31 Will Estes + + * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file + list + +2016-03-31 rlar + + * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) + and polish build rule Also remove references to srcdir since skel.c is no longer mentioned + in po/POTFILES.in. + +2016-03-31 rlar + + * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 + && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. + +2016-03-31 rlar + + * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't + open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz + file. stage1flex will be build from scan.c (which is + distributed), and this will then generate stage1scan.c from scan.l + +2016-03-31 Will Estes + + * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in + +2016-03-29 rlar + + * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may + change the sign of the result [-Wsign-conversion] + +2016-03-29 rlar + + * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete + `noansi' test cases + +2016-03-29 rlar + + * configure.ac, src/Makefile.am, tests/Makefile.am: configure option + `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter + +2016-03-31 Tobias Klauser + + * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is + emitted: main.c:378:27: warning: the value of the size argument in 'strncat' + is too large, might lead to a buffer overflow [-Wstrncat-size] + strncat(m4_path, m4, sizeof(m4_path)); + ^~~~~~~~~~~~~~~ + main.c:378:27: note: change the argument to be the free space in the + destination buffer minus the terminating null byte strncat(m4_path, + m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ + sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. + +2016-03-29 Robert.Larice Robert Larice + + * src/Makefile.am: build: simplified dependency tracking so parallel + make runs succeed + +2016-03-20 rlar + + * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated + code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign + of the result [-Wsign-conversion] + +2016-03-18 Will Estes + + * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 + +2016-03-18 Will Estes + + * doc/flex.texi: doc: corrected example in manual, gh#67 + +2016-03-16 rlar + + * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: + conversion to 'size_t' from 'int' may change the sign of the result + [-Wsign-conversion] + +2016-03-16 rlar + + * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: + conversion to 'long unsigned int' from 'int' may change the sign of + the result [-Wsign-conversion] + +2016-03-16 rlar + + * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long + unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t + +2016-03-16 rlar + + * tests/alloc_extra.l, tests/bison_nr_main.c, + tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: + redundant redeclaration of '...' [-Wredundant-decls] + +2016-03-16 rlar + + * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, + tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous + prototype for '...' [-Wmissing-prototypes] + +2016-03-16 rlar + + * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' + [-Wunused-variable] + +2016-03-16 rlar + + * tests/pthread.l: main(), warning: redundant redeclaration of + 'main' [-Wredundant-decls] + +2016-03-16 rlar + + * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, + tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: + old-style function definition [-Wold-style-definition] + +2016-03-16 rlar + + * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, + tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, + tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, + tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, + tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, + tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), + warning: old-style function definition [-Wold-style-definition] + +2016-03-01 rlar + + * src/ecs.c, src/tblcmp.c: Fix two more casts + +2016-03-14 Bastian Köcher + + * src/gen.c: Fixes yyl compare with unsigned warning + +2016-03-13 Robert Larice + + * configure.ac: Suppress portability warnings in Makefile generation + +2016-02-27 rlar + + * src/flex.skl: generated code, in yyensure_buffer_stack(), change + type of local `num_to_alloc' which is exclusively used in yy_size_t context + +2016-03-01 rlar + + * src/flex.skl: generated code, in yy_get_next_buffer(), change type + of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type + `int' + +2016-02-27 rlar + + * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix + code accordingly + +2016-02-28 rlar + + * src/gen.c: generated code, `max_size' seems to be of type `int', + fix casts accordingly + +2016-02-28 rlar + + * src/flex.skl: generated code, here `new_size' is of type `int', + fix casts accordingly + +2016-02-28 rlar + + * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix + casts accordingly + +2016-02-28 rlar + + * src/flex.skl: generated code, `offset' is of type `int' + +2016-02-28 rlar + + * src/gen.c: generated code, `yy_more_len' is of type `int' + +2016-02-28 rlar + + * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy + casting + +2016-03-01 rlar + + * src/regex.c, src/tables.c: improve readability + +2016-02-28 rlar + + * src/tblcmp.c: another cast in tblcmp.c to avoid warning + +2016-02-28 rlar + + * src/buf.c: casts in buf_append() to get rid of warnings + +2016-02-28 rlar + + * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen + +2016-02-28 rlar + + * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, + src/tables_shared.c: cast to get rid of warnings + +2016-03-01 rlar + + * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to + prevent buffer overflow + +2016-03-01 rlar + + * src/tables.c: tables.c, sprinkle casts to get rid of warnings + +2016-03-01 rlar + + * src/tables.c: yytbl_data_compress(), change type of local newsz to + get rid of warnings + +2016-03-01 rlar + + * src/tables.c, src/tables.h: change type of struct + yytbl_writer.total_written to get rid of warnings + +2016-02-28 rlar + + * src/tables.c: change argument type of yytbl_writen() to get rid of + warnings + +2016-03-01 rlar + + * src/tables.c: yytbl_write8/16/32(), change type of local variables + to get rid of warnings + +2016-02-28 rlar + + * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, + to.do/unicode/misc.c: change return type and rename int + htoi()/otoi() --> unsigned int htoui()/otoui() + +2016-03-01 Will Estes + + * NEWS: Mention 2.6.1 release date + +2016-02-28 rlar + + * src/gen.c: avoid warning, add (int) cast to the read() return + value For similiarity with the fread() case. + +2016-02-28 rlar + + * src/scan.l: avoid warning, POSIX says yyless() has an `int' + argument + +2016-02-29 rlar + + * src/filter.c: use type size_t in filter_tee_header() to avoid + warnings + +2016-02-29 rlar + + * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add + (size_t) casts to malloc invocations to prevent warnings + +2016-02-29 rlar + + * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: + add (int) casts to some strlen() invocations to prevent warnings + +2016-02-29 rlar + + * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get + rid of casts and warnings + +2016-02-28 rlar + + * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get + rid of casts and warnings + +2016-02-28 rlar + + * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), + char *, to get rid of casts and warnings + +2016-02-28 rlar + + * src/gen.c: warning: redundant redeclaration of + ‘gen_next_state’ [-Wredundant-decls] + +2016-02-28 rlar + + * src/gen.c: warning: no previous prototype for ‘mkecstbl’ + [-Wmissing-prototypes] + +2016-02-28 rlar + + * src/main.c: warning: suggest parentheses around assignment used as + truth value [-Wparentheses] + +2016-02-28 rlar + + * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ + [-Wredundant-decls] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jun 18 18:16:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C18435706B; Thu, 18 Jun 2020 18:16:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nqrG1P8Sz3ZS0; Thu, 18 Jun 2020 18:16:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10FBCDFB1; Thu, 18 Jun 2020 18:16:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IIGDW4060033; Thu, 18 Jun 2020 18:16:13 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IIGDwk060032; Thu, 18 Jun 2020 18:16:13 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202006181816.05IIGDwk060032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Jun 2020 18:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362334 - head/contrib/flex X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/contrib/flex X-SVN-Commit-Revision: 362334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 18:16:14 -0000 Author: jkim Date: Thu Jun 18 18:16:13 2020 New Revision: 362334 URL: https://svnweb.freebsd.org/changeset/base/362334 Log: Remove the unnecessary configure.ac. Deleted: head/contrib/flex/configure.ac From owner-svn-src-all@freebsd.org Thu Jun 18 18:18:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71965357075; Thu, 18 Jun 2020 18:18:10 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nqtV2BrTz3ZYC; Thu, 18 Jun 2020 18:18:10 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46821E0A6; Thu, 18 Jun 2020 18:18:10 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IIIAJk060170; Thu, 18 Jun 2020 18:18:10 GMT (envelope-from jrm@FreeBSD.org) Received: (from jrm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05III9vr060168; Thu, 18 Jun 2020 18:18:09 GMT (envelope-from jrm@FreeBSD.org) Message-Id: <202006181818.05III9vr060168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrm set sender to jrm@FreeBSD.org using -f From: Joseph Mingrone Date: Thu, 18 Jun 2020 18:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r362335 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: jrm X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 362335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 18:18:10 -0000 Author: jrm (ports committer) Date: Thu Jun 18 18:18:09 2020 New Revision: 362335 URL: https://svnweb.freebsd.org/changeset/base/362335 Log: Retire idle commit bits for hiren, miwi, and oleg Approved by: core (bcr) Differential Revision: https://reviews.freebsd.org/D25347 Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Jun 18 18:16:13 2020 (r362334) +++ svnadmin/conf/access Thu Jun 18 18:18:09 2020 (r362335) @@ -86,7 +86,6 @@ grehan grog gshapiro freebsd-cvs-committers@g.gshapiro.net harti -hiren hrs hselasky ian @@ -136,7 +135,6 @@ maxim mckusick melifaro mhorne -miwi mizhka mjg mjoras @@ -154,7 +152,6 @@ np nwhitehorn nyan obrien -oleg oshogbo peter peter@wemm.org peterj Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Jun 18 18:16:13 2020 (r362334) +++ svnadmin/conf/mentors Thu Jun 18 18:18:09 2020 (r362335) @@ -22,7 +22,6 @@ johalun imp jrtc27 brooks Co-mentor: jhb kadesai ken Co-mentor: scottl, ambrisko kaktus kib Co-mentor: mjg -miwi araujo mjoras rstone nick philip Co-mentor: kp ram ken Co-mentor: mav From owner-svn-src-all@freebsd.org Thu Jun 18 19:03:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C826A330564; Thu, 18 Jun 2020 19:03:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nrtc518Jz3cx4; Thu, 18 Jun 2020 19:03:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A764CE779; Thu, 18 Jun 2020 19:03:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IJ3Kxr090559; Thu, 18 Jun 2020 19:03:20 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IJ3KiD090558; Thu, 18 Jun 2020 19:03:20 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006181903.05IJ3KiD090558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 18 Jun 2020 19:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362336 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 362336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 19:03:20 -0000 Author: 0mp (doc,ports committer) Date: Thu Jun 18 19:03:20 2020 New Revision: 362336 URL: https://svnweb.freebsd.org/changeset/base/362336 Log: Fix a typo in cpuset_getdomain.2 PR: 247385 Reported by: Paul Floyd MFC after: 1 week Modified: head/lib/libc/sys/cpuset_getdomain.2 Modified: head/lib/libc/sys/cpuset_getdomain.2 ============================================================================== --- head/lib/libc/sys/cpuset_getdomain.2 Thu Jun 18 18:18:09 2020 (r362335) +++ head/lib/libc/sys/cpuset_getdomain.2 Thu Jun 18 19:03:20 2020 (r362336) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 19, 2018 +.Dd June 18, 2020 .Dt CPUSET_GETDOMAIN 2 .Os .Sh NAME @@ -37,7 +37,7 @@ .In sys/param.h .In sys/domainset.h .Ft int -.Fn cpuset_getdomain "cpulevel_t level" "cpuwhich_t which" "id_t id" "size_t setsize" "domainet_t *mask" "int *policy" +.Fn cpuset_getdomain "cpulevel_t level" "cpuwhich_t which" "id_t id" "size_t setsize" "domainset_t *mask" "int *policy" .Ft int .Fn cpuset_setdomain "cpulevel_t level" "cpuwhich_t which" "id_t id" "size_t setsize" "const domainset_t *mask" "int policy" .Sh DESCRIPTION From owner-svn-src-all@freebsd.org Thu Jun 18 19:16:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F4263309E1; Thu, 18 Jun 2020 19:16:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ns9J0VSGz3f6N; Thu, 18 Jun 2020 19:16:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C6AAEA3C; Thu, 18 Jun 2020 19:16:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IJG3HC097364; Thu, 18 Jun 2020 19:16:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IJG3lW097361; Thu, 18 Jun 2020 19:16:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006181916.05IJG3lW097361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Jun 2020 19:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362337 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 362337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 19:16:04 -0000 Author: mav Date: Thu Jun 18 19:16:03 2020 New Revision: 362337 URL: https://svnweb.freebsd.org/changeset/base/362337 Log: Make polled request timeout less invasive. Instead of panic after one second of polling, make the normal timeout handler to activate, reset the controller and abort the outstanding requests. If all of it won't happen within 10 seconds then something in the driver is likely stuck bad and panic is the only way out. In particular this fixed device hot unplug during execution of those polled commands, allowing clean device detach instead of panic. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jun 18 19:03:20 2020 (r362336) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jun 18 19:16:03 2020 (r362337) @@ -520,7 +520,7 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr } status.done = 0; - nvme_ctrlr_cmd_create_io_sq(qpair->ctrlr, qpair, + nvme_ctrlr_cmd_create_io_sq(ctrlr, qpair, nvme_completion_poll_cb, &status); nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Jun 18 19:03:20 2020 (r362336) +++ head/sys/dev/nvme/nvme_private.h Thu Jun 18 19:16:03 2020 (r362337) @@ -463,20 +463,22 @@ int nvme_detach(device_t dev); * Wait for a command to complete using the nvme_completion_poll_cb. * Used in limited contexts where the caller knows it's OK to block * briefly while the command runs. The ISR will run the callback which - * will set status->done to true.usually within microseconds. A 1s - * pause means something is seriously AFU and we should panic to - * provide the proper context to diagnose. + * will set status->done to true, usually within microseconds. If not, + * then after one second timeout handler should reset the controller + * and abort all outstanding requests including this polled one. If + * still not after ten seconds, then something is wrong with the driver, + * and panic is the only way to recover. */ static __inline void nvme_completion_poll(struct nvme_completion_poll_status *status) { - int sanity = hz * 1; + int sanity = hz * 10; while (!atomic_load_acq_int(&status->done) && --sanity > 0) pause("nvme", 1); if (sanity <= 0) - panic("NVME polled command failed to complete within 1s."); + panic("NVME polled command failed to complete within 10s."); } static __inline void Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Jun 18 19:03:20 2020 (r362336) +++ head/sys/dev/nvme/nvme_qpair.c Thu Jun 18 19:16:03 2020 (r362337) @@ -956,6 +956,7 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st { struct nvme_request *req; struct nvme_controller *ctrlr; + int timeout; mtx_assert(&qpair->lock, MA_OWNED); @@ -964,9 +965,14 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st qpair->act_tr[tr->cid] = tr; ctrlr = qpair->ctrlr; - if (req->timeout) - callout_reset_on(&tr->timer, ctrlr->timeout_period * hz, - nvme_timeout, tr, qpair->cpu); + if (req->timeout) { + if (req->cb_fn == nvme_completion_poll_cb) + timeout = hz; + else + timeout = ctrlr->timeout_period * hz; + callout_reset_on(&tr->timer, timeout, nvme_timeout, tr, + qpair->cpu); + } /* Copy the command from the tracker to the submission queue. */ memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd)); From owner-svn-src-all@freebsd.org Thu Jun 18 19:32:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2793C3314D6; Thu, 18 Jun 2020 19:32:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nsXQ0Hx5z3fyQ; Thu, 18 Jun 2020 19:32:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFDA6EEB8; Thu, 18 Jun 2020 19:32:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IJWbbc009574; Thu, 18 Jun 2020 19:32:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IJWZYH009560; Thu, 18 Jun 2020 19:32:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006181932.05IJWZYH009560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 18 Jun 2020 19:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362338 - in head: share/man/man4 sys/conf sys/kern sys/netinet sys/netinet6 sys/netipsec sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/kern sys/netinet sys/netinet6 sys/netipsec sys/netpfil/pf X-SVN-Commit-Revision: 362338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 19:32:38 -0000 Author: markj Date: Thu Jun 18 19:32:34 2020 New Revision: 362338 URL: https://svnweb.freebsd.org/changeset/base/362338 Log: Add the SCTP_SUPPORT kernel option. This is in preparation for enabling a loadable SCTP stack. Analogous to IPSEC/IPSEC_SUPPORT, the SCTP_SUPPORT kernel option must be configured in order to support a loadable SCTP implementation. Discussed with: tuexen MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/sctp.4 head/sys/conf/NOTES head/sys/conf/options head/sys/kern/uipc_socket.c head/sys/netinet/in_proto.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_output.c head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_crc32.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_output.c head/sys/netipsec/ipsec_output.c head/sys/netpfil/pf/pf.c Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Thu Jun 18 19:16:03 2020 (r362337) +++ head/share/man/man4/sctp.4 Thu Jun 18 19:32:34 2020 (r362338) @@ -26,13 +26,16 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2020 +.Dd June 18, 2020 .Dt SCTP 4 .Os .Sh NAME .Nm sctp .Nd Internet Stream Control Transmission Protocol .Sh SYNOPSIS +.Cd "options SCTP" +.Cd "options SCTP_SUPPORT" +.Pp .In sys/types.h .In sys/socket.h .In netinet/sctp.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/conf/NOTES Thu Jun 18 19:32:34 2020 (r362338) @@ -697,7 +697,12 @@ options LIBALIAS # the V6 and V4.. since an association can span # both a V6 and V4 address at the SAME time :-) # +# The SCTP_SUPPORT option does not enable SCTP, but provides the necessary +# support for loading SCTP as a loadable kernel module. +# options SCTP +options SCTP_SUPPORT + # There are bunches of options: # this one turns on all sorts of # nastily printing that you can @@ -710,6 +715,7 @@ options SCTP # bits and prints.. which makes the code run # faster.. if you are not debugging don't use. options SCTP_DEBUG + # # All that options after that turn on specific types of # logging. You can monitor CWND growth, flight size @@ -732,7 +738,6 @@ options SCTP_MBCNT_LOGGING options SCTP_PACKET_LOGGING options SCTP_LTRACE_CHUNKS options SCTP_LTRACE_ERRORS - # altq(9). Enable the base part of the hooks with the ALTQ option. # Individual disciplines must be built into the base system and can not be Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/conf/options Thu Jun 18 19:32:34 2020 (r362338) @@ -476,6 +476,7 @@ XBONEHACK # SCTP # SCTP opt_sctp.h +SCTP_SUPPORT opt_sctp.h SCTP_DEBUG opt_sctp.h # Enable debug printfs SCTP_LOCK_LOGGING opt_sctp.h # Log to KTR lock activity SCTP_MBUF_LOGGING opt_sctp.h # Log to KTR general mbuf aloc/free Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/kern/uipc_socket.c Thu Jun 18 19:32:34 2020 (r362338) @@ -793,7 +793,7 @@ sonewconn(struct socket *head, int connstatus) return (so); } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) /* * Socket part of sctp_peeloff(). Detach a new socket from an * association. The new socket is returned with a reference. Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet/in_proto.c Thu Jun 18 19:32:34 2020 (r362338) @@ -94,7 +94,7 @@ static struct pr_usrreqs nousrreqs; #include #include #include -#endif /* SCTP */ +#endif FEATURE(inet, "Internet Protocol version 4"); @@ -324,7 +324,7 @@ SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW | "UDP"); SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP"); -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) SYSCTL_NODE(_net_inet, IPPROTO_SCTP, sctp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "SCTP"); #endif Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet/ip_divert.c Thu Jun 18 19:32:34 2020 (r362338) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) #include #endif @@ -215,7 +215,7 @@ divert_packet(struct mbuf *m, bool incoming) in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP) { sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet/ip_output.c Thu Jun 18 19:32:34 2020 (r362338) @@ -86,7 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) #include #include #endif @@ -154,7 +154,7 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, in } m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID; -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif @@ -185,7 +185,7 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, in CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif @@ -753,7 +753,7 @@ sendit: goto bad; } } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { m = mb_unmapped_to_ext(m); if (m == NULL) { @@ -905,7 +905,7 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int m in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { m0 = mb_unmapped_to_ext(m0); if (m0 == NULL) { Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet/sctp_crc32.c Thu Jun 18 19:32:34 2020 (r362338) @@ -37,18 +37,17 @@ __FBSDID("$FreeBSD$"); #include "opt_sctp.h" -#include -#ifdef SCTP -#include -#include -#include -#include -#else #include #include +#include #include +#include #include +#ifdef SCTP +#include +#include +#include #endif static uint32_t @@ -117,7 +116,7 @@ sctp_calculate_cksum(struct mbuf *m, uint32_t offset) return (base); } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) /* * Compute and insert the SCTP checksum in network byte order for a given * mbuf chain m which contains an SCTP packet starting at offset. @@ -128,8 +127,10 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) uint32_t checksum; checksum = sctp_calculate_cksum(m, offset); +#ifdef SCTP SCTP_STAT_DECR(sctps_sendhwcrc); SCTP_STAT_INCR(sctps_sendswcrc); +#endif offset += offsetof(struct sctphdr, checksum); if (offset + sizeof(uint32_t) > (uint32_t)(m->m_pkthdr.len)) { Modified: head/sys/netinet/sctp_crc32.h ============================================================================== --- head/sys/netinet/sctp_crc32.h Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet/sctp_crc32.h Thu Jun 18 19:32:34 2020 (r362338) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) void sctp_delayed_cksum(struct mbuf *, uint32_t offset); #endif #endif /* _KERNEL */ Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet6/in6_proto.c Thu Jun 18 19:32:34 2020 (r362338) @@ -429,7 +429,7 @@ SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW "UDP6"); SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP6"); -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) SYSCTL_NODE(_net_inet6, IPPROTO_SCTP, sctp6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "SCTP6"); #endif Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet6/ip6_forward.c Thu Jun 18 19:32:34 2020 (r362338) @@ -360,7 +360,7 @@ again: CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netinet6/ip6_output.c Thu Jun 18 19:32:34 2020 (r362338) @@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) #include #include #endif @@ -221,7 +221,7 @@ ip6_output_delayed_csum(struct mbuf *m, struct ifnet * __func__, __LINE__, plen, optlen, m, ifp, csum_flags, frag)); if ((csum_flags & CSUM_DELAY_DATA_IPV6) || -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) (csum_flags & CSUM_SCTP_IPV6) || #endif (!frag && (ifp->if_capenable & IFCAP_NOMAP) == 0)) { @@ -238,7 +238,7 @@ ip6_output_delayed_csum(struct mbuf *m, struct ifnet * sizeof(struct ip6_hdr) + optlen); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (csum_flags & CSUM_SCTP_IPV6) { sctp_delayed_cksum(m, sizeof(struct ip6_hdr) + optlen); m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; @@ -1041,7 +1041,7 @@ nonh6lookup: CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif @@ -1073,7 +1073,7 @@ nonh6lookup: CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netipsec/ipsec_output.c Thu Jun 18 19:32:34 2020 (r362338) @@ -71,7 +71,7 @@ #ifdef INET6 #include #endif -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) #include #endif @@ -326,7 +326,7 @@ ipsec4_common_output(struct mbuf *m, struct inpcb *inp in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP) { struct ip *ip = mtod(m, struct ip *); @@ -621,7 +621,7 @@ ipsec6_common_output(struct mbuf *m, struct inpcb *inp sizeof(struct ip6_hdr), sizeof(struct ip6_hdr)); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Jun 18 19:16:03 2020 (r362337) +++ head/sys/netpfil/pf/pf.c Thu Jun 18 19:32:34 2020 (r362338) @@ -40,9 +40,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bpf.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_bpf.h" #include "opt_pf.h" #include "opt_sctp.h" @@ -103,7 +103,7 @@ __FBSDID("$FreeBSD$"); #include #endif /* INET6 */ -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) #include #endif @@ -5474,7 +5474,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2)); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; From owner-svn-src-all@freebsd.org Thu Jun 18 20:23:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38DD23328F8; Thu, 18 Jun 2020 20:23:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ntgR0p7Nz41dk; Thu, 18 Jun 2020 20:23:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16A36F993; Thu, 18 Jun 2020 20:23:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IKNkug041821; Thu, 18 Jun 2020 20:23:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IKNk6A041820; Thu, 18 Jun 2020 20:23:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006182023.05IKNk6A041820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Jun 2020 20:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362339 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 362339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 20:23:47 -0000 Author: mav Date: Thu Jun 18 20:23:46 2020 New Revision: 362339 URL: https://svnweb.freebsd.org/changeset/base/362339 Log: MFC r360503 (by imp): Move / reword a comment. Explain what we're doing with mapping CAM's notion of a LUN to NVMe's notion of a namespace. Modified: stable/12/sys/dev/nvme/nvme_sim.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_sim.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_sim.c Thu Jun 18 19:32:34 2020 (r362338) +++ stable/12/sys/dev/nvme/nvme_sim.c Thu Jun 18 20:23:46 2020 (r362339) @@ -172,12 +172,6 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) struct ccb_pathinq *cpi = &ccb->cpi; device_t dev = ctrlr->dev; - /* - * NVMe may have multiple LUNs on the same path. Current generation - * of NVMe devives support only a single name space. Multiple name - * space drives are coming, but it's unclear how we should report - * them up the stack. - */ cpi->version_num = 1; cpi->hba_inquiry = 0; cpi->target_sprt = 0; @@ -330,13 +324,17 @@ nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_ar return (NULL); } + /* + * We map the NVMe namespace idea onto the CAM unit LUN. For + * each new namespace, we create a new CAM path for it. We then + * rescan the path to get it to enumerate. + */ if (xpt_create_path(&ccb->ccb_h.path, /*periph*/NULL, cam_sim_path(sc->s_sim), 0, ns->id) != CAM_REQ_CMP) { printf("unable to create path for rescan\n"); xpt_free_ccb(ccb); return (NULL); } - xpt_rescan(ccb); return (ns); From owner-svn-src-all@freebsd.org Thu Jun 18 20:25:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFABB332837; Thu, 18 Jun 2020 20:25:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ntjf5g6Bz41dJ; Thu, 18 Jun 2020 20:25:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD48EF8AF; Thu, 18 Jun 2020 20:25:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IKPgYY042037; Thu, 18 Jun 2020 20:25:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IKPgFT042036; Thu, 18 Jun 2020 20:25:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006182025.05IKPgFT042036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Jun 2020 20:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362340 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 362340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 20:25:42 -0000 Author: mav Date: Thu Jun 18 20:25:42 2020 New Revision: 362340 URL: https://svnweb.freebsd.org/changeset/base/362340 Log: MFC r360504 (by imp): Style(9) nit: put function name at start of line. Modified: stable/12/sys/dev/nvme/nvme_ns.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_ns.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ns.c Thu Jun 18 20:23:46 2020 (r362339) +++ stable/12/sys/dev/nvme/nvme_ns.c Thu Jun 18 20:25:42 2020 (r362340) @@ -618,7 +618,8 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t return (0); } -void nvme_ns_destruct(struct nvme_namespace *ns) +void +nvme_ns_destruct(struct nvme_namespace *ns) { if (ns->cdev != NULL) From owner-svn-src-all@freebsd.org Thu Jun 18 20:41:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C635333679; Thu, 18 Jun 2020 20:41:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nv480wcZz43Db; Thu, 18 Jun 2020 20:41:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01D49FCB7; Thu, 18 Jun 2020 20:41:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IKfhs2051546; Thu, 18 Jun 2020 20:41:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IKfh2G051545; Thu, 18 Jun 2020 20:41:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202006182041.05IKfh2G051545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Jun 2020 20:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362341 - head/contrib/llvm-project/llvm/lib/Analysis X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/llvm/lib/Analysis X-SVN-Commit-Revision: 362341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 20:41:44 -0000 Author: dim Date: Thu Jun 18 20:41:43 2020 New Revision: 362341 URL: https://svnweb.freebsd.org/changeset/base/362341 Log: Merge commit 0cecafd647cc from llvm git (by Alina Sbirlea): [BasicAA] Make BasicAA a cfg pass. Summary: Part of the changes in D44564 made BasicAA not CFG only due to it using PhiAnalysisValues which may have values invalidated. Subsequent patches (rL340613) appear to have addressed this limitation. BasicAA should not be invalidated by non-CFG-altering passes. A concrete example is MemCpyOpt which preserves CFG, but we are testing it invalidates BasicAA. llvm-dev RFC: https://groups.google.com/forum/#!topic/llvm-dev/eSPXuWnNfzM Reviewers: john.brawn, sebpop, hfinkel, brzycki Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74353 This fixes an issue with clang's -fintegrated-cc1 feature, which could make it output slightly different assembly code, depending on the way it was invoked. In r361755 we attempted to work around it by disabling the integrated cc1 stage, but it did not solve the root cause for all situations. Extensive testing and bisecting showed that the above change finally makes the output deterministic, even if -fintegrated-cc1 is on. Reported by: Fabian Keil PR: 246630 MFC after: 3 days Modified: head/contrib/llvm-project/llvm/lib/Analysis/BasicAliasAnalysis.cpp Modified: head/contrib/llvm-project/llvm/lib/Analysis/BasicAliasAnalysis.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Analysis/BasicAliasAnalysis.cpp Thu Jun 18 20:25:42 2020 (r362340) +++ head/contrib/llvm-project/llvm/lib/Analysis/BasicAliasAnalysis.cpp Thu Jun 18 20:41:43 2020 (r362341) @@ -2059,12 +2059,13 @@ char BasicAAWrapperPass::ID = 0; void BasicAAWrapperPass::anchor() {} INITIALIZE_PASS_BEGIN(BasicAAWrapperPass, "basicaa", - "Basic Alias Analysis (stateless AA impl)", false, true) + "Basic Alias Analysis (stateless AA impl)", true, true) INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker) INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass) +INITIALIZE_PASS_DEPENDENCY(PhiValuesWrapperPass) INITIALIZE_PASS_END(BasicAAWrapperPass, "basicaa", - "Basic Alias Analysis (stateless AA impl)", false, true) + "Basic Alias Analysis (stateless AA impl)", true, true) FunctionPass *llvm::createBasicAAWrapperPass() { return new BasicAAWrapperPass(); From owner-svn-src-all@freebsd.org Thu Jun 18 20:49:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97FF8333A1A; Thu, 18 Jun 2020 20:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nvFd3LFrz43Xk; Thu, 18 Jun 2020 20:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69791FBB6; Thu, 18 Jun 2020 20:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IKnvBK055273; Thu, 18 Jun 2020 20:49:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IKnvje055272; Thu, 18 Jun 2020 20:49:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006182049.05IKnvje055272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Jun 2020 20:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362342 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 362342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 20:49:57 -0000 Author: kib Date: Thu Jun 18 20:49:56 2020 New Revision: 362342 URL: https://svnweb.freebsd.org/changeset/base/362342 Log: Fix execution of linux binary from multithreaded non-Linux process. If multithreaded non-Linux process execs Linux binary, then non-Linux threads different from the one that execing are cleared by single-threading at boundary, and then terminating them in post_execve(). Since at that time the process is already switched to linux ABI, linuxolator is involved in the thread clearing on boundary, but cannot find the emul data. Handle it by pre-creating emuldata for all threads in the execing process. Also remove a code in linux_proc_exec() handler that cleared emul data for other threads when execing from multithreaded Linux process. It is excessive. PR: 247020 Reported by: Martin FIlla Reported by: Henrique L. Amorim, Independent Security Researcher Reported by: Rodrigo Rubira Branco (BSDaemon), Amazon Web Services Reviewed by: markj Tested by: trasz Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25293 Modified: head/sys/compat/linux/linux_emul.c Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Thu Jun 18 20:41:43 2020 (r362341) +++ head/sys/compat/linux/linux_emul.c Thu Jun 18 20:49:56 2020 (r362342) @@ -291,22 +291,13 @@ linux_common_execve(struct thread *td, struct image_ar void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { - struct thread *td = curthread; + struct thread *td; struct thread *othertd; #if defined(__amd64__) struct linux_pemuldata *pem; #endif - /* - * In a case of execing from Linux binary properly detach - * other threads from the user space. - */ - if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) { - FOREACH_THREAD_IN_PROC(p, othertd) { - if (td != othertd) - (p->p_sysent->sv_thread_detach)(othertd); - } - } + td = curthread; /* * In a case of execing to Linux binary we create Linux @@ -314,11 +305,32 @@ linux_proc_exec(void *arg __unused, struct proc *p, st */ if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)) { - - if (SV_PROC_ABI(p) == SV_ABI_LINUX) + if (SV_PROC_ABI(p) == SV_ABI_LINUX) { + /* + * Process already was under Linuxolator + * before exec. Update emuldata to reflect + * single-threaded cleaned state after exec. + */ linux_proc_init(td, NULL, 0); - else + } else { + /* + * We are switching the process to Linux emulator. + */ linux_proc_init(td, td, 0); + + /* + * Create a transient td_emuldata for all suspended + * threads, so that p->p_sysent->sv_thread_detach() == + * linux_thread_detach() can find expected but unused + * emuldata. + */ + FOREACH_THREAD_IN_PROC(td->td_proc, othertd) { + if (othertd != td) { + linux_proc_init(td, othertd, + LINUX_CLONE_THREAD); + } + } + } #if defined(__amd64__) /* * An IA32 executable which has executable stack will have the From owner-svn-src-all@freebsd.org Thu Jun 18 21:29:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5C2B334759; Thu, 18 Jun 2020 21:29:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nw741RqVz45j3; Thu, 18 Jun 2020 21:29:19 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f66.google.com with SMTP id o5so8934593iow.8; Thu, 18 Jun 2020 14:29:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fAn31h6g3o3MJ3TXn70NIgc5+f0Vl9V636Ph/O4DiVU=; b=VugG6M6JEBs9Jt4NC6G/Fk6DsBeINxSzOEev4CzqWB8tIcXJBQ9dt5QIOUwyBS5psP 4gLyFpv81StATjv4B1Irj6AMP32yeTtXmlXNu6nt0STjS/NVW6StURC2xIi5zVfItqzG cZZ8CAZtK3zSw8bdwBuPLlbnVfXjsBRbt//HyBirnVP5iaqVsXwx0KxojCovbEvPZYfC n/TpQD45aN5nQ0dvC/+fcFDbZSzmvnhJM4E9HXav6hylQ/GzXECgmnbHBy1k2DnKxyVo S5a2zQO0ZYCPqy66jfCDY47psIIlRR05rtLidPfDUOwKTg3csBJ6l+RVMzT+3JO6RW0W NhyQ== X-Gm-Message-State: AOAM532MxSGwdvZxkjjVSgRdWAKIeuGVn/jHgjfPdj8rFTaLKX3QF3hy jA0llSD7Ke9v5ajjWEXWXY7J2zkZ1f0EylBnXwmJCw== X-Google-Smtp-Source: ABdhPJwP0gufqok8+tQ6Q7vkG42jB5ChIDggiMxHU4vsinppNJQlohuyxfLE0KxOxgIR+sHivigUzLWOWAuGTc8x3S8= X-Received: by 2002:a02:ba93:: with SMTP id g19mr641437jao.136.1592515757159; Thu, 18 Jun 2020 14:29:17 -0700 (PDT) MIME-Version: 1.0 References: <202006171956.05HJuH8B032154@repo.freebsd.org> <831631E9-2F54-4E5F-950A-B923B0A3DADA@freebsd.org> In-Reply-To: <831631E9-2F54-4E5F-950A-B923B0A3DADA@freebsd.org> From: Ed Maste Date: Thu, 18 Jun 2020 17:29:05 -0400 Message-ID: Subject: Re: svn commit: r362285 - head/sys/dev/pci To: Jessica Clarke Cc: Andrew Turner , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49nw741RqVz45j3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 21:29:21 -0000 On Thu, 18 Jun 2020 at 08:48, Jessica Clarke wrote: > > On 18 Jun 2020, at 13:23, Ed Maste wrote: > > On Wed, 17 Jun 2020 at 15:56, Andrew Turner wrote: > >> > >> Author: andrew > >> Date: Wed Jun 17 19:56:17 2020 > >> New Revision: 362285 > >> URL: https://svnweb.freebsd.org/changeset/base/362285 > >> > >> Log: > >> Clean up the pci host generic driver > > ... > >> > >> + /* Translate the address from a PCI address to a physical address */ > >> + switch (type) { > >> + case SYS_RES_IOPORT: > >> + case SYS_RES_MEMORY: > >> + found = false; > >> + for (i = 0; i < MAX_RANGES_TUPLES; i++) { > >> + pci_base = sc->ranges[i].pci_base; > >> + phys_base = sc->ranges[i].phys_base; > >> + size = sc->ranges[i].size; > >> + > >> + if (start < pci_base || start >= pci_base + size) > >> + continue; > > > > Should the second condition be end instead? markj had this comment on > > the old version in review D20884. > > The code previously had: > > > if ((rman_get_start(r) >= pci_base) && (rman_get_start(r) < (pci_base + size))) > > found = 1; > > break; > > } > > The new code is just the inverted form of that. Yes; Mark made the comment (that the 2nd rman_get_start should be rman_get_end) about the previous version of the code but no change was made. I believe that comment still applies. From owner-svn-src-all@freebsd.org Thu Jun 18 21:42:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4989B334E33; Thu, 18 Jun 2020 21:42:55 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nwQl10R2z46vL; Thu, 18 Jun 2020 21:42:55 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DA031081F; Thu, 18 Jun 2020 21:42:55 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05ILgspG091827; Thu, 18 Jun 2020 21:42:54 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05ILgsae091825; Thu, 18 Jun 2020 21:42:54 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202006182142.05ILgsae091825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Thu, 18 Jun 2020 21:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362343 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 362343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 21:42:55 -0000 Author: kaktus Date: Thu Jun 18 21:42:54 2020 New Revision: 362343 URL: https://svnweb.freebsd.org/changeset/base/362343 Log: hw.bus.info: rework handler hw.bus.info was added in r68522 as a node, but there was never anything connected "behind" it. Its only purpose is to return a struct u_businfo. The only in-base consumer are devinfo(3)/devinfo(8). Rewrite the handler as SYSCTL_PROC and mark it as MPSAFE and read-only as there never was a writable path. Reviewed by: kib Approved by: kib (mentor) Sponsored by: Mysterious Code Ltd. Differential Revision: https://reviews.freebsd.org/D25321 Modified: head/sys/kern/subr_bus.c head/sys/sys/sysctl.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Jun 18 20:49:56 2020 (r362342) +++ head/sys/kern/subr_bus.c Thu Jun 18 21:42:54 2020 (r362343) @@ -5454,7 +5454,7 @@ print_devclass_list(void) */ static int -sysctl_bus(SYSCTL_HANDLER_ARGS) +sysctl_bus_info(SYSCTL_HANDLER_ARGS) { struct u_businfo ubus; @@ -5463,7 +5463,8 @@ sysctl_bus(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &ubus, sizeof(ubus))); } -SYSCTL_NODE(_hw_bus, OID_AUTO, info, CTLFLAG_RW | CTLFLAG_NEEDGIANT, sysctl_bus, +SYSCTL_PROC(_hw_bus, OID_AUTO, info, CTLTYPE_STRUCT | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, sysctl_bus_info, "S,u_businfo", "bus-related data"); static int @@ -5555,7 +5556,8 @@ bus_data_generation_check(int generation) void bus_data_generation_update(void) { - bus_data_generation++; + + atomic_add_int(&bus_data_generation, 1); } int Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Jun 18 20:49:56 2020 (r362342) +++ head/sys/sys/sysctl.h Thu Jun 18 21:42:54 2020 (r362343) @@ -1122,7 +1122,6 @@ SYSCTL_DECL(_dev); SYSCTL_DECL(_hw); SYSCTL_DECL(_hw_bus); SYSCTL_DECL(_hw_bus_devices); -SYSCTL_DECL(_hw_bus_info); SYSCTL_DECL(_machdep); SYSCTL_DECL(_machdep_mitigations); SYSCTL_DECL(_user); From owner-svn-src-all@freebsd.org Thu Jun 18 21:44:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDF08334ED9; Thu, 18 Jun 2020 21:44:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nwSz4sVTz474D; Thu, 18 Jun 2020 21:44:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1B111090E; Thu, 18 Jun 2020 21:44:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05ILipeG091989; Thu, 18 Jun 2020 21:44:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05ILinnB091978; Thu, 18 Jun 2020 21:44:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006182144.05ILinnB091978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 18 Jun 2020 21:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362344 - in stable/12/sys: arm/amlogic/aml8726 arm64/conf conf dev/mmc/host mips/ingenic X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/amlogic/aml8726 arm64/conf conf dev/mmc/host mips/ingenic X-SVN-Commit-Revision: 362344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 21:44:51 -0000 Author: manu Date: Thu Jun 18 21:44:49 2020 New Revision: 362344 URL: https://svnweb.freebsd.org/changeset/base/362344 Log: MFC r349584, r349728, r349731, r350440, r350443, r351185, r353493, r353575, r355625, r355627, r355629, r356813 r349584: Since r349571 we need all the accessor to be present for set or get otherwise we panic. dwmmc don't handle VCCQ (voltage for the IO line of the SD/eMMC) or TIMING. Add the needed accessor in the {read,write}_ivar functions. Reviewed by: imp (previous version) r349728 by imp: Implement missing MMCBR ivars All MMCBR bridges have to implement all the MMCBR variables. This implements them for everybody that currently doesn't. A common routine for this should be written. r349731 by imp: Fix cut-and-pasto that slipped through my testing. r350440 by br: Add support for the SD/MMC controller found in Terasic DE10-Pro (an Intel Stratix 10 GX/SX FPGA Development Kit). Set the bus speed manually due to lack of clock management support. Sponsored by: DARPA, AFRL r350443 by br: Fix MMCCAM kernel build. Sponsored by: DARPA, AFRL r351185 by mmel: Enhance support of extres in dwmmc driver. Handle all clocks, regulators and resets defined by dwmmc bindings. r353493 by br: Fix the driver attachment in cases when the external resource devices (resets, regulators, clocks) are not available. Rely on a system initialization done by a bootloader in that cases. This fixes operation on Terasic DE10-Pro (an Intel Stratix 10 development kit). Sponsored by: DARPA, AFRL r353575 by br: Fix dwmmc(4) driver attachment when ext_resources are not present. Ignore only ENOENT (no DTS properties found) and ENODEV (driver not present) non-zero return values from ext_resources. Reviewed by: manu Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22043 r355625: dwmmc: Add a detach method This method will disable the regulators, clocks and assert the reset of the module. It will also detach it's children (the mmc device) and release it's resources. While here enable the regulators on attach as we need them to power up the sdcard or emmc. r355627: dwmmc: Handle the card detect interrupt The driver used to always add the mmc device as it's child even it no card was detected. Add a function that will detect if the card is present or not and that will attach/detach the mmc device. The function is either call on attach (as we won't have the interrupt fired) or from two taskqueues. The first taskqueue will directly call the function when the sdcard was present and is now removed and the other one will delay a bit the attach when we didn't had a card and now have one. This is mostly based on comments from the sdhci driver where it describe a situation when the CD pin is detected before the others pins are connected. r355629: dwmmc: Use device_delete_children Instead of first detaching the children(s) and then delete them, use the device_delete_children function that does all of that. Suggested by: ian r356813: dwmmc: Remove max_hz from the softc We never use it so directly set the value to the mmc host structure. Modified: stable/12/sys/arm/amlogic/aml8726/aml8726_mmc.c stable/12/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 stable/12/sys/dev/mmc/host/dwmmc.c stable/12/sys/dev/mmc/host/dwmmc_altera.c stable/12/sys/dev/mmc/host/dwmmc_hisi.c stable/12/sys/dev/mmc/host/dwmmc_rockchip.c stable/12/sys/dev/mmc/host/dwmmc_samsung.c stable/12/sys/dev/mmc/host/dwmmc_var.h stable/12/sys/mips/ingenic/jz4780_mmc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/amlogic/aml8726/aml8726_mmc.c ============================================================================== --- stable/12/sys/arm/amlogic/aml8726/aml8726_mmc.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/arm/amlogic/aml8726/aml8726_mmc.c Thu Jun 18 21:44:49 2020 (r362344) @@ -965,15 +965,26 @@ aml8726_mmc_read_ivar(device_t bus, device_t child, case MMCBR_IVAR_POWER_MODE: *(int *)result = sc->host.ios.power_mode; break; + case MMCBR_IVAR_RETUNE_REQ: + *(int *)result = return_req_none; case MMCBR_IVAR_VDD: *(int *)result = sc->host.ios.vdd; break; + case MMCBR_IVAR_VCCQ: + *result = sc->sc_host.ios.vccq; + break; case MMCBR_IVAR_CAPS: *(int *)result = sc->host.caps; break; + case MMCBR_IVAR_TIMING: + *(int *)result = sc->sc_host.ios.timing; + break; case MMCBR_IVAR_MAX_DATA: *(int *)result = AML_MMC_MAX_DMA / MMC_SECTOR_SIZE; break; + case MMCBR_IVAR_MAX_BUSY_TIMEOUT: + *(int *)result = 1000000; /* 1s max */ + break; default: return (EINVAL); } @@ -1011,6 +1022,12 @@ aml8726_mmc_write_ivar(device_t bus, device_t child, break; case MMCBR_IVAR_VDD: sc->host.ios.vdd = value; + break; + case MMCBR_IVAR_VCCQ: + sc->sc_host.ios.vccq = value; + break; + case MMCBR_IVAR_TIMING: + sc->sc_host.ios.timing = value; break; /* These are read-only */ case MMCBR_IVAR_CAPS: Modified: stable/12/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- stable/12/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Thu Jun 18 21:44:49 2020 (r362344) @@ -1245,15 +1245,27 @@ aml8726_sdxc_read_ivar(device_t bus, device_t child, case MMCBR_IVAR_POWER_MODE: *(int *)result = sc->host.ios.power_mode; break; + case MMCBR_IVAR_RETUNE_REQ: + *(int *)result = return_req_none; + break; case MMCBR_IVAR_VDD: *(int *)result = sc->host.ios.vdd; break; + case MMCBR_IVAR_VCCQ: + *result = sc->host.ios.vccq; + break; case MMCBR_IVAR_CAPS: *(int *)result = sc->host.caps; break; + case MMCBR_IVAR_TIMING: + *(int *)result = sc->host.ios.timing; + break; case MMCBR_IVAR_MAX_DATA: *(int *)result = AML_SDXC_MAX_DMA / MMC_SECTOR_SIZE; break; + case MMCBR_IVAR_MAX_BUSY_TIMEOUT: + *(int *)result = 1000000; /* 1s max */ + break; default: return (EINVAL); } @@ -1291,6 +1303,12 @@ aml8726_sdxc_write_ivar(device_t bus, device_t child, break; case MMCBR_IVAR_VDD: sc->host.ios.vdd = value; + break; + case MMCBR_IVAR_VCCQ: + sc->host.ios.vccq = value; + break; + case MMCBR_IVAR_TIMING: + sc->host.ios.timing = value; break; /* These are read-only */ case MMCBR_IVAR_CAPS: Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/arm64/conf/GENERIC Thu Jun 18 21:44:49 2020 (r362344) @@ -166,6 +166,7 @@ device aw_mmc # Allwinner SD/MMC controller device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device dwmmc +device dwmmc_altera device rk_emmcphy # Serial (COM) ports Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/conf/files.arm64 Thu Jun 18 21:44:49 2020 (r362344) @@ -223,6 +223,7 @@ dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/mbox/mbox_if.m optional soc_brcm_bcm2837 dev/mmc/host/dwmmc.c optional dwmmc fdt +dev/mmc/host/dwmmc_altera.c optional dwmmc fdt dwmmc_altera dev/mmc/host/dwmmc_hisi.c optional dwmmc fdt soc_hisi_hi6220 dev/mmc/host/dwmmc_rockchip.c optional dwmmc fdt soc_rockchip_rk3328 dev/neta/if_mvneta_fdt.c optional neta fdt Modified: stable/12/sys/dev/mmc/host/dwmmc.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/dev/mmc/host/dwmmc.c Thu Jun 18 21:44:49 2020 (r362344) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Ruslan Bukin + * Copyright (c) 2014-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -125,6 +127,7 @@ static int dma_done(struct dwmmc_softc *, struct mmc_c static int dma_stop(struct dwmmc_softc *); static void pio_read(struct dwmmc_softc *, struct mmc_command *); static void pio_write(struct dwmmc_softc *, struct mmc_command *); +static void dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present); static struct resource_spec dwmmc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -372,7 +375,8 @@ dwmmc_intr(void *arg) sc->dto_rcvd = 1; if (reg & SDMMC_INTMASK_CD) { - /* XXX: Handle card detect */ + dwmmc_handle_card_present(sc, + READ4(sc, SDMMC_CDETECT) == 0 ? true : false); } } @@ -405,6 +409,56 @@ dwmmc_intr(void *arg) DWMMC_UNLOCK(sc); } +static void +dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present) +{ + bool was_present; + + was_present = sc->child != NULL; + + if (!was_present && is_present) { + taskqueue_enqueue_timeout(taskqueue_swi_giant, + &sc->card_delayed_task, -(hz / 2)); + } else if (was_present && !is_present) { + taskqueue_enqueue(taskqueue_swi_giant, &sc->card_task); + } +} + +static void +dwmmc_card_task(void *arg, int pending __unused) +{ + struct dwmmc_softc *sc = arg; + + DWMMC_LOCK(sc); + + if (READ4(sc, SDMMC_CDETECT) == 0) { + if (sc->child == NULL) { + if (bootverbose) + device_printf(sc->dev, "Card inserted\n"); + + sc->child = device_add_child(sc->dev, "mmc", -1); + DWMMC_UNLOCK(sc); + if (sc->child) { + device_set_ivars(sc->child, sc); + (void)device_probe_and_attach(sc->child); + } + } else + DWMMC_UNLOCK(sc); + + } else { + /* Card isn't present, detach if necessary */ + if (sc->child != NULL) { + if (bootverbose) + device_printf(sc->dev, "Card removed\n"); + + DWMMC_UNLOCK(sc); + device_delete_child(sc->dev, sc->child); + sc->child = NULL; + } else + DWMMC_UNLOCK(sc); + } +} + static int parse_fdt(struct dwmmc_softc *sc) { @@ -428,8 +482,8 @@ parse_fdt(struct dwmmc_softc *sc) sc->host.caps |= MMC_CAP_8_BIT_DATA; /* max-frequency */ - if (OF_getencprop(node, "max-frequency", &sc->max_hz, sizeof(uint32_t)) <= 0) - sc->max_hz = 200000000; + if (OF_getencprop(node, "max-frequency", &sc->host.f_max, sizeof(uint32_t)) <= 0) + sc->host.f_max = 200000000; /* fifo-depth */ if ((len = OF_getproplen(node, "fifo-depth")) > 0) { @@ -452,8 +506,54 @@ parse_fdt(struct dwmmc_softc *sc) } #ifdef EXT_RESOURCES + + /* IP block reset is optional */ + error = hwreset_get_by_ofw_name(sc->dev, 0, "reset", &sc->hwreset); + if (error != 0 && + error != ENOENT && + error != ENODEV) { + device_printf(sc->dev, "Cannot get reset\n"); + goto fail; + } + + /* vmmc regulator is optional */ + error = regulator_get_by_ofw_property(sc->dev, 0, "vmmc-supply", + &sc->vmmc); + if (error != 0 && + error != ENOENT && + error != ENODEV) { + device_printf(sc->dev, "Cannot get regulator 'vmmc-supply'\n"); + goto fail; + } + + /* vqmmc regulator is optional */ + error = regulator_get_by_ofw_property(sc->dev, 0, "vqmmc-supply", + &sc->vqmmc); + if (error != 0 && + error != ENOENT && + error != ENODEV) { + device_printf(sc->dev, "Cannot get regulator 'vqmmc-supply'\n"); + goto fail; + } + + /* Assert reset first */ + if (sc->hwreset != NULL) { + error = hwreset_assert(sc->hwreset); + if (error != 0) { + device_printf(sc->dev, "Cannot assert reset\n"); + goto fail; + } + } + /* BIU (Bus Interface Unit clock) is optional */ error = clk_get_by_ofw_name(sc->dev, 0, "biu", &sc->biu); + if (error != 0 && + error != ENOENT && + error != ENODEV) { + device_printf(sc->dev, "Cannot get 'biu' clock\n"); + goto fail; + } + if (sc->biu) { error = clk_enable(sc->biu); if (error != 0) { @@ -467,20 +567,52 @@ parse_fdt(struct dwmmc_softc *sc) * if no clock-frequency property is given */ error = clk_get_by_ofw_name(sc->dev, 0, "ciu", &sc->ciu); + if (error != 0 && + error != ENOENT && + error != ENODEV) { + device_printf(sc->dev, "Cannot get 'ciu' clock\n"); + goto fail; + } + if (sc->ciu) { - error = clk_enable(sc->ciu); - if (error != 0) { - device_printf(sc->dev, "cannot enable ciu clock\n"); - goto fail; - } if (bus_hz != 0) { error = clk_set_freq(sc->ciu, bus_hz, 0); if (error != 0) device_printf(sc->dev, "cannot set ciu clock to %u\n", bus_hz); } + error = clk_enable(sc->ciu); + if (error != 0) { + device_printf(sc->dev, "cannot enable ciu clock\n"); + goto fail; + } clk_get_freq(sc->ciu, &sc->bus_hz); } + + /* Enable regulators */ + if (sc->vmmc != NULL) { + error = regulator_enable(sc->vmmc); + if (error != 0) { + device_printf(sc->dev, "Cannot enable vmmc regulator\n"); + goto fail; + } + } + if (sc->vqmmc != NULL) { + error = regulator_enable(sc->vqmmc); + if (error != 0) { + device_printf(sc->dev, "Cannot enable vqmmc regulator\n"); + goto fail; + } + } + + /* Take dwmmc out of reset */ + if (sc->hwreset != NULL) { + error = hwreset_deassert(sc->hwreset); + if (error != 0) { + device_printf(sc->dev, "Cannot deassert reset\n"); + goto fail; + } + } #endif /* EXT_RESOURCES */ if (sc->bus_hz == 0) { @@ -592,15 +724,64 @@ dwmmc_attach(device_t dev) WRITE4(sc, SDMMC_CTRL, SDMMC_CTRL_INT_ENABLE); sc->host.f_min = 400000; - sc->host.f_max = sc->max_hz; sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps |= MMC_CAP_HSPEED; sc->host.caps |= MMC_CAP_SIGNALING_330; - device_add_child(dev, "mmc", -1); - return (bus_generic_attach(dev)); + TASK_INIT(&sc->card_task, 0, dwmmc_card_task, sc); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->card_delayed_task, 0, + dwmmc_card_task, sc); + + /* + * Schedule a card detection as we won't get an interrupt + * if the card is inserted when we attach + */ + dwmmc_card_task(sc, 0); + + return (0); } +int +dwmmc_detach(device_t dev) +{ + struct dwmmc_softc *sc; + int ret; + + sc = device_get_softc(dev); + + ret = device_delete_children(dev); + if (ret != 0) + return (ret); + + taskqueue_drain(taskqueue_swi_giant, &sc->card_task); + taskqueue_drain_timeout(taskqueue_swi_giant, &sc->card_delayed_task); + + if (sc->intr_cookie != NULL) { + ret = bus_teardown_intr(dev, sc->res[1], sc->intr_cookie); + if (ret != 0) + return (ret); + } + bus_release_resources(dev, dwmmc_spec, sc->res); + + DWMMC_LOCK_DESTROY(sc); + +#ifdef EXT_RESOURCES + if (sc->hwreset != NULL && hwreset_deassert(sc->hwreset) != 0) + device_printf(sc->dev, "cannot deassert reset\n"); + if (sc->biu != NULL && clk_disable(sc->biu) != 0) + device_printf(sc->dev, "cannot disable biu clock\n"); + if (sc->ciu != NULL && clk_disable(sc->ciu) != 0) + device_printf(sc->dev, "cannot disable ciu clock\n"); + + if (sc->vmmc && regulator_disable(sc->vmmc) != 0) + device_printf(sc->dev, "Cannot disable vmmc regulator\n"); + if (sc->vqmmc && regulator_disable(sc->vqmmc) != 0) + device_printf(sc->dev, "Cannot disable vqmmc regulator\n"); +#endif + + return (0); +} + static int dwmmc_setup_bus(struct dwmmc_softc *sc, int freq) { @@ -1090,11 +1271,18 @@ dwmmc_read_ivar(device_t bus, device_t child, int whic case MMCBR_IVAR_VDD: *(int *)result = sc->host.ios.vdd; break; + case MMCBR_IVAR_VCCQ: + *(int *)result = sc->host.ios.vccq; + break; case MMCBR_IVAR_CAPS: *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: *(int *)result = sc->desc_count; + break; + case MMCBR_IVAR_TIMING: + *(int *)result = sc->host.ios.timing; + break; } return (0); } @@ -1132,6 +1320,12 @@ dwmmc_write_ivar(device_t bus, device_t child, int whi break; case MMCBR_IVAR_VDD: sc->host.ios.vdd = value; + break; + case MMCBR_IVAR_TIMING: + sc->host.ios.timing = value; + break; + case MMCBR_IVAR_VCCQ: + sc->host.ios.vccq = value; break; /* These are read-only */ case MMCBR_IVAR_CAPS: Modified: stable/12/sys/dev/mmc/host/dwmmc_altera.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_altera.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/dev/mmc/host/dwmmc_altera.c Thu Jun 18 21:44:49 2020 (r362344) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -41,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include +#include "opt_mmccam.h" + static struct ofw_compat_data compat_data[] = { {"altr,socfpga-dw-mshc", 1}, {NULL, 0}, @@ -66,9 +70,17 @@ static int altera_dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; + phandle_t root; sc = device_get_softc(dev); sc->hwtype = HWTYPE_ALTERA; + + root = OF_finddevice("/"); + + if (ofw_bus_node_is_compatible(root, "altr,socfpga-stratix10")) { + sc->bus_hz = 24000000; + sc->use_pio = 1; + } return (dwmmc_attach(dev)); } Modified: stable/12/sys/dev/mmc/host/dwmmc_hisi.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_hisi.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/dev/mmc/host/dwmmc_hisi.c Thu Jun 18 21:44:49 2020 (r362344) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include Modified: stable/12/sys/dev/mmc/host/dwmmc_rockchip.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_rockchip.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/dev/mmc/host/dwmmc_rockchip.c Thu Jun 18 21:44:49 2020 (r362344) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -134,6 +136,7 @@ static device_method_t rockchip_dwmmc_methods[] = { /* bus interface */ DEVMETHOD(device_probe, rockchip_dwmmc_probe), DEVMETHOD(device_attach, rockchip_dwmmc_attach), + DEVMETHOD(device_detach, dwmmc_detach), DEVMETHOD_END }; Modified: stable/12/sys/dev/mmc/host/dwmmc_samsung.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_samsung.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/dev/mmc/host/dwmmc_samsung.c Thu Jun 18 21:44:49 2020 (r362344) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include Modified: stable/12/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_var.h Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/dev/mmc/host/dwmmc_var.h Thu Jun 18 21:44:49 2020 (r362344) @@ -35,6 +35,8 @@ #ifdef EXT_RESOURCES #include +#include +#include #endif enum { @@ -59,6 +61,9 @@ struct dwmmc_softc { uint32_t use_pio; uint32_t pwren_inverted; u_int desc_count; + device_t child; + struct task card_task; /* Card presence check task */ + struct timeout_task card_delayed_task;/* Card insert delayed task */ int (*update_ios)(struct dwmmc_softc *sc, struct mmc_ios *ios); @@ -74,7 +79,6 @@ struct dwmmc_softc { uint32_t acd_rcvd; uint32_t cmd_done; uint64_t bus_hz; - uint32_t max_hz; uint32_t fifo_depth; uint32_t num_slots; uint32_t sdr_timing; @@ -83,11 +87,15 @@ struct dwmmc_softc { #ifdef EXT_RESOURCES clk_t biu; clk_t ciu; + hwreset_t hwreset; + regulator_t vmmc; + regulator_t vqmmc; #endif }; DECLARE_CLASS(dwmmc_driver); int dwmmc_attach(device_t); +int dwmmc_detach(device_t); #endif Modified: stable/12/sys/mips/ingenic/jz4780_mmc.c ============================================================================== --- stable/12/sys/mips/ingenic/jz4780_mmc.c Thu Jun 18 21:42:54 2020 (r362343) +++ stable/12/sys/mips/ingenic/jz4780_mmc.c Thu Jun 18 21:44:49 2020 (r362344) @@ -774,17 +774,26 @@ jz4780_mmc_read_ivar(device_t bus, device_t child, int case MMCBR_IVAR_POWER_MODE: *(int *)result = sc->sc_host.ios.power_mode; break; + case MMCBR_IVAR_RETUNE_REQ: + *(int *)result = return_req_none; + break; case MMCBR_IVAR_VDD: *(int *)result = sc->sc_host.ios.vdd; break; + case MMCBR_IVAR_VCCQ: + *result = sc->sc_host.ios.vccq; + break; case MMCBR_IVAR_CAPS: *(int *)result = sc->sc_host.caps; break; + case MMCBR_IVAR_TIMING: + *(int *)result = sc->sc_host.ios.timing; + break; case MMCBR_IVAR_MAX_DATA: *(int *)result = 65535; break; - case MMCBR_IVAR_TIMING: - *(int *)result = sc->sc_host.ios.timing; + case MMCBR_IVAR_MAX_BUSY_TIMEOUT: + *(int *)result = 1000000; /* 1s max */ break; } @@ -824,6 +833,9 @@ jz4780_mmc_write_ivar(device_t bus, device_t child, in break; case MMCBR_IVAR_VDD: sc->sc_host.ios.vdd = value; + break; + case MMCBR_IVAR_VCCQ: + sc->sc_host.ios.vccq = value; break; case MMCBR_IVAR_TIMING: sc->sc_host.ios.timing = value; From owner-svn-src-all@freebsd.org Thu Jun 18 22:10:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB57833598B; Thu, 18 Jun 2020 22:10:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nx2652dBz488c; Thu, 18 Jun 2020 22:10:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A838210E8C; Thu, 18 Jun 2020 22:10:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IMA6CU004661; Thu, 18 Jun 2020 22:10:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IMA6o5004660; Thu, 18 Jun 2020 22:10:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202006182210.05IMA6o5004660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 18 Jun 2020 22:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362345 - stable/12/usr.sbin/services_mkdb X-SVN-Group: stable-12 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/12/usr.sbin/services_mkdb X-SVN-Commit-Revision: 362345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 22:10:06 -0000 Author: pfg Date: Thu Jun 18 22:10:06 2020 New Revision: 362345 URL: https://svnweb.freebsd.org/changeset/base/362345 Log: services: Add SSDP to service database This is used for UPnP and is registered in the IANA database. PR: 241573 Modified: stable/12/usr.sbin/services_mkdb/services Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/services_mkdb/services ============================================================================== --- stable/12/usr.sbin/services_mkdb/services Thu Jun 18 21:44:49 2020 (r362344) +++ stable/12/usr.sbin/services_mkdb/services Thu Jun 18 22:10:06 2020 (r362345) @@ -1602,6 +1602,8 @@ pptp 1723/tcp #Point-to-point tunnelling protocol # IMPORTANT NOTE: See comments for ports 1645/1646 when using older equipment radius 1812/udp #RADIUS authentication protocol (IANA sanctioned) radacct 1813/udp #RADIUS accounting protocol (IANA sanctioned) +ssdp 1900/tcp #Selective Service Discovery Protocol (UPnP) +ssdp 1900/udp #Selective Service Discovery Protocol (UPnP) licensedaemon 1986/tcp #cisco license management licensedaemon 1986/udp #cisco license management tr-rsrb-p1 1987/tcp #cisco RSRB Priority 1 port From owner-svn-src-all@freebsd.org Thu Jun 18 23:06:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFA3433744E; Thu, 18 Jun 2020 23:06:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nyGj4YgVz4CqC; Thu, 18 Jun 2020 23:06:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9365B11622; Thu, 18 Jun 2020 23:06:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IN659o040888; Thu, 18 Jun 2020 23:06:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IN65HS040887; Thu, 18 Jun 2020 23:06:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006182306.05IN65HS040887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Jun 2020 23:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362346 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 362346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:06:05 -0000 Author: kib Date: Thu Jun 18 23:06:05 2020 New Revision: 362346 URL: https://svnweb.freebsd.org/changeset/base/362346 Log: rtld: Parse own phdr and notes. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25319 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jun 18 22:10:06 2020 (r362345) +++ head/libexec/rtld-elf/rtld.c Thu Jun 18 23:06:05 2020 (r362346) @@ -2182,6 +2182,34 @@ process_z(Obj_Entry *root) } } } + +static void +parse_rtld_phdr(Obj_Entry *obj) +{ + const Elf_Phdr *ph; + Elf_Addr note_start, note_end; + + obj->stack_flags = PF_X | PF_R | PF_W; + for (ph = obj->phdr; (const char *)ph < (const char *)obj->phdr + + obj->phsize; ph++) { + switch (ph->p_type) { + case PT_GNU_STACK: + obj->stack_flags = ph->p_flags; + break; + case PT_GNU_RELRO: + obj->relro_page = obj->relocbase + + trunc_page(ph->p_vaddr); + obj->relro_size = round_page(ph->p_memsz); + break; + case PT_NOTE: + note_start = (Elf_Addr)obj->relocbase + ph->p_vaddr; + note_end = note_start + ph->p_filesz; + digest_notes(obj, note_start, note_end); + break; + } + } +} + /* * Initialize the dynamic linker. The argument is the address at which * the dynamic linker has been mapped into memory. The primary task of @@ -2250,6 +2278,8 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) /* Replace the path with a dynamically allocated copy. */ obj_rtld.path = xstrdup(ld_path_rtld); + + parse_rtld_phdr(&obj_rtld); r_debug.r_brk = r_debug_state; r_debug.r_state = RT_CONSISTENT; From owner-svn-src-all@freebsd.org Thu Jun 18 23:07:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7182A337565; Thu, 18 Jun 2020 23:07:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nyJv2KR9z4D2N; Thu, 18 Jun 2020 23:07:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B1B211949; Thu, 18 Jun 2020 23:07:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IN7xlB041028; Thu, 18 Jun 2020 23:07:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IN7xNL041027; Thu, 18 Jun 2020 23:07:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006182307.05IN7xNL041027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Jun 2020 23:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362347 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 362347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:07:59 -0000 Author: kib Date: Thu Jun 18 23:07:58 2020 New Revision: 362347 URL: https://svnweb.freebsd.org/changeset/base/362347 Log: rtld: Apply relro to itself. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25319 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jun 18 23:06:05 2020 (r362346) +++ head/libexec/rtld-elf/rtld.c Thu Jun 18 23:07:58 2020 (r362347) @@ -2280,6 +2280,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) obj_rtld.path = xstrdup(ld_path_rtld); parse_rtld_phdr(&obj_rtld); + obj_enforce_relro(&obj_rtld); r_debug.r_brk = r_debug_state; r_debug.r_state = RT_CONSISTENT; From owner-svn-src-all@freebsd.org Thu Jun 18 23:12:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0D1D337892; Thu, 18 Jun 2020 23:12:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nyQb5hyjz4DFN; Thu, 18 Jun 2020 23:12:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF00D11A42; Thu, 18 Jun 2020 23:12:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05INCtYv046678; Thu, 18 Jun 2020 23:12:55 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05INCtjc046677; Thu, 18 Jun 2020 23:12:55 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202006182312.05INCtjc046677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 18 Jun 2020 23:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362348 - head/sbin/umount X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/sbin/umount X-SVN-Commit-Revision: 362348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:12:56 -0000 Author: 0mp (doc,ports committer) Date: Thu Jun 18 23:12:55 2020 New Revision: 362348 URL: https://svnweb.freebsd.org/changeset/base/362348 Log: Document that umount -A does not unmount /dev Reported by: kaktus Reviewed by: kaktus MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25351 Modified: head/sbin/umount/umount.8 Modified: head/sbin/umount/umount.8 ============================================================================== --- head/sbin/umount/umount.8 Thu Jun 18 23:07:58 2020 (r362347) +++ head/sbin/umount/umount.8 Thu Jun 18 23:12:55 2020 (r362348) @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd April 14, 2020 +.Dd June 19, 2020 .Dt UMOUNT 8 .Os .Sh NAME @@ -69,8 +69,11 @@ All the file systems described in .Xr fstab 5 are unmounted. .It Fl A -All the currently mounted file systems except -the root are unmounted. +All the currently mounted file systems are unmounted, +except for those mounted at +.Pa / +or +.Pa /dev . .It Fl F Ar fstab Specify the .Pa fstab From owner-svn-src-all@freebsd.org Thu Jun 18 23:18:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26A3D337A40; Thu, 18 Jun 2020 23:18:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nyYP0Rw2z4DSJ; Thu, 18 Jun 2020 23:18:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F0C11A43; Thu, 18 Jun 2020 23:18:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05INImBt047015; Thu, 18 Jun 2020 23:18:48 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05INIlvN047009; Thu, 18 Jun 2020 23:18:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006182318.05INIlvN047009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 18 Jun 2020 23:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362349 - in stable/12/sys: arm/allwinner arm/allwinner/clkng arm/allwinner/h6 arm64/conf conf X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/allwinner/clkng arm/allwinner/h6 arm64/conf conf X-SVN-Commit-Revision: 362349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:18:49 -0000 Author: manu Date: Thu Jun 18 23:18:47 2020 New Revision: 362349 URL: https://svnweb.freebsd.org/changeset/base/362349 Log: MFC r353528-r353529 r353528: arm64: allwinner: Add Allwinner H6 Support This adds support for H6 SoC. Add a CCU driver for H6 that support all PLLs and most of the clocks that we are intersted in for now (i2c, mmc, usb, etc ...) r353529: arm64: allwinner: Add H6 GPIO/Pinctrl driver This adds support for Allwinner H6 GPIO and pinctrl driver for both the main pinctrl unit and the 'r_' one. Added: stable/12/sys/arm/allwinner/clkng/ccu_h6.c - copied unchanged from r353529, head/sys/arm/allwinner/clkng/ccu_h6.c stable/12/sys/arm/allwinner/clkng/ccu_h6_r.c - copied unchanged from r353529, head/sys/arm/allwinner/clkng/ccu_h6_r.c stable/12/sys/arm/allwinner/h6/ - copied from r353529, head/sys/arm/allwinner/h6/ Modified: stable/12/sys/arm/allwinner/aw_gpio.c stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 stable/12/sys/conf/options.arm64 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_gpio.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_gpio.c Thu Jun 18 23:12:55 2020 (r362348) +++ stable/12/sys/arm/allwinner/aw_gpio.c Thu Jun 18 23:18:47 2020 (r362349) @@ -130,6 +130,12 @@ extern const struct allwinner_padconf a64_padconf; extern const struct allwinner_padconf a64_r_padconf; #endif +/* Defined in h6_padconf.c */ +#ifdef SOC_ALLWINNER_H6 +extern const struct allwinner_padconf h6_padconf; +extern const struct allwinner_padconf h6_r_padconf; +#endif + static struct ofw_compat_data compat_data[] = { #ifdef SOC_ALLWINNER_A10 {"allwinner,sun4i-a10-pinctrl", (uintptr_t)&a10_padconf}, @@ -164,6 +170,10 @@ static struct ofw_compat_data compat_data[] = { #ifdef SOC_ALLWINNER_A64 {"allwinner,sun50i-a64-pinctrl", (uintptr_t)&a64_padconf}, {"allwinner,sun50i-a64-r-pinctrl", (uintptr_t)&a64_r_padconf}, +#endif +#ifdef SOC_ALLWINNER_H6 + {"allwinner,sun50i-h6-pinctrl", (uintptr_t)&h6_padconf}, + {"allwinner,sun50i-h6-r-pinctrl", (uintptr_t)&h6_r_padconf}, #endif {NULL, 0} }; Copied: stable/12/sys/arm/allwinner/clkng/ccu_h6.c (from r353529, head/sys/arm/allwinner/clkng/ccu_h6.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/allwinner/clkng/ccu_h6.c Thu Jun 18 23:18:47 2020 (r362349, copy of r353529, head/sys/arm/allwinner/clkng/ccu_h6.c) @@ -0,0 +1,501 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +/* Non-exported clocks */ +#define CLK_OSC_12M 0 +#define CLK_PLL_CPUX 1 +#define CLK_PLL_DDR0 2 +#define CLK_PLL_PERIPH0_2X 4 +#define CLK_PLL_PERIPH0_4X 5 +#define CLK_PLL_PERIPH1 6 +#define CLK_PLL_PERIPH1_2X 7 +#define CLK_PLL_PERIPH1_4X 8 +#define CLK_PLL_GPU 9 +#define CLK_PLL_VIDEO0 10 +#define CLK_PLL_VIDEO0_4X 11 +#define CLK_PLL_VIDEO1 12 +#define CLK_PLL_VIDEO1_4X 13 +#define CLK_PLL_VE 14 +#define CLK_PLL_DE 14 +#define CLK_PLL_HSIC 16 + +#define CLK_PSI_AHB1_AHB2 24 +#define CLK_AHB3 25 +#define CLK_APB2 27 + +static struct aw_ccung_reset h6_ccu_resets[] = { + /* PSI_BGR_REG */ + CCU_RESET(RST_BUS_PSI, 0x79c, 16) + + /* SMHC_BGR_REG */ + CCU_RESET(RST_BUS_MMC0, 0x84c, 16) + CCU_RESET(RST_BUS_MMC1, 0x84c, 17) + CCU_RESET(RST_BUS_MMC2, 0x84c, 18) + + /* UART_BGR_REG */ + CCU_RESET(RST_BUS_UART0, 0x90c, 16) + CCU_RESET(RST_BUS_UART1, 0x90c, 17) + CCU_RESET(RST_BUS_UART2, 0x90c, 18) + CCU_RESET(RST_BUS_UART3, 0x90c, 19) + + /* TWI_BGR_REG */ + CCU_RESET(RST_BUS_I2C0, 0x91c, 16) + CCU_RESET(RST_BUS_I2C1, 0x91c, 17) + CCU_RESET(RST_BUS_I2C2, 0x91c, 18) + CCU_RESET(RST_BUS_I2C3, 0x91c, 19) + + /* EMAC_BGR_REG */ + CCU_RESET(RST_BUS_EMAC, 0x97c, 16) + + /* USB0_CLK_REG */ + CCU_RESET(RST_USB_PHY0, 0xa70, 30) + + /* USB1_CLK_REG */ + CCU_RESET(RST_USB_PHY1, 0xa74, 30) + + /* USB3_CLK_REG */ + CCU_RESET(RST_USB_HSIC, 0xa7c, 28) + CCU_RESET(RST_USB_PHY3, 0xa7c, 30) + + /* USB_BGR_REG */ + CCU_RESET(RST_BUS_OHCI0, 0xa8c, 16) + CCU_RESET(RST_BUS_OHCI3, 0xa8c, 19) + CCU_RESET(RST_BUS_EHCI0, 0xa8c, 20) + CCU_RESET(RST_BUS_XHCI, 0xa8c, 21) + CCU_RESET(RST_BUS_EHCI3, 0xa8c, 23) + CCU_RESET(RST_BUS_OTG, 0xa8c, 24) +}; + +static struct aw_ccung_gate h6_ccu_gates[] = { + /* PSI_BGR_REG */ + CCU_GATE(CLK_BUS_PSI, "bus-psi", "psi_ahb1_ahb2", 0x79c, 0) + + /* SMHC_BGR_REG */ + CCU_GATE(CLK_BUS_MMC0, "bus-mmc0", "ahb3", 0x84c, 0) + CCU_GATE(CLK_BUS_MMC1, "bus-mmc1", "ahb3", 0x84c, 1) + CCU_GATE(CLK_BUS_MMC2, "bus-mmc2", "ahb3", 0x84c, 2) + + /* UART_BGR_REG Enabling the gate enable weir behavior ... */ + /* CCU_GATE(CLK_BUS_UART0, "bus-uart0", "apb2", 0x90c, 0) */ + /* CCU_GATE(CLK_BUS_UART1, "bus-uart1", "apb2", 0x90c, 1) */ + /* CCU_GATE(CLK_BUS_UART2, "bus-uart2", "apb2", 0x90c, 2) */ + /* CCU_GATE(CLK_BUS_UART3, "bus-uart3", "apb2", 0x90c, 3) */ + + /* TWI_BGR_REG */ + CCU_GATE(CLK_BUS_I2C0, "bus-i2c0", "apb2", 0x91c, 0) + CCU_GATE(CLK_BUS_I2C1, "bus-i2c1", "apb2", 0x91c, 1) + CCU_GATE(CLK_BUS_I2C2, "bus-i2c2", "apb2", 0x91c, 2) + CCU_GATE(CLK_BUS_I2C3, "bus-i2c3", "apb2", 0x91c, 3) + + /* EMAC_BGR_REG */ + CCU_GATE(CLK_BUS_EMAC, "bus-emac", "ahb3", 0x97c, 0) + + /* USB0_CLK_REG */ + CCU_GATE(CLK_USB_PHY0, "usb-phy0", "ahb3", 0xa70, 29) + CCU_GATE(CLK_USB_OHCI0, "usb-ohci0", "ahb3", 0xa70, 31) + + /* USB1_CLK_REG */ + CCU_GATE(CLK_USB_PHY1, "usb-phy1", "ahb3", 0xa74, 29) + + /* USB3_CLK_REG */ + CCU_GATE(CLK_USB_HSIC, "usb-hsic", "ahb3", 0xa7c, 26) + CCU_GATE(CLK_USB_HSIC_12M, "usb-hsic-12M", "ahb3", 0xa7c, 27) + CCU_GATE(CLK_USB_PHY3, "usb-phy3", "ahb3", 0xa7c, 29) + CCU_GATE(CLK_USB_OHCI3, "usb-ohci3", "ahb3", 0xa7c, 31) + + /* USB_BGR_REG */ + CCU_GATE(CLK_BUS_OHCI0, "bus-ohci0", "ahb3", 0xa8c, 0) + CCU_GATE(CLK_BUS_OHCI3, "bus-ohci3", "ahb3", 0xa8c, 3) + CCU_GATE(CLK_BUS_EHCI0, "bus-ehci0", "ahb3", 0xa8c, 4) + CCU_GATE(CLK_BUS_XHCI, "bus-xhci", "ahb3", 0xa8c, 5) + CCU_GATE(CLK_BUS_EHCI3, "bus-ehci3", "ahb3", 0xa8c, 7) + CCU_GATE(CLK_BUS_OTG, "bus-otg", "ahb3", 0xa8c, 8) +}; + +static const char *osc12m_parents[] = {"osc24M"}; +FIXED_CLK(osc12m_clk, + CLK_OSC_12M, /* id */ + "osc12M", /* name */ + osc12m_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 2, /* div */ + 0); /* flags */ + +static const char *pll_cpux_parents[] = {"osc24M"}; +NP_CLK(pll_cpux_clk, + CLK_PLL_CPUX, /* id */ + "pll_cpux", pll_cpux_parents, /* name, parents */ + 0x00, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 2, 0, 0, /* p factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ + +static const char *pll_ddr0_parents[] = {"osc24M"}; +NMM_CLK(pll_ddr0_clk, + CLK_PLL_DDR0, /* id */ + "pll_ddr0", pll_ddr0_parents, /* name, parents */ + 0x10, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ + +static const char *pll_peri0_parents[] = {"osc24M"}; +NMM_CLK(pll_peri0_clk, + CLK_PLL_PERIPH0, /* id */ + "pll_periph0", pll_peri0_parents, /* name, parents */ + 0x20, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ +static const char *pll_peri0_2x_parents[] = {"pll_periph0"}; +FIXED_CLK(pll_peri0_2x_clk, + CLK_PLL_PERIPH0_2X, /* id */ + "pll_periph0_2x", /* name */ + pll_peri0_2x_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 2, /* div */ + 0); /* flags */ +static const char *pll_peri0_4x_parents[] = {"pll_periph0"}; +FIXED_CLK(pll_peri0_4x_clk, + CLK_PLL_PERIPH0_4X, /* id */ + "pll_periph0_4x", /* name */ + pll_peri0_4x_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 4, /* div */ + 0); /* flags */ + +static const char *pll_peri1_parents[] = {"osc24M"}; +NMM_CLK(pll_peri1_clk, + CLK_PLL_PERIPH1, /* id */ + "pll_periph1", pll_peri1_parents, /* name, parents */ + 0x28, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ +static const char *pll_peri1_2x_parents[] = {"pll_periph1"}; +FIXED_CLK(pll_peri1_2x_clk, + CLK_PLL_PERIPH1_2X, /* id */ + "pll_periph1_2x", /* name */ + pll_peri1_2x_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 2, /* div */ + 0); /* flags */ +static const char *pll_peri1_4x_parents[] = {"pll_periph1"}; +FIXED_CLK(pll_peri1_4x_clk, + CLK_PLL_PERIPH1_4X, /* id */ + "pll_periph1_4x", /* name */ + pll_peri1_4x_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 4, /* div */ + 0); /* flags */ + +static const char *pll_gpu_parents[] = {"osc24M"}; +NMM_CLK(pll_gpu_clk, + CLK_PLL_GPU, /* id */ + "pll_gpu", pll_gpu_parents, /* name, parents */ + 0x30, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ + +static const char *pll_video0_parents[] = {"osc24M"}; +NMM_CLK(pll_video0_clk, + CLK_PLL_VIDEO0, /* id */ + "pll_video0", pll_video0_parents, /* name, parents */ + 0x40, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ +static const char *pll_video0_4x_parents[] = {"pll_video0"}; +FIXED_CLK(pll_video0_4x_clk, + CLK_PLL_VIDEO0_4X, /* id */ + "pll_video0_4x", /* name */ + pll_video0_4x_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 4, /* div */ + 0); /* flags */ + +static const char *pll_video1_parents[] = {"osc24M"}; +NMM_CLK(pll_video1_clk, + CLK_PLL_VIDEO1, /* id */ + "pll_video1", pll_video1_parents, /* name, parents */ + 0x48, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ +static const char *pll_video1_4x_parents[] = {"pll_video1"}; +FIXED_CLK(pll_video1_4x_clk, + CLK_PLL_VIDEO1_4X, /* id */ + "pll_video1_4x", /* name */ + pll_video1_4x_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 4, /* div */ + 0); /* flags */ + +static const char *pll_ve_parents[] = {"osc24M"}; +NMM_CLK(pll_ve_clk, + CLK_PLL_VE, /* id */ + "pll_ve", pll_ve_parents, /* name, parents */ + 0x58, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ + +static const char *pll_de_parents[] = {"osc24M"}; +NMM_CLK(pll_de_clk, + CLK_PLL_DE, /* id */ + "pll_de", pll_de_parents, /* name, parents */ + 0x60, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ + +static const char *pll_hsic_parents[] = {"osc24M"}; +NMM_CLK(pll_hsic_clk, + CLK_PLL_HSIC, /* id */ + "pll_hsic", pll_hsic_parents, /* name, parents */ + 0x70, /* offset */ + 8, 7, 0, 0, /* n factor */ + 0, 1, 0, 0, /* m0 factor */ + 1, 1, 0, 0, /* m1 factor */ + 31, /* gate */ + 28, 1000, /* lock */ + AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ + +/* PLL_AUDIO missing */ + +/* CPUX_AXI missing */ + +static const char *psi_ahb1_ahb2_parents[] = {"osc24M", "osc32k", "iosc", "pll_periph0"}; +NM_CLK(psi_ahb1_ahb2_clk, + CLK_PSI_AHB1_AHB2, "psi_ahb1_ahb2", psi_ahb1_ahb2_parents, /* id, name, parents */ + 0x510, /* offset */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 2, 0, 0, /* m factor */ + 24, 2, /* mux */ + 0, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ + +static const char *ahb3_parents[] = {"osc24M", "osc32k", "psi_ahb1_ahb2", "pll_periph0"}; +NM_CLK(ahb3_clk, + CLK_AHB3, "ahb3", ahb3_parents, /* id, name, parents */ + 0x51C, /* offset */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 2, 0, 0, /* m factor */ + 24, 2, /* mux */ + 0, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ + +static const char *apb1_parents[] = {"osc24M", "osc32k", "psi_ahb1_ahb2", "pll_periph0"}; +NM_CLK(apb1_clk, + CLK_APB1, "apb1", apb1_parents, /* id, name, parents */ + 0x520, /* offset */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 2, 0, 0, /* m factor */ + 24, 2, /* mux */ + 0, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ + +static const char *apb2_parents[] = {"osc24M", "osc32k", "psi_ahb1_ahb2", "pll_periph0"}; +NM_CLK(apb2_clk, + CLK_APB2, "apb2", apb2_parents, /* id, name, parents */ + 0x524, /* offset */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 2, 0, 0, /* m factor */ + 24, 2, /* mux */ + 0, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ + +/* Missing MBUS clock */ + +static const char *mod_parents[] = {"osc24M", "pll_periph0_2x", "pll_periph1_2x"}; +NM_CLK(mmc0_clk, + CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */ + 0x830, /* offset */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX | + AW_CLK_REPARENT); /* flags */ + +NM_CLK(mmc1_clk, + CLK_MMC1, "mmc1", mod_parents, /* id, name, parents */ + 0x834, /* offset */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX | + AW_CLK_REPARENT); /* flags */ + +NM_CLK(mmc2_clk, + CLK_MMC2, "mmc2", mod_parents, /* id, name, parents */ + 0x838, /* offset */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX | + AW_CLK_REPARENT); /* flags */ + +static struct aw_ccung_clk h6_ccu_clks[] = { + { .type = AW_CLK_NP, .clk.np = &pll_cpux_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_ddr0_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_peri0_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_peri1_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_gpu_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_video0_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_video1_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_ve_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_de_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_hsic_clk}, + + { .type = AW_CLK_NM, .clk.nm = &psi_ahb1_ahb2_clk}, + { .type = AW_CLK_NM, .clk.nm = &ahb3_clk}, + { .type = AW_CLK_NM, .clk.nm = &apb1_clk}, + { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, + + { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc1_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc2_clk}, + + { .type = AW_CLK_FIXED, .clk.fixed = &osc12m_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri0_2x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri0_4x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri1_2x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri1_4x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video0_4x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video1_4x_clk}, +}; + +static int +ccu_h6_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "allwinner,sun50i-h6-ccu")) + return (ENXIO); + + device_set_desc(dev, "Allwinner H6 Clock Control Unit NG"); + return (BUS_PROBE_DEFAULT); +} + +static int +ccu_h6_attach(device_t dev) +{ + struct aw_ccung_softc *sc; + + sc = device_get_softc(dev); + + sc->resets = h6_ccu_resets; + sc->nresets = nitems(h6_ccu_resets); + sc->gates = h6_ccu_gates; + sc->ngates = nitems(h6_ccu_gates); + sc->clks = h6_ccu_clks; + sc->nclks = nitems(h6_ccu_clks); + + return (aw_ccung_attach(dev)); +} + +static device_method_t ccu_h6ng_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccu_h6_probe), + DEVMETHOD(device_attach, ccu_h6_attach), + + DEVMETHOD_END +}; + +static devclass_t ccu_h6ng_devclass; + +DEFINE_CLASS_1(ccu_h6ng, ccu_h6ng_driver, ccu_h6ng_methods, + sizeof(struct aw_ccung_softc), aw_ccung_driver); + +EARLY_DRIVER_MODULE(ccu_h6ng, simplebus, ccu_h6ng_driver, + ccu_h6ng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Copied: stable/12/sys/arm/allwinner/clkng/ccu_h6_r.c (from r353529, head/sys/arm/allwinner/clkng/ccu_h6_r.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/allwinner/clkng/ccu_h6_r.c Thu Jun 18 23:18:47 2020 (r362349, copy of r353529, head/sys/arm/allwinner/clkng/ccu_h6_r.c) @@ -0,0 +1,172 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +/* Non-exported clocks */ +#define CLK_R_AHB 1 +#define CLK_R_APB2 3 + +static struct aw_ccung_reset ccu_sun50i_h6_r_resets[] = { + CCU_RESET(RST_R_APB1_TIMER, 0x11c, 16) + CCU_RESET(RST_R_APB1_TWD, 0x12c, 16) + CCU_RESET(RST_R_APB1_PWM, 0x13c, 16) + CCU_RESET(RST_R_APB2_UART, 0x18c, 16) + CCU_RESET(RST_R_APB2_I2C, 0x19c, 16) + CCU_RESET(RST_R_APB1_IR, 0x1cc, 16) + CCU_RESET(RST_R_APB1_W1, 0x1ec, 16) +}; + +static struct aw_ccung_gate ccu_sun50i_h6_r_gates[] = { + CCU_GATE(CLK_R_APB1_TIMER, "r_apb1-timer", "r_apb1", 0x11c, 0) + CCU_GATE(CLK_R_APB1_TWD, "r_apb1-twd", "r_apb1", 0x12c, 0) + CCU_GATE(CLK_R_APB1_PWM, "r_apb1-pwm", "r_apb1", 0x13c, 0) + CCU_GATE(CLK_R_APB2_UART, "r_apb1-uart", "r_apb2", 0x18c, 0) + CCU_GATE(CLK_R_APB2_I2C, "r_apb1-i2c", "r_apb2", 0x19c, 0) + CCU_GATE(CLK_R_APB1_IR, "r_apb1-ir", "r_apb1", 0x1cc, 0) + CCU_GATE(CLK_R_APB1_W1, "r_apb1-w1", "r_apb1", 0x1ec, 0) +}; + +static const char *ar100_parents[] = {"osc24M", "osc32k", "pll_periph0", "iosc"}; +PREDIV_CLK(ar100_clk, CLK_AR100, /* id */ + "ar100", ar100_parents, /* name, parents */ + 0x00, /* offset */ + 16, 2, /* mux */ + 4, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* div */ + 8, 5, 0, AW_CLK_FACTOR_HAS_COND, /* prediv */ + 16, 2, 2); /* prediv condition */ + +static const char *r_ahb_parents[] = {"ar100"}; +FIXED_CLK(r_ahb_clk, + CLK_R_AHB, /* id */ + "r_ahb", /* name */ + r_ahb_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 1, /* div */ + 0); /* flags */ + +static const char *r_apb1_parents[] = {"r_ahb"}; +DIV_CLK(r_apb1_clk, + CLK_R_APB1, /* id */ + "r_apb1", r_apb1_parents, /* name, parents */ + 0x0c, /* offset */ + 0, 2, /* shift, width */ + 0, NULL); /* flags, div table */ + +static const char *r_apb2_parents[] = {"osc24M", "osc32k", "pll_periph0", "iosc"}; +PREDIV_CLK(r_apb2_clk, CLK_R_APB2, /* id */ + "r_apb2", r_apb2_parents, /* name, parents */ + 0x10, /* offset */ + 16, 2, /* mux */ + 4, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* div */ + 8, 5, 0, AW_CLK_FACTOR_HAS_COND, /* prediv */ + 16, 2, 2); /* prediv condition */ + +static struct aw_ccung_clk clks[] = { + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &ar100_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &r_ahb_clk}, + { .type = AW_CLK_DIV, .clk.div = &r_apb1_clk}, + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &r_apb2_clk}, +}; + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun50i-h6-r-ccu", 1 }, + { NULL, 0}, +}; + +static int +ccu_sun50i_h6_r_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner SUN50I_H6_R Clock Control Unit NG"); + return (BUS_PROBE_DEFAULT); +} + +static int +ccu_sun50i_h6_r_attach(device_t dev) +{ + struct aw_ccung_softc *sc; + + sc = device_get_softc(dev); + + sc->resets = ccu_sun50i_h6_r_resets; + sc->nresets = nitems(ccu_sun50i_h6_r_resets); + sc->gates = ccu_sun50i_h6_r_gates; + sc->ngates = nitems(ccu_sun50i_h6_r_gates); + sc->clks = clks; + sc->nclks = nitems(clks); + + return (aw_ccung_attach(dev)); +} + +static device_method_t ccu_sun50i_h6_r_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccu_sun50i_h6_r_probe), + DEVMETHOD(device_attach, ccu_sun50i_h6_r_attach), + + DEVMETHOD_END +}; + +static devclass_t ccu_sun50i_h6_r_devclass; + +DEFINE_CLASS_1(ccu_sun50i_h6_r, ccu_sun50i_h6_r_driver, ccu_sun50i_h6_r_methods, + sizeof(struct aw_ccung_softc), aw_ccung_driver); + +EARLY_DRIVER_MODULE(ccu_sun50i_h6_r, simplebus, ccu_sun50i_h6_r_driver, + ccu_sun50i_h6_r_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Thu Jun 18 23:12:55 2020 (r362348) +++ stable/12/sys/arm64/conf/GENERIC Thu Jun 18 23:18:47 2020 (r362349) @@ -90,6 +90,7 @@ options NETDUMP # netdump(4) client support # SoC support options SOC_ALLWINNER_A64 options SOC_ALLWINNER_H5 +options SOC_ALLWINNER_H6 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 options SOC_BRCM_BCM2837 Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Thu Jun 18 23:12:55 2020 (r362348) +++ stable/12/sys/conf/files.arm64 Thu Jun 18 23:18:47 2020 (r362349) @@ -58,6 +58,8 @@ arm/allwinner/clkng/aw_clk_np.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt arm/allwinner/clkng/ccu_a64.c optional soc_allwinner_a64 aw_ccu fdt arm/allwinner/clkng/ccu_h3.c optional soc_allwinner_h5 aw_ccu fdt +arm/allwinner/clkng/ccu_h6.c optional soc_allwinner_h6 aw_ccu fdt +arm/allwinner/clkng/ccu_h6_r.c optional soc_allwinner_h6 aw_ccu fdt arm/allwinner/clkng/ccu_sun8i_r.c optional aw_ccu fdt arm/allwinner/clkng/ccu_de2.c optional aw_ccu fdt @@ -66,6 +68,8 @@ arm/allwinner/a64/a64_padconf.c optional soc_allwinner arm/allwinner/a64/a64_r_padconf.c optional soc_allwinner_a64 fdt arm/allwinner/h3/h3_padconf.c optional soc_allwinner_h5 fdt arm/allwinner/h3/h3_r_padconf.c optional soc_allwinner_h5 fdt +arm/allwinner/h6/h6_padconf.c optional soc_allwinner_h6 fdt +arm/allwinner/h6/h6_r_padconf.c optional soc_allwinner_h6 fdt arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt Modified: stable/12/sys/conf/options.arm64 ============================================================================== --- stable/12/sys/conf/options.arm64 Thu Jun 18 23:12:55 2020 (r362348) +++ stable/12/sys/conf/options.arm64 Thu Jun 18 23:18:47 2020 (r362349) @@ -16,6 +16,7 @@ EFIRT opt_efirt.h # SoC Support SOC_ALLWINNER_A64 opt_soc.h SOC_ALLWINNER_H5 opt_soc.h +SOC_ALLWINNER_H6 opt_soc.h SOC_BRCM_BCM2837 opt_soc.h SOC_BRCM_BCM2838 opt_soc.h SOC_CAVM_THUNDERX opt_soc.h From owner-svn-src-all@freebsd.org Thu Jun 18 23:21:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 205323378BB; Thu, 18 Jun 2020 23:21:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nycB0NHTz4DvQ; Thu, 18 Jun 2020 23:21:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07EE9119C3; Thu, 18 Jun 2020 23:21:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05INLEdw047225; Thu, 18 Jun 2020 23:21:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05INLCCw047219; Thu, 18 Jun 2020 23:21:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006182321.05INLCCw047219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 18 Jun 2020 23:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362350 - in stable/12/sys: arm/allwinner dev/iicbus/twsi dts/arm64/overlays modules/dtb/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner dev/iicbus/twsi dts/arm64/overlays modules/dtb/allwinner X-SVN-Commit-Revision: 362350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:21:14 -0000 Author: manu Date: Thu Jun 18 23:21:12 2020 New Revision: 362350 URL: https://svnweb.freebsd.org/changeset/base/362350 Log: MFC r356276, r356609-r356610, r356637, r356798-r356800, r356802 r356276: arm: allwinner: aw_spi: Call bus_generic_attach This is needed when the driver is compiled into the kernel. When compiled as a module this will be called from another code path as we also depend on ofw_spibus. r356609: twsi: Rework how we handle the i2c messages We use to handle each message separately in i2c_transfer but that cannot work with message with NOSTOP as it confuses the controller that we disable the interrupts and start a new message. Handle every message in the interrupt handler and fire a new start condition if the previous message have NOSTOP, the controller understand this as a repeated start. This fixes booting on Allwinner A10/A20 platform where before the i2c controller used to write 0 to the PMIC register that control the regulators as it though that this was the continuation of the write message. Tested on: A20 BananaPi, Cubieboard 1 (kevans) Reported by: kevans r356610: arm: allwinner: axp209: Add regnode_status method This allow consumers to check if the regulator is enable or not. r356637: arm64: allwinner: dtso: Add spi0 spigen DTSO This overlays can be used on A64 board to use spigen and spi(8) on the spi0 pins. Tested On: Pine64-LTS, A64-Olinuxino Submitted by: Gary Otten r356798: axp8xx: Add missing voltage regulators offset This lead to writing the desired voltage value to the wrong register. r356799: axp8xx: Add a regnode_init method This method will set the desired voltaged based on values in the DTS. It will not enable the regulator, this is the job of either a consumer or regnode_set_constraint SYSINIT if the regulator is boot_on or always_on. r356800: arm: allwinner: Add support for bank supply Each GPIO bank is powered by a different pin and so can be powered at different voltage from different regulators. Add a new config that now hold the pinmux data and the banks available on each SoCs. Since the aw_gpio driver being also the pinmux one it's attached before the PMIC so add a config_intrhook_oneshot function that will enable the needed regulators when the system is fully functional. r356802: arm: allwinner: ahci: target-supply is optional The target-supply regulator is optional so don't fail if it's not present. While here disable the clock on detach. X-MFC-With: 356600 Added: stable/12/sys/dts/arm64/overlays/sun50i-a64-spi0-spigen.dtso - copied unchanged from r356637, head/sys/dts/arm64/overlays/sun50i-a64-spi0-spigen.dtso Modified: stable/12/sys/arm/allwinner/a10_ahci.c stable/12/sys/arm/allwinner/aw_gpio.c stable/12/sys/arm/allwinner/aw_spi.c stable/12/sys/arm/allwinner/axp209.c stable/12/sys/arm/allwinner/axp81x.c stable/12/sys/dev/iicbus/twsi/twsi.c stable/12/sys/dev/iicbus/twsi/twsi.h stable/12/sys/modules/dtb/allwinner/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/a10_ahci.c ============================================================================== --- stable/12/sys/arm/allwinner/a10_ahci.c Thu Jun 18 23:18:47 2020 (r362349) +++ stable/12/sys/arm/allwinner/a10_ahci.c Thu Jun 18 23:21:12 2020 (r362350) @@ -123,6 +123,8 @@ __FBSDID("$FreeBSD$"); struct ahci_a10_softc { struct ahci_controller ahci_ctlr; regulator_t ahci_reg; + clk_t clk_pll; + clk_t clk_gate; }; static void inline @@ -304,11 +306,9 @@ ahci_a10_attach(device_t dev) int error; struct ahci_a10_softc *sc; struct ahci_controller *ctlr; - clk_t clk_pll, clk_gate; sc = device_get_softc(dev); ctlr = &sc->ahci_ctlr; - clk_pll = clk_gate = NULL; ctlr->quirks = AHCI_Q_NOPMP; ctlr->vendorid = 0; @@ -320,41 +320,38 @@ ahci_a10_attach(device_t dev) &ctlr->r_rid, RF_ACTIVE))) return (ENXIO); - /* Enable the regulator */ - error = regulator_get_by_ofw_property(dev, 0, "target-supply", - &sc->ahci_reg); - if (error != 0) { - device_printf(dev, "Cannot get regulator\n"); - goto fail; + /* Enable the (optional) regulator */ + if (regulator_get_by_ofw_property(dev, 0, "target-supply", + &sc->ahci_reg) == 0) { + error = regulator_enable(sc->ahci_reg); + if (error != 0) { + device_printf(dev, "Could not enable regulator\n"); + goto fail; + } } - error = regulator_enable(sc->ahci_reg); - if (error != 0) { - device_printf(dev, "Could not enable regulator\n"); - goto fail; - } /* Enable clocks */ - error = clk_get_by_ofw_index(dev, 0, 0, &clk_gate); + error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_gate); if (error != 0) { device_printf(dev, "Cannot get gate clock\n"); goto fail; } - error = clk_get_by_ofw_index(dev, 0, 1, &clk_pll); + error = clk_get_by_ofw_index(dev, 0, 1, &sc->clk_pll); if (error != 0) { device_printf(dev, "Cannot get PLL clock\n"); goto fail; } - error = clk_set_freq(clk_pll, PLL_FREQ, CLK_SET_ROUND_DOWN); + error = clk_set_freq(sc->clk_pll, PLL_FREQ, CLK_SET_ROUND_DOWN); if (error != 0) { device_printf(dev, "Cannot set PLL frequency\n"); goto fail; } - error = clk_enable(clk_pll); + error = clk_enable(sc->clk_pll); if (error != 0) { device_printf(dev, "Cannot enable PLL\n"); goto fail; } - error = clk_enable(clk_gate); + error = clk_enable(sc->clk_gate); if (error != 0) { device_printf(dev, "Cannot enable clk gate\n"); goto fail; @@ -379,12 +376,12 @@ ahci_a10_attach(device_t dev) return (ahci_attach(dev)); fail: - if (sc->ahci_reg != 0) + if (sc->ahci_reg != NULL) regulator_disable(sc->ahci_reg); - if (clk_gate != NULL) - clk_release(clk_gate); - if (clk_pll != NULL) - clk_release(clk_pll); + if (sc->clk_gate != NULL) + clk_release(sc->clk_gate); + if (sc->clk_pll != NULL) + clk_release(sc->clk_pll); bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); return (error); } @@ -392,7 +389,19 @@ fail: static int ahci_a10_detach(device_t dev) { + struct ahci_a10_softc *sc; + struct ahci_controller *ctlr; + sc = device_get_softc(dev); + ctlr = &sc->ahci_ctlr; + + if (sc->ahci_reg != NULL) + regulator_disable(sc->ahci_reg); + if (sc->clk_gate != NULL) + clk_release(sc->clk_gate); + if (sc->clk_pll != NULL) + clk_release(sc->clk_pll); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); return (ahci_detach(dev)); } Modified: stable/12/sys/arm/allwinner/aw_gpio.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_gpio.c Thu Jun 18 23:18:47 2020 (r362349) +++ stable/12/sys/arm/allwinner/aw_gpio.c Thu Jun 18 23:21:12 2020 (r362350) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(__aarch64__) #include "opt_soc.h" @@ -78,102 +79,167 @@ __FBSDID("$FreeBSD$"); #define AW_PINCTRL 1 #define AW_R_PINCTRL 2 +struct aw_gpio_conf { + struct allwinner_padconf *padconf; + const char *banks; +}; + /* Defined in aw_padconf.c */ #ifdef SOC_ALLWINNER_A10 -extern const struct allwinner_padconf a10_padconf; +extern struct allwinner_padconf a10_padconf; +struct aw_gpio_conf a10_gpio_conf = { + .padconf = &a10_padconf, + .banks = "abcdefghi", +}; #endif /* Defined in a13_padconf.c */ #ifdef SOC_ALLWINNER_A13 -extern const struct allwinner_padconf a13_padconf; +extern struct allwinner_padconf a13_padconf; +struct aw_gpio_conf a13_gpio_conf = { + .padconf = &a13_padconf, + .banks = "bcdefg", +}; #endif /* Defined in a20_padconf.c */ #ifdef SOC_ALLWINNER_A20 -extern const struct allwinner_padconf a20_padconf; +extern struct allwinner_padconf a20_padconf; +struct aw_gpio_conf a20_gpio_conf = { + .padconf = &a20_padconf, + .banks = "abcdefghi", +}; #endif /* Defined in a31_padconf.c */ #ifdef SOC_ALLWINNER_A31 -extern const struct allwinner_padconf a31_padconf; +extern struct allwinner_padconf a31_padconf; +struct aw_gpio_conf a31_gpio_conf = { + .padconf = &a31_padconf, + .banks = "abcdefgh", +}; #endif /* Defined in a31s_padconf.c */ #ifdef SOC_ALLWINNER_A31S -extern const struct allwinner_padconf a31s_padconf; +extern struct allwinner_padconf a31s_padconf; +struct aw_gpio_conf a31s_gpio_conf = { + .padconf = &a31s_padconf, + .banks = "abcdefgh", +}; #endif #if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) -extern const struct allwinner_padconf a31_r_padconf; +extern struct allwinner_padconf a31_r_padconf; +struct aw_gpio_conf a31_r_gpio_conf = { + .padconf = &a31_r_padconf, + .banks = "lm", +}; #endif /* Defined in a33_padconf.c */ #ifdef SOC_ALLWINNER_A33 -extern const struct allwinner_padconf a33_padconf; +extern struct allwinner_padconf a33_padconf; +struct aw_gpio_conf a33_gpio_conf = { + .padconf = &a33_padconf, + .banks = "bcdefgh", +}; #endif /* Defined in h3_padconf.c */ #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) -extern const struct allwinner_padconf h3_padconf; -extern const struct allwinner_padconf h3_r_padconf; +extern struct allwinner_padconf h3_padconf; +extern struct allwinner_padconf h3_r_padconf; +struct aw_gpio_conf h3_gpio_conf = { + .padconf = &h3_padconf, + .banks = "acdefg", +}; +struct aw_gpio_conf h3_r_gpio_conf = { + .padconf = &h3_r_padconf, + .banks = "l", +}; #endif /* Defined in a83t_padconf.c */ #ifdef SOC_ALLWINNER_A83T -extern const struct allwinner_padconf a83t_padconf; -extern const struct allwinner_padconf a83t_r_padconf; +extern struct allwinner_padconf a83t_padconf; +extern struct allwinner_padconf a83t_r_padconf; +struct aw_gpio_conf a83t_gpio_conf = { + .padconf = &a83t_padconf, + .banks = "bcdefgh" +}; +struct aw_gpio_conf a83t_r_gpio_conf = { + .padconf = &a83t_r_padconf, + .banks = "l", +}; #endif /* Defined in a64_padconf.c */ #ifdef SOC_ALLWINNER_A64 -extern const struct allwinner_padconf a64_padconf; -extern const struct allwinner_padconf a64_r_padconf; +extern struct allwinner_padconf a64_padconf; +extern struct allwinner_padconf a64_r_padconf; +struct aw_gpio_conf a64_gpio_conf = { + .padconf = &a64_padconf, + .banks = "bcdefgh", +}; +struct aw_gpio_conf a64_r_gpio_conf = { + .padconf = &a64_r_padconf, + .banks = "l", +}; #endif /* Defined in h6_padconf.c */ #ifdef SOC_ALLWINNER_H6 -extern const struct allwinner_padconf h6_padconf; -extern const struct allwinner_padconf h6_r_padconf; +extern struct allwinner_padconf h6_padconf; +extern struct allwinner_padconf h6_r_padconf; +struct aw_gpio_conf h6_gpio_conf = { + .padconf = &h6_padconf, + .banks = "cdfgh", +}; +struct aw_gpio_conf h6_r_gpio_conf = { + .padconf = &h6_r_padconf, + .banks = "lm", +}; #endif static struct ofw_compat_data compat_data[] = { #ifdef SOC_ALLWINNER_A10 - {"allwinner,sun4i-a10-pinctrl", (uintptr_t)&a10_padconf}, + {"allwinner,sun4i-a10-pinctrl", (uintptr_t)&a10_gpio_conf}, #endif #ifdef SOC_ALLWINNER_A13 - {"allwinner,sun5i-a13-pinctrl", (uintptr_t)&a13_padconf}, + {"allwinner,sun5i-a13-pinctrl", (uintptr_t)&a13_gpio_conf}, #endif #ifdef SOC_ALLWINNER_A20 - {"allwinner,sun7i-a20-pinctrl", (uintptr_t)&a20_padconf}, + {"allwinner,sun7i-a20-pinctrl", (uintptr_t)&a20_gpio_conf}, #endif #ifdef SOC_ALLWINNER_A31 - {"allwinner,sun6i-a31-pinctrl", (uintptr_t)&a31_padconf}, + {"allwinner,sun6i-a31-pinctrl", (uintptr_t)&a31_gpio_conf}, #endif #ifdef SOC_ALLWINNER_A31S - {"allwinner,sun6i-a31s-pinctrl", (uintptr_t)&a31s_padconf}, + {"allwinner,sun6i-a31s-pinctrl", (uintptr_t)&a31s_gpio_conf}, #endif #if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) - {"allwinner,sun6i-a31-r-pinctrl", (uintptr_t)&a31_r_padconf}, + {"allwinner,sun6i-a31-r-pinctrl", (uintptr_t)&a31_r_gpio_conf}, #endif #ifdef SOC_ALLWINNER_A33 - {"allwinner,sun6i-a33-pinctrl", (uintptr_t)&a33_padconf}, + {"allwinner,sun6i-a33-pinctrl", (uintptr_t)&a33_gpio_conf}, #endif #ifdef SOC_ALLWINNER_A83T - {"allwinner,sun8i-a83t-pinctrl", (uintptr_t)&a83t_padconf}, - {"allwinner,sun8i-a83t-r-pinctrl", (uintptr_t)&a83t_r_padconf}, + {"allwinner,sun8i-a83t-pinctrl", (uintptr_t)&a83t_gpio_conf}, + {"allwinner,sun8i-a83t-r-pinctrl", (uintptr_t)&a83t_r_gpio_conf}, #endif #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) - {"allwinner,sun8i-h3-pinctrl", (uintptr_t)&h3_padconf}, - {"allwinner,sun50i-h5-pinctrl", (uintptr_t)&h3_padconf}, - {"allwinner,sun8i-h3-r-pinctrl", (uintptr_t)&h3_r_padconf}, + {"allwinner,sun8i-h3-pinctrl", (uintptr_t)&h3_gpio_conf}, + {"allwinner,sun50i-h5-pinctrl", (uintptr_t)&h3_gpio_conf}, + {"allwinner,sun8i-h3-r-pinctrl", (uintptr_t)&h3_r_gpio_conf}, #endif #ifdef SOC_ALLWINNER_A64 - {"allwinner,sun50i-a64-pinctrl", (uintptr_t)&a64_padconf}, - {"allwinner,sun50i-a64-r-pinctrl", (uintptr_t)&a64_r_padconf}, + {"allwinner,sun50i-a64-pinctrl", (uintptr_t)&a64_gpio_conf}, + {"allwinner,sun50i-a64-r-pinctrl", (uintptr_t)&a64_r_gpio_conf}, #endif #ifdef SOC_ALLWINNER_H6 - {"allwinner,sun50i-h6-pinctrl", (uintptr_t)&h6_padconf}, - {"allwinner,sun50i-h6-r-pinctrl", (uintptr_t)&h6_r_padconf}, + {"allwinner,sun50i-h6-pinctrl", (uintptr_t)&h6_gpio_conf}, + {"allwinner,sun50i-h6-r-pinctrl", (uintptr_t)&h6_r_gpio_conf}, #endif {NULL, 0} }; @@ -192,7 +258,7 @@ struct aw_gpio_softc { bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; void * sc_intrhand; - const struct allwinner_padconf * padconf; + struct aw_gpio_conf *conf; TAILQ_HEAD(, clk_list) clk_list; }; @@ -237,10 +303,10 @@ aw_gpio_get_function(struct aw_gpio_softc *sc, uint32_ /* Must be called with lock held. */ AW_GPIO_LOCK_ASSERT(sc); - if (pin > sc->padconf->npins) + if (pin > sc->conf->padconf->npins) return (0); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; offset = ((pin & 0x07) << 2); func = AW_GPIO_READ(sc, AW_GPIO_GP_CFG(bank, pin >> 3)); @@ -254,14 +320,14 @@ aw_gpio_set_function(struct aw_gpio_softc *sc, uint32_ uint32_t bank, data, offset; /* Check if the function exists in the padconf data */ - if (sc->padconf->pins[pin].functions[f] == NULL) + if (sc->conf->padconf->pins[pin].functions[f] == NULL) return (EINVAL); /* Must be called with lock held. */ AW_GPIO_LOCK_ASSERT(sc); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; offset = ((pin & 0x07) << 2); data = AW_GPIO_READ(sc, AW_GPIO_GP_CFG(bank, pin >> 3)); @@ -280,8 +346,8 @@ aw_gpio_get_pud(struct aw_gpio_softc *sc, uint32_t pin /* Must be called with lock held. */ AW_GPIO_LOCK_ASSERT(sc); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); val = AW_GPIO_READ(sc, AW_GPIO_GP_PUL(bank, pin >> 4)); @@ -300,8 +366,8 @@ aw_gpio_set_pud(struct aw_gpio_softc *sc, uint32_t pin /* Must be called with lock held. */ AW_GPIO_LOCK_ASSERT(sc); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); val = AW_GPIO_READ(sc, AW_GPIO_GP_PUL(bank, pin >> 4)); @@ -318,8 +384,8 @@ aw_gpio_get_drv(struct aw_gpio_softc *sc, uint32_t pin /* Must be called with lock held. */ AW_GPIO_LOCK_ASSERT(sc); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); val = AW_GPIO_READ(sc, AW_GPIO_GP_DRV(bank, pin >> 4)); @@ -338,8 +404,8 @@ aw_gpio_set_drv(struct aw_gpio_softc *sc, uint32_t pin /* Must be called with lock held. */ AW_GPIO_LOCK_ASSERT(sc); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); val = AW_GPIO_READ(sc, AW_GPIO_GP_DRV(bank, pin >> 4)); @@ -357,7 +423,7 @@ aw_gpio_pin_configure(struct aw_gpio_softc *sc, uint32 /* Must be called with lock held. */ AW_GPIO_LOCK_ASSERT(sc); - if (pin > sc->padconf->npins) + if (pin > sc->conf->padconf->npins) return (EINVAL); /* Manage input/output. */ @@ -412,7 +478,7 @@ aw_gpio_pin_max(device_t dev, int *maxpin) sc = device_get_softc(dev); - *maxpin = sc->padconf->npins - 1; + *maxpin = sc->conf->padconf->npins - 1; return (0); } @@ -422,7 +488,7 @@ aw_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32 struct aw_gpio_softc *sc; sc = device_get_softc(dev); - if (pin >= sc->padconf->npins) + if (pin >= sc->conf->padconf->npins) return (EINVAL); *caps = AW_GPIO_DEFAULT_CAPS; @@ -438,7 +504,7 @@ aw_gpio_pin_getflags(device_t dev, uint32_t pin, uint3 uint32_t pud; sc = device_get_softc(dev); - if (pin >= sc->padconf->npins) + if (pin >= sc->conf->padconf->npins) return (EINVAL); AW_GPIO_LOCK(sc); @@ -478,11 +544,11 @@ aw_gpio_pin_getname(device_t dev, uint32_t pin, char * struct aw_gpio_softc *sc; sc = device_get_softc(dev); - if (pin >= sc->padconf->npins) + if (pin >= sc->conf->padconf->npins) return (EINVAL); snprintf(name, GPIOMAXNAME - 1, "%s", - sc->padconf->pins[pin].name); + sc->conf->padconf->pins[pin].name); name[GPIOMAXNAME - 1] = '\0'; return (0); @@ -495,7 +561,7 @@ aw_gpio_pin_setflags(device_t dev, uint32_t pin, uint3 int err; sc = device_get_softc(dev); - if (pin > sc->padconf->npins) + if (pin > sc->conf->padconf->npins) return (EINVAL); AW_GPIO_LOCK(sc); @@ -513,11 +579,11 @@ aw_gpio_pin_set_locked(struct aw_gpio_softc *sc, uint3 AW_GPIO_LOCK_ASSERT(sc); - if (pin > sc->padconf->npins) + if (pin > sc->conf->padconf->npins) return (EINVAL); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); if (value) @@ -552,11 +618,11 @@ aw_gpio_pin_get_locked(struct aw_gpio_softc *sc,uint32 AW_GPIO_LOCK_ASSERT(sc); - if (pin > sc->padconf->npins) + if (pin > sc->conf->padconf->npins) return (EINVAL); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; reg_data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); *val = (reg_data & (1 << pin)) ? 1 : 0; @@ -655,11 +721,11 @@ aw_gpio_pin_toggle(device_t dev, uint32_t pin) uint32_t bank, data; sc = device_get_softc(dev); - if (pin > sc->padconf->npins) + if (pin > sc->conf->padconf->npins) return (EINVAL); - bank = sc->padconf->pins[pin].port; - pin = sc->padconf->pins[pin].pin; + bank = sc->conf->padconf->pins[pin].port; + pin = sc->conf->padconf->pins[pin].pin; AW_GPIO_LOCK(sc); data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); @@ -681,7 +747,7 @@ aw_gpio_pin_access_32(device_t dev, uint32_t first_pin uint32_t bank, data, pin; sc = device_get_softc(dev); - if (first_pin > sc->padconf->npins) + if (first_pin > sc->conf->padconf->npins) return (EINVAL); /* @@ -690,8 +756,8 @@ aw_gpio_pin_access_32(device_t dev, uint32_t first_pin * change simultaneously (required) with reasonably high performance * (desired); we need to do a read-modify-write on a single register. */ - bank = sc->padconf->pins[first_pin].port; - pin = sc->padconf->pins[first_pin].pin; + bank = sc->conf->padconf->pins[first_pin].port; + pin = sc->conf->padconf->pins[first_pin].pin; if (pin != 0) return (EINVAL); @@ -717,11 +783,11 @@ aw_gpio_pin_config_32(device_t dev, uint32_t first_pin int err; sc = device_get_softc(dev); - if (first_pin > sc->padconf->npins) + if (first_pin > sc->conf->padconf->npins) return (EINVAL); - bank = sc->padconf->pins[first_pin].port; - if (sc->padconf->pins[first_pin].pin != 0) + bank = sc->conf->padconf->pins[first_pin].port; + if (sc->conf->padconf->pins[first_pin].pin != 0) return (EINVAL); /* @@ -745,8 +811,8 @@ aw_find_pinnum_by_name(struct aw_gpio_softc *sc, const { int i; - for (i = 0; i < sc->padconf->npins; i++) - if (!strcmp(pinname, sc->padconf->pins[i].name)) + for (i = 0; i < sc->conf->padconf->npins; i++) + if (!strcmp(pinname, sc->conf->padconf->pins[i].name)) return i; return (-1); @@ -758,8 +824,8 @@ aw_find_pin_func(struct aw_gpio_softc *sc, int pin, co int i; for (i = 0; i < AW_MAX_FUNC_BY_PIN; i++) - if (sc->padconf->pins[pin].functions[i] && - !strcmp(func, sc->padconf->pins[pin].functions[i])) + if (sc->conf->padconf->pins[pin].functions[i] && + !strcmp(func, sc->conf->padconf->pins[pin].functions[i])) return (i); return (-1); @@ -828,6 +894,33 @@ aw_fdt_configure_pins(device_t dev, phandle_t cfgxref) return (ret); } +static void +aw_gpio_enable_bank_supply(void *arg) +{ + struct aw_gpio_softc *sc = arg; + regulator_t vcc_supply; + char bank_reg_name[16]; + int i, nbanks; + + nbanks = strlen(sc->conf->banks); + for (i = 0; i < nbanks; i++) { + snprintf(bank_reg_name, sizeof(bank_reg_name), "vcc-p%c-supply", + sc->conf->banks[i]); + + if (regulator_get_by_ofw_property(sc->sc_dev, 0, bank_reg_name, &vcc_supply) == 0) { + if (bootverbose) + device_printf(sc->sc_dev, + "Enabling regulator for gpio bank %c\n", + sc->conf->banks[i]); + if (regulator_enable(vcc_supply) != 0) { + device_printf(sc->sc_dev, + "Cannot enable regulator for bank %c\n", + sc->conf->banks[i]); + } + } + } +} + static int aw_gpio_probe(device_t dev) { @@ -884,7 +977,7 @@ aw_gpio_attach(device_t dev) goto fail; /* Use the right pin data for the current SoC */ - sc->padconf = (struct allwinner_padconf *)ofw_bus_search_compatible(dev, + sc->conf = (struct aw_gpio_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst) == 0) { @@ -928,6 +1021,8 @@ aw_gpio_attach(device_t dev) fdt_pinctrl_register(dev, "allwinner,pins"); fdt_pinctrl_configure_tree(dev); + config_intrhook_oneshot(aw_gpio_enable_bank_supply, sc); + return (0); fail: @@ -985,9 +1080,9 @@ aw_gpio_map_gpios(device_t bus, phandle_t dev, phandle sc = device_get_softc(bus); /* The GPIO pins are mapped as: . */ - for (i = 0; i < sc->padconf->npins; i++) - if (sc->padconf->pins[i].port == gpios[0] && - sc->padconf->pins[i].pin == gpios[1]) { + for (i = 0; i < sc->conf->padconf->npins; i++) + if (sc->conf->padconf->pins[i].port == gpios[0] && + sc->conf->padconf->pins[i].pin == gpios[1]) { *pin = i; break; } Modified: stable/12/sys/arm/allwinner/aw_spi.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_spi.c Thu Jun 18 23:18:47 2020 (r362349) +++ stable/12/sys/arm/allwinner/aw_spi.c Thu Jun 18 23:21:12 2020 (r362350) @@ -240,7 +240,7 @@ aw_spi_attach(device_t dev) sc->spibus = device_add_child(dev, "spibus", -1); - return (0); + return (bus_generic_attach(dev)); fail: aw_spi_detach(dev); Modified: stable/12/sys/arm/allwinner/axp209.c ============================================================================== --- stable/12/sys/arm/allwinner/axp209.c Thu Jun 18 23:18:47 2020 (r362349) +++ stable/12/sys/arm/allwinner/axp209.c Thu Jun 18 23:21:12 2020 (r362350) @@ -709,6 +709,22 @@ axp2xx_regnode_voltage_to_reg(struct axp2xx_reg_sc *sc } static int +axp2xx_regnode_status(struct regnode *regnode, int *status) +{ + struct axp2xx_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + *status = 0; + axp2xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (val & sc->def->enable_mask) + *status = REGULATOR_STATUS_ENABLED; + + return (0); +} + +static int axp2xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) { @@ -751,6 +767,7 @@ static regnode_method_t axp2xx_regnode_methods[] = { /* Regulator interface */ REGNODEMETHOD(regnode_init, axp2xx_regnode_init), REGNODEMETHOD(regnode_enable, axp2xx_regnode_enable), + REGNODEMETHOD(regnode_status, axp2xx_regnode_status), REGNODEMETHOD(regnode_set_voltage, axp2xx_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, axp2xx_regnode_get_voltage), REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), Modified: stable/12/sys/arm/allwinner/axp81x.c ============================================================================== --- stable/12/sys/arm/allwinner/axp81x.c Thu Jun 18 23:18:47 2020 (r362349) +++ stable/12/sys/arm/allwinner/axp81x.c Thu Jun 18 23:21:12 2020 (r362350) @@ -438,6 +438,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO1, .enable_value = AXP_POWERCTL3_ALDO1, + .voltage_reg = AXP_VOLTCTL_ALDO1, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -449,6 +450,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO2, .enable_value = AXP_POWERCTL3_ALDO2, + .voltage_reg = AXP_VOLTCTL_ALDO2, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -460,6 +462,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO3, .enable_value = AXP_POWERCTL3_ALDO3, + .voltage_reg = AXP_VOLTCTL_ALDO3, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -471,6 +474,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL2, .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO1, .enable_value = AXP_POWERCTL2_ELDO1, + .voltage_reg = AXP_VOLTCTL_ELDO1, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -482,6 +486,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL2, .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO2, .enable_value = AXP_POWERCTL2_ELDO2, + .voltage_reg = AXP_VOLTCTL_ELDO2, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -493,6 +498,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL2, .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO3, .enable_value = AXP_POWERCTL2_ELDO3, + .voltage_reg = AXP_VOLTCTL_ELDO3, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -504,6 +510,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO1, .enable_value = AXP_POWERCTL3_FLDO1, + .voltage_reg = AXP_VOLTCTL_FLDO1, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, @@ -515,6 +522,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO2, .enable_value = AXP_POWERCTL3_FLDO2, + .voltage_reg = AXP_VOLTCTL_FLDO2, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, @@ -703,6 +711,8 @@ struct axp8xx_softc { #define AXP_LOCK(sc) mtx_lock(&(sc)->mtx) #define AXP_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +static int axp8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay); static int axp8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) @@ -747,6 +757,31 @@ axp8xx_write(device_t dev, uint8_t reg, uint8_t val) } static int +axp8xx_regnode_init(struct regnode *regnode) +{ + struct axp8xx_reg_sc *sc; + struct regnode_std_param *param; + int rv, udelay; + + sc = regnode_get_softc(regnode); + param = regnode_get_stdparam(regnode); + if (param->min_uvolt == 0) + return (0); + + /* + * Set the regulator at the correct voltage + * Do not enable it, this is will be done either by a + * consumer or by regnode_set_constraint if boot_on is true + */ + rv = axp8xx_regnode_set_voltage(regnode, param->min_uvolt, + param->max_uvolt, &udelay); + if (rv != 0) + DELAY(udelay); + + return (rv); +} + +static int axp8xx_regnode_enable(struct regnode *regnode, bool enable, int *udelay) { struct axp8xx_reg_sc *sc; @@ -863,6 +898,7 @@ axp8xx_regnode_get_voltage(struct regnode *regnode, in static regnode_method_t axp8xx_regnode_methods[] = { /* Regulator interface */ + REGNODEMETHOD(regnode_init, axp8xx_regnode_init), REGNODEMETHOD(regnode_enable, axp8xx_regnode_enable), REGNODEMETHOD(regnode_set_voltage, axp8xx_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, axp8xx_regnode_get_voltage), Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Thu Jun 18 23:18:47 2020 (r362349) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Thu Jun 18 23:21:12 2020 (r362350) @@ -481,7 +481,6 @@ static int twsi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { struct twsi_softc *sc; - int i; sc = device_get_softc(dev); @@ -495,28 +494,25 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint TWSI_WRITE(sc, sc->reg_control, sc->control_val); debugf(dev, "transmitting %d messages\n", nmsgs); debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); - for (i = 0; i < nmsgs && sc->error == 0; i++) { - sc->transfer = 1; - sc->msg = &msgs[i]; - debugf(dev, "msg[%d] flags: %x\n", i, msgs[i].flags); - debugf(dev, "msg[%d] len: %d\n", i, msgs[i].len); + sc->nmsgs = nmsgs; + sc->msgs = msgs; + sc->msg_idx = 0; + sc->transfer = 1; - /* Send start and re-enable interrupts */ - sc->control_val = TWSI_CONTROL_TWSIEN | - TWSI_CONTROL_INTEN | TWSI_CONTROL_ACK; - if (sc->msg->len == 1) - sc->control_val &= ~TWSI_CONTROL_ACK; - TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); - while (sc->error == 0 && sc->transfer != 0) { - pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); - } + /* Send start and re-enable interrupts */ + sc->control_val = TWSI_CONTROL_TWSIEN | + TWSI_CONTROL_INTEN | TWSI_CONTROL_ACK; + if (sc->msgs[0].len == 1) + sc->control_val &= ~TWSI_CONTROL_ACK; + TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); + while (sc->error == 0 && sc->transfer != 0) { + pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); + } + debugf(sc->dev, "pause finish\n"); - debugf(dev, "Done with msg[%d]\n", i); - if (sc->error) { - debugf(sc->dev, "Error, aborting (%d)\n", sc->error); - TWSI_WRITE(sc, sc->reg_control, 0); - goto out; - } + if (sc->error) { + debugf(sc->dev, "Error, aborting (%d)\n", sc->error); + TWSI_WRITE(sc, sc->reg_control, 0); } /* Disable module and interrupts */ @@ -524,7 +520,6 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint TWSI_WRITE(sc, sc->reg_control, 0); debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); -out: return (sc->error); } @@ -537,122 +532,123 @@ twsi_intr(void *arg) sc = arg; - debugf(sc->dev, "Got interrupt\n"); + debugf(sc->dev, "Got interrupt Current msg=%x\n", sc->msg_idx); - while (TWSI_READ(sc, sc->reg_control) & TWSI_CONTROL_IFLG) { - status = TWSI_READ(sc, sc->reg_status); - debugf(sc->dev, "status=%x\n", status); + status = TWSI_READ(sc, sc->reg_status); + debugf(sc->dev, "initial status=%x\n", status); - switch (status) { - case TWSI_STATUS_START: - case TWSI_STATUS_RPTD_START: - /* Transmit the address */ - debugf(sc->dev, "Send the address\n"); + switch (status) { + case TWSI_STATUS_START: + case TWSI_STATUS_RPTD_START: + /* Transmit the address */ + debugf(sc->dev, "Send the address\n"); - if (sc->msg->flags & IIC_M_RD) - TWSI_WRITE(sc, sc->reg_data, - sc->msg->slave | LSB); - else - TWSI_WRITE(sc, sc->reg_data, - sc->msg->slave & ~LSB); + if (sc->msgs[sc->msg_idx].flags & IIC_M_RD) + TWSI_WRITE(sc, sc->reg_data, + sc->msgs[sc->msg_idx].slave | LSB); + else + TWSI_WRITE(sc, sc->reg_data, + sc->msgs[sc->msg_idx].slave & ~LSB); + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; - TWSI_WRITE(sc, sc->reg_control, sc->control_val); - break; + case TWSI_STATUS_ADDR_W_ACK: + debugf(sc->dev, "Ack received after transmitting the address (write)\n"); + /* Directly send the first byte */ + sc->sent_bytes = 0; + debugf(sc->dev, "Sending byte 0 = %x\n", sc->msgs[sc->msg_idx].buf[0]); + TWSI_WRITE(sc, sc->reg_data, sc->msgs[sc->msg_idx].buf[0]); - case TWSI_STATUS_ADDR_W_ACK: - debugf(sc->dev, "Ack received after transmitting the address\n"); - /* Directly send the first byte */ - sc->sent_bytes = 0; - debugf(sc->dev, "Sending byte 0 = %x\n", sc->msg->buf[0]); - TWSI_WRITE(sc, sc->reg_data, sc->msg->buf[0]); + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; - TWSI_WRITE(sc, sc->reg_control, sc->control_val); - break; + case TWSI_STATUS_ADDR_R_ACK: + debugf(sc->dev, "Ack received after transmitting the address (read)\n"); + sc->recv_bytes = 0; - case TWSI_STATUS_ADDR_R_ACK: - debugf(sc->dev, "Ack received after transmitting the address\n"); - sc->recv_bytes = 0; + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; - TWSI_WRITE(sc, sc->reg_control, sc->control_val); - break; + case TWSI_STATUS_ADDR_W_NACK: + case TWSI_STATUS_ADDR_R_NACK: + debugf(sc->dev, "No ack received after transmitting the address\n"); + sc->transfer = 0; + sc->error = ETIMEDOUT; + sc->control_val = 0; + wakeup(sc); + break; - case TWSI_STATUS_ADDR_W_NACK: - case TWSI_STATUS_ADDR_R_NACK: - debugf(sc->dev, "No ack received after transmitting the address\n"); - sc->transfer = 0; - sc->error = ETIMEDOUT; - sc->control_val = 0; - wakeup(sc); - break; - - case TWSI_STATUS_DATA_WR_ACK: - debugf(sc->dev, "Ack received after transmitting data\n"); - if (sc->sent_bytes++ == (sc->msg->len - 1)) { - debugf(sc->dev, "Done sending all the bytes\n"); - /* Send stop, no interrupts on stop */ - if (!(sc->msg->flags & IIC_M_NOSTOP)) { - debugf(sc->dev, "Done TX data, send stop\n"); - TWSI_WRITE(sc, sc->reg_control, - sc->control_val | TWSI_CONTROL_STOP); - } else { - sc->control_val &= ~TWSI_CONTROL_INTEN; - TWSI_WRITE(sc, sc->reg_control, - sc->control_val); - } - transfer_done = 1; - } else { - debugf(sc->dev, "Sending byte %d = %x\n", - sc->sent_bytes, - sc->msg->buf[sc->sent_bytes]); - TWSI_WRITE(sc, sc->reg_data, - sc->msg->buf[sc->sent_bytes]); + case TWSI_STATUS_DATA_WR_ACK: + debugf(sc->dev, "Ack received after transmitting data\n"); + if (sc->sent_bytes++ == (sc->msgs[sc->msg_idx].len - 1)) { + debugf(sc->dev, "Done sending all the bytes for msg %d\n", sc->msg_idx); + /* Send stop, no interrupts on stop */ + if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP)) { + debugf(sc->dev, "Done TX data, send stop\n"); TWSI_WRITE(sc, sc->reg_control, - sc->control_val); + sc->control_val | TWSI_CONTROL_STOP); + } else { + debugf(sc->dev, "Done TX data with NO_STOP\n"); + TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); } + sc->msg_idx++; + if (sc->msg_idx == sc->nmsgs) { + debugf(sc->dev, "transfer_done=1\n"); + transfer_done = 1; + } + } else { + debugf(sc->dev, "Sending byte %d = %x\n", + sc->sent_bytes, + sc->msgs[sc->msg_idx].buf[sc->sent_bytes]); + TWSI_WRITE(sc, sc->reg_data, + sc->msgs[sc->msg_idx].buf[sc->sent_bytes]); + TWSI_WRITE(sc, sc->reg_control, + sc->control_val); + } + break; - break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jun 18 23:23:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3ED97337AF2; Thu, 18 Jun 2020 23:23:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nyfg6JXwz4Dyr; Thu, 18 Jun 2020 23:23:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D290D11AC0; Thu, 18 Jun 2020 23:23:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05INNNdi053278; Thu, 18 Jun 2020 23:23:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05INNLOp053264; Thu, 18 Jun 2020 23:23:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006182323.05INNLOp053264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 18 Jun 2020 23:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362351 - in stable/12/sys/arm/allwinner: . a10 a13 a20 a31 a33 a64 a83t h3 h6 X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys/arm/allwinner: . a10 a13 a20 a31 a33 a64 a83t h3 h6 X-SVN-Commit-Revision: 362351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:23:24 -0000 Author: manu Date: Thu Jun 18 23:23:21 2020 New Revision: 362351 URL: https://svnweb.freebsd.org/changeset/base/362351 Log: MFC r356888, r356891 r356888: arm: allwinner: Fix padconf for interrupts information Add a eint_bank member to the allwinner_pins structure. On Allwinner SoCs not all pins can do interrupt. Older SoC (A10/A13 and A20) there is a maximum number of interrupts set to 32 and all the configuration is done in the same registers. While on "newer" SoCs (>=A31) interrupts registers are splitted per pin bank (i.e. all interrupts available in bank B will be configured with a sets of registers and the one in bank G in another set). While here set the names to all interrupts function to pX_eintY where X is the bank name and Y the interrupt number. To whom ever in the future look at the H5 manual and notice that the bank F have interrupts support : This isn't true, trust me. r356891: arm: allwinner: Add GPIO Interrupt support Not all pins in Allwinner have interrupts support so we rely on the padconf data to add the proper caps when pin_getcaps is called. The pin is switch to the specific "eint" function during setup_intr and switched back to its old function in teardown_intr. Only INTR_MAP_DATA_GPIO is supported for now. Modified: stable/12/sys/arm/allwinner/a10/a10_padconf.c stable/12/sys/arm/allwinner/a13/a13_padconf.c stable/12/sys/arm/allwinner/a20/a20_padconf.c stable/12/sys/arm/allwinner/a31/a31_padconf.c stable/12/sys/arm/allwinner/a31/a31s_padconf.c stable/12/sys/arm/allwinner/a33/a33_padconf.c stable/12/sys/arm/allwinner/a64/a64_padconf.c stable/12/sys/arm/allwinner/a64/a64_r_padconf.c stable/12/sys/arm/allwinner/a83t/a83t_padconf.c stable/12/sys/arm/allwinner/allwinner_pinctrl.h stable/12/sys/arm/allwinner/aw_gpio.c stable/12/sys/arm/allwinner/h3/h3_padconf.c stable/12/sys/arm/allwinner/h3/h3_r_padconf.c stable/12/sys/arm/allwinner/h6/h6_padconf.c stable/12/sys/arm/allwinner/h6/h6_r_padconf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/a10/a10_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a10/a10_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a10/a10_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -170,28 +170,28 @@ const static struct allwinner_pins a10_pins[] = { {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, - {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint0", "csi1"}, 6, 0}, - {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint1", "csi1"}, 6, 1}, - {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint2", "csi1"}, 6, 2}, - {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint3", "csi1"}, 6, 3}, - {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint4", "csi1"}, 6, 4}, - {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint5", "csi1"}, 6, 5}, - {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint6", "csi1"}, 6, 6}, - {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint7", "csi1"}, 6, 7}, - {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint8", "csi1"}, 6, 8}, - {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint9", "csi1"}, 6, 9}, - {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint10", "csi1"}, 6, 10}, - {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint11", "csi1"}, 6, 11}, - {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint12", "csi1"}, 6, 12}, - {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint13", "csi1"}, 6, 13}, - {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint14", "csi1"}, 6, 14}, - {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint15", "csi1"}, 6, 15}, - {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint16", "csi1"}, 6, 16}, - {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint17", "csi1"}, 6, 17}, - {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint18", "csi1"}, 6, 18}, - {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint19", "csi1"}, 6, 19}, - {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint20", "csi1"}, 6, 20}, - {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint21", "csi1"}, 6, 21}, + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint0", "csi1"}, 6, 0, 0}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint1", "csi1"}, 6, 1, 0}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint2", "csi1"}, 6, 2, 0}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint3", "csi1"}, 6, 3, 0}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "ph_eint4", "csi1"}, 6, 4, 0}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "ph_eint5", "csi1"}, 6, 5, 0}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "ph_eint6", "csi1"}, 6, 6, 0}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "ph_eint7", "csi1"}, 6, 7, 0}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint8", "csi1"}, 6, 8, 0}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint9", "csi1"}, 6, 9, 0}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint10", "csi1"}, 6, 10, 0}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint11", "csi1"}, 6, 11, 0}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "ph_eint12", "csi1"}, 6, 12, 0}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "ph_eint13", "csi1"}, 6, 13, 0}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint14", "csi1"}, 6, 14, 0}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint15", "csi1"}, 6, 15, 0}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "ph_eint16", "csi1"}, 6, 16, 0}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint17", "csi1"}, 6, 17, 0}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint18", "csi1"}, 6, 18, 0}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint19", "csi1"}, 6, 19, 0}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "ph_eint20", "csi1"}, 6, 20, 0}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "ph_eint21", "csi1"}, 6, 21, 0}, {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, @@ -209,16 +209,16 @@ const static struct allwinner_pins a10_pins[] = { {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, - {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint22", NULL}, 6, 22}, - {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint23", NULL}, 6, 23}, - {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint24", NULL}, 6, 24}, - {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint25", NULL}, 6, 25}, - {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint26", NULL}, 6, 26}, - {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint27", NULL}, 6, 27}, - {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint28", NULL}, 6, 28}, - {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint29", NULL}, 6, 29}, - {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint30", NULL}, 6, 30}, - {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint31", NULL}, 6, 31}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint22", NULL}, 6, 22, 0}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint23", NULL}, 6, 23, 0}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "pi_eint24", NULL}, 6, 24, 0}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "pi_eint25", NULL}, 6, 25, 0}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "pi_eint26", NULL}, 6, 26, 0}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "pi_eint27", NULL}, 6, 27, 0}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint28", NULL}, 6, 28, 0}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint29", NULL}, 6, 29, 0}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint30", NULL}, 6, 30, 0}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint31", NULL}, 6, 31, 0}, {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, }; Modified: stable/12/sys/arm/allwinner/a13/a13_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a13/a13_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a13/a13_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); const static struct allwinner_pins a13_pins[] = { {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, "eint16", NULL}, 6, 16}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "eint17", NULL}, 6, 17}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "eint18", NULL}, 6, 18}, - {"PB10", 1, 10, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, "eint24", NULL}, 6, 24}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, "pb_eint16", NULL}, 6, 16, 0}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "pb_eint17", NULL}, 6, 17, 0}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "pb_eint18", NULL}, 6, 18, 0}, + {"PB10", 1, 10, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, "pb_eint24", NULL}, 6, 24, 0}, {"PB15", 1, 15, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, {"PB16", 1, 16, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, {"PB17", 1, 17, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, @@ -90,8 +90,8 @@ const static struct allwinner_pins a13_pins[] = { {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, - {"PE0", 4, 0, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "eint14", NULL}, 6, 14}, - {"PE1", 4, 1, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "eint15", NULL}, 6, 15}, + {"PE0", 4, 0, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "pe_eint14", NULL}, 6, 14, 0}, + {"PE1", 4, 1, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "pe_eint15", NULL}, 6, 15, 0}, {"PE2", 4, 2, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, NULL, NULL}}, {"PE3", 4, 3, {"gpio_in", "gpio_out", NULL, "csi0", "spi2", NULL, NULL, NULL}}, {"PE4", 4, 4, {"gpio_in", "gpio_out", NULL, "csi0", "mmc2", NULL, NULL, NULL}}, @@ -110,15 +110,15 @@ const static struct allwinner_pins a13_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, NULL, NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, NULL, NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint0", NULL}, 6, 0}, - {"PG1", 6, 1, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint1", NULL}, 6, 1}, - {"PG2", 6, 2, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint2", NULL}, 6, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint3", NULL}, 6, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint4", NULL}, 6, 4}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint9", NULL}, 6, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint10", NULL}, 6, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint11", NULL}, 6, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint12", NULL}, 6, 12}, + {"PG0", 6, 0, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0, 6}, + {"PG1", 6, 1, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1, 6}, + {"PG2", 6, 2, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "pg_eint3", NULL}, 6, 3, 0}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "pg_eint4", NULL}, 6, 4, 0}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint9", NULL}, 6, 9, 0}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint10", NULL}, 6, 10, 0}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint11", NULL}, 6, 11, 0}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint12", NULL}, 6, 12, 0}, }; const struct allwinner_padconf a13_padconf = { Modified: stable/12/sys/arm/allwinner/a20/a20_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a20/a20_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a20/a20_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -101,10 +101,10 @@ const static struct allwinner_pins a20_pins[] = { {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, {"PC17", 2, 17, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, {"PC18", 2, 18, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, - {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint12", NULL}, 6, 12}, - {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint13", NULL}, 6, 13}, - {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint14", NULL}, 6, 14}, - {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint15", NULL}, 6, 15}, + {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, + {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, + {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, + {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, {"PC23", 2, 23, {"gpio_in", "gpio_out", NULL, "spi0", NULL, NULL, NULL, NULL}}, {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, @@ -170,28 +170,28 @@ const static struct allwinner_pins a20_pins[] = { {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, - {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint0", "csi1"}, 6, 0}, - {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint1", "csi1"}, 6, 1}, - {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint2", "csi1"}, 6, 2}, - {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint3", "csi1"}, 6, 3}, - {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint4", "csi1"}, 6, 4}, - {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint5", "csi1"}, 6, 5}, - {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint6", "csi1"}, 6, 6}, - {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint7", "csi1"}, 6, 7}, - {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint8", "csi1"}, 6, 8}, - {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint9", "csi1"}, 6, 9}, - {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint10", "csi1"}, 6, 10}, - {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint11", "csi1"}, 6, 11}, - {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", NULL, "eint12", "csi1"}, 6, 12}, - {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", "sim", "eint13", "csi1"}, 6, 13}, - {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint14", "csi1"}, 6, 14}, - {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint15", "csi1"}, 6, 15}, - {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint16", "csi1"}, 6, 16}, - {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint17", "csi1"}, 6, 17}, - {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint18", "csi1"}, 6, 18}, - {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint19", "csi1"}, 6, 19}, - {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint20", "csi1"}, 6, 20}, - {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint21", "csi1"}, 6, 21}, + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint0", "csi1"}, 6, 0, 0}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint1", "csi1"}, 6, 1, 0}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint2", "csi1"}, 6, 2, 0}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint3", "csi1"}, 6, 3, 0}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "ph_eint4", "csi1"}, 6, 4, 0}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "ph_eint5", "csi1"}, 6, 5, 0}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "ph_eint6", "csi1"}, 6, 6, 0}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "ph_eint7", "csi1"}, 6, 7, 0}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint8", "csi1"}, 6, 8, 0}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint9", "csi1"}, 6, 9, 0}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint10", "csi1"}, 6, 10, 0}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint11", "csi1"}, 6, 11, 0}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", NULL, "ph_eint12", "csi1"}, 6, 12, 0}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", "sim", "ph_eint13", "csi1"}, 6, 13, 0}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint14", "csi1"}, 6, 14, 0}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint15", "csi1"}, 6, 15, 0}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint16", "csi1"}, 6, 16, 0}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint17", "csi1"}, 6, 17, 0}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint18", "csi1"}, 6, 18, 0}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint19", "csi1"}, 6, 19, 0}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "ph_eint20", "csi1"}, 6, 20, 0}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "ph_eint21", "csi1"}, 6, 21, 0}, {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, @@ -209,16 +209,16 @@ const static struct allwinner_pins a20_pins[] = { {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, - {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, - {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, - {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_a", NULL, "eint", NULL}}, - {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_b", NULL, "eint", NULL}}, - {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint", NULL}}, - {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint", NULL}}, - {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, - {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, - {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, - {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint22", NULL}, 6, 22, 0}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint23", NULL}, 6, 23, 0}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_a", NULL, "pi_eint24", NULL}, 6, 24, 0}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_b", NULL, "pi_eint25", NULL}, 6, 25, 0}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "pi_eint26", NULL}, 6, 26, 0}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "pi_eint27", NULL}, 6, 27, 0}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint28", NULL}, 6, 28, 0}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint29", NULL}, 6, 29, 0}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint30", NULL}, 6, 30, 0}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint31", NULL}, 6, 31, 0}, {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, }; Modified: stable/12/sys/arm/allwinner/a31/a31_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a31/a31_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a31/a31_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -38,43 +38,43 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A31 const static struct allwinner_pins a31_pins[] = { - {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint0", NULL}, 6, 0}, - {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint1", NULL}, 6, 1}, - {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint2", NULL}, 6, 2}, - {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint3", NULL}, 6, 3}, - {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint4", NULL}, 6, 4}, - {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint5", NULL}, 6, 5}, - {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint6", NULL}, 6, 6}, - {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint7", NULL}, 6, 7}, - {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint8", NULL}, 6, 8}, - {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, "mmc2", "pa_eint9", NULL}, 6, 9}, - {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10}, - {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11}, - {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12}, - {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13}, - {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14}, - {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_a", NULL, "pa_eint15", NULL}, 6, 15}, - {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint16", NULL}, 6, 16}, - {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint17", NULL}, 6, 17}, - {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_b", NULL, "pa_eint18", NULL}, 6, 18}, - {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint19", NULL}, 6, 19}, - {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint20", NULL}, 6, 20}, - {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint21", NULL}, 6, 21}, - {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint22", NULL}, 6, 22}, - {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint23", NULL}, 6, 23}, - {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint24", NULL}, 6, 24}, - {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint25", NULL}, 6, 25}, - {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26}, - {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint27", NULL}, 6, 27}, + {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint0", NULL}, 6, 0, 0}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint1", NULL}, 6, 1, 0}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint2", NULL}, 6, 2, 0}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint3", NULL}, 6, 3, 0}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint4", NULL}, 6, 4, 0}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint5", NULL}, 6, 5, 0}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint6", NULL}, 6, 6, 0}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint7", NULL}, 6, 7, 0}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint8", NULL}, 6, 8, 0}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, "mmc2", "pa_eint9", NULL}, 6, 9, 0}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10, 0}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11, 0}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12, 0}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13, 0}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14, 0}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_a", NULL, "pa_eint15", NULL}, 6, 15, 0}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint16", NULL}, 6, 16, 0}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint17", NULL}, 6, 17, 0}, + {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_b", NULL, "pa_eint18", NULL}, 6, 18, 0}, + {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint19", NULL}, 6, 19, 0}, + {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint20", NULL}, 6, 20, 0}, + {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint21", NULL}, 6, 21, 0}, + {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint22", NULL}, 6, 22, 0}, + {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint23", NULL}, 6, 23, 0}, + {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint24", NULL}, 6, 24, 0}, + {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint25", NULL}, 6, 25, 0}, + {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26, 0}, + {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint27", NULL}, 6, 27, 0}, - {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", "csi", NULL, "pb_eint0", NULL}, 6, 0}, - {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4}, - {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5}, - {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6}, - {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7}, + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", "csi", NULL, "pb_eint0", NULL}, 6, 0, 1}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1, 1}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2, 1}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3, 1}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4, 1}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5, 1}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6, 1}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7, 1}, {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, @@ -134,23 +134,23 @@ const static struct allwinner_pins a31_pins[] = { {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, - {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0}, - {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1}, - {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2}, - {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3}, - {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4}, - {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5}, - {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6}, - {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7}, - {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8}, - {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9}, - {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10}, - {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11}, - {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12}, - {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13}, - {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14}, - {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15}, - {"PE16", 4, 16, {"gpio_in", "gpio_out", "csi", NULL, NULL, NULL, "pe_eint16", NULL}, 6, 16}, + {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0, 4}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1, 4}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2, 4}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3, 4}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4, 4}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5, 4}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6, 4}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7, 4}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8, 4}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9, 4}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10, 4}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11, 4}, + {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12, 4}, + {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13, 4}, + {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14, 4}, + {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15, 4}, + {"PE16", 4, 16, {"gpio_in", "gpio_out", "csi", NULL, NULL, NULL, "pe_eint16", NULL}, 6, 16, 4}, {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, @@ -159,25 +159,25 @@ const static struct allwinner_pins a31_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0}, - {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1}, - {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4}, - {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5}, - {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6}, - {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7}, - {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint10", NULL}, 6, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint11", NULL}, 6, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12}, - {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13}, - {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14}, - {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15}, - {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16}, - {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17}, - {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18}, + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0, 6}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1, 6}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3, 6}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4, 6}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5, 6}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6, 6}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7, 6}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8, 6}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9, 6}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint10", NULL}, 6, 10, 6}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint11", NULL}, 6, 11, 6}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12, 6}, + {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13, 6}, + {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14, 6}, + {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15, 6}, + {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16, 6}, + {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17, 6}, + {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18, 6}, {"PH0", 7, 0, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, {"PH1", 7, 1, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, Modified: stable/12/sys/arm/allwinner/a31/a31s_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a31/a31s_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a31/a31s_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -38,43 +38,43 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A31S const static struct allwinner_pins a31s_pins[] = { - {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint0", NULL}, 6, 0}, - {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint1", NULL}, 6, 1}, - {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint2", NULL}, 6, 2}, - {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint3", NULL}, 6, 3}, - {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint4", NULL}, 6, 4}, - {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint5", NULL}, 6, 5}, - {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint6", NULL}, 6, 6}, - {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint7", NULL}, 6, 7}, - {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint8", NULL}, 6, 8}, - {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint9", NULL}, 6, 9}, - {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10}, - {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11}, - {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12}, - {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13}, - {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14}, - {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint15", NULL}, 6, 15}, - {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint16", NULL}, 6, 16}, - {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_b", NULL, "pa_eint17", NULL}, 6, 17}, - {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint18", NULL}, 6, 18}, - {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint19", NULL}, 6, 19}, - {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint20", NULL}, 6, 20}, - {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint21", NULL}, 6, 21}, - {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint22", NULL}, 6, 22}, - {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint23", NULL}, 6, 23}, - {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint24", NULL}, 6, 24}, - {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint25", NULL}, 6, 25}, - {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26}, - {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint27", NULL}, 6, 27}, + {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint0", NULL}, 6, 0, 0}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint1", NULL}, 6, 1, 0}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint2", NULL}, 6, 2, 0}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint3", NULL}, 6, 3, 0}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint4", NULL}, 6, 4, 0}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint5", NULL}, 6, 5, 0}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint6", NULL}, 6, 6, 0}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint7", NULL}, 6, 7, 0}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint8", NULL}, 6, 8, 0}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint9", NULL}, 6, 9, 0}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10, 0}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11, 0}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12, 0}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13, 0}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14, 0}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint15", NULL}, 6, 15, 0}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint16", NULL}, 6, 16, 0}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_b", NULL, "pa_eint17", NULL}, 6, 17, 0}, + {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint18", NULL}, 6, 18, 0}, + {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint19", NULL}, 6, 19, 0}, + {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint20", NULL}, 6, 20, 0}, + {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint21", NULL}, 6, 21, 0}, + {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint22", NULL}, 6, 22, 0}, + {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint23", NULL}, 6, 23, 0}, + {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint24", NULL}, 6, 24, 0}, + {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint25", NULL}, 6, 25, 0}, + {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26, 0}, + {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint27", NULL}, 6, 27, 0}, - {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL , NULL, "pb_eint0", NULL}, 6, 0}, - {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4}, - {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5}, - {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6}, - {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7}, + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL , NULL, "pb_eint0", NULL}, 6, 0, 1}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1, 1}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2, 1}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3, 1}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4, 1}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5, 1}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6, 1}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7, 1}, {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, @@ -126,22 +126,22 @@ const static struct allwinner_pins a31s_pins[] = { {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, - {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0}, - {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1}, - {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2}, - {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3}, - {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4}, - {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5}, - {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6}, - {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7}, - {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8}, - {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9}, - {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10}, - {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11}, - {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12}, - {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13}, - {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14}, - {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15}, + {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0, 4}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1, 4}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2, 4}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3, 4}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4, 4}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5, 4}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6, 4}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7, 4}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8, 4}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9, 4}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10, 4}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11, 4}, + {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12, 4}, + {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13, 4}, + {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14, 4}, + {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15, 4}, {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, @@ -150,25 +150,25 @@ const static struct allwinner_pins a31s_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0}, - {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1}, - {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4}, - {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5}, - {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6}, - {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7}, - {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12}, - {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13}, - {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14}, - {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15}, - {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16}, - {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17}, - {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18}, + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0, 6}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1, 6}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3, 6}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4, 6}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5, 6}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6, 6}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7, 6}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8, 6}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9, 6}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10, 6}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11, 6}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12, 6}, + {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13, 6}, + {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14, 6}, + {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15, 6}, + {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16, 6}, + {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17, 6}, + {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18, 6}, {"PH9", 7, 9, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, {"PH10", 7, 10, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, Modified: stable/12/sys/arm/allwinner/a33/a33_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a33/a33_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a33/a33_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -38,14 +38,14 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A33 const static struct allwinner_pins a33_pins[] = { - {"PB0", 1, 0, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint0", NULL}, 4, 0}, - {"PB1", 1, 1, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint1", NULL}, 4, 1}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint2", NULL}, 4, 2}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint3", NULL}, 4, 3}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint4", NULL}, 4, 4}, - {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint5", NULL}, 4, 5}, - {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint6", NULL}, 4, 6}, - {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint7", NULL}, 4, 7}, + {"PB0", 1, 0, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint0", NULL}, 4, 0, 1}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint1", NULL}, 4, 1, 1}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint2", NULL}, 4, 2, 1}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint3", NULL}, 4, 3, 1}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint4", NULL}, 4, 4, 1}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint5", NULL}, 4, 5, 1}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint6", NULL}, 4, 6, 1}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint7", NULL}, 4, 7, 1}, {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, @@ -114,20 +114,20 @@ const static struct allwinner_pins a33_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint0", NULL}, 4, 0}, - {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint1", NULL}, 4, 1}, - {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint2", NULL}, 4, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint3", NULL}, 4, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint4", NULL}, 4, 4}, - {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint5", NULL}, 4, 5}, - {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint6", NULL}, 4, 6}, - {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint7", NULL}, 4, 7}, - {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint8", NULL}, 4, 8}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint9", NULL}, 4, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint10", NULL}, 4, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint11", NULL}, 4, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint12", NULL}, 4, 12}, - {"PG13", 6, 13, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint13", NULL}, 4, 13}, + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint0", NULL}, 4, 0, 6}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint1", NULL}, 4, 1, 6}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint2", NULL}, 4, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint3", NULL}, 4, 3, 6}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint4", NULL}, 4, 4, 6}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint5", NULL}, 4, 5, 6}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint6", NULL}, 4, 6, 6}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint7", NULL}, 4, 7, 6}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint8", NULL}, 4, 8, 6}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint9", NULL}, 4, 9, 6}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint10", NULL}, 4, 10, 6}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint11", NULL}, 4, 11, 6}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint12", NULL}, 4, 12, 6}, + {"PG13", 6, 13, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint13", NULL}, 4, 13, 6}, {"PH0", 7, 0, {"gpio_in", "gpio_out", "pwm0", NULL, NULL, NULL, NULL, NULL}}, {"PH1", 7, 1, {"gpio_in", "gpio_out", "pwm1", NULL, NULL, NULL, NULL, NULL}}, Modified: stable/12/sys/arm/allwinner/a64/a64_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a64/a64_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a64/a64_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -41,16 +41,16 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A64 static const struct allwinner_pins a64_pins[] = { - { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "pb_eint0" }, 6, 0}, - { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint1" }, 6, 1}, - { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint2" }, 6, 2}, - { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "pb_eint3" }, 6, 3}, - { "PB4", 1, 4, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint4" }, 6, 4}, - { "PB5", 1, 5, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint5" }, 6, 5}, - { "PB6", 1, 6, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint6" }, 6, 6}, - { "PB7", 1, 7, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint7" }, 6, 7}, - { "PB8", 1, 8, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint8" }, 6, 8}, - { "PB9", 1, 9, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint9" }, 6, 9}, + { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "pb_eint0" }, 6, 0, 0}, + { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint1" }, 6, 1, 0}, + { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint2" }, 6, 2, 0}, + { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "pb_eint3" }, 6, 3, 0}, + { "PB4", 1, 4, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint4" }, 6, 4, 0}, + { "PB5", 1, 5, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint5" }, 6, 5, 0}, + { "PB6", 1, 6, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint6" }, 6, 6, 0}, + { "PB7", 1, 7, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint7" }, 6, 7, 0}, + { "PB8", 1, 8, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint8" }, 6, 8, 0}, + { "PB9", 1, 9, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint9" }, 6, 9, 0}, { "PC0", 2, 0, { "gpio_in", "gpio_out", "nand", NULL, "spi0" } }, { "PC1", 2, 1, { "gpio_in", "gpio_out", "nand", "mmc2", "spi0" } }, @@ -123,33 +123,33 @@ static const struct allwinner_pins a64_pins[] = { { "PF5", 5, 5, { "gpio_in", "gpio_out", "mmc0", "jtag" } }, { "PF6", 5, 6, { "gpio_in", "gpio_out" } }, - { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0}, - { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1}, - { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2}, - { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3}, - { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4}, - { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5}, - { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" }, 6, 6}, - { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" }, 6, 7}, - { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8" }, 6, 8}, - { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9" }, 6, 9}, - { "PG10", 6, 10, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint10" }, 6, 10}, - { "PG11", 6, 11, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint11" }, 6, 11}, - { "PG12", 6, 12, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint12" }, 6, 12}, - { "PG13", 6, 13, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint13" }, 6, 13}, + { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0, 1}, + { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1, 1}, + { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2, 1}, + { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3, 1}, + { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4, 1}, + { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5, 1}, + { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" }, 6, 6, 1}, + { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" }, 6, 7, 1}, + { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8" }, 6, 8, 1}, + { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9" }, 6, 9, 1}, + { "PG10", 6, 10, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint10" }, 6, 10, 1}, + { "PG11", 6, 11, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint11" }, 6, 11, 1}, + { "PG12", 6, 12, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint12" }, 6, 12, 1}, + { "PG13", 6, 13, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint13" }, 6, 13, 1}, - { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" }, 6, 0}, - { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" }, 6, 1}, - { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" }, 6, 2}, - { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" }, 6, 3}, - { "PH4", 7, 4, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint4" }, 6, 4}, - { "PH5", 7, 5, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint5" }, 6, 5}, - { "PH6", 7, 6, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint6" }, 6, 6}, - { "PH7", 7, 7, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint7" }, 6, 7}, - { "PH8", 7, 8, { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "ph_eint8" }, 6, 8}, - { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" }, 6, 9}, - { "PH10", 7, 10, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint10" }, 6, 10}, - { "PH11", 7, 11, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint11" }, 6, 11}, + { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" }, 6, 0, 2}, + { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" }, 6, 1, 2}, + { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" }, 6, 2, 2}, + { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" }, 6, 3, 2}, + { "PH4", 7, 4, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint4" }, 6, 4, 2}, + { "PH5", 7, 5, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint5" }, 6, 5, 2}, + { "PH6", 7, 6, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint6" }, 6, 6, 2}, + { "PH7", 7, 7, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint7" }, 6, 7, 2}, + { "PH8", 7, 8, { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "ph_eint8" }, 6, 8, 2}, + { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" }, 6, 9, 2}, + { "PH10", 7, 10, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint10" }, 6, 10, 2}, + { "PH11", 7, 11, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint11" }, 6, 11, 2}, }; const struct allwinner_padconf a64_padconf = { Modified: stable/12/sys/arm/allwinner/a64/a64_r_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a64/a64_r_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a64/a64_r_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -41,19 +41,19 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A64 static const struct allwinner_pins a64_r_pins[] = { - { "PL0", 0, 0, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint0" }, 6, 0}, - { "PL1", 0, 1, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint1" }, 6, 1}, - { "PL2", 0, 2, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2" }, 6, 2}, - { "PL3", 0, 3, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3" }, 6, 3}, - { "PL4", 0, 4, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4" }, 6, 4}, - { "PL5", 0, 5, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5" }, 6, 5}, - { "PL6", 0, 6, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6" }, 6, 6}, - { "PL7", 0, 7, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7" }, 6, 7}, - { "PL8", 0, 8, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint8" }, 6, 8}, - { "PL9", 0, 9, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint9" }, 6, 9}, - { "PL10", 0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10" }, 6, 10}, - { "PL11", 0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "pl_eint11" }, 6, 11}, - { "PL12", 0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint12" }, 6, 12}, + { "PL0", 0, 0, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint0" }, 6, 0, 0}, + { "PL1", 0, 1, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint1" }, 6, 1, 0}, + { "PL2", 0, 2, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2" }, 6, 2, 0}, + { "PL3", 0, 3, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3" }, 6, 3, 0}, + { "PL4", 0, 4, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4" }, 6, 4, 0}, + { "PL5", 0, 5, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5" }, 6, 5, 0}, + { "PL6", 0, 6, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6" }, 6, 6, 0}, + { "PL7", 0, 7, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7" }, 6, 7, 0}, + { "PL8", 0, 8, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint8" }, 6, 8, 0}, + { "PL9", 0, 9, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint9" }, 6, 9, 0}, + { "PL10", 0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10" }, 6, 10, 0}, + { "PL11", 0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "pl_eint11" }, 6, 11, 0}, + { "PL12", 0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint12" }, 6, 12, 0}, }; const struct allwinner_padconf a64_r_padconf = { Modified: stable/12/sys/arm/allwinner/a83t/a83t_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a83t/a83t_padconf.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/a83t/a83t_padconf.c Thu Jun 18 23:23:21 2020 (r362351) @@ -39,17 +39,17 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A83T static const struct allwinner_pins a83t_pins[] = { - { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB4", 1, 4, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB5", 1, 5, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB6", 1, 6, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB7", 1, 7, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB8", 1, 8, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB9", 1, 9, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint" } }, - { "PB10", 1, 10, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint" } }, + { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint0" }, 6, 0, 0}, + { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint1" }, 6, 1, 0}, + { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint2" }, 6, 2, 0}, + { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint3" }, 6, 3, 0}, + { "PB4", 1, 4, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint4" }, 6, 4, 0}, + { "PB5", 1, 5, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint5" }, 6, 5, 0}, + { "PB6", 1, 6, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint6" }, 6, 6, 0}, + { "PB7", 1, 7, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint7" }, 6, 7, 0}, + { "PB8", 1, 8, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint8" }, 6, 8, 0}, + { "PB9", 1, 9, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "pb_eint9" }, 6, 9, 0}, + { "PB10", 1, 10, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "pb_eint10" }, 6, 10, 0}, { "PC0", 2, 0, { "gpio_in", "gpio_out", "nand", "spi0" } }, { "PC1", 2, 1, { "gpio_in", "gpio_out", "nand", "spi0" } }, @@ -125,33 +125,33 @@ static const struct allwinner_pins a83t_pins[] = { { "PF5", 5, 5, { "gpio_in", "gpio_out", "mmc0", "jtag" } }, { "PF6", 5, 6, { "gpio_in", "gpio_out" } }, - { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG10", 6, 10, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, - { "PG11", 6, 11, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, - { "PG12", 6, 12, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, - { "PG13", 6, 13, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, + { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0, 1}, + { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1, 1}, + { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2, 1}, + { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3, 1}, + { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4, 1}, + { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5, 1}, + { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint6" }, 6, 6, 1}, + { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint7" }, 6, 7, 1}, + { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint8" }, 6, 8, 1}, + { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint9" }, 6, 9, 1}, + { "PG10", 6, 10, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint10" }, 6, 10, 1}, + { "PG11", 6, 11, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint11" }, 6, 11, 1}, + { "PG12", 6, 12, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint12" }, 6, 12, 1}, + { "PG13", 6, 13, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint13" }, 6, 13, 1}, - { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } }, - { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } }, - { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } }, - { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } }, - { "PH4", 7, 4, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "eint" } }, - { "PH5", 7, 5, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "eint" } }, - { "PH6", 7, 6, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } }, - { "PH7", 7, 7, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } }, - { "PH8", 7, 8, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } }, - { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } }, - { "PH10", 7, 10, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } }, - { "PH11", 7, 11, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } }, + { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" }, 6, 0, 2}, + { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" }, 6, 1, 2}, + { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" }, 6, 2, 2}, + { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" }, 6, 3, 2}, + { "PH4", 7, 4, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "ph_eint4" }, 6, 4, 2}, + { "PH5", 7, 5, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "ph_eint5" }, 6, 5, 2}, + { "PH6", 7, 6, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "ph_eint6" }, 6, 6, 2}, + { "PH7", 7, 7, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "ph_eint7" }, 6, 7, 2}, + { "PH8", 7, 8, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "ph_eint8" }, 6, 8, 2}, + { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" }, 6, 9, 2}, + { "PH10", 7, 10, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint10" }, 6, 10, 2}, + { "PH11", 7, 11, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint11" }, 6, 11, 2}, }; const struct allwinner_padconf a83t_padconf = { Modified: stable/12/sys/arm/allwinner/allwinner_pinctrl.h ============================================================================== --- stable/12/sys/arm/allwinner/allwinner_pinctrl.h Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/allwinner_pinctrl.h Thu Jun 18 23:23:21 2020 (r362351) @@ -38,6 +38,7 @@ struct allwinner_pins { const char *functions[8]; uint8_t eint_func; uint8_t eint_num; + uint8_t eint_bank; }; struct allwinner_padconf { Modified: stable/12/sys/arm/allwinner/aw_gpio.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_gpio.c Thu Jun 18 23:21:12 2020 (r362350) +++ stable/12/sys/arm/allwinner/aw_gpio.c Thu Jun 18 23:23:21 2020 (r362351) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,11 +62,18 @@ __FBSDID("$FreeBSD$"); #include "opt_soc.h" #endif +#ifdef INTRNG +#include "pic_if.h" +#endif + #include "gpio_if.h" #define AW_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ - GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) + GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); +#define AW_GPIO_INTR_CAPS (GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | \ + GPIO_INTR_EDGE_RISING | GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) + #define AW_GPIO_NONE 0 #define AW_GPIO_PULLUP 1 #define AW_GPIO_PULLDOWN 2 @@ -249,19 +257,47 @@ struct clk_list { clk_t clk; }; +#ifdef INTRNG +struct gpio_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + uint32_t mode; + uint32_t pin; + uint32_t bank; + uint32_t intnum; + uint32_t intfunc; + uint32_t oldfunc; + bool enabled; +}; +#endif + +#define AW_GPIO_MEMRES 0 +#define AW_GPIO_IRQRES 1 +#define AW_GPIO_RESSZ 2 + struct aw_gpio_softc { device_t sc_dev; device_t sc_busdev; + struct resource * sc_res[AW_GPIO_RESSZ]; struct mtx sc_mtx; struct resource * sc_mem_res; struct resource * sc_irq_res; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; void * sc_intrhand; struct aw_gpio_conf *conf; TAILQ_HEAD(, clk_list) clk_list; + +#ifdef INTRNG + struct gpio_irqsrc *gpio_pic_irqsrc; + int nirqs; +#endif }; +static struct resource_spec aw_gpio_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; + #define AW_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #define AW_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) #define AW_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) @@ -271,15 +307,19 @@ struct aw_gpio_softc { #define AW_GPIO_GP_DRV(_bank, _idx) 0x14 + ((_bank) * 0x24) + ((_idx) << 2) #define AW_GPIO_GP_PUL(_bank, _idx) 0x1c + ((_bank) * 0x24) + ((_idx) << 2) -#define AW_GPIO_GP_INT_CFG0 0x200 -#define AW_GPIO_GP_INT_CFG1 0x204 -#define AW_GPIO_GP_INT_CFG2 0x208 -#define AW_GPIO_GP_INT_CFG3 0x20c +#define AW_GPIO_GP_INT_BASE(_bank) (0x200 + 0x20 * _bank) -#define AW_GPIO_GP_INT_CTL 0x210 -#define AW_GPIO_GP_INT_STA 0x214 -#define AW_GPIO_GP_INT_DEB 0x218 +#define AW_GPIO_GP_INT_CFG(_bank, _pin) (AW_GPIO_GP_INT_BASE(_bank) + (0x4 * ((_pin) / 8))) +#define AW_GPIO_GP_INT_CTL(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x10) +#define AW_GPIO_GP_INT_STA(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x14) +#define AW_GPIO_GP_INT_DEB(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x18) +#define AW_GPIO_INT_EDGE_POSITIVE 0x0 +#define AW_GPIO_INT_EDGE_NEGATIVE 0x1 +#define AW_GPIO_INT_LEVEL_HIGH 0x2 +#define AW_GPIO_INT_LEVEL_LOW 0x3 +#define AW_GPIO_INT_EDGE_BOTH 0x4 + static char *aw_gpio_parse_function(phandle_t node); static const char **aw_gpio_parse_pins(phandle_t node, int *pins_nb); static uint32_t aw_gpio_parse_bias(phandle_t node); @@ -290,10 +330,16 @@ static int aw_gpio_pin_set(device_t dev, uint32_t pin, static int aw_gpio_pin_get_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int *value); static int aw_gpio_pin_set_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int value); +static void aw_gpio_intr(void *arg); +static void aw_gpio_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc); +static void aw_gpio_pic_disable_intr_locked(struct aw_gpio_softc *sc, struct intr_irqsrc *isrc); +static void aw_gpio_pic_post_filter(device_t dev, struct intr_irqsrc *isrc); +static int aw_gpio_register_isrcs(struct aw_gpio_softc *sc); + #define AW_GPIO_WRITE(_sc, _off, _val) \ - bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) + bus_write_4((_sc)->sc_res[AW_GPIO_MEMRES], _off, _val) #define AW_GPIO_READ(_sc, _off) \ - bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + bus_read_4((_sc)->sc_res[AW_GPIO_MEMRES], _off) static uint32_t aw_gpio_get_function(struct aw_gpio_softc *sc, uint32_t pin) @@ -492,6 +538,8 @@ aw_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32 return (EINVAL); *caps = AW_GPIO_DEFAULT_CAPS; + if (sc->conf->padconf->pins[pin].eint_func != 0) + *caps |= AW_GPIO_INTR_CAPS; return (0); } @@ -807,6 +855,27 @@ aw_gpio_pin_config_32(device_t dev, uint32_t first_pin } static int +aw_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + struct aw_gpio_softc *sc; + int i; + + sc = device_get_softc(bus); + + /* The GPIO pins are mapped as: . */ + for (i = 0; i < sc->conf->padconf->npins; i++) + if (sc->conf->padconf->pins[i].port == gpios[0] && + sc->conf->padconf->pins[i].pin == gpios[1]) { + *pin = i; + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jun 18 23:31:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 378E4337DE8; Thu, 18 Jun 2020 23:31:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nyrY0mwSz4FHn; Thu, 18 Jun 2020 23:31:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15D7411EBB; Thu, 18 Jun 2020 23:31:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05INVuJt057569; Thu, 18 Jun 2020 23:31:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05INVuhN057568; Thu, 18 Jun 2020 23:31:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006182331.05INVuhN057568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 18 Jun 2020 23:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362352 - stable/12/sys/dev/cpufreq X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/cpufreq X-SVN-Commit-Revision: 362352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:31:57 -0000 Author: manu Date: Thu Jun 18 23:31:56 2020 New Revision: 362352 URL: https://svnweb.freebsd.org/changeset/base/362352 Log: MFC r358555, r358799-r358800 r358555: cpufreq_dt: Improve multiple opp support When looking for cpu with the same OPP starts from the root /cpus node so each instance of cpufreq_dt will now each cpu with the same operating point. Also test that the node we are testing have the property "device_type" set to be equal to "cpu". While here add more debug printfs (off by defaults). r358799: cpufreq_dt: Fix r358555 Before skipping the current cpu when trying to find the ones that have the same opp, record that this one have this opp. Reported by: mmel X-MFC-With: r358555 r358800: cpufreq: Unbreak build. Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c ============================================================================== --- stable/12/sys/dev/cpufreq/cpufreq_dt.c Thu Jun 18 23:23:21 2020 (r362351) +++ stable/12/sys/dev/cpufreq/cpufreq_dt.c Thu Jun 18 23:31:56 2020 (r362352) @@ -82,6 +82,7 @@ struct cpufreq_dt_softc { struct cpufreq_dt_opp *opp; ssize_t nopp; + int cpu; cpuset_t cpus; }; @@ -170,6 +171,13 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * sc = device_get_softc(dev); + DEBUG(dev, "Working on cpu %d\n", sc->cpu); + DEBUG(dev, "We have %d cpu on this dev\n", CPU_COUNT(&sc->cpus)); + if (!CPU_ISSET(sc->cpu, &sc->cpus)) { + DEBUG(dev, "Not for this CPU\n"); + return (0); + } + if (clk_get_freq(sc->clk, &freq) != 0) { device_printf(dev, "Can't get current clk freq\n"); return (ENXIO); @@ -191,7 +199,6 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * return (ENOENT); } uvolt = copp->uvolt_target; - } opp = cpufreq_dt_find_opp(sc->dev, set->freq * 1000000); @@ -450,14 +457,16 @@ cpufreq_dt_attach(device_t dev) int cpu; uint64_t freq; int rv = 0; + char device_type[16]; enum opp_version version; sc = device_get_softc(dev); sc->dev = dev; node = ofw_bus_get_node(device_get_parent(dev)); - cpu = device_get_unit(device_get_parent(dev)); + sc->cpu = device_get_unit(device_get_parent(dev)); - if (cpu >= mp_ncpus) { + DEBUG(dev, "cpu=%d\n", sc->cpu); + if (sc->cpu >= mp_ncpus) { device_printf(dev, "Not attaching as cpu is not present\n"); return (ENXIO); } @@ -503,7 +512,19 @@ cpufreq_dt_attach(device_t dev) * Find all CPUs that share the same opp table */ CPU_ZERO(&sc->cpus); - for (cnode = node; cnode > 0; cnode = OF_peer(cnode), cpu++) { + cnode = OF_parent(node); + for (cpu = 0, cnode = OF_child(cnode); cnode > 0; cnode = OF_peer(cnode)) { + if (OF_getprop(cnode, "device_type", device_type, sizeof(device_type)) <= 0) + continue; + if (strcmp(device_type, "cpu") != 0) + continue; + if (cpu == sc->cpu) { + DEBUG(dev, "Skipping our cpu\n"); + CPU_SET(cpu, &sc->cpus); + cpu++; + continue; + } + DEBUG(dev, "Testing CPU %d\n", cpu); copp = -1; if (version == OPP_V1) OF_getencprop(cnode, "operating-points", &copp, @@ -511,8 +532,11 @@ cpufreq_dt_attach(device_t dev) else if (version == OPP_V2) OF_getencprop(cnode, "operating-points-v2", &copp, sizeof(copp)); - if (opp == copp) + if (opp == copp) { + DEBUG(dev, "CPU %d is using the same opp as this one (%d)\n", cpu, sc->cpu); CPU_SET(cpu, &sc->cpus); + } + cpu++; } if (clk_get_freq(sc->clk, &freq) == 0) From owner-svn-src-all@freebsd.org Thu Jun 18 23:57:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F44F338D93; Thu, 18 Jun 2020 23:57:12 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nzPh0pfNz4H27; Thu, 18 Jun 2020 23:57:12 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1269211EFC; Thu, 18 Jun 2020 23:57:12 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05INvBYq072095; Thu, 18 Jun 2020 23:57:11 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05INvBHH072091; Thu, 18 Jun 2020 23:57:11 GMT (envelope-from karels@FreeBSD.org) Message-Id: <202006182357.05INvBHH072091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Thu, 18 Jun 2020 23:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362353 - in head/sys: arm64/broadcom/genet dev/mii X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: in head/sys: arm64/broadcom/genet dev/mii X-SVN-Commit-Revision: 362353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:57:12 -0000 Author: karels Date: Thu Jun 18 23:57:10 2020 New Revision: 362353 URL: https://svnweb.freebsd.org/changeset/base/362353 Log: Add support for bcm54213PE in brgphy. This chip is used in the Rasperry Pi 4, and is supported by the if_genet driver. Currently we use the ukphy mii driver, this patch switches over to the brgphy mii driver instead. To support the rgmii-rxid phy mode, which is now the default in the Linux dtb, we add support for clock skewing. These changes are taken from OpenBSD and NetBSD, except for the bailout in brgphy_bcm54xx_clock_delay() in rgmii mode, which was found necessary after testing. Submitted by: Robert Crowston, crowston at protomail.com Differential Revision: https://reviews.freebsd.org/D25251 Modified: head/sys/arm64/broadcom/genet/if_genet.c head/sys/dev/mii/brgphy.c head/sys/dev/mii/brgphyreg.h head/sys/dev/mii/miidevs head/sys/dev/mii/miivar.h Modified: head/sys/arm64/broadcom/genet/if_genet.c ============================================================================== --- head/sys/arm64/broadcom/genet/if_genet.c Thu Jun 18 23:31:56 2020 (r362352) +++ head/sys/arm64/broadcom/genet/if_genet.c Thu Jun 18 23:57:10 2020 (r362353) @@ -237,7 +237,7 @@ gen_attach(device_t dev) { struct ether_addr eaddr; struct gen_softc *sc; - int major, minor, error; + int major, minor, error, mii_flags; bool eaddr_found; sc = device_get_softc(dev); @@ -315,9 +315,24 @@ gen_attach(device_t dev) if_setcapenable(sc->ifp, if_getcapabilities(sc->ifp)); /* Attach MII driver */ + mii_flags = 0; + switch (sc->phy_mode) + { + case MII_CONTYPE_RGMII_ID: + mii_flags |= MIIF_RX_DELAY | MIIF_TX_DELAY; + break; + case MII_CONTYPE_RGMII_RXID: + mii_flags |= MIIF_RX_DELAY; + break; + case MII_CONTYPE_RGMII_TXID: + mii_flags |= MIIF_TX_DELAY; + break; + default: + break; + } error = mii_attach(dev, &sc->miibus, sc->ifp, gen_media_change, gen_media_status, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, - MIIF_DOPAUSE); + mii_flags); if (error != 0) { device_printf(dev, "cannot attach PHY\n"); goto fail; @@ -371,6 +386,7 @@ gen_get_phy_mode(device_t dev) switch (type) { case MII_CONTYPE_RGMII: + case MII_CONTYPE_RGMII_ID: case MII_CONTYPE_RGMII_RXID: case MII_CONTYPE_RGMII_TXID: sc->phy_mode = type; @@ -791,10 +807,17 @@ gen_init_locked(struct gen_softc *sc) if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) return; - if (sc->phy_mode == MII_CONTYPE_RGMII || - sc->phy_mode == MII_CONTYPE_RGMII_RXID) - WR4(sc, GENET_SYS_PORT_CTRL, - GENET_SYS_PORT_MODE_EXT_GPHY); + switch (sc->phy_mode) + { + case MII_CONTYPE_RGMII: + case MII_CONTYPE_RGMII_ID: + case MII_CONTYPE_RGMII_RXID: + case MII_CONTYPE_RGMII_TXID: + WR4(sc, GENET_SYS_PORT_CTRL, GENET_SYS_PORT_MODE_EXT_GPHY); + break; + default: + WR4(sc, GENET_SYS_PORT_CTRL, 0); + } gen_set_enaddr(sc); @@ -1649,6 +1672,8 @@ gen_update_link_locked(struct gen_softc *sc) val |= GENET_EXT_RGMII_OOB_RGMII_MODE_EN; if (sc->phy_mode == MII_CONTYPE_RGMII) val |= GENET_EXT_RGMII_OOB_ID_MODE_DISABLE; + else + val &= ~GENET_EXT_RGMII_OOB_ID_MODE_DISABLE; WR4(sc, GENET_EXT_RGMII_OOB_CTRL, val); val = RD4(sc, GENET_UMAC_CMD); Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Thu Jun 18 23:31:56 2020 (r362352) +++ head/sys/dev/mii/brgphy.c Thu Jun 18 23:57:10 2020 (r362353) @@ -115,6 +115,7 @@ static void brgphy_fixup_ber_bug(struct mii_softc *); static void brgphy_fixup_crc_bug(struct mii_softc *); static void brgphy_fixup_jitter_bug(struct mii_softc *); static void brgphy_ethernet_wirespeed(struct mii_softc *); +static void brgphy_bcm54xx_clock_delay(struct mii_softc *); static void brgphy_jumbo_settings(struct mii_softc *, u_long); static const struct mii_phydesc brgphys[] = { @@ -158,6 +159,7 @@ static const struct mii_phydesc brgphys[] = { MII_PHY_DESC(BROADCOM3, BCM5720C), MII_PHY_DESC(BROADCOM3, BCM57765), MII_PHY_DESC(BROADCOM3, BCM57780), + MII_PHY_DESC(BROADCOM4, BCM54213PE), MII_PHY_DESC(BROADCOM4, BCM5725C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906), MII_PHY_END @@ -414,6 +416,12 @@ brgphy_service(struct mii_softc *sc, struct mii_data * break; } break; + case MII_OUI_BROADCOM4: + switch (sc->mii_mpd_model) { + case MII_MODEL_BROADCOM4_BCM54213PE: + brgphy_bcm54xx_clock_delay(sc); + break; + } } } mii_phy_update(sc, cmd); @@ -861,6 +869,37 @@ brgphy_ethernet_wirespeed(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7007); val = PHY_READ(sc, BRGPHY_MII_AUXCTL); PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4)); +} + +static void +brgphy_bcm54xx_clock_delay(struct mii_softc *sc) +{ + uint16_t val; + + if (!(sc->mii_flags & (MIIF_RX_DELAY | MIIF_TX_DELAY))) + /* Adjusting the clocks in rgmii mode causes packet losses. */ + return; + + PHY_WRITE(sc, BRGPHY_MII_AUXCTL, BRGPHY_AUXCTL_SHADOW_MISC | + BRGPHY_AUXCTL_SHADOW_MISC << BRGPHY_AUXCTL_MISC_READ_SHIFT); + val = PHY_READ(sc, BRGPHY_MII_AUXCTL); + val &= BRGPHY_AUXCTL_MISC_DATA_MASK; + if (sc->mii_flags & MIIF_RX_DELAY) + val |= BRGPHY_AUXCTL_MISC_RGMII_SKEW_EN; + else + val &= ~BRGPHY_AUXCTL_MISC_RGMII_SKEW_EN; + PHY_WRITE(sc, BRGPHY_MII_AUXCTL, BRGPHY_AUXCTL_MISC_WRITE_EN | + BRGPHY_AUXCTL_SHADOW_MISC | val); + + PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, BRGPHY_SHADOW_1C_CLK_CTRL); + val = PHY_READ(sc, BRGPHY_MII_SHADOW_1C); + val &= BRGPHY_SHADOW_1C_DATA_MASK; + if (sc->mii_flags & MIIF_TX_DELAY) + val |= BRGPHY_SHADOW_1C_GTXCLK_EN; + else + val &= ~BRGPHY_SHADOW_1C_GTXCLK_EN; + PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, BRGPHY_SHADOW_1C_WRITE_EN | + BRGPHY_SHADOW_1C_CLK_CTRL | val); } static void Modified: head/sys/dev/mii/brgphyreg.h ============================================================================== --- head/sys/dev/mii/brgphyreg.h Thu Jun 18 23:31:56 2020 (r362352) +++ head/sys/dev/mii/brgphyreg.h Thu Jun 18 23:57:10 2020 (r362353) @@ -293,6 +293,17 @@ /* Begin: PHY register values for the 5706 PHY */ /*******************************************************/ +/* + * Aux control shadow register, bits 0-2 select function (0x00 to + * 0x07). + */ +#define BRGPHY_AUXCTL_SHADOW_MISC 0x07 +#define BRGPHY_AUXCTL_MISC_DATA_MASK 0x7ff8 +#define BRGPHY_AUXCTL_MISC_READ_SHIFT 12 +#define BRGPHY_AUXCTL_MISC_WRITE_EN 0x8000 +#define BRGPHY_AUXCTL_MISC_RGMII_SKEW_EN 0x0200 +#define BRGPHY_AUXCTL_MISC_WIRESPEED_EN 0x0010 + /* * Shadow register 0x1C, bit 15 is write enable, * bits 14-10 select function (0x00 to 0x1F). @@ -300,6 +311,11 @@ #define BRGPHY_MII_SHADOW_1C 0x1C #define BRGPHY_SHADOW_1C_WRITE_EN 0x8000 #define BRGPHY_SHADOW_1C_SELECT_MASK 0x7C00 +#define BRGPHY_SHADOW_1C_DATA_MASK 0x03FF + +/* Shadow 0x1C Clock Alignment Control Register (select value 0x03) */ +#define BRGPHY_SHADOW_1C_CLK_CTRL (0x03 << 10) +#define BRGPHY_SHADOW_1C_GTXCLK_EN 0x0200 /* Shadow 0x1C Mode Control Register (select value 0x1F) */ #define BRGPHY_SHADOW_1C_MODE_CTRL (0x1F << 10) Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Thu Jun 18 23:31:56 2020 (r362352) +++ head/sys/dev/mii/miidevs Thu Jun 18 23:57:10 2020 (r362353) @@ -196,6 +196,7 @@ model BROADCOM3 BCM5717C 0x0020 BCM5717C 1000BASE-T me model BROADCOM3 BCM5719C 0x0022 BCM5719C 1000BASE-T media interface model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface +model BROADCOM4 BCM54213PE 0x000a BCM54213PE 1000BASE-T media interface model BROADCOM4 BCM5725C 0x0038 BCM5725C 1000BASE-T media interface model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface Modified: head/sys/dev/mii/miivar.h ============================================================================== --- head/sys/dev/mii/miivar.h Thu Jun 18 23:31:56 2020 (r362352) +++ head/sys/dev/mii/miivar.h Thu Jun 18 23:57:10 2020 (r362353) @@ -134,6 +134,8 @@ typedef struct mii_softc mii_softc_t; #define MIIF_DOPAUSE 0x00000100 /* advertise PAUSE capability */ #define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ #define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ +#define MIIF_RX_DELAY 0x00000800 /* add RX delay */ +#define MIIF_TX_DELAY 0x00001000 /* add TX delay */ #define MIIF_NOMANPAUSE 0x00100000 /* no manual PAUSE selection */ #define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisement */ #define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ From owner-svn-src-all@freebsd.org Fri Jun 19 00:43:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D655433A000; Fri, 19 Jun 2020 00:43:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p0RN5JlWz4K8H; Fri, 19 Jun 2020 00:43:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B171312D03; Fri, 19 Jun 2020 00:43:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J0hifl002657; Fri, 19 Jun 2020 00:43:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J0hiIh002656; Fri, 19 Jun 2020 00:43:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006190043.05J0hiIh002656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Jun 2020 00:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362355 - stable/12/sys/dev/ahci X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/ahci X-SVN-Commit-Revision: 362355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 00:43:44 -0000 Author: mav Date: Fri Jun 19 00:43:44 2020 New Revision: 362355 URL: https://svnweb.freebsd.org/changeset/base/362355 Log: MFC r361816: Limit AHCI to only one MSI if more is not needed. My AMD Ryzen system has 4 AHCI controllers, each supporting 16 MSI vectors. Since two of the controllers have only one SATA port, limit to single MSI saves system 30 interrupt vectors for free. It may be possible to also limit number of MSI vectors to 4 and 8 for the other two controllers, but according to the AHCI specification after that controllers may revert to only one vector, that would be a bigger loss to risk. Modified: stable/12/sys/dev/ahci/ahci_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/12/sys/dev/ahci/ahci_pci.c Fri Jun 19 00:26:30 2020 (r362354) +++ stable/12/sys/dev/ahci/ahci_pci.c Fri Jun 19 00:43:44 2020 (r362355) @@ -470,6 +470,7 @@ ahci_pci_attach(device_t dev) uint8_t revid = pci_get_revid(dev); int msi_count, msix_count; uint8_t table_bar = 0, pba_bar = 0; + uint32_t caps, pi; msi_count = pci_msi_count(dev); msix_count = pci_msix_count(dev); @@ -604,9 +605,12 @@ ahci_pci_attach(device_t dev) /* Setup MSI register parameters */ /* Process hints. */ + caps = ATA_INL(ctlr->r_mem, AHCI_CAP); + pi = ATA_INL(ctlr->r_mem, AHCI_PI); if (ctlr->quirks & AHCI_Q_NOMSI) ctlr->msi = 0; - else if (ctlr->quirks & AHCI_Q_1MSI) + else if ((ctlr->quirks & AHCI_Q_1MSI) || + ((caps & (AHCI_CAP_NPMASK | AHCI_CAP_CCCS)) == 0 && pi == 1)) ctlr->msi = 1; else ctlr->msi = 2; From owner-svn-src-all@freebsd.org Fri Jun 19 00:44:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 769E4339E36; Fri, 19 Jun 2020 00:44:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p0SN2WYyz4K6l; Fri, 19 Jun 2020 00:44:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51C25128C0; Fri, 19 Jun 2020 00:44:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J0ianV002779; Fri, 19 Jun 2020 00:44:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J0iZir002777; Fri, 19 Jun 2020 00:44:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006190044.05J0iZir002777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Jun 2020 00:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362356 - stable/12/sys/dev/sound/pci/hda X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 362356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 00:44:36 -0000 Author: mav Date: Fri Jun 19 00:44:35 2020 New Revision: 362356 URL: https://svnweb.freebsd.org/changeset/base/362356 Log: MFC r361835: Add bunch of HDA controller and codec IDs. Modified: stable/12/sys/dev/sound/pci/hda/hdac.c stable/12/sys/dev/sound/pci/hda/hdac.h stable/12/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdac.c Fri Jun 19 00:43:44 2020 (r362355) +++ stable/12/sys/dev/sound/pci/hda/hdac.c Fri Jun 19 00:44:35 2020 (r362356) @@ -80,15 +80,19 @@ static const struct { char quirks_off; } hdac_devices[] = { { HDA_INTEL_OAK, "Intel Oaktrail", 0, 0 }, + { HDA_INTEL_CMLKLP, "Intel Comet Lake-LP", 0, 0 }, + { HDA_INTEL_CMLKH, "Intel Comet Lake-H", 0, 0 }, { HDA_INTEL_BAY, "Intel BayTrail", 0, 0 }, { HDA_INTEL_HSW1, "Intel Haswell", 0, 0 }, { HDA_INTEL_HSW2, "Intel Haswell", 0, 0 }, { HDA_INTEL_HSW3, "Intel Haswell", 0, 0 }, { HDA_INTEL_BDW1, "Intel Broadwell", 0, 0 }, { HDA_INTEL_BDW2, "Intel Broadwell", 0, 0 }, + { HDA_INTEL_BXTNT, "Intel Broxton-T", 0, 0 }, { HDA_INTEL_CPT, "Intel Cougar Point", 0, 0 }, { HDA_INTEL_PATSBURG,"Intel Patsburg", 0, 0 }, { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, + { HDA_INTEL_BR, "Intel Braswell", 0, 0 }, { HDA_INTEL_LPT1, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_LPT2, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_WCPT, "Intel Wildcat Point", 0, 0 }, @@ -102,16 +106,21 @@ static const struct { { HDA_INTEL_KBLK, "Intel Kaby Lake", 0, 0 }, { HDA_INTEL_KBLKH, "Intel Kaby Lake-H", 0, 0 }, { HDA_INTEL_CFLK, "Intel Coffee Lake", 0, 0 }, + { HDA_INTEL_CMLKS, "Intel Comet Lake-S", 0, 0 }, { HDA_INTEL_CNLK, "Intel Cannon Lake", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, { HDA_INTEL_82801H, "Intel 82801H", 0, 0 }, { HDA_INTEL_82801I, "Intel 82801I", 0, 0 }, + { HDA_INTEL_JLK, "Intel Jasper Lake", 0, 0 }, { HDA_INTEL_82801JI, "Intel 82801JI", 0, 0 }, { HDA_INTEL_82801JD, "Intel 82801JD", 0, 0 }, { HDA_INTEL_PCH, "Intel Ibex Peak", 0, 0 }, { HDA_INTEL_PCH2, "Intel Ibex Peak", 0, 0 }, + { HDA_INTEL_ELLK, "Intel Elkhart Lake", 0, 0 }, + { HDA_INTEL_JLK2, "Intel Jasper Lake", 0, 0 }, + { HDA_INTEL_BXTNP, "Intel Broxton-P", 0, 0 }, { HDA_INTEL_SCH, "Intel SCH", 0, 0 }, { HDA_NVIDIA_MCP51, "NVIDIA MCP51", 0, HDAC_QUIRK_MSI }, { HDA_NVIDIA_MCP55, "NVIDIA MCP55", 0, HDAC_QUIRK_MSI }, @@ -169,6 +178,10 @@ static const struct { { HDA_ATI_RV940, "ATI RV940", 0, 0 }, { HDA_ATI_RV970, "ATI RV970", 0, 0 }, { HDA_ATI_R1000, "ATI R1000", 0, 0 }, + { HDA_AMD_X370, "AMD X370", 0, 0 }, + { HDA_AMD_X570, "AMD X570", 0, 0 }, + { HDA_AMD_STONEY, "AMD Stoney", 0, 0 }, + { HDA_AMD_RAVEN, "AMD Raven", 0, 0 }, { HDA_AMD_HUDSON2, "AMD Hudson-2", 0, 0 }, { HDA_RDC_M3010, "RDC M3010", 0, 0 }, { HDA_VIA_VT82XX, "VIA VT8251/8237A",0, 0 }, Modified: stable/12/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdac.h Fri Jun 19 00:43:44 2020 (r362355) +++ stable/12/sys/dev/sound/pci/hda/hdac.h Fri Jun 19 00:44:35 2020 (r362356) @@ -43,24 +43,32 @@ /* Intel */ #define INTEL_VENDORID 0x8086 +#define HDA_INTEL_CMLKLP HDA_MODEL_CONSTRUCT(INTEL, 0x02c8) +#define HDA_INTEL_CMLKH HDA_MODEL_CONSTRUCT(INTEL, 0x06c8) #define HDA_INTEL_OAK HDA_MODEL_CONSTRUCT(INTEL, 0x080a) #define HDA_INTEL_BAY HDA_MODEL_CONSTRUCT(INTEL, 0x0f04) #define HDA_INTEL_HSW1 HDA_MODEL_CONSTRUCT(INTEL, 0x0a0c) #define HDA_INTEL_HSW2 HDA_MODEL_CONSTRUCT(INTEL, 0x0c0c) #define HDA_INTEL_HSW3 HDA_MODEL_CONSTRUCT(INTEL, 0x0d0c) #define HDA_INTEL_BDW1 HDA_MODEL_CONSTRUCT(INTEL, 0x160c) +#define HDA_INTEL_BXTNT HDA_MODEL_CONSTRUCT(INTEL, 0x1a98) #define HDA_INTEL_CPT HDA_MODEL_CONSTRUCT(INTEL, 0x1c20) #define HDA_INTEL_PATSBURG HDA_MODEL_CONSTRUCT(INTEL, 0x1d20) #define HDA_INTEL_PPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x1e20) +#define HDA_INTEL_BR HDA_MODEL_CONSTRUCT(INTEL, 0x2284) #define HDA_INTEL_82801F HDA_MODEL_CONSTRUCT(INTEL, 0x2668) #define HDA_INTEL_63XXESB HDA_MODEL_CONSTRUCT(INTEL, 0x269a) #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) #define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b) #define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e) +#define HDA_INTEL_JLK HDA_MODEL_CONSTRUCT(INTEL, 0x38c8) #define HDA_INTEL_82801JI HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) #define HDA_INTEL_82801JD HDA_MODEL_CONSTRUCT(INTEL, 0x3a6e) #define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_PCH2 HDA_MODEL_CONSTRUCT(INTEL, 0x3b57) +#define HDA_INTEL_ELLK HDA_MODEL_CONSTRUCT(INTEL, 0x4b55) +#define HDA_INTEL_JLK2 HDA_MODEL_CONSTRUCT(INTEL, 0x4dc8) +#define HDA_INTEL_BXTNP HDA_MODEL_CONSTRUCT(INTEL, 0x5a98) #define HDA_INTEL_MACBOOKPRO92 HDA_MODEL_CONSTRUCT(INTEL, 0x7270) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) @@ -77,6 +85,7 @@ #define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171) #define HDA_INTEL_KBLKH HDA_MODEL_CONSTRUCT(INTEL, 0xa2f0) #define HDA_INTEL_CFLK HDA_MODEL_CONSTRUCT(INTEL, 0xa348) +#define HDA_INTEL_CMLKS HDA_MODEL_CONSTRUCT(INTEL, 0xa3f0) #define HDA_INTEL_CNLK HDA_MODEL_CONSTRUCT(INTEL, 0x9dc8) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) @@ -146,6 +155,10 @@ #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) #define AMD_VENDORID 0x1022 +#define HDA_AMD_X370 HDA_MODEL_CONSTRUCT(AMD, 0x1457) +#define HDA_AMD_X570 HDA_MODEL_CONSTRUCT(AMD, 0x1487) +#define HDA_AMD_STONEY HDA_MODEL_CONSTRUCT(AMD, 0x157a) +#define HDA_AMD_RAVEN HDA_MODEL_CONSTRUCT(AMD, 0x15e3) #define HDA_AMD_HUDSON2 HDA_MODEL_CONSTRUCT(AMD, 0x780d) #define HDA_AMD_ALL HDA_MODEL_CONSTRUCT(AMD, 0xffff) @@ -353,12 +366,16 @@ /* Realtek */ #define REALTEK_VENDORID 0x10ec +#define HDA_CODEC_ALC215 HDA_CODEC_CONSTRUCT(REALTEK, 0x0215) #define HDA_CODEC_ALC221 HDA_CODEC_CONSTRUCT(REALTEK, 0x0221) +#define HDA_CODEC_ALC222 HDA_CODEC_CONSTRUCT(REALTEK, 0x0222) #define HDA_CODEC_ALC225 HDA_CODEC_CONSTRUCT(REALTEK, 0x0225) #define HDA_CODEC_ALC231 HDA_CODEC_CONSTRUCT(REALTEK, 0x0231) #define HDA_CODEC_ALC233 HDA_CODEC_CONSTRUCT(REALTEK, 0x0233) #define HDA_CODEC_ALC234 HDA_CODEC_CONSTRUCT(REALTEK, 0x0234) #define HDA_CODEC_ALC235 HDA_CODEC_CONSTRUCT(REALTEK, 0x0235) +#define HDA_CODEC_ALC236 HDA_CODEC_CONSTRUCT(REALTEK, 0x0236) +#define HDA_CODEC_ALC245 HDA_CODEC_CONSTRUCT(REALTEK, 0x0245) #define HDA_CODEC_ALC255 HDA_CODEC_CONSTRUCT(REALTEK, 0x0255) #define HDA_CODEC_ALC256 HDA_CODEC_CONSTRUCT(REALTEK, 0x0256) #define HDA_CODEC_ALC257 HDA_CODEC_CONSTRUCT(REALTEK, 0x0257) @@ -380,6 +397,7 @@ #define HDA_CODEC_ALC285 HDA_CODEC_CONSTRUCT(REALTEK, 0x0285) #define HDA_CODEC_ALC286 HDA_CODEC_CONSTRUCT(REALTEK, 0x0286) #define HDA_CODEC_ALC288 HDA_CODEC_CONSTRUCT(REALTEK, 0x0288) +#define HDA_CODEC_ALC289 HDA_CODEC_CONSTRUCT(REALTEK, 0x0289) #define HDA_CODEC_ALC290 HDA_CODEC_CONSTRUCT(REALTEK, 0x0290) #define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) #define HDA_CODEC_ALC293 HDA_CODEC_CONSTRUCT(REALTEK, 0x0293) @@ -389,6 +407,8 @@ #define HDA_CODEC_ALC299 HDA_CODEC_CONSTRUCT(REALTEK, 0x0299) #define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) #define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295) +#define HDA_CODEC_ALC300 HDA_CODEC_CONSTRUCT(REALTEK, 0x0300) +#define HDA_CODEC_ALC623 HDA_CODEC_CONSTRUCT(REALTEK, 0x0623) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) #define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662) #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) @@ -411,6 +431,8 @@ #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) #define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) +#define HDA_CODEC_ALCS1200A HDA_CODEC_CONSTRUCT(REALTEK, 0x0b00) +#define HDA_CODEC_ALC1220_1 HDA_CODEC_CONSTRUCT(REALTEK, 0x1168) #define HDA_CODEC_ALC1220 HDA_CODEC_CONSTRUCT(REALTEK, 0x1220) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) @@ -697,6 +719,11 @@ #define HDA_CODEC_INTELBDW HDA_CODEC_CONSTRUCT(INTEL, 0x2808) #define HDA_CODEC_INTELSKLK HDA_CODEC_CONSTRUCT(INTEL, 0x2809) #define HDA_CODEC_INTELKBLK HDA_CODEC_CONSTRUCT(INTEL, 0x280b) +#define HDA_CODEC_INTELJLK HDA_CODEC_CONSTRUCT(INTEL, 0x281a) +#define HDA_CODEC_INTELELLK HDA_CODEC_CONSTRUCT(INTEL, 0x281b) +#define HDA_CODEC_INTELCT HDA_CODEC_CONSTRUCT(INTEL, 0x2880) +#define HDA_CODEC_INTELVV2 HDA_CODEC_CONSTRUCT(INTEL, 0x2882) +#define HDA_CODEC_INTELBR HDA_CODEC_CONSTRUCT(INTEL, 0x2883) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: stable/12/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdacc.c Fri Jun 19 00:43:44 2020 (r362355) +++ stable/12/sys/dev/sound/pci/hda/hdacc.c Fri Jun 19 00:44:35 2020 (r362356) @@ -78,12 +78,16 @@ static const struct { { HDA_CODEC_CS4206, 0, "Cirrus Logic CS4206" }, { HDA_CODEC_CS4207, 0, "Cirrus Logic CS4207" }, { HDA_CODEC_CS4210, 0, "Cirrus Logic CS4210" }, + { HDA_CODEC_ALC215, 0, "Realtek ALC215" }, { HDA_CODEC_ALC221, 0, "Realtek ALC221" }, + { HDA_CODEC_ALC222, 0, "Realtek ALC222" }, { HDA_CODEC_ALC225, 0, "Realtek ALC225" }, { HDA_CODEC_ALC231, 0, "Realtek ALC231" }, { HDA_CODEC_ALC233, 0, "Realtek ALC233" }, { HDA_CODEC_ALC234, 0, "Realtek ALC234" }, { HDA_CODEC_ALC235, 0, "Realtek ALC235" }, + { HDA_CODEC_ALC236, 0, "Realtek ALC236" }, + { HDA_CODEC_ALC245, 0, "Realtek ALC245" }, { HDA_CODEC_ALC255, 0, "Realtek ALC255" }, { HDA_CODEC_ALC256, 0, "Realtek ALC256" }, { HDA_CODEC_ALC257, 0, "Realtek ALC257" }, @@ -107,6 +111,7 @@ static const struct { { HDA_CODEC_ALC285, 0, "Realtek ALC285" }, { HDA_CODEC_ALC286, 0, "Realtek ALC286" }, { HDA_CODEC_ALC288, 0, "Realtek ALC288" }, + { HDA_CODEC_ALC289, 0, "Realtek ALC289" }, { HDA_CODEC_ALC290, 0, "Realtek ALC290" }, { HDA_CODEC_ALC292, 0, "Realtek ALC292" }, { HDA_CODEC_ALC293, 0, "Realtek ALC293" }, @@ -114,8 +119,12 @@ static const struct { { HDA_CODEC_ALC295, 0, "Realtek ALC295" }, { HDA_CODEC_ALC298, 0, "Realtek ALC298" }, { HDA_CODEC_ALC299, 0, "Realtek ALC299" }, + { HDA_CODEC_ALC300, 0, "Realtek ALC300" }, + { HDA_CODEC_ALC623, 0, "Realtek ALC623" }, { HDA_CODEC_ALC660, 0, "Realtek ALC660-VD" }, { HDA_CODEC_ALC662, 0x0002, "Realtek ALC662 rev2" }, + { HDA_CODEC_ALC662, 0x0101, "Realtek ALC662 rev1" }, + { HDA_CODEC_ALC662, 0x0300, "Realtek ALC662 rev3" }, { HDA_CODEC_ALC662, 0, "Realtek ALC662" }, { HDA_CODEC_ALC663, 0, "Realtek ALC663" }, { HDA_CODEC_ALC665, 0, "Realtek ALC665" }, @@ -141,6 +150,8 @@ static const struct { { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, + { HDA_CODEC_ALCS1200A, 0, "Realtek ALCS1200A" }, + { HDA_CODEC_ALC1220_1, 0, "Realtek ALC1220" }, { HDA_CODEC_ALC1220, 0, "Realtek ALC1220" }, { HDA_CODEC_AD1882, 0, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, 0, "Analog Devices AD1882A" }, @@ -370,6 +381,11 @@ static const struct { { HDA_CODEC_INTELBDW, 0, "Intel Broadwell" }, { HDA_CODEC_INTELSKLK, 0, "Intel Skylake" }, { HDA_CODEC_INTELKBLK, 0, "Intel Kaby Lake" }, + { HDA_CODEC_INTELJLK, 0, "Intel Jasper Lake" }, + { HDA_CODEC_INTELELLK, 0, "Intel Elkhart Lake" }, + { HDA_CODEC_INTELCT, 0, "Intel CedarTrail" }, + { HDA_CODEC_INTELVV2, 0, "Intel Valleyview2" }, + { HDA_CODEC_INTELBR, 0, "Intel Braswell" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, From owner-svn-src-all@freebsd.org Fri Jun 19 00:45:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA246339E50; Fri, 19 Jun 2020 00:45:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p0TP4VTFz4KG9; Fri, 19 Jun 2020 00:45:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95885128C1; Fri, 19 Jun 2020 00:45:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J0jTUR002894; Fri, 19 Jun 2020 00:45:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J0jT38002893; Fri, 19 Jun 2020 00:45:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006190045.05J0jT38002893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Jun 2020 00:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362357 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 362357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 00:45:29 -0000 Author: mav Date: Fri Jun 19 00:45:29 2020 New Revision: 362357 URL: https://svnweb.freebsd.org/changeset/base/362357 Log: MFC r362100: Fix config_intrhook leak on initial reset failure. Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Fri Jun 19 00:44:35 2020 (r362356) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Fri Jun 19 00:45:29 2020 (r362357) @@ -1090,12 +1090,14 @@ nvme_ctrlr_start_config_hook(void *arg) status = nvme_ctrlr_hw_reset(ctrlr); if (status != 0) { nvme_ctrlr_fail(ctrlr); + config_intrhook_disestablish(&ctrlr->config_hook); return; } status = nvme_ctrlr_hw_reset(ctrlr); if (status != 0) { nvme_ctrlr_fail(ctrlr); + config_intrhook_disestablish(&ctrlr->config_hook); return; } From owner-svn-src-all@freebsd.org Fri Jun 19 01:02:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31FFF339E7A; Fri, 19 Jun 2020 01:02:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p0sX0pr8z4KjL; Fri, 19 Jun 2020 01:02:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0FF212AEF; Fri, 19 Jun 2020 01:02:55 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J12tBv015470; Fri, 19 Jun 2020 01:02:55 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J12rRt015459; Fri, 19 Jun 2020 01:02:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202006190102.05J12rRt015459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 19 Jun 2020 01:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362358 - in head: sbin/newfs stand/libsa sys/geom/journal sys/geom/label sys/ufs/ffs usr.sbin/fstyp usr.sbin/quot X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/newfs stand/libsa sys/geom/journal sys/geom/label sys/ufs/ffs usr.sbin/fstyp usr.sbin/quot X-SVN-Commit-Revision: 362358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 01:02:56 -0000 Author: mckusick Date: Fri Jun 19 01:02:53 2020 New Revision: 362358 URL: https://svnweb.freebsd.org/changeset/base/362358 Log: Move the pointers stored in the superblock into a separate fs_summary_info structure. This change was originally done by the CheriBSD project as they need larger pointers that do not fit in the existing superblock. This cleanup of the superblock eases the task of the commit that immediately follows this one. Suggested by: brooks Reviewed by: kib PR: 246983 Sponsored by: Netflix Modified: head/sbin/newfs/mkfs.c head/stand/libsa/ufs.c head/sys/geom/journal/g_journal_ufs.c head/sys/geom/label/g_label_ufs.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h head/usr.sbin/fstyp/ufs.c head/usr.sbin/quot/quot.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/sbin/newfs/mkfs.c Fri Jun 19 01:02:53 2020 (r362358) @@ -134,6 +134,10 @@ mkfs(struct partition *pp, char *fsys) utime = 1000000000; else time(&utime); + if ((sblock.fs_si = malloc(sizeof(struct fs_summary_info))) == NULL) { + printf("Superblock summary info allocation failed.\n"); + exit(18); + } sblock.fs_old_flags = FS_FLAGS_UPDATED; sblock.fs_flags = 0; if (Uflag) @@ -548,6 +552,10 @@ restart: } } } + /* + * Reference the summary information so it will also be written. + */ + sblock.fs_csp = fscs; if (!Nflag && sbput(disk.d_fd, &disk.d_fs, 0) != 0) err(1, "sbput: %s", disk.d_error); if (Xflag == 1) { @@ -611,10 +619,6 @@ restart: printf("** Exiting on Xflag 3\n"); exit(0); } - /* - * Reference the summary information so it will also be written. - */ - sblock.fs_csp = fscs; if (sbput(disk.d_fd, &disk.d_fs, 0) != 0) err(1, "sbput: %s", disk.d_error); /* Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/stand/libsa/ufs.c Fri Jun 19 01:02:53 2020 (r362358) @@ -678,7 +678,11 @@ out: if (rc) { if (fp->f_buf) free(fp->f_buf); - free(fp->f_fs); + if (fp->f_fs != NULL) { + free(fp->f_fs->fs_csp); + free(fp->f_fs->fs_si); + free(fp->f_fs); + } free(fp); } return (rc); @@ -723,7 +727,11 @@ ufs_close(f) } if (fp->f_buf) free(fp->f_buf); - free(fp->f_fs); + if (fp->f_fs != NULL) { + free(fp->f_fs->fs_csp); + free(fp->f_fs->fs_si); + free(fp->f_fs); + } free(fp); return (0); } Modified: head/sys/geom/journal/g_journal_ufs.c ============================================================================== --- head/sys/geom/journal/g_journal_ufs.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/sys/geom/journal/g_journal_ufs.c Fri Jun 19 01:02:53 2020 (r362358) @@ -68,6 +68,7 @@ g_journal_ufs_clean(struct mount *mp) static void g_journal_ufs_dirty(struct g_consumer *cp) { + struct fs_summary_info *fs_si; struct fs *fs; int error; @@ -83,8 +84,12 @@ g_journal_ufs_dirty(struct g_consumer *cp) GJ_DEBUG(0, "clean=%d flags=0x%x", fs->fs_clean, fs->fs_flags); fs->fs_clean = 0; fs->fs_flags |= FS_NEEDSFSCK | FS_UNCLEAN; + fs_si = fs->fs_si; + fs->fs_si = NULL; error = ffs_sbput(cp, fs, fs->fs_sblockloc, g_use_g_write_data); + fs->fs_si = fs_si; g_free(fs->fs_csp); + g_free(fs->fs_si); g_free(fs); if (error != 0) { GJ_DEBUG(0, "Cannot mark file system %s as dirty " Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/sys/geom/label/g_label_ufs.c Fri Jun 19 01:02:53 2020 (r362358) @@ -122,6 +122,7 @@ g_label_ufs_taste_common(struct g_consumer *cp, char * } out: g_free(fs->fs_csp); + g_free(fs->fs_si); g_free(fs); } Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Jun 19 01:02:53 2020 (r362358) @@ -480,6 +480,8 @@ restart: */ copy_fs = malloc((u_long)fs->fs_bsize, M_UFSMNT, M_WAITOK); bcopy(fs, copy_fs, fs->fs_sbsize); + copy_fs->fs_si = malloc(sizeof(struct fs_summary_info), M_UFSMNT, + M_ZERO | M_WAITOK); if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) == 0) copy_fs->fs_clean = 1; size = fs->fs_bsize < SBLOCKSIZE ? fs->fs_bsize : SBLOCKSIZE; @@ -501,6 +503,7 @@ restart: len, KERNCRED, &bp)) != 0) { brelse(bp); free(copy_fs->fs_csp, M_UFSMNT); + free(copy_fs->fs_si, M_UFSMNT); free(copy_fs, M_UFSMNT); copy_fs = NULL; goto out1; @@ -611,6 +614,7 @@ loop: vdrop(xvp); if (error) { free(copy_fs->fs_csp, M_UFSMNT); + free(copy_fs->fs_si, M_UFSMNT); free(copy_fs, M_UFSMNT); copy_fs = NULL; MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); @@ -624,6 +628,7 @@ loop: error = softdep_journal_lookup(mp, &xvp); if (error) { free(copy_fs->fs_csp, M_UFSMNT); + free(copy_fs->fs_si, M_UFSMNT); free(copy_fs, M_UFSMNT); copy_fs = NULL; goto out1; @@ -842,6 +847,7 @@ out1: } done: free(copy_fs->fs_csp, M_UFSMNT); + free(copy_fs->fs_si, M_UFSMNT); free(copy_fs, M_UFSMNT); copy_fs = NULL; out: Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/sys/ufs/ffs/ffs_subr.c Fri Jun 19 01:02:53 2020 (r362358) @@ -158,6 +158,7 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc int (*readfunc)(void *devfd, off_t loc, void **bufp, int size)) { struct fs *fs; + struct fs_summary_info *fs_si; int i, error, size, blks; uint8_t *space; int32_t *lp; @@ -201,7 +202,14 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc size += fs->fs_ncg * sizeof(int32_t); size += fs->fs_ncg * sizeof(u_int8_t); /* When running in libufs or libsa, UFS_MALLOC may fail */ + if ((fs_si = UFS_MALLOC(sizeof(*fs_si), filltype, M_WAITOK)) == NULL) { + UFS_FREE(fs, filltype); + return (ENOSPC); + } + bzero(fs_si, sizeof(*fs_si)); + fs->fs_si = fs_si; if ((space = UFS_MALLOC(size, filltype, M_WAITOK)) == NULL) { + UFS_FREE(fs->fs_si, filltype); UFS_FREE(fs, filltype); return (ENOSPC); } @@ -217,6 +225,7 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc if (buf != NULL) UFS_FREE(buf, filltype); UFS_FREE(fs->fs_csp, filltype); + UFS_FREE(fs->fs_si, filltype); UFS_FREE(fs, filltype); return (error); } @@ -299,7 +308,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo /* Have to set for old filesystems that predate this field */ fs->fs_sblockactualloc = sblockloc; /* Not yet any summary information */ - fs->fs_csp = NULL; + fs->fs_si = NULL; return (0); } return (ENOENT); @@ -325,7 +334,7 @@ ffs_sbput(void *devfd, struct fs *fs, off_t loc, * If there is summary information, write it first, so if there * is an error, the superblock will not be marked as clean. */ - if (fs->fs_csp != NULL) { + if (fs->fs_si != NULL && fs->fs_csp != NULL) { blks = howmany(fs->fs_cssize, fs->fs_fsize); space = (uint8_t *)fs->fs_csp; for (i = 0; i < blks; i += fs->fs_frag) { Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Jun 19 01:02:53 2020 (r362358) @@ -885,14 +885,11 @@ ffs_reload(struct mount *mp, struct thread *td, int fl return (EIO); /* XXX needs translation */ } /* - * Copy pointer fields back into superblock before copying in XXX - * new superblock. These should really be in the ufsmount. XXX - * Note that important parameters (eg fs_ncg) are unchanged. + * Preserve the summary information, read-only status, and + * superblock location by copying these fields into our new + * superblock before using it to update the existing superblock. */ - newfs->fs_csp = fs->fs_csp; - newfs->fs_maxcluster = fs->fs_maxcluster; - newfs->fs_contigdirs = fs->fs_contigdirs; - newfs->fs_active = fs->fs_active; + newfs->fs_si = fs->fs_si; newfs->fs_ronly = fs->fs_ronly; sblockloc = fs->fs_sblockloc; bcopy(newfs, fs, (u_int)fs->fs_sbsize); @@ -1309,6 +1306,7 @@ ffs_mountfs(odevvp, mp, td) out: if (fs != NULL) { free(fs->fs_csp, M_UFSMNT); + free(fs->fs_si, M_UFSMNT); free(fs, M_UFSMNT); } if (cp != NULL) { @@ -1546,6 +1544,7 @@ ffs_unmount(mp, mntflags) mp->mnt_gjprovider = NULL; } free(fs->fs_csp, M_UFSMNT); + free(fs->fs_si, M_UFSMNT); free(fs, M_UFSMNT); if (ump->um_fsfail_task != NULL) free(ump->um_fsfail_task, M_UFSMNT); @@ -2294,10 +2293,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); fs = (struct fs *)bp->b_data; ffs_oldfscompat_write(fs, ump); - /* - * Because we may have made changes to the superblock, we need to - * recompute its check-hash. - */ + /* Recalculate the superblock hash */ fs->fs_ckhash = ffs_calc_sbhash(fs); if (devfdp->suspended) bp->b_flags |= B_VALIDSUSPWRT; Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Fri Jun 19 00:45:29 2020 (r362357) +++ head/sys/ufs/ffs/fs.h Fri Jun 19 01:02:53 2020 (r362358) @@ -132,16 +132,18 @@ * of pointers to blocks of struct csum; now there are just a few * pointers and the remaining space is padded with fs_ocsp[]. * - * NOCSPTRS determines the size of this padding. One pointer (fs_csp) - * is taken away to point to a contiguous array of struct csum for - * all cylinder groups; a second (fs_maxcluster) points to an array - * of cluster sizes that is computed as cylinder groups are inspected, - * and the third points to an array that tracks the creation of new - * directories. A fourth pointer, fs_active, is used when creating - * snapshots; it points to a bitmap of cylinder groups for which the - * free-block bitmap has changed since the snapshot operation began. + * NOCSPTRS determines the size of this padding. Historically this + * space was used to store pointers to structures that summaried + * filesystem usage and layout information. However, these pointers + * left various kernel pointers in the superblock which made otherwise + * identical superblocks appear to have differences. So, all the + * pointers in the superblock were moved to a fs_summary_info structure + * reducing the superblock to having only a single pointer to this + * structure. When writing the superblock to disk, this pointer is + * temporarily NULL'ed out so that the kernel pointer will not appear + * in the on-disk copy of the superblock. */ -#define NOCSPTRS ((128 / sizeof(void *)) - 4) +#define NOCSPTRS ((128 / sizeof(void *)) - 1) /* * A summary of contiguous blocks of various sizes is maintained @@ -270,6 +272,32 @@ struct csum_total { }; /* + * Pointers to super block summary information. Placed in a separate + * structure so there is just one pointer in the superblock. + * + * The pointers in this structure are used as follows: + * fs_contigdirs references an array that tracks the creation of new + * directories + * fs_csp references a contiguous array of struct csum for + * all cylinder groups + * fs_maxcluster references an array of cluster sizes that is computed + * as cylinder groups are inspected + * fs_active is used when creating snapshots; it points to a bitmap + * of cylinder groups for which the free-block bitmap has changed + * since the snapshot operation began. + */ +struct fs_summary_info { + uint8_t *si_contigdirs; /* (u) # of contig. allocated dirs */ + struct csum *si_csp; /* (u) cg summary info buffer */ + int32_t *si_maxcluster; /* (u) max cluster in each cyl group */ + u_int *si_active; /* (u) used by snapshots to track fs */ +}; +#define fs_contigdirs fs_si->si_contigdirs +#define fs_csp fs_si->si_csp +#define fs_maxcluster fs_si->si_maxcluster +#define fs_active fs_si->si_active + +/* * Super block for an FFS filesystem. */ struct fs { @@ -340,10 +368,7 @@ struct fs { /* these fields retain the current block allocation info */ int32_t fs_cgrotor; /* last cg searched */ void *fs_ocsp[NOCSPTRS]; /* padding; was list of fs_cs buffers */ - u_int8_t *fs_contigdirs; /* (u) # of contig. allocated dirs */ - struct csum *fs_csp; /* (u) cg summary info buffer */ - int32_t *fs_maxcluster; /* (u) max cluster in each cyl group */ - u_int *fs_active; /* (u) used by snapshots to track fs */ + struct fs_summary_info *fs_si;/* In-core pointer to summary info */ int32_t fs_old_cpc; /* cyl per cycle in postbl */ int32_t fs_maxbsize; /* maximum blocking factor permitted */ int64_t fs_unrefs; /* number of unreferenced inodes */ Modified: head/usr.sbin/fstyp/ufs.c ============================================================================== --- head/usr.sbin/fstyp/ufs.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/usr.sbin/fstyp/ufs.c Fri Jun 19 01:02:53 2020 (r362358) @@ -53,6 +53,9 @@ fstyp_ufs(FILE *fp, char *label, size_t labelsize) switch (sbget(fileno(fp), &fs, STDSB)) { case 0: strlcpy(label, fs->fs_volname, labelsize); + free(fs->fs_csp); + free(fs->fs_si); + free(fs); return (0); case ENOENT: /* Cannot find file system superblock */ Modified: head/usr.sbin/quot/quot.c ============================================================================== --- head/usr.sbin/quot/quot.c Fri Jun 19 00:45:29 2020 (r362357) +++ head/usr.sbin/quot/quot.c Fri Jun 19 01:02:53 2020 (r362358) @@ -567,6 +567,9 @@ quot(char *name, char *mp) printf(" (%s)",mp); putchar('\n'); (*func)(fd, fs, name); + free(fs->fs_csp); + free(fs->fs_si); + free(fs); close(fd); } From owner-svn-src-all@freebsd.org Fri Jun 19 01:04:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C2EC33A569; Fri, 19 Jun 2020 01:04:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p0vG1Lwlz4Krn; Fri, 19 Jun 2020 01:04:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1052612AF0; Fri, 19 Jun 2020 01:04:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J14PH9015604; Fri, 19 Jun 2020 01:04:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J14PPA015602; Fri, 19 Jun 2020 01:04:25 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202006190104.05J14PPA015602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 19 Jun 2020 01:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362359 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 362359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 01:04:26 -0000 Author: mckusick Date: Fri Jun 19 01:04:25 2020 New Revision: 362359 URL: https://svnweb.freebsd.org/changeset/base/362359 Log: The binary representation of the superblock (the fs structure) is written out verbatim to the disk: see ffs_sbput() in sys/ufs/ffs/ffs_subr.c. It contains a pointer to the fs_summary_info structure. This pointer value inadvertently causes garbage to be stored. It is garbage because the pointer to the fs_summary_info structure is the address the then current stack or heap. Although a mere pointer does not reveal anything useful (like a part of a private key) to an attacker, garbage output deteriorates reproducibility. This commit zeros out the pointer to the fs_summary_info structure before writing the out the superblock. Reviewed by: kib Tested by: Peter Holm PR: 246983 Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Fri Jun 19 01:02:53 2020 (r362358) +++ head/sys/ufs/ffs/ffs_subr.c Fri Jun 19 01:04:25 2020 (r362359) @@ -50,7 +50,6 @@ uint32_t ffs_calc_sbhash(struct fs *); struct malloc_type; #define UFS_MALLOC(size, type, flags) malloc(size) #define UFS_FREE(ptr, type) free(ptr) -#define UFS_TIME time(NULL) /* * Request standard superblock location in ffs_sbget */ @@ -78,7 +77,6 @@ struct malloc_type; #define UFS_MALLOC(size, type, flags) malloc(size, type, flags) #define UFS_FREE(ptr, type) free(ptr, type) -#define UFS_TIME time_second #endif /* _KERNEL */ @@ -349,11 +347,24 @@ ffs_sbput(void *devfd, struct fs *fs, off_t loc, } } fs->fs_fmod = 0; - fs->fs_time = UFS_TIME; +#ifndef _KERNEL + { + struct fs_summary_info *fs_si; + + fs->fs_time = time(NULL); + /* Clear the pointers for the duration of writing. */ + fs_si = fs->fs_si; + fs->fs_si = NULL; + fs->fs_ckhash = ffs_calc_sbhash(fs); + error = (*writefunc)(devfd, loc, fs, fs->fs_sbsize); + fs->fs_si = fs_si; + } +#else /* _KERNEL */ + fs->fs_time = time_second; fs->fs_ckhash = ffs_calc_sbhash(fs); - if ((error = (*writefunc)(devfd, loc, fs, fs->fs_sbsize)) != 0) - return (error); - return (0); + error = (*writefunc)(devfd, loc, fs, fs->fs_sbsize); +#endif /* _KERNEL */ + return (error); } /* Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Jun 19 01:02:53 2020 (r362358) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Jun 19 01:04:25 2020 (r362359) @@ -2293,6 +2293,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); fs = (struct fs *)bp->b_data; ffs_oldfscompat_write(fs, ump); + fs->fs_si = NULL; /* Recalculate the superblock hash */ fs->fs_ckhash = ffs_calc_sbhash(fs); if (devfdp->suspended) From owner-svn-src-all@freebsd.org Fri Jun 19 03:31:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B628133D10A; Fri, 19 Jun 2020 03:31:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p49G4MvDz4Rwj; Fri, 19 Jun 2020 03:31:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9141114AC4; Fri, 19 Jun 2020 03:31:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J3Vk5X003124; Fri, 19 Jun 2020 03:31:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J3VkZa003123; Fri, 19 Jun 2020 03:31:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006190331.05J3VkZa003123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jun 2020 03:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362360 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 362360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 03:31:46 -0000 Author: markj Date: Fri Jun 19 03:31:46 2020 New Revision: 362360 URL: https://svnweb.freebsd.org/changeset/base/362360 Log: Fix a double object unlock in vm_object_backing_collapse_wait(). Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25327 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Jun 19 01:04:25 2020 (r362359) +++ head/sys/vm/vm_object.c Fri Jun 19 03:31:46 2020 (r362360) @@ -864,7 +864,6 @@ vm_object_backing_collapse_wait(vm_object_t object) VM_OBJECT_WLOCK(backing_object); if ((backing_object->flags & (OBJ_DEAD | OBJ_COLLAPSING)) == 0) break; - VM_OBJECT_WUNLOCK(object); vm_object_pip_sleep(backing_object, "vmbckwait"); counter_u64_add(object_collapse_waits, 1); VM_OBJECT_WLOCK(object); From owner-svn-src-all@freebsd.org Fri Jun 19 03:32:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51C5433CD87; Fri, 19 Jun 2020 03:32:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p49f1X6xz4Rcl; Fri, 19 Jun 2020 03:32:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FCD014B50; Fri, 19 Jun 2020 03:32:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J3W6u8006448; Fri, 19 Jun 2020 03:32:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J3W53u006443; Fri, 19 Jun 2020 03:32:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006190332.05J3W53u006443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jun 2020 03:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362361 - in head/sys: compat/linuxkpi/common/src vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/src vm X-SVN-Commit-Revision: 362361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 03:32:06 -0000 Author: markj Date: Fri Jun 19 03:32:04 2020 New Revision: 362361 URL: https://svnweb.freebsd.org/changeset/base/362361 Log: Add a helper function for validating VA ranges. Functions which take untrusted user ranges must validate against the bounds of the map, and also check for wraparound. Instead of having the same logic duplicated in a number of places, add a function to check. Reviewed by: dougm, kib Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25328 Modified: head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_mmap.c Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jun 19 03:31:46 2020 (r362360) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jun 19 03:32:04 2020 (r362361) @@ -222,7 +222,7 @@ __get_user_pages_fast(unsigned long start, int nr_page va = start; map = &curthread->td_proc->p_vmspace->vm_map; end = start + (((size_t)nr_pages) << PAGE_SHIFT); - if (start < vm_map_min(map) || end > vm_map_max(map)) + if (!vm_map_range_valid(map, start, end)) return (-EINVAL); prot = write ? (VM_PROT_READ | VM_PROT_WRITE) : VM_PROT_READ; for (count = 0, mp = pages, va = start; va < end; Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Jun 19 03:31:46 2020 (r362360) +++ head/sys/vm/vm_fault.c Fri Jun 19 03:32:04 2020 (r362361) @@ -1713,10 +1713,7 @@ vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t ad end = round_page(addr + len); addr = trunc_page(addr); - /* - * Check for illegal addresses. - */ - if (addr < vm_map_min(map) || addr > end || end > vm_map_max(map)) + if (!vm_map_range_valid(map, addr, end)) return (-1); if (atop(end - addr) > max_count) Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jun 19 03:31:46 2020 (r362360) +++ head/sys/vm/vm_map.c Fri Jun 19 03:32:04 2020 (r362361) @@ -1616,8 +1616,7 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof /* * Check that the start and end points are not bogus. */ - if (start < vm_map_min(map) || end > vm_map_max(map) || - start >= end) + if (!vm_map_range_valid(map, start, end)) return (KERN_INVALID_ADDRESS); /* @@ -2161,9 +2160,7 @@ again: goto done; } } else if ((cow & MAP_REMAP) != 0) { - if (*addr < vm_map_min(map) || - *addr + length > vm_map_max(map) || - *addr + length <= length) { + if (!vm_map_range_valid(map, *addr, *addr + length)) { rv = KERN_INVALID_ADDRESS; goto done; } @@ -4324,9 +4321,8 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, KASSERT(orient != (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP), ("bi-dir stack")); - if (addrbos < vm_map_min(map) || - addrbos + max_ssize > vm_map_max(map) || - addrbos + max_ssize <= addrbos) + if (max_ssize == 0 || + !vm_map_range_valid(map, addrbos, addrbos + max_ssize)) return (KERN_INVALID_ADDRESS); sgp = ((curproc->p_flag2 & P2_STKGAP_DISABLE) != 0 || (curproc->p_fctl0 & NT_FREEBSD_FCTL_STKGAP_DISABLE) != 0) ? 0 : Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Fri Jun 19 03:31:46 2020 (r362360) +++ head/sys/vm/vm_map.h Fri Jun 19 03:32:04 2020 (r362361) @@ -255,6 +255,17 @@ vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags { map->flags = (map->flags | set) & ~clear; } + +static inline bool +vm_map_range_valid(vm_map_t map, vm_offset_t start, vm_offset_t end) +{ + if (end < start) + return (false); + if (start < vm_map_min(map) || end > vm_map_max(map)) + return (false); + return (true); +} + #endif /* KLD_MODULE */ #endif /* _KERNEL */ Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Fri Jun 19 03:31:46 2020 (r362360) +++ head/sys/vm/vm_mmap.c Fri Jun 19 03:32:04 2020 (r362361) @@ -342,11 +342,8 @@ kern_mmap_req(struct thread *td, const struct mmap_req return (EINVAL); /* Address range must be all in user VM space. */ - if (addr < vm_map_min(&vms->vm_map) || - addr + size > vm_map_max(&vms->vm_map)) + if (!vm_map_range_valid(&vms->vm_map, addr, addr + size)) return (EINVAL); - if (addr + size < addr) - return (EINVAL); #ifdef MAP_32BIT if (flags & MAP_32BIT && addr + size > MAP_32BIT_MAX_ADDR) return (EINVAL); @@ -577,7 +574,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t vm_map_entry_t entry; bool pmc_handled; #endif - vm_offset_t addr; + vm_offset_t addr, end; vm_size_t pageoff; vm_map_t map; @@ -589,15 +586,11 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t addr -= pageoff; size += pageoff; size = (vm_size_t) round_page(size); - if (addr + size < addr) - return (EINVAL); - - /* - * Check for illegal addresses. Watch out for address wrap... - */ + end = addr + size; map = &td->td_proc->p_vmspace->vm_map; - if (addr < vm_map_min(map) || addr + size > vm_map_max(map)) + if (!vm_map_range_valid(map, addr, end)) return (EINVAL); + vm_map_lock(map); #ifdef HWPMC_HOOKS pmc_handled = false; @@ -609,7 +602,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t */ pkm.pm_address = (uintptr_t) NULL; if (vm_map_lookup_entry(map, addr, &entry)) { - for (; entry->start < addr + size; + for (; entry->start < end; entry = vm_map_entry_succ(entry)) { if (vm_map_check_protection(map, entry->start, entry->end, VM_PROT_EXECUTE) == TRUE) { @@ -621,7 +614,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t } } #endif - vm_map_delete(map, addr, addr + size); + vm_map_delete(map, addr, end); #ifdef HWPMC_HOOKS if (__predict_false(pmc_handled)) { @@ -772,9 +765,7 @@ kern_madvise(struct thread *td, uintptr_t addr0, size_ */ map = &td->td_proc->p_vmspace->vm_map; addr = addr0; - if (addr < vm_map_min(map) || addr + len > vm_map_max(map)) - return (EINVAL); - if ((addr + len) < addr) + if (!vm_map_range_valid(map, addr, addr + len)) return (EINVAL); /* From owner-svn-src-all@freebsd.org Fri Jun 19 04:09:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DECF33E995; Fri, 19 Jun 2020 04:09:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p50w1VzZz4VTy; Fri, 19 Jun 2020 04:09:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2617A14BFC; Fri, 19 Jun 2020 04:09:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J49ZKl027329; Fri, 19 Jun 2020 04:09:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J49ZtP027328; Fri, 19 Jun 2020 04:09:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202006190409.05J49ZtP027328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jun 2020 04:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362362 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 362362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 04:09:36 -0000 Author: imp Date: Fri Jun 19 04:09:35 2020 New Revision: 362362 URL: https://svnweb.freebsd.org/changeset/base/362362 Log: The actual name for MMCCAM sd block devices is sdda. Pointed out by: kibab@ Modified: head/share/man/man4/scsi.4 Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Fri Jun 19 03:32:04 2020 (r362361) +++ head/share/man/man4/scsi.4 Fri Jun 19 04:09:35 2020 (r362362) @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 6, 2020 +.Dd June 18, 2020 .Dt CAM 4 .Os .Sh NAME @@ -330,7 +330,7 @@ SCSI or SAS device, or devices that accept SCSI CDBs f ATA or SATA device .It Xr nda 4 NVME device -.It Xr mda 4 +.It Xr sdda 4 An SD or MMC block storage device. .El .Pp @@ -441,7 +441,7 @@ for details. .Xr ada 4 , .Xr da 4 , .Xr nda 4 , -.\" .Xr mda 4 , +.\" .Xr sdda 4 , .Xr pass 4 , .Xr sa 4 .Pp From owner-svn-src-all@freebsd.org Fri Jun 19 04:18:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD70F33ECA7; Fri, 19 Jun 2020 04:18:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p5C03pxdz4Vsw; Fri, 19 Jun 2020 04:18:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DEC715600; Fri, 19 Jun 2020 04:18:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J4IKY8033595; Fri, 19 Jun 2020 04:18:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J4IK38033594; Fri, 19 Jun 2020 04:18:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006190418.05J4IK38033594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jun 2020 04:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362363 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 362363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 04:18:20 -0000 Author: markj Date: Fri Jun 19 04:18:20 2020 New Revision: 362363 URL: https://svnweb.freebsd.org/changeset/base/362363 Log: Restore a check unintentionally dropped in r362361. MFC with: r362361 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jun 19 04:09:35 2020 (r362362) +++ head/sys/vm/vm_map.c Fri Jun 19 04:18:20 2020 (r362363) @@ -1616,7 +1616,7 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof /* * Check that the start and end points are not bogus. */ - if (!vm_map_range_valid(map, start, end)) + if (start == end || !vm_map_range_valid(map, start, end)) return (KERN_INVALID_ADDRESS); /* From owner-svn-src-all@freebsd.org Fri Jun 19 05:54:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 013533401BC; Fri, 19 Jun 2020 05:54:16 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p7Kh5x40z4ZPj; Fri, 19 Jun 2020 05:54:16 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6DA616278; Fri, 19 Jun 2020 05:54:16 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J5sGFE094468; Fri, 19 Jun 2020 05:54:16 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J5sGxQ094465; Fri, 19 Jun 2020 05:54:16 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <202006190554.05J5sGxQ094465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Fri, 19 Jun 2020 05:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362364 - in stable/12: sbin/ifconfig sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in stable/12: sbin/ifconfig sys/net X-SVN-Commit-Revision: 362364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 05:54:17 -0000 Author: rpokala Date: Fri Jun 19 05:54:15 2020 New Revision: 362364 URL: https://svnweb.freebsd.org/changeset/base/362364 Log: MFC r362078: Decode the "LACP Fast Timeout" LAGG option flag r286700 added the "lacp_fast_timeout" option to `ifconfig', but we forgot to include the new option in the string used to decode the option bits. Add "LACP_FAST_TIMO" to LAGG_OPT_BITS. Also, s/LAGG_OPT_LACP_TIMEOUT/LAGG_OPT_LACP_FAST_TIMO/g , to be clearer that the flag indicates "Fast Timeout" mode. Modified: stable/12/sbin/ifconfig/iflagg.c stable/12/sys/net/if_lagg.c stable/12/sys/net/if_lagg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/iflagg.c ============================================================================== --- stable/12/sbin/ifconfig/iflagg.c Fri Jun 19 04:18:20 2020 (r362363) +++ stable/12/sbin/ifconfig/iflagg.c Fri Jun 19 05:54:15 2020 (r362364) @@ -139,8 +139,8 @@ setlaggsetopt(const char *val, int d, int s, const str case -LAGG_OPT_LACP_TXTEST: case LAGG_OPT_LACP_RXTEST: case -LAGG_OPT_LACP_RXTEST: - case LAGG_OPT_LACP_TIMEOUT: - case -LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: + case -LAGG_OPT_LACP_FAST_TIMO: break; default: err(1, "Invalid lagg option"); @@ -312,8 +312,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), - DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), - DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), + DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt), + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt), DEF_CMD_ARG("flowid_shift", setlaggflowidshift), DEF_CMD_ARG("rr_limit", setlaggrr_limit), }; Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Fri Jun 19 04:18:20 2020 (r362363) +++ stable/12/sys/net/if_lagg.c Fri Jun 19 05:54:15 2020 (r362364) @@ -1220,7 +1220,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data if (lsc->lsc_strict_mode != 0) ro->ro_opts |= LAGG_OPT_LACP_STRICT; if (lsc->lsc_fast_timeout != 0) - ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT; + ro->ro_opts |= LAGG_OPT_LACP_FAST_TIMO; ro->ro_active = sc->sc_active; } else { @@ -1277,8 +1277,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case -LAGG_OPT_LACP_RXTEST: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: - case LAGG_OPT_LACP_TIMEOUT: - case -LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: + case -LAGG_OPT_LACP_FAST_TIMO: valid = lacp = 1; break; default: @@ -1338,14 +1338,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case -LAGG_OPT_LACP_STRICT: lsc->lsc_strict_mode = 0; break; - case LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: LACP_LOCK(lsc); LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) lp->lp_state |= LACP_STATE_TIMEOUT; LACP_UNLOCK(lsc); lsc->lsc_fast_timeout = 1; break; - case -LAGG_OPT_LACP_TIMEOUT: + case -LAGG_OPT_LACP_FAST_TIMO: LACP_LOCK(lsc); LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) lp->lp_state &= ~LACP_STATE_TIMEOUT; Modified: stable/12/sys/net/if_lagg.h ============================================================================== --- stable/12/sys/net/if_lagg.h Fri Jun 19 04:18:20 2020 (r362363) +++ stable/12/sys/net/if_lagg.h Fri Jun 19 05:54:15 2020 (r362364) @@ -147,7 +147,7 @@ struct lagg_reqopts { #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ -#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ +#define LAGG_OPT_LACP_FAST_TIMO 0x80 /* LACP fast timeout */ #define LAGG_OPT_RR_LIMIT 0x100 /* RR stride */ u_int ro_count; /* number of ports */ u_int ro_active; /* active port count */ @@ -160,7 +160,8 @@ struct lagg_reqopts { #define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts) #define LAGG_OPT_BITS "\020\001USE_FLOWID\005LACP_STRICT" \ - "\006LACP_TXTEST\007LACP_RXTEST" + "\006LACP_TXTEST\007LACP_RXTEST" \ + "\010LACP_FAST_TIMO" #ifdef _KERNEL From owner-svn-src-all@freebsd.org Fri Jun 19 06:23:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A483E340D55; Fri, 19 Jun 2020 06:23:55 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p7zv3sb2z4byL; Fri, 19 Jun 2020 06:23:55 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FE6A16A4A; Fri, 19 Jun 2020 06:23:55 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J6NtmD013186; Fri, 19 Jun 2020 06:23:55 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J6NtTD013185; Fri, 19 Jun 2020 06:23:55 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006190623.05J6NtTD013185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Fri, 19 Jun 2020 06:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362365 - head/sbin/md5 X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/sbin/md5 X-SVN-Commit-Revision: 362365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 06:23:55 -0000 Author: fernape (ports committer) Date: Fri Jun 19 06:23:55 2020 New Revision: 362365 URL: https://svnweb.freebsd.org/changeset/base/362365 Log: md5(1): Add EXAMPLES section Add EXAMLES covering -c, -s and -r Approved by: bcr@, 0mp@ Differential Revision: https://reviews.freebsd.org/D25278 Modified: head/sbin/md5/md5.1 Modified: head/sbin/md5/md5.1 ============================================================================== --- head/sbin/md5/md5.1 Fri Jun 19 05:54:15 2020 (r362364) +++ head/sbin/md5/md5.1 Fri Jun 19 06:23:55 2020 (r362365) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 15, 2020 +.Dd June 19, 2020 .Dt MD5 1 .Os .Sh NAME @@ -95,6 +95,48 @@ utilities exit 0 on success, and 2 if at least one file does not have the same hash as the .Fl c option. +.Sh EXAMPLES +Calculate the MD5 checksum of the string +.Dq Hello . +.Bd -literal -offset indent +$ md5 -s Hello +MD5 ("Hello") = 8b1a9953c4611296a827abf8c47804d7 +.Ed +.Pp +Same as above, but note the absence of the newline character in the input +string: +.Bd -literal -offset indent +$ echo -n Hello | md5 +8b1a9953c4611296a827abf8c47804d7 +.Ed +.Pp +Calculate the checksum of multiple files reversing the output: +.Bd -literal -offset indent +$ md5 -r /boot/loader.conf /etc/rc.conf +ada5f60f23af88ff95b8091d6d67bef6 /boot/loader.conf +d80bf36c332dc0fdc479366ec3fa44cd /etc/rc.conf +.Ed +.Pp +Write the digest for +.Pa /boot/loader.conf +in a file named +.Pa digest . +Then calculate the checksum again and validate it against the checksum string +extracted from the +.Pa digest +file: +.Bd -literal -offset indent +$ md5 /boot/loader.conf > digest && md5 -c $(cut -f2 -d= digest) /boot/loader.conf +MD5 (/boot/loader.conf) = ada5f60f23af88ff95b8091d6d67bef6 +.Ed +.Pp +Same as above but comparing the digest against an invalid string +.Pq Dq randomstring , +which results in a failure. +.Bd -literal -offset indent +$ md5 -c randomstring /boot/loader.conf +MD5 (/boot/loader.conf) = ada5f60f23af88ff95b8091d6d67bef6 [ Failed ] +.Ed .Sh SEE ALSO .Xr cksum 1 , .Xr md5 3 , From owner-svn-src-all@freebsd.org Fri Jun 19 06:35:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9C803413FF; Fri, 19 Jun 2020 06:35:58 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p8Fp4lNYz4cbN; Fri, 19 Jun 2020 06:35:58 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E12F16A77; Fri, 19 Jun 2020 06:35:58 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J6ZwYu020018; Fri, 19 Jun 2020 06:35:58 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J6Zwiu020015; Fri, 19 Jun 2020 06:35:58 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <202006190635.05J6Zwiu020015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Fri, 19 Jun 2020 06:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362366 - in stable/11: sbin/ifconfig sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in stable/11: sbin/ifconfig sys/net X-SVN-Commit-Revision: 362366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 06:35:58 -0000 Author: rpokala Date: Fri Jun 19 06:35:57 2020 New Revision: 362366 URL: https://svnweb.freebsd.org/changeset/base/362366 Log: MFC r362078: Decode the "LACP Fast Timeout" LAGG option flag r286700 added the "lacp_fast_timeout" option to `ifconfig', but we forgot to include the new option in the string used to decode the option bits. Add "LACP_FAST_TIMO" to LAGG_OPT_BITS. Also, s/LAGG_OPT_LACP_TIMEOUT/LAGG_OPT_LACP_FAST_TIMO/g , to be clearer that the flag indicates "Fast Timeout" mode. Modified: stable/11/sbin/ifconfig/iflagg.c stable/11/sys/net/if_lagg.c stable/11/sys/net/if_lagg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ifconfig/iflagg.c ============================================================================== --- stable/11/sbin/ifconfig/iflagg.c Fri Jun 19 06:23:55 2020 (r362365) +++ stable/11/sbin/ifconfig/iflagg.c Fri Jun 19 06:35:57 2020 (r362366) @@ -128,8 +128,8 @@ setlaggsetopt(const char *val, int d, int s, const str case -LAGG_OPT_LACP_TXTEST: case LAGG_OPT_LACP_RXTEST: case -LAGG_OPT_LACP_RXTEST: - case LAGG_OPT_LACP_TIMEOUT: - case -LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: + case -LAGG_OPT_LACP_FAST_TIMO: break; default: err(1, "Invalid lagg option"); @@ -301,8 +301,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), - DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), - DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), + DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt), + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt), DEF_CMD_ARG("flowid_shift", setlaggflowidshift), DEF_CMD_ARG("rr_limit", setlaggrr_limit), }; Modified: stable/11/sys/net/if_lagg.c ============================================================================== --- stable/11/sys/net/if_lagg.c Fri Jun 19 06:23:55 2020 (r362365) +++ stable/11/sys/net/if_lagg.c Fri Jun 19 06:35:57 2020 (r362366) @@ -1194,7 +1194,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data if (lsc->lsc_strict_mode != 0) ro->ro_opts |= LAGG_OPT_LACP_STRICT; if (lsc->lsc_fast_timeout != 0) - ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT; + ro->ro_opts |= LAGG_OPT_LACP_FAST_TIMO; ro->ro_active = sc->sc_active; } else { @@ -1238,8 +1238,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case -LAGG_OPT_LACP_RXTEST: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: - case LAGG_OPT_LACP_TIMEOUT: - case -LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: + case -LAGG_OPT_LACP_FAST_TIMO: valid = lacp = 1; break; default: @@ -1292,14 +1292,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case -LAGG_OPT_LACP_STRICT: lsc->lsc_strict_mode = 0; break; - case LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: LACP_LOCK(lsc); LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) lp->lp_state |= LACP_STATE_TIMEOUT; LACP_UNLOCK(lsc); lsc->lsc_fast_timeout = 1; break; - case -LAGG_OPT_LACP_TIMEOUT: + case -LAGG_OPT_LACP_FAST_TIMO: LACP_LOCK(lsc); LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) lp->lp_state &= ~LACP_STATE_TIMEOUT; Modified: stable/11/sys/net/if_lagg.h ============================================================================== --- stable/11/sys/net/if_lagg.h Fri Jun 19 06:23:55 2020 (r362365) +++ stable/11/sys/net/if_lagg.h Fri Jun 19 06:35:57 2020 (r362366) @@ -148,7 +148,7 @@ struct lagg_reqopts { #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ -#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ +#define LAGG_OPT_LACP_FAST_TIMO 0x80 /* LACP fast timeout */ u_int ro_count; /* number of ports */ u_int ro_active; /* active port count */ u_int ro_flapping; /* number of flapping */ @@ -160,7 +160,8 @@ struct lagg_reqopts { #define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts) #define LAGG_OPT_BITS "\020\001USE_FLOWID\005LACP_STRICT" \ - "\006LACP_TXTEST\007LACP_RXTEST" + "\006LACP_TXTEST\007LACP_RXTEST" \ + "\010LACP_FAST_TIMO" #ifdef _KERNEL From owner-svn-src-all@freebsd.org Fri Jun 19 06:48:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48BE4341615; Fri, 19 Jun 2020 06:48:17 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p8X11Bs2z4d3C; Fri, 19 Jun 2020 06:48:17 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 246AB16BDD; Fri, 19 Jun 2020 06:48:17 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J6mHQA026233; Fri, 19 Jun 2020 06:48:17 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J6mHeq026232; Fri, 19 Jun 2020 06:48:17 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006190648.05J6mHeq026232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Fri, 19 Jun 2020 06:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362367 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 362367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 06:48:17 -0000 Author: fernape (ports committer) Date: Fri Jun 19 06:48:16 2020 New Revision: 362367 URL: https://svnweb.freebsd.org/changeset/base/362367 Log: diff(1): Add EXAMPLES section Add examples for -r, -u, -N, -x, -q and -I Approved by: 0mp@ Differential Revision: https://reviews.freebsd.org/D25345 Modified: head/usr.bin/diff/diff.1 Modified: head/usr.bin/diff/diff.1 ============================================================================== --- head/usr.bin/diff/diff.1 Fri Jun 19 06:35:57 2020 (r362366) +++ head/usr.bin/diff/diff.1 Fri Jun 19 06:48:16 2020 (r362367) @@ -30,7 +30,7 @@ .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd June 1, 2020 +.Dd June 19, 2020 .Dt DIFF 1 .Os .Sh NAME @@ -277,8 +277,7 @@ Produces a script similar to that of .Fl e , but in the opposite order and with a count of changed lines on each insert or delete command. -This is the form used by -.Xr rcsdiff 1 . +This is the form used by rcsdiff. .It Fl q -brief Just print a line when the files differ. Does not output a list of changes. @@ -613,6 +612,49 @@ Differences were found. .It >1 An error occurred. .El +.Sh EXAMPLES +Compare +.Pa old_dir +and +.Pa new_dir +recursively generating an unified diff and treating files found only in one +of those directories as new files: +.Bd -literal -offset indent +$ diff -ruN /path/to/old_dir /path/to/new_dir +.Ed +.Pp +Same as above but excluding files matching the expressions +.Dq *.h +and +.Dq *.c : +.Bd -literal -offset indent +$ diff -ruN -x '*.h' -x '*.c' /path/to/old_dir /path/to/new_dir +.Ed +.Pp +Show a single line indicating if the files differ: +.Bd -literal -offset indent +$ diff -q /boot/loader.conf /boot/defaults/loader.conf +Files /boot/loader.conf and /boot/defaults/loader.conf differ +.Ed +.Pp +Assuming a file named +.Pa example.txt +with the following contents: +.Bd -literal -offset indent +FreeBSD is an operating system +Linux is a kernel +OpenBSD is an operating system +.Ed +.Pp +Compare stdin with +.Pa example.txt +excluding from the comparison those lines containing either +.Qq Linux +or +.Qq Open : +.Bd -literal -offset indent +$ echo "FreeBSD is an operating system" | diff -q -I 'Linux|Open' example.txt - +.Ed .Sh SEE ALSO .Xr cmp 1 , .Xr comm 1 , From owner-svn-src-all@freebsd.org Fri Jun 19 07:07:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6B39342018; Fri, 19 Jun 2020 07:07:11 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49p8xq5tSRz4fSq; Fri, 19 Jun 2020 07:07:11 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C535516C6B; Fri, 19 Jun 2020 07:07:11 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J77BPr038397; Fri, 19 Jun 2020 07:07:11 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J77BRx038395; Fri, 19 Jun 2020 07:07:11 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <202006190707.05J77BRx038395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Fri, 19 Jun 2020 07:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r362368 - in stable/10: sbin/ifconfig sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in stable/10: sbin/ifconfig sys/net X-SVN-Commit-Revision: 362368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 07:07:12 -0000 Author: rpokala Date: Fri Jun 19 07:07:10 2020 New Revision: 362368 URL: https://svnweb.freebsd.org/changeset/base/362368 Log: MFC r362078: Decode the "LACP Fast Timeout" LAGG option flag r286700 added the "lacp_fast_timeout" option to `ifconfig', but we forgot to include the new option in the string used to decode the option bits. Add "LACP_FAST_TIMO" to LAGG_OPT_BITS. Also, s/LAGG_OPT_LACP_TIMEOUT/LAGG_OPT_LACP_FAST_TIMO/g , to be clearer that the flag indicates "Fast Timeout" mode. Modified: stable/10/sbin/ifconfig/iflagg.c stable/10/sys/net/if_lagg.c stable/10/sys/net/if_lagg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/iflagg.c ============================================================================== --- stable/10/sbin/ifconfig/iflagg.c Fri Jun 19 06:48:16 2020 (r362367) +++ stable/10/sbin/ifconfig/iflagg.c Fri Jun 19 07:07:10 2020 (r362368) @@ -115,8 +115,8 @@ setlaggsetopt(const char *val, int d, int s, const str case -LAGG_OPT_LACP_TXTEST: case LAGG_OPT_LACP_RXTEST: case -LAGG_OPT_LACP_RXTEST: - case LAGG_OPT_LACP_TIMEOUT: - case -LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: + case -LAGG_OPT_LACP_FAST_TIMO: break; default: err(1, "Invalid lagg option"); @@ -286,8 +286,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), - DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), - DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), + DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt), + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt), DEF_CMD_ARG("flowid_shift", setlaggflowidshift), }; static struct afswtch af_lagg = { Modified: stable/10/sys/net/if_lagg.c ============================================================================== --- stable/10/sys/net/if_lagg.c Fri Jun 19 06:48:16 2020 (r362367) +++ stable/10/sys/net/if_lagg.c Fri Jun 19 07:07:10 2020 (r362368) @@ -1100,7 +1100,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data if (lsc->lsc_strict_mode != 0) ro->ro_opts |= LAGG_OPT_LACP_STRICT; if (lsc->lsc_fast_timeout != 0) - ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT; + ro->ro_opts |= LAGG_OPT_LACP_FAST_TIMO; ro->ro_active = sc->sc_active; } else { @@ -1136,8 +1136,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case -LAGG_OPT_LACP_RXTEST: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: - case LAGG_OPT_LACP_TIMEOUT: - case -LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: + case -LAGG_OPT_LACP_FAST_TIMO: valid = lacp = 1; break; default: @@ -1189,14 +1189,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case -LAGG_OPT_LACP_STRICT: lsc->lsc_strict_mode = 0; break; - case LAGG_OPT_LACP_TIMEOUT: + case LAGG_OPT_LACP_FAST_TIMO: LACP_LOCK(lsc); LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) lp->lp_state |= LACP_STATE_TIMEOUT; LACP_UNLOCK(lsc); lsc->lsc_fast_timeout = 1; break; - case -LAGG_OPT_LACP_TIMEOUT: + case -LAGG_OPT_LACP_FAST_TIMO: LACP_LOCK(lsc); LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) lp->lp_state &= ~LACP_STATE_TIMEOUT; Modified: stable/10/sys/net/if_lagg.h ============================================================================== --- stable/10/sys/net/if_lagg.h Fri Jun 19 06:48:16 2020 (r362367) +++ stable/10/sys/net/if_lagg.h Fri Jun 19 07:07:10 2020 (r362368) @@ -148,7 +148,7 @@ struct lagg_reqopts { #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ -#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ +#define LAGG_OPT_LACP_FAST_TIMO 0x80 /* LACP fast timeout */ u_int ro_count; /* number of ports */ u_int ro_active; /* active port count */ u_int ro_flapping; /* number of flapping */ @@ -159,7 +159,8 @@ struct lagg_reqopts { #define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts) #define LAGG_OPT_BITS "\020\001USE_FLOWID\005LACP_STRICT" \ - "\006LACP_TXTEST\007LACP_RXTEST" + "\006LACP_TXTEST\007LACP_RXTEST" \ + "\010LACP_FAST_TIMO" #ifdef _KERNEL From owner-svn-src-all@freebsd.org Fri Jun 19 09:27:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D94E83457D5; Fri, 19 Jun 2020 09:27:58 +0000 (UTC) (envelope-from salvadore@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pD4G5SKnz3YCX; Fri, 19 Jun 2020 09:27:58 +0000 (UTC) (envelope-from salvadore@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B683918A7A; Fri, 19 Jun 2020 09:27:58 +0000 (UTC) (envelope-from salvadore@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05J9RwTY024272; Fri, 19 Jun 2020 09:27:58 GMT (envelope-from salvadore@FreeBSD.org) Received: (from salvadore@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05J9RwjN024270; Fri, 19 Jun 2020 09:27:58 GMT (envelope-from salvadore@FreeBSD.org) Message-Id: <202006190927.05J9RwjN024270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: salvadore set sender to salvadore@FreeBSD.org using -f From: Lorenzo Salvadore Date: Fri, 19 Jun 2020 09:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362369 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: salvadore X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 362369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 09:27:58 -0000 Author: salvadore (ports committer) Date: Fri Jun 19 09:27:58 2020 New Revision: 362369 URL: https://svnweb.freebsd.org/changeset/base/362369 Log: bin/ps: Make the rtprio option actually show realtime priorities Fix the rtprio option that for some reason was progessively becoming an option showing the priority class of threads. In particular: - use the constants defined in sys/sys/rtprio.h instead of those defined in sys/sys/priority.h: this helps making clearer that the code actually is about realtime priorities and not standard scheduler priorities; - remove the PRI_ITHD case that has nothing to do with realtime priorities; - convert the priority levels to realtime priority levels using the same formulas used for pri_to_rtp function in sys/kern/kern_resource.c. - remove outdated note "101 = not a realtime process" in the man page and replace it with a more useful reference to man 1 rtprio. Approved by: src (mckusick), manpages (bcr), gerald (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25266 Modified: head/bin/ps/print.c head/bin/ps/ps.1 Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Fri Jun 19 07:07:10 2020 (r362368) +++ head/bin/ps/print.c Fri Jun 19 09:27:58 2020 (r362369) @@ -704,17 +704,17 @@ priorityr(KINFO *k, VARENT *ve __unused) class = lpri->pri_class; level = lpri->pri_level; switch (class) { - case PRI_ITHD: - asprintf(&str, "intr:%u", level); + case RTP_PRIO_REALTIME: + /* alias for PRI_REALTIME */ + asprintf(&str, "real:%u", level - PRI_MIN_REALTIME); break; - case PRI_REALTIME: - asprintf(&str, "real:%u", level); + case RTP_PRIO_NORMAL: + /* alias for PRI_TIMESHARE */ + asprintf(&str, "normal:%u", level - PRI_MIN_TIMESHARE); break; - case PRI_TIMESHARE: - asprintf(&str, "normal"); - break; - case PRI_IDLE: - asprintf(&str, "idle:%u", level); + case RTP_PRIO_IDLE: + /* alias for PRI_IDLE */ + asprintf(&str, "idle:%u", level - PRI_MIN_IDLE); break; default: asprintf(&str, "%u:%u", class, level); Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri Jun 19 07:07:10 2020 (r362368) +++ head/bin/ps/ps.1 Fri Jun 19 09:27:58 2020 (r362369) @@ -648,7 +648,8 @@ group name (from rgid) .It Cm rss resident set size .It Cm rtprio -realtime priority (101 = not a realtime process) +realtime priority (see +.Xr rtprio 1) .It Cm ruid real user ID .It Cm ruser From owner-svn-src-all@freebsd.org Fri Jun 19 10:02:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53F56346985; Fri, 19 Jun 2020 10:02:31 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pDr708jQz3b25; Fri, 19 Jun 2020 10:02:30 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f182.google.com with SMTP id 187so4672477ybq.2; Fri, 19 Jun 2020 03:02:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qNbKhINq7le8E293hfZUjmEgVDu3tAb3ipKIkM55OCQ=; b=mQYwA/cfMpzIF0aX4tz6JEK7wVNG6sQa5YuVBSwa7/UkZzdtLoWGoHlx4W90rpBcQr 9WiLGbSC+Olo7XsqbvZg5EQM3igpDUuuvvuT7fSfKcwpxrZCl3xPrneNMT5882xJAuy1 sUj04CM2JgSaQfih6Or5GZUsJZ6EcXyIbHR9X167iVamhCIjU17XWEoFB0UOJd1qe6Mr NSix1MO5eNShbhN1qX2Msi+jbfAVtwNqkWa9pnzGnj6cxbz0Tee2A20BwC9QsuphJUJ/ tipgNsKt4+SxqVquv/GAFnLfYSrLKbv7DTF1FeFXK2ZexVekDkyYazoMoMhzYCxTUkNJ l5cA== X-Gm-Message-State: AOAM531dix1CQ/7pJeRhBievskHmVUBZiVaR8jBzN8dj9GhBUFj6R1dQ PQvwweUuuP5x0R7YjYlaud4bJx6gTCvosHb+iKsuv+Fc X-Google-Smtp-Source: ABdhPJy5N52+h3hlItL1bHGphg9Xxr2XZFy2OvZjmiEDGY02cI2t9z/tO8ouwSg5LTMNktttKMCvUfc7JwXhKsFejTE= X-Received: by 2002:a25:c646:: with SMTP id k67mr5025009ybf.110.1592560949792; Fri, 19 Jun 2020 03:02:29 -0700 (PDT) MIME-Version: 1.0 References: <202006190332.05J3W53u006443@repo.freebsd.org> In-Reply-To: <202006190332.05J3W53u006443@repo.freebsd.org> From: Li-Wen Hsu Date: Fri, 19 Jun 2020 18:02:18 +0800 Message-ID: Subject: Re: svn commit: r362361 - in head/sys: compat/linuxkpi/common/src vm To: Mark Johnston Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49pDr708jQz3b25 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 10:02:31 -0000 On Fri, Jun 19, 2020 at 11:32 AM Mark Johnston wrote: > > Author: markj > Date: Fri Jun 19 03:32:04 2020 > New Revision: 362361 > URL: https://svnweb.freebsd.org/changeset/base/362361 > > Log: > Add a helper function for validating VA ranges. > > Functions which take untrusted user ranges must validate against the > bounds of the map, and also check for wraparound. Instead of having the > same logic duplicated in a number of places, add a function to check. > > Reviewed by: dougm, kib > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D25328 I'm not sure if it's this one, or 3623630, the following i386 tests all panicked: https://ci.freebsd.org/job/FreeBSD-head-i386-test/9681/console 00:11:31.669 lib/libc/net/protoent_test:protoent -> panic: __rw_wlock_hard: recursing but non-recursive rw vm object @ /usr/src/sys/vm/vm_object.c:869 https://ci.freebsd.org/job/FreeBSD-head-i386-test/9682/console (includes the fix or r362363) 00:27:53.864 bin/pkill/pkill-j_test:main -> Sleeping thread (tid 100115, pid 65628) owns a non-sleepable lock https://ci.freebsd.org/job/FreeBSD-head-i386-test/9683/console 00:02:26.917 bin/pkill/pkill-j_test:main -> Sleeping thread (tid 100152, pid 26582) owns a non-sleepable lock Can you help check these? Thanks, Li-Wen From owner-svn-src-all@freebsd.org Fri Jun 19 10:33:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEA9D346F8A; Fri, 19 Jun 2020 10:33:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pFXB41Rrz3c1l; Fri, 19 Jun 2020 10:33:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C49119D1E; Fri, 19 Jun 2020 10:33:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JAXk2f066652; Fri, 19 Jun 2020 10:33:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JAXkjo066651; Fri, 19 Jun 2020 10:33:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191033.05JAXkjo066651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 10:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362370 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 362370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 10:33:46 -0000 Author: kib Date: Fri Jun 19 10:33:45 2020 New Revision: 362370 URL: https://svnweb.freebsd.org/changeset/base/362370 Log: MFC r362128: rtld: set osrel when in the direct exec mode. Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Fri Jun 19 09:27:58 2020 (r362369) +++ stable/12/libexec/rtld-elf/rtld.c Fri Jun 19 10:33:45 2020 (r362370) @@ -384,8 +384,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr const char *argv0, *binpath; caddr_t imgentry; char buf[MAXPATHLEN]; - int argc, fd, i, phnum, rtld_argc; - bool dir_enable, explicit_fd, search_in_path; + int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc; + size_t sz; + bool dir_enable, direct_exec, explicit_fd, search_in_path; /* * On entry, the dynamic linker itself has not been relocated yet. @@ -423,6 +424,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr main_argv = argv; trust = !issetugid(); + direct_exec = false; md_abi_variant_hook(aux_info); @@ -438,6 +440,21 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr argv0); rtld_die(); } + direct_exec = true; + + /* + * Set osrel for us, it is later reset to the binary' + * value before first instruction of code from the binary + * is executed. + */ + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_OSREL; + mib[3] = getpid(); + osrel = __FreeBSD_version; + sz = sizeof(old_osrel); + (void)sysctl(mib, 4, &old_osrel, &sz, &osrel, sizeof(osrel)); + dbg("opening main program in direct exec mode"); if (argc >= 2) { rtld_argc = parse_args(argv, argc, &search_in_path, &fd, &argv0); @@ -767,6 +784,18 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr * init functions. */ pre_init(); + + if (direct_exec) { + /* Set osrel for direct-execed binary */ + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_OSREL; + mib[3] = getpid(); + osrel = obj_main->osrel; + sz = sizeof(old_osrel); + dbg("setting osrel to %d", osrel); + (void)sysctl(mib, 4, &old_osrel, &sz, &osrel, sizeof(osrel)); + } wlock_acquire(rtld_bind_lock, &lockstate); From owner-svn-src-all@freebsd.org Fri Jun 19 11:04:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B78C347D05; Fri, 19 Jun 2020 11:04:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pGD20K6rz3fJB; Fri, 19 Jun 2020 11:04:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 062701A03E; Fri, 19 Jun 2020 11:04:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JB4nuH085288; Fri, 19 Jun 2020 11:04:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JB4nEi085287; Fri, 19 Jun 2020 11:04:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006191104.05JB4nEi085287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jun 2020 11:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362371 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 362371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:04:50 -0000 Author: markj Date: Fri Jun 19 11:04:49 2020 New Revision: 362371 URL: https://svnweb.freebsd.org/changeset/base/362371 Log: Revert r362360. This commit was simply wrong since two different objects are locked. Reported by: lwhsu, pho Pointy hat: markj Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Jun 19 10:33:45 2020 (r362370) +++ head/sys/vm/vm_object.c Fri Jun 19 11:04:49 2020 (r362371) @@ -864,6 +864,7 @@ vm_object_backing_collapse_wait(vm_object_t object) VM_OBJECT_WLOCK(backing_object); if ((backing_object->flags & (OBJ_DEAD | OBJ_COLLAPSING)) == 0) break; + VM_OBJECT_WUNLOCK(object); vm_object_pip_sleep(backing_object, "vmbckwait"); counter_u64_add(object_collapse_waits, 1); VM_OBJECT_WLOCK(object); From owner-svn-src-all@freebsd.org Fri Jun 19 11:07:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39432347BB4; Fri, 19 Jun 2020 11:07:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pGGv5qxJz3fLw; Fri, 19 Jun 2020 11:07:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x732.google.com with SMTP id q8so8446415qkm.12; Fri, 19 Jun 2020 04:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=t03EiiqPN/4OqaH8CxIqUMNW6QXQKJaGF3kCLQiQdTA=; b=uj84xCgXzLiYzBrrYzDWhLJwuUYiJN5xe2CR4FcIQGASdpLXmxbIm8dOyQnOjVeJoh Bknhe+rIV/tpbQB8VxV6RiYw40iHHovApiAGi5y2BoRXX6MxhEpBbcr04nFDWSZlOZDj U5GgIuT3r7pJ72C82tLm/i9t5LREM5f8KsH4YdqLhwSaC6ErUxRtgtsOJhLWhiERKPCj /tvOUid54ZDIXY2uV0vWlczFClvhTPOwXBAU30d2BCAipYazNMhjiyBMY/wCF4c8guW6 2eP1qYTCw231Rdva2Dc2vO2UaTnoEvp502jUv81oCZ1kE9W/ao0v+1qiJoe/rgFRURI4 qQ3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=t03EiiqPN/4OqaH8CxIqUMNW6QXQKJaGF3kCLQiQdTA=; b=WLFzA1Kx2ktZy2cKZmEMrQ++BFwSwyLUAO2+vUMnst29x9vuJNZ1VPNx5k+r9hisUk TqAnqs/SSU8iqVaWxo+XqXZj5apb/9LeDwqQ7Oc9soNaElRLfj38LqAAS+X+49YH//Z4 Y8wDawoz1TR8fHfiprEYfMt35uPKFnJSXMvZ8b2kZ9nJxOk0JDspWuJhDcvcL/SrCBZU 6475rxWe8Y2Cm93pQzS4t94248RYiLvWp11CePCZEcTLrq+AE0hMYIVEzn4bLYwg1B/Y 0dNrWTMlzZiWRn+HtrIiDCxtgoHgY+jpp6NdzsNV1rxE+wKITP1+Ia/Fc/wO/v/ex723 QdIQ== X-Gm-Message-State: AOAM530RzYXmWxJb0tZ/yrUU4rAjxDexLG3AAR6YJzZvpiDtbQeNzt8S w1XKnMqiUbjPBfoQ/Q4ty7BIdFfhIBM= X-Google-Smtp-Source: ABdhPJx+ne2Q6VjCouuVqRY6Pl9aB9DQeOtGQy339C/xZUJeEQJxAPgzFG3WpqBR++Rfm3J9oqS8SQ== X-Received: by 2002:a05:620a:2050:: with SMTP id d16mr2999573qka.215.1592564838514; Fri, 19 Jun 2020 04:07:18 -0700 (PDT) Received: from raichu (bras-base-toroon0560w-grc-20-184-147-206-12.dsl.bell.ca. [184.147.206.12]) by smtp.gmail.com with ESMTPSA id k17sm6575133qtb.5.2020.06.19.04.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 04:07:17 -0700 (PDT) Sender: Mark Johnston Date: Fri, 19 Jun 2020 07:07:15 -0400 From: Mark Johnston To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r362361 - in head/sys: compat/linuxkpi/common/src vm Message-ID: <20200619110715.GD97300@raichu> References: <202006190332.05J3W53u006443@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 49pGGv5qxJz3fLw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:07:20 -0000 On Fri, Jun 19, 2020 at 06:02:18PM +0800, Li-Wen Hsu wrote: > On Fri, Jun 19, 2020 at 11:32 AM Mark Johnston wrote: > > > > Author: markj > > Date: Fri Jun 19 03:32:04 2020 > > New Revision: 362361 > > URL: https://svnweb.freebsd.org/changeset/base/362361 > > > > Log: > > Add a helper function for validating VA ranges. > > > > Functions which take untrusted user ranges must validate against the > > bounds of the map, and also check for wraparound. Instead of having the > > same logic duplicated in a number of places, add a function to check. > > > > Reviewed by: dougm, kib > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D25328 > > I'm not sure if it's this one, or 3623630, the following i386 tests > all panicked: It was 3623630, which was totally wrong. > https://ci.freebsd.org/job/FreeBSD-head-i386-test/9681/console > > 00:11:31.669 lib/libc/net/protoent_test:protoent -> panic: > __rw_wlock_hard: recursing but non-recursive rw vm object @ > /usr/src/sys/vm/vm_object.c:869 > > https://ci.freebsd.org/job/FreeBSD-head-i386-test/9682/console > (includes the fix or r362363) > > 00:27:53.864 bin/pkill/pkill-j_test:main -> Sleeping thread (tid > 100115, pid 65628) owns a non-sleepable lock > > https://ci.freebsd.org/job/FreeBSD-head-i386-test/9683/console > > 00:02:26.917 bin/pkill/pkill-j_test:main -> Sleeping thread (tid > 100152, pid 26582) owns a non-sleepable lock > > Can you help check these? I reverted the change. Sorry for the breakage. From owner-svn-src-all@freebsd.org Fri Jun 19 11:11:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06DBF347F31; Fri, 19 Jun 2020 11:11:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pGN85NgHz3fsX; Fri, 19 Jun 2020 11:11:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B42DF19E75; Fri, 19 Jun 2020 11:11:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JBBqLs088825; Fri, 19 Jun 2020 11:11:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JBBqNZ088822; Fri, 19 Jun 2020 11:11:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191111.05JBBqNZ088822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 11:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362372 - in stable/12/sys/x86: include x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/x86: include x86 X-SVN-Commit-Revision: 362372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:11:53 -0000 Author: kib Date: Fri Jun 19 11:11:52 2020 New Revision: 362372 URL: https://svnweb.freebsd.org/changeset/base/362372 Log: MFC r348130 (by cem): Decode and name additional x86 feature bits. Modified: stable/12/sys/x86/include/specialreg.h stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Fri Jun 19 11:04:49 2020 (r362371) +++ stable/12/sys/x86/include/specialreg.h Fri Jun 19 11:11:52 2020 (r362372) @@ -416,29 +416,41 @@ /* * CPUID instruction 7 Structured Extended Features, leaf 0 ecx info */ -#define CPUID_STDEXT2_PREFETCHWT1 0x00000001 -#define CPUID_STDEXT2_UMIP 0x00000004 -#define CPUID_STDEXT2_PKU 0x00000008 -#define CPUID_STDEXT2_OSPKE 0x00000010 -#define CPUID_STDEXT2_WAITPKG 0x00000020 -#define CPUID_STDEXT2_GFNI 0x00000100 -#define CPUID_STDEXT2_RDPID 0x00400000 -#define CPUID_STDEXT2_CLDEMOTE 0x02000000 -#define CPUID_STDEXT2_MOVDIRI 0x08000000 +#define CPUID_STDEXT2_PREFETCHWT1 0x00000001 +#define CPUID_STDEXT2_AVX512VBMI 0x00000002 +#define CPUID_STDEXT2_UMIP 0x00000004 +#define CPUID_STDEXT2_PKU 0x00000008 +#define CPUID_STDEXT2_OSPKE 0x00000010 +#define CPUID_STDEXT2_WAITPKG 0x00000020 +#define CPUID_STDEXT2_AVX512VBMI2 0x00000040 +#define CPUID_STDEXT2_GFNI 0x00000100 +#define CPUID_STDEXT2_VAES 0x00000200 +#define CPUID_STDEXT2_VPCLMULQDQ 0x00000400 +#define CPUID_STDEXT2_AVX512VNNI 0x00000800 +#define CPUID_STDEXT2_AVX512BITALG 0x00001000 +#define CPUID_STDEXT2_AVX512VPOPCNTDQ 0x00004000 +#define CPUID_STDEXT2_RDPID 0x00400000 +#define CPUID_STDEXT2_CLDEMOTE 0x02000000 +#define CPUID_STDEXT2_MOVDIRI 0x08000000 #define CPUID_STDEXT2_MOVDIRI64B 0x10000000 -#define CPUID_STDEXT2_SGXLC 0x40000000 +#define CPUID_STDEXT2_ENQCMD 0x20000000 +#define CPUID_STDEXT2_SGXLC 0x40000000 /* * CPUID instruction 7 Structured Extended Features, leaf 0 edx info */ -#define CPUID_STDEXT3_MD_CLEAR 0x00000400 -#define CPUID_STDEXT3_TSXFA 0x00002000 -#define CPUID_STDEXT3_IBPB 0x04000000 -#define CPUID_STDEXT3_STIBP 0x08000000 -#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 -#define CPUID_STDEXT3_ARCH_CAP 0x20000000 -#define CPUID_STDEXT3_CORE_CAP 0x40000000 -#define CPUID_STDEXT3_SSBD 0x80000000 +#define CPUID_STDEXT3_AVX5124VNNIW 0x00000004 +#define CPUID_STDEXT3_AVX5124FMAPS 0x00000008 +#define CPUID_STDEXT3_AVX512VP2INTERSECT 0x00000100 +#define CPUID_STDEXT3_MD_CLEAR 0x00000400 +#define CPUID_STDEXT3_TSXFA 0x00002000 +#define CPUID_STDEXT3_PCONFIG 0x00040000 +#define CPUID_STDEXT3_IBPB 0x04000000 +#define CPUID_STDEXT3_STIBP 0x08000000 +#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 +#define CPUID_STDEXT3_ARCH_CAP 0x20000000 +#define CPUID_STDEXT3_CORE_CAP 0x40000000 +#define CPUID_STDEXT3_SSBD 0x80000000 /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Fri Jun 19 11:04:49 2020 (r362371) +++ stable/12/sys/x86/x86/identcpu.c Fri Jun 19 11:11:52 2020 (r362372) @@ -993,11 +993,18 @@ printcpuinfo(void) "\004PKU" "\005OSPKE" "\006WAITPKG" + "\007AVX512VBMI2" "\011GFNI" + "\012VAES" + "\013VPCLMULQDQ" + "\014AVX512VNNI" + "\015AVX512BITALG" + "\016AVX512VPOPCNTDQ" "\027RDPID" "\032CLDEMOTE" "\034MOVDIRI" "\035MOVDIRI64B" + "\036ENQCMD" "\037SGXLC" ); } @@ -1006,8 +1013,12 @@ printcpuinfo(void) printf("\n Structured Extended Features3=0x%b", cpu_stdext_feature3, "\020" + "\003AVX512_4VNNIW" + "\004AVX512_4FMAPS" + "\011AVX512VP2INTERSECT" "\013MD_CLEAR" "\016TSXFA" + "\023PCONFIG" "\033IBPB" "\034STIBP" "\035L1DFL" From owner-svn-src-all@freebsd.org Fri Jun 19 11:24:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 058B0348394; Fri, 19 Jun 2020 11:24:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pGfk6M9dz3gWF; Fri, 19 Jun 2020 11:24:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D57601A258; Fri, 19 Jun 2020 11:24:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JBOUGZ097666; Fri, 19 Jun 2020 11:24:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JBOUJ1097665; Fri, 19 Jun 2020 11:24:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191124.05JBOUJ1097665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 11:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362373 - stable/12/sys/x86/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/include X-SVN-Commit-Revision: 362373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:24:31 -0000 Author: kib Date: Fri Jun 19 11:24:30 2020 New Revision: 362373 URL: https://svnweb.freebsd.org/changeset/base/362373 Log: MFC r340716 (by bwidawsk): Add definitions for Intel Speed Shift. Modified: stable/12/sys/x86/include/specialreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Fri Jun 19 11:11:52 2020 (r362372) +++ stable/12/sys/x86/include/specialreg.h Fri Jun 19 11:24:30 2020 (r362373) @@ -190,6 +190,12 @@ #define CPUTPM1_SENSOR 0x00000001 #define CPUTPM1_TURBO 0x00000002 #define CPUTPM1_ARAT 0x00000004 +#define CPUTPM1_HWP 0x00000080 +#define CPUTPM1_HWP_NOTIFICATION 0x00000100 +#define CPUTPM1_HWP_ACTIVITY_WINDOW 0x00000200 +#define CPUTPM1_HWP_PERF_PREF 0x00000400 +#define CPUTPM1_HWP_PKG 0x00000800 +#define CPUTPM1_HWP_FLEXIBLE 0x00020000 #define CPUTPM2_EFFREQ 0x00000001 /* Intel Processor Trace CPUID. */ @@ -573,7 +579,14 @@ #define MSR_DRAM_ENERGY_STATUS 0x619 #define MSR_PP0_ENERGY_STATUS 0x639 #define MSR_PP1_ENERGY_STATUS 0x641 +#define MSR_PPERF 0x64e #define MSR_TSC_DEADLINE 0x6e0 /* Writes are not serializing */ +#define MSR_IA32_PM_ENABLE 0x770 +#define MSR_IA32_HWP_CAPABILITIES 0x771 +#define MSR_IA32_HWP_REQUEST_PKG 0x772 +#define MSR_IA32_HWP_INTERRUPT 0x773 +#define MSR_IA32_HWP_REQUEST 0x774 +#define MSR_IA32_HWP_STATUS 0x777 /* * VMX MSRs @@ -749,6 +762,25 @@ /* MSR IA32_FLUSH_CMD */ #define IA32_FLUSH_CMD_L1D 0x00000001 + +/* MSR IA32_HWP_CAPABILITIES */ +#define IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x) (((x) >> 0) & 0xff) +#define IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(x) (((x) >> 8) & 0xff) +#define IA32_HWP_CAPABILITIES_EFFICIENT_PERFORMANCE(x) (((x) >> 16) & 0xff) +#define IA32_HWP_CAPABILITIES_LOWEST_PERFORMANCE(x) (((x) >> 24) & 0xff) + +/* MSR IA32_HWP_REQUEST */ +#define IA32_HWP_REQUEST_MINIMUM_VALID (1ULL << 63) +#define IA32_HWP_REQUEST_MAXIMUM_VALID (1ULL << 62) +#define IA32_HWP_REQUEST_DESIRED_VALID (1ULL << 61) +#define IA32_HWP_REQUEST_EPP_VALID (1ULL << 60) +#define IA32_HWP_REQUEST_ACTIVITY_WINDOW_VALID (1ULL << 59) +#define IA32_HWP_REQUEST_PACKAGE_CONTROL (1ULL << 42) +#define IA32_HWP_ACTIVITY_WINDOW (0x3ffULL << 32) +#define IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE (0xffULL << 24) +#define IA32_HWP_DESIRED_PERFORMANCE (0xffULL << 16) +#define IA32_HWP_REQUEST_MAXIMUM_PERFORMANCE (0xffULL << 8) +#define IA32_HWP_MINIMUM_PERFORMANCE (0xffULL << 0) /* * PAT modes. From owner-svn-src-all@freebsd.org Fri Jun 19 11:32:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2CE53483DF; Fri, 19 Jun 2020 11:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pGrC3sCxz3gkT; Fri, 19 Jun 2020 11:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FA8C1A901; Fri, 19 Jun 2020 11:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JBWhv2003562; Fri, 19 Jun 2020 11:32:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JBWhvR003561; Fri, 19 Jun 2020 11:32:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191132.05JBWhvR003561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 11:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362374 - in stable/12/sys/x86: include x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/x86: include x86 X-SVN-Commit-Revision: 362374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:32:43 -0000 Author: kib Date: Fri Jun 19 11:32:42 2020 New Revision: 362374 URL: https://svnweb.freebsd.org/changeset/base/362374 Log: MFC r362129: x86: add bits definitions for SRBDS mitigation control. Modified: stable/12/sys/x86/include/specialreg.h stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Fri Jun 19 11:24:30 2020 (r362373) +++ stable/12/sys/x86/include/specialreg.h Fri Jun 19 11:32:42 2020 (r362374) @@ -448,6 +448,7 @@ #define CPUID_STDEXT3_AVX5124VNNIW 0x00000004 #define CPUID_STDEXT3_AVX5124FMAPS 0x00000008 #define CPUID_STDEXT3_AVX512VP2INTERSECT 0x00000100 +#define CPUID_STDEXT3_MCUOPT 0x00000200 #define CPUID_STDEXT3_MD_CLEAR 0x00000400 #define CPUID_STDEXT3_TSXFA 0x00002000 #define CPUID_STDEXT3_PCONFIG 0x00040000 @@ -526,6 +527,7 @@ #define MSR_BBL_CR_BUSY 0x11b #define MSR_BBL_CR_CTL3 0x11e #define MSR_IA32_TSX_CTRL 0x122 +#define MSR_IA32_MCU_OPT_CTRL 0x123 #define MSR_SYSENTER_CS_MSR 0x174 #define MSR_SYSENTER_ESP_MSR 0x175 #define MSR_SYSENTER_EIP_MSR 0x176 @@ -762,6 +764,9 @@ /* MSR IA32_FLUSH_CMD */ #define IA32_FLUSH_CMD_L1D 0x00000001 + +/* MSR IA32_MCU_OPT_CTRL */ +#define IA32_RNGDS_MITG_DIS 0x00000001 /* MSR IA32_HWP_CAPABILITIES */ #define IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x) (((x) >> 0) & 0xff) Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Fri Jun 19 11:24:30 2020 (r362373) +++ stable/12/sys/x86/x86/identcpu.c Fri Jun 19 11:32:42 2020 (r362374) @@ -1016,6 +1016,7 @@ printcpuinfo(void) "\003AVX512_4VNNIW" "\004AVX512_4FMAPS" "\011AVX512VP2INTERSECT" + "\012MCUOPT" "\013MD_CLEAR" "\016TSXFA" "\023PCONFIG" From owner-svn-src-all@freebsd.org Fri Jun 19 11:45:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 712FE3485E4; Fri, 19 Jun 2020 11:45:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pH6d2QnSz3yCk; Fri, 19 Jun 2020 11:45:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E82A1A8AD; Fri, 19 Jun 2020 11:45:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JBjDQ9009925; Fri, 19 Jun 2020 11:45:13 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JBjCjs009921; Fri, 19 Jun 2020 11:45:12 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202006191145.05JBjCjs009921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 19 Jun 2020 11:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362375 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 362375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:45:13 -0000 Author: freqlabs Date: Fri Jun 19 11:45:12 2020 New Revision: 362375 URL: https://svnweb.freebsd.org/changeset/base/362375 Log: MFC r362252: Apply default security flavor in vfs_export Reported by: npn Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25300 Modified: stable/12/sys/kern/vfs_export.c stable/12/sys/kern/vfs_mount.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/vfs_export.c stable/11/sys/kern/vfs_mount.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/kern/vfs_export.c ============================================================================== --- stable/12/sys/kern/vfs_export.c Fri Jun 19 11:32:42 2020 (r362374) +++ stable/12/sys/kern/vfs_export.c Fri Jun 19 11:45:12 2020 (r362375) @@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); #if defined(INET) || defined(INET6) @@ -309,7 +312,7 @@ vfs_export(struct mount *mp, struct export_args *argp) return (EINVAL); if ((argp->ex_flags & MNT_EXPORTED) != 0 && - (argp->ex_numsecflavors <= 0 + (argp->ex_numsecflavors < 0 || argp->ex_numsecflavors >= MAXSECFLAVORS)) return (EINVAL); @@ -346,6 +349,10 @@ vfs_export(struct mount *mp, struct export_args *argp) MNT_ILOCK(mp); mp->mnt_flag |= MNT_EXPUBLIC; MNT_IUNLOCK(mp); + } + if (argp->ex_numsecflavors == 0) { + argp->ex_numsecflavors = 1; + argp->ex_secflavors[0] = AUTH_SYS; } if ((error = vfs_hang_addrlist(mp, nep, argp))) goto out; Modified: stable/12/sys/kern/vfs_mount.c ============================================================================== --- stable/12/sys/kern/vfs_mount.c Fri Jun 19 11:32:42 2020 (r362374) +++ stable/12/sys/kern/vfs_mount.c Fri Jun 19 11:45:12 2020 (r362375) @@ -68,9 +68,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include - #include #include @@ -2050,18 +2047,13 @@ kernel_vmount(int flags, ...) * Convert the old export args format into new export args. * * The old export args struct does not have security flavors. Otherwise, the - * structs are identical. The default security flavor 'sys' is applied when - * the given args export the filesystem. + * structs are identical. The default security flavor 'sys' is applied by + * vfs_export when .ex_numsecflavors is 0. */ void vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp) { bcopy(oexp, exp, sizeof(*oexp)); - if (exp->ex_flags & MNT_EXPORTED) { - exp->ex_numsecflavors = 1; - exp->ex_secflavors[0] = AUTH_SYS; - } else { - exp->ex_numsecflavors = 0; - } + exp->ex_numsecflavors = 0; } From owner-svn-src-all@freebsd.org Fri Jun 19 11:45:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BD18348669; Fri, 19 Jun 2020 11:45:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pH6c6X07z3yCg; Fri, 19 Jun 2020 11:45:12 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCB001A8AC; Fri, 19 Jun 2020 11:45:12 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JBjCFu009865; Fri, 19 Jun 2020 11:45:12 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JBjCEQ009817; Fri, 19 Jun 2020 11:45:12 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202006191145.05JBjCEQ009817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 19 Jun 2020 11:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362375 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 362375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:45:13 -0000 Author: freqlabs Date: Fri Jun 19 11:45:12 2020 New Revision: 362375 URL: https://svnweb.freebsd.org/changeset/base/362375 Log: MFC r362252: Apply default security flavor in vfs_export Reported by: npn Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25300 Modified: stable/11/sys/kern/vfs_export.c stable/11/sys/kern/vfs_mount.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/kern/vfs_export.c stable/12/sys/kern/vfs_mount.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/kern/vfs_export.c ============================================================================== --- stable/11/sys/kern/vfs_export.c Fri Jun 19 11:32:42 2020 (r362374) +++ stable/11/sys/kern/vfs_export.c Fri Jun 19 11:45:12 2020 (r362375) @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); static struct radix_node_head *vfs_create_addrlist_af( @@ -303,7 +306,7 @@ vfs_export(struct mount *mp, struct export_args *argp) return (EINVAL); if ((argp->ex_flags & MNT_EXPORTED) != 0 && - (argp->ex_numsecflavors <= 0 + (argp->ex_numsecflavors < 0 || argp->ex_numsecflavors >= MAXSECFLAVORS)) return (EINVAL); @@ -340,6 +343,10 @@ vfs_export(struct mount *mp, struct export_args *argp) MNT_ILOCK(mp); mp->mnt_flag |= MNT_EXPUBLIC; MNT_IUNLOCK(mp); + } + if (argp->ex_numsecflavors == 0) { + argp->ex_numsecflavors = 1; + argp->ex_secflavors[0] = AUTH_SYS; } if ((error = vfs_hang_addrlist(mp, nep, argp))) goto out; Modified: stable/11/sys/kern/vfs_mount.c ============================================================================== --- stable/11/sys/kern/vfs_mount.c Fri Jun 19 11:32:42 2020 (r362374) +++ stable/11/sys/kern/vfs_mount.c Fri Jun 19 11:45:12 2020 (r362375) @@ -65,9 +65,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include - #include #include @@ -2056,18 +2053,13 @@ kernel_vmount(int flags, ...) * Convert the old export args format into new export args. * * The old export args struct does not have security flavors. Otherwise, the - * structs are identical. The default security flavor 'sys' is applied when - * the given args export the filesystem. + * structs are identical. The default security flavor 'sys' is applied by + * vfs_export when .ex_numsecflavors is 0. */ void vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp) { bcopy(oexp, exp, sizeof(*oexp)); - if (exp->ex_flags & MNT_EXPORTED) { - exp->ex_numsecflavors = 1; - exp->ex_secflavors[0] = AUTH_SYS; - } else { - exp->ex_numsecflavors = 0; - } + exp->ex_numsecflavors = 0; } From owner-svn-src-all@freebsd.org Fri Jun 19 11:47:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E7EC3489E2; Fri, 19 Jun 2020 11:47:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pH9T6hhYz3ySg; Fri, 19 Jun 2020 11:47:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E076D1A7C3; Fri, 19 Jun 2020 11:47:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JBlfj7010120; Fri, 19 Jun 2020 11:47:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JBlere010115; Fri, 19 Jun 2020 11:47:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191147.05JBlere010115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 11:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362376 - in stable/12/sys: amd64/amd64 dev/cpuctl x86/include x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 dev/cpuctl x86/include x86/x86 X-SVN-Commit-Revision: 362376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 11:47:42 -0000 Author: kib Date: Fri Jun 19 11:47:40 2020 New Revision: 362376 URL: https://svnweb.freebsd.org/changeset/base/362376 Log: MFC r362130: Control for Special Register Buffer Data Sampling mitigation. Modified: stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/amd64/amd64/machdep.c stable/12/sys/dev/cpuctl/cpuctl.c stable/12/sys/x86/include/x86_var.h stable/12/sys/x86/x86/cpu_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Fri Jun 19 11:45:12 2020 (r362375) +++ stable/12/sys/amd64/amd64/initcpu.c Fri Jun 19 11:47:40 2020 (r362376) @@ -270,6 +270,7 @@ initializecpu(void) hw_ibrs_recalculate(false); hw_ssb_recalculate(false); amd64_syscall_ret_flush_l1d_recalc(); + x86_rngds_mitg_recalculate(false); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: case CPU_VENDOR_HYGON: Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Fri Jun 19 11:45:12 2020 (r362375) +++ stable/12/sys/amd64/amd64/machdep.c Fri Jun 19 11:47:40 2020 (r362376) @@ -1794,6 +1794,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable); TUNABLE_INT_FETCH("machdep.mitigations.taa.enable", &x86_taa_enable); + TUNABLE_INT_FETCH("machdep.mitigations.rndgs.enable", + &x86_rngds_mitg_enable); + finishidentcpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ Modified: stable/12/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/12/sys/dev/cpuctl/cpuctl.c Fri Jun 19 11:45:12 2020 (r362375) +++ stable/12/sys/dev/cpuctl/cpuctl.c Fri Jun 19 11:47:40 2020 (r362376) @@ -547,6 +547,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td #endif hw_mds_recalculate(); x86_taa_recalculate(); + x86_rngds_mitg_recalculate(true); printcpuinfo(); return (0); } Modified: stable/12/sys/x86/include/x86_var.h ============================================================================== --- stable/12/sys/x86/include/x86_var.h Fri Jun 19 11:45:12 2020 (r362375) +++ stable/12/sys/x86/include/x86_var.h Fri Jun 19 11:47:40 2020 (r362376) @@ -89,6 +89,7 @@ extern int hw_mds_disable; extern int hw_ssb_active; extern int x86_taa_enable; extern int cpu_flush_rsb_ctxsw; +extern int x86_rngds_mitg_enable; struct pcb; struct thread; @@ -146,6 +147,7 @@ void hw_ibrs_recalculate(bool all_cpus); void hw_mds_recalculate(void); void hw_ssb_recalculate(bool all_cpus); void x86_taa_recalculate(void); +void x86_rngds_mitg_recalculate(bool all_cpus); void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame); void nmi_call_kdb_smp(u_int type, struct trapframe *frame); void nmi_handle_intr(u_int type, struct trapframe *frame); Modified: stable/12/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/12/sys/x86/x86/cpu_machdep.c Fri Jun 19 11:45:12 2020 (r362375) +++ stable/12/sys/x86/x86/cpu_machdep.c Fri Jun 19 11:47:40 2020 (r362376) @@ -1337,6 +1337,60 @@ SYSCTL_INT(_machdep_mitigations, OID_AUTO, flush_rsb_c CTLFLAG_RW | CTLFLAG_NOFETCH, &cpu_flush_rsb_ctxsw, 0, "Flush Return Stack Buffer on context switch"); +SYSCTL_NODE(_machdep_mitigations, OID_AUTO, rngds, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "MCU Optimization, disable RDSEED mitigation"); + +int x86_rngds_mitg_enable = 1; +void +x86_rngds_mitg_recalculate(bool all_cpus) +{ + if ((cpu_stdext_feature3 & CPUID_STDEXT3_MCUOPT) == 0) + return; + x86_msr_op(MSR_IA32_MCU_OPT_CTRL, + (x86_rngds_mitg_enable ? MSR_OP_OR : MSR_OP_ANDNOT) | + (all_cpus ? MSR_OP_RENDEZVOUS : MSR_OP_LOCAL), + IA32_RNGDS_MITG_DIS); +} + +static int +sysctl_rngds_mitg_enable_handler(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = x86_rngds_mitg_enable; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + x86_rngds_mitg_enable = val; + x86_rngds_mitg_recalculate(true); + return (0); +} +SYSCTL_PROC(_machdep_mitigations_rngds, OID_AUTO, enable, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, + sysctl_rngds_mitg_enable_handler, "I", + "MCU Optimization, disabling RDSEED mitigation control " + "(0 - mitigation disabled (RDSEED optimized), 1 - mitigation enabled"); + +static int +sysctl_rngds_state_handler(SYSCTL_HANDLER_ARGS) +{ + const char *state; + + if ((cpu_stdext_feature3 & CPUID_STDEXT3_MCUOPT) == 0) { + state = "Not applicable"; + } else if (x86_rngds_mitg_enable == 0) { + state = "RDSEED not serialized"; + } else { + state = "Mitigated"; + } + return (SYSCTL_OUT(req, state, strlen(state))); +} +SYSCTL_PROC(_machdep_mitigations_rngds, OID_AUTO, state, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_rngds_state_handler, "A", + "MCU Optimization state"); + /* * Enable and restore kernel text write permissions. * Callers must ensure that disable_wp()/restore_wp() are executed From owner-svn-src-all@freebsd.org Fri Jun 19 12:35:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F45734A271; Fri, 19 Jun 2020 12:35:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pJDf3BzNz42Tl; Fri, 19 Jun 2020 12:35:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 647C21B328; Fri, 19 Jun 2020 12:35:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JCZUrQ040587; Fri, 19 Jun 2020 12:35:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JCZTPB040584; Fri, 19 Jun 2020 12:35:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006191235.05JCZTPB040584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 19 Jun 2020 12:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362377 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 12:35:30 -0000 Author: tuexen Date: Fri Jun 19 12:35:29 2020 New Revision: 362377 URL: https://svnweb.freebsd.org/changeset/base/362377 Log: Remove last argument of sctp_addr_mgmt_ep_sa(), since it is not used. MFC after: 1 week Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_asconf.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Fri Jun 19 11:47:40 2020 (r362376) +++ head/sys/netinet/sctp_asconf.c Fri Jun 19 12:35:29 2020 (r362377) @@ -3165,7 +3165,7 @@ sctp_check_address_list(struct sctp_tcb *stcb, struct */ uint32_t sctp_addr_mgmt_ep_sa(struct sctp_inpcb *inp, struct sockaddr *sa, - uint32_t type, uint32_t vrf_id, struct sctp_ifa *sctp_ifap) + uint32_t type, uint32_t vrf_id) { struct sctp_ifa *ifa; struct sctp_laddr *laddr, *nladdr; @@ -3174,9 +3174,7 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb *inp, struct so SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EINVAL); return (EINVAL); } - if (sctp_ifap) { - ifa = sctp_ifap; - } else if (type == SCTP_ADD_IP_ADDRESS) { + if (type == SCTP_ADD_IP_ADDRESS) { /* For an add the address MUST be on the system */ ifa = sctp_find_ifa_by_addr(sa, vrf_id, SCTP_ADDR_NOT_LOCKED); } else if (type == SCTP_DEL_IP_ADDRESS) { Modified: head/sys/netinet/sctp_asconf.h ============================================================================== --- head/sys/netinet/sctp_asconf.h Fri Jun 19 11:47:40 2020 (r362376) +++ head/sys/netinet/sctp_asconf.h Fri Jun 19 12:35:29 2020 (r362377) @@ -56,8 +56,8 @@ sctp_handle_asconf_ack(struct mbuf *, int, struct sctp struct sctp_tcb *, struct sctp_nets *, int *); extern uint32_t -sctp_addr_mgmt_ep_sa(struct sctp_inpcb *, struct sockaddr *, - uint32_t, uint32_t, struct sctp_ifa *); +sctp_addr_mgmt_ep_sa(struct sctp_inpcb *, struct sockaddr *, uint32_t, + uint32_t); extern int Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Jun 19 11:47:40 2020 (r362376) +++ head/sys/netinet/sctputil.c Fri Jun 19 12:35:29 2020 (r362377) @@ -6804,8 +6804,7 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ } else if (lep == NULL) { ((struct sockaddr_in *)addr_touse)->sin_port = 0; *error = sctp_addr_mgmt_ep_sa(inp, addr_touse, - SCTP_ADD_IP_ADDRESS, - vrf_id, NULL); + SCTP_ADD_IP_ADDRESS, vrf_id); } else { *error = EADDRINUSE; } @@ -6896,8 +6895,7 @@ sctp_bindx_delete_address(struct sctp_inpcb *inp, if (assoc_id == 0) { /* delete the address */ *error = sctp_addr_mgmt_ep_sa(inp, addr_touse, - SCTP_DEL_IP_ADDRESS, - vrf_id, NULL); + SCTP_DEL_IP_ADDRESS, vrf_id); } else { /* * FIX: decide whether we allow assoc based bindx From owner-svn-src-all@freebsd.org Fri Jun 19 12:38:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3ABD734A909; Fri, 19 Jun 2020 12:38:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pJJ40MD2z42QD; Fri, 19 Jun 2020 12:38:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 076381B228; Fri, 19 Jun 2020 12:38:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JCcRfn040755; Fri, 19 Jun 2020 12:38:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JCcRr5040754; Fri, 19 Jun 2020 12:38:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191238.05JCcRr5040754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 12:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362378 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 362378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 12:38:28 -0000 Author: kib Date: Fri Jun 19 12:38:27 2020 New Revision: 362378 URL: https://svnweb.freebsd.org/changeset/base/362378 Log: MFC r362128: rtld: set osrel when in the direct exec mode. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Fri Jun 19 12:35:29 2020 (r362377) +++ stable/11/libexec/rtld-elf/rtld.c Fri Jun 19 12:38:27 2020 (r362378) @@ -366,9 +366,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr const char *binpath; caddr_t imgentry; char buf[MAXPATHLEN]; - int argc, fd, i, mib[2], phnum, rtld_argc; - size_t len; - bool dir_enable, explicit_fd, search_in_path; + int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc; + size_t len, sz; + bool dir_enable, direct_exec, explicit_fd, search_in_path; /* * On entry, the dynamic linker itself has not been relocated yet. @@ -427,6 +427,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr } trust = !issetugid(); + direct_exec = false; md_abi_variant_hook(aux_info); @@ -442,6 +443,21 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr argv0); rtld_die(); } + direct_exec = true; + + /* + * Set osrel for us, it is later reset to the binary' + * value before first instruction of code from the binary + * is executed. + */ + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_OSREL; + mib[3] = getpid(); + osrel = __FreeBSD_version; + sz = sizeof(old_osrel); + (void)sysctl(mib, 4, &old_osrel, &sz, &osrel, sizeof(osrel)); + dbg("opening main program in direct exec mode"); if (argc >= 2) { rtld_argc = parse_args(argv, argc, &search_in_path, &fd); @@ -772,6 +788,18 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr * init functions. */ pre_init(); + + if (direct_exec) { + /* Set osrel for direct-execed binary */ + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_OSREL; + mib[3] = getpid(); + osrel = obj_main->osrel; + sz = sizeof(old_osrel); + dbg("setting osrel to %d", osrel); + (void)sysctl(mib, 4, &old_osrel, &sz, &osrel, sizeof(osrel)); + } wlock_acquire(rtld_bind_lock, &lockstate); From owner-svn-src-all@freebsd.org Fri Jun 19 13:09:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBA7E34B0F0; Fri, 19 Jun 2020 13:09:00 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pJzJ4XFtz44Vh; Fri, 19 Jun 2020 13:09:00 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96CC31B760; Fri, 19 Jun 2020 13:09:00 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JD90KL059140; Fri, 19 Jun 2020 13:09:00 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JD90AK059139; Fri, 19 Jun 2020 13:09:00 GMT (envelope-from thj@FreeBSD.org) Message-Id: <202006191309.05JD90AK059139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Fri, 19 Jun 2020 13:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362379 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 362379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 13:09:00 -0000 Author: thj Date: Fri Jun 19 13:09:00 2020 New Revision: 362379 URL: https://svnweb.freebsd.org/changeset/base/362379 Log: Fix typo in apic.4 Reviewed by: bcr (manpages) Approved by: jtl (co-mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D25357 Modified: head/share/man/man4/apic.4 Modified: head/share/man/man4/apic.4 ============================================================================== --- head/share/man/man4/apic.4 Fri Jun 19 12:38:27 2020 (r362378) +++ head/share/man/man4/apic.4 Fri Jun 19 13:09:00 2020 (r362379) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2011 +.Dd June 19, 2020 .Dt APIC 4 .Os .Sh NAME @@ -64,7 +64,7 @@ they receive from peripheral buses to one or more loca .Pp Each local APIC includes one 32-bit programmable timer. This driver uses them to supply kernel with one event timer named "LAPIC". -Event timer provided by the driver supports both one-shot an periodic modes. +Event timer provided by the driver supports both one-shot and periodic modes. Because of local APIC nature it is per-CPU. The timer frequency is not reported by the platform and so automatically measured by the driver on the first use. From owner-svn-src-all@freebsd.org Fri Jun 19 13:46:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEE8334C0CA; Fri, 19 Jun 2020 13:46:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pKp741Y3z46Ch; Fri, 19 Jun 2020 13:46:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C7F61BAD9; Fri, 19 Jun 2020 13:46:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JDk7Es083462; Fri, 19 Jun 2020 13:46:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JDk7KW083461; Fri, 19 Jun 2020 13:46:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191346.05JDk7KW083461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 13:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362380 - stable/11/sys/x86/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/include X-SVN-Commit-Revision: 362380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 13:46:07 -0000 Author: kib Date: Fri Jun 19 13:46:06 2020 New Revision: 362380 URL: https://svnweb.freebsd.org/changeset/base/362380 Log: MFC r340716 (by bwidawsk): Add definitions for Intel Speed Shift. Modified: stable/11/sys/x86/include/specialreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/include/specialreg.h ============================================================================== --- stable/11/sys/x86/include/specialreg.h Fri Jun 19 13:09:00 2020 (r362379) +++ stable/11/sys/x86/include/specialreg.h Fri Jun 19 13:46:06 2020 (r362380) @@ -187,6 +187,12 @@ #define CPUTPM1_SENSOR 0x00000001 #define CPUTPM1_TURBO 0x00000002 #define CPUTPM1_ARAT 0x00000004 +#define CPUTPM1_HWP 0x00000080 +#define CPUTPM1_HWP_NOTIFICATION 0x00000100 +#define CPUTPM1_HWP_ACTIVITY_WINDOW 0x00000200 +#define CPUTPM1_HWP_PERF_PREF 0x00000400 +#define CPUTPM1_HWP_PKG 0x00000800 +#define CPUTPM1_HWP_FLEXIBLE 0x00020000 #define CPUTPM2_EFFREQ 0x00000001 /* @@ -519,7 +525,14 @@ #define MSR_DRAM_ENERGY_STATUS 0x619 #define MSR_PP0_ENERGY_STATUS 0x639 #define MSR_PP1_ENERGY_STATUS 0x641 +#define MSR_PPERF 0x64e #define MSR_TSC_DEADLINE 0x6e0 /* Writes are not serializing */ +#define MSR_IA32_PM_ENABLE 0x770 +#define MSR_IA32_HWP_CAPABILITIES 0x771 +#define MSR_IA32_HWP_REQUEST_PKG 0x772 +#define MSR_IA32_HWP_INTERRUPT 0x773 +#define MSR_IA32_HWP_REQUEST 0x774 +#define MSR_IA32_HWP_STATUS 0x777 /* * VMX MSRs @@ -616,6 +629,25 @@ /* MSR IA32_FLUSH_CMD */ #define IA32_FLUSH_CMD_L1D 0x00000001 + +/* MSR IA32_HWP_CAPABILITIES */ +#define IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x) (((x) >> 0) & 0xff) +#define IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(x) (((x) >> 8) & 0xff) +#define IA32_HWP_CAPABILITIES_EFFICIENT_PERFORMANCE(x) (((x) >> 16) & 0xff) +#define IA32_HWP_CAPABILITIES_LOWEST_PERFORMANCE(x) (((x) >> 24) & 0xff) + +/* MSR IA32_HWP_REQUEST */ +#define IA32_HWP_REQUEST_MINIMUM_VALID (1ULL << 63) +#define IA32_HWP_REQUEST_MAXIMUM_VALID (1ULL << 62) +#define IA32_HWP_REQUEST_DESIRED_VALID (1ULL << 61) +#define IA32_HWP_REQUEST_EPP_VALID (1ULL << 60) +#define IA32_HWP_REQUEST_ACTIVITY_WINDOW_VALID (1ULL << 59) +#define IA32_HWP_REQUEST_PACKAGE_CONTROL (1ULL << 42) +#define IA32_HWP_ACTIVITY_WINDOW (0x3ffULL << 32) +#define IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE (0xffULL << 24) +#define IA32_HWP_DESIRED_PERFORMANCE (0xffULL << 16) +#define IA32_HWP_REQUEST_MAXIMUM_PERFORMANCE (0xffULL << 8) +#define IA32_HWP_MINIMUM_PERFORMANCE (0xffULL << 0) /* * PAT modes. From owner-svn-src-all@freebsd.org Fri Jun 19 13:46:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97F4534C2B3; Fri, 19 Jun 2020 13:46:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pKpt3bnHz46Wv; Fri, 19 Jun 2020 13:46:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76E651BFA6; Fri, 19 Jun 2020 13:46:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JDkkic083543; Fri, 19 Jun 2020 13:46:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JDkkdO083542; Fri, 19 Jun 2020 13:46:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191346.05JDkkdO083542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 13:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362381 - in stable/11/sys/x86: include x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/x86: include x86 X-SVN-Commit-Revision: 362381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 13:46:46 -0000 Author: kib Date: Fri Jun 19 13:46:45 2020 New Revision: 362381 URL: https://svnweb.freebsd.org/changeset/base/362381 Log: MFC r348130 (by cem): Decode and name additional x86 feature bits. Modified: stable/11/sys/x86/include/specialreg.h stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/include/specialreg.h ============================================================================== --- stable/11/sys/x86/include/specialreg.h Fri Jun 19 13:46:06 2020 (r362380) +++ stable/11/sys/x86/include/specialreg.h Fri Jun 19 13:46:45 2020 (r362381) @@ -381,29 +381,41 @@ /* * CPUID instruction 7 Structured Extended Features, leaf 0 ecx info */ -#define CPUID_STDEXT2_PREFETCHWT1 0x00000001 -#define CPUID_STDEXT2_UMIP 0x00000004 -#define CPUID_STDEXT2_PKU 0x00000008 -#define CPUID_STDEXT2_OSPKE 0x00000010 -#define CPUID_STDEXT2_WAITPKG 0x00000020 -#define CPUID_STDEXT2_GFNI 0x00000100 -#define CPUID_STDEXT2_RDPID 0x00400000 -#define CPUID_STDEXT2_CLDEMOTE 0x02000000 -#define CPUID_STDEXT2_MOVDIRI 0x08000000 +#define CPUID_STDEXT2_PREFETCHWT1 0x00000001 +#define CPUID_STDEXT2_AVX512VBMI 0x00000002 +#define CPUID_STDEXT2_UMIP 0x00000004 +#define CPUID_STDEXT2_PKU 0x00000008 +#define CPUID_STDEXT2_OSPKE 0x00000010 +#define CPUID_STDEXT2_WAITPKG 0x00000020 +#define CPUID_STDEXT2_AVX512VBMI2 0x00000040 +#define CPUID_STDEXT2_GFNI 0x00000100 +#define CPUID_STDEXT2_VAES 0x00000200 +#define CPUID_STDEXT2_VPCLMULQDQ 0x00000400 +#define CPUID_STDEXT2_AVX512VNNI 0x00000800 +#define CPUID_STDEXT2_AVX512BITALG 0x00001000 +#define CPUID_STDEXT2_AVX512VPOPCNTDQ 0x00004000 +#define CPUID_STDEXT2_RDPID 0x00400000 +#define CPUID_STDEXT2_CLDEMOTE 0x02000000 +#define CPUID_STDEXT2_MOVDIRI 0x08000000 #define CPUID_STDEXT2_MOVDIRI64B 0x10000000 -#define CPUID_STDEXT2_SGXLC 0x40000000 +#define CPUID_STDEXT2_ENQCMD 0x20000000 +#define CPUID_STDEXT2_SGXLC 0x40000000 /* * CPUID instruction 7 Structured Extended Features, leaf 0 edx info */ -#define CPUID_STDEXT3_MD_CLEAR 0x00000400 -#define CPUID_STDEXT3_TSXFA 0x00002000 -#define CPUID_STDEXT3_IBPB 0x04000000 -#define CPUID_STDEXT3_STIBP 0x08000000 -#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 -#define CPUID_STDEXT3_ARCH_CAP 0x20000000 -#define CPUID_STDEXT3_CORE_CAP 0x40000000 -#define CPUID_STDEXT3_SSBD 0x80000000 +#define CPUID_STDEXT3_AVX5124VNNIW 0x00000004 +#define CPUID_STDEXT3_AVX5124FMAPS 0x00000008 +#define CPUID_STDEXT3_AVX512VP2INTERSECT 0x00000100 +#define CPUID_STDEXT3_MD_CLEAR 0x00000400 +#define CPUID_STDEXT3_TSXFA 0x00002000 +#define CPUID_STDEXT3_PCONFIG 0x00040000 +#define CPUID_STDEXT3_IBPB 0x04000000 +#define CPUID_STDEXT3_STIBP 0x08000000 +#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 +#define CPUID_STDEXT3_ARCH_CAP 0x20000000 +#define CPUID_STDEXT3_CORE_CAP 0x40000000 +#define CPUID_STDEXT3_SSBD 0x80000000 /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Fri Jun 19 13:46:06 2020 (r362380) +++ stable/11/sys/x86/x86/identcpu.c Fri Jun 19 13:46:45 2020 (r362381) @@ -978,11 +978,18 @@ printcpuinfo(void) "\004PKU" "\005OSPKE" "\006WAITPKG" + "\007AVX512VBMI2" "\011GFNI" + "\012VAES" + "\013VPCLMULQDQ" + "\014AVX512VNNI" + "\015AVX512BITALG" + "\016AVX512VPOPCNTDQ" "\027RDPID" "\032CLDEMOTE" "\034MOVDIRI" "\035MOVDIRI64B" + "\036ENQCMD" "\037SGXLC" ); } @@ -991,8 +998,12 @@ printcpuinfo(void) printf("\n Structured Extended Features3=0x%b", cpu_stdext_feature3, "\020" + "\003AVX512_4VNNIW" + "\004AVX512_4FMAPS" + "\011AVX512VP2INTERSECT" "\013MD_CLEAR" "\016TSXFA" + "\023PCONFIG" "\033IBPB" "\034STIBP" "\035L1DFL" From owner-svn-src-all@freebsd.org Fri Jun 19 13:47:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3353F34C2BC; Fri, 19 Jun 2020 13:47:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pKqx0ZPTz46kB; Fri, 19 Jun 2020 13:47:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EF741BC50; Fri, 19 Jun 2020 13:47:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JDleqD083640; Fri, 19 Jun 2020 13:47:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JDlemL083638; Fri, 19 Jun 2020 13:47:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191347.05JDlemL083638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 13:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362382 - in stable/11/sys/x86: include x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/x86: include x86 X-SVN-Commit-Revision: 362382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 13:47:41 -0000 Author: kib Date: Fri Jun 19 13:47:40 2020 New Revision: 362382 URL: https://svnweb.freebsd.org/changeset/base/362382 Log: MFC r362129: x86: add bits definitions for SRBDS mitigation control. Modified: stable/11/sys/x86/include/specialreg.h stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/include/specialreg.h ============================================================================== --- stable/11/sys/x86/include/specialreg.h Fri Jun 19 13:46:45 2020 (r362381) +++ stable/11/sys/x86/include/specialreg.h Fri Jun 19 13:47:40 2020 (r362382) @@ -407,6 +407,7 @@ #define CPUID_STDEXT3_AVX5124VNNIW 0x00000004 #define CPUID_STDEXT3_AVX5124FMAPS 0x00000008 #define CPUID_STDEXT3_AVX512VP2INTERSECT 0x00000100 +#define CPUID_STDEXT3_MCUOPT 0x00000200 #define CPUID_STDEXT3_MD_CLEAR 0x00000400 #define CPUID_STDEXT3_TSXFA 0x00002000 #define CPUID_STDEXT3_PCONFIG 0x00040000 @@ -484,6 +485,7 @@ #define MSR_BBL_CR_BUSY 0x11b #define MSR_BBL_CR_CTL3 0x11e #define MSR_IA32_TSX_CTRL 0x122 +#define MSR_IA32_MCU_OPT_CTRL 0x123 #define MSR_SYSENTER_CS_MSR 0x174 #define MSR_SYSENTER_ESP_MSR 0x175 #define MSR_SYSENTER_EIP_MSR 0x176 @@ -641,6 +643,9 @@ /* MSR IA32_FLUSH_CMD */ #define IA32_FLUSH_CMD_L1D 0x00000001 + +/* MSR IA32_MCU_OPT_CTRL */ +#define IA32_RNGDS_MITG_DIS 0x00000001 /* MSR IA32_HWP_CAPABILITIES */ #define IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x) (((x) >> 0) & 0xff) Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Fri Jun 19 13:46:45 2020 (r362381) +++ stable/11/sys/x86/x86/identcpu.c Fri Jun 19 13:47:40 2020 (r362382) @@ -1001,6 +1001,7 @@ printcpuinfo(void) "\003AVX512_4VNNIW" "\004AVX512_4FMAPS" "\011AVX512VP2INTERSECT" + "\012MCUOPT" "\013MD_CLEAR" "\016TSXFA" "\023PCONFIG" From owner-svn-src-all@freebsd.org Fri Jun 19 13:48:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C21C34C0F9; Fri, 19 Jun 2020 13:48:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pKrm3hkrz46f9; Fri, 19 Jun 2020 13:48:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 785591BDB9; Fri, 19 Jun 2020 13:48:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JDmOHL083742; Fri, 19 Jun 2020 13:48:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JDmNgx083737; Fri, 19 Jun 2020 13:48:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006191348.05JDmNgx083737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jun 2020 13:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362383 - in stable/11/sys: amd64/amd64 dev/cpuctl x86/include x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 dev/cpuctl x86/include x86/x86 X-SVN-Commit-Revision: 362383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 13:48:24 -0000 Author: kib Date: Fri Jun 19 13:48:23 2020 New Revision: 362383 URL: https://svnweb.freebsd.org/changeset/base/362383 Log: MFC r362130: Control for Special Register Buffer Data Sampling mitigation. Modified: stable/11/sys/amd64/amd64/initcpu.c stable/11/sys/amd64/amd64/machdep.c stable/11/sys/dev/cpuctl/cpuctl.c stable/11/sys/x86/include/x86_var.h stable/11/sys/x86/x86/cpu_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/11/sys/amd64/amd64/initcpu.c Fri Jun 19 13:47:40 2020 (r362382) +++ stable/11/sys/amd64/amd64/initcpu.c Fri Jun 19 13:48:23 2020 (r362383) @@ -261,6 +261,7 @@ initializecpu(void) } hw_ibrs_recalculate(false); hw_ssb_recalculate(false); + x86_rngds_mitg_recalculate(false); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: init_amd(); Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Fri Jun 19 13:47:40 2020 (r362382) +++ stable/11/sys/amd64/amd64/machdep.c Fri Jun 19 13:48:23 2020 (r362383) @@ -1727,6 +1727,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable); TUNABLE_INT_FETCH("machdep.mitigations.taa.enable", &x86_taa_enable); + TUNABLE_INT_FETCH("machdep.mitigations.rndgs.enable", + &x86_rngds_mitg_enable); + finishidentcpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ initializecpucache(); Modified: stable/11/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/11/sys/dev/cpuctl/cpuctl.c Fri Jun 19 13:47:40 2020 (r362382) +++ stable/11/sys/dev/cpuctl/cpuctl.c Fri Jun 19 13:48:23 2020 (r362383) @@ -544,6 +544,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td #endif hw_mds_recalculate(); x86_taa_recalculate(); + x86_rngds_mitg_recalculate(true); printcpuinfo(); return (0); } Modified: stable/11/sys/x86/include/x86_var.h ============================================================================== --- stable/11/sys/x86/include/x86_var.h Fri Jun 19 13:47:40 2020 (r362382) +++ stable/11/sys/x86/include/x86_var.h Fri Jun 19 13:48:23 2020 (r362383) @@ -87,6 +87,7 @@ extern int hw_mds_disable; extern int hw_ssb_active; extern int x86_taa_enable; extern int cpu_flush_rsb_ctxsw; +extern int x86_rngds_mitg_enable; struct pcb; struct thread; @@ -140,6 +141,7 @@ void hw_ibrs_recalculate(bool all_cpus); void hw_mds_recalculate(void); void hw_ssb_recalculate(bool all_cpus); void x86_taa_recalculate(void); +void x86_rngds_mitg_recalculate(bool all_cpus); void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame); void nmi_call_kdb_smp(u_int type, struct trapframe *frame); void nmi_handle_intr(u_int type, struct trapframe *frame); Modified: stable/11/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/11/sys/x86/x86/cpu_machdep.c Fri Jun 19 13:47:40 2020 (r362382) +++ stable/11/sys/x86/x86/cpu_machdep.c Fri Jun 19 13:48:23 2020 (r362383) @@ -1364,3 +1364,57 @@ int __read_frequently cpu_flush_rsb_ctxsw; SYSCTL_INT(_machdep_mitigations, OID_AUTO, flush_rsb_ctxsw, CTLFLAG_RW | CTLFLAG_NOFETCH, &cpu_flush_rsb_ctxsw, 0, "Flush Return Stack Buffer on context switch"); + +SYSCTL_NODE(_machdep_mitigations, OID_AUTO, rngds, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "MCU Optimization, disable RDSEED mitigation"); + +int x86_rngds_mitg_enable = 1; +void +x86_rngds_mitg_recalculate(bool all_cpus) +{ + if ((cpu_stdext_feature3 & CPUID_STDEXT3_MCUOPT) == 0) + return; + x86_msr_op(MSR_IA32_MCU_OPT_CTRL, + (x86_rngds_mitg_enable ? MSR_OP_OR : MSR_OP_ANDNOT) | + (all_cpus ? MSR_OP_RENDEZVOUS : MSR_OP_LOCAL), + IA32_RNGDS_MITG_DIS); +} + +static int +sysctl_rngds_mitg_enable_handler(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = x86_rngds_mitg_enable; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + x86_rngds_mitg_enable = val; + x86_rngds_mitg_recalculate(true); + return (0); +} +SYSCTL_PROC(_machdep_mitigations_rngds, OID_AUTO, enable, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, + sysctl_rngds_mitg_enable_handler, "I", + "MCU Optimization, disabling RDSEED mitigation control " + "(0 - mitigation disabled (RDSEED optimized), 1 - mitigation enabled"); + +static int +sysctl_rngds_state_handler(SYSCTL_HANDLER_ARGS) +{ + const char *state; + + if ((cpu_stdext_feature3 & CPUID_STDEXT3_MCUOPT) == 0) { + state = "Not applicable"; + } else if (x86_rngds_mitg_enable == 0) { + state = "RDSEED not serialized"; + } else { + state = "Mitigated"; + } + return (SYSCTL_OUT(req, state, strlen(state))); +} +SYSCTL_PROC(_machdep_mitigations_rngds, OID_AUTO, state, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_rngds_state_handler, "A", + "MCU Optimization state"); From owner-svn-src-all@freebsd.org Fri Jun 19 14:28:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24F4034DB17; Fri, 19 Jun 2020 14:28:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pLlY0CQPz4BSm; Fri, 19 Jun 2020 14:28:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 027321C632; Fri, 19 Jun 2020 14:28:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JESuZS009288; Fri, 19 Jun 2020 14:28:56 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JESuGC009287; Fri, 19 Jun 2020 14:28:56 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191428.05JESuGC009287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 14:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362384 - head/sys/modules/dtb/mv X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/modules/dtb/mv X-SVN-Commit-Revision: 362384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 14:28:57 -0000 Author: mmel Date: Fri Jun 19 14:28:56 2020 New Revision: 362384 URL: https://svnweb.freebsd.org/changeset/base/362384 Log: Add DTB files for ARMADA 8040 based boards. MFC after: 2 weeks Modified: head/sys/modules/dtb/mv/Makefile Modified: head/sys/modules/dtb/mv/Makefile ============================================================================== --- head/sys/modules/dtb/mv/Makefile Fri Jun 19 13:48:23 2020 (r362383) +++ head/sys/modules/dtb/mv/Makefile Fri Jun 19 14:28:56 2020 (r362384) @@ -7,7 +7,11 @@ DTS= \ armada-388-gp.dts .elif ${MACHINE_ARCH} == "aarch64" DTS= \ - marvell/armada-3720-espressobin.dts + marvell/armada-3720-espressobin.dts \ + marvell/armada-8040-clearfog-gt-8k.dts \ + marvell/armada-8040-db \ + marvell/armada-8040-mcbin.dts \ + marvell/armada-8040-mcbin-singleshot.dts .endif .include From owner-svn-src-all@freebsd.org Fri Jun 19 15:08:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2ADC334F40F; Fri, 19 Jun 2020 15:08:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pMdV0Kwwz4GWN; Fri, 19 Jun 2020 15:08:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:403:e9be:84e2:c1f9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 69135133CD; Fri, 19 Jun 2020 15:08:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r362126 - head/sys/vm To: cem@freebsd.org Cc: Eric van Gyzen , src-committers , svn-src-all , svn-src-head References: <202006122153.05CLr8JN091722@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <68fedb9b-04a1-5d52-34e5-ff32800c7eeb@FreeBSD.org> Date: Fri, 19 Jun 2020 08:08:43 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 15:08:46 -0000 On 6/18/20 10:53 AM, Conrad Meyer wrote: > On Thu, Jun 18, 2020 at 10:19 AM John Baldwin wrote: >> >> On 6/17/20 5:48 PM, Conrad Meyer wrote: >>> db_printf checks the pager, via db_putc. >> >> It doesn't break out of the loops for you though (e.g. via setjmp or the >> like). Commands still have to check db_pager_quit directly if they wish >> to abort early to honor a user entering 'q' at the pager prompt. > > It does for Ctrl-C, but not 'q', true. It could easily do the same > for 'q' as Ctrl-C: db_error(NULL) => kdb_reenter_silent(). That's only safe if commands are always idempotent. Some commands can use try locks (though they really shouldn't). Having printf() auto-convert is potentially worse for this as it affects doing a 'call' of an arbitrary function (which is likely not written to be safe for DDB). Though that's already a bit fraught with dragons since any nested panic already does the longjmp. We skip locking (though only somewhat, you can "unlock" a lock held by the interrupted code in your thread by calling a function). It may be that having 'q' longjmp is ok and wouldn't really be more fragile than what is already there. That is still orthogonal to your patch (which is printf -> db_printf in effect) (and so 2 separate things to consider). -- John Baldwin From owner-svn-src-all@freebsd.org Fri Jun 19 15:21:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE8BA34F836; Fri, 19 Jun 2020 15:21:33 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pMwF5YW3z4HRf; Fri, 19 Jun 2020 15:21:33 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D801CFF5; Fri, 19 Jun 2020 15:21:33 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JFLXga042812; Fri, 19 Jun 2020 15:21:33 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JFLXgr042809; Fri, 19 Jun 2020 15:21:33 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191521.05JFLXgr042809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 15:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362385 - in head/sys: arm/mv conf X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm/mv conf X-SVN-Commit-Revision: 362385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 15:21:33 -0000 Author: mmel Date: Fri Jun 19 15:21:33 2020 New Revision: 362385 URL: https://svnweb.freebsd.org/changeset/base/362385 Log: Add specialized gpio driver for ARMADA 8k SoC. Older marvell gpio blocks are to different for reusing/enhancing existing frivers. MFC after: 2 weeks Added: head/sys/arm/mv/mvebu_gpio.c (contents, props changed) Modified: head/sys/arm/mv/gpio.c head/sys/conf/files.arm64 Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Fri Jun 19 14:28:56 2020 (r362384) +++ head/sys/arm/mv/gpio.c Fri Jun 19 15:21:33 2020 (r362385) @@ -60,9 +60,6 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" -#ifdef __aarch64__ -#include "opt_soc.h" -#endif #define GPIO_MAX_INTR_COUNT 8 #define GPIO_PINS_PER_REG 32 @@ -199,9 +196,6 @@ EARLY_DRIVER_MODULE(mv_gpio, simplebus, mv_gpio_driver struct ofw_compat_data compat_data[] = { { "mrvl,gpio", 1 }, { "marvell,orion-gpio", 1 }, -#ifdef SOC_MARVELL_8K - { "marvell,armada-8k-gpio", 1 }, -#endif { NULL, 0 } }; Added: head/sys/arm/mv/mvebu_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/mvebu_gpio.c Fri Jun 19 15:21:33 2020 (r362385) @@ -0,0 +1,869 @@ +/*- + * Copyright (c) 2020 Michal Meloun + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ARMADA 8040 GPIO driver. + */ +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include "pic_if.h" +#include "syscon_if.h" + +#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define GPIO_LOCK_INIT(_sc) mtx_init(&_sc->mtx, \ + device_get_nameunit(_sc->dev), "mvebu_gpio", MTX_DEF) +#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->mtx); +#define GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED); +#define GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->mtx, MA_NOTOWNED); + +#define GPIO_DATA_OUT 0x00 +#define GPIO_CONTROL 0x04 +#define GPIO_BLINK_ENA 0x08 +#define GPIO_DATA_IN_POL 0x0C +#define GPIO_DATA_IN 0x10 +#define GPIO_INT_CAUSE 0x14 +#define GPIO_INT_MASK 0x18 +#define GPIO_INT_LEVEL_MASK 0x1C +#define GPIO_CONTROL_SET 0x28 +#define GPIO_CONTROL_CLR 0x2C +#define GPIO_DATA_SET 0x30 +#define GPIO_DATA_CLR 0x34 + +#define GPIO_BIT(_p) ((_p) % 32) +#define GPIO_REGNUM(_p) ((_p) / 32) + +#define MV_GPIO_MAX_NIRQS 4 +#define MV_GPIO_MAX_NPINS 32 + +#define RD4(sc, reg) SYSCON_READ_4((sc)->syscon, (reg)) +#define WR4(sc, reg, val) SYSCON_WRITE_4((sc)->syscon, (reg), (val)) + +struct mvebu_gpio_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + bool is_level; + bool is_inverted; +}; + +struct mvebu_gpio_softc; +struct mvebu_gpio_irq_cookie { + struct mvebu_gpio_softc *sc; + int bank_num; +}; + +struct mvebu_gpio_softc { + device_t dev; + device_t busdev; + struct mtx mtx; + struct syscon *syscon; + uint32_t offset; + struct resource *irq_res[MV_GPIO_MAX_NIRQS]; + void *irq_ih[MV_GPIO_MAX_NIRQS]; + struct mvebu_gpio_irq_cookie irq_cookies[MV_GPIO_MAX_NIRQS]; + int gpio_npins; + struct gpio_pin gpio_pins[MV_GPIO_MAX_NPINS]; + struct mvebu_gpio_irqsrc *isrcs; +}; + +static struct ofw_compat_data compat_data[] = { + {"marvell,armada-8k-gpio", 1}, + {NULL, 0} +}; + +/* -------------------------------------------------------------------------- + * + * GPIO + * + */ +static inline void +gpio_write(struct mvebu_gpio_softc *sc, bus_size_t reg, + struct gpio_pin *pin, uint32_t val) +{ + uint32_t tmp; + int bit; + + bit = GPIO_BIT(pin->gp_pin); + tmp = 0x100 << bit; /* mask */ + tmp |= (val & 1) << bit; /* value */ + SYSCON_WRITE_4(sc->syscon, sc->offset + GPIO_REGNUM(pin->gp_pin) + reg, + tmp); +} + +static inline uint32_t +gpio_read(struct mvebu_gpio_softc *sc, bus_size_t reg, struct gpio_pin *pin) +{ + int bit; + uint32_t val; + + bit = GPIO_BIT(pin->gp_pin); + val = SYSCON_READ_4(sc->syscon, + sc->offset + GPIO_REGNUM(pin->gp_pin) + reg); + return (val >> bit) & 1; +} + +static void +mvebu_gpio_pin_configure(struct mvebu_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + + if ((flags & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) == 0) + return; + + /* Manage input/output */ + pin->gp_flags &= ~(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + gpio_write(sc, GPIO_CONTROL_SET, pin, 1); + } else { + pin->gp_flags |= GPIO_PIN_INPUT; + gpio_write(sc, GPIO_CONTROL_CLR, pin, 1); + } +} + +static device_t +mvebu_gpio_get_bus(device_t dev) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + return (sc->busdev); +} + +static int +mvebu_gpio_pin_max(device_t dev, int *maxpin) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + *maxpin = sc->gpio_npins - 1; + return (0); +} + +static int +mvebu_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->gpio_npins) + return (EINVAL); + + *caps = sc->gpio_pins[pin].gp_caps; + + return (0); +} + +static int +mvebu_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->gpio_npins) + return (EINVAL); + + *flags = sc->gpio_pins[pin].gp_flags; + + return (0); +} + +static int +mvebu_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->gpio_npins) + return (EINVAL); + + memcpy(name, sc->gpio_pins[pin].gp_name, GPIOMAXNAME); + + return (0); +} + +static int +mvebu_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->gpio_npins) + return (EINVAL); + + + mvebu_gpio_pin_configure(sc, &sc->gpio_pins[pin], flags); + + return (0); +} + +static int +mvebu_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->gpio_npins) + return (EINVAL); + + if (value != 0) + gpio_write(sc, GPIO_DATA_SET, &sc->gpio_pins[pin], 1); + else + gpio_write(sc, GPIO_DATA_CLR, &sc->gpio_pins[pin], 1); + + return (0); +} + +static int +mvebu_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + *val = gpio_read(sc, GPIO_DATA_IN, &sc->gpio_pins[pin]); + *val ^= gpio_read(sc, GPIO_DATA_IN_POL, &sc->gpio_pins[pin]); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +mvebu_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct mvebu_gpio_softc *sc; + uint32_t val; + + sc = device_get_softc(dev); + if (pin >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + mvebu_gpio_pin_get(sc->dev, pin, &val); + if (val != 0) + gpio_write(sc, GPIO_DATA_CLR, &sc->gpio_pins[pin], 1); + else + gpio_write(sc, GPIO_DATA_SET, &sc->gpio_pins[pin], 1); + GPIO_UNLOCK(sc); + + return (0); +} + + +/* -------------------------------------------------------------------------- + * + * Interrupts + * + */ +static inline void +intr_modify(struct mvebu_gpio_softc *sc, bus_addr_t reg, + struct mvebu_gpio_irqsrc *mgi, uint32_t val, uint32_t mask) +{ + int bit; + + bit = GPIO_BIT(mgi->irq); + GPIO_LOCK(sc); + val = SYSCON_MODIFY_4(sc->syscon, + sc->offset + GPIO_REGNUM(mgi->irq) + reg, val, mask); + GPIO_UNLOCK(sc); +} + +static inline void +mvebu_gpio_isrc_mask(struct mvebu_gpio_softc *sc, + struct mvebu_gpio_irqsrc *mgi, uint32_t val) +{ + + if (mgi->is_level) + intr_modify(sc, GPIO_INT_LEVEL_MASK, mgi, val, 1); + else + intr_modify(sc, GPIO_INT_MASK, mgi, val, 1); +} + +static inline void +mvebu_gpio_isrc_eoi(struct mvebu_gpio_softc *sc, + struct mvebu_gpio_irqsrc *mgi) +{ + + if (!mgi->is_level) + intr_modify(sc, GPIO_INT_CAUSE, mgi, 1, 1); +} + + +static int +mvebu_gpio_pic_attach(struct mvebu_gpio_softc *sc) +{ + int rv; + uint32_t irq; + const char *name; + + sc->isrcs = malloc(sizeof(*sc->isrcs) * sc->gpio_npins, M_DEVBUF, + M_WAITOK | M_ZERO); + + name = device_get_nameunit(sc->dev); + for (irq = 0; irq < sc->gpio_npins; irq++) { + sc->isrcs[irq].irq = irq; + sc->isrcs[irq].is_level = false; + sc->isrcs[irq].is_inverted = false; + rv = intr_isrc_register(&sc->isrcs[irq].isrc, + sc->dev, 0, "%s,%u", name, irq); + if (rv != 0) + return (rv); /* XXX deregister ISRCs */ + } + if (intr_pic_register(sc->dev, + OF_xref_from_node(ofw_bus_get_node(sc->dev))) == NULL) + return (ENXIO); + + return (0); +} + +static int +mvebu_gpio_pic_detach(struct mvebu_gpio_softc *sc) +{ + + /* + * There has not been established any procedure yet + * how to detach PIC from living system correctly. + */ + device_printf(sc->dev, "%s: not implemented yet\n", __func__); + return (EBUSY); +} + + +static void +mvebu_gpio_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct mvebu_gpio_softc *sc; + struct mvebu_gpio_irqsrc *mgi; + + sc = device_get_softc(dev); + mgi = (struct mvebu_gpio_irqsrc *)isrc; + mvebu_gpio_isrc_mask(sc, mgi, 0); +} + +static void +mvebu_gpio_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct mvebu_gpio_softc *sc; + struct mvebu_gpio_irqsrc *mgi; + + sc = device_get_softc(dev); + mgi = (struct mvebu_gpio_irqsrc *)isrc; + mvebu_gpio_isrc_mask(sc, mgi, 1); +} + +static int +mvebu_gpio_pic_map_fdt(struct mvebu_gpio_softc *sc, u_int ncells, + pcell_t *cells, u_int *irqp, bool *invertedp, bool *levelp) +{ + bool inverted, level; + + /* + * The first cell is the interrupt number. + * The second cell is used to specify flags: + * bits[3:0] trigger type and level flags: + * 1 = low-to-high edge triggered. + * 2 = high-to-low edge triggered. + * 4 = active high level-sensitive. + * 8 = active low level-sensitive. + */ + if (ncells != 2 || cells[0] >= sc->gpio_npins) + return (EINVAL); + + + switch (cells[1]) { + case 1: + inverted = false; + level = false; + break; + case 2: + inverted = true; + level = false; + break; + case 4: + inverted = false; + level = true; + break; + case 8: + inverted = true; + level = true; + break; + default: + return (EINVAL); + } + *irqp = cells[0]; + if (invertedp != NULL) + *invertedp = inverted; + if (levelp != NULL) + *levelp = level; + return (0); +} + + +static int +mvebu_gpio_pic_map_gpio(struct mvebu_gpio_softc *sc, u_int gpio_pin_num, + u_int gpio_pin_flags, u_int intr_mode, u_int *irqp, bool *invertedp, + bool *levelp) +{ + bool inverted, level; + + if (gpio_pin_num >= sc->gpio_npins) + return (EINVAL); + + switch (intr_mode) { + case GPIO_INTR_LEVEL_LOW: + inverted = true; + level = true; + break; + case GPIO_INTR_LEVEL_HIGH: + inverted = false; + level = true; + break; + case GPIO_INTR_CONFORM: + case GPIO_INTR_EDGE_RISING: + inverted = false; + level = false; + break; + case GPIO_INTR_EDGE_FALLING: + inverted = true; + level = false; + break; + default: + return (EINVAL); + } + *irqp = gpio_pin_num; + if (invertedp != NULL) + *invertedp = inverted; + if (levelp != NULL) + *levelp = level; + return (0); +} + +static int +mvebu_gpio_pic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + int rv; + u_int irq; + struct mvebu_gpio_softc *sc; + + sc = device_get_softc(dev); + + if (data->type == INTR_MAP_DATA_FDT) { + struct intr_map_data_fdt *daf; + + daf = (struct intr_map_data_fdt *)data; + rv = mvebu_gpio_pic_map_fdt(sc, daf->ncells, daf->cells, &irq, + NULL, NULL); + } else if (data->type == INTR_MAP_DATA_GPIO) { + struct intr_map_data_gpio *dag; + + dag = (struct intr_map_data_gpio *)data; + rv = mvebu_gpio_pic_map_gpio(sc, dag->gpio_pin_num, + dag->gpio_pin_flags, dag->gpio_intr_mode, &irq, NULL, NULL); + } else + return (ENOTSUP); + + if (rv == 0) + *isrcp = &sc->isrcs[irq].isrc; + return (rv); +} + +static void +mvebu_gpio_pic_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct mvebu_gpio_softc *sc; + struct mvebu_gpio_irqsrc *mgi; + + sc = device_get_softc(dev); + mgi = (struct mvebu_gpio_irqsrc *)isrc; + if (mgi->is_level) + mvebu_gpio_isrc_eoi(sc, mgi); +} + +static void +mvebu_gpio_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct mvebu_gpio_softc *sc; + struct mvebu_gpio_irqsrc *mgi; + + sc = device_get_softc(dev); + mgi = (struct mvebu_gpio_irqsrc *)isrc; + mvebu_gpio_isrc_mask(sc, mgi, 1); +} + +static void +mvebu_gpio_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct mvebu_gpio_softc *sc; + struct mvebu_gpio_irqsrc *mgi; + + sc = device_get_softc(dev); + mgi = (struct mvebu_gpio_irqsrc *)isrc; + + mvebu_gpio_isrc_mask(sc, mgi, 0); + if (mgi->is_level) + mvebu_gpio_isrc_eoi(sc, mgi); +} + +static int +mvebu_gpio_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + u_int irq; + bool inverted, level; + int rv; + struct mvebu_gpio_softc *sc; + struct mvebu_gpio_irqsrc *mgi; + + sc = device_get_softc(dev); + mgi = (struct mvebu_gpio_irqsrc *)isrc; + + if (data == NULL) + return (ENOTSUP); + + /* Get and check config for an interrupt. */ + if (data->type == INTR_MAP_DATA_FDT) { + struct intr_map_data_fdt *daf; + + daf = (struct intr_map_data_fdt *)data; + rv = mvebu_gpio_pic_map_fdt(sc, daf->ncells, daf->cells, &irq, + &inverted, &level); + } else if (data->type == INTR_MAP_DATA_GPIO) { + struct intr_map_data_gpio *dag; + + dag = (struct intr_map_data_gpio *)data; + rv = mvebu_gpio_pic_map_gpio(sc, dag->gpio_pin_num, + dag->gpio_pin_flags, dag->gpio_intr_mode, &irq, + &inverted, &level); + } else + return (ENOTSUP); + + if (rv != 0) + return (EINVAL); + + /* + * If this is a setup for another handler, + * only check that its configuration match. + */ + if (isrc->isrc_handlers != 0) + return ( + mgi->is_level == level && mgi->is_inverted == inverted ? + 0 : EINVAL); + + mgi->is_level = level; + mgi->is_inverted = inverted; + intr_modify(sc, GPIO_DATA_IN_POL, mgi, inverted ? 1 : 0, 1); + mvebu_gpio_pic_enable_intr(dev, isrc); + + return (0); +} + +static int +mvebu_gpio_pic_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct mvebu_gpio_softc *sc; + struct mvebu_gpio_irqsrc *mgi; + + sc = device_get_softc(dev); + mgi = (struct mvebu_gpio_irqsrc *)isrc; + + if (isrc->isrc_handlers == 0) + mvebu_gpio_isrc_mask(sc, mgi, 0); + return (0); +} + +/* -------------------------------------------------------------------------- + * + * Bus + * + */ + +static int +mvebu_gpio_intr(void *arg) +{ + u_int i, lvl, edge; + struct mvebu_gpio_softc *sc; + struct trapframe *tf; + struct mvebu_gpio_irqsrc *mgi; + struct mvebu_gpio_irq_cookie *cookie; + + + cookie = (struct mvebu_gpio_irq_cookie *)arg; + sc = cookie->sc; + tf = curthread->td_intr_frame; + + for (i = 0; i < sc->gpio_npins; i++) { + lvl = gpio_read(sc, GPIO_DATA_IN, &sc->gpio_pins[i]); + lvl &= gpio_read(sc, GPIO_INT_LEVEL_MASK, &sc->gpio_pins[i]); + edge = gpio_read(sc, GPIO_DATA_IN, &sc->gpio_pins[i]); + edge &= gpio_read(sc, GPIO_INT_LEVEL_MASK, &sc->gpio_pins[i]); + if (edge == 0 || lvl == 0) + continue; + + mgi = &sc->isrcs[i]; + if (!mgi->is_level) + mvebu_gpio_isrc_eoi(sc, mgi); + if (intr_isrc_dispatch(&mgi->isrc, tf) != 0) { + mvebu_gpio_isrc_mask(sc, mgi, 0); + if (mgi->is_level) + mvebu_gpio_isrc_eoi(sc, mgi); + device_printf(sc->dev, + "Stray irq %u disabled\n", mgi->irq); + } + } + return (FILTER_HANDLED); +} + +static int +mvebu_gpio_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Marvell Integrated GPIO Controller"); + return (0); +} + +static int +mvebu_gpio_detach(device_t dev) +{ + struct mvebu_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + + KASSERT(mtx_initialized(&sc->mtx), ("gpio mutex not initialized")); + + for (i = 0; i < MV_GPIO_MAX_NIRQS; i++) { + if (sc->irq_ih[i] != NULL) + bus_teardown_intr(dev, sc->irq_res[i], sc->irq_ih[i]); + } + + if (sc->isrcs != NULL) + mvebu_gpio_pic_detach(sc); + + gpiobus_detach_bus(dev); + + for (i = 0; i < MV_GPIO_MAX_NIRQS; i++) { + if (sc->irq_res[i] != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->irq_res[i]); + } + GPIO_LOCK_DESTROY(sc); + + return(0); +} + +static int +mvebu_gpio_attach(device_t dev) +{ + struct mvebu_gpio_softc *sc; + phandle_t node; + struct gpio_pin *pin; + pcell_t pincnt; + int i, rv, rid; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + GPIO_LOCK_INIT(sc); + + pincnt = 0; + rv = OF_getencprop(node, "ngpios", &pincnt, sizeof(pcell_t)); + if (rv < 0) { + device_printf(dev, + "ERROR: no pin-count or ngpios entry found!\n"); + return (ENXIO); + } + + sc->gpio_npins = MIN(pincnt, MV_GPIO_MAX_NPINS); + if (bootverbose) + device_printf(dev, + "%d pins available\n", sc->gpio_npins); + + rv = OF_getencprop(node, "offset", &sc->offset, sizeof(sc->offset)); + if (rv == -1) { + device_printf(dev, "ERROR: no 'offset' property found!\n"); + return (ENXIO); + } + + if (SYSCON_GET_HANDLE(sc->dev, &sc->syscon) != 0 || + sc->syscon == NULL) { + device_printf(dev, "ERROR: cannot get syscon handle!\n"); + return (ENXIO); + } + + /* Allocate interrupts. */ + for (i = 0; i < MV_GPIO_MAX_NIRQS; i++) { + sc->irq_cookies[i].sc = sc; + sc->irq_cookies[i].bank_num = i; + rid = i; + sc->irq_res[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_ACTIVE); + if (sc->irq_res[i] == NULL) + break; + if ((bus_setup_intr(dev, sc->irq_res[i], + INTR_TYPE_MISC | INTR_MPSAFE, mvebu_gpio_intr, NULL, + &sc->irq_cookies[i], &sc->irq_ih[i]))) { + device_printf(dev, + "WARNING: unable to register interrupt handler\n"); + mvebu_gpio_detach(dev); + return (ENXIO); + } + } + + /* Init GPIO pins */ + for (i = 0; i < sc->gpio_npins; i++) { + pin = sc->gpio_pins + i; + pin->gp_pin = i; + if (sc->irq_res[0] != NULL) + pin->gp_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | + GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | + GPIO_INTR_EDGE_RISING | GPIO_INTR_EDGE_FALLING; + else + pin->gp_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + pin->gp_flags = + gpio_read(sc, GPIO_CONTROL, &sc->gpio_pins[i]) != 0 ? + GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; + snprintf(pin->gp_name, GPIOMAXNAME, "gpio%d", i); + + /* Init HW */ + gpio_write(sc, GPIO_INT_MASK, pin, 0); + gpio_write(sc, GPIO_INT_LEVEL_MASK, pin, 0); + gpio_write(sc, GPIO_INT_CAUSE, pin, 1); + gpio_write(sc, GPIO_DATA_IN_POL, pin, 1); + gpio_write(sc, GPIO_BLINK_ENA, pin, 0); + } + + if (sc->irq_res[0] != NULL) { + rv = mvebu_gpio_pic_attach(sc); + if (rv != 0) { + device_printf(dev, "WARNING: unable to attach PIC\n"); + mvebu_gpio_detach(dev); + return (rv); + } + } + + sc->busdev = gpiobus_attach_bus(dev); + if (sc->busdev == NULL) { + mvebu_gpio_detach(dev); + return (ENXIO); + } + + return (bus_generic_attach(dev)); +} + +static int +mvebu_gpio_map_gpios(device_t dev, phandle_t pdev, phandle_t gparent, + int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + + if (gcells != 2) + return (ERANGE); + *pin = gpios[0]; + *flags= gpios[1]; + return (0); +} + +static phandle_t +mvebu_gpio_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the GPIO bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + +static device_method_t mvebu_gpio_methods[] = { + DEVMETHOD(device_probe, mvebu_gpio_probe), + DEVMETHOD(device_attach, mvebu_gpio_attach), + DEVMETHOD(device_detach, mvebu_gpio_detach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, mvebu_gpio_pic_disable_intr), + DEVMETHOD(pic_enable_intr, mvebu_gpio_pic_enable_intr), + DEVMETHOD(pic_map_intr, mvebu_gpio_pic_map_intr), + DEVMETHOD(pic_setup_intr, mvebu_gpio_pic_setup_intr), + DEVMETHOD(pic_teardown_intr, mvebu_gpio_pic_teardown_intr), + DEVMETHOD(pic_post_filter, mvebu_gpio_pic_post_filter), + DEVMETHOD(pic_post_ithread, mvebu_gpio_pic_post_ithread), + DEVMETHOD(pic_pre_ithread, mvebu_gpio_pic_pre_ithread), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, mvebu_gpio_get_bus), + DEVMETHOD(gpio_pin_max, mvebu_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, mvebu_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, mvebu_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, mvebu_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, mvebu_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, mvebu_gpio_pin_get), + DEVMETHOD(gpio_pin_set, mvebu_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, mvebu_gpio_pin_toggle), + DEVMETHOD(gpio_map_gpios, mvebu_gpio_map_gpios), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, mvebu_gpio_get_node), + + DEVMETHOD_END +}; + +static devclass_t mvebu_gpio_devclass; +static DEFINE_CLASS_0(gpio, mvebu_gpio_driver, mvebu_gpio_methods, + sizeof(struct mvebu_gpio_softc)); +EARLY_DRIVER_MODULE(gpio, simplebus, mvebu_gpio_driver, + mvebu_gpio_devclass, NULL, NULL, + BUS_PASS_TIMER + BUS_PASS_ORDER_LAST); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Jun 19 14:28:56 2020 (r362384) +++ head/sys/conf/files.arm64 Fri Jun 19 15:21:33 2020 (r362385) @@ -111,6 +111,7 @@ arm/mv/a37x0_iic.c optional a37x0_iic iicbus fdt arm/mv/a37x0_spi.c optional a37x0_spi spibus fdt arm/mv/armada38x/armada38x_rtc.c optional mv_rtc fdt arm/mv/gpio.c optional mv_gpio fdt +arm/mv/mvebu_gpio.c optional mv_gpio fdt arm/mv/mvebu_pinctrl.c optional mvebu_pinctrl fdt arm/mv/mv_ap806_clock.c optional SOC_MARVELL_8K fdt arm/mv/mv_ap806_gicp.c optional mv_ap806_gicp fdt From owner-svn-src-all@freebsd.org Fri Jun 19 15:32:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0903F34FF36; Fri, 19 Jun 2020 15:32:56 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pN9M6SP9z4JnV; Fri, 19 Jun 2020 15:32:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8B341D587; Fri, 19 Jun 2020 15:32:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JFWt3L052166; Fri, 19 Jun 2020 15:32:55 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JFWttZ052165; Fri, 19 Jun 2020 15:32:55 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191532.05JFWttZ052165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 15:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362386 - head/sys/arm/mv/armada38x X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm/mv/armada38x X-SVN-Commit-Revision: 362386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 15:32:56 -0000 Author: mmel Date: Fri Jun 19 15:32:55 2020 New Revision: 362386 URL: https://svnweb.freebsd.org/changeset/base/362386 Log: Add specific stub for ARMADA 8k SoC to Marvell RTC driver. The AXI bridge is different between ARMADA 38x and 8K, and both platforms needs specific setup to mitigate HW issues with accessing RTC registers. MFC after: 2 weeks Modified: head/sys/arm/mv/armada38x/armada38x_rtc.c Modified: head/sys/arm/mv/armada38x/armada38x_rtc.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x_rtc.c Fri Jun 19 15:21:33 2020 (r362385) +++ head/sys/arm/mv/armada38x/armada38x_rtc.c Fri Jun 19 15:32:55 2020 (r362386) @@ -72,14 +72,27 @@ __FBSDID("$FreeBSD$"); #define MV_RTC_LOCK(sc) mtx_lock_spin(&(sc)->mutex) #define MV_RTC_UNLOCK(sc) mtx_unlock_spin(&(sc)->mutex) -#define RTC_BRIDGE_TIMING_CTRL 0x0 -#define RTC_WRCLK_PERIOD_SHIFT 0 -#define RTC_WRCLK_PERIOD_MASK 0x00000003FF -#define RTC_WRCLK_PERIOD_MAX 0x3FF -#define RTC_READ_OUTPUT_DELAY_SHIFT 26 -#define RTC_READ_OUTPUT_DELAY_MASK 0x007C000000 -#define RTC_READ_OUTPUT_DELAY_MAX 0x1F +#define A38X_RTC_BRIDGE_TIMING_CTRL 0x0 +#define A38X_RTC_WRCLK_PERIOD_SHIFT 0 +#define A38X_RTC_WRCLK_PERIOD_MASK 0x00000003FF +#define A38X_RTC_WRCLK_PERIOD_MAX 0x3FF +#define A38X_RTC_READ_OUTPUT_DELAY_SHIFT 26 +#define A38X_RTC_READ_OUTPUT_DELAY_MASK 0x007C000000 +#define A38X_RTC_READ_OUTPUT_DELAY_MAX 0x1F +#define A8K_RTC_BRIDGE_TIMING_CTRL0 0x0 +#define A8K_RTC_WRCLK_PERIOD_SHIFT 0 +#define A8K_RTC_WRCLK_PERIOD_MASK 0x000000FFFF +#define A8K_RTC_WRCLK_PERIOD_VAL 0x3FF +#define A8K_RTC_WRCLK_SETUP_SHIFT 16 +#define A8K_RTC_WRCLK_SETUP_MASK 0x00FFFF0000 +#define A8K_RTC_WRCLK_SETUP_VAL 29 +#define A8K_RTC_BRIDGE_TIMING_CTRL1 0x4 +#define A8K_RTC_READ_OUTPUT_DELAY_SHIFT 0 +#define A8K_RTC_READ_OUTPUT_DELAY_MASK 0x000000FFFF +#define A8K_RTC_READ_OUTPUT_DELAY_VAL 0x3F + + #define RTC_RES 0 #define RTC_SOC_RES 1 @@ -94,6 +107,7 @@ struct mv_rtc_softc { device_t dev; struct resource *res[2]; struct mtx mutex; + int rtc_type; }; static int mv_rtc_probe(device_t dev); @@ -107,7 +121,8 @@ static inline uint32_t mv_rtc_reg_read(struct mv_rtc_s bus_size_t off); static inline int mv_rtc_reg_write(struct mv_rtc_softc *sc, bus_size_t off, uint32_t val); -static inline void mv_rtc_configure_bus(struct mv_rtc_softc *sc); +static inline void mv_rtc_configure_bus_a38x(struct mv_rtc_softc *sc); +static inline void mv_rtc_configure_bus_a8k(struct mv_rtc_softc *sc); static device_method_t mv_rtc_methods[] = { DEVMETHOD(device_probe, mv_rtc_probe), @@ -126,10 +141,13 @@ static driver_t mv_rtc_driver = { sizeof(struct mv_rtc_softc), }; +#define RTC_A38X 1 +#define RTC_A8K 2 + static struct ofw_compat_data mv_rtc_compat[] = { - {"marvell,armada-380-rtc", true}, - {"marvell,armada-8k-rtc", true}, - {NULL, false}, + {"marvell,armada-380-rtc", RTC_A38X}, + {"marvell,armada-8k-rtc", RTC_A8K}, + {NULL, 0}, }; static devclass_t mv_rtc_devclass; @@ -198,20 +216,29 @@ mv_rtc_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->rtc_type = ofw_bus_search_compatible(dev, mv_rtc_compat)->ocd_data; - clock_register(dev, RTC_RES_US); - mtx_init(&sc->mutex, device_get_nameunit(dev), NULL, MTX_SPIN); ret = bus_alloc_resources(dev, res_spec, sc->res); - if (ret != 0) { device_printf(dev, "could not allocate resources\n"); mtx_destroy(&sc->mutex); return (ENXIO); } - mv_rtc_configure_bus(sc); + switch (sc->rtc_type) { + case RTC_A38X: + mv_rtc_configure_bus_a38x(sc); + break; + case RTC_A8K: + mv_rtc_configure_bus_a8k(sc); + break; + default: + panic("Unknown RTC type: %d", sc->rtc_type); + } + clock_register(dev, RTC_RES_US); + return (0); } @@ -239,13 +266,15 @@ mv_rtc_gettime(device_t dev, struct timespec *ts) MV_RTC_LOCK(sc); /* - * According to HW Errata if more than one second between - * two time reads is detected, then read once again + * According to HW Errata, if more than one second is detected + * between two time reads, then at least one of the reads gave + * an invalid value. */ - val = mv_rtc_reg_read(sc, RTC_TIME); - val_check = mv_rtc_reg_read(sc, RTC_TIME); - if (val_check - val > 1) + do { + val = mv_rtc_reg_read(sc, RTC_TIME); + DELAY(100); val_check = mv_rtc_reg_read(sc, RTC_TIME); + } while ((val_check - val) > 1); MV_RTC_UNLOCK(sc); @@ -284,7 +313,6 @@ mv_rtc_settime(device_t dev, struct timespec *ts) mv_rtc_reg_write(sc, RTC_STATUS, 0x0); mv_rtc_reg_write(sc, RTC_STATUS, 0x0); mv_rtc_reg_write(sc, RTC_TIME, ts->tv_sec); - MV_RTC_UNLOCK(sc); return (0); @@ -313,13 +341,30 @@ mv_rtc_reg_write(struct mv_rtc_softc *sc, bus_size_t o } static inline void -mv_rtc_configure_bus(struct mv_rtc_softc *sc) +mv_rtc_configure_bus_a38x(struct mv_rtc_softc *sc) { int val; - val = bus_read_4(sc->res[RTC_SOC_RES], RTC_BRIDGE_TIMING_CTRL); - val &= ~(RTC_WRCLK_PERIOD_MASK | RTC_READ_OUTPUT_DELAY_MASK); - val |= RTC_WRCLK_PERIOD_MAX << RTC_WRCLK_PERIOD_SHIFT; - val |= RTC_READ_OUTPUT_DELAY_MAX << RTC_READ_OUTPUT_DELAY_SHIFT; - bus_write_4(sc->res[RTC_SOC_RES], RTC_BRIDGE_TIMING_CTRL, val); + val = bus_read_4(sc->res[RTC_SOC_RES], A38X_RTC_BRIDGE_TIMING_CTRL); + val &= ~(A38X_RTC_WRCLK_PERIOD_MASK | A38X_RTC_READ_OUTPUT_DELAY_MASK); + val |= A38X_RTC_WRCLK_PERIOD_MAX << A38X_RTC_WRCLK_PERIOD_SHIFT; + val |= A38X_RTC_READ_OUTPUT_DELAY_MAX << A38X_RTC_READ_OUTPUT_DELAY_SHIFT; + bus_write_4(sc->res[RTC_SOC_RES], A38X_RTC_BRIDGE_TIMING_CTRL, val); +} + +static inline void +mv_rtc_configure_bus_a8k(struct mv_rtc_softc *sc) +{ + int val; + + val = bus_read_4(sc->res[RTC_SOC_RES], A8K_RTC_BRIDGE_TIMING_CTRL0); + val &= ~(A8K_RTC_WRCLK_PERIOD_MASK | A8K_RTC_WRCLK_SETUP_MASK); + val |= A8K_RTC_WRCLK_PERIOD_VAL << A8K_RTC_WRCLK_PERIOD_SHIFT; + val |= A8K_RTC_WRCLK_SETUP_VAL << A8K_RTC_WRCLK_SETUP_SHIFT; + bus_write_4(sc->res[RTC_SOC_RES], A8K_RTC_BRIDGE_TIMING_CTRL1, val); + + val = bus_read_4(sc->res[RTC_SOC_RES], A8K_RTC_BRIDGE_TIMING_CTRL0); + val &= ~A8K_RTC_READ_OUTPUT_DELAY_MASK; + val |= A8K_RTC_READ_OUTPUT_DELAY_VAL << A8K_RTC_READ_OUTPUT_DELAY_SHIFT; + bus_write_4(sc->res[RTC_SOC_RES], A8K_RTC_BRIDGE_TIMING_CTRL1, val); } From owner-svn-src-all@freebsd.org Fri Jun 19 15:33:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E831734FCF7; Fri, 19 Jun 2020 15:33:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pNB85s7Xz4JrY; Fri, 19 Jun 2020 15:33:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:403:e9be:84e2:c1f9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 46582133E3; Fri, 19 Jun 2020 15:33:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r362338 - in head: share/man/man4 sys/conf sys/kern sys/netinet sys/netinet6 sys/netipsec sys/netpfil/pf To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006181932.05IJWZYH009560@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 19 Jun 2020 08:33:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202006181932.05IJWZYH009560@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 15:33:37 -0000 On 6/18/20 12:32 PM, Mark Johnston wrote: > Author: markj > Date: Thu Jun 18 19:32:34 2020 > New Revision: 362338 > URL: https://svnweb.freebsd.org/changeset/base/362338 > > Log: > Add the SCTP_SUPPORT kernel option. > > This is in preparation for enabling a loadable SCTP stack. Analogous to > IPSEC/IPSEC_SUPPORT, the SCTP_SUPPORT kernel option must be configured > in order to support a loadable SCTP implementation. > > Discussed with: tuexen > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation Do you want to add similar handling to sys/conf/config.mk that we have for IPsec? Also, do we want to avoid building sctp.ko if it is in the kernel like we do for ipsec.ko and/or only build it if the kernel contains SCTP_SUPPORT? (For ipsec.ko we had to do that as it wouldn't compile, not sure if the same is true for sctp.ko) -- John Baldwin From owner-svn-src-all@freebsd.org Fri Jun 19 16:15:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AD1A331B75; Fri, 19 Jun 2020 16:15:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pP630rrhz4Rqv; Fri, 19 Jun 2020 16:15:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 174F51DE1C; Fri, 19 Jun 2020 16:15:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JGF6rt082047; Fri, 19 Jun 2020 16:15:06 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JGF66H082046; Fri, 19 Jun 2020 16:15:06 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191615.05JGF66H082046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 16:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362387 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 362387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 16:15:07 -0000 Author: mmel Date: Fri Jun 19 16:15:06 2020 New Revision: 362387 URL: https://svnweb.freebsd.org/changeset/base/362387 Log: Improve DesignWare PCIe driver: - only normal memory window is mandatory, prefetchable memory and I/O windows should be optional - full PCIe configuration space is supported - remove duplicated check from function for accessing configuration space. It is already contained in pci_dw_check_dev() MFC after: 2 weeks Modified: head/sys/dev/pci/pci_dw.c Modified: head/sys/dev/pci/pci_dw.c ============================================================================== --- head/sys/dev/pci/pci_dw.c Fri Jun 19 15:32:55 2020 (r362386) +++ head/sys/dev/pci/pci_dw.c Fri Jun 19 16:15:06 2020 (r362387) @@ -156,7 +156,7 @@ pci_dw_check_dev(struct pci_dw_softc *sc, u_int bus, u int rv; if (bus < sc->bus_start || bus > sc->bus_end || slot > PCI_SLOTMAX || - func > PCI_FUNCMAX || reg > PCI_REGMAX) + func > PCI_FUNCMAX || reg > PCIE_REGMAX) return (false); /* link is needed for access to all non-root busses */ @@ -234,7 +234,7 @@ pci_dw_setup_hw(struct pci_dw_softc *sc) return (rv); /* If we have enouht viewports ..*/ - if (sc->num_viewport >= 3) { + if (sc->num_viewport >= 3 && sc->io_range.size != 0) { /* Setup outbound I/O window */ rv = pci_dw_map_out_atu(sc, 0, IATU_CTRL1_TYPE_MEM, sc->io_range.host, sc->io_range.pci, sc->io_range.size); @@ -345,7 +345,7 @@ pci_dw_decode_ranges(struct pci_dw_softc *sc, struct o } } } - if ((sc->io_range.size == 0) || (sc->mem_range.size == 0)) { + if (sc->mem_range.size == 0) { device_printf(sc->dev, " Not all required ranges are found in DT\n"); return (ENXIO); @@ -375,10 +375,6 @@ pci_dw_read_config(device_t dev, u_int bus, u_int slot if (!pci_dw_check_dev(sc, bus, slot, func, reg)) return (0xFFFFFFFFU); - if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || - (reg > PCI_REGMAX)) - return (0xFFFFFFFFU); - if (bus == sc->root_bus) { res = (sc->dbi_res); } else { @@ -424,10 +420,6 @@ pci_dw_write_config(device_t dev, u_int bus, u_int slo sc = device_get_softc(dev); if (!pci_dw_check_dev(sc, bus, slot, func, reg)) - return; - - if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || - (reg > PCI_REGMAX)) return; if (bus == sc->root_bus) { From owner-svn-src-all@freebsd.org Fri Jun 19 16:26:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F4633322EF; Fri, 19 Jun 2020 16:26:43 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pPMR1wFwz4SGm; Fri, 19 Jun 2020 16:26:43 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38AB11D867; Fri, 19 Jun 2020 16:26:43 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JGQhPv088474; Fri, 19 Jun 2020 16:26:43 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JGQhfY088473; Fri, 19 Jun 2020 16:26:43 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191626.05JGQhfY088473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 16:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362388 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 362388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 16:26:43 -0000 Author: mmel Date: Fri Jun 19 16:26:42 2020 New Revision: 362388 URL: https://svnweb.freebsd.org/changeset/base/362388 Log: Use native-sized accesses when accessing memory from kdb. Not all MMIO mapped devices supports byte access. MFC after: 4 weeks Modified: head/sys/arm64/arm64/db_interface.c Modified: head/sys/arm64/arm64/db_interface.c ============================================================================== --- head/sys/arm64/arm64/db_interface.c Fri Jun 19 16:15:06 2020 (r362387) +++ head/sys/arm64/arm64/db_interface.c Fri Jun 19 16:26:42 2020 (r362388) @@ -118,12 +118,25 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat void *prev_jb; const char *src; int ret; + uint64_t tmp64; + uint32_t tmp32; + uint16_t tmp16; prev_jb = kdb_jmpbuf(jb); ret = setjmp(jb); if (ret == 0) { src = (const char *)addr; + if (size == 8 && (addr & 7) == 0) { + tmp64 = *((const int *)src); + src = (const char *)&tmp64; + } else if (size == 4 && (addr & 3) == 0) { + tmp32 = *((const int *)src); + src = (const char *)&tmp32; + } else if (size == 2 && (addr & 1) == 0) { + tmp16 = *((const short *)src); + src = (const char *)&tmp16; + } while (size-- > 0) *data++ = *src++; } @@ -142,14 +155,33 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da void *prev_jb; char *dst; int ret; + uint64_t tmp64; + uint32_t tmp32; + uint16_t tmp16; prev_jb = kdb_jmpbuf(jb); ret = setjmp(jb); if (ret == 0) { - dst = (char *)addr; - while (size-- > 0) - *dst++ = *data++; - + if (size == 8 && (addr & 7) == 0) { + dst = (char *)&tmp64; + while (size-- > 0) + *dst++ = *data++; + *((uint64_t *)addr) = tmp64; + } else if (size == 4 && (addr & 3) == 0) { + dst = (char *)&tmp32; + while (size-- > 0) + *dst++ = *data++; + *((uint32_t *)addr) = tmp32; + } else if (size == 2 && (addr & 1) == 0) { + dst = (char *)&tmp16; + while (size-- > 0) + *dst++ = *data++; + *((uint32_t *)addr) = tmp16; + } else { + dst = (char *)addr; + while (size-- > 0) + *dst++ = *data++; + } dsb(ish); /* Clean D-cache and invalidate I-cache */ From owner-svn-src-all@freebsd.org Fri Jun 19 17:25:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 624AE3338BA; Fri, 19 Jun 2020 17:25:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pQgl229Hz4WlS; Fri, 19 Jun 2020 17:25:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 410251EB95; Fri, 19 Jun 2020 17:25:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHPtO1025352; Fri, 19 Jun 2020 17:25:55 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHPt5V025351; Fri, 19 Jun 2020 17:25:55 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191725.05JHPt5V025351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 17:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362389 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 362389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:25:55 -0000 Author: mmel Date: Fri Jun 19 17:25:54 2020 New Revision: 362389 URL: https://svnweb.freebsd.org/changeset/base/362389 Log: diff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c index 06a29fefbdd..571fc00f6c1 100644 --- a/sys/dev/pci/pci_dw_mv.c +++ b/sys/dev/pci/pci_dw_mv.c @@ -64,15 +64,11 @@ __FBSDID("$FreeBSD$"); #define MV_GLOBAL_CONTROL_REG 0x8000 #define PCIE_APP_LTSSM_EN (1 << 2) -//#define PCIE_DEVICE_TYPE_SHIFT 4 -//#define PCIE_DEVICE_TYPE_MASK 0xF -//#define PCIE_DEVICE_TYPE_RC 0x4/ #define MV_GLOBAL_STATUS_REG 0x8008 #define MV_STATUS_RDLH_LINK_UP (1 << 1) #define MV_STATUS_PHY_LINK_UP (1 << 9) - #define MV_INT_CAUSE1 0x801C #define MV_INT_MASK1 0x8020 #define INT_A_ASSERT_MASK (1 << 9) @@ -90,11 +86,7 @@ __FBSDID("$FreeBSD$"); #define MV_ARUSER_REG 0x805C #define MV_AWUSER_REG 0x8060 - - #define MV_MAX_LANES 8 - - struct pci_mv_softc { struct pci_dw_softc dw_sc; device_t dev; @@ -112,7 +104,6 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0}, }; - static int pci_mv_phy_init(struct pci_mv_softc *sc) { @@ -121,18 +112,23 @@ pci_mv_phy_init(struct pci_mv_softc *sc) for (i = 0; i < MV_MAX_LANES; i++) { rv = phy_get_by_ofw_idx(sc->dev, sc->node, i, &(sc->phy[i])); if (rv != 0 && rv != ENOENT) { - device_printf(sc->dev, "Cannot get phy[%d]\n", i); - goto fail; - } - if (sc->phy[i] == NULL) - continue; - rv = phy_enable(sc->phy[i]); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable phy[%d]\n", i); - goto fail; - } - } - return (0); + device_printf(sc->dev, "Cannot get phy[%d]\n", i); +/* XXX revert when phy driver will be implemented */ +#if 0 + goto fail; +#else + continue; +#endif + } + if (sc->phy[i] == NULL) + continue; + rv = phy_enable(sc->phy[i]); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable phy[%d]\n", i); + goto fail; + } + } + return (0); fail: for (i = 0; i < MV_MAX_LANES; i++) { @@ -173,13 +169,14 @@ pci_mv_init(struct pci_mv_softc *sc) /* Enable local interrupts */ pci_dw_dbi_wr4(sc->dev, DW_MSI_INTR0_MASK, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0xFFFFFFFF); - pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFF); + pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFD); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, 0xFFFFFFFF); /* Errors have own interrupt, not yet populated in DTt */ pci_dw_dbi_wr4(sc->dev, MV_ERR_INT_MASK, 0); } + static int pci_mv_intr(void *arg) { struct pci_mv_softc *sc = arg; @@ -188,8 +185,6 @@ static int pci_mv_intr(void *arg) /* Ack all interrups */ cause1 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE1); cause2 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE2); - if (cause1 == 0 || cause2 == 0) - return(FILTER_STRAY); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, cause1); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, cause2); Modified: head/sys/dev/pci/pci_dw_mv.c Modified: head/sys/dev/pci/pci_dw_mv.c ============================================================================== --- head/sys/dev/pci/pci_dw_mv.c Fri Jun 19 16:26:42 2020 (r362388) +++ head/sys/dev/pci/pci_dw_mv.c Fri Jun 19 17:25:54 2020 (r362389) @@ -64,15 +64,11 @@ __FBSDID("$FreeBSD$"); #define MV_GLOBAL_CONTROL_REG 0x8000 #define PCIE_APP_LTSSM_EN (1 << 2) -//#define PCIE_DEVICE_TYPE_SHIFT 4 -//#define PCIE_DEVICE_TYPE_MASK 0xF -//#define PCIE_DEVICE_TYPE_RC 0x4/ #define MV_GLOBAL_STATUS_REG 0x8008 #define MV_STATUS_RDLH_LINK_UP (1 << 1) #define MV_STATUS_PHY_LINK_UP (1 << 9) - #define MV_INT_CAUSE1 0x801C #define MV_INT_MASK1 0x8020 #define INT_A_ASSERT_MASK (1 << 9) @@ -90,11 +86,7 @@ __FBSDID("$FreeBSD$"); #define MV_ARUSER_REG 0x805C #define MV_AWUSER_REG 0x8060 - - #define MV_MAX_LANES 8 - - struct pci_mv_softc { struct pci_dw_softc dw_sc; device_t dev; @@ -112,7 +104,6 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0}, }; - static int pci_mv_phy_init(struct pci_mv_softc *sc) { @@ -121,18 +112,23 @@ pci_mv_phy_init(struct pci_mv_softc *sc) for (i = 0; i < MV_MAX_LANES; i++) { rv = phy_get_by_ofw_idx(sc->dev, sc->node, i, &(sc->phy[i])); if (rv != 0 && rv != ENOENT) { - device_printf(sc->dev, "Cannot get phy[%d]\n", i); - goto fail; - } - if (sc->phy[i] == NULL) - continue; - rv = phy_enable(sc->phy[i]); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable phy[%d]\n", i); - goto fail; - } - } - return (0); + device_printf(sc->dev, "Cannot get phy[%d]\n", i); +/* XXX revert when phy driver will be implemented */ +#if 0 + goto fail; +#else + continue; +#endif + } + if (sc->phy[i] == NULL) + continue; + rv = phy_enable(sc->phy[i]); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable phy[%d]\n", i); + goto fail; + } + } + return (0); fail: for (i = 0; i < MV_MAX_LANES; i++) { @@ -173,13 +169,14 @@ pci_mv_init(struct pci_mv_softc *sc) /* Enable local interrupts */ pci_dw_dbi_wr4(sc->dev, DW_MSI_INTR0_MASK, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0xFFFFFFFF); - pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFF); + pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFD); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, 0xFFFFFFFF); /* Errors have own interrupt, not yet populated in DTt */ pci_dw_dbi_wr4(sc->dev, MV_ERR_INT_MASK, 0); } + static int pci_mv_intr(void *arg) { struct pci_mv_softc *sc = arg; @@ -188,8 +185,6 @@ static int pci_mv_intr(void *arg) /* Ack all interrups */ cause1 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE1); cause2 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE2); - if (cause1 == 0 || cause2 == 0) - return(FILTER_STRAY); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, cause1); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, cause2); @@ -325,4 +320,4 @@ DEFINE_CLASS_1(pcib, pci_mv_driver, pci_mv_methods, sizeof(struct pci_mv_softc), pci_dw_driver); static devclass_t pci_mv_devclass; DRIVER_MODULE( pci_mv, simplebus, pci_mv_driver, pci_mv_devclass, - NULL, NULL); \ No newline at end of file + NULL, NULL); From owner-svn-src-all@freebsd.org Fri Jun 19 17:32:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD3B2333D7E; Fri, 19 Jun 2020 17:32:30 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pQqL58kVz4XBy; Fri, 19 Jun 2020 17:32:30 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC3641E9DE; Fri, 19 Jun 2020 17:32:30 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHWUTR031160; Fri, 19 Jun 2020 17:32:30 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHWUSl031158; Fri, 19 Jun 2020 17:32:30 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202006191732.05JHWUSl031158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 19 Jun 2020 17:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362390 - in head/usr.sbin: fstyp/tests makefs/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/usr.sbin: fstyp/tests makefs/tests X-SVN-Commit-Revision: 362390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:32:30 -0000 Author: lwhsu Date: Fri Jun 19 17:32:30 2020 New Revision: 362390 URL: https://svnweb.freebsd.org/changeset/base/362390 Log: Skip ufs related tests in fstyp(8) and makefs(8) temporarily They are failing after r362358 and r362359. PR: 247425 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh head/usr.sbin/makefs/tests/makefs_ffs_tests.sh Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jun 19 17:25:54 2020 (r362389) +++ head/usr.sbin/fstyp/tests/fstyp_test.sh Fri Jun 19 17:32:30 2020 (r362390) @@ -197,6 +197,9 @@ ufs1_head() { atf_set "descr" "fstyp(8) should detect UFS version 1 filesystems" } ufs1_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi atf_check -s exit:0 mkdir dir atf_check -s exit:0 -o ignore makefs -Z -s 64m ufs.img dir atf_check -s exit:0 -o inline:"ufs\n" fstyp ufs.img @@ -208,6 +211,9 @@ ufs2_head() { atf_set "descr" "fstyp(8) should detect UFS version 2 filesystems" } ufs2_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi atf_check -s exit:0 mkdir dir atf_check -s exit:0 -o ignore makefs -o version=2 -Z -s 64m ufs.img dir atf_check -s exit:0 -o inline:"ufs\n" fstyp ufs.img @@ -219,6 +225,9 @@ ufs2_label_head() { atf_set "descr" "fstyp(8) can read the label on a UFS v2 filesystem" } ufs2_label_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi atf_check -s exit:0 mkdir dir atf_check -s exit:0 -o ignore makefs -o version=2,label="foo" -Z -s 64m ufs.img dir atf_check -s exit:0 -o inline:"ufs foo\n" fstyp -l ufs.img Modified: head/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_ffs_tests.sh Fri Jun 19 17:25:54 2020 (r362389) +++ head/usr.sbin/makefs/tests/makefs_ffs_tests.sh Fri Jun 19 17:32:30 2020 (r362390) @@ -106,6 +106,10 @@ D_flag_cleanup() atf_test_case F_flag cleanup F_flag_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi + create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ @@ -125,6 +129,10 @@ F_flag_cleanup() atf_test_case from_mtree_spec_file cleanup from_mtree_spec_file_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi + create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ @@ -146,6 +154,10 @@ from_mtree_spec_file_cleanup() atf_test_case from_multiple_dirs cleanup from_multiple_dirs_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi + test_inputs_dir2=$TMPDIR/inputs2 create_test_inputs @@ -168,6 +180,10 @@ from_multiple_dirs_cleanup() atf_test_case from_single_dir cleanup from_single_dir_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi + create_test_inputs atf_check -e empty -o not-empty -s exit:0 \ @@ -184,6 +200,10 @@ from_single_dir_cleanup() atf_test_case o_flag_version_1 cleanup o_flag_version_1_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi + ffs_version=1 platform=$(uname) @@ -216,6 +236,10 @@ o_flag_version_1_cleanup() atf_test_case o_flag_version_2 cleanup o_flag_version_2_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/247425" + fi + ffs_version=2 platform=$(uname) From owner-svn-src-all@freebsd.org Fri Jun 19 17:32:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B073333E85; Fri, 19 Jun 2020 17:32:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pQql1pncz4Xlw; Fri, 19 Jun 2020 17:32:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 396731ED0A; Fri, 19 Jun 2020 17:32:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHWp1N031232; Fri, 19 Jun 2020 17:32:51 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHWpbl031231; Fri, 19 Jun 2020 17:32:51 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191732.05JHWpbl031231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 17:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362391 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 362391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:32:51 -0000 Author: mmel Date: Fri Jun 19 17:32:50 2020 New Revision: 362391 URL: https://svnweb.freebsd.org/changeset/base/362391 Log: Revert r362389, it was committed with .diff instead of .txt as commit log. Modified: head/sys/dev/pci/pci_dw_mv.c Modified: head/sys/dev/pci/pci_dw_mv.c ============================================================================== --- head/sys/dev/pci/pci_dw_mv.c Fri Jun 19 17:32:30 2020 (r362390) +++ head/sys/dev/pci/pci_dw_mv.c Fri Jun 19 17:32:50 2020 (r362391) @@ -64,11 +64,15 @@ __FBSDID("$FreeBSD$"); #define MV_GLOBAL_CONTROL_REG 0x8000 #define PCIE_APP_LTSSM_EN (1 << 2) +//#define PCIE_DEVICE_TYPE_SHIFT 4 +//#define PCIE_DEVICE_TYPE_MASK 0xF +//#define PCIE_DEVICE_TYPE_RC 0x4/ #define MV_GLOBAL_STATUS_REG 0x8008 #define MV_STATUS_RDLH_LINK_UP (1 << 1) #define MV_STATUS_PHY_LINK_UP (1 << 9) + #define MV_INT_CAUSE1 0x801C #define MV_INT_MASK1 0x8020 #define INT_A_ASSERT_MASK (1 << 9) @@ -86,7 +90,11 @@ __FBSDID("$FreeBSD$"); #define MV_ARUSER_REG 0x805C #define MV_AWUSER_REG 0x8060 + + #define MV_MAX_LANES 8 + + struct pci_mv_softc { struct pci_dw_softc dw_sc; device_t dev; @@ -104,6 +112,7 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0}, }; + static int pci_mv_phy_init(struct pci_mv_softc *sc) { @@ -112,23 +121,18 @@ pci_mv_phy_init(struct pci_mv_softc *sc) for (i = 0; i < MV_MAX_LANES; i++) { rv = phy_get_by_ofw_idx(sc->dev, sc->node, i, &(sc->phy[i])); if (rv != 0 && rv != ENOENT) { - device_printf(sc->dev, "Cannot get phy[%d]\n", i); -/* XXX revert when phy driver will be implemented */ -#if 0 - goto fail; -#else - continue; -#endif - } - if (sc->phy[i] == NULL) - continue; - rv = phy_enable(sc->phy[i]); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable phy[%d]\n", i); - goto fail; - } - } - return (0); + device_printf(sc->dev, "Cannot get phy[%d]\n", i); + goto fail; + } + if (sc->phy[i] == NULL) + continue; + rv = phy_enable(sc->phy[i]); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable phy[%d]\n", i); + goto fail; + } + } + return (0); fail: for (i = 0; i < MV_MAX_LANES; i++) { @@ -169,14 +173,13 @@ pci_mv_init(struct pci_mv_softc *sc) /* Enable local interrupts */ pci_dw_dbi_wr4(sc->dev, DW_MSI_INTR0_MASK, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0xFFFFFFFF); - pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFD); + pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, 0xFFFFFFFF); /* Errors have own interrupt, not yet populated in DTt */ pci_dw_dbi_wr4(sc->dev, MV_ERR_INT_MASK, 0); } - static int pci_mv_intr(void *arg) { struct pci_mv_softc *sc = arg; @@ -185,6 +188,8 @@ static int pci_mv_intr(void *arg) /* Ack all interrups */ cause1 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE1); cause2 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE2); + if (cause1 == 0 || cause2 == 0) + return(FILTER_STRAY); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, cause1); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, cause2); @@ -320,4 +325,4 @@ DEFINE_CLASS_1(pcib, pci_mv_driver, pci_mv_methods, sizeof(struct pci_mv_softc), pci_dw_driver); static devclass_t pci_mv_devclass; DRIVER_MODULE( pci_mv, simplebus, pci_mv_driver, pci_mv_devclass, - NULL, NULL); + NULL, NULL); \ No newline at end of file From owner-svn-src-all@freebsd.org Fri Jun 19 17:33:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46A323338FC; Fri, 19 Jun 2020 17:33:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pQrz17Rjz4XqF; Fri, 19 Jun 2020 17:33:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 222C41E4FF; Fri, 19 Jun 2020 17:33:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHXsTB031359; Fri, 19 Jun 2020 17:33:54 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHXstt031358; Fri, 19 Jun 2020 17:33:54 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191733.05JHXstt031358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 17:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362392 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 362392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:33:55 -0000 Author: mmel Date: Fri Jun 19 17:33:54 2020 New Revision: 362392 URL: https://svnweb.freebsd.org/changeset/base/362392 Log: Adapt ARMADA8k PCIe driver to newly imported 5.7 DT. - temporarily disable handling with phy, we don't have driver for it yet - always clear cause for administartive interrupt. While I'm in, fix style(9) (mainly whitespace). MFC after: 4 weeks Modified: head/sys/dev/pci/pci_dw_mv.c Modified: head/sys/dev/pci/pci_dw_mv.c ============================================================================== --- head/sys/dev/pci/pci_dw_mv.c Fri Jun 19 17:32:50 2020 (r362391) +++ head/sys/dev/pci/pci_dw_mv.c Fri Jun 19 17:33:54 2020 (r362392) @@ -64,15 +64,11 @@ __FBSDID("$FreeBSD$"); #define MV_GLOBAL_CONTROL_REG 0x8000 #define PCIE_APP_LTSSM_EN (1 << 2) -//#define PCIE_DEVICE_TYPE_SHIFT 4 -//#define PCIE_DEVICE_TYPE_MASK 0xF -//#define PCIE_DEVICE_TYPE_RC 0x4/ #define MV_GLOBAL_STATUS_REG 0x8008 #define MV_STATUS_RDLH_LINK_UP (1 << 1) #define MV_STATUS_PHY_LINK_UP (1 << 9) - #define MV_INT_CAUSE1 0x801C #define MV_INT_MASK1 0x8020 #define INT_A_ASSERT_MASK (1 << 9) @@ -90,11 +86,7 @@ __FBSDID("$FreeBSD$"); #define MV_ARUSER_REG 0x805C #define MV_AWUSER_REG 0x8060 - - #define MV_MAX_LANES 8 - - struct pci_mv_softc { struct pci_dw_softc dw_sc; device_t dev; @@ -112,7 +104,6 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0}, }; - static int pci_mv_phy_init(struct pci_mv_softc *sc) { @@ -121,18 +112,23 @@ pci_mv_phy_init(struct pci_mv_softc *sc) for (i = 0; i < MV_MAX_LANES; i++) { rv = phy_get_by_ofw_idx(sc->dev, sc->node, i, &(sc->phy[i])); if (rv != 0 && rv != ENOENT) { - device_printf(sc->dev, "Cannot get phy[%d]\n", i); - goto fail; - } - if (sc->phy[i] == NULL) - continue; - rv = phy_enable(sc->phy[i]); - if (rv != 0) { - device_printf(sc->dev, "Cannot enable phy[%d]\n", i); - goto fail; - } - } - return (0); + device_printf(sc->dev, "Cannot get phy[%d]\n", i); +/* XXX revert when phy driver will be implemented */ +#if 0 + goto fail; +#else + continue; +#endif + } + if (sc->phy[i] == NULL) + continue; + rv = phy_enable(sc->phy[i]); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable phy[%d]\n", i); + goto fail; + } + } + return (0); fail: for (i = 0; i < MV_MAX_LANES; i++) { @@ -173,13 +169,14 @@ pci_mv_init(struct pci_mv_softc *sc) /* Enable local interrupts */ pci_dw_dbi_wr4(sc->dev, DW_MSI_INTR0_MASK, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0xFFFFFFFF); - pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFF); + pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFD); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, 0xFFFFFFFF); /* Errors have own interrupt, not yet populated in DTt */ pci_dw_dbi_wr4(sc->dev, MV_ERR_INT_MASK, 0); } + static int pci_mv_intr(void *arg) { struct pci_mv_softc *sc = arg; @@ -188,8 +185,6 @@ static int pci_mv_intr(void *arg) /* Ack all interrups */ cause1 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE1); cause2 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE2); - if (cause1 == 0 || cause2 == 0) - return(FILTER_STRAY); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, cause1); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, cause2); @@ -325,4 +320,4 @@ DEFINE_CLASS_1(pcib, pci_mv_driver, pci_mv_methods, sizeof(struct pci_mv_softc), pci_dw_driver); static devclass_t pci_mv_devclass; DRIVER_MODULE( pci_mv, simplebus, pci_mv_driver, pci_mv_devclass, - NULL, NULL); \ No newline at end of file + NULL, NULL); From owner-svn-src-all@freebsd.org Fri Jun 19 17:49:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 108F93344A8; Fri, 19 Jun 2020 17:49:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRCK6llWz4YcQ; Fri, 19 Jun 2020 17:49:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E28E71EB79; Fri, 19 Jun 2020 17:49:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHnn7x037863; Fri, 19 Jun 2020 17:49:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHnnof037862; Fri, 19 Jun 2020 17:49:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191749.05JHnnof037862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 17:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362393 - stable/12/sys/dev/extres/regulator X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/extres/regulator X-SVN-Commit-Revision: 362393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:49:50 -0000 Author: manu Date: Fri Jun 19 17:49:49 2020 New Revision: 362393 URL: https://svnweb.freebsd.org/changeset/base/362393 Log: MFC r356803: regulator_fixed: Add a get_voltage method Some consumer cannot know the voltage of the regulator without it. While here, refuse to attach is min_voltage != max_voltage, it shouldn't happens anyway. Modified: stable/12/sys/dev/extres/regulator/regulator_fixed.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- stable/12/sys/dev/extres/regulator/regulator_fixed.c Fri Jun 19 17:33:54 2020 (r362392) +++ stable/12/sys/dev/extres/regulator/regulator_fixed.c Fri Jun 19 17:49:49 2020 (r362393) @@ -73,6 +73,7 @@ static int regnode_fixed_enable(struct regnode *regnod int *udelay); static int regnode_fixed_status(struct regnode *regnode, int *status); static int regnode_fixed_stop(struct regnode *regnode, int *udelay); +static int regnode_fixed_get_voltage(struct regnode *regnode, int *uvolt); static regnode_method_t regnode_fixed_methods[] = { /* Regulator interface */ @@ -80,6 +81,7 @@ static regnode_method_t regnode_fixed_methods[] = { REGNODEMETHOD(regnode_enable, regnode_fixed_enable), REGNODEMETHOD(regnode_status, regnode_fixed_status), REGNODEMETHOD(regnode_stop, regnode_fixed_stop), + REGNODEMETHOD(regnode_get_voltage, regnode_fixed_get_voltage), REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), REGNODEMETHOD_END }; @@ -280,6 +282,16 @@ regnode_fixed_status(struct regnode *regnode, int *sta return (rv); } +static int +regnode_fixed_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct regnode_fixed_sc *sc; + + sc = regnode_get_softc(regnode); + *uvolt = sc->param->min_uvolt; + return (0); +} + int regnode_fixed_register(device_t dev, struct regnode_fixed_init_def *init_def) { @@ -382,6 +394,10 @@ regfix_parse_fdt(struct regfix_softc * sc) return(rv); } + if (init_def->std_param.min_uvolt != init_def->std_param.max_uvolt) { + device_printf(sc->dev, "min_uvolt != max_uvolt\n"); + return (ENXIO); + } /* Fixed regulator uses 'startup-delay-us' property for enable_delay */ rv = OF_getencprop(node, "startup-delay-us", &init_def->std_param.enable_delay, From owner-svn-src-all@freebsd.org Fri Jun 19 17:52:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69E8D334572; Fri, 19 Jun 2020 17:52:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRGn2Bfrz4YsQ; Fri, 19 Jun 2020 17:52:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 467121EF3B; Fri, 19 Jun 2020 17:52:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHqnBp043443; Fri, 19 Jun 2020 17:52:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHqmiD043440; Fri, 19 Jun 2020 17:52:48 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191752.05JHqmiD043440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 17:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362394 - stable/12/sys/dev/mmc/host X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/mmc/host X-SVN-Commit-Revision: 362394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:52:49 -0000 Author: manu Date: Fri Jun 19 17:52:48 2020 New Revision: 362394 URL: https://svnweb.freebsd.org/changeset/base/362394 Log: MFC r358450, r358635 r358450: mmc: dwmmc: Fix off by one error The IVAR_MAX_DATA is supposed to have the number of descriptor X the mmc block size and desc_count contain all this information + 1. Reported by: phk r358635: dwmmc: Rework the DMA engine Each segment can be up to 4096 bytes in chain structure according to the RK3399 TRM Part 2. Set the buffers in full ring where the last one point to the first one. Correctly reports the MMC_IVAR_MAX_DATA. Use CACHE_LINE_SIZE for bus_dma alignment. Modified: stable/12/sys/dev/mmc/host/dwmmc.c stable/12/sys/dev/mmc/host/dwmmc_hisi.c stable/12/sys/dev/mmc/host/dwmmc_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mmc/host/dwmmc.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc.c Fri Jun 19 17:49:49 2020 (r362393) +++ stable/12/sys/dev/mmc/host/dwmmc.c Fri Jun 19 17:52:48 2020 (r362394) @@ -99,16 +99,15 @@ __FBSDID("$FreeBSD$"); #define DWMMC_ERR_FLAGS (DWMMC_DATA_ERR_FLAGS | DWMMC_CMD_ERR_FLAGS \ |SDMMC_INTMASK_HLE) -#define DES0_DIC (1 << 1) -#define DES0_LD (1 << 2) -#define DES0_FS (1 << 3) -#define DES0_CH (1 << 4) -#define DES0_ER (1 << 5) -#define DES0_CES (1 << 30) -#define DES0_OWN (1 << 31) +#define DES0_DIC (1 << 1) /* Disable Interrupt on Completion */ +#define DES0_LD (1 << 2) /* Last Descriptor */ +#define DES0_FS (1 << 3) /* First Descriptor */ +#define DES0_CH (1 << 4) /* second address CHained */ +#define DES0_ER (1 << 5) /* End of Ring */ +#define DES0_CES (1 << 30) /* Card Error Summary */ +#define DES0_OWN (1 << 31) /* OWN */ -#define DES1_BS1_MASK 0xfff -#define DES1_BS1_SHIFT 0 +#define DES1_BS1_MASK 0x1fff struct idmac_desc { uint32_t des0; /* control */ @@ -117,9 +116,10 @@ struct idmac_desc { uint32_t des3; /* buf2 phys addr or next descr */ }; -#define DESC_MAX 256 -#define DESC_SIZE (sizeof(struct idmac_desc) * DESC_MAX) +#define IDMAC_DESC_SEGS (PAGE_SIZE / (sizeof(struct idmac_desc))) +#define IDMAC_DESC_SIZE (sizeof(struct idmac_desc) * IDMAC_DESC_SEGS) #define DEF_MSIZE 0x2 /* Burst size of multiple transaction */ +#define IDMAC_MAX_SIZE 4096 static void dwmmc_next_operation(struct dwmmc_softc *); static int dwmmc_setup_bus(struct dwmmc_softc *, int); @@ -162,7 +162,7 @@ dwmmc_ring_setup(void *arg, bus_dma_segment_t *segs, i for (idx = 0; idx < nsegs; idx++) { sc->desc_ring[idx].des0 = (DES0_OWN | DES0_DIC | DES0_CH); - sc->desc_ring[idx].des1 = segs[idx].ds_len; + sc->desc_ring[idx].des1 = segs[idx].ds_len & DES1_BS1_MASK; sc->desc_ring[idx].des2 = segs[idx].ds_addr; if (idx == 0) @@ -213,8 +213,8 @@ dma_setup(struct dwmmc_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - DESC_SIZE, 1, /* maxsize, nsegments */ - DESC_SIZE, /* maxsegsize */ + IDMAC_DESC_SIZE, 1, /* maxsize, nsegments */ + IDMAC_DESC_SIZE, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->desc_tag); @@ -234,7 +234,7 @@ dma_setup(struct dwmmc_softc *sc) } error = bus_dmamap_load(sc->desc_tag, sc->desc_map, - sc->desc_ring, DESC_SIZE, dwmmc_get1paddr, + sc->desc_ring, IDMAC_DESC_SIZE, dwmmc_get1paddr, &sc->desc_ring_paddr, 0); if (error != 0) { device_printf(sc->dev, @@ -242,23 +242,25 @@ dma_setup(struct dwmmc_softc *sc) return (1); } - for (idx = 0; idx < sc->desc_count; idx++) { + for (idx = 0; idx < IDMAC_DESC_SEGS; idx++) { sc->desc_ring[idx].des0 = DES0_CH; sc->desc_ring[idx].des1 = 0; - nidx = (idx + 1) % sc->desc_count; + nidx = (idx + 1) % IDMAC_DESC_SEGS; sc->desc_ring[idx].des3 = sc->desc_ring_paddr + \ (nidx * sizeof(struct idmac_desc)); } + sc->desc_ring[idx - 1].des3 = sc->desc_ring_paddr; + sc->desc_ring[idx - 1].des0 |= DES0_ER; error = bus_dma_tag_create( bus_get_dma_tag(sc->dev), /* Parent tag. */ - 4096, 0, /* alignment, boundary */ + CACHE_LINE_SIZE, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - sc->desc_count * MMC_SECTOR_SIZE, /* maxsize */ - sc->desc_count, /* nsegments */ - MMC_SECTOR_SIZE, /* maxsegsize */ + IDMAC_MAX_SIZE * IDMAC_DESC_SEGS, /* maxsize */ + IDMAC_DESC_SEGS, /* nsegments */ + IDMAC_MAX_SIZE, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->buf_tag); @@ -664,9 +666,6 @@ dwmmc_attach(device_t dev) device_printf(dev, "Hardware version ID is %04x\n", READ4(sc, SDMMC_VERID) & 0xffff); - if (sc->desc_count == 0) - sc->desc_count = DESC_MAX; - /* XXX: we support operation for slot index 0 only */ slot = 0; if (sc->pwren_inverted) { @@ -1278,7 +1277,7 @@ dwmmc_read_ivar(device_t bus, device_t child, int whic *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = sc->desc_count; + *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE; break; case MMCBR_IVAR_TIMING: *(int *)result = sc->host.ios.timing; Modified: stable/12/sys/dev/mmc/host/dwmmc_hisi.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_hisi.c Fri Jun 19 17:49:49 2020 (r362393) +++ stable/12/sys/dev/mmc/host/dwmmc_hisi.c Fri Jun 19 17:52:48 2020 (r362394) @@ -79,7 +79,6 @@ hisi_dwmmc_attach(device_t dev) * DMA when the controller is not cache-coherent on arm64. */ sc->use_pio = 1; - sc->desc_count = 1; return (dwmmc_attach(dev)); } Modified: stable/12/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_var.h Fri Jun 19 17:49:49 2020 (r362393) +++ stable/12/sys/dev/mmc/host/dwmmc_var.h Fri Jun 19 17:52:48 2020 (r362394) @@ -60,7 +60,6 @@ struct dwmmc_softc { uint32_t use_auto_stop; uint32_t use_pio; uint32_t pwren_inverted; - u_int desc_count; device_t child; struct task card_task; /* Card presence check task */ struct timeout_task card_delayed_task;/* Card insert delayed task */ From owner-svn-src-all@freebsd.org Fri Jun 19 17:56:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F99233496A; Fri, 19 Jun 2020 17:56:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRLZ0crkz4ZJB; Fri, 19 Jun 2020 17:56:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DF351EFCD; Fri, 19 Jun 2020 17:56:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHu5mj043769; Fri, 19 Jun 2020 17:56:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHu5gK043768; Fri, 19 Jun 2020 17:56:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191756.05JHu5gK043768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 17:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362395 - stable/12/usr.sbin/gpioctl X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/usr.sbin/gpioctl X-SVN-Commit-Revision: 362395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:56:06 -0000 Author: manu Date: Fri Jun 19 17:56:05 2020 New Revision: 362395 URL: https://svnweb.freebsd.org/changeset/base/362395 Log: MFC r359805: gpioctl: Print interrupts capabilities GPIO drivers who supports interrupts report them in the caps (obtain via the getcaps method) but gpioctl doesn't know how to interpret this and print "UNKNOWN" for each one of them. Even if we don't have userland gpio interrupts support for now let gpioctl print the supported caps. Modified: stable/12/usr.sbin/gpioctl/gpioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/gpioctl/gpioctl.c ============================================================================== --- stable/12/usr.sbin/gpioctl/gpioctl.c Fri Jun 19 17:52:48 2020 (r362394) +++ stable/12/usr.sbin/gpioctl/gpioctl.c Fri Jun 19 17:56:05 2020 (r362395) @@ -62,6 +62,11 @@ static struct flag_desc gpio_flags[] = { { "II", GPIO_PIN_INVIN }, { "IO", GPIO_PIN_INVOUT }, { "PULSE", GPIO_PIN_PULSATE }, + { "INTRLL", GPIO_INTR_LEVEL_LOW}, + { "INTRLH", GPIO_INTR_LEVEL_HIGH}, + { "INTRER", GPIO_INTR_EDGE_RISING}, + { "INTREF", GPIO_INTR_EDGE_FALLING}, + { "INTREB", GPIO_INTR_EDGE_BOTH}, { NULL, 0 }, }; From owner-svn-src-all@freebsd.org Fri Jun 19 17:59:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 768F0334AC8; Fri, 19 Jun 2020 17:59:56 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRR02YB2z4ZmS; Fri, 19 Jun 2020 17:59:56 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34CA71EF3F; Fri, 19 Jun 2020 17:59:56 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JHxuKu043984; Fri, 19 Jun 2020 17:59:56 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JHxtil043981; Fri, 19 Jun 2020 17:59:55 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202006191759.05JHxtil043981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 19 Jun 2020 17:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362396 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 362396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 17:59:56 -0000 Author: allanjude Date: Fri Jun 19 17:59:55 2020 New Revision: 362396 URL: https://svnweb.freebsd.org/changeset/base/362396 Log: ZFS: Allow setting checksum=skein on boot pools PR: 245889 Reported by: delphij Sponsored by: Klara Inc. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 19 17:56:05 2020 (r362395) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 19 17:59:55 2020 (r362396) @@ -1001,9 +1001,9 @@ for more information on these algorithms. .Pp Changing this property affects only newly-written data. .Pp -Salted checksum algorithms -.Pq Cm edonr , skein -are currently not supported for any filesystem on the boot pools. +The salted checksum algorithm +.Pq Cm edonr +is currently not supported on FreeBSD. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle | Cm lz4 Controls the compression algorithm used for this dataset. Setting compression to Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Fri Jun 19 17:56:05 2020 (r362395) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Fri Jun 19 17:59:55 2020 (r362396) @@ -632,6 +632,9 @@ and will return to being once all filesystems that have ever had their checksum set to .Sy skein are destroyed. +Booting off of pools using +.Sy skein +is supported. .It Sy allocation_classes .Bl -column "READ\-ONLY COMPATIBLE" "com.intel:allocation_classes" .It GUID Ta com.intel:allocation_classes Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 19 17:56:05 2020 (r362395) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 19 17:59:55 2020 (r362396) @@ -4373,16 +4373,7 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, if ((err = spa_open(dsname, &spa, FTAG)) != 0) return (err); - /* - * Salted checksums are not supported on root pools. - */ - if (spa_bootfs(spa) != 0 && - intval < ZIO_CHECKSUM_FUNCTIONS && - (zio_checksum_table[intval].ci_flags & - ZCHECKSUM_FLAG_SALTED)) { - spa_close(spa, FTAG); - return (SET_ERROR(ERANGE)); - } + if (!spa_feature_is_enabled(spa, feature)) { spa_close(spa, FTAG); return (SET_ERROR(ENOTSUP)); From owner-svn-src-all@freebsd.org Fri Jun 19 18:00:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F3B1334D82; Fri, 19 Jun 2020 18:00:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRRT2Mt9z4ZhK; Fri, 19 Jun 2020 18:00:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CC381EE58; Fri, 19 Jun 2020 18:00:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JI0LAx044144; Fri, 19 Jun 2020 18:00:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JI0LAG044143; Fri, 19 Jun 2020 18:00:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202006191800.05JI0LAG044143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 19 Jun 2020 18:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362397 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 362397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:00:21 -0000 Author: andrew Date: Fri Jun 19 18:00:20 2020 New Revision: 362397 URL: https://svnweb.freebsd.org/changeset/base/362397 Log: Use the correct address when creating pci resources When the PCI and CPU physical addresses are identical it doesn't matter which is used to create the resources, however on some systems, e.g. qemu armv7 virt, they are different. This leads to a panic as we try to map the wrong physical address into the kernel address space. Reported by: Jenkins via trasz Sponsored by: Innovate UK Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri Jun 19 17:59:55 2020 (r362396) +++ head/sys/dev/pci/pci_host_generic.c Fri Jun 19 18:00:20 2020 (r362397) @@ -143,15 +143,15 @@ pci_host_generic_core_attach(device_t dev) case FLAG_TYPE_PMEM: sc->has_pmem = true; error = rman_manage_region(&sc->pmem_rman, - phys_base, phys_base + size - 1); + pci_base, pci_base + size - 1); break; case FLAG_TYPE_MEM: error = rman_manage_region(&sc->mem_rman, - phys_base, phys_base + size - 1); + pci_base, pci_base + size - 1); break; case FLAG_TYPE_IO: error = rman_manage_region(&sc->io_rman, - phys_base, phys_base + size - 1); + pci_base, pci_base + size - 1); break; default: continue; From owner-svn-src-all@freebsd.org Fri Jun 19 18:02:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B73C334D73; Fri, 19 Jun 2020 18:02:30 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRTy2dw8z4bJy; Fri, 19 Jun 2020 18:02:30 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BE301F1F8; Fri, 19 Jun 2020 18:02:30 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JI2UYY050115; Fri, 19 Jun 2020 18:02:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JI2Ug6050114; Fri, 19 Jun 2020 18:02:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191802.05JI2Ug6050114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362398 - stable/12/sys/arm/ti/am335x X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/arm/ti/am335x X-SVN-Commit-Revision: 362398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:02:30 -0000 Author: manu Date: Fri Jun 19 18:02:29 2020 New Revision: 362398 URL: https://svnweb.freebsd.org/changeset/base/362398 Log: MFC r359806: arm: am335x: Honor pmic option ti,pmic-shutdown-controller Honor ti,pmic-shutdown-controller option in DTS Tested on stable r359316 @ Sleep mode on custom hw, Power off on BBB and PB OFF bit [1] in status register control the pmic behaviour when PWR_EN pin is pulled low. On most AM335x hardware [beaglebone *] the desired behaviour are in fact power off due to some hardware designs - read more in the comments around pmic in sys/gnu/dts/arm/am335x-bone-common.dtsi This patch let the device-tree decide with ti,pmic-shutdown-controller[2] the state of off bit in status register. [1] 8.6.12 table 12 http://www.ti.com/lit/ds/symlink/tps65217.pdf [2] Documentation/devicetree/bindings/regulator/tps65217.txt PR: 245159 Submitted by: Oskar Holmlund Modified: stable/12/sys/arm/ti/am335x/am335x_pmic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/ti/am335x/am335x_pmic.c ============================================================================== --- stable/12/sys/arm/ti/am335x/am335x_pmic.c Fri Jun 19 18:00:20 2020 (r362397) +++ stable/12/sys/arm/ti/am335x/am335x_pmic.c Fri Jun 19 18:02:29 2020 (r362398) @@ -208,6 +208,7 @@ am335x_pmic_start(struct am335x_pmic_softc *sc) char name[20]; char pwr[4][11] = {"Battery", "USB", "AC", "USB and AC"}; int rv; + phandle_t node; dev = sc->sc_dev; am335x_pmic_read(dev, TPS65217_CHIPID_REG, (uint8_t *)&chipid_reg, 1); @@ -232,6 +233,16 @@ am335x_pmic_start(struct am335x_pmic_softc *sc) device_printf(dev, "%s powered by %s\n", name, pwr[status_reg.usbpwr | (status_reg.acpwr << 1)]); + /* Check devicetree for ti,pmic-shutdown-controller + * if present; PMIC will go to shutdown state on PWR_EN toggle + * if not present; PMIC will enter sleep state on PWR_EN toggle (default on reset) + */ + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "ti,pmic-shutdown-controller")) { + status_reg.off = 1; + am335x_pmic_write(dev, TPS65217_STATUS_REG, (uint8_t *)&status_reg, 1); + } + if (am335x_pmic_vo[0] != '\0') { for (vo = 0; vo < 4; vo++) { if (strcmp(tps65217_voreg_c[vo], am335x_pmic_vo) == 0) @@ -291,16 +302,9 @@ am335x_pmic_attach(device_t dev) static void am335x_pmic_shutdown(void *xdev, int howto) { - device_t dev; - struct tps65217_status_reg reg; - if (!(howto & RB_POWEROFF)) return; - dev = (device_t)xdev; - am335x_pmic_read(dev, TPS65217_STATUS_REG, (uint8_t *)®, 1); - /* Set the OFF bit on status register to start the shutdown sequence. */ - reg.off = 1; - am335x_pmic_write(dev, TPS65217_STATUS_REG, (uint8_t *)®, 1); + /* Toggle pmic_pwr_enable to shutdown the PMIC. */ am335x_rtc_pmic_pwr_toggle(); } From owner-svn-src-all@freebsd.org Fri Jun 19 18:04:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2852334DA7; Fri, 19 Jun 2020 18:04:41 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRXT4ftLz4b91; Fri, 19 Jun 2020 18:04:41 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B33A1F0CA; Fri, 19 Jun 2020 18:04:41 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JI4fJM050280; Fri, 19 Jun 2020 18:04:41 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JI4f3C050279; Fri, 19 Jun 2020 18:04:41 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191804.05JI4f3C050279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 18:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362399 - head/sys/dev/dwc X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/dwc X-SVN-Commit-Revision: 362399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:04:41 -0000 Author: mmel Date: Fri Jun 19 18:04:41 2020 New Revision: 362399 URL: https://svnweb.freebsd.org/changeset/base/362399 Log: Use naming nomenclature used in DesignWare TRM. Use naming nomenclature used in DesignWare TRM. This driver was written by using Altera (now Intel) documentation for Arria FPGA manual. Unfortunately this manual used very different (and in some cases opposite naming) for registers and descriptor fields. Unfortunately, this makes future expansion extremely hard. Should not been functional change. MFC after: 4 weeks Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Fri Jun 19 18:02:29 2020 (r362398) +++ head/sys/dev/dwc/if_dwc.c Fri Jun 19 18:04:41 2020 (r362399) @@ -93,46 +93,113 @@ __FBSDID("$FreeBSD$"); #define DWC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) #define DWC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED) -#define DDESC_TDES0_OWN (1U << 31) -#define DDESC_TDES0_TXINT (1U << 30) -#define DDESC_TDES0_TXLAST (1U << 29) -#define DDESC_TDES0_TXFIRST (1U << 28) -#define DDESC_TDES0_TXCRCDIS (1U << 27) -#define DDESC_TDES0_TXRINGEND (1U << 21) -#define DDESC_TDES0_TXCHAIN (1U << 20) +/* TX descriptors - TDESC0 is almost unified */ +#define TDESC0_OWN (1U << 31) +#define TDESC0_IHE (1U << 16) /* IP Header Error */ +#define TDESC0_ES (1U << 15) /* Error Summary */ +#define TDESC0_JT (1U << 14) /* Jabber Timeout */ +#define TDESC0_FF (1U << 13) /* Frame Flushed */ +#define TDESC0_PCE (1U << 12) /* Payload Checksum Error */ +#define TDESC0_LOC (1U << 11) /* Loss of Carrier */ +#define TDESC0_NC (1U << 10) /* No Carrier */ +#define TDESC0_LC (1U << 9) /* Late Collision */ +#define TDESC0_EC (1U << 8) /* Excessive Collision */ +#define TDESC0_VF (1U << 7) /* VLAN Frame */ +#define TDESC0_CC_MASK 0xf +#define TDESC0_CC_SHIFT 3 /* Collision Count */ +#define TDESC0_ED (1U << 2) /* Excessive Deferral */ +#define TDESC0_UF (1U << 1) /* Underflow Error */ +#define TDESC0_DB (1U << 0) /* Deferred Bit */ +/* TX descriptors - TDESC0 extended format only */ +#define ETDESC0_IC (1U << 30) /* Interrupt on Completion */ +#define ETDESC0_LS (1U << 29) /* Last Segment */ +#define ETDESC0_FS (1U << 28) /* First Segment */ +#define ETDESC0_DC (1U << 27) /* Disable CRC */ +#define ETDESC0_DP (1U << 26) /* Disable Padding */ +#define ETDESC0_CIC_NONE (0U << 22) /* Checksum Insertion Control */ +#define ETDESC0_CIC_HDR (1U << 22) +#define ETDESC0_CIC_SEG (2U << 22) +#define ETDESC0_CIC_FULL (3U << 22) +#define ETDESC0_TER (1U << 21) /* Transmit End of Ring */ +#define ETDESC0_TCH (1U << 20) /* Second Address Chained */ -#define DDESC_RDES0_OWN (1U << 31) -#define DDESC_RDES0_FL_MASK 0x3fff -#define DDESC_RDES0_FL_SHIFT 16 /* Frame Length */ -#define DDESC_RDES1_CHAINED (1U << 14) +/* TX descriptors - TDESC1 normal format */ +#define NTDESC1_IC (1U << 31) /* Interrupt on Completion */ +#define NTDESC1_LS (1U << 30) /* Last Segment */ +#define NTDESC1_FS (1U << 29) /* First Segment */ +#define NTDESC1_CIC_NONE (0U << 27) /* Checksum Insertion Control */ +#define NTDESC1_CIC_HDR (1U << 27) +#define NTDESC1_CIC_SEG (2U << 27) +#define NTDESC1_CIC_FULL (3U << 27) +#define NTDESC1_DC (1U << 26) /* Disable CRC */ +#define NTDESC1_TER (1U << 25) /* Transmit End of Ring */ +#define NTDESC1_TCH (1U << 24) /* Second Address Chained */ +/* TX descriptors - TDESC1 extended format */ +#define ETDESC1_DP (1U << 23) /* Disable Padding */ +#define ETDESC1_TBS2_MASK 0x7ff +#define ETDESC1_TBS2_SHIFT 11 /* Receive Buffer 2 Size */ +#define ETDESC1_TBS1_MASK 0x7ff +#define ETDESC1_TBS1_SHIFT 0 /* Receive Buffer 1 Size */ -/* Alt descriptor bits. */ -#define DDESC_CNTL_TXINT (1U << 31) -#define DDESC_CNTL_TXLAST (1U << 30) -#define DDESC_CNTL_TXFIRST (1U << 29) -#define DDESC_CNTL_TXCRCDIS (1U << 26) -#define DDESC_CNTL_TXRINGEND (1U << 25) -#define DDESC_CNTL_TXCHAIN (1U << 24) +/* RX descriptor - RDESC0 is unified */ +#define RDESC0_OWN (1U << 31) +#define RDESC0_AFM (1U << 30) /* Dest. Address Filter Fail */ +#define RDESC0_FL_MASK 0x3fff +#define RDESC0_FL_SHIFT 16 /* Frame Length */ +#define RDESC0_ES (1U << 15) /* Error Summary */ +#define RDESC0_DE (1U << 14) /* Descriptor Error */ +#define RDESC0_SAF (1U << 13) /* Source Address Filter Fail */ +#define RDESC0_LE (1U << 12) /* Length Error */ +#define RDESC0_OE (1U << 11) /* Overflow Error */ +#define RDESC0_VLAN (1U << 10) /* VLAN Tag */ +#define RDESC0_FS (1U << 9) /* First Descriptor */ +#define RDESC0_LS (1U << 8) /* Last Descriptor */ +#define RDESC0_ICE (1U << 7) /* IPC Checksum Error */ +#define RDESC0_GF (1U << 7) /* Giant Frame */ +#define RDESC0_LC (1U << 6) /* Late Collision */ +#define RDESC0_FT (1U << 5) /* Frame Type */ +#define RDESC0_RWT (1U << 4) /* Receive Watchdog Timeout */ +#define RDESC0_RE (1U << 3) /* Receive Error */ +#define RDESC0_DBE (1U << 2) /* Dribble Bit Error */ +#define RDESC0_CE (1U << 1) /* CRC Error */ +#define RDESC0_PCE (1U << 0) /* Payload Checksum Error */ +#define RDESC0_RXMA (1U << 0) /* Rx MAC Address */ -#define DDESC_CNTL_CHAINED (1U << 24) +/* RX descriptors - RDESC1 normal format */ +#define NRDESC1_DIC (1U << 31) /* Disable Intr on Completion */ +#define NRDESC1_RER (1U << 25) /* Receive End of Ring */ +#define NRDESC1_RCH (1U << 24) /* Second Address Chained */ +#define NRDESC1_RBS2_MASK 0x7ff +#define NRDESC1_RBS2_SHIFT 11 /* Receive Buffer 2 Size */ +#define NRDESC1_RBS1_MASK 0x7ff +#define NRDESC1_RBS1_SHIFT 0 /* Receive Buffer 1 Size */ +/* RX descriptors - RDESC1 enhanced format */ +#define ERDESC1_DIC (1U << 31) /* Disable Intr on Completion */ +#define ERDESC1_RBS2_MASK 0x7ffff +#define ERDESC1_RBS2_SHIFT 16 /* Receive Buffer 2 Size */ +#define ERDESC1_RER (1U << 15) /* Receive End of Ring */ +#define ERDESC1_RCH (1U << 14) /* Second Address Chained */ +#define ERDESC1_RBS1_MASK 0x7ffff +#define ERDESC1_RBS1_SHIFT 0 /* Receive Buffer 1 Size */ + /* * A hardware buffer descriptor. Rx and Tx buffers have the same descriptor * layout, but the bits in the fields have different meanings. */ struct dwc_hwdesc { - uint32_t tdes0; /* status for alt layout */ - uint32_t tdes1; /* cntl for alt layout */ - uint32_t addr; /* pointer to buffer data */ - uint32_t addr_next; /* link to next descriptor */ + uint32_t desc0; + uint32_t desc1; + uint32_t addr1; /* ptr to first buffer data */ + uint32_t addr2; /* ptr to next descriptor / second buffer data*/ }; /* * The hardware imposes alignment restrictions on various objects involved in * DMA transfers. These values are expressed in bytes (not bits). */ -#define DWC_DESC_RING_ALIGN 2048 +#define DWC_DESC_RING_ALIGN 2048 static struct resource_spec dwc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -183,26 +250,26 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_ad --sc->txcount; } else { if (sc->mactype == DWC_GMAC_ALT_DESC) - flags = DDESC_CNTL_TXCHAIN | DDESC_CNTL_TXFIRST - | DDESC_CNTL_TXLAST | DDESC_CNTL_TXINT; + flags = NTDESC1_TCH | NTDESC1_FS + | NTDESC1_LS | NTDESC1_IC; else - flags = DDESC_TDES0_TXCHAIN | DDESC_TDES0_TXFIRST - | DDESC_TDES0_TXLAST | DDESC_TDES0_TXINT; + flags = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS | + ETDESC0_IC; ++sc->txcount; } - sc->txdesc_ring[idx].addr = (uint32_t)(paddr); + sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); if (sc->mactype == DWC_GMAC_ALT_DESC) { - sc->txdesc_ring[idx].tdes0 = 0; - sc->txdesc_ring[idx].tdes1 = flags | len; + sc->txdesc_ring[idx].desc0 = 0; + sc->txdesc_ring[idx].desc1 = flags | len; } else { - sc->txdesc_ring[idx].tdes0 = flags; - sc->txdesc_ring[idx].tdes1 = len; + sc->txdesc_ring[idx].desc0 = flags; + sc->txdesc_ring[idx].desc1 = len; } if (paddr && len) { wmb(); - sc->txdesc_ring[idx].tdes0 |= DDESC_TDES0_OWN; + sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; wmb(); } @@ -466,17 +533,17 @@ dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_ad { uint32_t nidx; - sc->rxdesc_ring[idx].addr = (uint32_t)paddr; + sc->rxdesc_ring[idx].addr1 = (uint32_t)paddr; nidx = next_rxidx(sc, idx); - sc->rxdesc_ring[idx].addr_next = sc->rxdesc_ring_paddr + + sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); if (sc->mactype == DWC_GMAC_ALT_DESC) - sc->rxdesc_ring[idx].tdes1 = DDESC_CNTL_CHAINED | RX_MAX_PACKET; + sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | RX_MAX_PACKET; else - sc->rxdesc_ring[idx].tdes1 = DDESC_RDES1_CHAINED | MCLBYTES; + sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | MCLBYTES; wmb(); - sc->rxdesc_ring[idx].tdes0 = DDESC_RDES0_OWN; + sc->rxdesc_ring[idx].desc0 = RDESC0_OWN; wmb(); return (nidx); @@ -729,7 +796,7 @@ dwc_txfinish_locked(struct dwc_softc *sc) ifp = sc->ifp; while (sc->tx_idx_tail != sc->tx_idx_head) { desc = &sc->txdesc_ring[sc->tx_idx_tail]; - if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) + if ((desc->desc0 & TDESC0_OWN) != 0) break; bmap = &sc->txbuf_map[sc->tx_idx_tail]; bus_dmamap_sync(sc->txbuf_tag, bmap->map, @@ -763,15 +830,15 @@ dwc_rxfinish_locked(struct dwc_softc *sc) for (;;) { idx = sc->rx_idx; - rdes0 = sc->rxdesc_ring[idx].tdes0; - if ((rdes0 & DDESC_RDES0_OWN) != 0) + rdes0 = sc->rxdesc_ring[idx].desc0; + if ((rdes0 & RDESC0_OWN) != 0) break; bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->rxbuf_tag, sc->rxbuf_map[idx].map); - len = (rdes0 >> DDESC_RDES0_FL_SHIFT) & DDESC_RDES0_FL_MASK; + len = (rdes0 >> RDESC0_FL_SHIFT) & RDESC0_FL_MASK; if (len != 0) { m = sc->rxbuf_map[idx].mbuf; m->m_pkthdr.rcvif = ifp; @@ -890,7 +957,7 @@ setup_dma(struct dwc_softc *sc) for (idx = 0; idx < TX_DESC_COUNT; idx++) { nidx = next_txidx(sc, idx); - sc->txdesc_ring[idx].addr_next = sc->txdesc_ring_paddr + + sc->txdesc_ring[idx].addr2 = sc->txdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); } From owner-svn-src-all@freebsd.org Fri Jun 19 18:05:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F0F4334DB9; Fri, 19 Jun 2020 18:05:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRY81Kqbz4bWZ; Fri, 19 Jun 2020 18:05:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28CE21F05E; Fri, 19 Jun 2020 18:05:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JI5GPI050384; Fri, 19 Jun 2020 18:05:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JI5EdM050373; Fri, 19 Jun 2020 18:05:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191805.05JI5EdM050373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362400 - in stable/12/sys: arm/allwinner conf dev/mmc dev/mmc/host X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner conf dev/mmc dev/mmc/host X-SVN-Commit-Revision: 362400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:05:16 -0000 Author: manu Date: Fri Jun 19 18:05:14 2020 New Revision: 362400 URL: https://svnweb.freebsd.org/changeset/base/362400 Log: MFC r359924-r359925, r359927, r359932, r359965 r359924: Those functions are here to help fdt mmc controller drivers to parse the dts to find the supported speeds and the regulators. Not all DTS have every settings properly defined so host controller will still have to add some caps themselves. It also add a mmc_fdt_gpio_setup function which will read the cd-gpios property and register it as the CD pin. If the pin support interrupts one will be registered and the cd_helper function will be called. If the pin doesn't support interrupts the internal taskqueue will poll for change and call the same cd_helper function. mmc_fdt_gpio_setup will also parse the wp-gpio property and MMC drivers can know the write-protect pin value by calling the mmc_fdt_gpio_get_readonly function. Differential Revision: https://reviews.freebsd.org/D23267 r359925: arm: allwinner: aw_mmc: Use the mmc_fdt_helper The fdt properties are now parsed via the help of mmc_fdt_helper functions. This also adds card detection. Note that on some boards (like the Pine64) card detection is broken due to a missing resistor on the cd pin. Differential Revision: https://reviews.freebsd.org/D23268 r359927: arm: dwmmc: Use mmc_fdt_helpers Use the mmc_fdt_parse function instead of parsing everything in the driver. r359932: files: Add mmc_fdt_helpers for mmccam enabled config X-MFC-With: r359924 r359965: mmc_fdt_helpers: Do not schedule a card detection is there is no cd gpio If the fdt node doesn't have a cd-gpios properties or if the node is set as non-removable we do not init the card detection timeout task as it is useless so don't schedule it too. X-MFC-With: r359924 Added: stable/12/sys/dev/mmc/mmc_fdt_helpers.c - copied, changed from r359925, head/sys/dev/mmc/mmc_fdt_helpers.c stable/12/sys/dev/mmc/mmc_fdt_helpers.h - copied unchanged from r359925, head/sys/dev/mmc/mmc_fdt_helpers.h Modified: stable/12/sys/arm/allwinner/aw_mmc.c stable/12/sys/conf/files stable/12/sys/dev/mmc/host/dwmmc.c stable/12/sys/dev/mmc/host/dwmmc_altera.c stable/12/sys/dev/mmc/host/dwmmc_hisi.c stable/12/sys/dev/mmc/host/dwmmc_rockchip.c stable/12/sys/dev/mmc/host/dwmmc_samsung.c stable/12/sys/dev/mmc/host/dwmmc_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_mmc.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_mmc.c Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/arm/allwinner/aw_mmc.c Fri Jun 19 18:05:14 2020 (r362400) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -49,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -122,6 +125,7 @@ struct aw_mmc_softc { int aw_timeout; struct callout aw_timeoutc; struct mmc_host aw_host; + struct mmc_fdt_helper mmc_helper; #ifdef MMCCAM union ccb * ccb; struct cam_devq * devq; @@ -136,9 +140,8 @@ struct aw_mmc_softc { uint32_t aw_intr; uint32_t aw_intr_wait; void * aw_intrhand; - regulator_t aw_reg_vmmc; - regulator_t aw_reg_vqmmc; unsigned int aw_clock; + device_t child; /* Fields required for DMA access. */ bus_addr_t aw_dma_desc_phys; @@ -164,6 +167,7 @@ static int aw_mmc_reset(struct aw_mmc_softc *); static int aw_mmc_init(struct aw_mmc_softc *); static void aw_mmc_intr(void *); static int aw_mmc_update_clock(struct aw_mmc_softc *, uint32_t); +static void aw_mmc_helper_cd_handler(device_t, bool); static void aw_mmc_print_error(uint32_t); static int aw_mmc_update_ios(device_t, device_t); @@ -380,6 +384,40 @@ aw_mmc_cam_request(struct aw_mmc_softc *sc, union ccb } #endif /* MMCCAM */ +static void +aw_mmc_helper_cd_handler(device_t dev, bool present) +{ + struct aw_mmc_softc *sc; + + sc = device_get_softc(dev); + AW_MMC_LOCK(sc); + if (present) { + if (sc->child == NULL) { + if (bootverbose) + device_printf(sc->aw_dev, "Card inserted\n"); + + sc->child = device_add_child(sc->aw_dev, "mmc", -1); + AW_MMC_UNLOCK(sc); + if (sc->child) { + device_set_ivars(sc->child, sc); + (void)device_probe_and_attach(sc->child); + } + } else + AW_MMC_UNLOCK(sc); + } else { + /* Card isn't present, detach if necessary */ + if (sc->child != NULL) { + if (bootverbose) + device_printf(sc->aw_dev, "Card removed\n"); + + AW_MMC_UNLOCK(sc); + device_delete_child(sc->aw_dev, sc->child); + sc->child = NULL; + } else + AW_MMC_UNLOCK(sc); + } +} + static int aw_mmc_probe(device_t dev) { @@ -397,15 +435,11 @@ aw_mmc_probe(device_t dev) static int aw_mmc_attach(device_t dev) { - device_t child; struct aw_mmc_softc *sc; struct sysctl_ctx_list *ctx; struct sysctl_oid_list *tree; - uint32_t bus_width, max_freq; - phandle_t node; int error; - node = ofw_bus_get_node(dev); sc = device_get_softc(dev); sc->aw_dev = dev; @@ -419,7 +453,7 @@ aw_mmc_attach(device_t dev) return (ENXIO); } if (bus_setup_intr(dev, sc->aw_res[AW_MMC_IRQRES], - INTR_TYPE_MISC | INTR_MPSAFE, NULL, aw_mmc_intr, sc, + INTR_TYPE_NET | INTR_MPSAFE, NULL, aw_mmc_intr, sc, &sc->aw_intrhand)) { bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); device_printf(dev, "cannot setup interrupt handler\n"); @@ -483,47 +517,15 @@ aw_mmc_attach(device_t dev) goto fail; } - if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) - bus_width = 4; - - if (regulator_get_by_ofw_property(dev, 0, "vmmc-supply", - &sc->aw_reg_vmmc) == 0) { - if (bootverbose) - device_printf(dev, "vmmc-supply regulator found\n"); - } - if (regulator_get_by_ofw_property(dev, 0, "vqmmc-supply", - &sc->aw_reg_vqmmc) == 0 && bootverbose) { - if (bootverbose) - device_printf(dev, "vqmmc-supply regulator found\n"); - } - + /* Set some defaults for freq and supported mode */ sc->aw_host.f_min = 400000; - - if (OF_getencprop(node, "max-frequency", &max_freq, - sizeof(uint32_t)) <= 0) - max_freq = 52000000; - sc->aw_host.f_max = max_freq; - + sc->aw_host.f_max = 52000000; sc->aw_host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; - sc->aw_host.caps = MMC_CAP_HSPEED | MMC_CAP_UHS_SDR12 | - MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR50 | - MMC_CAP_UHS_DDR50 | MMC_CAP_MMC_DDR52; + sc->aw_host.caps |= MMC_CAP_HSPEED | MMC_CAP_SIGNALING_330; + mmc_fdt_parse(dev, 0, &sc->mmc_helper, &sc->aw_host); + mmc_fdt_gpio_setup(dev, 0, &sc->mmc_helper, aw_mmc_helper_cd_handler); - if (sc->aw_reg_vqmmc != NULL) { - if (regulator_check_voltage(sc->aw_reg_vqmmc, 1800000) == 0) - sc->aw_host.caps |= MMC_CAP_SIGNALING_180; - if (regulator_check_voltage(sc->aw_reg_vqmmc, 3300000) == 0) - sc->aw_host.caps |= MMC_CAP_SIGNALING_330; - } else - sc->aw_host.caps |= MMC_CAP_SIGNALING_330; - - if (bus_width >= 4) - sc->aw_host.caps |= MMC_CAP_4_BIT_DATA; - if (bus_width >= 8) - sc->aw_host.caps |= MMC_CAP_8_BIT_DATA; - #ifdef MMCCAM - child = NULL; /* Not used by MMCCAM, need to silence compiler warnings */ sc->ccb = NULL; if ((sc->devq = cam_simq_alloc(1)) == NULL) { goto fail; @@ -550,18 +552,8 @@ aw_mmc_attach(device_t dev) } mtx_unlock(&sc->sim_mtx); -#else /* !MMCCAM */ - child = device_add_child(dev, "mmc", -1); - if (child == NULL) { - device_printf(dev, "attaching MMC bus failed!\n"); - goto fail; - } - if (device_probe_and_attach(child) != 0) { - device_printf(dev, "attaching MMC child failed!\n"); - device_delete_child(dev, child); - goto fail; - } #endif /* MMCCAM */ + return (0); fail: @@ -1314,7 +1306,7 @@ aw_mmc_switch_vccq(device_t bus, device_t child) sc = device_get_softc(bus); - if (sc->aw_reg_vqmmc == NULL) + if (sc->mmc_helper.vqmmc_supply == NULL) return EOPNOTSUPP; switch (sc->aw_host.ios.vccq) { @@ -1328,7 +1320,7 @@ aw_mmc_switch_vccq(device_t bus, device_t child) return EINVAL; } - err = regulator_set_voltage(sc->aw_reg_vqmmc, uvolt, uvolt); + err = regulator_set_voltage(sc->mmc_helper.vqmmc_supply, uvolt, uvolt); if (err != 0) { device_printf(sc->aw_dev, "Cannot set vqmmc to %d<->%d\n", @@ -1373,10 +1365,10 @@ aw_mmc_update_ios(device_t bus, device_t child) if (bootverbose) device_printf(sc->aw_dev, "Powering down sd/mmc\n"); - if (sc->aw_reg_vmmc) - regulator_disable(sc->aw_reg_vmmc); - if (sc->aw_reg_vqmmc) - regulator_disable(sc->aw_reg_vqmmc); + if (sc->mmc_helper.vmmc_supply) + regulator_disable(sc->mmc_helper.vmmc_supply); + if (sc->mmc_helper.vqmmc_supply) + regulator_disable(sc->mmc_helper.vqmmc_supply); aw_mmc_reset(sc); break; @@ -1384,10 +1376,10 @@ aw_mmc_update_ios(device_t bus, device_t child) if (bootverbose) device_printf(sc->aw_dev, "Powering up sd/mmc\n"); - if (sc->aw_reg_vmmc) - regulator_enable(sc->aw_reg_vmmc); - if (sc->aw_reg_vqmmc) - regulator_enable(sc->aw_reg_vqmmc); + if (sc->mmc_helper.vmmc_supply) + regulator_enable(sc->mmc_helper.vmmc_supply); + if (sc->mmc_helper.vqmmc_supply) + regulator_enable(sc->mmc_helper.vqmmc_supply); aw_mmc_init(sc); break; }; @@ -1463,8 +1455,11 @@ aw_mmc_update_ios(device_t bus, device_t child) static int aw_mmc_get_ro(device_t bus, device_t child) { + struct aw_mmc_softc *sc; - return (0); + sc = device_get_softc(bus); + + return (mmc_fdt_gpio_get_readonly(&sc->mmc_helper)); } static int Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/conf/files Fri Jun 19 18:05:14 2020 (r362400) @@ -2473,6 +2473,7 @@ dev/mmc/mmc.c optional mmc !mmccam dev/mmc/mmcbr_if.m standard dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd !mmccam +dev/mmc/mmc_fdt_helpers.c optional mmc fdt | mmccam fdt dev/mmcnull/mmcnull.c optional mmcnull dev/mn/if_mn.c optional mn pci dev/mpr/mpr.c optional mpr Modified: stable/12/sys/dev/mmc/host/dwmmc.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc.c Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/dev/mmc/host/dwmmc.c Fri Jun 19 18:05:14 2020 (r362400) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -446,7 +447,6 @@ dwmmc_card_task(void *arg, int pending __unused) } } else DWMMC_UNLOCK(sc); - } else { /* Card isn't present, detach if necessary */ if (sc->child != NULL) { @@ -466,7 +466,7 @@ parse_fdt(struct dwmmc_softc *sc) { pcell_t dts_value[3]; phandle_t node; - uint32_t bus_hz = 0, bus_width; + uint32_t bus_hz = 0; int len; #ifdef EXT_RESOURCES int error; @@ -475,18 +475,13 @@ parse_fdt(struct dwmmc_softc *sc) if ((node = ofw_bus_get_node(sc->dev)) == -1) return (ENXIO); - /* bus-width */ - if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) - bus_width = 4; - if (bus_width >= 4) - sc->host.caps |= MMC_CAP_4_BIT_DATA; - if (bus_width >= 8) - sc->host.caps |= MMC_CAP_8_BIT_DATA; + /* Set some defaults for freq and supported mode */ + sc->host.f_min = 400000; + sc->host.f_max = 200000000; + sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; + sc->host.caps = MMC_CAP_HSPEED | MMC_CAP_SIGNALING_330; + mmc_fdt_parse(sc->dev, node, &sc->mmc_helper, &sc->host); - /* max-frequency */ - if (OF_getencprop(node, "max-frequency", &sc->host.f_max, sizeof(uint32_t)) <= 0) - sc->host.f_max = 200000000; - /* fifo-depth */ if ((len = OF_getproplen(node, "fifo-depth")) > 0) { OF_getencprop(node, "fifo-depth", dts_value, len); @@ -721,11 +716,6 @@ dwmmc_attach(device_t dev) DWMMC_ERR_FLAGS | SDMMC_INTMASK_CD)); WRITE4(sc, SDMMC_CTRL, SDMMC_CTRL_INT_ENABLE); - - sc->host.f_min = 400000; - sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; - sc->host.caps |= MMC_CAP_HSPEED; - sc->host.caps |= MMC_CAP_SIGNALING_330; TASK_INIT(&sc->card_task, 0, dwmmc_card_task, sc); TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->card_delayed_task, 0, Modified: stable/12/sys/dev/mmc/host/dwmmc_altera.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_altera.c Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/dev/mmc/host/dwmmc_altera.c Fri Jun 19 18:05:14 2020 (r362400) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include Modified: stable/12/sys/dev/mmc/host/dwmmc_hisi.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_hisi.c Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/dev/mmc/host/dwmmc_hisi.c Fri Jun 19 18:05:14 2020 (r362400) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include Modified: stable/12/sys/dev/mmc/host/dwmmc_rockchip.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_rockchip.c Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/dev/mmc/host/dwmmc_rockchip.c Fri Jun 19 18:05:14 2020 (r362400) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include Modified: stable/12/sys/dev/mmc/host/dwmmc_samsung.c ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_samsung.c Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/dev/mmc/host/dwmmc_samsung.c Fri Jun 19 18:05:14 2020 (r362400) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: stable/12/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- stable/12/sys/dev/mmc/host/dwmmc_var.h Fri Jun 19 18:04:41 2020 (r362399) +++ stable/12/sys/dev/mmc/host/dwmmc_var.h Fri Jun 19 18:05:14 2020 (r362400) @@ -52,6 +52,7 @@ struct dwmmc_softc { device_t dev; void *intr_cookie; struct mmc_host host; + struct mmc_fdt_helper mmc_helper; struct mtx sc_mtx; struct mmc_request *req; struct mmc_command *curcmd; Copied and modified: stable/12/sys/dev/mmc/mmc_fdt_helpers.c (from r359925, head/sys/dev/mmc/mmc_fdt_helpers.c) ============================================================================== --- head/sys/dev/mmc/mmc_fdt_helpers.c Tue Apr 14 16:34:13 2020 (r359925, copy source) +++ stable/12/sys/dev/mmc/mmc_fdt_helpers.c Fri Jun 19 18:05:14 2020 (r362400) @@ -217,7 +217,7 @@ cd_card_task(void *arg, int pending __unused) /* * Card detect setup. */ -static void +static bool cd_setup(struct mmc_fdt_helper *helper, phandle_t node) { int pincaps; @@ -233,7 +233,7 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node helper->cd_disabled = true; if (bootverbose) device_printf(dev, "Non-removable media\n"); - return; + return (false); } /* @@ -246,14 +246,14 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node */ if (gpio_pin_get_by_ofw_property(dev, node, "cd-gpios", &helper->cd_pin)) - return; + return (false); if (gpio_pin_getcaps(helper->cd_pin, &pincaps) != 0 || !(pincaps & GPIO_PIN_INPUT)) { device_printf(dev, "Cannot read card-detect gpio pin; " "setting card-always-present flag.\n"); helper->cd_disabled = true; - return; + return (false); } /* @@ -313,6 +313,8 @@ without_interrupts: device_get_nameunit(helper->cd_pin->dev), helper->cd_pin->pin, cd_mode_str); } + + return (true); } /* @@ -354,14 +356,16 @@ mmc_fdt_gpio_setup(device_t dev, phandle_t node, struc helper->dev = dev; helper->cd_handler = handler; - cd_setup(helper, node); wp_setup(helper, node); - /* - * Schedule a card detection - */ - taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant, - &helper->cd_delayed_task, mstosbt(500), 0, C_PREL(2)); + if (cd_setup(helper, node)) { + /* + * Schedule a card detection + */ + taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant, + &helper->cd_delayed_task, mstosbt(500), 0, C_PREL(2)); + } + return (0); } Copied: stable/12/sys/dev/mmc/mmc_fdt_helpers.h (from r359925, head/sys/dev/mmc/mmc_fdt_helpers.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/mmc/mmc_fdt_helpers.h Fri Jun 19 18:05:14 2020 (r362400, copy of r359925, head/sys/dev/mmc/mmc_fdt_helpers.h) @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Emmanuel Vadot + * Copyright (c) 2017 Ian Lepore All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MMC_FDT_HELPERS_H_ +#define _MMC_FDT_HELPERS_H_ + +#include +#include + +#ifdef EXT_RESOURCES +#include +#endif + +struct mmc_fdt_helper { + device_t dev; + gpio_pin_t wp_pin; + gpio_pin_t cd_pin; + void * cd_ihandler; + struct resource * cd_ires; + int cd_irid; + void (*cd_handler)(device_t, bool); + struct timeout_task cd_delayed_task; + bool cd_disabled; + bool wp_disabled; + bool cd_present; + uint32_t props; +#define MMC_PROP_BROKEN_CD (1 << 0) +#define MMC_PROP_NON_REMOVABLE (1 << 1) +#define MMC_PROP_WP_INVERTED (1 << 2) +#define MMC_PROP_CD_INVERTED (1 << 3) +#define MMC_PROP_DISABLE_WP (1 << 4) +#define MMC_PROP_NO_SDIO (1 << 5) +#define MMC_PROP_NO_SD (1 << 6) +#define MMC_PROP_NO_MMC (1 << 7) + +#ifdef EXT_RESOURCES + regulator_t vmmc_supply; + regulator_t vqmmc_supply; +#endif +}; + +typedef void (*mmc_fdt_cd_handler)(device_t dev, bool present); + +int mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, struct mmc_host *host); +int mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, mmc_fdt_cd_handler handler); +void mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper); +bool mmc_fdt_gpio_get_present(struct mmc_fdt_helper *helper); +bool mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper); + +#endif From owner-svn-src-all@freebsd.org Fri Jun 19 18:10:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 261DA33539C; Fri, 19 Jun 2020 18:10:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRgN0F83z4bVd; Fri, 19 Jun 2020 18:10:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 034A01F1FF; Fri, 19 Jun 2020 18:10:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIAdWD051669; Fri, 19 Jun 2020 18:10:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIAdrL051665; Fri, 19 Jun 2020 18:10:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191810.05JIAdrL051665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362401 - in stable/12/sys: arm/allwinner dev/mmc modules/allwinner modules/allwinner/aw_mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner dev/mmc modules/allwinner modules/allwinner/aw_mmc X-SVN-Commit-Revision: 362401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:10:40 -0000 Author: manu Date: Fri Jun 19 18:10:39 2020 New Revision: 362401 URL: https://svnweb.freebsd.org/changeset/base/362401 Log: MFC r360008-r360009, r360011 r360008: mmc_fdt_helpers: Always init the timout We use the taskqueue to schedule card detection so always init it. This is a proper solution instead of r359965. MFH: r359924 r360009: mmc_fdt_helpers: Drain the cd pin taskqueue in mmc_fdt_gpio_teardown We have no use for it now. r360011: arm: allwinner: aw_mmc: Make it possible to unload the module While here, add a makefile in sys/modules/allwinner so it is built. Also add the PNP info so devmatch will load this module automatically. Added: stable/12/sys/modules/allwinner/aw_mmc/ - copied from r360011, head/sys/modules/allwinner/aw_mmc/ Modified: stable/12/sys/arm/allwinner/aw_mmc.c stable/12/sys/dev/mmc/mmc_fdt_helpers.c stable/12/sys/modules/allwinner/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_mmc.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_mmc.c Fri Jun 19 18:05:14 2020 (r362400) +++ stable/12/sys/arm/allwinner/aw_mmc.c Fri Jun 19 18:10:39 2020 (r362401) @@ -163,6 +163,7 @@ static int aw_mmc_probe(device_t); static int aw_mmc_attach(device_t); static int aw_mmc_detach(device_t); static int aw_mmc_setup_dma(struct aw_mmc_softc *); +static void aw_mmc_teardown_dma(struct aw_mmc_softc *sc); static int aw_mmc_reset(struct aw_mmc_softc *); static int aw_mmc_init(struct aw_mmc_softc *); static void aw_mmc_intr(void *); @@ -579,8 +580,46 @@ fail: static int aw_mmc_detach(device_t dev) { + struct aw_mmc_softc *sc; + device_t d; - return (EBUSY); + sc = device_get_softc(dev); + + clk_disable(sc->aw_clk_mmc); + clk_disable(sc->aw_clk_ahb); + hwreset_assert(sc->aw_rst_ahb); + + mmc_fdt_gpio_teardown(&sc->mmc_helper); + + callout_drain(&sc->aw_timeoutc); + + AW_MMC_LOCK(sc); + d = sc->child; + sc->child = NULL; + AW_MMC_UNLOCK(sc); + if (d != NULL) + device_delete_child(sc->aw_dev, d); + + aw_mmc_teardown_dma(sc); + + mtx_destroy(&sc->aw_mtx); + + bus_teardown_intr(dev, sc->aw_res[AW_MMC_IRQRES], sc->aw_intrhand); + bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); + +#ifdef MMCCAM + if (sc->sim != NULL) { + mtx_lock(&sc->sim_mtx); + xpt_bus_deregister(cam_sim_path(sc->sim)); + cam_sim_free(sc->sim, FALSE); + mtx_unlock(&sc->sim_mtx); + } + + if (sc->devq != NULL) + cam_simq_free(sc->devq); +#endif + + return (0); } static void @@ -655,6 +694,21 @@ aw_mmc_setup_dma(struct aw_mmc_softc *sc) } static void +aw_mmc_teardown_dma(struct aw_mmc_softc *sc) +{ + + bus_dmamap_unload(sc->aw_dma_tag, sc->aw_dma_map); + bus_dmamem_free(sc->aw_dma_tag, sc->aw_dma_desc, sc->aw_dma_map); + if (bus_dma_tag_destroy(sc->aw_dma_tag) != 0) + device_printf(sc->aw_dev, "Cannot destroy the dma tag\n"); + + bus_dmamap_unload(sc->aw_dma_buf_tag, sc->aw_dma_buf_map); + bus_dmamap_destroy(sc->aw_dma_buf_tag, sc->aw_dma_buf_map); + if (bus_dma_tag_destroy(sc->aw_dma_buf_tag) != 0) + device_printf(sc->aw_dev, "Cannot destroy the dma buf tag\n"); +} + +static void aw_dma_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int err) { int i; @@ -1531,3 +1585,4 @@ DRIVER_MODULE(aw_mmc, simplebus, aw_mmc_driver, aw_mmc #ifndef MMCCAM MMC_DECLARE_BRIDGE(aw_mmc); #endif +SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/dev/mmc/mmc_fdt_helpers.c ============================================================================== --- stable/12/sys/dev/mmc/mmc_fdt_helpers.c Fri Jun 19 18:05:14 2020 (r362400) +++ stable/12/sys/dev/mmc/mmc_fdt_helpers.c Fri Jun 19 18:10:39 2020 (r362401) @@ -225,6 +225,10 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node const char *cd_mode_str; dev = helper->dev; + + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &helper->cd_delayed_task, 0, + cd_card_task, helper); + /* * If the device is flagged as non-removable, set that slot option, and * set a flag to make sdhci_fdt_gpio_get_present() always return true. @@ -294,9 +298,6 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node } without_interrupts: - TIMEOUT_TASK_INIT(taskqueue_swi_giant, &helper->cd_delayed_task, 0, - cd_card_task, helper); - /* * If we have a readable gpio pin, but didn't successfully configure * gpio interrupts, setup a timeout task to poll the pin @@ -384,6 +385,8 @@ mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper) gpio_pin_release(helper->cd_pin); if (helper->cd_ires != NULL) bus_release_resource(helper->dev, SYS_RES_IRQ, 0, helper->cd_ires); + + taskqueue_drain_timeout(taskqueue_swi_giant, &helper->cd_delayed_task); } bool Modified: stable/12/sys/modules/allwinner/Makefile ============================================================================== --- stable/12/sys/modules/allwinner/Makefile Fri Jun 19 18:05:14 2020 (r362400) +++ stable/12/sys/modules/allwinner/Makefile Fri Jun 19 18:10:39 2020 (r362401) @@ -2,6 +2,7 @@ # Build modules specific to Allwinner. SUBDIR = \ + aw_mmc \ aw_pwm \ aw_rtc \ aw_rsb \ From owner-svn-src-all@freebsd.org Fri Jun 19 18:14:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2432335716; Fri, 19 Jun 2020 18:14:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pRm53f0nz4bqf; Fri, 19 Jun 2020 18:14:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7828B1F589; Fri, 19 Jun 2020 18:14:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIEjZt056626; Fri, 19 Jun 2020 18:14:45 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIEj5q056625; Fri, 19 Jun 2020 18:14:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191814.05JIEj5q056625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362402 - stable/12/sys/dev/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/mmc X-SVN-Commit-Revision: 362402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:14:45 -0000 Author: manu Date: Fri Jun 19 18:14:45 2020 New Revision: 362402 URL: https://svnweb.freebsd.org/changeset/base/362402 Log: MFC r360007: Revert r359965 This cause board without a cd-gpio to not schedule a card detection. Modified: stable/12/sys/dev/mmc/mmc_fdt_helpers.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mmc/mmc_fdt_helpers.c ============================================================================== --- stable/12/sys/dev/mmc/mmc_fdt_helpers.c Fri Jun 19 18:10:39 2020 (r362401) +++ stable/12/sys/dev/mmc/mmc_fdt_helpers.c Fri Jun 19 18:14:45 2020 (r362402) @@ -217,7 +217,7 @@ cd_card_task(void *arg, int pending __unused) /* * Card detect setup. */ -static bool +static void cd_setup(struct mmc_fdt_helper *helper, phandle_t node) { int pincaps; @@ -237,7 +237,7 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node helper->cd_disabled = true; if (bootverbose) device_printf(dev, "Non-removable media\n"); - return (false); + return; } /* @@ -250,14 +250,14 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node */ if (gpio_pin_get_by_ofw_property(dev, node, "cd-gpios", &helper->cd_pin)) - return (false); + return; if (gpio_pin_getcaps(helper->cd_pin, &pincaps) != 0 || !(pincaps & GPIO_PIN_INPUT)) { device_printf(dev, "Cannot read card-detect gpio pin; " "setting card-always-present flag.\n"); helper->cd_disabled = true; - return (false); + return; } /* @@ -314,8 +314,6 @@ without_interrupts: device_get_nameunit(helper->cd_pin->dev), helper->cd_pin->pin, cd_mode_str); } - - return (true); } /* @@ -357,16 +355,14 @@ mmc_fdt_gpio_setup(device_t dev, phandle_t node, struc helper->dev = dev; helper->cd_handler = handler; + cd_setup(helper, node); wp_setup(helper, node); - if (cd_setup(helper, node)) { - /* - * Schedule a card detection - */ - taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant, - &helper->cd_delayed_task, mstosbt(500), 0, C_PREL(2)); - } - + /* + * Schedule a card detection + */ + taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant, + &helper->cd_delayed_task, mstosbt(500), 0, C_PREL(2)); return (0); } From owner-svn-src-all@freebsd.org Fri Jun 19 18:25:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28B483355BD; Fri, 19 Jun 2020 18:25:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pS0T07qdz4cQQ; Fri, 19 Jun 2020 18:25:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFC511F562; Fri, 19 Jun 2020 18:25:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIPSk9062552; Fri, 19 Jun 2020 18:25:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIPSvh062548; Fri, 19 Jun 2020 18:25:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191825.05JIPSvh062548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362403 - in stable/12/sys/arm64: arm64 include X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys/arm64: arm64 include X-SVN-Commit-Revision: 362403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:25:29 -0000 Author: manu Date: Fri Jun 19 18:25:27 2020 New Revision: 362403 URL: https://svnweb.freebsd.org/changeset/base/362403 Log: MFC r350166: arm64: Implement HWCAP Add HWCAP support for arm64. defines are the same as in Linux and a userland program can use elf_aux_info to get the data. We only save the common denominator for all cores in case the big and little cluster have different support (this is known to exists even if we don't support those SoCs in FreeBSD) Modified: stable/12/sys/arm64/arm64/elf_machdep.c stable/12/sys/arm64/arm64/identcpu.c stable/12/sys/arm64/include/cpu.h stable/12/sys/arm64/include/elf.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/elf_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/elf_machdep.c Fri Jun 19 18:14:45 2020 (r362402) +++ stable/12/sys/arm64/arm64/elf_machdep.c Fri Jun 19 18:25:27 2020 (r362403) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include "linker_if.h" +u_long elf_hwcap; + static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, @@ -89,6 +91,7 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &elf_hwcap, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: stable/12/sys/arm64/arm64/identcpu.c ============================================================================== --- stable/12/sys/arm64/arm64/identcpu.c Fri Jun 19 18:14:45 2020 (r362402) +++ stable/12/sys/arm64/arm64/identcpu.c Fri Jun 19 18:25:27 2020 (r362403) @@ -44,8 +44,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static int ident_lock; +static void print_cpu_features(u_int cpu); +static u_long parse_cpu_features_hwcap(u_int cpu); char machine[] = "arm64"; @@ -398,10 +401,14 @@ update_user_regs(u_int cpu) } } +/* HWCAP */ +extern u_long elf_hwcap; + static void identify_cpu_sysinit(void *dummy __unused) { int cpu; + u_long hwcap; /* Create a user visible cpu description with safe values */ memset(&user_cpu_desc, 0, sizeof(user_cpu_desc)); @@ -413,6 +420,11 @@ identify_cpu_sysinit(void *dummy __unused) CPU_FOREACH(cpu) { print_cpu_features(cpu); + hwcap = parse_cpu_features_hwcap(cpu); + if (elf_hwcap == 0) + elf_hwcap = hwcap; + else + elf_hwcap &= hwcap; update_user_regs(cpu); } @@ -420,7 +432,95 @@ identify_cpu_sysinit(void *dummy __unused) } SYSINIT(idenrity_cpu, SI_SUB_SMP, SI_ORDER_ANY, identify_cpu_sysinit, NULL); -void +static u_long +parse_cpu_features_hwcap(u_int cpu) +{ + u_long hwcap = 0; + + if (ID_AA64ISAR0_DP(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_DP_IMPL) + hwcap |= HWCAP_ASIMDDP; + + if (ID_AA64ISAR0_SM4(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM4_IMPL) + hwcap |= HWCAP_SM4; + + if (ID_AA64ISAR0_SM3(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM3_IMPL) + hwcap |= HWCAP_SM3; + + if (ID_AA64ISAR0_RDM(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_RDM_IMPL) + hwcap |= HWCAP_ASIMDRDM; + + if (ID_AA64ISAR0_Atomic(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_Atomic_IMPL) + hwcap |= HWCAP_ATOMICS; + + if (ID_AA64ISAR0_CRC32(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) + hwcap |= HWCAP_CRC32; + + switch (ID_AA64ISAR0_SHA2(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_SHA2_BASE: + hwcap |= HWCAP_SHA2; + break; + case ID_AA64ISAR0_SHA2_512: + hwcap |= HWCAP_SHA2 | HWCAP_SHA512; + break; + default: + break; + } + + if (ID_AA64ISAR0_SHA1(cpu_desc[cpu].id_aa64isar0)) + hwcap |= HWCAP_SHA1; + + switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_AES_BASE: + hwcap |= HWCAP_AES; + break; + case ID_AA64ISAR0_AES_PMULL: + hwcap |= HWCAP_PMULL | HWCAP_AES; + break; + default: + break; + } + + if (ID_AA64ISAR1_LRCPC(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_LRCPC_IMPL) + hwcap |= HWCAP_LRCPC; + + if (ID_AA64ISAR1_FCMA(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_FCMA_IMPL) + hwcap |= HWCAP_FCMA; + + if (ID_AA64ISAR1_JSCVT(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_JSCVT_IMPL) + hwcap |= HWCAP_JSCVT; + + if (ID_AA64ISAR1_DPB(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_DPB_IMPL) + hwcap |= HWCAP_DCPOP; + + if (ID_AA64PFR0_SVE(cpu_desc[cpu].id_aa64pfr0) == ID_AA64PFR0_SVE_IMPL) + hwcap |= HWCAP_SVE; + + switch (ID_AA64PFR0_AdvSIMD(cpu_desc[cpu].id_aa64pfr0)) { + case ID_AA64PFR0_AdvSIMD_IMPL: + hwcap |= HWCAP_ASIMD; + break; + case ID_AA64PFR0_AdvSIMD_HP: + hwcap |= HWCAP_ASIMD | HWCAP_ASIMDDP; + break; + default: + break; + } + + switch (ID_AA64PFR0_FP(cpu_desc[cpu].id_aa64pfr0)) { + case ID_AA64PFR0_FP_IMPL: + hwcap |= HWCAP_FP; + break; + case ID_AA64PFR0_FP_HP: + hwcap |= HWCAP_FP | HWCAP_FPHP; + break; + default: + break; + } + + return (hwcap); +} + +static void print_cpu_features(u_int cpu) { struct sbuf *sb; @@ -473,9 +573,6 @@ print_cpu_features(u_int cpu) printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known " "hardware bugs that may cause the incorrect operation of " "atomic operations.\n"); - - if (cpu != 0 && cpu_print_regs == 0) - return; #define SEP_STR ((printed++) == 0) ? "" : "," Modified: stable/12/sys/arm64/include/cpu.h ============================================================================== --- stable/12/sys/arm64/include/cpu.h Fri Jun 19 18:14:45 2020 (r362402) +++ stable/12/sys/arm64/include/cpu.h Fri Jun 19 18:25:27 2020 (r362403) @@ -163,7 +163,6 @@ void cpu_reset(void) __dead2; void fork_trampoline(void); void identify_cpu(void); void install_cpu_errata(void); -void print_cpu_features(u_int); void swi_vm(void *v); #define CPU_AFFINITY(cpu) __cpu_affinity[(cpu)] Modified: stable/12/sys/arm64/include/elf.h ============================================================================== --- stable/12/sys/arm64/include/elf.h Fri Jun 19 18:14:45 2020 (r362402) +++ stable/12/sys/arm64/include/elf.h Fri Jun 19 18:25:27 2020 (r362403) @@ -114,4 +114,34 @@ __ElfType(Auxinfo); #define ET_DYN_LOAD_ADDR 0x100000 +/* HWCAP */ + +#define HWCAP_FP 0x00000001 +#define HWCAP_ASIMD 0x00000002 +#define HWCAP_EVTSTRM 0x00000004 +#define HWCAP_AES 0x00000008 +#define HWCAP_PMULL 0x00000010 +#define HWCAP_SHA1 0x00000020 +#define HWCAP_SHA2 0x00000040 +#define HWCAP_CRC32 0x00000080 +#define HWCAP_ATOMICS 0x00000100 +#define HWCAP_FPHP 0x00000200 +#define HWCAP_CPUID 0x00000400 +#define HWCAP_ASIMDRDM 0x00000800 +#define HWCAP_JSCVT 0x00001000 +#define HWCAP_FCMA 0x00002000 +#define HWCAP_LRCPC 0x00004000 +#define HWCAP_DCPOP 0x00008000 +#define HWCAP_SHA3 0x00010000 +#define HWCAP_SM3 0x00020000 +#define HWCAP_SM4 0x00040000 +#define HWCAP_ASIMDDP 0x00080000 +#define HWCAP_SHA512 0x00100000 +#define HWCAP_SVE 0x00200000 +#define HWCAP_ASIMDFHM 0x00400000 +#define HWCAP_DIT 0x00800000 +#define HWCAP_USCAT 0x01000000 +#define HWCAP_ILRCPC 0x02000000 +#define HWCAP_FLAGM 0x04000000 + #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-all@freebsd.org Fri Jun 19 18:27:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43CB23356FF; Fri, 19 Jun 2020 18:27:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pS2g19LTz4cth; Fri, 19 Jun 2020 18:27:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 237561F795; Fri, 19 Jun 2020 18:27:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIRNe1062688; Fri, 19 Jun 2020 18:27:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIRM8c062685; Fri, 19 Jun 2020 18:27:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191827.05JIRM8c062685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362404 - in stable/12/sys: arm/mv arm/nvidia dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/mv arm/nvidia dev/usb/controller X-SVN-Commit-Revision: 362404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:27:23 -0000 Author: manu Date: Fri Jun 19 18:27:22 2020 New Revision: 362404 URL: https://svnweb.freebsd.org/changeset/base/362404 Log: MFC r360013, r360018, r360021 r360013: arm: Fix duplicate ehci DRIVER_MODULE Name each ehci driver uniquely. This remove the warning printed at each arm boot : module_register: cannot register simplebus/ehci from kernel; already loaded from kernel A similar fix was done in r333074 but imx_ehci wasn't renamed and generic_ehci wasn't present at that time. r360018: arm: Fix duplicate pcib DRIVER_MODULE Name each pcib driver uniquely. This remove the warning printed at each arm boot : module_register: cannot register simplebus/pcib from kernel; already loaded from kernel r360021: arm: nvidia: pcie: Rename class name to pcib Reported by: jhb Modified: stable/12/sys/arm/mv/mv_pci.c stable/12/sys/arm/nvidia/tegra_pcie.c stable/12/sys/dev/usb/controller/ehci_imx.c stable/12/sys/dev/usb/controller/generic_ehci_fdt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/mv/mv_pci.c ============================================================================== --- stable/12/sys/arm/mv/mv_pci.c Fri Jun 19 18:25:27 2020 (r362403) +++ stable/12/sys/arm/mv/mv_pci.c Fri Jun 19 18:27:22 2020 (r362404) @@ -409,8 +409,8 @@ static driver_t mv_pcib_driver = { devclass_t pcib_devclass; -DRIVER_MODULE(pcib, ofwbus, mv_pcib_driver, pcib_devclass, 0, 0); -DRIVER_MODULE(pcib, pcib_ctrl, mv_pcib_driver, pcib_devclass, 0, 0); +DRIVER_MODULE(mv_pcib, ofwbus, mv_pcib_driver, pcib_devclass, 0, 0); +DRIVER_MODULE(mv_pcib, pcib_ctrl, mv_pcib_driver, pcib_devclass, 0, 0); static struct mtx pcicfg_mtx; Modified: stable/12/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- stable/12/sys/arm/nvidia/tegra_pcie.c Fri Jun 19 18:25:27 2020 (r362403) +++ stable/12/sys/arm/nvidia/tegra_pcie.c Fri Jun 19 18:27:22 2020 (r362404) @@ -1632,5 +1632,5 @@ static device_method_t tegra_pcib_methods[] = { static devclass_t pcib_devclass; DEFINE_CLASS_1(pcib, tegra_pcib_driver, tegra_pcib_methods, sizeof(struct tegra_pcib_softc), ofw_pci_driver); -DRIVER_MODULE(pcib, simplebus, tegra_pcib_driver, pcib_devclass, +DRIVER_MODULE(tegra_pcib, simplebus, tegra_pcib_driver, pcib_devclass, NULL, NULL); Modified: stable/12/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- stable/12/sys/dev/usb/controller/ehci_imx.c Fri Jun 19 18:25:27 2020 (r362403) +++ stable/12/sys/dev/usb/controller/ehci_imx.c Fri Jun 19 18:27:22 2020 (r362404) @@ -510,5 +510,5 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(imx_ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(imx_ehci, usb, 1, 1, 1); Modified: stable/12/sys/dev/usb/controller/generic_ehci_fdt.c ============================================================================== --- stable/12/sys/dev/usb/controller/generic_ehci_fdt.c Fri Jun 19 18:25:27 2020 (r362403) +++ stable/12/sys/dev/usb/controller/generic_ehci_fdt.c Fri Jun 19 18:27:22 2020 (r362404) @@ -251,5 +251,5 @@ DEFINE_CLASS_1(ehci, ehci_fdt_driver, ehci_fdt_methods static devclass_t ehci_fdt_devclass; -DRIVER_MODULE(ehci, simplebus, ehci_fdt_driver, ehci_fdt_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(generic_ehci, simplebus, ehci_fdt_driver, ehci_fdt_devclass, 0, 0); +MODULE_DEPEND(generic_ehci, usb, 1, 1, 1); From owner-svn-src-all@freebsd.org Fri Jun 19 18:34:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6D12335DA0; Fri, 19 Jun 2020 18:34:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pSBr5rR5z4d5C; Fri, 19 Jun 2020 18:34:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3DF31F736; Fri, 19 Jun 2020 18:34:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIYSM5068453; Fri, 19 Jun 2020 18:34:28 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIYR35068447; Fri, 19 Jun 2020 18:34:27 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191834.05JIYR35068447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 18:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362405 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc X-SVN-Commit-Revision: 362405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:34:29 -0000 Author: mmel Date: Fri Jun 19 18:34:27 2020 New Revision: 362405 URL: https://svnweb.freebsd.org/changeset/base/362405 Log: Finish renaming in if_dwc. By using DWC TRM terminology, normal descriptor format should be named extended and alternate descriptor format should be named normal. Should not been functional change. MFC after: 4 weeks Modified: head/sys/arm/allwinner/aw_if_dwc.c head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c head/sys/arm64/rockchip/if_dwc_rk.c head/sys/dev/altera/dwc/if_dwc_socfpga.c head/sys/dev/dwc/if_dwc.c head/sys/dev/dwc/if_dwc.h head/sys/dev/dwc/if_dwc_if.m Modified: head/sys/arm/allwinner/aw_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/aw_if_dwc.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/arm/allwinner/aw_if_dwc.c Fri Jun 19 18:34:27 2020 (r362405) @@ -114,7 +114,7 @@ static int a20_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Fri Jun 19 18:34:27 2020 (r362405) @@ -66,7 +66,7 @@ static int aml8726_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- head/sys/arm64/rockchip/if_dwc_rk.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/arm64/rockchip/if_dwc_rk.c Fri Jun 19 18:34:27 2020 (r362405) @@ -160,7 +160,7 @@ static int if_dwc_rk_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: head/sys/dev/altera/dwc/if_dwc_socfpga.c ============================================================================== --- head/sys/dev/altera/dwc/if_dwc_socfpga.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/altera/dwc/if_dwc_socfpga.c Fri Jun 19 18:34:27 2020 (r362405) @@ -74,7 +74,7 @@ static int if_dwc_socfpga_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/dwc/if_dwc.c Fri Jun 19 18:34:27 2020 (r362405) @@ -249,7 +249,7 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_ad flags = 0; --sc->txcount; } else { - if (sc->mactype == DWC_GMAC_ALT_DESC) + if (sc->mactype != DWC_GMAC_EXT_DESC) flags = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS | NTDESC1_IC; else @@ -259,7 +259,7 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_ad } sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { sc->txdesc_ring[idx].desc0 = 0; sc->txdesc_ring[idx].desc1 = flags | len; } else { @@ -537,7 +537,7 @@ dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_ad nidx = next_rxidx(sc, idx); sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); - if (sc->mactype == DWC_GMAC_ALT_DESC) + if (sc->mactype != DWC_GMAC_EXT_DESC) sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | RX_MAX_PACKET; else sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | MCLBYTES; @@ -661,7 +661,7 @@ dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_i crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN); /* Take lower 8 bits and reverse it */ val = bitreverse(~crc & 0xff); - if (ctx->sc->mactype == DWC_GMAC_ALT_DESC) + if (ctx->sc->mactype != DWC_GMAC_EXT_DESC) val >>= 2; /* Only need lower 6 bits */ hashreg = (val >> 5); hashbit = (val & 31); @@ -682,7 +682,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - nhash = sc->mactype == DWC_GMAC_ALT_DESC ? 2 : 8; + nhash = sc->mactype != DWC_GMAC_EXT_DESC ? 2 : 8; /* * Set the multicast (group) filter hash. @@ -715,7 +715,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_LOW(0), lo); WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]); WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]); } else { @@ -1260,7 +1260,7 @@ dwc_attach(device_t dev) return (ENXIO); } - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { reg = BUS_MODE_FIXEDBURST; reg |= (BUS_MODE_PRIORXTX_41 << BUS_MODE_PRIORXTX_SHIFT); } else Modified: head/sys/dev/dwc/if_dwc.h ============================================================================== --- head/sys/dev/dwc/if_dwc.h Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/dwc/if_dwc.h Fri Jun 19 18:34:27 2020 (r362405) @@ -272,8 +272,9 @@ #define CURRENT_HOST_RECEIVE_BUF_ADDR 0x1054 #define HW_FEATURE 0x1058 -#define DWC_GMAC 0x1 -#define DWC_GMAC_ALT_DESC 0x2 +#define DWC_GMAC_NORMAL_DESC 0x1 +#define DWC_GMAC_EXT_DESC 0x2 + #define GMAC_MII_CLK_60_100M_DIV42 0x0 #define GMAC_MII_CLK_100_150M_DIV62 0x1 #define GMAC_MII_CLK_25_35M_DIV16 0x2 Modified: head/sys/dev/dwc/if_dwc_if.m ============================================================================== --- head/sys/dev/dwc/if_dwc_if.m Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/dwc/if_dwc_if.m Fri Jun 19 18:34:27 2020 (r362405) @@ -41,7 +41,7 @@ CODE { static int if_dwc_default_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int From owner-svn-src-all@freebsd.org Fri Jun 19 18:36:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 203BE335A79; Fri, 19 Jun 2020 18:36:12 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pSDq75J3z4dPC; Fri, 19 Jun 2020 18:36:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB9C1F934; Fri, 19 Jun 2020 18:36:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIaBi0068593; Fri, 19 Jun 2020 18:36:11 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIaBmr068589; Fri, 19 Jun 2020 18:36:11 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202006191836.05JIaBmr068589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 19 Jun 2020 18:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362406 - in head: share/man/man4/man4.powerpc sys/dev/powermac_nvram usr.sbin/nvram X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head: share/man/man4/man4.powerpc sys/dev/powermac_nvram usr.sbin/nvram X-SVN-Commit-Revision: 362406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:36:12 -0000 Author: bdragon Date: Fri Jun 19 18:36:10 2020 New Revision: 362406 URL: https://svnweb.freebsd.org/changeset/base/362406 Log: [PowerPC] De-giant powermac_nvram, update documentation * Remove the giant lock requirement from powermac_nvram. * Update manual pages to reflect current state. Reviewed by: bcr (manpages), jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D24812 Modified: head/share/man/man4/man4.powerpc/powermac_nvram.4 head/sys/dev/powermac_nvram/powermac_nvram.c head/sys/dev/powermac_nvram/powermac_nvramvar.h head/usr.sbin/nvram/nvram.8 Modified: head/share/man/man4/man4.powerpc/powermac_nvram.4 ============================================================================== --- head/share/man/man4/man4.powerpc/powermac_nvram.4 Fri Jun 19 18:34:27 2020 (r362405) +++ head/share/man/man4/man4.powerpc/powermac_nvram.4 Fri Jun 19 18:36:10 2020 (r362406) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2010 +.Dd June 19, 2020 .Dt POWERMAC_NVRAM 4 powerpc .Os .Sh NAME @@ -50,8 +50,10 @@ The .Nm driver provides access to the Open Firmware configuration NVRAM available on the Apple PowerPC-based machines. +.Pp +This driver currently supports "Core99" machines containing a Sharp, Micron, +or AMD NVRAM. .Sh SEE ALSO -.Xr eeprom 8 , .Xr nvram 8 .Sh HISTORY The Modified: head/sys/dev/powermac_nvram/powermac_nvram.c ============================================================================== --- head/sys/dev/powermac_nvram/powermac_nvram.c Fri Jun 19 18:34:27 2020 (r362405) +++ head/sys/dev/powermac_nvram/powermac_nvram.c Fri Jun 19 18:36:10 2020 (r362406) @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include @@ -99,7 +101,6 @@ static d_write_t powermac_nvram_write; static struct cdevsw powermac_nvram_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = powermac_nvram_open, .d_close = powermac_nvram_close, .d_read = powermac_nvram_read, @@ -180,6 +181,8 @@ powermac_nvram_attach(device_t dev) "powermac_nvram"); sc->sc_cdev->si_drv1 = sc; + sx_init(&sc->sc_lock, "powermac_nvram"); + return 0; } @@ -195,6 +198,8 @@ powermac_nvram_detach(device_t dev) if (sc->sc_cdev != NULL) destroy_dev(sc->sc_cdev); + + sx_destroy(&sc->sc_lock); return 0; } @@ -203,11 +208,17 @@ static int powermac_nvram_open(struct cdev *dev, int flags, int fmt, struct thread *td) { struct powermac_nvram_softc *sc = dev->si_drv1; + int err; + err = 0; + sx_xlock(&sc->sc_lock); if (sc->sc_isopen) - return EBUSY; - sc->sc_isopen = 1; + err = EBUSY; + else + sc->sc_isopen = 1; sc->sc_rpos = sc->sc_wpos = 0; + sx_xunlock(&sc->sc_lock); + return 0; } @@ -218,10 +229,12 @@ powermac_nvram_close(struct cdev *dev, int fflag, int struct core99_header *header; vm_offset_t bank; + sx_xlock(&sc->sc_lock); if (sc->sc_wpos != sizeof(sc->sc_data)) { /* Short write, restore in-memory copy */ bcopy((void *)sc->sc_bank, (void *)sc->sc_data, NVRAM_SIZE); sc->sc_isopen = 0; + sx_xunlock(&sc->sc_lock); return 0; } @@ -242,10 +255,12 @@ powermac_nvram_close(struct cdev *dev, int fflag, int if (erase_bank(sc->sc_dev, (uint8_t *)bank) != 0 || write_bank(sc->sc_dev, (uint8_t *)bank, sc->sc_data) != 0) { sc->sc_isopen = 0; + sx_xunlock(&sc->sc_lock); return ENOSPC; } sc->sc_bank = bank; sc->sc_isopen = 0; + sx_xunlock(&sc->sc_lock); return 0; } @@ -256,6 +271,8 @@ powermac_nvram_read(struct cdev *dev, struct uio *uio, struct powermac_nvram_softc *sc = dev->si_drv1; rv = 0; + + sx_xlock(&sc->sc_lock); while (uio->uio_resid > 0) { data_available = sizeof(sc->sc_data) - sc->sc_rpos; if (data_available > 0) { @@ -269,6 +286,8 @@ powermac_nvram_read(struct cdev *dev, struct uio *uio, break; } } + sx_xunlock(&sc->sc_lock); + return rv; } @@ -282,6 +301,8 @@ powermac_nvram_write(struct cdev *dev, struct uio *uio return EINVAL; rv = 0; + + sx_xlock(&sc->sc_lock); while (uio->uio_resid > 0) { data_available = sizeof(sc->sc_data) - sc->sc_wpos; if (data_available > 0) { @@ -295,6 +316,8 @@ powermac_nvram_write(struct cdev *dev, struct uio *uio break; } } + sx_xunlock(&sc->sc_lock); + return rv; } @@ -500,6 +523,8 @@ erase_bank(device_t dev, uint8_t *bank) struct powermac_nvram_softc *sc; sc = device_get_softc(dev); + + sx_assert(&sc->sc_lock, SA_XLOCKED); if (sc->sc_type == FLASH_TYPE_AMD) return (erase_bank_amd(dev, bank)); else @@ -512,6 +537,8 @@ write_bank(device_t dev, uint8_t *bank, uint8_t *data) struct powermac_nvram_softc *sc; sc = device_get_softc(dev); + + sx_assert(&sc->sc_lock, SA_XLOCKED); if (sc->sc_type == FLASH_TYPE_AMD) return (write_bank_amd(dev, bank, data)); else Modified: head/sys/dev/powermac_nvram/powermac_nvramvar.h ============================================================================== --- head/sys/dev/powermac_nvram/powermac_nvramvar.h Fri Jun 19 18:34:27 2020 (r362405) +++ head/sys/dev/powermac_nvram/powermac_nvramvar.h Fri Jun 19 18:36:10 2020 (r362406) @@ -49,6 +49,7 @@ struct powermac_nvram_softc { device_t sc_dev; + struct sx sc_lock; phandle_t sc_node; vm_offset_t sc_bank; vm_offset_t sc_bank0; Modified: head/usr.sbin/nvram/nvram.8 ============================================================================== --- head/usr.sbin/nvram/nvram.8 Fri Jun 19 18:34:27 2020 (r362405) +++ head/usr.sbin/nvram/nvram.8 Fri Jun 19 18:36:10 2020 (r362406) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2006 +.Dd June 19, 2020 .Dt NVRAM 8 powerpc .Os .Sh NAME @@ -98,8 +98,7 @@ to .Pp .Dl "nvram -d foo -d bar baz=100" .Sh SEE ALSO -.Xr powermac_nvram 4 , -.Xr eeprom 8 +.Xr powermac_nvram 4 .Sh HISTORY The .Nm @@ -111,8 +110,3 @@ Darwin/Mac OS X utility. .Sh AUTHORS .An Maxim Sobolev Aq Mt sobomax@FreeBSD.org -.Sh BUGS -Currently, -.Nm -only supports systems equipped with AMD flash and is only tested on Apple -G4-based Mac Mini machines. From owner-svn-src-all@freebsd.org Fri Jun 19 18:40:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E6FB335F3C; Fri, 19 Jun 2020 18:40:40 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pSKz6j7qz4dhC; Fri, 19 Jun 2020 18:40:39 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8F571F8E3; Fri, 19 Jun 2020 18:40:39 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIedWs068866; Fri, 19 Jun 2020 18:40:39 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIedq8068864; Fri, 19 Jun 2020 18:40:39 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202006191840.05JIedq8068864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 19 Jun 2020 18:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362407 - in head/sys/powerpc: booke include X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys/powerpc: booke include X-SVN-Commit-Revision: 362407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:40:40 -0000 Author: bdragon Date: Fri Jun 19 18:40:39 2020 New Revision: 362407 URL: https://svnweb.freebsd.org/changeset/base/362407 Log: [PowerPC] Fix booke64 qemu infinite loop in L2 cache enable Since qemu does not implement the L2 cache, we get stuck forever waiting for a bit to be set when trying to invalidate it. To prevent that, we should bail out if the L2 cache is missing. One easy way to check this is L2CFG0 == 0 (since L2CSIZE always has at least one bit set in a valid implementation) (tested on qemu, rb800, and x5000) Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D25225 Modified: head/sys/powerpc/booke/machdep_e500.c head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/booke/machdep_e500.c ============================================================================== --- head/sys/powerpc/booke/machdep_e500.c Fri Jun 19 18:36:10 2020 (r362406) +++ head/sys/powerpc/booke/machdep_e500.c Fri Jun 19 18:40:39 2020 (r362407) @@ -91,7 +91,17 @@ booke_enable_l2_cache(void) if ((((mfpvr() >> 16) & 0xFFFF) == FSL_E500mc) || (((mfpvr() >> 16) & 0xFFFF) == FSL_E5500)) { csr = mfspr(SPR_L2CSR0); - if ((csr & L2CSR0_L2E) == 0) { + /* + * Don't actually attempt to manipulate the L2 cache if + * L2CFG0 is zero. + * + * Any chip with a working L2 cache will have a nonzero + * L2CFG0, as it will have a nonzero L2CSIZE field. + * + * This fixes waiting forever for cache enable in qemu, + * which does not implement the L2 cache. + */ + if (mfspr(SPR_L2CFG0) != 0 && (csr & L2CSR0_L2E) == 0) { l2cache_inval(); l2cache_enable(); } Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Fri Jun 19 18:36:10 2020 (r362406) +++ head/sys/powerpc/include/spr.h Fri Jun 19 18:40:39 2020 (r362407) @@ -887,6 +887,7 @@ #define L1CSR1_ICFI 0x00000002 /* Instruction Cache Flash Invalidate */ #define L1CSR1_ICE 0x00000001 /* Instruction Cache Enable */ +#define SPR_L2CFG0 0x207 /* ..8 L2 Configuration Register 0 */ #define SPR_L2CSR0 0x3F9 /* ..8 L2 Cache Control and Status Register 0 */ #define L2CSR0_L2E 0x80000000 /* L2 Cache Enable */ #define L2CSR0_L2PE 0x40000000 /* L2 Cache Parity Enable */ From owner-svn-src-all@freebsd.org Fri Jun 19 18:43:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67FCE335F62; Fri, 19 Jun 2020 18:43:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pSNr0d6pz4f9k; Fri, 19 Jun 2020 18:43:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FCA51FB91; Fri, 19 Jun 2020 18:43:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIh782075244; Fri, 19 Jun 2020 18:43:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIh3GA075218; Fri, 19 Jun 2020 18:43:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191843.05JIh3GA075218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362408 - in stable/12: . release/arm64 sys/arm/allwinner sys/dts/arm/overlays sys/dts/arm64/overlays sys/gnu/dts/arm sys/gnu/dts/arm64/actions sys/gnu/dts/arm64/allwinner sys/gnu/dts/a... X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12: . release/arm64 sys/arm/allwinner sys/dts/arm/overlays sys/dts/arm64/overlays sys/gnu/dts/arm sys/gnu/dts/arm64/actions sys/gnu/dts/arm64/allwinner sys/gnu/dts/arm64/altera sys/gnu/dts/a... X-SVN-Commit-Revision: 362408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:43:08 -0000 Author: manu Date: Fri Jun 19 18:43:02 2020 New Revision: 362408 URL: https://svnweb.freebsd.org/changeset/base/362408 Log: MFC r358430, r359934-r359936, r359939, r359969, r360093 r358430: dts: Update our copy for arm, arm64 and riscv dts to Linux 5.5 r359934: dts: Import DTS from Linux 5.6 r359935: allwinner: aw_thermal: Cope with DTS changes The upstream DTS now include the thermal device node and the SID calibration entry. Update our driver to cope with this change and remove the DTB overlays that aren't needed anymore. X-MFC-With: r359934 r359936: modules: dtb: allwinner: Remove non existant files Those files have been removed in r359935. X-MFC-With: r359935 r359939: modules: dtb: allwinner: Remove sun50i-a64-sid.dtso File was removed in r359935 X-MFC-With: r359935 r359969: arm: allwinner: aw_sid: Fix thermal calibration size for A64 This fixes the aw_thermal driver on A64 SoC. X-MFC-With: r359935 r360093: release: arm64: Remove DTSO for Allwinner boards Both SID and THS dts node are now in the main dts and the DTSO have been removed in r359935 X-MFC-With: r359935 Added: stable/12/sys/gnu/dts/arm/am335x-netcan-plus-1xx.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/am335x-netcan-plus-1xx.dts stable/12/sys/gnu/dts/arm/am335x-netcom-plus-2xx.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/am335x-netcom-plus-2xx.dts stable/12/sys/gnu/dts/arm/am335x-netcom-plus-8xx.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/am335x-netcom-plus-8xx.dts stable/12/sys/gnu/dts/arm/am3703.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/am3703.dtsi stable/12/sys/gnu/dts/arm/am3715.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/am3715.dtsi stable/12/sys/gnu/dts/arm/armada-385-clearfog-gtr-l8.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/armada-385-clearfog-gtr-l8.dts stable/12/sys/gnu/dts/arm/armada-385-clearfog-gtr-s4.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/armada-385-clearfog-gtr-s4.dts stable/12/sys/gnu/dts/arm/armada-385-clearfog-gtr.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/armada-385-clearfog-gtr.dtsi stable/12/sys/gnu/dts/arm/aspeed-bmc-ibm-rainier.dts - copied, changed from r358430, head/sys/gnu/dts/arm/aspeed-bmc-ibm-rainier.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-tacoma.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/aspeed-bmc-opp-tacoma.dts stable/12/sys/gnu/dts/arm/ast2500-facebook-netbmc-common.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm/ast2500-facebook-netbmc-common.dtsi stable/12/sys/gnu/dts/arm/at91-kizbox2-2.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/at91-kizbox2-2.dts stable/12/sys/gnu/dts/arm/at91-kizbox2-common.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/at91-kizbox2-common.dtsi stable/12/sys/gnu/dts/arm/at91-kizbox3-hs.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/at91-kizbox3-hs.dts stable/12/sys/gnu/dts/arm/at91-kizbox3_common.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/at91-kizbox3_common.dtsi stable/12/sys/gnu/dts/arm/at91-kizboxmini-base.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-kizboxmini-base.dts stable/12/sys/gnu/dts/arm/at91-kizboxmini-common.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-kizboxmini-common.dtsi stable/12/sys/gnu/dts/arm/at91-kizboxmini-mb.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-kizboxmini-mb.dts stable/12/sys/gnu/dts/arm/at91-kizboxmini-rd.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-kizboxmini-rd.dts stable/12/sys/gnu/dts/arm/at91-sam9x60ek.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-sam9x60ek.dts stable/12/sys/gnu/dts/arm/at91-sama5d27_wlsom1.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-sama5d27_wlsom1.dtsi stable/12/sys/gnu/dts/arm/at91-sama5d27_wlsom1_ek.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-sama5d27_wlsom1_ek.dts stable/12/sys/gnu/dts/arm/at91-smartkiz.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/at91-smartkiz.dts stable/12/sys/gnu/dts/arm/bcm2711-rpi-4-b.dts - copied, changed from r358430, head/sys/gnu/dts/arm/bcm2711-rpi-4-b.dts stable/12/sys/gnu/dts/arm/bcm2711.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm/bcm2711.dtsi stable/12/sys/gnu/dts/arm/bcm2835-common.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm/bcm2835-common.dtsi stable/12/sys/gnu/dts/arm/bcm283x-rpi-usb-peripheral.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/bcm283x-rpi-usb-peripheral.dtsi stable/12/sys/gnu/dts/arm/bcm47094-luxul-xwc-2000.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/bcm47094-luxul-xwc-2000.dts stable/12/sys/gnu/dts/arm/dm3725.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/dm3725.dtsi stable/12/sys/gnu/dts/arm/e60k02.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm/e60k02.dtsi stable/12/sys/gnu/dts/arm/imx6dl-gw5907.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6dl-gw5907.dts stable/12/sys/gnu/dts/arm/imx6dl-gw5910.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6dl-gw5910.dts stable/12/sys/gnu/dts/arm/imx6dl-gw5912.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6dl-gw5912.dts stable/12/sys/gnu/dts/arm/imx6dl-gw5913.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6dl-gw5913.dts stable/12/sys/gnu/dts/arm/imx6q-gw5907.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6q-gw5907.dts stable/12/sys/gnu/dts/arm/imx6q-gw5910.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6q-gw5910.dts stable/12/sys/gnu/dts/arm/imx6q-gw5912.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6q-gw5912.dts stable/12/sys/gnu/dts/arm/imx6q-gw5913.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6q-gw5913.dts stable/12/sys/gnu/dts/arm/imx6qdl-gw5907.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6qdl-gw5907.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw5910.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6qdl-gw5910.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw5912.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6qdl-gw5912.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw5913.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6qdl-gw5913.dtsi stable/12/sys/gnu/dts/arm/imx6sl-tolino-shine3.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx6sl-tolino-shine3.dts stable/12/sys/gnu/dts/arm/imx6sll-kobo-clarahd.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6sll-kobo-clarahd.dts stable/12/sys/gnu/dts/arm/imx6ul-imx6ull-opos6ul.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ul-imx6ull-opos6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ul-imx6ull-opos6uldev.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ul-imx6ull-opos6uldev.dtsi stable/12/sys/gnu/dts/arm/imx6ul-kontron-n6311-s.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ul-kontron-n6311-s.dts stable/12/sys/gnu/dts/arm/imx6ul-kontron-n6311-som.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ul-kontron-n6311-som.dtsi stable/12/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-s.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-s.dtsi stable/12/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-som-common.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-som-common.dtsi stable/12/sys/gnu/dts/arm/imx6ull-kontron-n6411-s.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ull-kontron-n6411-s.dts stable/12/sys/gnu/dts/arm/imx6ull-kontron-n6411-som.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ull-kontron-n6411-som.dtsi stable/12/sys/gnu/dts/arm/imx6ull-opos6ul.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ull-opos6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ull-opos6uldev.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/imx6ull-opos6uldev.dts stable/12/sys/gnu/dts/arm/imx7ulp-com.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/imx7ulp-com.dts stable/12/sys/gnu/dts/arm/mmp3-dell-ariel.dts - copied, changed from r358430, head/sys/gnu/dts/arm/mmp3-dell-ariel.dts stable/12/sys/gnu/dts/arm/mmp3.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm/mmp3.dtsi stable/12/sys/gnu/dts/arm/motorola-mapphone-common.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm/motorola-mapphone-common.dtsi stable/12/sys/gnu/dts/arm/omap3-echo.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/omap3-echo.dts stable/12/sys/gnu/dts/arm/omap4-droid-bionic-xt875.dts - copied unchanged from r358430, head/sys/gnu/dts/arm/omap4-droid-bionic-xt875.dts stable/12/sys/gnu/dts/arm/openbmc-flash-layout-128.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/openbmc-flash-layout-128.dtsi stable/12/sys/gnu/dts/arm/rk3288-veyron-broadcom-bluetooth.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/rk3288-veyron-broadcom-bluetooth.dtsi stable/12/sys/gnu/dts/arm/rockchip-radxa-dalang-carrier.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/rockchip-radxa-dalang-carrier.dtsi stable/12/sys/gnu/dts/arm/sam9x60.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/sam9x60.dtsi stable/12/sys/gnu/dts/arm/ste-ab8505.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-ab8505.dtsi stable/12/sys/gnu/dts/arm/ste-db8500.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-db8500.dtsi stable/12/sys/gnu/dts/arm/ste-db8520.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-db8520.dtsi stable/12/sys/gnu/dts/arm/ste-dbx5x0-pinctrl.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-dbx5x0-pinctrl.dtsi stable/12/sys/gnu/dts/arm/ste-href-tvk1281618-r2.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-href-tvk1281618-r2.dtsi stable/12/sys/gnu/dts/arm/ste-href-tvk1281618-r3.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-href-tvk1281618-r3.dtsi stable/12/sys/gnu/dts/arm/ste-href520-tvk.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-href520-tvk.dts stable/12/sys/gnu/dts/arm/ste-ux500-samsung-golden.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/ste-ux500-samsung-golden.dts stable/12/sys/gnu/dts/arm/stm32mp15-pinctrl.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp15-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp151.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp151.dtsi stable/12/sys/gnu/dts/arm/stm32mp153.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp153.dtsi stable/12/sys/gnu/dts/arm/stm32mp157.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp157.dtsi stable/12/sys/gnu/dts/arm/stm32mp15xc.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp15xc.dtsi stable/12/sys/gnu/dts/arm/stm32mp15xx-dkx.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp15xx-dkx.dtsi stable/12/sys/gnu/dts/arm/stm32mp15xxaa-pinctrl.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp15xxaa-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp15xxab-pinctrl.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp15xxab-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp15xxac-pinctrl.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp15xxac-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp15xxad-pinctrl.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/stm32mp15xxad-pinctrl.dtsi stable/12/sys/gnu/dts/arm/sun8i-h3-emlid-neutis-n5h3-devboard.dts - copied unchanged from r359936, head/sys/gnu/dts/arm/sun8i-h3-emlid-neutis-n5h3-devboard.dts stable/12/sys/gnu/dts/arm/sun8i-h3-emlid-neutis-n5h3.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/sun8i-h3-emlid-neutis-n5h3.dtsi stable/12/sys/gnu/dts/arm/sun8i-h3-nanopi-duo2.dts - copied, changed from r358430, head/sys/gnu/dts/arm/sun8i-h3-nanopi-duo2.dts stable/12/sys/gnu/dts/arm/sunxi-h3-h5-emlid-neutis.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/sunxi-h3-h5-emlid-neutis.dtsi stable/12/sys/gnu/dts/arm/sunxi-libretech-all-h3-it.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm/sunxi-libretech-all-h3-it.dtsi stable/12/sys/gnu/dts/arm/tegra20-cpu-opp-microvolt.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/tegra20-cpu-opp-microvolt.dtsi stable/12/sys/gnu/dts/arm/tegra20-cpu-opp.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/tegra20-cpu-opp.dtsi stable/12/sys/gnu/dts/arm/tegra30-cpu-opp-microvolt.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/tegra30-cpu-opp-microvolt.dtsi stable/12/sys/gnu/dts/arm/tegra30-cpu-opp.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm/tegra30-cpu-opp.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-cpu-opp.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/allwinner/sun50i-a64-cpu-opp.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-libretech-all-h3-it.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/allwinner/sun50i-h5-libretech-all-h3-it.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-libretech-all-h5-cc.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/allwinner/sun50i-h5-libretech-all-h5-cc.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64-model-b.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64-model-b.dts stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk_nand.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk_nand.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-a1-ad401.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/amlogic/meson-a1-ad401.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-a1.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm64/amlogic/meson-a1.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-g12.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm64/amlogic/meson-g12.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b-ugoos-am6.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/amlogic/meson-g12b-ugoos-am6.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gx-libretech-pc.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/amlogic/meson-gx-libretech-pc.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-kii-pro.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/amlogic/meson-gxbb-kii-pro.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-libretech-pc.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-libretech-pc.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-s912-libretech-pc.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/amlogic/meson-gxm-s912-libretech-pc.dts stable/12/sys/gnu/dts/arm64/broadcom/bcm2711-rpi-4-b.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/broadcom/bcm2711-rpi-4-b.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-cex7.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-cex7.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-clearfog-cx.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-clearfog-cx.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-clearfog-itx.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-clearfog-itx.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-honeycomb.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-honeycomb.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mn-evk.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/freescale/imx8mn-evk.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mn-evk.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm64/freescale/imx8mn-evk.dtsi stable/12/sys/gnu/dts/arm64/freescale/imx8mq-phanbell.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/freescale/imx8mq-phanbell.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mq-thor96.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/freescale/imx8mq-thor96.dts stable/12/sys/gnu/dts/arm64/freescale/imx8qxp-colibri-eval-v3.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/freescale/imx8qxp-colibri-eval-v3.dts stable/12/sys/gnu/dts/arm64/freescale/imx8qxp-colibri-eval-v3.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/freescale/imx8qxp-colibri-eval-v3.dtsi stable/12/sys/gnu/dts/arm64/freescale/imx8qxp-colibri.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/freescale/imx8qxp-colibri.dtsi stable/12/sys/gnu/dts/arm64/freescale/s32v234-evb.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/freescale/s32v234-evb.dts stable/12/sys/gnu/dts/arm64/freescale/s32v234.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/freescale/s32v234.dtsi stable/12/sys/gnu/dts/arm64/intel/socfpga_agilex_socdk_nand.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/intel/socfpga_agilex_socdk_nand.dts stable/12/sys/gnu/dts/arm64/marvell/armada-3720-espressobin-emmc.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin-emmc.dts stable/12/sys/gnu/dts/arm64/marvell/armada-3720-espressobin-v7-emmc.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin-v7-emmc.dts stable/12/sys/gnu/dts/arm64/marvell/armada-3720-espressobin-v7.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin-v7.dts stable/12/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap807-quad.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-ap807-quad.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap807.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-ap807.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap80x.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-ap80x.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-cp115.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-cp115.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-cp11x.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/armada-cp11x.dtsi stable/12/sys/gnu/dts/arm64/marvell/cn9130-db.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/cn9130-db.dts stable/12/sys/gnu/dts/arm64/marvell/cn9130.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/cn9130.dtsi stable/12/sys/gnu/dts/arm64/marvell/cn9131-db.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/cn9131-db.dts stable/12/sys/gnu/dts/arm64/marvell/cn9132-db.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/marvell/cn9132-db.dts stable/12/sys/gnu/dts/arm64/qcom/apq8096-ifc6640.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/qcom/apq8096-ifc6640.dts stable/12/sys/gnu/dts/arm64/qcom/pm6150.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/qcom/pm6150.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm6150l.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/qcom/pm6150l.dtsi stable/12/sys/gnu/dts/arm64/qcom/sc7180-idp.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/qcom/sc7180-idp.dts stable/12/sys/gnu/dts/arm64/qcom/sc7180.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/qcom/sc7180.dtsi stable/12/sys/gnu/dts/arm64/realtek/rtd1293-ds418j.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/realtek/rtd1293-ds418j.dts stable/12/sys/gnu/dts/arm64/realtek/rtd1293.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/realtek/rtd1293.dtsi stable/12/sys/gnu/dts/arm64/realtek/rtd1296-ds418.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/realtek/rtd1296-ds418.dts stable/12/sys/gnu/dts/arm64/realtek/rtd1296.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/realtek/rtd1296.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a774b1-hihope-rzg2n-ex.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/renesas/r8a774b1-hihope-rzg2n-ex.dts stable/12/sys/gnu/dts/arm64/renesas/r8a774b1-hihope-rzg2n.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/renesas/r8a774b1-hihope-rzg2n.dts stable/12/sys/gnu/dts/arm64/renesas/r8a774b1.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm64/renesas/r8a774b1.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a774c0-ek874-idk-2121wr.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a774c0-ek874-idk-2121wr.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77950-salvator-x.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77950-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77950-ulcb-kf.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77950-ulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77950-ulcb.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77950-ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77950.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77950.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77951-salvator-x.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77951-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77951-salvator-xs.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77951-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77951-ulcb-kf.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77951-ulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77951-ulcb.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77951-ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77951.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77951.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77960-salvator-x.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77960-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77960-salvator-xs.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77960-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77960-ulcb-kf.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77960-ulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77960-ulcb.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77960-ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77960.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77960.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77961-salvator-xs.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/renesas/r8a77961-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77961.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm64/renesas/r8a77961.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77965-ulcb-kf.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77965-ulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77965-ulcb.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/renesas/r8a77965-ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/rzg2-advantech-idk-1110wr-panel.dtsi - copied unchanged from r358430, head/sys/gnu/dts/arm64/renesas/rzg2-advantech-idk-1110wr-panel.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3308-evb.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/rockchip/rk3308-evb.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3308-roc-cc.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/rockchip/rk3308-roc-cc.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3308.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm64/rockchip/rk3308.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3328-a1.dts - copied unchanged from r358430, head/sys/gnu/dts/arm64/rockchip/rk3328-a1.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc-mezzanine.dts - copied, changed from r358430, head/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc-mezzanine.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc.dtsi - copied, changed from r358430, head/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64-v2.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64-v2.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399pro-rock-pi-n10.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/rockchip/rk3399pro-rock-pi-n10.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399pro-vmarc-som.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/rockchip/rk3399pro-vmarc-som.dtsi stable/12/sys/gnu/dts/arm64/sprd/sc9863a.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/sprd/sc9863a.dtsi stable/12/sys/gnu/dts/arm64/sprd/sharkl3.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/sprd/sharkl3.dtsi stable/12/sys/gnu/dts/arm64/sprd/sp9863a-1h10.dts - copied unchanged from r359936, head/sys/gnu/dts/arm64/sprd/sp9863a-1h10.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-clk-ccf.dtsi - copied unchanged from r359936, head/sys/gnu/dts/arm64/xilinx/zynqmp-clk-ccf.dtsi stable/12/sys/gnu/dts/include/dt-bindings/clock/bm1880-clock.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/clock/bm1880-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8mp-clock.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/imx8mp-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/meson8-ddr-clkc.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/meson8-ddr-clkc.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,dispcc-sc7180.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,dispcc-sc7180.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq6018.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq6018.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sc7180.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sc7180.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gpucc-sc7180.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gpucc-sc7180.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8998.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8998.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,q6sstopcc-qcs404.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/clock/qcom,q6sstopcc-qcs404.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,videocc-sc7180.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,videocc-sc7180.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a774b1-cpg-mssr.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/clock/r8a774b1-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77961-cpg-mssr.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/clock/r8a77961-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/ti-dra7-atl.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/ti-dra7-atl.h stable/12/sys/gnu/dts/include/dt-bindings/clock/x1000-cgu.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/clock/x1000-cgu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/xlnx-versal-clk.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/clock/xlnx-versal-clk.h stable/12/sys/gnu/dts/include/dt-bindings/dma/x1000-dma.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/dma/x1000-dma.h stable/12/sys/gnu/dts/include/dt-bindings/dma/x1830-dma.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/dma/x1830-dma.h stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson-a1-gpio.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/gpio/meson-a1-gpio.h stable/12/sys/gnu/dts/include/dt-bindings/interconnect/qcom,msm8916.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/interconnect/qcom,msm8916.h stable/12/sys/gnu/dts/include/dt-bindings/interconnect/qcom,msm8974.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/interconnect/qcom,msm8974.h stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/aspeed-scu-ic.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/interrupt-controller/aspeed-scu-ic.h stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra194-mc.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/memory/tegra194-mc.h stable/12/sys/gnu/dts/include/dt-bindings/net/qca-ar803x.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/net/qca-ar803x.h stable/12/sys/gnu/dts/include/dt-bindings/net/ti-dp83869.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/net/ti-dp83869.h stable/12/sys/gnu/dts/include/dt-bindings/pmu/ - copied from r358430, head/sys/gnu/dts/include/dt-bindings/pmu/ stable/12/sys/gnu/dts/include/dt-bindings/power/mt6765-power.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/power/mt6765-power.h stable/12/sys/gnu/dts/include/dt-bindings/power/r8a774b1-sysc.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/power/r8a774b1-sysc.h stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77961-sysc.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/power/r8a77961-sysc.h stable/12/sys/gnu/dts/include/dt-bindings/regulator/dlg,da9063-regulator.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/regulator/dlg,da9063-regulator.h stable/12/sys/gnu/dts/include/dt-bindings/reset-controller/mt2712-resets.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/reset-controller/mt2712-resets.h stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-a1-reset.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-a1-reset.h stable/12/sys/gnu/dts/include/dt-bindings/reset/nuvoton,npcm7xx-reset.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/reset/nuvoton,npcm7xx-reset.h stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq6018.h - copied unchanged from r359936, head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq6018.h stable/12/sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1295.h - copied unchanged from r358430, head/sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1295.h Deleted: stable/12/sys/dts/arm/overlays/sun8i-h3-sid.dtso stable/12/sys/dts/arm/overlays/sun8i-h3-ths.dtso stable/12/sys/dts/arm64/overlays/sun50i-a64-sid.dtso stable/12/sys/dts/arm64/overlays/sun50i-a64-ths.dtso stable/12/sys/dts/arm64/overlays/sun50i-h5-sid.dtso stable/12/sys/dts/arm64/overlays/sun50i-h5-ths.dtso stable/12/sys/gnu/dts/arm/at91-kizbox2.dts stable/12/sys/gnu/dts/arm/at91-kizboxmini.dts stable/12/sys/gnu/dts/arm/ste-href-ab8505.dtsi stable/12/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp157c.dtsi stable/12/sys/gnu/dts/arm/stm32mp157xaa-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp157xab-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp157xac-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32mp157xad-pinctrl.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c-pins.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c-pmic-pins.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-h3ulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-h3ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7795-h3ulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-h3ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7796-m3ulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7796-m3ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7796-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7796-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7796.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-clk.dtsi stable/12/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h Modified: stable/12/UPDATING stable/12/release/arm64/PINE64-LTS.conf stable/12/release/arm64/PINE64.conf stable/12/release/arm64/PINEBOOK.conf stable/12/sys/arm/allwinner/aw_sid.c stable/12/sys/arm/allwinner/aw_thermal.c stable/12/sys/gnu/dts/arm/am335x-baltos.dtsi stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi stable/12/sys/gnu/dts/arm/am335x-boneblue.dts stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts stable/12/sys/gnu/dts/arm/am335x-evm.dts stable/12/sys/gnu/dts/arm/am335x-evmsk.dts stable/12/sys/gnu/dts/arm/am335x-guardian.dts stable/12/sys/gnu/dts/arm/am335x-icev2.dts stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi stable/12/sys/gnu/dts/arm/am335x-lxm.dts stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts stable/12/sys/gnu/dts/arm/am335x-pcm-953.dtsi stable/12/sys/gnu/dts/arm/am335x-pdu001.dts stable/12/sys/gnu/dts/arm/am335x-pepper.dts stable/12/sys/gnu/dts/arm/am335x-pocketbeagle.dts stable/12/sys/gnu/dts/arm/am335x-regor.dtsi stable/12/sys/gnu/dts/arm/am335x-sancloud-bbe.dts stable/12/sys/gnu/dts/arm/am335x-shc.dts stable/12/sys/gnu/dts/arm/am335x-sl50.dts stable/12/sys/gnu/dts/arm/am335x-wega.dtsi stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi stable/12/sys/gnu/dts/arm/am33xx.dtsi stable/12/sys/gnu/dts/arm/am3517.dtsi stable/12/sys/gnu/dts/arm/am3517_mt_ventoux.dts stable/12/sys/gnu/dts/arm/am4372.dtsi stable/12/sys/gnu/dts/arm/am437x-gp-evm.dts stable/12/sys/gnu/dts/arm/am437x-idk-evm.dts stable/12/sys/gnu/dts/arm/am437x-l4.dtsi stable/12/sys/gnu/dts/arm/am437x-sk-evm.dts stable/12/sys/gnu/dts/arm/am43x-epos-evm.dts stable/12/sys/gnu/dts/arm/am43xx-clocks.dtsi stable/12/sys/gnu/dts/arm/am571x-idk.dts stable/12/sys/gnu/dts/arm/am572x-idk-common.dtsi stable/12/sys/gnu/dts/arm/am572x-idk.dts stable/12/sys/gnu/dts/arm/am574x-idk.dts stable/12/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi stable/12/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts stable/12/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts stable/12/sys/gnu/dts/arm/am57xx-idk-common.dtsi stable/12/sys/gnu/dts/arm/armada-388-clearfog.dtsi stable/12/sys/gnu/dts/arm/armada-388-helios4.dts stable/12/sys/gnu/dts/arm/armada-38x-solidrun-microsom.dtsi stable/12/sys/gnu/dts/arm/armada-38x.dtsi stable/12/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi stable/12/sys/gnu/dts/arm/armada-xp-db-xc3-24g4xg.dts stable/12/sys/gnu/dts/arm/armada-xp.dtsi stable/12/sys/gnu/dts/arm/aspeed-ast2500-evb.dts stable/12/sys/gnu/dts/arm/aspeed-ast2600-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-arm-stardragon4800-rep2.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-minipack.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-wedge100.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-wedge40.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-yamp.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-inspur-fp5280g2.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-inspur-on5263m5.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-intel-s2600wf.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-lenovo-hr630.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-lenovo-hr855xg2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-lanyang.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-mihawk.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-swift.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-vesnin.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-portwell-neptune.dts stable/12/sys/gnu/dts/arm/aspeed-g4.dtsi stable/12/sys/gnu/dts/arm/aspeed-g5.dtsi stable/12/sys/gnu/dts/arm/aspeed-g6-pinctrl.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-g6.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91-kizbox.dts stable/12/sys/gnu/dts/arm/at91-nattis-2-natte-2.dts stable/12/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi stable/12/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts stable/12/sys/gnu/dts/arm/at91-sama5d2_xplained.dts stable/12/sys/gnu/dts/arm/at91-sama5d4_xplained.dts stable/12/sys/gnu/dts/arm/at91sam9260.dtsi stable/12/sys/gnu/dts/arm/at91sam9261.dtsi stable/12/sys/gnu/dts/arm/at91sam9263.dtsi stable/12/sys/gnu/dts/arm/at91sam9g45.dtsi stable/12/sys/gnu/dts/arm/at91sam9rl.dtsi stable/12/sys/gnu/dts/arm/atlas7-evb.dts stable/12/sys/gnu/dts/arm/bcm-cygnus.dtsi stable/12/sys/gnu/dts/arm/bcm-hr2.dtsi stable/12/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts stable/12/sys/gnu/dts/arm/bcm2835-rpi.dtsi stable/12/sys/gnu/dts/arm/bcm2835.dtsi stable/12/sys/gnu/dts/arm/bcm2836.dtsi stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-a-plus.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-b-plus.dts stable/12/sys/gnu/dts/arm/bcm2837.dtsi stable/12/sys/gnu/dts/arm/bcm283x.dtsi stable/12/sys/gnu/dts/arm/bcm5301x.dtsi stable/12/sys/gnu/dts/arm/bcm958625hr.dts stable/12/sys/gnu/dts/arm/dm8148-evm.dts stable/12/sys/gnu/dts/arm/dm8148-t410.dts stable/12/sys/gnu/dts/arm/dove.dtsi stable/12/sys/gnu/dts/arm/dra62x-j5eco-evm.dts stable/12/sys/gnu/dts/arm/dra7-evm-common.dtsi stable/12/sys/gnu/dts/arm/dra7-evm.dts stable/12/sys/gnu/dts/arm/dra7-l4.dtsi stable/12/sys/gnu/dts/arm/dra7.dtsi stable/12/sys/gnu/dts/arm/dra72-evm-common.dtsi stable/12/sys/gnu/dts/arm/dra72x.dtsi stable/12/sys/gnu/dts/arm/dra74x.dtsi stable/12/sys/gnu/dts/arm/dra76-evm.dts stable/12/sys/gnu/dts/arm/dra76x.dtsi stable/12/sys/gnu/dts/arm/dra7xx-clocks.dtsi stable/12/sys/gnu/dts/arm/emev2.dtsi stable/12/sys/gnu/dts/arm/exynos3250.dtsi stable/12/sys/gnu/dts/arm/exynos4.dtsi stable/12/sys/gnu/dts/arm/exynos4210-universal_c210.dts stable/12/sys/gnu/dts/arm/exynos4210.dtsi stable/12/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi stable/12/sys/gnu/dts/arm/exynos4412-midas.dtsi stable/12/sys/gnu/dts/arm/exynos4412-n710x.dts stable/12/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi stable/12/sys/gnu/dts/arm/exynos4412-tiny4412.dts stable/12/sys/gnu/dts/arm/exynos4412.dtsi stable/12/sys/gnu/dts/arm/exynos5.dtsi stable/12/sys/gnu/dts/arm/exynos5250-arndale.dts stable/12/sys/gnu/dts/arm/exynos5250-smdk5250.dts stable/12/sys/gnu/dts/arm/exynos5250.dtsi stable/12/sys/gnu/dts/arm/exynos5260-xyref5260.dts stable/12/sys/gnu/dts/arm/exynos5260.dtsi stable/12/sys/gnu/dts/arm/exynos5410-odroidxu.dts stable/12/sys/gnu/dts/arm/exynos5410-smdk5410.dts stable/12/sys/gnu/dts/arm/exynos5410.dtsi stable/12/sys/gnu/dts/arm/exynos5420-arndale-octa.dts stable/12/sys/gnu/dts/arm/exynos5420-cpus.dtsi stable/12/sys/gnu/dts/arm/exynos5420-peach-pit.dts stable/12/sys/gnu/dts/arm/exynos5420-smdk5420.dts stable/12/sys/gnu/dts/arm/exynos5420.dtsi stable/12/sys/gnu/dts/arm/exynos5422-cpus.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroidhc1.dts stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-lite.dts stable/12/sys/gnu/dts/arm/exynos54xx.dtsi stable/12/sys/gnu/dts/arm/exynos5800-peach-pi.dts stable/12/sys/gnu/dts/arm/exynos5800.dtsi stable/12/sys/gnu/dts/arm/ibm-power9-dual.dtsi stable/12/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts stable/12/sys/gnu/dts/arm/imx25-pdk.dts stable/12/sys/gnu/dts/arm/imx25.dtsi stable/12/sys/gnu/dts/arm/imx27.dtsi stable/12/sys/gnu/dts/arm/imx31.dtsi stable/12/sys/gnu/dts/arm/imx51-babbage.dts stable/12/sys/gnu/dts/arm/imx51.dtsi stable/12/sys/gnu/dts/arm/imx53-qsb-common.dtsi stable/12/sys/gnu/dts/arm/imx53-usbarmory.dts stable/12/sys/gnu/dts/arm/imx6dl-apf6dev.dts stable/12/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts stable/12/sys/gnu/dts/arm/imx6dl-icore-mipi.dts stable/12/sys/gnu/dts/arm/imx6dl-yapp4-common.dtsi stable/12/sys/gnu/dts/arm/imx6dl-yapp4-hydra.dts stable/12/sys/gnu/dts/arm/imx6dl.dtsi stable/12/sys/gnu/dts/arm/imx6q-apalis-eval.dts stable/12/sys/gnu/dts/arm/imx6q-apalis-ixora-v1.1.dts stable/12/sys/gnu/dts/arm/imx6q-apalis-ixora.dts stable/12/sys/gnu/dts/arm/imx6q-apf6dev.dts stable/12/sys/gnu/dts/arm/imx6q-dhcom-pdk2.dts stable/12/sys/gnu/dts/arm/imx6q-dhcom-som.dtsi stable/12/sys/gnu/dts/arm/imx6q-gw54xx.dts stable/12/sys/gnu/dts/arm/imx6q-logicpd.dts stable/12/sys/gnu/dts/arm/imx6q.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-apalis.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-apf6.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-colibri.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-icore-1.5.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-icore.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-phytec-phycore-som.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-rex.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-udoo.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi stable/12/sys/gnu/dts/arm/imx6sl-evk.dts stable/12/sys/gnu/dts/arm/imx6sl.dtsi stable/12/sys/gnu/dts/arm/imx6sll-evk.dts stable/12/sys/gnu/dts/arm/imx6sll.dtsi stable/12/sys/gnu/dts/arm/imx6sx-sdb-reva.dts stable/12/sys/gnu/dts/arm/imx6sx-sdb.dts stable/12/sys/gnu/dts/arm/imx6sx.dtsi stable/12/sys/gnu/dts/arm/imx6ul-14x14-evk.dtsi stable/12/sys/gnu/dts/arm/imx6ul-kontron-n6310-s.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx6ul-kontron-n6310-som.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6ul-opos6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ul-opos6uldev.dts stable/12/sys/gnu/dts/arm/imx6ul-phytec-phycore-som.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dtsi stable/12/sys/gnu/dts/arm/imx6ull-colibri-nonwifi.dtsi stable/12/sys/gnu/dts/arm/imx6ull-colibri-wifi.dtsi stable/12/sys/gnu/dts/arm/imx6ull-colibri.dtsi stable/12/sys/gnu/dts/arm/imx7-colibri-eval-v3.dtsi stable/12/sys/gnu/dts/arm/imx7-colibri.dtsi stable/12/sys/gnu/dts/arm/imx7d-pico.dtsi stable/12/sys/gnu/dts/arm/imx7d-sdb-reva.dts stable/12/sys/gnu/dts/arm/imx7d.dtsi stable/12/sys/gnu/dts/arm/imx7s-colibri.dtsi stable/12/sys/gnu/dts/arm/imx7s.dtsi stable/12/sys/gnu/dts/arm/imx7ulp-evk.dts stable/12/sys/gnu/dts/arm/imx7ulp.dtsi stable/12/sys/gnu/dts/arm/iwg20d-q7-common.dtsi stable/12/sys/gnu/dts/arm/iwg20d-q7-dbcm-ca.dtsi stable/12/sys/gnu/dts/arm/keystone-clocks.dtsi stable/12/sys/gnu/dts/arm/keystone-k2e-clocks.dtsi stable/12/sys/gnu/dts/arm/keystone-k2e-netcp.dtsi stable/12/sys/gnu/dts/arm/keystone-k2hk-netcp.dtsi stable/12/sys/gnu/dts/arm/keystone-k2l-netcp.dtsi stable/12/sys/gnu/dts/arm/kirkwood-synology.dtsi stable/12/sys/gnu/dts/arm/logicpd-som-lv-35xx-devkit.dts stable/12/sys/gnu/dts/arm/logicpd-torpedo-35xx-devkit.dts stable/12/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit-28.dts stable/12/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts stable/12/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi stable/12/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi stable/12/sys/gnu/dts/arm/ls1021a-tsn.dts stable/12/sys/gnu/dts/arm/ls1021a.dtsi stable/12/sys/gnu/dts/arm/meson.dtsi stable/12/sys/gnu/dts/arm/meson6.dtsi stable/12/sys/gnu/dts/arm/meson8.dtsi stable/12/sys/gnu/dts/arm/meson8b-ec100.dts stable/12/sys/gnu/dts/arm/meson8b-mxq.dts stable/12/sys/gnu/dts/arm/meson8b-odroidc1.dts stable/12/sys/gnu/dts/arm/meson8b.dtsi stable/12/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi stable/12/sys/gnu/dts/arm/mt6323.dtsi stable/12/sys/gnu/dts/arm/omap2.dtsi stable/12/sys/gnu/dts/arm/omap2430.dtsi stable/12/sys/gnu/dts/arm/omap3-beagle-xm.dts stable/12/sys/gnu/dts/arm/omap3-beagle.dts stable/12/sys/gnu/dts/arm/omap3-cm-t3530.dts stable/12/sys/gnu/dts/arm/omap3-cm-t3730.dts stable/12/sys/gnu/dts/arm/omap3-devkit8000-lcd43.dts stable/12/sys/gnu/dts/arm/omap3-devkit8000-lcd70.dts stable/12/sys/gnu/dts/arm/omap3-devkit8000.dts stable/12/sys/gnu/dts/arm/omap3-gta04.dtsi stable/12/sys/gnu/dts/arm/omap3-ha-lcd.dts stable/12/sys/gnu/dts/arm/omap3-ha.dts stable/12/sys/gnu/dts/arm/omap3-igep0020-rev-f.dts stable/12/sys/gnu/dts/arm/omap3-igep0020.dts stable/12/sys/gnu/dts/arm/omap3-igep0030-rev-g.dts stable/12/sys/gnu/dts/arm/omap3-igep0030.dts stable/12/sys/gnu/dts/arm/omap3-ldp.dts stable/12/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi stable/12/sys/gnu/dts/arm/omap3-lilly-dbb056.dts stable/12/sys/gnu/dts/arm/omap3-n9.dts stable/12/sys/gnu/dts/arm/omap3-n900.dts stable/12/sys/gnu/dts/arm/omap3-n950-n9.dtsi stable/12/sys/gnu/dts/arm/omap3-n950.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-alto35.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-chestnut43.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-gallop43.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-palo35.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-palo43.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-summit.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-tobi.dts stable/12/sys/gnu/dts/arm/omap3-overo-storm-tobiduo.dts stable/12/sys/gnu/dts/arm/omap3-pandora-1ghz.dts stable/12/sys/gnu/dts/arm/omap3-pandora-common.dtsi stable/12/sys/gnu/dts/arm/omap3-sbc-t3530.dts stable/12/sys/gnu/dts/arm/omap3-sbc-t3730.dts stable/12/sys/gnu/dts/arm/omap3-sniper.dts stable/12/sys/gnu/dts/arm/omap3-tao3530.dtsi stable/12/sys/gnu/dts/arm/omap3-thunder.dts stable/12/sys/gnu/dts/arm/omap3-zoom3.dts stable/12/sys/gnu/dts/arm/omap3.dtsi stable/12/sys/gnu/dts/arm/omap3430-sdp.dts stable/12/sys/gnu/dts/arm/omap34xx-omap36xx-clocks.dtsi stable/12/sys/gnu/dts/arm/omap34xx.dtsi stable/12/sys/gnu/dts/arm/omap36xx-clocks.dtsi stable/12/sys/gnu/dts/arm/omap36xx.dtsi stable/12/sys/gnu/dts/arm/omap3xxx-clocks.dtsi stable/12/sys/gnu/dts/arm/omap4-droid4-xt894.dts stable/12/sys/gnu/dts/arm/omap4-l4-abe.dtsi stable/12/sys/gnu/dts/arm/omap4-l4.dtsi stable/12/sys/gnu/dts/arm/omap4.dtsi stable/12/sys/gnu/dts/arm/omap44xx-clocks.dtsi stable/12/sys/gnu/dts/arm/omap5-l4-abe.dtsi stable/12/sys/gnu/dts/arm/omap5-l4.dtsi stable/12/sys/gnu/dts/arm/omap5.dtsi stable/12/sys/gnu/dts/arm/omap54xx-clocks.dtsi stable/12/sys/gnu/dts/arm/ox810se.dtsi stable/12/sys/gnu/dts/arm/ox820.dtsi stable/12/sys/gnu/dts/arm/qcom-apq8084.dtsi stable/12/sys/gnu/dts/arm/qcom-ipq4019.dtsi stable/12/sys/gnu/dts/arm/qcom-mdm9615-wp8548-mangoh-green.dts stable/12/sys/gnu/dts/arm/qcom-msm8974-fairphone-fp2.dts stable/12/sys/gnu/dts/arm/qcom-msm8974.dtsi stable/12/sys/gnu/dts/arm/qcom-pm8941.dtsi stable/12/sys/gnu/dts/arm/r7s72100.dtsi stable/12/sys/gnu/dts/arm/r8a73a4.dtsi stable/12/sys/gnu/dts/arm/r8a7740-armadillo800eva.dts stable/12/sys/gnu/dts/arm/r8a7740.dtsi stable/12/sys/gnu/dts/arm/r8a7743.dtsi stable/12/sys/gnu/dts/arm/r8a7744.dtsi stable/12/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm.dts stable/12/sys/gnu/dts/arm/r8a7745.dtsi stable/12/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts stable/12/sys/gnu/dts/arm/r8a77470.dtsi stable/12/sys/gnu/dts/arm/r8a7778.dtsi stable/12/sys/gnu/dts/arm/r8a7779-marzen.dts stable/12/sys/gnu/dts/arm/r8a7779.dtsi stable/12/sys/gnu/dts/arm/r8a7790-lager.dts stable/12/sys/gnu/dts/arm/r8a7790.dtsi stable/12/sys/gnu/dts/arm/r8a7791-koelsch.dts stable/12/sys/gnu/dts/arm/r8a7791-porter.dts stable/12/sys/gnu/dts/arm/r8a7791.dtsi stable/12/sys/gnu/dts/arm/r8a7792.dtsi stable/12/sys/gnu/dts/arm/r8a7793-gose.dts stable/12/sys/gnu/dts/arm/r8a7793.dtsi stable/12/sys/gnu/dts/arm/r8a7794-alt.dts stable/12/sys/gnu/dts/arm/r8a7794-silk.dts stable/12/sys/gnu/dts/arm/r8a7794.dtsi stable/12/sys/gnu/dts/arm/rda8810pl.dtsi stable/12/sys/gnu/dts/arm/rk3036.dtsi stable/12/sys/gnu/dts/arm/rk3188-bqedison2qc.dts stable/12/sys/gnu/dts/arm/rk322x.dtsi stable/12/sys/gnu/dts/arm/rk3288-evb.dtsi stable/12/sys/gnu/dts/arm/rk3288-rock2-som.dtsi stable/12/sys/gnu/dts/arm/rk3288-tinker.dtsi stable/12/sys/gnu/dts/arm/rk3288-veyron-analog-audio.dtsi stable/12/sys/gnu/dts/arm/rk3288-veyron-brain.dts stable/12/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi stable/12/sys/gnu/dts/arm/rk3288-veyron-edp.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-fievel.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-jaq.dts stable/12/sys/gnu/dts/arm/rk3288-veyron-jerry.dts stable/12/sys/gnu/dts/arm/rk3288-veyron-mickey.dts stable/12/sys/gnu/dts/arm/rk3288-veyron-minnie.dts stable/12/sys/gnu/dts/arm/rk3288-veyron-pinky.dts stable/12/sys/gnu/dts/arm/rk3288-veyron-speedy.dts stable/12/sys/gnu/dts/arm/rk3288-veyron-tiger.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron.dtsi stable/12/sys/gnu/dts/arm/rk3288.dtsi stable/12/sys/gnu/dts/arm/rk3xxx.dtsi stable/12/sys/gnu/dts/arm/rv1108.dtsi stable/12/sys/gnu/dts/arm/s3c2416-smdk2416.dts stable/12/sys/gnu/dts/arm/s3c6410-mini6410.dts stable/12/sys/gnu/dts/arm/s3c6410-smdk6410.dts stable/12/sys/gnu/dts/arm/sama5d2.dtsi stable/12/sys/gnu/dts/arm/sama5d3.dtsi stable/12/sys/gnu/dts/arm/sama5d3_can.dtsi stable/12/sys/gnu/dts/arm/sama5d3_tcb1.dtsi stable/12/sys/gnu/dts/arm/sama5d3_uart.dtsi stable/12/sys/gnu/dts/arm/sh73a0.dtsi stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk_qspi.dts stable/12/sys/gnu/dts/arm/ste-ab8500.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/ste-dbx5x0.dtsi stable/12/sys/gnu/dts/arm/ste-href-family-pinctrl.dtsi stable/12/sys/gnu/dts/arm/ste-href-tvk1281618.dtsi stable/12/sys/gnu/dts/arm/ste-href.dtsi stable/12/sys/gnu/dts/arm/ste-hrefprev60-stuib.dts stable/12/sys/gnu/dts/arm/ste-hrefprev60-tvk.dts stable/12/sys/gnu/dts/arm/ste-hrefprev60.dtsi stable/12/sys/gnu/dts/arm/ste-hrefv60plus-stuib.dts stable/12/sys/gnu/dts/arm/ste-hrefv60plus-tvk.dts stable/12/sys/gnu/dts/arm/ste-hrefv60plus.dtsi stable/12/sys/gnu/dts/arm/ste-nomadik-pinctrl.dtsi stable/12/sys/gnu/dts/arm/ste-snowball.dts stable/12/sys/gnu/dts/arm/stih410-b2260.dts stable/12/sys/gnu/dts/arm/stihxxx-b2120.dtsi stable/12/sys/gnu/dts/arm/stm32429i-eval.dts stable/12/sys/gnu/dts/arm/stm32746g-eval.dts stable/12/sys/gnu/dts/arm/stm32f4-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32f429-disco.dts stable/12/sys/gnu/dts/arm/stm32f429.dtsi stable/12/sys/gnu/dts/arm/stm32f469-disco.dts stable/12/sys/gnu/dts/arm/stm32f469.dtsi stable/12/sys/gnu/dts/arm/stm32f7-pinctrl.dtsi stable/12/sys/gnu/dts/arm/stm32f746-disco.dts stable/12/sys/gnu/dts/arm/stm32f746.dtsi stable/12/sys/gnu/dts/arm/stm32f769-disco.dts stable/12/sys/gnu/dts/arm/stm32h743.dtsi stable/12/sys/gnu/dts/arm/stm32h743i-disco.dts stable/12/sys/gnu/dts/arm/stm32h743i-eval.dts stable/12/sys/gnu/dts/arm/stm32mp157a-avenger96.dts stable/12/sys/gnu/dts/arm/stm32mp157a-dk1.dts stable/12/sys/gnu/dts/arm/stm32mp157c-dk2.dts stable/12/sys/gnu/dts/arm/stm32mp157c-ed1.dts stable/12/sys/gnu/dts/arm/stm32mp157c-ev1.dts stable/12/sys/gnu/dts/arm/sun4i-a10.dtsi stable/12/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts stable/12/sys/gnu/dts/arm/sun5i.dtsi stable/12/sys/gnu/dts/arm/sun6i-a31.dtsi stable/12/sys/gnu/dts/arm/sun7i-a20.dtsi stable/12/sys/gnu/dts/arm/sun8i-a23-a33.dtsi stable/12/sys/gnu/dts/arm/sun8i-a33.dtsi stable/12/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts stable/12/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts stable/12/sys/gnu/dts/arm/sun8i-a83t.dtsi stable/12/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts stable/12/sys/gnu/dts/arm/sun8i-h3.dtsi stable/12/sys/gnu/dts/arm/sun8i-r40.dtsi stable/12/sys/gnu/dts/arm/sun8i-v3s.dtsi stable/12/sys/gnu/dts/arm/sun9i-a80.dtsi stable/12/sys/gnu/dts/arm/sunxi-h3-h5.dtsi stable/12/sys/gnu/dts/arm/tegra124-apalis-emc.dtsi stable/12/sys/gnu/dts/arm/tegra124-jetson-tk1-emc.dtsi stable/12/sys/gnu/dts/arm/tegra124-nyan-big-emc.dtsi stable/12/sys/gnu/dts/arm/tegra124-nyan-blaze-emc.dtsi stable/12/sys/gnu/dts/arm/tegra124-venice2.dts stable/12/sys/gnu/dts/arm/tegra124.dtsi stable/12/sys/gnu/dts/arm/tegra20-paz00.dts stable/12/sys/gnu/dts/arm/tegra20-trimslice.dts stable/12/sys/gnu/dts/arm/tegra20.dtsi stable/12/sys/gnu/dts/arm/tegra30-apalis-v1.1.dtsi stable/12/sys/gnu/dts/arm/tegra30-apalis.dtsi stable/12/sys/gnu/dts/arm/tegra30-cardhu-a04.dts stable/12/sys/gnu/dts/arm/tegra30-colibri.dtsi stable/12/sys/gnu/dts/arm/tegra30.dtsi stable/12/sys/gnu/dts/arm/uniphier-ld4.dtsi stable/12/sys/gnu/dts/arm/uniphier-pinctrl.dtsi stable/12/sys/gnu/dts/arm/uniphier-pro4.dtsi stable/12/sys/gnu/dts/arm/uniphier-pro5.dtsi stable/12/sys/gnu/dts/arm/uniphier-pxs2.dtsi stable/12/sys/gnu/dts/arm/uniphier-sld8.dtsi stable/12/sys/gnu/dts/arm/vf-colibri.dtsi stable/12/sys/gnu/dts/arm/vf500-colibri.dtsi stable/12/sys/gnu/dts/arm/vf610-bk4.dts stable/12/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts stable/12/sys/gnu/dts/arm/vf610-zii-scu4-aib.dts stable/12/sys/gnu/dts/arm/zynq-7000.dtsi stable/12/sys/gnu/dts/arm64/actions/s900-bubblegum-96.dts stable/12/sys/gnu/dts/arm64/actions/s900.dtsi stable/12/sys/gnu/dts/arm64/allwinner/axp803.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-amarula-relic.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-nanopi-a64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino-emmc.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-lts.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-plus.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pinebook.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine-baseboard.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-teres-i.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-libretech-all-h3-cc.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo-plus2.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo2.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-pc2.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-prime.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus2.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-beelink-gs1.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-3.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-one-plus.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-tanix-tx6.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-g12-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a-sei510.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a-x96-max.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b-a311d-khadas-vim3.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b-odroid-n2.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b-s922x-khadas-vim3.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-p20x.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-vega-s96.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-khadas-vim3.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-sm1-khadas-vim3l.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-sm1-sei610.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-sm1.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/fvp-base-revc.dts stable/12/sys/gnu/dts/arm64/arm/juno-base.dtsi stable/12/sys/gnu/dts/arm64/arm/juno-clocks.dtsi stable/12/sys/gnu/dts/arm64/bitmain/bm1880-sophon-edge.dts stable/12/sys/gnu/dts/arm64/bitmain/bm1880.dtsi stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2-common.dtsi stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2.dts stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2e.dts stable/12/sys/gnu/dts/arm64/exynos/exynos5433.dtsi stable/12/sys/gnu/dts/arm64/exynos/exynos7-espresso.dts stable/12/sys/gnu/dts/arm64/exynos/exynos7.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043-post.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-frwy.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1088a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1088a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1088a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa-rdb.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi stable/12/sys/gnu/dts/arm64/freescale/imx8mm-evk.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mm-pinfunc.h stable/12/sys/gnu/dts/arm64/freescale/imx8mm.dtsi stable/12/sys/gnu/dts/arm64/freescale/imx8mn-ddr4-evk.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mn.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mq-hummingboard-pulse.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq-librem5-devkit.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mq-nitrogen.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq-pico-pi.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq-sr-som.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq-zii-ultra-rmb3.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mq-zii-ultra-zest.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mq-zii-ultra.dtsi stable/12/sys/gnu/dts/arm64/freescale/imx8mq.dtsi stable/12/sys/gnu/dts/arm64/freescale/imx8qxp-ai_ml.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts stable/12/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hi3798cv200-poplar.dts stable/12/sys/gnu/dts/arm64/hisilicon/hi3798cv200.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hi6220.dtsi stable/12/sys/gnu/dts/arm64/intel/socfpga_agilex.dtsi stable/12/sys/gnu/dts/arm64/intel/socfpga_agilex_socdk.dts stable/12/sys/gnu/dts/arm64/lg/lg1312.dtsi stable/12/sys/gnu/dts/arm64/lg/lg1313.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dts stable/12/sys/gnu/dts/arm64/marvell/armada-3720-turris-mox.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts stable/12/sys/gnu/dts/arm64/marvell/armada-70x0.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts stable/12/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-80x0.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap806-dual.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap806-quad.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap806.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-common.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-cp110.dtsi stable/12/sys/gnu/dts/arm64/mediatek/mt8173.dtsi stable/12/sys/gnu/dts/arm64/mediatek/mt8183.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra132.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra186-p2771-0000.dts stable/12/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra186.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra194-p2972-0000.dts stable/12/sys/gnu/dts/arm64/nvidia/tegra194.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p3450-0000.dts stable/12/sys/gnu/dts/arm64/nvidia/tegra210.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8016-sbc-pmic-pins.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8916-longcheer-l8150.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916-samsung-a2015-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916-samsung-a5u-eur.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8996.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8998-clamshell.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8998-pins.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8998.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm8004.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm8916.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm8994.dtsi stable/12/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi stable/12/sys/gnu/dts/arm64/qcom/qcs404.dtsi stable/12/sys/gnu/dts/arm64/qcom/sdm845-cheza.dtsi stable/12/sys/gnu/dts/arm64/qcom/sdm845-db845c.dts stable/12/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts stable/12/sys/gnu/dts/arm64/qcom/sdm845.dtsi stable/12/sys/gnu/dts/arm64/qcom/sdm850-lenovo-yoga-c630.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/sm8150-mtp.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/sm8150.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/realtek/rtd1295-zidoo-x9s.dts stable/12/sys/gnu/dts/arm64/realtek/rtd1295.dtsi stable/12/sys/gnu/dts/arm64/realtek/rtd129x.dtsi stable/12/sys/gnu/dts/arm64/renesas/hihope-common.dtsi stable/12/sys/gnu/dts/arm64/renesas/hihope-rzg2-ex.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a774a1-hihope-rzg2m-ex.dts stable/12/sys/gnu/dts/arm64/renesas/r8a774a1-hihope-rzg2m.dts stable/12/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a774c0-cat874.dts stable/12/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77965.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77970.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77980.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77990.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77995.dtsi stable/12/sys/gnu/dts/arm64/renesas/salvator-common.dtsi stable/12/sys/gnu/dts/arm64/renesas/ulcb.dtsi stable/12/sys/gnu/dts/arm64/rockchip/px30-evb.dts stable/12/sys/gnu/dts/arm64/rockchip/px30.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3328.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3368-lion-haikou.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3368.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-firefly.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-bob.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-kevin.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-hugsun-x99.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-khadas-edge.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-nanopc-t4.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-orangepi.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-puma.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock-pi-4.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-sapphire-excavator.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399.dtsi stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi stable/12/sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am654-base-board.dts stable/12/sys/gnu/dts/arm64/ti/k3-j721e-common-proc-board.dts stable/12/sys/gnu/dts/arm64/ti/k3-j721e-main.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-j721e-mcu-wakeup.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-j721e-som-p0.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-j721e.dtsi stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1232-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1254-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1275-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm015-dc1.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm016-dc2.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm017-dc3.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm018-dc4.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm019-dc5.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu100-revC.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revB.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu104-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu106-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu111-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp.dtsi stable/12/sys/gnu/dts/include/dt-bindings/clock/aspeed-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/ast2600-clock.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/axg-audio-clkc.h stable/12/sys/gnu/dts/include/dt-bindings/clock/dra7.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8mm-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8mn-clock.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8mq-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h stable/12/sys/gnu/dts/include/dt-bindings/clock/omap4.h stable/12/sys/gnu/dts/include/dt-bindings/clock/omap5.h stable/12/sys/gnu/dts/include/dt-bindings/clock/px30-cru.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,dispcc-sdm845.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sun50i-a64-ccu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sun6i-a31-ccu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-a23-a33-ccu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-h3-ccu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-r40-ccu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h stable/12/sys/gnu/dts/include/dt-bindings/iio/adc/ingenic,adc.h stable/12/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra186-mc.h stable/12/sys/gnu/dts/include/dt-bindings/phy/phy.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/at91.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h stable/12/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h stable/12/sys/gnu/dts/include/dt-bindings/reset-controller/mt8183-resets.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-g12a-audio-reset.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson8b-reset.h stable/12/sys/gnu/dts/include/dt-bindings/sound/samsung-i2s.h stable/12/sys/gnu/dts/include/dt-bindings/thermal/thermal_exynos.h stable/12/sys/gnu/dts/riscv/sifive/fu540-c000.dtsi (contents, props changed) stable/12/sys/gnu/dts/riscv/sifive/hifive-unleashed-a00.dts (contents, props changed) stable/12/sys/modules/dtb/allwinner/Makefile Directory Properties: stable/12/ (props changed) stable/12/sys/gnu/dts/arm/imx6ul-kontron-n6310-s-43.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-phytec-segin-ff-rdk-nand.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-phytec-segin-peb-eval-01.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-phytec-segin.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ull-phytec-phycore-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ull-phytec-segin-ff-rdk-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ull-phytec-segin-ff-rdk-nand.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ull-phytec-segin-lc-rdk-nand.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ull-phytec-segin-peb-eval-01.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ull-phytec-segin.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7d-zii-rmu2.dts (props changed) stable/12/sys/gnu/dts/arm/mmp2-olpc-xo-1-75.dts (props changed) stable/12/sys/gnu/dts/arm/mt7629-rfb.dts (props changed) stable/12/sys/gnu/dts/arm/mt7629.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3229-xms6.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-s3-lichee-zero-plus.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-v3.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b-a311d.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b-khadas-vim3.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12b-s922x.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916-samsung-a3u-eur.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998-asus-novago-tp370ql.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998-hp-envy-x2.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998-lenovo-miix-630.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8150.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8150b.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8150l.dtsi (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-leez-p710.dts (props changed) stable/12/sys/gnu/dts/include/dt-bindings/bus/moxtet.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/ingenic,tcu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt6779-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sm8150.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3308-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gce/mt8183-gce.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/interconnect/qcom,qcs404.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/mt8183-larb-port.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/phy/phy-lantiq-vrx200-pcie.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/meson-g12a-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/meson-sm1-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/regulator/active-semi,8865-regulator.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/mt7629-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/soc/ti,sci_pm_domain.h (props changed) Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/UPDATING Fri Jun 19 18:43:02 2020 (r362408) @@ -16,6 +16,14 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200414: + Upstream DTS from Linux 5.6 was merged and they now have the SID + and THS (Secure ID controller and THermal Sensor) node present. + The DTB overlays have now been removed from the tree for the H3/H5 and + A64 SoCs and the aw_sid and aw_thermal driver have been updated to + deal with upstream DTS. If you are using those overlays you need to + remove them from loader.conf and update the DTBs on the FAT partition. + 20200501: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.0. Please see the 20141231 entry below for Modified: stable/12/release/arm64/PINE64-LTS.conf ============================================================================== --- stable/12/release/arm64/PINE64-LTS.conf Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/release/arm64/PINE64-LTS.conf Fri Jun 19 18:43:02 2020 (r362408) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" +FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64-LTS" arm_install_uboot() { Modified: stable/12/release/arm64/PINE64.conf ============================================================================== --- stable/12/release/arm64/PINE64.conf Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/release/arm64/PINE64.conf Fri Jun 19 18:43:02 2020 (r362408) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" +FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64" arm_install_uboot() { Modified: stable/12/release/arm64/PINEBOOK.conf ============================================================================== --- stable/12/release/arm64/PINEBOOK.conf Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/release/arm64/PINEBOOK.conf Fri Jun 19 18:43:02 2020 (r362408) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" +FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINEBOOK" arm_install_uboot() { Modified: stable/12/sys/arm/allwinner/aw_sid.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_sid.c Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/arm/allwinner/aw_sid.c Fri Jun 19 18:43:02 2020 (r362408) @@ -101,11 +101,11 @@ static struct aw_sid_efuse a64_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, - .size = 6, + .size = 8, .id = AW_SID_FUSE_THSSENSOR, .public = true, }, @@ -122,7 +122,7 @@ static struct aw_sid_efuse a83t_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, @@ -143,11 +143,11 @@ static struct aw_sid_efuse h3_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, - .size = 2, + .size = 4, .id = AW_SID_FUSE_THSSENSOR, .public = false, }, @@ -164,7 +164,7 @@ static struct aw_sid_efuse h5_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, @@ -351,8 +351,7 @@ aw_sid_read(device_t dev, uint32_t offset, uint32_t si sc = device_get_softc(dev); for (i = 0; i < sc->sid_conf->nfuses; i++) - if (offset == (sc->sid_conf->efuses[i].base + - sc->sid_conf->efuses[i].offset)) { + if (offset == sc->sid_conf->efuses[i].offset) { fuse_id = sc->sid_conf->efuses[i].id; break; } Modified: stable/12/sys/arm/allwinner/aw_thermal.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_thermal.c Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/arm/allwinner/aw_thermal.c Fri Jun 19 18:43:02 2020 (r362408) @@ -267,7 +267,7 @@ static const struct aw_thermal_config h3_config = { .thermal_per = H3_THERMAL_PER, .to_temp = h3_to_temp, .to_reg = h3_to_reg, - .calib0_mask = 0xffff, + .calib0_mask = 0xffffffff, }; static int @@ -387,12 +387,12 @@ aw_thermal_init(struct aw_thermal_softc *sc) int error; node = ofw_bus_get_node(sc->dev); - if (nvmem_get_cell_len(node, "ths-calib") > sizeof(calib)) { - device_printf(sc->dev, "ths-calib nvmem cell is too large\n"); + if (nvmem_get_cell_len(node, "calibration") > sizeof(calib)) { + device_printf(sc->dev, "calibration nvmem cell is too large\n"); return (ENXIO); } - error = nvmem_read_cell_by_name(node, "ths-calib", - (void *)&calib, nvmem_get_cell_len(node, "ths-calib")); + error = nvmem_read_cell_by_name(node, "calibration", + (void *)&calib, nvmem_get_cell_len(node, "calibration")); /* Read calibration settings from EFUSE */ if (error != 0) { device_printf(sc->dev, "Cannot read THS efuse\n"); @@ -624,7 +624,7 @@ aw_thermal_attach(device_t dev) return (ENXIO); } - if (clk_get_by_ofw_name(dev, 0, "apb", &sc->clk_apb) == 0) { + if (clk_get_by_ofw_name(dev, 0, "bus", &sc->clk_apb) == 0) { error = clk_enable(sc->clk_apb); if (error != 0) { device_printf(dev, "cannot enable apb clock\n"); @@ -632,7 +632,7 @@ aw_thermal_attach(device_t dev) } } - if (clk_get_by_ofw_name(dev, 0, "ths", &sc->clk_ths) == 0) { + if (clk_get_by_ofw_name(dev, 0, "mod", &sc->clk_ths) == 0) { error = clk_set_freq(sc->clk_ths, sc->conf->clk_rate, 0); if (error != 0) { device_printf(dev, "cannot set ths clock rate\n"); Modified: stable/12/sys/gnu/dts/arm/am335x-baltos.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-baltos.dtsi Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-baltos.dtsi Fri Jun 19 18:43:02 2020 (r362408) @@ -258,18 +258,6 @@ }; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&cppi41dma { - status = "okay"; -}; - #include "tps65910.dtsi" &tps { Modified: stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi Fri Jun 19 18:43:02 2020 (r362408) @@ -191,36 +191,14 @@ status = "okay"; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - &usb0 { - status = "okay"; dr_mode = "peripheral"; interrupts-extended = <&intc 18 &tps 0>; interrupt-names = "mc", "vbus"; }; &usb1 { - status = "okay"; dr_mode = "host"; -}; - -&cppi41dma { - status = "okay"; }; &i2c0 { Modified: stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Fri Jun 19 18:43:02 2020 (r362408) @@ -131,6 +131,11 @@ }; / { + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x20000000>; /* 512 MB */ + }; + clk_mcasp0_fixed: clk_mcasp0_fixed { #clock-cells = <0>; compatible = "fixed-clock"; Modified: stable/12/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-boneblue.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-boneblue.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -278,36 +278,14 @@ status = "okay"; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - &usb0 { - status = "okay"; dr_mode = "peripheral"; interrupts-extended = <&intc 18 &tps 0>; interrupt-names = "mc", "vbus"; }; &usb1 { - status = "okay"; dr_mode = "host"; -}; - -&cppi41dma { - status = "okay"; }; &i2c0 { Modified: stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -153,28 +153,10 @@ }; /* USB */ -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - &usb1 { pinctrl-names = "default"; pinctrl-0 = <&usb1_drvvbus>; - - status = "okay"; dr_mode = "host"; -}; - -&cppi41dma { - status = "okay"; }; /* microSD */ Modified: stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -330,26 +330,6 @@ status = "okay"; }; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb0 { - status = "okay"; -}; - -&cppi41dma { - status = "okay"; -}; - &epwmss0 { status = "okay"; Modified: stable/12/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evm.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-evm.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -113,7 +113,7 @@ }; }; - backlight { + backlight: backlight { compatible = "pwm-backlight"; pwms = <&ecap0 0 50000 0>; brightness-levels = <0 51 53 56 62 75 101 152 255>; @@ -121,35 +121,15 @@ }; panel { - compatible = "ti,tilcdc,panel"; - status = "okay"; + compatible = "tfc,s9700rtwv43tr-01b"; + pinctrl-names = "default"; pinctrl-0 = <&lcd_pins_s0>; - panel-info { - ac-bias = <255>; - ac-bias-intrpt = <0>; - dma-burst-sz = <16>; - bpp = <32>; - fdd = <0x80>; - sync-edge = <0>; - sync-ctrl = <1>; - raster-order = <0>; - fifo-th = <0>; - }; + backlight = <&backlight>; - display-timings { - 800x480p62 { - clock-frequency = <30000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <39>; - hback-porch = <39>; - hsync-len = <47>; - vback-porch = <29>; - vfront-porch = <13>; - vsync-len = <2>; - hsync-active = <1>; - vsync-active = <1>; + port { + panel_0: endpoint@0 { + remote-endpoint = <&lcdc_0>; }; }; }; @@ -433,35 +413,10 @@ }; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - -&usb0 { - status = "okay"; -}; - &usb1 { - status = "okay"; dr_mode = "host"; }; -&cppi41dma { - status = "okay"; -}; - &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&i2c1_pins>; @@ -525,6 +480,12 @@ status = "okay"; blue-and-red-wiring = "crossed"; + + port { + lcdc_0: endpoint@0 { + remote-endpoint = <&panel_0>; + }; + }; }; &elm { Modified: stable/12/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -183,36 +183,16 @@ }; panel { - compatible = "ti,tilcdc,panel"; + compatible = "newhaven,nhd-4.3-480272ef-atxl"; + pinctrl-names = "default", "sleep"; pinctrl-0 = <&lcd_pins_default>; pinctrl-1 = <&lcd_pins_sleep>; backlight = <&lcd_bl>; - status = "okay"; - panel-info { - ac-bias = <255>; - ac-bias-intrpt = <0>; - dma-burst-sz = <16>; - bpp = <32>; - fdd = <0x80>; - sync-edge = <0>; - sync-ctrl = <1>; - raster-order = <0>; - fifo-th = <0>; - }; - display-timings { - 480x272 { - hactive = <480>; - vactive = <272>; - hback-porch = <43>; - hfront-porch = <8>; - hsync-len = <4>; - vback-porch = <12>; - vfront-porch = <4>; - vsync-len = <10>; - clock-frequency = <9000000>; - hsync-active = <0>; - vsync-active = <0>; + + port { + panel_0: endpoint@0 { + remote-endpoint = <&lcdc_0>; }; }; }; @@ -523,35 +503,10 @@ }; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - -&usb0 { - status = "okay"; -}; - &usb1 { - status = "okay"; dr_mode = "host"; }; -&cppi41dma { - status = "okay"; -}; - &epwmss2 { status = "okay"; @@ -750,6 +705,12 @@ status = "okay"; blue-and-red-wiring = "crossed"; + + port { + lcdc_0: endpoint@0 { + remote-endpoint = <&panel_0>; + }; + }; }; &rtc { Modified: stable/12/sys/gnu/dts/arm/am335x-guardian.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-guardian.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-guardian.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -115,10 +115,6 @@ }; }; -&cppi41dma { - status = "okay"; -}; - &elm { status = "okay"; }; @@ -328,30 +324,12 @@ status = "okay"; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - &usb0 { dr_mode = "peripheral"; - status = "okay"; }; -&usb0_phy { - status = "okay"; -}; - &usb1 { dr_mode = "host"; - status = "okay"; -}; - -&usb1_phy { - status = "okay"; }; &am33xx_pinmux { Modified: stable/12/sys/gnu/dts/arm/am335x-icev2.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-icev2.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-icev2.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -287,6 +287,19 @@ gpio-controller; #gpio-cells = <2>; }; + + /* osd9616p0899-10 */ + display@3c { + compatible = "solomon,ssd1306fb-i2c"; + reg = <0x3c>; + solomon,height = <16>; + solomon,width = <96>; + solomon,com-seq; + solomon,com-invdir; + solomon,page-offset = <0>; + solomon,prechargep1 = <2>; + solomon,prechargep2 = <13>; + }; }; &spi0 { Modified: stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi Fri Jun 19 18:43:02 2020 (r362408) @@ -217,33 +217,8 @@ pinctrl-0 = <&uart0_pins>; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - -&usb0 { - status = "okay"; -}; - &usb1 { - status = "okay"; dr_mode = "host"; -}; - -&cppi41dma { - status = "okay"; }; #include "tps65910.dtsi" Modified: stable/12/sys/gnu/dts/arm/am335x-lxm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-lxm.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-lxm.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -283,34 +283,12 @@ status = "okay"; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - &usb0 { - status = "okay"; dr_mode = "host"; }; &usb1 { - status = "okay"; dr_mode = "host"; -}; - -&cppi41dma { - status = "okay"; }; &cpsw_emac0 { Modified: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Fri Jun 19 18:43:02 2020 (r362408) @@ -111,25 +111,8 @@ }; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - &usb0 { - status = "okay"; dr_mode = "host"; -}; - -&cppi41dma { - status = "okay"; }; /* Power */ Modified: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Fri Jun 19 18:40:39 2020 (r362407) +++ stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Fri Jun 19 18:43:02 2020 (r362408) @@ -290,34 +290,12 @@ }; }; -&usb { - status = "okay"; -}; - -&usb_ctrl_mod { - status = "okay"; -}; - -&usb0_phy { - status = "okay"; -}; - -&usb1_phy { - status = "okay"; -}; - &usb0 { - status = "okay"; dr_mode = "host"; }; &usb1 { - status = "okay"; dr_mode = "host"; -}; - -&cppi41dma { - status = "okay"; }; #include "tps65910.dtsi" Copied: stable/12/sys/gnu/dts/arm/am335x-netcan-plus-1xx.dts (from r358430, head/sys/gnu/dts/arm/am335x-netcan-plus-1xx.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am335x-netcan-plus-1xx.dts Fri Jun 19 18:43:02 2020 (r362408, copy of r358430, head/sys/gnu/dts/arm/am335x-netcan-plus-1xx.dts) @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + */ + +/* + * VScom OnRISC + * http://www.vscom.de + */ + +/dts-v1/; + +#include "am335x-baltos.dtsi" +#include "am335x-baltos-leds.dtsi" + +/ { + model = "NetCAN"; + + leds { + pinctrl-names = "default"; + pinctrl-0 = <&user_leds_s0>; + + compatible = "gpio-leds"; + + led@1 { + label = "can_data"; + linux,default-trigger = "netdev"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + led@2 { + label = "can_error"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + }; +}; + +&am33xx_pinmux { + user_leds_s0: user_leds_s0 { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* CAN Data LED */ + AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* CAN Error LED */ + >; + }; + + dcan1_pins: pinmux_dcan1_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_OUTPUT, MUX_MODE2) /* CAN TX */ + AM33XX_PADCONF(AM335X_PIN_UART0_RTSN, PIN_INPUT, MUX_MODE2) /* CAN RX */ + >; + }; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&davinci_mdio { + phy0: ethernet-phy@0 { + reg = <1>; + }; +}; + +&cpsw_emac0 { + phy-mode = "rmii"; + dual_emac_res_vlan = <1>; + phy-handle = <&phy0>; +}; + +&cpsw_emac1 { + phy-mode = "rgmii-id"; + dual_emac_res_vlan = <2>; + phy-handle = <&phy1>; +}; + +&dcan1 { + pinctrl-names = "default"; + pinctrl-0 = <&dcan1_pins>; + + status = "okay"; +}; Copied: stable/12/sys/gnu/dts/arm/am335x-netcom-plus-2xx.dts (from r358430, head/sys/gnu/dts/arm/am335x-netcom-plus-2xx.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am335x-netcom-plus-2xx.dts Fri Jun 19 18:43:02 2020 (r362408, copy of r358430, head/sys/gnu/dts/arm/am335x-netcom-plus-2xx.dts) @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + */ + +/* + * VScom OnRISC + * http://www.vscom.de + */ + +/dts-v1/; + +#include "am335x-baltos.dtsi" +#include "am335x-baltos-leds.dtsi" + +/ { + model = "NetCom Plus"; +}; + +&am33xx_pinmux { + uart1_pins: pinmux_uart1_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0) /* RX */ + AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_INPUT, MUX_MODE0) /* TX */ + AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE0) /* CTS */ + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_OUTPUT_PULLDOWN, MUX_MODE0) /* RTS */ + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* DTR */ + AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_INPUT_PULLDOWN, MUX_MODE7) /* DSR */ + AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_INPUT_PULLDOWN, MUX_MODE7) /* DCD */ + AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_INPUT_PULLDOWN, MUX_MODE7) /* RI */ + >; + }; + + uart2_pins: pinmux_uart2_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE1) /* RX */ + AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_OUTPUT, MUX_MODE1) /* TX */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SDA, PIN_INPUT_PULLDOWN, MUX_MODE2) /* CTS */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SCL, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* RTS */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD12, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* DTR */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD13, PIN_INPUT_PULLDOWN, MUX_MODE7) /* DSR */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD14, PIN_INPUT_PULLDOWN, MUX_MODE7) /* DCD */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD15, PIN_INPUT_PULLDOWN, MUX_MODE7) /* RI */ + >; + }; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + dtr-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; + dsr-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; + dcd-gpios = <&gpio2 24 GPIO_ACTIVE_LOW>; + rng-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; + + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + dtr-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + dsr-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + dcd-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + rng-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + + status = "okay"; +}; + +&davinci_mdio { + phy0: ethernet-phy@0 { + reg = <1>; + }; +}; + +&cpsw_emac0 { + phy-mode = "rmii"; + dual_emac_res_vlan = <1>; + phy-handle = <&phy0>; +}; + +&cpsw_emac1 { + phy-mode = "rgmii-id"; + dual_emac_res_vlan = <2>; + phy-handle = <&phy1>; +}; Copied: stable/12/sys/gnu/dts/arm/am335x-netcom-plus-8xx.dts (from r358430, head/sys/gnu/dts/arm/am335x-netcom-plus-8xx.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am335x-netcom-plus-8xx.dts Fri Jun 19 18:43:02 2020 (r362408, copy of r358430, head/sys/gnu/dts/arm/am335x-netcom-plus-8xx.dts) @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + */ + +/* + * VScom OnRISC + * http://www.vscom.de + */ + +/dts-v1/; + +#include "am335x-baltos.dtsi" + +/ { + model = "NetCom Plus"; +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&dip_switches>; + + dip_switches: pinmux_dip_switches { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_GPMC_AD12, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_AD13, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_AD14, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_AD15, PIN_INPUT_PULLDOWN, MUX_MODE7) + >; + }; + + tca6416_pins: pinmux_tca6416_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR1, PIN_INPUT_PULLUP, MUX_MODE7) + >; + }; + + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE3) + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_INPUT_PULLDOWN, MUX_MODE3) + >; + }; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; +}; + +&i2c1 { + tca6416a: gpio@20 { + compatible = "ti,tca6416"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&gpio0>; + interrupts = <20 IRQ_TYPE_EDGE_RISING>; + pinctrl-names = "default"; + pinctrl-0 = <&tca6416_pins>; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; + clock-frequency = <400000>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 19 18:43:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E793333606D; Fri, 19 Jun 2020 18:43:14 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pSNy2CTCz4f0X; Fri, 19 Jun 2020 18:43:14 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC76F1FB92; Fri, 19 Jun 2020 18:43:13 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIhDB3075291; Fri, 19 Jun 2020 18:43:13 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIhDRH075290; Fri, 19 Jun 2020 18:43:13 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202006191843.05JIhDRH075290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 19 Jun 2020 18:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362409 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 362409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:43:15 -0000 Author: bdragon Date: Fri Jun 19 18:43:13 2020 New Revision: 362409 URL: https://svnweb.freebsd.org/changeset/base/362409 Log: [PowerPC] Add virtio to GENERIC Due to kldxref not being able to generate hints for nonnative platforms, any cross built VM images do not have /boot/kernel/linker.hints. This prevents the virtio modules from being loaded, as the fallback code will always fail the version check when the hints are missing. Since we want to be able to generate VM images for 32 bit powerpc, add the virtio modules to GENERIC like we do on powerpc64. Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D25271 Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Jun 19 18:43:02 2020 (r362408) +++ head/sys/powerpc/conf/GENERIC Fri Jun 19 18:43:13 2020 (r362409) @@ -230,3 +230,12 @@ device snd_uaudio # USB Audio options EVDEV_SUPPORT # evdev support in legacy drivers device evdev # input event device support device uinput # install /dev/uinput cdev + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device + From owner-svn-src-all@freebsd.org Fri Jun 19 18:53:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 152433367B4; Fri, 19 Jun 2020 18:53:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pScr6tchz4fVb; Fri, 19 Jun 2020 18:53:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC5BC1F770; Fri, 19 Jun 2020 18:53:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIrWK2081200; Fri, 19 Jun 2020 18:53:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIrWxe081199; Fri, 19 Jun 2020 18:53:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191853.05JIrWxe081199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362410 - stable/12/sys/arm64/rockchip X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/arm64/rockchip X-SVN-Commit-Revision: 362410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:53:33 -0000 Author: manu Date: Fri Jun 19 18:53:32 2020 New Revision: 362410 URL: https://svnweb.freebsd.org/changeset/base/362410 Log: MFC r360228: arm64: rockchip: Fix TSADC on RK3328 The TSADC familiy is a little bit more complex than V2 and V3. Early revision do not use syscon and do not use qsel (RK3288). Next revision still do not use syscon but uses qsel (RK3328). Final revision use both. Submitted by: peterj Modified: stable/12/sys/arm64/rockchip/rk_tsadc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/rockchip/rk_tsadc.c ============================================================================== --- stable/12/sys/arm64/rockchip/rk_tsadc.c Fri Jun 19 18:43:13 2020 (r362409) +++ stable/12/sys/arm64/rockchip/rk_tsadc.c Fri Jun 19 18:53:32 2020 (r362410) @@ -98,24 +98,19 @@ struct tsensor { int channel; }; -enum tsadc_type { - RK_TSADC_V2, - RK_TSADC_V3 -}; - struct rk_calib_entry { uint32_t raw; int temp; }; struct tsadc_calib_info { - bool decrement_mode; struct rk_calib_entry *table; int nentries; }; struct tsadc_conf { - enum tsadc_type type; + int use_syscon; + int q_sel_ntc; int shutdown_temp; int shutdown_mode; int shutdown_pol; @@ -188,7 +183,8 @@ struct tsensor rk3288_tsensors[] = { }; struct tsadc_conf rk3288_tsadc_conf = { - .type = RK_TSADC_V2, + .use_syscon = 0, + .q_sel_ntc = 0, .shutdown_temp = 95000, .shutdown_mode = 1, /* GPIO */ .shutdown_pol = 0, /* Low */ @@ -241,7 +237,8 @@ static struct tsensor rk3328_tsensors[] = { }; static struct tsadc_conf rk3328_tsadc_conf = { - .type = RK_TSADC_V3, + .use_syscon = 0, + .q_sel_ntc = 1, .shutdown_temp = 95000, .shutdown_mode = 0, /* CRU */ .shutdown_pol = 0, /* Low */ @@ -296,7 +293,8 @@ static struct tsensor rk3399_tsensors[] = { }; static struct tsadc_conf rk3399_tsadc_conf = { - .type = RK_TSADC_V3, + .use_syscon = 1, + .q_sel_ntc = 1, .shutdown_temp = 95000, .shutdown_mode = 1, /* GPIO */ .shutdown_pol = 0, /* Low */ @@ -444,11 +442,11 @@ tsadc_init(struct tsadc_softc *sc) val |= TSADC_AUTO_CON_POL_HI; else val &= ~TSADC_AUTO_CON_POL_HI; - if (sc->conf->type == RK_TSADC_V3) + if (sc->conf->q_sel_ntc) val |= TSADC_AUTO_Q_SEL; WR4(sc, TSADC_AUTO_CON, val); - if (sc->conf->type == RK_TSADC_V2) { + if (!sc->conf->use_syscon) { /* V2 init */ WR4(sc, TSADC_AUTO_PERIOD, 250); /* 250 ms */ WR4(sc, TSADC_AUTO_PERIOD_HT, 50); /* 50 ms */ From owner-svn-src-all@freebsd.org Fri Jun 19 18:54:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D23C3367C0; Fri, 19 Jun 2020 18:54:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pSfS0qjgz4ftX; Fri, 19 Jun 2020 18:54:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 179A01FB3D; Fri, 19 Jun 2020 18:54:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JIstMK081435; Fri, 19 Jun 2020 18:54:55 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JIstQ0081434; Fri, 19 Jun 2020 18:54:55 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191854.05JIstQ0081434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 18:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362411 - stable/12/sys/arm64/rockchip X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/arm64/rockchip X-SVN-Commit-Revision: 362411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 18:54:56 -0000 Author: manu Date: Fri Jun 19 18:54:55 2020 New Revision: 362411 URL: https://svnweb.freebsd.org/changeset/base/362411 Log: MFC r360311: arm64: rockchip: rk805: Use a tailq for the attached regulator Store the attached regulator in a tailq to later find them in ofw_map. While here, do not attempt to attach a regulator without a name, a node might exists but if it doesn't have a name the regulator is unused. Modified: stable/12/sys/arm64/rockchip/rk805.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/rockchip/rk805.c ============================================================================== --- stable/12/sys/arm64/rockchip/rk805.c Fri Jun 19 18:53:32 2020 (r362410) +++ stable/12/sys/arm64/rockchip/rk805.c Fri Jun 19 18:54:55 2020 (r362411) @@ -86,6 +86,11 @@ struct rk805_reg_sc { struct regnode_std_param *param; }; +struct reg_list { + TAILQ_ENTRY(reg_list) next; + struct rk805_reg_sc *reg; +}; + struct rk805_softc { device_t dev; struct mtx mtx; @@ -94,7 +99,7 @@ struct rk805_softc { struct intr_config_hook intr_hook; enum rk_pmic_type type; - struct rk805_reg_sc **regs; + TAILQ_HEAD(, reg_list) regs; int nregs; }; @@ -620,6 +625,7 @@ rk805_attach(device_t dev) struct rk805_softc *sc; struct rk805_reg_sc *reg; struct rk805_regdef *regdefs; + struct reg_list *regp; phandle_t rnode, child; int i; @@ -646,8 +652,7 @@ rk805_attach(device_t dev) return (ENXIO); } - sc->regs = malloc(sizeof(struct rk805_reg_sc *) * sc->nregs, - M_RK805_REG, M_WAITOK | M_ZERO); + TAILQ_INIT(&sc->regs); rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); if (rnode > 0) { @@ -656,6 +661,8 @@ rk805_attach(device_t dev) regdefs[i].name); if (child == 0) continue; + if (OF_hasprop(child, "regulator-name") != 1) + continue; reg = rk805_reg_attach(dev, child, ®defs[i]); if (reg == NULL) { device_printf(dev, @@ -663,7 +670,9 @@ rk805_attach(device_t dev) regdefs[i].name); continue; } - sc->regs[i] = reg; + regp = malloc(sizeof(*regp), M_DEVBUF, M_WAITOK | M_ZERO); + regp->reg = reg; + TAILQ_INSERT_TAIL(&sc->regs, regp, next); if (bootverbose) device_printf(dev, "Regulator %s attached\n", regdefs[i].name); @@ -686,13 +695,13 @@ rk805_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, intptr_t *id) { struct rk805_softc *sc; - int i; + struct reg_list *regp; sc = device_get_softc(dev); - for (i = 0; i < sc->nregs; i++) { - if (sc->regs[i]->xref == xref) { - *id = sc->regs[i]->def->id; + TAILQ_FOREACH(regp, &sc->regs, next) { + if (regp->reg->xref == xref) { + *id = regp->reg->def->id; return (0); } } From owner-svn-src-all@freebsd.org Fri Jun 19 19:16:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B864336D56; Fri, 19 Jun 2020 19:16:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pT7G2CCZz3S4p; Fri, 19 Jun 2020 19:16:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2893D1FEA1; Fri, 19 Jun 2020 19:16:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JJGQUJ093843; Fri, 19 Jun 2020 19:16:26 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JJGQCR093842; Fri, 19 Jun 2020 19:16:26 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202006191916.05JJGQCR093842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 19 Jun 2020 19:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362412 - head/sbin/md5 X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/sbin/md5 X-SVN-Commit-Revision: 362412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:16:26 -0000 Author: allanjude Date: Fri Jun 19 19:16:25 2020 New Revision: 362412 URL: https://svnweb.freebsd.org/changeset/base/362412 Log: md5(1): fix -c flag to work with input on stdin Previously, the -p and -c flags were ignored when reading from stdin Additionally, -s and -c can be used together now. PR: 247295 Reviewed by: kevans MFC after: 2 weeks Relnotes: yes Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D25362 Modified: head/sbin/md5/md5.c Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Fri Jun 19 18:54:55 2020 (r362411) +++ head/sbin/md5/md5.c Fri Jun 19 19:16:25 2020 (r362412) @@ -52,11 +52,14 @@ __FBSDID("$FreeBSD$"); #define TEST_BLOCK_COUNT 100000 #define MDTESTCOUNT 8 +static int pflag; static int qflag; static int rflag; static int sflag; +static int skip; static char* checkAgainst; static int checksFailed; +static int failed; typedef void (DIGEST_Init)(void *); typedef void (DIGEST_Update)(void *, const unsigned char *, size_t); @@ -86,10 +89,10 @@ typedef struct Algorithm_t { } Algorithm_t; static void MD5_Update(MD5_CTX *, const unsigned char *, size_t); -static void MDString(const Algorithm_t *, const char *); +static void MDOutput(const Algorithm_t *, char *, char **); static void MDTimeTrial(const Algorithm_t *); static void MDTestSuite(const Algorithm_t *); -static void MDFilter(const Algorithm_t *, int); +static char *MDFilter(const Algorithm_t *, char*, int); static void usage(const Algorithm_t *); typedef union { @@ -170,9 +173,9 @@ main(int argc, char *argv[]) cap_rights_t rights; #endif int ch, fd; - char *p; + char *p, *string; char buf[HEX_DIGEST_LENGTH]; - int failed; + size_t len; unsigned digest; const char* progname; @@ -191,13 +194,14 @@ main(int argc, char *argv[]) failed = 0; checkAgainst = NULL; checksFailed = 0; + skip = 0; while ((ch = getopt(argc, argv, "c:pqrs:tx")) != -1) switch (ch) { case 'c': checkAgainst = optarg; break; case 'p': - MDFilter(&Algorithm[digest], 1); + pflag = 1; break; case 'q': qflag = 1; @@ -207,13 +211,15 @@ main(int argc, char *argv[]) break; case 's': sflag = 1; - MDString(&Algorithm[digest], optarg); + string = optarg; break; case 't': MDTimeTrial(&Algorithm[digest]); + skip = 1; break; case 'x': MDTestSuite(&Algorithm[digest]); + skip = 1; break; default: usage(&Algorithm[digest]); @@ -249,32 +255,19 @@ main(int argc, char *argv[]) } p = Algorithm[digest].Fd(fd, buf); (void)close(fd); - if (p == NULL) { - warn("%s", *argv); - failed++; - } else { - if (qflag) - printf("%s", p); - else if (rflag) - printf("%s %s", p, *argv); - else - printf("%s (%s) = %s", - Algorithm[digest].name, *argv, p); - if (checkAgainst && strcasecmp(checkAgainst, p) != 0) - { - checksFailed++; - if (!qflag) - printf(" [ Failed ]"); - } - printf("\n"); - } + MDOutput(&Algorithm[digest], p, argv); } while (*++argv); - } else if (!sflag && (optind == 1 || qflag || rflag)) { + } else if (!sflag && !skip) { #ifdef HAVE_CAPSICUM if (caph_limit_stdin() < 0 || caph_enter() < 0) err(1, "capsicum"); #endif - MDFilter(&Algorithm[digest], 0); + p = MDFilter(&Algorithm[digest], (char *)&buf, pflag); + MDOutput(&Algorithm[digest], p, NULL); + } else if (sflag) { + len = strlen(string); + p = Algorithm[digest].Data(string, len, buf); + MDOutput(&Algorithm[digest], p, &string); } if (failed != 0) @@ -284,30 +277,38 @@ main(int argc, char *argv[]) return (0); } + /* - * Digests a string and prints the result. + * Common output handling */ static void -MDString(const Algorithm_t *alg, const char *string) +MDOutput(const Algorithm_t *alg, char *p, char *argv[]) { - size_t len = strlen(string); - char buf[HEX_DIGEST_LENGTH]; - - alg->Data(string,len,buf); - if (qflag) - printf("%s", buf); - else if (rflag) - printf("%s \"%s\"", buf, string); - else - printf("%s (\"%s\") = %s", alg->name, string, buf); - if (checkAgainst && strcasecmp(buf,checkAgainst) != 0) - { - checksFailed++; - if (!qflag) - printf(" [ failed ]"); + if (p == NULL) { + warn("%s", *argv); + failed++; + } else { + /* + * If argv is NULL we are reading from stdin, where the output + * format has always been just the hash. + */ + if (qflag || argv == NULL) + printf("%s", p); + else if (rflag) + printf("%s %s", p, *argv); + else + printf("%s (%s) = %s", + alg->name, *argv, p); + if (checkAgainst && strcasecmp(checkAgainst, p) != 0) + { + checksFailed++; + if (!qflag) + printf(" [ Failed ]"); + } + printf("\n"); } - printf("\n"); } + /* * Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte blocks. */ @@ -507,13 +508,13 @@ MDTestSuite(const Algorithm_t *alg) /* * Digests the standard input and prints the result. */ -static void -MDFilter(const Algorithm_t *alg, int tee) +static char * +MDFilter(const Algorithm_t *alg, char *buf, int tee) { DIGEST_CTX context; unsigned int len; unsigned char buffer[BUFSIZ]; - char buf[HEX_DIGEST_LENGTH]; + char *p; alg->Init(&context); while ((len = fread(buffer, 1, BUFSIZ, stdin))) { @@ -521,7 +522,9 @@ MDFilter(const Algorithm_t *alg, int tee) err(1, "stdout"); alg->Update(&context, buffer, len); } - printf("%s\n", alg->End(&context, buf)); + p = alg->End(&context, buf); + + return (p); } static void From owner-svn-src-all@freebsd.org Fri Jun 19 19:24:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C49B63371B4; Fri, 19 Jun 2020 19:24:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pTJj4rlYz3SfK; Fri, 19 Jun 2020 19:24:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D90D20384; Fri, 19 Jun 2020 19:24:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JJOb4u000279; Fri, 19 Jun 2020 19:24:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JJObYU000277; Fri, 19 Jun 2020 19:24:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191924.05JJObYU000277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 19:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362413 - in stable/12/release: arm64 tools X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/release: arm64 tools X-SVN-Commit-Revision: 362413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:24:37 -0000 Author: manu Date: Fri Jun 19 19:24:36 2020 New Revision: 362413 URL: https://svnweb.freebsd.org/changeset/base/362413 Log: MFC r360271-r360272, r360321 r360271: Add support for generating release images using GPT for ARM Submitted by: Daniel Engberg (Original version) Differential Revision: https://reviews.freebsd.org/D22537 r360272: Add PINE64 ROCKPro64 config for generation of release images Submitted by: Daniel Engberg Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D22538 r360321: release: arm64: rockpro64: Set hw.ncpu to 4 Since there is known issue with big.LITTLE set the number of CPU to 4 which is the number present in the LITTLE cluster. Added: stable/12/release/arm64/ROCKPRO64.conf - copied, changed from r360272, head/release/arm64/ROCKPRO64.conf Modified: stable/12/release/tools/arm.subr Directory Properties: stable/12/ (props changed) Copied and modified: stable/12/release/arm64/ROCKPRO64.conf (from r360272, head/release/arm64/ROCKPRO64.conf) ============================================================================== --- head/release/arm64/ROCKPRO64.conf Fri Apr 24 16:32:25 2020 (r360272, copy source) +++ stable/12/release/arm64/ROCKPRO64.conf Fri Jun 19 19:24:36 2020 (r362413) @@ -26,3 +26,10 @@ arm_install_uboot() { of=/dev/${mddev} bs=512 seek=16384 conv=sync return 0 } + +arm_do_quirk() { + echo '# Known issue with big.LITTLE' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'hw.ncpu=4' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf +} Modified: stable/12/release/tools/arm.subr ============================================================================== --- stable/12/release/tools/arm.subr Fri Jun 19 19:16:25 2020 (r362412) +++ stable/12/release/tools/arm.subr Fri Jun 19 19:24:36 2020 (r362413) @@ -65,13 +65,21 @@ umount_loop() { arm_create_disk() { # Create the target raw file and temporary work directory. chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} - chroot ${CHROOTDIR} gpart add -t '!12' -a 512k -s ${FAT_SIZE} ${mddev} - chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev} - chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 - chroot ${CHROOTDIR} gpart add -t freebsd ${mddev} - chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 - chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 - chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a + if [ "${PART_SCHEME}" == "GPT" ]; then + chroot ${CHROOTDIR} gpart add -t efi -l efi -a 512k -s ${FAT_SIZE} ${mddev} + chroot ${CHROOTDIR} newfs_msdos -L efi -F ${FAT_TYPE} /dev/${mddev}p1 + chroot ${CHROOTDIR} gpart add -t freebsd-ufs -l rootfs -a 64k ${mddev} + chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}p2 + fi + if [ "${PART_SCHEME}" == "MBR" ]; then + chroot ${CHROOTDIR} gpart add -t '!12' -a 512k -s ${FAT_SIZE} ${mddev} + chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev} + chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 + chroot ${CHROOTDIR} gpart add -t freebsd ${mddev} + chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 + chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 + chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a + fi return 0 } @@ -161,7 +169,12 @@ arm_setup_minimal_loader() { } arm_install_base() { - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} + if [ "${PART_SCHEME}" == "GPT" ]; then + chroot ${CHROOTDIR} mount /dev/${mddev}p2 ${DESTDIR} + fi + if [ "${PART_SCHEME}" == "MBR" ]; then + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} + fi eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ TARGET=${EMBEDDED_TARGET} \ TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ @@ -178,10 +191,18 @@ arm_install_base() { echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "/dev/ufs/rootfs / ufs rw 1 1" \ - >> ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ - >> ${CHROOTDIR}/${DESTDIR}/etc/fstab + if [ "${PART_SCHEME}" == "GPT" ]; then + echo "/dev/ufs/rootfs / ufs rw 1 1" \ + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab + echo "/dev/msdosfs/efi /boot/efi msdosfs rw,noatime 0 0" \ + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab + fi + if [ "${PART_SCHEME}" == "MBR" ]; then + echo "/dev/ufs/rootfs / ufs rw 1 1" \ + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab + echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab + fi echo "tmpfs /tmp tmpfs rw,mode=1777,size=50m 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab @@ -206,8 +227,17 @@ arm_install_boot() { FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" - chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + if [ "${PART_SCHEME}" == "GPT" ]; then + dospart="/dev/${mddev}p1" + ufspart="/dev/${mddev}p2" + fi + if [ "${PART_SCHEME}" == "MBR" ]; then + dospart="/dev/${mddev}s1" + ufspart="/dev/${mddev}s2a" + fi + + chroot ${CHROOTDIR} mount_msdosfs ${dospart} ${FATMOUNT} + chroot ${CHROOTDIR} mount ${ufspart} ${UFSMOUNT} if [ "${EMBEDDED_TARGET}" == "arm" ]; then chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ From owner-svn-src-all@freebsd.org Fri Jun 19 19:25:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 140D4337336; Fri, 19 Jun 2020 19:25:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pTL36lzkz3SZd; Fri, 19 Jun 2020 19:25:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E34C320026; Fri, 19 Jun 2020 19:25:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JJPl0A000404; Fri, 19 Jun 2020 19:25:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JJPlP6000402; Fri, 19 Jun 2020 19:25:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191925.05JJPlP6000402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 19:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362414 - in stable/12/release: . tools X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/release: . tools X-SVN-Commit-Revision: 362414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:25:48 -0000 Author: manu Date: Fri Jun 19 19:25:47 2020 New Revision: 362414 URL: https://svnweb.freebsd.org/changeset/base/362414 Log: MFC r361980, r362010 r361980: release: amd64 efi boot name is bootx64 efi_boot_name is just used for arm image so no harm done. Reported by: gonzo r362010: release: Fix arm GPT image msdosfs labels are capitalized, use EFI instead of efi. Modified: stable/12/release/release.sh stable/12/release/tools/arm.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/release/release.sh ============================================================================== --- stable/12/release/release.sh Fri Jun 19 19:24:36 2020 (r362413) +++ stable/12/release/release.sh Fri Jun 19 19:25:47 2020 (r362414) @@ -368,7 +368,7 @@ efi_boot_name() echo "bootaa64.efi" ;; amd64) - echo "bootx86.efi" + echo "bootx64.efi" ;; esac } Modified: stable/12/release/tools/arm.subr ============================================================================== --- stable/12/release/tools/arm.subr Fri Jun 19 19:24:36 2020 (r362413) +++ stable/12/release/tools/arm.subr Fri Jun 19 19:25:47 2020 (r362414) @@ -194,7 +194,7 @@ arm_install_base() { if [ "${PART_SCHEME}" == "GPT" ]; then echo "/dev/ufs/rootfs / ufs rw 1 1" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "/dev/msdosfs/efi /boot/efi msdosfs rw,noatime 0 0" \ + echo "/dev/msdosfs/EFI /boot/efi msdosfs rw,noatime 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab fi if [ "${PART_SCHEME}" == "MBR" ]; then From owner-svn-src-all@freebsd.org Fri Jun 19 19:26:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13DD233717D; Fri, 19 Jun 2020 19:26:56 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pTMM6k7lz3T0Q; Fri, 19 Jun 2020 19:26:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E199F20305; Fri, 19 Jun 2020 19:26:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JJQtFD000503; Fri, 19 Jun 2020 19:26:55 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JJQtQE000501; Fri, 19 Jun 2020 19:26:55 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202006191926.05JJQtQE000501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Jun 2020 19:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362415 - head/sys/dev/dwc X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/dwc X-SVN-Commit-Revision: 362415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:26:56 -0000 Author: mmel Date: Fri Jun 19 19:26:55 2020 New Revision: 362415 URL: https://svnweb.freebsd.org/changeset/base/362415 Log: Improve if_dwc: - refactorize packet receive path. Make sure that we don't leak mbufs and/or that we don't create holes in RX descriptor ring - slightly simplify handling with TX descriptors MFC after: 4 weeks Modified: head/sys/dev/dwc/if_dwc.c head/sys/dev/dwc/if_dwcvar.h Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Fri Jun 19 19:25:47 2020 (r362414) +++ head/sys/dev/dwc/if_dwc.c Fri Jun 19 19:26:55 2020 (r362415) @@ -235,45 +235,39 @@ dwc_get1paddr(void *arg, bus_dma_segment_t *segs, int *(bus_addr_t *)arg = segs[0].ds_addr; } -inline static uint32_t +inline static void dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr, uint32_t len) { - uint32_t flags; - uint32_t nidx; + uint32_t desc0, desc1; - nidx = next_txidx(sc, idx); - /* Addr/len 0 means we're clearing the descriptor after xmit done. */ if (paddr == 0 || len == 0) { - flags = 0; + desc0 = 0; + desc1 = 0; --sc->txcount; } else { - if (sc->mactype != DWC_GMAC_EXT_DESC) - flags = NTDESC1_TCH | NTDESC1_FS - | NTDESC1_LS | NTDESC1_IC; - else - flags = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS | - ETDESC0_IC; + if (sc->mactype != DWC_GMAC_EXT_DESC) { + desc0 = 0; + desc1 = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS | + NTDESC1_IC | len; + } else { + desc0 = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS | + ETDESC0_IC; + desc1 = len; + } ++sc->txcount; } sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); - if (sc->mactype != DWC_GMAC_EXT_DESC) { - sc->txdesc_ring[idx].desc0 = 0; - sc->txdesc_ring[idx].desc1 = flags | len; - } else { - sc->txdesc_ring[idx].desc0 = flags; - sc->txdesc_ring[idx].desc1 = len; - } + sc->txdesc_ring[idx].desc0 = desc0; + sc->txdesc_ring[idx].desc1 = desc1; if (paddr && len) { wmb(); sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; wmb(); } - - return (nidx); } static int @@ -528,6 +522,7 @@ dwc_init(void *if_softc) DWC_UNLOCK(sc); } + inline static uint32_t dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr) { @@ -538,14 +533,15 @@ dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_ad sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); if (sc->mactype != DWC_GMAC_EXT_DESC) - sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | RX_MAX_PACKET; + sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | + MIN(MCLBYTES, NRDESC1_RBS1_MASK); else - sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | MCLBYTES; + sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | + MIN(MCLBYTES, ERDESC1_RBS1_MASK); wmb(); sc->rxdesc_ring[idx].desc0 = RDESC0_OWN; wmb(); - return (nidx); } @@ -585,6 +581,74 @@ dwc_alloc_mbufcl(struct dwc_softc *sc) return (m); } +static struct mbuf * +dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc, + struct dwc_bufmap *map) +{ + struct ifnet *ifp; + struct mbuf *m, *m0; + int len; + uint32_t rdesc0; + + m = map->mbuf; + ifp = sc->ifp; + rdesc0 = desc ->desc0; + /* Validate descriptor. */ + if (rdesc0 & RDESC0_ES) { + /* + * Errored packet. Statistic counters are updated + * globally, so do nothing + */ + return (NULL); + } + + if ((rdesc0 & (RDESC0_FS | RDESC0_LS)) != + (RDESC0_FS | RDESC0_LS)) { + /* + * Something very wrong happens. The whole packet should be + * recevied in one descriptr. Report problem. + */ + device_printf(sc->dev, + "%s: RX descriptor without FIRST and LAST bit set: 0x%08X", + __func__, rdesc0); + return (NULL); + } + + len = (rdesc0 >> RDESC0_FL_SHIFT) & RDESC0_FL_MASK; + if (len < 64) { + /* + * Lenght is invalid, recycle old mbuf + * Probably impossible case + */ + return (NULL); + } + + /* Allocate new buffer */ + m0 = dwc_alloc_mbufcl(sc); + if (m0 == NULL) { + /* no new mbuf available, recycle old */ + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); + return (NULL); + } + /* Do dmasync for newly received packet */ + bus_dmamap_sync(sc->rxbuf_tag, map->map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rxbuf_tag, map->map); + + /* Received packet is valid, process it */ + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + m->m_len = len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + + /* Remove trailing FCS */ + m_adj(m, -ETHER_CRC_LEN); + + DWC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + DWC_LOCK(sc); + return (m0); +} + static void dwc_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) { @@ -820,52 +884,30 @@ static void dwc_rxfinish_locked(struct dwc_softc *sc) { struct ifnet *ifp; - struct mbuf *m0; struct mbuf *m; - int error, idx, len; - uint32_t rdes0; + int error, idx; + struct dwc_hwdesc *desc; + DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - for (;;) { idx = sc->rx_idx; - - rdes0 = sc->rxdesc_ring[idx].desc0; - if ((rdes0 & RDESC0_OWN) != 0) + desc = sc->rxdesc_ring + idx; + if ((desc->desc0 & RDESC0_OWN) != 0) break; - bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->rxbuf_tag, sc->rxbuf_map[idx].map); - - len = (rdes0 >> RDESC0_FL_SHIFT) & RDESC0_FL_MASK; - if (len != 0) { - m = sc->rxbuf_map[idx].mbuf; - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - m->m_len = len; - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - - /* Remove trailing FCS */ - m_adj(m, -ETHER_CRC_LEN); - - DWC_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - DWC_LOCK(sc); + m = dwc_rxfinish_one(sc, desc, sc->rxbuf_map + idx); + if (m == NULL) { + wmb(); + desc->desc0 = RDESC0_OWN; + wmb(); } else { - /* XXX Zero-length packet ? */ + /* We cannot create hole in RX ring */ + error = dwc_setup_rxbuf(sc, idx, m); + if (error != 0) + panic("dwc_setup_rxbuf failed: error %d\n", + error); } - - if ((m0 = dwc_alloc_mbufcl(sc)) != NULL) { - if ((error = dwc_setup_rxbuf(sc, idx, m0)) != 0) { - /* - * XXX Now what? - * We've got a hole in the rx ring. - */ - } - } else - if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); - sc->rx_idx = next_rxidx(sc, sc->rx_idx); } } Modified: head/sys/dev/dwc/if_dwcvar.h ============================================================================== --- head/sys/dev/dwc/if_dwcvar.h Fri Jun 19 19:25:47 2020 (r362414) +++ head/sys/dev/dwc/if_dwcvar.h Fri Jun 19 19:26:55 2020 (r362415) @@ -44,7 +44,6 @@ /* * Driver data and defines. */ -#define RX_MAX_PACKET 0x7ff #define RX_DESC_COUNT 1024 #define RX_DESC_SIZE (sizeof(struct dwc_hwdesc) * RX_DESC_COUNT) #define TX_DESC_COUNT 1024 From owner-svn-src-all@freebsd.org Fri Jun 19 19:33:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5556E337716; Fri, 19 Jun 2020 19:33:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pTVW1Ypwz3Tgc; Fri, 19 Jun 2020 19:33:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F673201CF; Fri, 19 Jun 2020 19:33:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JJX7lh006731; Fri, 19 Jun 2020 19:33:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JJX7H3006730; Fri, 19 Jun 2020 19:33:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202006191933.05JJX7H3006730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 19 Jun 2020 19:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362416 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 362416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:33:07 -0000 Author: trasz Date: Fri Jun 19 19:33:06 2020 New Revision: 362416 URL: https://svnweb.freebsd.org/changeset/base/362416 Log: Add warnings for unsupported Linux clockids. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25322 Modified: head/sys/compat/linux/linux_time.c Modified: head/sys/compat/linux/linux_time.c ============================================================================== --- head/sys/compat/linux/linux_time.c Fri Jun 19 19:26:55 2020 (r362415) +++ head/sys/compat/linux/linux_time.c Fri Jun 19 19:33:06 2020 (r362416) @@ -67,6 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/0 #include #include #include +#include /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -268,6 +269,8 @@ linux_clock_gettime(struct thread *td, struct linux_cl error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_gettime clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_gettime, conversion_error, error); LIN_SDT_PROBE1(time, linux_clock_gettime, return, error); @@ -399,6 +402,8 @@ linux_clock_settime(struct thread *td, struct linux_cl error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_settime clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_settime, conversion_error, error); LIN_SDT_PROBE1(time, linux_clock_settime, return, error); @@ -441,6 +446,8 @@ linux_clock_getres(struct thread *td, struct linux_clo error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_getres clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_getres, conversion_error, error); LIN_SDT_PROBE1(time, linux_clock_getres, return, error); @@ -600,6 +607,8 @@ linux_clock_nanosleep(struct thread *td, struct linux_ error = linux_to_native_clockid(&clockid, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_nanosleep clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_nanosleep, unsupported_clockid, args->which); LIN_SDT_PROBE1(time, linux_clock_settime, return, error); From owner-svn-src-all@freebsd.org Fri Jun 19 19:33:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C68753376AD; Fri, 19 Jun 2020 19:33:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pTVl4dxqz3TkR; Fri, 19 Jun 2020 19:33:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A7882050B; Fri, 19 Jun 2020 19:33:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JJXJiw006797; Fri, 19 Jun 2020 19:33:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JJXJkj006796; Fri, 19 Jun 2020 19:33:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202006191933.05JJXJkj006796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Jun 2020 19:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362417 - stable/12/sys/dev/cpufreq X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/cpufreq X-SVN-Commit-Revision: 362417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:33:19 -0000 Author: manu Date: Fri Jun 19 19:33:19 2020 New Revision: 362417 URL: https://svnweb.freebsd.org/changeset/base/362417 Log: MFC r361964: coufreq_dt: Rename DEBUG to DPRINTF DEBUG is a kernel configuration flag and if used cpufreq_dt.c will fail the build of kernel. PR: 246867 Submitted by: Oskar Holmund (oskar.holmlund@ohdata.se) Differential Revision: https://reviews.freebsd.org/D25080 Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c ============================================================================== --- stable/12/sys/dev/cpufreq/cpufreq_dt.c Fri Jun 19 19:33:06 2020 (r362416) +++ stable/12/sys/dev/cpufreq/cpufreq_dt.c Fri Jun 19 19:33:19 2020 (r362417) @@ -53,9 +53,9 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" #if 0 -#define DEBUG(dev, msg...) device_printf(dev, "cpufreq_dt: " msg); +#define DPRINTF(dev, msg...) device_printf(dev, "cpufreq_dt: " msg); #else -#define DEBUG(dev, msg...) +#define DPRINTF(dev, msg...) #endif enum opp_version { @@ -111,12 +111,12 @@ cpufreq_dt_find_opp(device_t dev, uint64_t freq) sc = device_get_softc(dev); - DEBUG(dev, "Looking for freq %ju\n", freq); + DPRINTF(dev, "Looking for freq %ju\n", freq); for (n = 0; n < sc->nopp; n++) if (CPUFREQ_CMP(sc->opp[n].freq, freq)) return (&sc->opp[n]); - DEBUG(dev, "Couldn't find one\n"); + DPRINTF(dev, "Couldn't find one\n"); return (NULL); } @@ -145,7 +145,7 @@ cpufreq_dt_get(device_t dev, struct cf_setting *set) sc = device_get_softc(dev); - DEBUG(dev, "cpufreq_dt_get\n"); + DPRINTF(dev, "cpufreq_dt_get\n"); if (clk_get_freq(sc->clk, &freq) != 0) return (ENXIO); @@ -157,7 +157,7 @@ cpufreq_dt_get(device_t dev, struct cf_setting *set) cpufreq_dt_opp_to_setting(dev, opp, set); - DEBUG(dev, "Current freq %dMhz\n", set->freq); + DPRINTF(dev, "Current freq %dMhz\n", set->freq); return (0); } @@ -171,10 +171,10 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * sc = device_get_softc(dev); - DEBUG(dev, "Working on cpu %d\n", sc->cpu); - DEBUG(dev, "We have %d cpu on this dev\n", CPU_COUNT(&sc->cpus)); + DPRINTF(dev, "Working on cpu %d\n", sc->cpu); + DPRINTF(dev, "We have %d cpu on this dev\n", CPU_COUNT(&sc->cpus)); if (!CPU_ISSET(sc->cpu, &sc->cpus)) { - DEBUG(dev, "Not for this CPU\n"); + DPRINTF(dev, "Not for this CPU\n"); return (0); } @@ -206,26 +206,26 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * device_printf(dev, "Couldn't find an opp for this freq\n"); return (EINVAL); } - DEBUG(sc->dev, "Current freq %ju, uvolt: %d\n", freq, uvolt); - DEBUG(sc->dev, "Target freq %ju, , uvolt: %d\n", + DPRINTF(sc->dev, "Current freq %ju, uvolt: %d\n", freq, uvolt); + DPRINTF(sc->dev, "Target freq %ju, , uvolt: %d\n", opp->freq, opp->uvolt_target); if (uvolt < opp->uvolt_target) { - DEBUG(dev, "Changing regulator from %u to %u\n", + DPRINTF(dev, "Changing regulator from %u to %u\n", uvolt, opp->uvolt_target); error = regulator_set_voltage(sc->reg, opp->uvolt_min, opp->uvolt_max); if (error != 0) { - DEBUG(dev, "Failed, backout\n"); + DPRINTF(dev, "Failed, backout\n"); return (ENXIO); } } - DEBUG(dev, "Setting clk to %ju\n", opp->freq); + DPRINTF(dev, "Setting clk to %ju\n", opp->freq); error = clk_set_freq(sc->clk, opp->freq, CLK_SET_ROUND_DOWN); if (error != 0) { - DEBUG(dev, "Failed, backout\n"); + DPRINTF(dev, "Failed, backout\n"); /* Restore previous voltage (best effort) */ error = regulator_set_voltage(sc->reg, copp->uvolt_min, @@ -234,13 +234,13 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * } if (uvolt > opp->uvolt_target) { - DEBUG(dev, "Changing regulator from %u to %u\n", + DPRINTF(dev, "Changing regulator from %u to %u\n", uvolt, opp->uvolt_target); error = regulator_set_voltage(sc->reg, opp->uvolt_min, opp->uvolt_max); if (error != 0) { - DEBUG(dev, "Failed to switch regulator to %d\n", + DPRINTF(dev, "Failed to switch regulator to %d\n", opp->uvolt_target); /* Restore previous CPU frequency (best effort) */ (void)clk_set_freq(sc->clk, copp->freq, 0); @@ -271,7 +271,7 @@ cpufreq_dt_settings(device_t dev, struct cf_setting *s struct cpufreq_dt_softc *sc; ssize_t n; - DEBUG(dev, "cpufreq_dt_settings\n"); + DPRINTF(dev, "cpufreq_dt_settings\n"); if (sets == NULL || count == NULL) return (EINVAL); @@ -465,7 +465,7 @@ cpufreq_dt_attach(device_t dev) node = ofw_bus_get_node(device_get_parent(dev)); sc->cpu = device_get_unit(device_get_parent(dev)); - DEBUG(dev, "cpu=%d\n", sc->cpu); + DPRINTF(dev, "cpu=%d\n", sc->cpu); if (sc->cpu >= mp_ncpus) { device_printf(dev, "Not attaching as cpu is not present\n"); return (ENXIO); @@ -519,12 +519,12 @@ cpufreq_dt_attach(device_t dev) if (strcmp(device_type, "cpu") != 0) continue; if (cpu == sc->cpu) { - DEBUG(dev, "Skipping our cpu\n"); + DPRINTF(dev, "Skipping our cpu\n"); CPU_SET(cpu, &sc->cpus); cpu++; continue; } - DEBUG(dev, "Testing CPU %d\n", cpu); + DPRINTF(dev, "Testing CPU %d\n", cpu); copp = -1; if (version == OPP_V1) OF_getencprop(cnode, "operating-points", &copp, @@ -533,7 +533,8 @@ cpufreq_dt_attach(device_t dev) OF_getencprop(cnode, "operating-points-v2", &copp, sizeof(copp)); if (opp == copp) { - DEBUG(dev, "CPU %d is using the same opp as this one (%d)\n", cpu, sc->cpu); + DPRINTF(dev, "CPU %d is using the same opp as this one (%d)\n", + cpu, sc->cpu); CPU_SET(cpu, &sc->cpus); } cpu++; From owner-svn-src-all@freebsd.org Fri Jun 19 19:38:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D753F33784A; Fri, 19 Jun 2020 19:38:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pTcY5M8lz3Tr4; Fri, 19 Jun 2020 19:38:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id AA009194C9; Fri, 19 Jun 2020 19:38:21 +0000 (UTC) Date: Fri, 19 Jun 2020 19:38:21 +0000 From: Alexey Dokuchaev To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362399 - head/sys/dev/dwc Message-ID: <20200619193821.GA6030@FreeBSD.org> References: <202006191804.05JI4f3C050279@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202006191804.05JI4f3C050279@repo.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 19:38:21 -0000 On Fri, Jun 19, 2020 at 06:04:41PM +0000, Michal Meloun wrote: > New Revision: 362399 > URL: https://svnweb.freebsd.org/changeset/base/362399 > > Log: > Use naming nomenclature used in DesignWare TRM. > Use naming nomenclature used in DesignWare TRM. Please trim repeated lines from the commit logs. It breaks reading prefetch and thus makes it rather annoying. ./danfe From owner-svn-src-all@freebsd.org Fri Jun 19 23:32:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2A8F33C295; Fri, 19 Jun 2020 23:32:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pZpw4nCTz3xZh; Fri, 19 Jun 2020 23:32:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F6A823135; Fri, 19 Jun 2020 23:32:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05JNWeEC054334; Fri, 19 Jun 2020 23:32:40 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05JNWeXJ054333; Fri, 19 Jun 2020 23:32:40 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202006192332.05JNWeXJ054333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 19 Jun 2020 23:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362418 - head/usr.sbin/makefs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/usr.sbin/makefs/ffs X-SVN-Commit-Revision: 362418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 23:32:40 -0000 Author: mckusick Date: Fri Jun 19 23:32:40 2020 New Revision: 362418 URL: https://svnweb.freebsd.org/changeset/base/362418 Log: Allocate an fs_summary_info structure when creating a UFS filesystem needed since introduced in -r362358. PR: 247425 Sponsored by: Netflix Modified: head/usr.sbin/makefs/ffs/mkfs.c Modified: head/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- head/usr.sbin/makefs/ffs/mkfs.c Fri Jun 19 19:33:19 2020 (r362417) +++ head/usr.sbin/makefs/ffs/mkfs.c Fri Jun 19 23:32:40 2020 (r362418) @@ -408,6 +408,7 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, tim if (sblock.fs_contigsumsize > 0) size += sblock.fs_ncg * sizeof(int32_t); space = ecalloc(1, size); + sblock.fs_si = ecalloc(1, sizeof(struct fs_summary_info)); sblock.fs_csp = space; space = (char *)space + sblock.fs_cssize; if (sblock.fs_contigsumsize > 0) { From owner-svn-src-all@freebsd.org Sat Jun 20 04:07:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25103345172; Sat, 20 Jun 2020 04:07:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49phvw3gDqz4Hnq; Sat, 20 Jun 2020 04:07:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B933E25FF7; Sat, 20 Jun 2020 04:07:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K47NNf022415; Sat, 20 Jun 2020 04:07:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K47Npg022413; Sat, 20 Jun 2020 04:07:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202006200407.05K47Npg022413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Jun 2020 04:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362419 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 362419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:07:25 -0000 Author: imp Date: Sat Jun 20 04:07:23 2020 New Revision: 362419 URL: https://svnweb.freebsd.org/changeset/base/362419 Log: Use the more descriptive src_ccb and dst_ccb for the two ccbs being merged. MFC after: 1 week Modified: head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Jun 19 23:32:40 2020 (r362418) +++ head/sys/cam/cam_xpt.c Sat Jun 20 04:07:23 2020 (r362419) @@ -3526,22 +3526,22 @@ xpt_run_devq(struct cam_devq *devq) } /* - * This function merges stuff from the slave ccb into the master ccb, while - * keeping important fields in the master ccb constant. + * This function merges stuff from the src ccb into the dst ccb, while keeping + * important fields in the dst ccb constant. */ void -xpt_merge_ccb(union ccb *master_ccb, union ccb *slave_ccb) +xpt_merge_ccb(union ccb *dst_ccb, union ccb *src_ccb) { /* * Pull fields that are valid for peripheral drivers to set - * into the master CCB along with the CCB "payload". + * into the dst CCB along with the CCB "payload". */ - master_ccb->ccb_h.retry_count = slave_ccb->ccb_h.retry_count; - master_ccb->ccb_h.func_code = slave_ccb->ccb_h.func_code; - master_ccb->ccb_h.timeout = slave_ccb->ccb_h.timeout; - master_ccb->ccb_h.flags = slave_ccb->ccb_h.flags; - bcopy(&(&slave_ccb->ccb_h)[1], &(&master_ccb->ccb_h)[1], + dst_ccb->ccb_h.retry_count = src_ccb->ccb_h.retry_count; + dst_ccb->ccb_h.func_code = src_ccb->ccb_h.func_code; + dst_ccb->ccb_h.timeout = src_ccb->ccb_h.timeout; + dst_ccb->ccb_h.flags = src_ccb->ccb_h.flags; + bcopy(&(&src_ccb->ccb_h)[1], &(&dst_ccb->ccb_h)[1], sizeof(union ccb) - sizeof(struct ccb_hdr)); } Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Fri Jun 19 23:32:40 2020 (r362418) +++ head/sys/cam/cam_xpt.h Sat Jun 20 04:07:23 2020 (r362419) @@ -86,8 +86,8 @@ void xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, void xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority); -void xpt_merge_ccb(union ccb *master_ccb, - union ccb *slave_ccb); +void xpt_merge_ccb(union ccb *dst_ccb, + union ccb *src_ccb); cam_status xpt_create_path(struct cam_path **new_path_ptr, struct cam_periph *perph, path_id_t path_id, From owner-svn-src-all@freebsd.org Sat Jun 20 04:07:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0393345C85; Sat, 20 Jun 2020 04:07:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49phwK43W2z4J70; Sat, 20 Jun 2020 04:07:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94143265D5; Sat, 20 Jun 2020 04:07:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K47iTU022478; Sat, 20 Jun 2020 04:07:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K47iuN022477; Sat, 20 Jun 2020 04:07:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202006200407.05K47iuN022477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Jun 2020 04:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362420 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 362420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:07:48 -0000 Author: imp Date: Sat Jun 20 04:07:44 2020 New Revision: 362420 URL: https://svnweb.freebsd.org/changeset/base/362420 Log: Correct 1BSD release date. The Quarter Century of Unix book said that 1BSD was released March 1979. However, the 1BSD tape image that's on Kirk's historical unix collection has an earlier date. It was common practice, at the time, to create a new copy of the tape from the master system when a new tape was to go out, so several different versions of 1BSD, etc were shipped from Berkerely. The date on the 1BSD tape in the Berkeley archives on Kirk's DVD is dated in January 16 1979 on the label, and has dates as late as Jan 29 (there's an UPDATE file that says this includes updates through this date). Note this date as well. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sat Jun 20 04:07:23 2020 (r362419) +++ head/share/misc/bsd-family-tree Sat Jun 20 04:07:44 2020 (r362420) @@ -477,6 +477,7 @@ Ninth Edition 1986-09-xx [QCU] Tenth Edition 1989-10-xx [QCU] 1BSD late 1977 + 1978-01-16 [DOC] 1978-03-09 [QCU] PDP-11, Pascal, ex(1) 30 free copies of 1BSD sent out From owner-svn-src-all@freebsd.org Sat Jun 20 04:07:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2E5F345C91; Sat, 20 Jun 2020 04:07:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49phwb3nJpz4JDh; Sat, 20 Jun 2020 04:07:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51A8926158; Sat, 20 Jun 2020 04:07:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K47xMH022543; Sat, 20 Jun 2020 04:07:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K47x2P022542; Sat, 20 Jun 2020 04:07:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202006200407.05K47x2P022542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 20 Jun 2020 04:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362421 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 362421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:07:59 -0000 Author: kevans Date: Sat Jun 20 04:07:58 2020 New Revision: 362421 URL: https://svnweb.freebsd.org/changeset/base/362421 Log: raspberry pi 4: cpufreq support The submitter notes that the bcm2835_cpufreq driver really just needs the rpi4 compat string added to it; powerd subsequently works and the dev.cpu.0 sysctl values look sane and can be successfully manipulated. Submitted by: James Mintram MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D25349 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Sat Jun 20 04:07:44 2020 (r362420) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Sat Jun 20 04:07:58 2020 (r362421) @@ -129,6 +129,7 @@ static struct ofw_compat_data compat_data[] = { { "brcm,bcm2835", 1 }, { "brcm,bcm2836", 1 }, { "brcm,bcm2837", 1 }, + { "brcm,bcm2711", 1 }, { NULL, 0 } }; From owner-svn-src-all@freebsd.org Sat Jun 20 04:19:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FF9D345F3C; Sat, 20 Jun 2020 04:19:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pj9f2VlKz4KYp; Sat, 20 Jun 2020 04:19:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 511BB266ED; Sat, 20 Jun 2020 04:19:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K4JI1a029149; Sat, 20 Jun 2020 04:19:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K4JIJ6029148; Sat, 20 Jun 2020 04:19:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202006200419.05K4JIJ6029148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Jun 2020 04:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362422 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 362422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:19:18 -0000 Author: imp Date: Sat Jun 20 04:19:17 2020 New Revision: 362422 URL: https://svnweb.freebsd.org/changeset/base/362422 Log: Increase the whimsy in this file by famring dump's work out to minions. Adjust variables accordingly. Thankfully, we are able to do this without additional banana expenditures. Modified: head/sbin/dump/tape.c Modified: head/sbin/dump/tape.c ============================================================================== --- head/sbin/dump/tape.c Sat Jun 20 04:07:58 2020 (r362421) +++ head/sbin/dump/tape.c Sat Jun 20 04:19:17 2020 (r362422) @@ -75,19 +75,19 @@ static char *nexttape; static FILE *popenfp = NULL; static int atomic(ssize_t (*)(), int, char *, int); -static void doslave(int, int); -static void enslave(void); +static void dominion(int, int); +static void enminion(void); static void flushtape(void); static void killall(void); static void rollforward(void); /* * Concurrent dump mods (Caltech) - disk block reading and tape writing - * are exported to several slave processes. While one slave writes the + * are exported to several minion processes. While one minion writes the * tape, the others read disk blocks; they pass control of the tape in * a ring via signals. The parent process traverses the file system and - * sends writeheader()'s and lists of daddr's to the slaves via pipes. - * The following structure defines the instruction packets sent to slaves. + * sends writeheader()'s and lists of daddr's to the minions via pipes. + * The following structure defines the instruction packets sent to minions. */ struct req { ufs2_daddr_t dblk; @@ -95,20 +95,20 @@ struct req { }; static int reqsiz; -#define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */ -static struct slave { +#define MINIONS 3 /* 1 minion writing, 1 reading, 1 for slack */ +static struct minion { int64_t tapea; /* header number at start of this chunk */ int64_t firstrec; /* record number of this block */ int count; /* count to next header (used for TS_TAPE */ /* after EOT) */ int inode; /* inode that we are currently dealing with */ - int fd; /* FD for this slave */ - int pid; /* PID for this slave */ - int sent; /* 1 == we've sent this slave requests */ + int fd; /* FD for this minion */ + int pid; /* PID for this minion */ + int sent; /* 1 == we've sent this minion requests */ char (*tblock)[TP_BSIZE]; /* buffer for data blocks */ struct req *req; /* buffer for requests */ -} slaves[SLAVES+1]; -static struct slave *slp; +} minions[MINIONS+1]; +static struct minion *mlp; static char (*nextblock)[TP_BSIZE]; @@ -116,9 +116,9 @@ static int master; /* pid of master, for sending error static int tenths; /* length of tape used per block written */ static volatile sig_atomic_t caught; /* have we caught the signal to proceed? */ static volatile sig_atomic_t ready; /* reached the lock point without having */ - /* received the SIGUSR2 signal from the prev slave? */ + /* received the SIGUSR2 signal from the prev minion? */ static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ - /* SIGUSR2 arrives from the previous slave */ + /* SIGUSR2 arrives from the previous minion */ int alloctape(void) @@ -143,20 +143,20 @@ alloctape(void) * packets, so flushtape() can write them together with one write(). * Align tape buffer on page boundary to speed up tape write(). */ - for (i = 0; i <= SLAVES; i++) { + for (i = 0; i <= MINIONS; i++) { buf = (char *) malloc((unsigned)(reqsiz + writesize + pgoff + TP_BSIZE)); if (buf == NULL) return(0); - slaves[i].tblock = (char (*)[TP_BSIZE]) + minions[i].tblock = (char (*)[TP_BSIZE]) (((long)&buf[ntrec + 1] + pgoff) &~ pgoff); - slaves[i].req = (struct req *)slaves[i].tblock - ntrec - 1; + minions[i].req = (struct req *)minions[i].tblock - ntrec - 1; } - slp = &slaves[0]; - slp->count = 1; - slp->tapea = 0; - slp->firstrec = 0; - nextblock = slp->tblock; + mlp = &minions[0]; + mlp->count = 1; + mlp->tapea = 0; + mlp->firstrec = 0; + nextblock = mlp->tblock; return(1); } @@ -164,8 +164,8 @@ void writerec(char *dp, int isspcl) { - slp->req[trecno].dblk = (ufs2_daddr_t)0; - slp->req[trecno].count = 1; + mlp->req[trecno].dblk = (ufs2_daddr_t)0; + mlp->req[trecno].count = 1; /* Can't do a structure assignment due to alignment problems */ bcopy(dp, *(nextblock)++, sizeof (union u_spcl)); if (isspcl) @@ -185,8 +185,8 @@ dumpblock(ufs2_daddr_t blkno, int size) dblkno = fsbtodb(sblock, blkno); tpblks = size >> tp_bshift; while ((avail = MIN(tpblks, ntrec - trecno)) > 0) { - slp->req[trecno].dblk = dblkno; - slp->req[trecno].count = avail; + mlp->req[trecno].dblk = dblkno; + mlp->req[trecno].count = avail; trecno += avail; spcl.c_tapea += avail; if (trecno >= ntrec) @@ -232,27 +232,27 @@ flushtape(void) int i, blks, got; int64_t lastfirstrec; - int siz = (char *)nextblock - (char *)slp->req; + int siz = (char *)nextblock - (char *)mlp->req; - slp->req[trecno].count = 0; /* Sentinel */ + mlp->req[trecno].count = 0; /* Sentinel */ - if (atomic(write, slp->fd, (char *)slp->req, siz) != siz) + if (atomic(write, mlp->fd, (char *)mlp->req, siz) != siz) quit("error writing command pipe: %s\n", strerror(errno)); - slp->sent = 1; /* we sent a request, read the response later */ + mlp->sent = 1; /* we sent a request, read the response later */ - lastfirstrec = slp->firstrec; + lastfirstrec = mlp->firstrec; - if (++slp >= &slaves[SLAVES]) - slp = &slaves[0]; + if (++mlp >= &minions[MINIONS]) + mlp = &minions[0]; - /* Read results back from next slave */ - if (slp->sent) { - if (atomic(read, slp->fd, (char *)&got, sizeof got) + /* Read results back from next minion */ + if (mlp->sent) { + if (atomic(read, mlp->fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slp->sent = 0; + mlp->sent = 0; /* Check for end of tape */ if (got < writesize) { @@ -262,15 +262,15 @@ flushtape(void) * Drain the results, don't care what the values were. * If we read them here then trewind won't... */ - for (i = 0; i < SLAVES; i++) { - if (slaves[i].sent) { - if (atomic(read, slaves[i].fd, + for (i = 0; i < MINIONS; i++) { + if (minions[i].sent) { + if (atomic(read, minions[i].fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slaves[i].sent = 0; + minions[i].sent = 0; } } @@ -288,11 +288,11 @@ flushtape(void) if (spcl.c_addr[i] != 0) blks++; } - slp->count = lastspclrec + blks + 1 - spcl.c_tapea; - slp->tapea = spcl.c_tapea; - slp->firstrec = lastfirstrec + ntrec; - slp->inode = curino; - nextblock = slp->tblock; + mlp->count = lastspclrec + blks + 1 - spcl.c_tapea; + mlp->tapea = spcl.c_tapea; + mlp->firstrec = lastfirstrec + ntrec; + mlp->inode = curino; + nextblock = mlp->tblock; trecno = 0; asize += tenths; blockswritten += ntrec; @@ -312,7 +312,7 @@ trewind(void) int f; int got; - for (f = 0; f < SLAVES; f++) { + for (f = 0; f < MINIONS; f++) { /* * Drain the results, but unlike EOT we DO (or should) care * what the return values were, since if we detect EOT after @@ -321,22 +321,22 @@ trewind(void) * * fixme: punt for now. */ - if (slaves[f].sent) { - if (atomic(read, slaves[f].fd, (char *)&got, sizeof got) + if (minions[f].sent) { + if (atomic(read, minions[f].fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slaves[f].sent = 0; + minions[f].sent = 0; if (got != writesize) { msg("EOT detected in last 2 tape records!\n"); msg("Use a longer tape, decrease the size estimate\n"); quit("or use no size estimate at all.\n"); } } - (void) close(slaves[f].fd); + (void) close(minions[f].fd); } - while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ + while (wait((int *)NULL) >= 0) /* wait for any signals from minions */ /* void */; if (pipeout) @@ -396,29 +396,29 @@ void rollforward(void) { struct req *p, *q, *prev; - struct slave *tslp; + struct minion *tmlp; int i, size, got; int64_t savedtapea; union u_spcl *ntb, *otb; - tslp = &slaves[SLAVES]; - ntb = (union u_spcl *)tslp->tblock[1]; + tmlp = &minions[MINIONS]; + ntb = (union u_spcl *)tmlp->tblock[1]; /* - * Each of the N slaves should have requests that need to - * be replayed on the next tape. Use the extra slave buffers - * (slaves[SLAVES]) to construct request lists to be sent to - * each slave in turn. + * Each of the N minions should have requests that need to + * be replayed on the next tape. Use the extra minion buffers + * (minions[MINIONS]) to construct request lists to be sent to + * each minion in turn. */ - for (i = 0; i < SLAVES; i++) { - q = &tslp->req[1]; - otb = (union u_spcl *)slp->tblock; + for (i = 0; i < MINIONS; i++) { + q = &tmlp->req[1]; + otb = (union u_spcl *)mlp->tblock; /* - * For each request in the current slave, copy it to tslp. + * For each request in the current minion, copy it to tmlp. */ prev = NULL; - for (p = slp->req; p->count > 0; p += p->count) { + for (p = mlp->req; p->count > 0; p += p->count) { *q = *p; if (p->dblk == 0) *ntb++ = *otb++; /* copy the datablock also */ @@ -433,26 +433,26 @@ rollforward(void) ntb--; q -= 1; q->count = 0; - q = &tslp->req[0]; + q = &tmlp->req[0]; if (i == 0) { q->dblk = 0; q->count = 1; trecno = 0; - nextblock = tslp->tblock; + nextblock = tmlp->tblock; savedtapea = spcl.c_tapea; - spcl.c_tapea = slp->tapea; + spcl.c_tapea = mlp->tapea; startnewtape(0); spcl.c_tapea = savedtapea; lastspclrec = savedtapea - 1; } size = (char *)ntb - (char *)q; - if (atomic(write, slp->fd, (char *)q, size) != size) { + if (atomic(write, mlp->fd, (char *)q, size) != size) { perror(" DUMP: error writing command pipe"); dumpabort(0); } - slp->sent = 1; - if (++slp >= &slaves[SLAVES]) - slp = &slaves[0]; + mlp->sent = 1; + if (++mlp >= &minions[MINIONS]) + mlp = &minions[0]; q->count = 1; @@ -464,34 +464,34 @@ rollforward(void) */ q->dblk = prev->dblk + prev->count * (TP_BSIZE / DEV_BSIZE); - ntb = (union u_spcl *)tslp->tblock; + ntb = (union u_spcl *)tmlp->tblock; } else { /* * It wasn't a disk block. Copy the data to its * new location in the buffer. */ q->dblk = 0; - *((union u_spcl *)tslp->tblock) = *ntb; - ntb = (union u_spcl *)tslp->tblock[1]; + *((union u_spcl *)tmlp->tblock) = *ntb; + ntb = (union u_spcl *)tmlp->tblock[1]; } } - slp->req[0] = *q; - nextblock = slp->tblock; + mlp->req[0] = *q; + nextblock = mlp->tblock; if (q->dblk == 0) nextblock++; trecno = 1; /* - * Clear the first slaves' response. One hopes that it + * Clear the first minions' response. One hopes that it * worked ok, otherwise the tape is much too short! */ - if (slp->sent) { - if (atomic(read, slp->fd, (char *)&got, sizeof got) + if (mlp->sent) { + if (atomic(read, mlp->fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slp->sent = 0; + mlp->sent = 0; if (got != writesize) { quit("EOT detected at start of the tape!\n"); @@ -634,7 +634,7 @@ restore_check_point: } } - enslave(); /* Share open tape file descriptor with slaves */ + enminion(); /* Share open tape file descriptor with minions */ if (popenout) close(tapefd); /* Give up our copy of it. */ signal(SIGINFO, infosch); @@ -643,18 +643,18 @@ restore_check_point: blocksthisvol = 0; if (top) newtape++; /* new tape signal */ - spcl.c_count = slp->count; + spcl.c_count = mlp->count; /* * measure firstrec in TP_BSIZE units since restore doesn't * know the correct ntrec value... */ - spcl.c_firstrec = slp->firstrec; + spcl.c_firstrec = mlp->firstrec; spcl.c_volume++; spcl.c_type = TS_TAPE; - writeheader((ino_t)slp->inode); + writeheader((ino_t)mlp->inode); if (tapeno > 1) msg("Volume %d begins with blocks from inode %d\n", - tapeno, slp->inode); + tapeno, mlp->inode); } } @@ -687,7 +687,7 @@ Exit(status) } /* - * proceed - handler for SIGUSR2, used to synchronize IO between the slaves. + * proceed - handler for SIGUSR2, used to synchronize IO between the minions. */ void proceed(int signo __unused) @@ -699,45 +699,45 @@ proceed(int signo __unused) } void -enslave(void) +enminion(void) { int cmd[2]; int i, j; master = getpid(); - signal(SIGTERM, dumpabort); /* Slave sends SIGTERM on dumpabort() */ + signal(SIGTERM, dumpabort); /* Minion sends SIGTERM on dumpabort() */ signal(SIGPIPE, sigpipe); - signal(SIGUSR1, tperror); /* Slave sends SIGUSR1 on tape errors */ - signal(SIGUSR2, proceed); /* Slave sends SIGUSR2 to next slave */ + signal(SIGUSR1, tperror); /* Minion sends SIGUSR1 on tape errors */ + signal(SIGUSR2, proceed); /* Minion sends SIGUSR2 to next minion */ - for (i = 0; i < SLAVES; i++) { - if (i == slp - &slaves[0]) { + for (i = 0; i < MINIONS; i++) { + if (i == mlp - &minions[0]) { caught = 1; } else { caught = 0; } if (socketpair(AF_UNIX, SOCK_STREAM, 0, cmd) < 0 || - (slaves[i].pid = fork()) < 0) - quit("too many slaves, %d (recompile smaller): %s\n", + (minions[i].pid = fork()) < 0) + quit("too many minions, %d (recompile smaller): %s\n", i, strerror(errno)); - slaves[i].fd = cmd[1]; - slaves[i].sent = 0; - if (slaves[i].pid == 0) { /* Slave starts up here */ + minions[i].fd = cmd[1]; + minions[i].sent = 0; + if (minions[i].pid == 0) { /* Minion starts up here */ for (j = 0; j <= i; j++) - (void) close(slaves[j].fd); + (void) close(minions[j].fd); signal(SIGINT, SIG_IGN); /* Master handles this */ - doslave(cmd[0], i); + dominion(cmd[0], i); Exit(X_FINOK); } } - for (i = 0; i < SLAVES; i++) - (void) atomic(write, slaves[i].fd, - (char *) &slaves[(i + 1) % SLAVES].pid, - sizeof slaves[0].pid); + for (i = 0; i < MINIONS; i++) + (void) atomic(write, minions[i].fd, + (char *) &minions[(i + 1) % MINIONS].pid, + sizeof minions[0].pid); master = 0; } @@ -747,10 +747,10 @@ killall(void) { int i; - for (i = 0; i < SLAVES; i++) - if (slaves[i].pid > 0) { - (void) kill(slaves[i].pid, SIGKILL); - slaves[i].sent = 0; + for (i = 0; i < MINIONS; i++) + if (minions[i].pid > 0) { + (void) kill(minions[i].pid, SIGKILL); + minions[i].sent = 0; } } @@ -762,42 +762,42 @@ killall(void) * get the lock back for the next cycle by swapping descriptors. */ static void -doslave(int cmd, int slave_number) +dominion(int cmd, int minion_number) { int nread; - int nextslave, size, wrote, eot_count; + int nextminion, size, wrote, eot_count; /* * Need our own seek pointer. */ (void) close(diskfd); if ((diskfd = open(disk, O_RDONLY)) < 0) - quit("slave couldn't reopen disk: %s\n", strerror(errno)); + quit("minion couldn't reopen disk: %s\n", strerror(errno)); /* - * Need the pid of the next slave in the loop... + * Need the pid of the next minion in the loop... */ - if ((nread = atomic(read, cmd, (char *)&nextslave, sizeof nextslave)) - != sizeof nextslave) { - quit("master/slave protocol botched - didn't get pid of next slave.\n"); + if ((nread = atomic(read, cmd, (char *)&nextminion, sizeof nextminion)) + != sizeof nextminion) { + quit("master/minion protocol botched - didn't get pid of next minion.\n"); } /* * Get list of blocks to dump, read the blocks into tape buffer */ - while ((nread = atomic(read, cmd, (char *)slp->req, reqsiz)) == reqsiz) { - struct req *p = slp->req; + while ((nread = atomic(read, cmd, (char *)mlp->req, reqsiz)) == reqsiz) { + struct req *p = mlp->req; for (trecno = 0; trecno < ntrec; trecno += p->count, p += p->count) { if (p->dblk) { - blkread(p->dblk, slp->tblock[trecno], + blkread(p->dblk, mlp->tblock[trecno], p->count * TP_BSIZE); } else { if (p->count != 1 || atomic(read, cmd, - (char *)slp->tblock[trecno], + (char *)mlp->tblock[trecno], TP_BSIZE) != TP_BSIZE) - quit("master/slave protocol botched.\n"); + quit("master/minion protocol botched.\n"); } } if (setjmp(jmpbuf) == 0) { @@ -816,14 +816,14 @@ doslave(int cmd, int slave_number) while (eot_count < 10 && size < writesize) { #ifdef RDUMP if (host) - wrote = rmtwrite(slp->tblock[0]+size, + wrote = rmtwrite(mlp->tblock[0]+size, writesize-size); else #endif - wrote = write(tapefd, slp->tblock[0]+size, + wrote = write(tapefd, mlp->tblock[0]+size, writesize-size); #ifdef WRITEDEBUG - printf("slave %d wrote %d\n", slave_number, wrote); + printf("minion %d wrote %d\n", minion_number, wrote); #endif if (wrote < 0) break; @@ -834,8 +834,8 @@ doslave(int cmd, int slave_number) #ifdef WRITEDEBUG if (size != writesize) - printf("slave %d only wrote %d out of %d bytes and gave up.\n", - slave_number, size, writesize); + printf("minion %d only wrote %d out of %d bytes and gave up.\n", + minion_number, size, writesize); #endif /* @@ -862,10 +862,10 @@ doslave(int cmd, int slave_number) } /* - * If partial write, don't want next slave to go. + * If partial write, don't want next minion to go. * Also jolts him awake. */ - (void) kill(nextslave, SIGUSR2); + (void) kill(nextminion, SIGUSR2); } if (nread != 0) quit("error reading command pipe: %s\n", strerror(errno)); From owner-svn-src-all@freebsd.org Sat Jun 20 04:24:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C15C8346570; Sat, 20 Jun 2020 04:24:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pjH4058Mz4LWL; Sat, 20 Jun 2020 04:23:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13EE226A76; Sat, 20 Jun 2020 04:23:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K4NvV9035027; Sat, 20 Jun 2020 04:23:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K4Nv29035026; Sat, 20 Jun 2020 04:23:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006200423.05K4Nv29035026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jun 2020 04:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362423 - stable/12/usr.bin/ldd X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.bin/ldd X-SVN-Commit-Revision: 362423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:24:02 -0000 Author: kib Date: Sat Jun 20 04:23:57 2020 New Revision: 362423 URL: https://svnweb.freebsd.org/changeset/base/362423 Log: MFC r362152: Fix ldd for PIE binaries after rtld stopped accepting binaries for dlopen. Modified: stable/12/usr.bin/ldd/ldd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ldd/ldd.c ============================================================================== --- stable/12/usr.bin/ldd/ldd.c Sat Jun 20 04:19:17 2020 (r362422) +++ stable/12/usr.bin/ldd/ldd.c Sat Jun 20 04:23:57 2020 (r362423) @@ -289,10 +289,18 @@ is_executable(const char *fname, int fd, int *is_shlib #endif Elf_Ehdr elf; } hdr; - int n; + Elf_Phdr phdr, dynphdr; + Elf_Dyn *dynp; + void *dyndata; +#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) + Elf32_Phdr phdr32, dynphdr32; + Elf32_Dyn *dynp32; +#endif + int df1pie, dynamic, i, n; *is_shlib = 0; *type = TYPE_UNKNOWN; + df1pie = 0; if ((n = read(fd, &hdr, sizeof(hdr))) == -1) { warn("%s: can't read program header", fname); @@ -319,8 +327,6 @@ is_executable(const char *fname, int fd, int *is_shlib if ((size_t)n >= sizeof(hdr.elf32) && IS_ELF(hdr.elf32) && hdr.elf32.e_ident[EI_CLASS] == ELFCLASS32) { /* Handle 32 bit ELF objects */ - Elf32_Phdr phdr; - int dynamic, i; dynamic = 0; *type = TYPE_ELF32; @@ -330,13 +336,14 @@ is_executable(const char *fname, int fd, int *is_shlib return (0); } for (i = 0; i < hdr.elf32.e_phnum; i++) { - if (read(fd, &phdr, hdr.elf32.e_phentsize) != - sizeof(phdr)) { + if (read(fd, &phdr32, hdr.elf32.e_phentsize) != + sizeof(phdr32)) { warnx("%s: can't read program header", fname); return (0); } - if (phdr.p_type == PT_DYNAMIC) { + if (phdr32.p_type == PT_DYNAMIC) { dynamic = 1; + dynphdr32 = phdr32; break; } } @@ -345,9 +352,36 @@ is_executable(const char *fname, int fd, int *is_shlib warnx("%s: not a dynamic ELF executable", fname); return (0); } + if (hdr.elf32.e_type == ET_DYN) { + if (lseek(fd, dynphdr32.p_offset, SEEK_SET) == -1) { + warnx("%s: dynamic segment out of range", + fname); + return (0); + } + dyndata = malloc(dynphdr32.p_filesz); + if (dyndata == NULL) { + warn("malloc"); + return (0); + } + if (read(fd, dyndata, dynphdr32.p_filesz) != + (ssize_t)dynphdr32.p_filesz) { + free(dyndata); + warnx("%s: can't read dynamic segment", fname); + return (0); + } + for (dynp32 = dyndata; dynp32->d_tag != DT_NULL; + dynp32++) { + if (dynp32->d_tag != DT_FLAGS_1) + continue; + df1pie = (dynp32->d_un.d_val & DF_1_PIE) != 0; + break; + } + free(dyndata); + if (hdr.elf32.e_ident[EI_OSABI] == ELFOSABI_FREEBSD) { - *is_shlib = 1; + if (!df1pie) + *is_shlib = 1; return (1); } warnx("%s: not a FreeBSD ELF shared object", fname); @@ -361,8 +395,6 @@ is_executable(const char *fname, int fd, int *is_shlib if ((size_t)n >= sizeof(hdr.elf) && IS_ELF(hdr.elf) && hdr.elf.e_ident[EI_CLASS] == ELF_TARG_CLASS) { /* Handle default ELF objects on this architecture */ - Elf_Phdr phdr; - int dynamic, i; dynamic = 0; *type = TYPE_ELF; @@ -379,6 +411,7 @@ is_executable(const char *fname, int fd, int *is_shlib } if (phdr.p_type == PT_DYNAMIC) { dynamic = 1; + dynphdr = phdr; break; } } @@ -387,10 +420,36 @@ is_executable(const char *fname, int fd, int *is_shlib warnx("%s: not a dynamic ELF executable", fname); return (0); } + if (hdr.elf.e_type == ET_DYN) { + if (lseek(fd, dynphdr.p_offset, SEEK_SET) == -1) { + warnx("%s: dynamic segment out of range", + fname); + return (0); + } + dyndata = malloc(dynphdr.p_filesz); + if (dyndata == NULL) { + warn("malloc"); + return (0); + } + if (read(fd, dyndata, dynphdr.p_filesz) != + (ssize_t)dynphdr.p_filesz) { + free(dyndata); + warnx("%s: can't read dynamic segment", fname); + return (0); + } + for (dynp = dyndata; dynp->d_tag != DT_NULL; dynp++) { + if (dynp->d_tag != DT_FLAGS_1) + continue; + df1pie = (dynp->d_un.d_val & DF_1_PIE) != 0; + break; + } + free(dyndata); + switch (hdr.elf.e_ident[EI_OSABI]) { case ELFOSABI_FREEBSD: - *is_shlib = 1; + if (!df1pie) + *is_shlib = 1; return (1); #ifdef __ARM_EABI__ case ELFOSABI_NONE: From owner-svn-src-all@freebsd.org Sat Jun 20 04:26:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5B2A34679A; Sat, 20 Jun 2020 04:26:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pjKV3v5Qz4LlK; Sat, 20 Jun 2020 04:26:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80F8326824; Sat, 20 Jun 2020 04:26:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K4Q61t035194; Sat, 20 Jun 2020 04:26:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K4Q6Ju035193; Sat, 20 Jun 2020 04:26:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006200426.05K4Q6Ju035193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jun 2020 04:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362424 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 362424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:26:06 -0000 Author: kib Date: Sat Jun 20 04:26:05 2020 New Revision: 362424 URL: https://svnweb.freebsd.org/changeset/base/362424 Log: MFC r362150: procctl(2): consistently refer to the data pointer as 'data'. Modified: stable/12/lib/libc/sys/procctl.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/procctl.2 ============================================================================== --- stable/12/lib/libc/sys/procctl.2 Sat Jun 20 04:23:57 2020 (r362423) +++ stable/12/lib/libc/sys/procctl.2 Sat Jun 20 04:26:05 2020 (r362424) @@ -40,7 +40,7 @@ .Sh SYNOPSIS .In sys/procctl.h .Ft int -.Fn procctl "idtype_t idtype" "id_t id" "int cmd" "void *arg" +.Fn procctl "idtype_t idtype" "id_t id" "int cmd" "void *data" .Sh DESCRIPTION The .Fn procctl @@ -80,7 +80,7 @@ by in the specified process or its descendants that did not changed the control nor modified it by other means. The -.Va arg +.Fa data parameter must point to the integer variable holding one of the following values: .Bl -tag -width PROC_ASLR_FORCE_DISABLE @@ -99,7 +99,7 @@ Use system-wide configured policy for ASLR. .It Dv PROC_ASLR_STATUS Returns the current status of ASLR enablement for the target process. The -.Va arg +.Fa data parameter must point to the integer variable, where one of the following values is written: .Bl -tag -width PROC_ASLR_FORCE_DISABLE @@ -117,7 +117,7 @@ Set process protection state. This is used to mark a process as protected from being killed if the system exhausts the available memory and swap. The -.Fa arg +.Fa data parameter must point to an integer containing an operation and zero or more optional flags. The following operations are supported: From owner-svn-src-all@freebsd.org Sat Jun 20 04:27:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78CBD3463EF; Sat, 20 Jun 2020 04:27:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pjMH28DQz4LvJ; Sat, 20 Jun 2020 04:27:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43C4F268B4; Sat, 20 Jun 2020 04:27:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K4Rdx2035320; Sat, 20 Jun 2020 04:27:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K4RdGU035319; Sat, 20 Jun 2020 04:27:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006200427.05K4RdGU035319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jun 2020 04:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362425 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 362425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:27:39 -0000 Author: kib Date: Sat Jun 20 04:27:38 2020 New Revision: 362425 URL: https://svnweb.freebsd.org/changeset/base/362425 Log: MFC r362151: procctl(2): document PROC_KPTI Modified: stable/12/lib/libc/sys/procctl.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/procctl.2 ============================================================================== --- stable/12/lib/libc/sys/procctl.2 Sat Jun 20 04:26:05 2020 (r362424) +++ stable/12/lib/libc/sys/procctl.2 Sat Jun 20 04:27:38 2020 (r362425) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2020 +.Dd June 13, 2020 .Dt PROCCTL 2 .Os .Sh NAME @@ -524,6 +524,47 @@ Stack gaps are disabled in the process after .Xr execve 2 . .El .El +.Sh x86 MACHINE-SPECIFIC REQUESTS +.Bl -tag -width PROC_KPTI_STATUS +.It Dv PROC_KPTI_CTL +AMD64 only. +Controls the Kernel Page Table Isolation (KPTI) option for the children +of the specified process. +For the command to work, the +.Va vm.pmap.kpti +tunable must be enabled on boot. +It is not possible to change the KPTI setting for a running process, +except at the +.Xr execve 2 , +where the address space is reinitialized. +.Pp +The +.Fa data +parameter must point to an integer variable containing one of the +following commands: +.Bl -tag -width PROC_KPTI_CTL_DISABLE_ON_EXEC +.It Dv PROC_KPTI_CTL_ENABLE_ON_EXEC +Enable KPTI after +.Xr execve 2 . +.It Dv PROC_KPTI_CTL_DISABLE_ON_EXEC +Disable KPTI after +.Xr execve 2 . +Only root or a process having the +.Va PRIV_IO +privilege might use this option. +.El +.It Dv PROC_KPTI_STATUS +Returns the current KPTI status for the specified process. +.Fa data must point to the integer variable, which returns the +following statuses: +.Bl -tag -width PROC_KPTI_CTL_DISABLE_ON_EXEC +.It Dv PROC_KPTI_CTL_ENABLE_ON_EXEC +.It Dv PROC_KPTI_CTL_DISABLE_ON_EXEC +.El +.Pp +The status is or-ed with the +.Va PROC_KPTI_STATUS_ACTIVE +in case KPTI is active for the current address space of the process. .Sh NOTES Disabling tracing on a process should not be considered a security feature, as it is bypassable both by the kernel and privileged processes, From owner-svn-src-all@freebsd.org Sat Jun 20 04:39:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64D19346958; Sat, 20 Jun 2020 04:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pjdP1jT3z4Mm0; Sat, 20 Jun 2020 04:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EF0C26942; Sat, 20 Jun 2020 04:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K4dqt8041611; Sat, 20 Jun 2020 04:39:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K4dqLQ041610; Sat, 20 Jun 2020 04:39:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006200439.05K4dqLQ041610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jun 2020 04:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362426 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 362426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:39:53 -0000 Author: kib Date: Sat Jun 20 04:39:52 2020 New Revision: 362426 URL: https://svnweb.freebsd.org/changeset/base/362426 Log: MFC r311286: The callers of kern_getfsstat(UIO_SYSSPACE) expect that *buf always returns memory which must be freed, regardless of the error. Assign NULL to *buf in case we are not going to allocate any memory due to invalid mode. Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Sat Jun 20 04:27:38 2020 (r362425) +++ stable/11/sys/kern/vfs_syscalls.c Sat Jun 20 04:39:52 2020 (r362426) @@ -409,6 +409,8 @@ kern_getfsstat(struct thread *td, struct statfs **buf, case MNT_NOWAIT: break; default: + if (bufseg == UIO_SYSSPACE) + *buf = NULL; return (EINVAL); } restart: From owner-svn-src-all@freebsd.org Sat Jun 20 04:41:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7C03346805; Sat, 20 Jun 2020 04:41:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pjfm5ZjDz4My0; Sat, 20 Jun 2020 04:41:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAE9026AA4; Sat, 20 Jun 2020 04:41:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K4f48N044816; Sat, 20 Jun 2020 04:41:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K4f40C044815; Sat, 20 Jun 2020 04:41:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006200441.05K4f40C044815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jun 2020 04:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362427 - stable/11/usr.bin/ldd X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/usr.bin/ldd X-SVN-Commit-Revision: 362427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:41:05 -0000 Author: kib Date: Sat Jun 20 04:41:04 2020 New Revision: 362427 URL: https://svnweb.freebsd.org/changeset/base/362427 Log: MFC r362152: Fix ldd for PIE binaries after rtld stopped accepting binaries for dlopen. Modified: stable/11/usr.bin/ldd/ldd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ldd/ldd.c ============================================================================== --- stable/11/usr.bin/ldd/ldd.c Sat Jun 20 04:39:52 2020 (r362426) +++ stable/11/usr.bin/ldd/ldd.c Sat Jun 20 04:41:04 2020 (r362427) @@ -289,10 +289,18 @@ is_executable(const char *fname, int fd, int *is_shlib #endif Elf_Ehdr elf; } hdr; - int n; + Elf_Phdr phdr, dynphdr; + Elf_Dyn *dynp; + void *dyndata; +#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) + Elf32_Phdr phdr32, dynphdr32; + Elf32_Dyn *dynp32; +#endif + int df1pie, dynamic, i, n; *is_shlib = 0; *type = TYPE_UNKNOWN; + df1pie = 0; if ((n = read(fd, &hdr, sizeof(hdr))) == -1) { warn("%s: can't read program header", fname); @@ -319,8 +327,6 @@ is_executable(const char *fname, int fd, int *is_shlib if ((size_t)n >= sizeof(hdr.elf32) && IS_ELF(hdr.elf32) && hdr.elf32.e_ident[EI_CLASS] == ELFCLASS32) { /* Handle 32 bit ELF objects */ - Elf32_Phdr phdr; - int dynamic, i; dynamic = 0; *type = TYPE_ELF32; @@ -330,13 +336,14 @@ is_executable(const char *fname, int fd, int *is_shlib return (0); } for (i = 0; i < hdr.elf32.e_phnum; i++) { - if (read(fd, &phdr, hdr.elf32.e_phentsize) != - sizeof(phdr)) { + if (read(fd, &phdr32, hdr.elf32.e_phentsize) != + sizeof(phdr32)) { warnx("%s: can't read program header", fname); return (0); } - if (phdr.p_type == PT_DYNAMIC) { + if (phdr32.p_type == PT_DYNAMIC) { dynamic = 1; + dynphdr32 = phdr32; break; } } @@ -345,9 +352,36 @@ is_executable(const char *fname, int fd, int *is_shlib warnx("%s: not a dynamic ELF executable", fname); return (0); } + if (hdr.elf32.e_type == ET_DYN) { + if (lseek(fd, dynphdr32.p_offset, SEEK_SET) == -1) { + warnx("%s: dynamic segment out of range", + fname); + return (0); + } + dyndata = malloc(dynphdr32.p_filesz); + if (dyndata == NULL) { + warn("malloc"); + return (0); + } + if (read(fd, dyndata, dynphdr32.p_filesz) != + (ssize_t)dynphdr32.p_filesz) { + free(dyndata); + warnx("%s: can't read dynamic segment", fname); + return (0); + } + for (dynp32 = dyndata; dynp32->d_tag != DT_NULL; + dynp32++) { + if (dynp32->d_tag != DT_FLAGS_1) + continue; + df1pie = (dynp32->d_un.d_val & DF_1_PIE) != 0; + break; + } + free(dyndata); + if (hdr.elf32.e_ident[EI_OSABI] == ELFOSABI_FREEBSD) { - *is_shlib = 1; + if (!df1pie) + *is_shlib = 1; return (1); } warnx("%s: not a FreeBSD ELF shared object", fname); @@ -361,8 +395,6 @@ is_executable(const char *fname, int fd, int *is_shlib if ((size_t)n >= sizeof(hdr.elf) && IS_ELF(hdr.elf) && hdr.elf.e_ident[EI_CLASS] == ELF_TARG_CLASS) { /* Handle default ELF objects on this architecture */ - Elf_Phdr phdr; - int dynamic, i; dynamic = 0; *type = TYPE_ELF; @@ -379,6 +411,7 @@ is_executable(const char *fname, int fd, int *is_shlib } if (phdr.p_type == PT_DYNAMIC) { dynamic = 1; + dynphdr = phdr; break; } } @@ -387,10 +420,36 @@ is_executable(const char *fname, int fd, int *is_shlib warnx("%s: not a dynamic ELF executable", fname); return (0); } + if (hdr.elf.e_type == ET_DYN) { + if (lseek(fd, dynphdr.p_offset, SEEK_SET) == -1) { + warnx("%s: dynamic segment out of range", + fname); + return (0); + } + dyndata = malloc(dynphdr.p_filesz); + if (dyndata == NULL) { + warn("malloc"); + return (0); + } + if (read(fd, dyndata, dynphdr.p_filesz) != + (ssize_t)dynphdr.p_filesz) { + free(dyndata); + warnx("%s: can't read dynamic segment", fname); + return (0); + } + for (dynp = dyndata; dynp->d_tag != DT_NULL; dynp++) { + if (dynp->d_tag != DT_FLAGS_1) + continue; + df1pie = (dynp->d_un.d_val & DF_1_PIE) != 0; + break; + } + free(dyndata); + switch (hdr.elf.e_ident[EI_OSABI]) { case ELFOSABI_FREEBSD: - *is_shlib = 1; + if (!df1pie) + *is_shlib = 1; return (1); #ifdef __ARM_EABI__ case ELFOSABI_NONE: From owner-svn-src-all@freebsd.org Sat Jun 20 04:42:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4633346E1E; Sat, 20 Jun 2020 04:42:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pjhJ4Hrpz4NJb; Sat, 20 Jun 2020 04:42:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ED8326C3C; Sat, 20 Jun 2020 04:42:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K4gOlb047664; Sat, 20 Jun 2020 04:42:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K4gOZg047663; Sat, 20 Jun 2020 04:42:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006200442.05K4gOZg047663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jun 2020 04:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362428 - stable/11/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/sys X-SVN-Commit-Revision: 362428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:42:24 -0000 Author: kib Date: Sat Jun 20 04:42:24 2020 New Revision: 362428 URL: https://svnweb.freebsd.org/changeset/base/362428 Log: MFC r362150: procctl(2): consistently refer to the data pointer as 'data'. Modified: stable/11/lib/libc/sys/procctl.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/procctl.2 ============================================================================== --- stable/11/lib/libc/sys/procctl.2 Sat Jun 20 04:41:04 2020 (r362427) +++ stable/11/lib/libc/sys/procctl.2 Sat Jun 20 04:42:24 2020 (r362428) @@ -40,7 +40,7 @@ .Sh SYNOPSIS .In sys/procctl.h .Ft int -.Fn procctl "idtype_t idtype" "id_t id" "int cmd" "void *arg" +.Fn procctl "idtype_t idtype" "id_t id" "int cmd" "void *data" .Sh DESCRIPTION The .Fn procctl @@ -77,7 +77,7 @@ Set process protection state. This is used to mark a process as protected from being killed if the system exhausts the available memory and swap. The -.Fa arg +.Fa data parameter must point to an integer containing an operation and zero or more optional flags. The following operations are supported: From owner-svn-src-all@freebsd.org Sat Jun 20 04:44:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14E44346E3C; Sat, 20 Jun 2020 04:44:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pjkY5MfXz4NVd; Sat, 20 Jun 2020 04:44:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A0DF026FB; Sat, 20 Jun 2020 04:44:21 +0000 (UTC) Date: Sat, 20 Jun 2020 04:44:21 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362420 - head/share/misc Message-ID: <20200620044421.GA97516@FreeBSD.org> References: <202006200407.05K47iuN022477@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202006200407.05K47iuN022477@repo.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 04:44:22 -0000 On Sat, Jun 20, 2020 at 04:07:44AM +0000, Warner Losh wrote: > New Revision: 362420 > URL: https://svnweb.freebsd.org/changeset/base/362420 > > Log: > Correct 1BSD release date. > > The Quarter Century of Unix book said that 1BSD was released March 1979. > However, the 1BSD tape image that's on Kirk's historical unix collection > has an earlier date. > > It was common practice, at the time, to create a new copy of the tape > from the master system ^^^^^^ Ouch! :-) ./danfe From owner-svn-src-all@freebsd.org Sat Jun 20 06:10:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DABEB347D31; Sat, 20 Jun 2020 06:10:42 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49plfB5V19z4SRd; Sat, 20 Jun 2020 06:10:42 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7A5527C0C; Sat, 20 Jun 2020 06:10:42 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K6Agv7096777; Sat, 20 Jun 2020 06:10:42 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K6AgFm096775; Sat, 20 Jun 2020 06:10:42 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202006200610.05K6AgFm096775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sat, 20 Jun 2020 06:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362429 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 362429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 06:10:42 -0000 Author: pstef Date: Sat Jun 20 06:10:42 2020 New Revision: 362429 URL: https://svnweb.freebsd.org/changeset/base/362429 Log: libutil: remove extraneous ": " from error messages Each of the err() family of functions already takes care of that. Modified: head/lib/libutil/gr_util.c head/lib/libutil/pw_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Sat Jun 20 04:42:24 2020 (r362428) +++ head/lib/libutil/gr_util.c Sat Jun 20 06:10:42 2020 (r362429) @@ -108,11 +108,11 @@ gr_lock(void) if (errno == EWOULDBLOCK) { errx(1, "the group file is busy"); } else { - err(1, "could not lock the group file: "); + err(1, "could not lock the group file"); } } if (fstat(lockfd, &st) == -1) - err(1, "fstat() failed: "); + err(1, "fstat() failed"); if (st.st_nlink != 0) break; close(lockfd); Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Sat Jun 20 04:42:24 2020 (r362428) +++ head/lib/libutil/pw_util.c Sat Jun 20 06:10:42 2020 (r362429) @@ -181,7 +181,7 @@ pw_lock(void) if (errno == EWOULDBLOCK) { errx(1, "the password db file is busy"); } else { - err(1, "could not lock the passwd file: "); + err(1, "could not lock the passwd file"); } } @@ -191,7 +191,7 @@ pw_lock(void) * close and retry. */ if (fstat(lockfd, &st) == -1) - err(1, "fstat() failed: "); + err(1, "fstat() failed"); if (st.st_nlink != 0) break; close(lockfd); From owner-svn-src-all@freebsd.org Sat Jun 20 06:20:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 367E9348308; Sat, 20 Jun 2020 06:20:01 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49plrx0kWcz4T1J; Sat, 20 Jun 2020 06:20:01 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13CA827F17; Sat, 20 Jun 2020 06:20:01 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K6K0hm003203; Sat, 20 Jun 2020 06:20:00 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K6K0vh003202; Sat, 20 Jun 2020 06:20:00 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202006200620.05K6K0vh003202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sat, 20 Jun 2020 06:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362430 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 362430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 06:20:01 -0000 Author: pstef Date: Sat Jun 20 06:20:00 2020 New Revision: 362430 URL: https://svnweb.freebsd.org/changeset/base/362430 Log: Make vipw error message less cryptic Unable to find an editor, vipw would give this error: # env EDITOR=fnord vipw vipw: pw_edit(): No such file or directory vigr or crontab do better: # env EDITOR=fnord crontab -e crontab: no crontab for root - using an empty one crontab: fnord: No such file or directory crontab: "fnord" exited with status 1 After this change, vipw behaves more like vigr or crontab: # env EDITOR=fnord vipw vipw: fnord: No such file or directory vipw: "fnord" exited with status 1 Reviewed by: rpokala, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25369 Modified: head/lib/libutil/pw_util.c Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Sat Jun 20 06:10:42 2020 (r362429) +++ head/lib/libutil/pw_util.c Sat Jun 20 06:20:00 2020 (r362430) @@ -308,12 +308,13 @@ pw_edit(int notsetuid) sigaction(SIGQUIT, &sa_quit, NULL); sigprocmask(SIG_SETMASK, &oldsigset, NULL); if (notsetuid) { - (void)setgid(getgid()); - (void)setuid(getuid()); + if (setgid(getgid()) == -1) + err(1, "setgid"); + if (setuid(getuid()) == -1) + err(1, "setuid"); } - errno = 0; execlp(editor, editor, tempname, (char *)NULL); - _exit(errno); + err(1, "%s", editor); default: /* parent */ break; @@ -327,7 +328,9 @@ pw_edit(int notsetuid) break; } else if (WIFSTOPPED(pstat)) { raise(WSTOPSIG(pstat)); - } else if (WIFEXITED(pstat) && WEXITSTATUS(pstat) == 0) { + } else if (WIFEXITED(pstat)) { + if (WEXITSTATUS(pstat) != 0) + errx(1, "\"%s\" exited with status %d", editor, WEXITSTATUS(pstat)); editpid = -1; break; } else { From owner-svn-src-all@freebsd.org Sat Jun 20 06:23:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF4E734867C; Sat, 20 Jun 2020 06:23:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49plx04TJlz4TjC; Sat, 20 Jun 2020 06:23:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AC468284; Sat, 20 Jun 2020 06:23:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K6NWe3008892; Sat, 20 Jun 2020 06:23:32 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K6NVNI008886; Sat, 20 Jun 2020 06:23:31 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006200623.05K6NVNI008886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 20 Jun 2020 06:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362431 - in head: stand stand/efi/libefi stand/efi/loader stand/i386/gptzfsboot stand/i386/libi386 stand/i386/zfsboot stand/libsa/zfs stand/userboot/userboot sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: stand stand/efi/libefi stand/efi/loader stand/i386/gptzfsboot stand/i386/libi386 stand/i386/zfsboot stand/libsa/zfs stand/userboot/userboot sys/cddl/boot/zfs X-SVN-Commit-Revision: 362431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 06:23:32 -0000 Author: tsoome Date: Sat Jun 20 06:23:31 2020 New Revision: 362431 URL: https://svnweb.freebsd.org/changeset/base/362431 Log: loader: create single zfs nextboot implementation We should have nextboot feature implemented in libsa zfs code. To get there, I have created zfs_nextboot() implementation based on two sources, our current simple textual string based approach with added structured boot label PAD structure from OpenZFS. Secondly, all nvlist details are moved to separate source file and restructured a bit. This is done to provide base support to add nvlist add/update feature in followup updates. And finally, the zfsboot/gptzfsboot disk access functions are swapped to use libi386 and libsa. Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25324 Added: head/stand/libsa/zfs/nvlist.c (contents, props changed) Modified: head/stand/efi/libefi/Makefile head/stand/efi/loader/main.c head/stand/i386/gptzfsboot/Makefile head/stand/i386/libi386/Makefile head/stand/i386/zfsboot/Makefile head/stand/i386/zfsboot/zfsboot.c head/stand/libsa/zfs/Makefile.inc head/stand/libsa/zfs/libzfs.h head/stand/libsa/zfs/zfs.c head/stand/libsa/zfs/zfsimpl.c head/stand/loader.mk head/stand/userboot/userboot/Makefile head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Sat Jun 20 06:20:00 2020 (r362430) +++ head/stand/efi/libefi/Makefile Sat Jun 20 06:23:31 2020 (r362431) @@ -52,6 +52,8 @@ CFLAGS.efi_console.c+= -I${SRCTOP}/sys/teken CFLAGS.teken.c+= -I${SRCTOP}/sys/teken .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Sat Jun 20 06:20:00 2020 (r362430) +++ head/stand/efi/loader/main.c Sat Jun 20 06:23:31 2020 (r362431) @@ -260,6 +260,8 @@ probe_zfs_currdev(uint64_t guid) { char *devname; struct zfs_devdesc currdev; + char *buf = NULL; + bool rv; currdev.dd.d_dev = &zfs_dev; currdev.dd.d_unit = 0; @@ -269,7 +271,18 @@ probe_zfs_currdev(uint64_t guid) devname = efi_fmtdev(&currdev); init_zfs_bootenv(devname); - return (sanity_check_currdev()); + rv = sanity_check_currdev(); + if (rv) { + buf = malloc(VDEV_PAD_SIZE); + if (buf != NULL) { + if (zfs_nextboot(&currdev, buf, VDEV_PAD_SIZE) == 0) { + printf("zfs nextboot: %s\n", buf); + set_currdev(buf); + } + free(buf); + } + } + return (rv); } #endif Modified: head/stand/i386/gptzfsboot/Makefile ============================================================================== --- head/stand/i386/gptzfsboot/Makefile Sat Jun 20 06:20:00 2020 (r362430) +++ head/stand/i386/gptzfsboot/Makefile Sat Jun 20 06:23:31 2020 (r362431) @@ -4,7 +4,7 @@ .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ ${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \ - ${SASRC} + ${BOOTSRC}/common FILES= gptzfsboot MAN= gptzfsboot.8 @@ -19,12 +19,16 @@ ORG2= 0x0 CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -O1 \ - -DGPT -DZFS -DBOOT2 \ + -DBOOT2 \ + -DLOADER_GPT_SUPPORT \ + -DLOADER_MBR_SUPPORT \ + -DLOADER_ZFS_SUPPORT \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ + -I${BOOTSRC}/i386/libi386 \ -I${ZFSSRC} \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ @@ -60,15 +64,18 @@ gptldr.bin: gptldr.out gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o -CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ - drv.o gpt.o ${OPENCRYPTO_XTS} +OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o +CLEANFILES+= gptzfsboot.bin gptzfsboot.out ${OBJS} ${OPENCRYPTO_XTS} +# i386 standalone support library +LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a + gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ +gptzfsboot.out: ${BTXCRT} ${OBJS} \ ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} + ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBI386} ${LIBSA32} zfsboot.o: ${ZFSSRC}/zfsimpl.c Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Sat Jun 20 06:20:00 2020 (r362430) +++ head/stand/i386/libi386/Makefile Sat Jun 20 06:23:31 2020 (r362431) @@ -37,6 +37,8 @@ CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ -I${LDRSRC} -I${BOOTSRC}/i386/common \ + -I${SYSDIR}/cddl/boot/zfs \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Sat Jun 20 06:20:00 2020 (r362430) +++ head/stand/i386/zfsboot/Makefile Sat Jun 20 06:23:31 2020 (r362431) @@ -2,7 +2,7 @@ .include -.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} +.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${BOOTSRC}/common FILES= zfsboot MAN= zfsboot.8 @@ -17,13 +17,17 @@ ORG2= 0x2000 CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -O1 \ - -DZFS -DBOOT2 \ + -DBOOT2 \ + -DLOADER_GPT_SUPPORT \ + -DLOADER_MBR_SUPPORT \ + -DLOADER_ZFS_SUPPORT \ + -DLOADER_UFS_SUPPORT \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ - -I${BOOTSRC}/i386 \ + -I${BOOTSRC}/i386/libi386 \ -I${ZFSSRC} \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ @@ -34,6 +38,8 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings +CFLAGS.part.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib + CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} @@ -51,14 +57,18 @@ zfsboot1: zfsldr.out zfsldr.out: zfsldr.o ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} zfsldr.o +OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o + ${OBJS} # We currently allow 256k bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. # BOOT2SIZE= 262144 +# i386 standalone support library +LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a + zfsboot2: zfsboot.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 @@ -74,8 +84,8 @@ zfsboot.ldr: zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} -zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o - ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} +zfsboot.out: ${BTXCRT} ${OBJS} + ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBI386} ${LIBSA32} SRCS= zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sat Jun 20 06:20:00 2020 (r362430) +++ head/stand/i386/zfsboot/zfsboot.c Sat Jun 20 06:23:31 2020 (r362431) @@ -16,7 +16,7 @@ #include __FBSDID("$FreeBSD$"); -#include "stand.h" +#include #include #include @@ -35,15 +35,16 @@ __FBSDID("$FreeBSD$"); #include #include - +#include "bootstrap.h" +#include "libi386.h" #include #include "lib.h" #include "rbx.h" -#include "drv.h" -#include "edd.h" #include "cons.h" #include "bootargs.h" +#include "disk.h" +#include "part.h" #include "paths.h" #include "libzfs.h" @@ -61,13 +62,8 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define DEV_GELIBOOT_BSIZE 4096 - extern uint32_t _end; -#ifdef GPT -static const uuid_t freebsd_zfs_uuid = GPT_ENT_TYPE_FREEBSD_ZFS; -#endif static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { RBX_DUAL, @@ -107,785 +103,153 @@ static const struct string { static const unsigned char dev_maj[NDEV] = {30, 4, 2}; +static struct i386_devdesc *bdev; static char cmd[512]; static char cmddup[512]; static char kname[1024]; -static char rootname[256]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint32_t bootdev; static struct zfs_boot_args zfsargs; +#ifdef LOADER_GELI_SUPPORT +static struct geli_boot_args geliargs; +#endif -vm_offset_t high_heap_base; -uint32_t bios_basemem, bios_extmem, high_heap_size; +extern vm_offset_t high_heap_base; +extern uint32_t bios_basemem, bios_extmem, high_heap_size; -static struct bios_smap smap; +static char *heap_top; +static char *heap_bottom; -/* - * The minimum amount of memory to reserve in bios_extmem for the heap. - */ -#define HEAP_MIN (64 * 1024 * 1024) - -static char *heap_next; -static char *heap_end; - -/* Buffers that must not span a 64k boundary. */ -#define READ_BUF_SIZE 8192 -struct dmadat { - char rdbuf[READ_BUF_SIZE]; /* for reading large things */ - char secbuf[READ_BUF_SIZE]; /* for MBR/disklabel */ -}; -static struct dmadat *dmadat; - void exit(int); -void reboot(void); +static void i386_zfs_probe(void); static void load(void); static int parse_cmd(void); -static void bios_getmem(void); -int main(void); #ifdef LOADER_GELI_SUPPORT #include "geliboot.h" static char gelipw[GELI_PW_MAXLEN]; #endif -struct zfsdsk { - struct dsk dsk; -#ifdef LOADER_GELI_SUPPORT - struct geli_dev *gdev; +struct arch_switch archsw; /* MI/MD interface boundary */ +static char boot_devname[2 * ZFS_MAXNAMELEN + 8]; /* disk or pool:dataset */ + +struct devsw *devsw[] = { + &bioshd, +#if defined(LOADER_ZFS_SUPPORT) + &zfs_dev, #endif + NULL }; -#include "zfsimpl.c" - -/* - * Read from a dnode (which must be from a ZPL filesystem). - */ -static int -zfs_read(spa_t *spa, const dnode_phys_t *dnode, off_t *offp, void *start, - size_t size) -{ - const znode_phys_t *zp = (const znode_phys_t *) dnode->dn_bonus; - size_t n; - int rc; - - n = size; - if (*offp + n > zp->zp_size) - n = zp->zp_size - *offp; - - rc = dnode_read(spa, dnode, *offp, start, n); - if (rc) - return (-1); - *offp += n; - - return (n); -} - -/* - * Current ZFS pool - */ -static spa_t *spa; -static spa_t *primary_spa; -static vdev_t *primary_vdev; - -/* - * A wrapper for dskread that doesn't have to worry about whether the - * buffer pointer crosses a 64k boundary. - */ -static int -vdev_read(void *xvdev, void *priv, off_t off, void *buf, size_t bytes) -{ - char *p; - daddr_t lba, alignlba; - off_t diff; - unsigned int nb, alignnb; - struct zfsdsk *zdsk = priv; - - if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) - return (-1); - - p = buf; - lba = off / DEV_BSIZE; - lba += zdsk->dsk.start; - /* - * Align reads to 4k else 4k sector GELIs will not decrypt. - * Round LBA down to nearest multiple of DEV_GELIBOOT_BSIZE bytes. - */ - alignlba = rounddown2(off, DEV_GELIBOOT_BSIZE) / DEV_BSIZE; - /* - * The read must be aligned to DEV_GELIBOOT_BSIZE bytes relative to the - * start of the GELI partition, not the start of the actual disk. - */ - alignlba += zdsk->dsk.start; - diff = (lba - alignlba) * DEV_BSIZE; - - while (bytes > 0) { - nb = bytes / DEV_BSIZE; - /* - * Ensure that the read size plus the leading offset does not - * exceed the size of the read buffer. - */ - if (nb > (READ_BUF_SIZE - diff) / DEV_BSIZE) - nb = (READ_BUF_SIZE - diff) / DEV_BSIZE; - /* - * Round the number of blocks to read up to the nearest multiple - * of DEV_GELIBOOT_BSIZE. - */ - alignnb = roundup2(nb * DEV_BSIZE + diff, DEV_GELIBOOT_BSIZE) - / DEV_BSIZE; - - if (zdsk->dsk.size > 0 && alignlba + alignnb > - zdsk->dsk.size + zdsk->dsk.start) { - printf("Shortening read at %lld from %d to %lld\n", - alignlba, alignnb, - (zdsk->dsk.size + zdsk->dsk.start) - alignlba); - alignnb = (zdsk->dsk.size + zdsk->dsk.start) - alignlba; - } - - if (drvread(&zdsk->dsk, dmadat->rdbuf, alignlba, alignnb)) - return (-1); -#ifdef LOADER_GELI_SUPPORT - /* decrypt */ - if (zdsk->gdev != NULL) { - if (geli_read(zdsk->gdev, - ((alignlba - zdsk->dsk.start) * DEV_BSIZE), - dmadat->rdbuf, alignnb * DEV_BSIZE)) - return (-1); - } +struct fs_ops *file_system[] = { +#if defined(LOADER_ZFS_SUPPORT) + &zfs_fsops, #endif - memcpy(p, dmadat->rdbuf + diff, nb * DEV_BSIZE); - p += nb * DEV_BSIZE; - lba += nb; - alignlba += alignnb; - bytes -= nb * DEV_BSIZE; - /* Don't need the leading offset after the first block. */ - diff = 0; - } - - return (0); -} -/* Match the signature exactly due to signature madness */ -static int -vdev_read2(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) -{ - return (vdev_read(vdev, priv, off, buf, bytes)); -} - - -static int -vdev_write(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) -{ - char *p; - daddr_t lba; - unsigned int nb; - struct zfsdsk *zdsk = priv; - - if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) - return (-1); - - p = buf; - lba = off / DEV_BSIZE; - lba += zdsk->dsk.start; - while (bytes > 0) { - nb = bytes / DEV_BSIZE; - if (nb > READ_BUF_SIZE / DEV_BSIZE) - nb = READ_BUF_SIZE / DEV_BSIZE; - memcpy(dmadat->rdbuf, p, nb * DEV_BSIZE); - if (drvwrite(&zdsk->dsk, dmadat->rdbuf, lba, nb)) - return (-1); - p += nb * DEV_BSIZE; - lba += nb; - bytes -= nb * DEV_BSIZE; - } - - return (0); -} - -static int -xfsread(const dnode_phys_t *dnode, off_t *offp, void *buf, size_t nbyte) -{ - if ((size_t)zfs_read(spa, dnode, offp, buf, nbyte) != nbyte) { - printf("Invalid format\n"); - return (-1); - } - return (0); -} - -/* - * Read Pad2 (formerly "Boot Block Header") area of the first - * vdev label of the given vdev. - */ -static int -vdev_read_pad2(vdev_t *vdev, char *buf, size_t size) -{ - blkptr_t bp; - char *tmp; - off_t off = offsetof(vdev_label_t, vl_pad2); - int rc; - - if (size > VDEV_PAD_SIZE) - size = VDEV_PAD_SIZE; - - tmp = malloc(VDEV_PAD_SIZE); - if (tmp == NULL) - return (ENOMEM); - - BP_ZERO(&bp); - BP_SET_LSIZE(&bp, VDEV_PAD_SIZE); - BP_SET_PSIZE(&bp, VDEV_PAD_SIZE); - BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); - BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); - DVA_SET_OFFSET(BP_IDENTITY(&bp), off); - rc = vdev_read_phys(vdev, &bp, tmp, off, 0); - if (rc == 0) - memcpy(buf, tmp, size); - free(tmp); - return (rc); -} - -static int -vdev_clear_pad2(vdev_t *vdev) -{ - char *zeroes; - uint64_t *end; - off_t off = offsetof(vdev_label_t, vl_pad2); - int rc; - - zeroes = malloc(VDEV_PAD_SIZE); - if (zeroes == NULL) - return (ENOMEM); - - memset(zeroes, 0, VDEV_PAD_SIZE); - end = (uint64_t *)(zeroes + VDEV_PAD_SIZE); - /* ZIO_CHECKSUM_LABEL magic and pre-calcualted checksum for all zeros */ - end[-5] = 0x0210da7ab10c7a11; - end[-4] = 0x97f48f807f6e2a3f; - end[-3] = 0xaf909f1658aacefc; - end[-2] = 0xcbd1ea57ff6db48b; - end[-1] = 0x6ec692db0d465fab; - rc = vdev_write(vdev, vdev->v_read_priv, off, zeroes, VDEV_PAD_SIZE); - free(zeroes); - return (rc); -} - -static void -bios_getmem(void) -{ - uint64_t size; - - /* Parse system memory map */ - v86.ebx = 0; - do { - v86.ctl = V86_FLAGS; - v86.addr = 0x15; /* int 0x15 function 0xe820 */ - v86.eax = 0xe820; - v86.ecx = sizeof(struct bios_smap); - v86.edx = SMAP_SIG; - v86.es = VTOPSEG(&smap); - v86.edi = VTOPOFF(&smap); - v86int(); - if (V86_CY(v86.efl) || (v86.eax != SMAP_SIG)) - break; - /* look for a low-memory segment that's large enough */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && - (smap.length >= (512 * 1024))) - bios_basemem = smap.length; - /* look for the first segment in 'extended' memory */ - if ((smap.type == SMAP_TYPE_MEMORY) && - (smap.base == 0x100000)) { - bios_extmem = smap.length; - } - - /* - * Look for the largest segment in 'extended' memory beyond - * 1MB but below 4GB. - */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && - (smap.base < 0x100000000ull)) { - size = smap.length; - - /* - * If this segment crosses the 4GB boundary, - * truncate it. - */ - if (smap.base + size > 0x100000000ull) - size = 0x100000000ull - smap.base; - - if (size > high_heap_size) { - high_heap_size = size; - high_heap_base = smap.base; - } - } - } while (v86.ebx != 0); - - /* Fall back to the old compatibility function for base memory */ - if (bios_basemem == 0) { - v86.ctl = 0; - v86.addr = 0x12; /* int 0x12 */ - v86int(); - - bios_basemem = (v86.eax & 0xffff) * 1024; - } - - /* - * Fall back through several compatibility functions for extended - * memory. - */ - if (bios_extmem == 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x15; /* int 0x15 function 0xe801 */ - v86.eax = 0xe801; - v86int(); - if (!V86_CY(v86.efl)) { - bios_extmem = ((v86.ecx & 0xffff) + - ((v86.edx & 0xffff) * 64)) * 1024; - } - } - if (bios_extmem == 0) { - v86.ctl = 0; - v86.addr = 0x15; /* int 0x15 function 0x88 */ - v86.eax = 0x8800; - v86int(); - bios_extmem = (v86.eax & 0xffff) * 1024; - } - - /* - * If we have extended memory and did not find a suitable heap - * region in the SMAP, use the last 3MB of 'extended' memory as a - * high heap candidate. - */ - if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { - high_heap_size = HEAP_MIN; - high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; - } -} - -/* - * Try to detect a device supported by the legacy int13 BIOS - */ -static int -int13probe(int drive) -{ - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x800; - v86.edx = drive; - v86int(); - - if (!V86_CY(v86.efl) && /* carry clear */ - ((v86.edx & 0xff) != (drive & DRV_MASK))) { /* unit # OK */ - if ((v86.ecx & 0x3f) == 0) { /* absurd sector size */ - return (0); /* skip device */ - } - return (1); - } - return (0); -} - -/* - * We call this when we find a ZFS vdev - ZFS consumes the dsk - * structure so we must make a new one. - */ -static struct zfsdsk * -copy_dsk(struct zfsdsk *zdsk) -{ - struct zfsdsk *newdsk; - - newdsk = malloc(sizeof(struct zfsdsk)); - *newdsk = *zdsk; - return (newdsk); -} - -/* - * Get disk size from GPT. - */ -static uint64_t -drvsize_gpt(struct dsk *dskp) -{ -#ifdef GPT - struct gpt_hdr hdr; - char *sec; - - sec = dmadat->secbuf; - if (drvread(dskp, sec, 1, 1)) - return (0); - - memcpy(&hdr, sec, sizeof(hdr)); - if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || - hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x00010000 || - hdr.hdr_entsz < sizeof(struct gpt_ent) || - DEV_BSIZE % hdr.hdr_entsz != 0) { - return (0); - } - return (hdr.hdr_lba_alt + 1); -#else - return (0); +#if defined(LOADER_UFS_SUPPORT) + &ufs_fsops, #endif -} + NULL +}; -/* - * Get disk size from eax=0x800 and 0x4800. We need to probe both - * because 0x4800 may not be available and we would like to get more - * or less correct disk size - if it is possible at all. - * Note we do not really want to touch drv.c because that code is shared - * with boot2 and we can not afford to grow that code. - */ -static uint64_t -drvsize_ext(struct zfsdsk *zdsk) +caddr_t +ptov(uintptr_t x) { - struct dsk *dskp; - uint64_t size, tmp; - int cyl, hds, sec; - - dskp = &zdsk->dsk; - - /* Try to read disk size from GPT */ - size = drvsize_gpt(dskp); - if (size != 0) - return (size); - - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x800; - v86.edx = dskp->drive; - v86int(); - - /* Don't error out if we get bad sector number, try EDD as well */ - if (V86_CY(v86.efl) || /* carry set */ - (v86.edx & 0xff) <= (unsigned)(dskp->drive & 0x7f)) /* unit # bad */ - return (0); - cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1; - /* Convert max head # -> # of heads */ - hds = ((v86.edx & 0xff00) >> 8) + 1; - sec = v86.ecx & 0x3f; - - size = (uint64_t)cyl * hds * sec; - - /* Determine if we can use EDD with this device. */ - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4100; - v86.edx = dskp->drive; - v86.ebx = 0x55aa; - v86int(); - if (V86_CY(v86.efl) || /* carry set */ - (v86.ebx & 0xffff) != 0xaa55 || /* signature */ - (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) - return (size); - - tmp = drvsize(dskp); - if (tmp > size) - size = tmp; - - return (size); + return (PTOV(x)); } -/* - * The "layered" ioctl to read disk/partition size. Unfortunately - * the zfsboot case is hardest, because we do not have full software - * stack available, so we need to do some manual work here. - */ -uint64_t -ldi_get_size(void *priv) -{ - struct zfsdsk *zdsk = priv; - uint64_t size = zdsk->dsk.size; - - if (zdsk->dsk.start == 0) - size = drvsize_ext(zdsk); - - return (size * DEV_BSIZE); -} - -static void -probe_drive(struct zfsdsk *zdsk) -{ -#ifdef GPT - struct gpt_hdr hdr; - struct gpt_ent *ent; - unsigned part, entries_per_sec; - daddr_t slba; -#endif -#if defined(GPT) || defined(LOADER_GELI_SUPPORT) - daddr_t elba; -#endif - - struct dos_partition *dp; - char *sec; - unsigned i; - -#ifdef LOADER_GELI_SUPPORT - /* - * Taste the disk, if it is GELI encrypted, decrypt it then dig out the - * partition table and probe each slice/partition in turn for a vdev or - * GELI encrypted vdev. - */ - elba = drvsize_ext(zdsk); - if (elba > 0) { - elba--; - } - zdsk->gdev = geli_taste(vdev_read, zdsk, elba, "disk%u:0:"); - if ((zdsk->gdev != NULL) && (geli_havekey(zdsk->gdev) == 0)) - geli_passphrase(zdsk->gdev, gelipw); -#endif /* LOADER_GELI_SUPPORT */ - - sec = dmadat->secbuf; - zdsk->dsk.start = 0; - -#ifdef GPT - /* - * First check for GPT. - */ - if (drvread(&zdsk->dsk, sec, 1, 1)) { - return; - } - memcpy(&hdr, sec, sizeof(hdr)); - if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || - hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x00010000 || - hdr.hdr_entsz < sizeof(*ent) || DEV_BSIZE % hdr.hdr_entsz != 0) { - goto trymbr; - } - - /* - * Probe all GPT partitions for the presence of ZFS pools. We - * return the spa_t for the first we find (if requested). This - * will have the effect of booting from the first pool on the - * disk. - * - * If no vdev is found, GELI decrypting the device and try again - */ - entries_per_sec = DEV_BSIZE / hdr.hdr_entsz; - slba = hdr.hdr_lba_table; - elba = slba + hdr.hdr_entries / entries_per_sec; - while (slba < elba) { - zdsk->dsk.start = 0; - if (drvread(&zdsk->dsk, sec, slba, 1)) - return; - for (part = 0; part < entries_per_sec; part++) { - ent = (struct gpt_ent *)(sec + part * hdr.hdr_entsz); - if (memcmp(&ent->ent_type, &freebsd_zfs_uuid, - sizeof(uuid_t)) == 0) { - zdsk->dsk.start = ent->ent_lba_start; - zdsk->dsk.size = - ent->ent_lba_end - ent->ent_lba_start + 1; - zdsk->dsk.slice = part + 1; - zdsk->dsk.part = 255; - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - /* - * This slice had a vdev. We need a new - * dsk structure now since the vdev now - * owns this one. - */ - zdsk = copy_dsk(zdsk); - } -#ifdef LOADER_GELI_SUPPORT - else if ((zdsk->gdev = geli_taste(vdev_read, - zdsk, ent->ent_lba_end - ent->ent_lba_start, - "disk%up%u:", zdsk->dsk.unit, - zdsk->dsk.slice)) != NULL) { - if (geli_havekey(zdsk->gdev) == 0 || - geli_passphrase(zdsk->gdev, gelipw) - == 0) { - /* - * This slice has GELI, - * check it for ZFS. - */ - if (vdev_probe(vdev_read2, - zdsk, NULL) == 0) { - /* - * This slice had a - * vdev. We need a new - * dsk structure now - * since the vdev now - * owns this one. - */ - zdsk = copy_dsk(zdsk); - } - break; - } - } -#endif /* LOADER_GELI_SUPPORT */ - } - } - slba++; - } - return; -trymbr: -#endif /* GPT */ - - if (drvread(&zdsk->dsk, sec, DOSBBSECTOR, 1)) - return; - dp = (void *)(sec + DOSPARTOFF); - - for (i = 0; i < NDOSPART; i++) { - if (!dp[i].dp_typ) - continue; - zdsk->dsk.start = dp[i].dp_start; - zdsk->dsk.size = dp[i].dp_size; - zdsk->dsk.slice = i + 1; - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - zdsk = copy_dsk(zdsk); - } -#ifdef LOADER_GELI_SUPPORT - else if ((zdsk->gdev = geli_taste(vdev_read, zdsk, - dp[i].dp_size - dp[i].dp_start, "disk%us%u:")) != NULL) { - if (geli_havekey(zdsk->gdev) == 0 || - geli_passphrase(zdsk->gdev, gelipw) == 0) { - /* - * This slice has GELI, check it for ZFS. - */ - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - /* - * This slice had a vdev. We need a new - * dsk structure now since the vdev now - * owns this one. - */ - zdsk = copy_dsk(zdsk); - } - break; - } - } -#endif /* LOADER_GELI_SUPPORT */ - } -} - int main(void) { - dnode_phys_t dn; - off_t off; - struct zfsdsk *zdsk; - int autoboot, i; - int nextboot; - int rc; + unsigned i; + int auto_boot, fd, nextboot = 0; + struct disk_devdesc devdesc; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - bios_getmem(); if (high_heap_size > 0) { - heap_end = PTOV(high_heap_base + high_heap_size); - heap_next = PTOV(high_heap_base); + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); } else { - heap_next = (char *)dmadat + sizeof(*dmadat); - heap_end = (char *)PTOV(bios_basemem); + heap_bottom = (char *) + (roundup2(__base + (int32_t)&_end, 0x10000) - __base); + heap_top = (char *)PTOV(bios_basemem); } - setheap(heap_next, heap_end); + setheap(heap_bottom, heap_top); - zdsk = calloc(1, sizeof(struct zfsdsk)); - zdsk->dsk.drive = *(uint8_t *)PTOV(ARGS); - zdsk->dsk.type = zdsk->dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - zdsk->dsk.unit = zdsk->dsk.drive & DRV_MASK; - zdsk->dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; - zdsk->dsk.part = 0; - zdsk->dsk.start = 0; - zdsk->dsk.size = drvsize_ext(zdsk); + /* + * Initialise the block cache. Set the upper limit. + */ + bcache_init(32768, 512); + archsw.arch_autoload = NULL; + archsw.arch_getdev = i386_getdev; + archsw.arch_copyin = NULL; + archsw.arch_copyout = NULL; + archsw.arch_readin = NULL; + archsw.arch_isainb = NULL; + archsw.arch_isaoutb = NULL; + archsw.arch_zfs_probe = i386_zfs_probe; + bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); bootinfo.bi_basemem = bios_basemem / 1024; bootinfo.bi_extmem = bios_extmem / 1024; bootinfo.bi_memsizes_valid++; - bootinfo.bi_bios_dev = zdsk->dsk.drive; + bootinfo.bi_bios_dev = *(uint8_t *)PTOV(ARGS); - bootdev = MAKEBOOTDEV(dev_maj[zdsk->dsk.type], - zdsk->dsk.slice, zdsk->dsk.unit, zdsk->dsk.part); + /* Set up fall back device name. */ + snprintf(boot_devname, sizeof (boot_devname), "disk%d:", + bd_bios2unit(bootinfo.bi_bios_dev)); - /* Process configuration file */ + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); - autoboot = 1; + disk_parsedev(&devdesc, boot_devname + 4, NULL); - zfs_init(); + bootdev = MAKEBOOTDEV(dev_maj[DEVT_DISK], devdesc.d_slice + 1, + devdesc.dd.d_unit, + devdesc.d_partition >= 0 ? devdesc.d_partition : 0xff); /* - * Probe the boot drive first - we will try to boot from whatever - * pool we find on that drive. + * zfs_fmtdev() can be called only after dv_init */ - probe_drive(zdsk); - - /* - * Probe the rest of the drives that the bios knows about. This - * will find any other available pools and it may fill in missing - * vdevs for the boot pool. - */ -#ifndef VIRTUALBOX - for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) -#else - for (i = 0; i < MAXBDDEV; i++) -#endif - { - if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) - continue; - - if (!int13probe(i | DRV_HARD)) - break; - - zdsk = calloc(1, sizeof(struct zfsdsk)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 20 07:46:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2390634A12C; Sat, 20 Jun 2020 07:46:44 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pnn005wvz4Zgp; Sat, 20 Jun 2020 07:46:44 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEBC09261; Sat, 20 Jun 2020 07:46:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K7khJX058070; Sat, 20 Jun 2020 07:46:43 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K7khGK058069; Sat, 20 Jun 2020 07:46:43 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006200746.05K7khGK058069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 20 Jun 2020 07:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362432 - head/stand/libofw X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libofw X-SVN-Commit-Revision: 362432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 07:46:44 -0000 Author: tsoome Date: Sat Jun 20 07:46:43 2020 New Revision: 362432 URL: https://svnweb.freebsd.org/changeset/base/362432 Log: loader: fix libofw build after r362431 Modified: head/stand/libofw/Makefile Modified: head/stand/libofw/Makefile ============================================================================== --- head/stand/libofw/Makefile Sat Jun 20 06:23:31 2020 (r362431) +++ head/stand/libofw/Makefile Sat Jun 20 07:46:43 2020 (r362432) @@ -9,7 +9,7 @@ SRCS= devicename.c ofw_console.c ofw_copy.c ofw_disk.c ofw_time.c openfirm.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c -CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${ZFSSRC} -I${SYSDIR}/cddl/boot/zfs # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} From owner-svn-src-all@freebsd.org Sat Jun 20 08:22:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4382034ACF6; Sat, 20 Jun 2020 08:22:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ppZp123vz4dF3; Sat, 20 Jun 2020 08:22:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E8A295F6; Sat, 20 Jun 2020 08:22:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05K8MvoJ083461; Sat, 20 Jun 2020 08:22:57 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05K8Mvfr083460; Sat, 20 Jun 2020 08:22:57 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202006200822.05K8Mvfr083460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 20 Jun 2020 08:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362433 - head/stand/libofw X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libofw X-SVN-Commit-Revision: 362433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 08:22:58 -0000 Author: tsoome Date: Sat Jun 20 08:22:57 2020 New Revision: 362433 URL: https://svnweb.freebsd.org/changeset/base/362433 Log: loader: libofw build is missing sys/list.h after r362431 Add another include path Modified: head/stand/libofw/Makefile Modified: head/stand/libofw/Makefile ============================================================================== --- head/stand/libofw/Makefile Sat Jun 20 07:46:43 2020 (r362432) +++ head/stand/libofw/Makefile Sat Jun 20 08:22:57 2020 (r362433) @@ -10,6 +10,7 @@ SRCS= devicename.c ofw_console.c ofw_copy.c ofw_disk.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c CFLAGS+= -I${ZFSSRC} -I${SYSDIR}/cddl/boot/zfs +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} From owner-svn-src-all@freebsd.org Sat Jun 20 11:10:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B51F34E707; Sat, 20 Jun 2020 11:10:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49ptJF4ryNz3bSZ; Sat, 20 Jun 2020 11:10:37 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05KBAZSR099452; Sat, 20 Jun 2020 04:10:35 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05KBAZBU099451; Sat, 20 Jun 2020 04:10:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006201110.05KBAZBU099451@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362422 - head/sbin/dump In-Reply-To: <202006200419.05K4JIJ6029148@repo.freebsd.org> To: Warner Losh Date: Sat, 20 Jun 2020 04:10:35 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49ptJF4ryNz3bSZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 11:10:38 -0000 > Author: imp > Date: Sat Jun 20 04:19:17 2020 > New Revision: 362422 > URL: https://svnweb.freebsd.org/changeset/base/362422 > > Log: > Increase the whimsy in this file by famring dump's work out to minions. Adjust > variables accordingly. Thankfully, we are able to do this without additional > banana expenditures. This flys in the face of its intent and as a "commit" is more racially biased than the code was! > Modified: > head/sbin/dump/tape.c > > Modified: head/sbin/dump/tape.c > ============================================================================== > --- head/sbin/dump/tape.c Sat Jun 20 04:07:58 2020 (r362421) > +++ head/sbin/dump/tape.c Sat Jun 20 04:19:17 2020 (r362422) > @@ -75,19 +75,19 @@ static char *nexttape; > static FILE *popenfp = NULL; > > static int atomic(ssize_t (*)(), int, char *, int); > -static void doslave(int, int); > -static void enslave(void); > +static void dominion(int, int); > +static void enminion(void); > static void flushtape(void); > static void killall(void); > static void rollforward(void); > > /* > * Concurrent dump mods (Caltech) - disk block reading and tape writing > - * are exported to several slave processes. While one slave writes the > + * are exported to several minion processes. While one minion writes the > * tape, the others read disk blocks; they pass control of the tape in > * a ring via signals. The parent process traverses the file system and > - * sends writeheader()'s and lists of daddr's to the slaves via pipes. > - * The following structure defines the instruction packets sent to slaves. > + * sends writeheader()'s and lists of daddr's to the minions via pipes. > + * The following structure defines the instruction packets sent to minions. > */ > struct req { > ufs2_daddr_t dblk; > @@ -95,20 +95,20 @@ struct req { > }; > static int reqsiz; > > -#define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */ > -static struct slave { > +#define MINIONS 3 /* 1 minion writing, 1 reading, 1 for slack */ > +static struct minion { > int64_t tapea; /* header number at start of this chunk */ > int64_t firstrec; /* record number of this block */ > int count; /* count to next header (used for TS_TAPE */ > /* after EOT) */ > int inode; /* inode that we are currently dealing with */ > - int fd; /* FD for this slave */ > - int pid; /* PID for this slave */ > - int sent; /* 1 == we've sent this slave requests */ > + int fd; /* FD for this minion */ > + int pid; /* PID for this minion */ > + int sent; /* 1 == we've sent this minion requests */ > char (*tblock)[TP_BSIZE]; /* buffer for data blocks */ > struct req *req; /* buffer for requests */ > -} slaves[SLAVES+1]; > -static struct slave *slp; > +} minions[MINIONS+1]; > +static struct minion *mlp; > > static char (*nextblock)[TP_BSIZE]; > > @@ -116,9 +116,9 @@ static int master; /* pid of master, for sending error > static int tenths; /* length of tape used per block written */ > static volatile sig_atomic_t caught; /* have we caught the signal to proceed? */ > static volatile sig_atomic_t ready; /* reached the lock point without having */ > - /* received the SIGUSR2 signal from the prev slave? */ > + /* received the SIGUSR2 signal from the prev minion? */ > static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ > - /* SIGUSR2 arrives from the previous slave */ > + /* SIGUSR2 arrives from the previous minion */ > > int > alloctape(void) > @@ -143,20 +143,20 @@ alloctape(void) > * packets, so flushtape() can write them together with one write(). > * Align tape buffer on page boundary to speed up tape write(). > */ > - for (i = 0; i <= SLAVES; i++) { > + for (i = 0; i <= MINIONS; i++) { > buf = (char *) > malloc((unsigned)(reqsiz + writesize + pgoff + TP_BSIZE)); > if (buf == NULL) > return(0); > - slaves[i].tblock = (char (*)[TP_BSIZE]) > + minions[i].tblock = (char (*)[TP_BSIZE]) > (((long)&buf[ntrec + 1] + pgoff) &~ pgoff); > - slaves[i].req = (struct req *)slaves[i].tblock - ntrec - 1; > + minions[i].req = (struct req *)minions[i].tblock - ntrec - 1; > } > - slp = &slaves[0]; > - slp->count = 1; > - slp->tapea = 0; > - slp->firstrec = 0; > - nextblock = slp->tblock; > + mlp = &minions[0]; > + mlp->count = 1; > + mlp->tapea = 0; > + mlp->firstrec = 0; > + nextblock = mlp->tblock; > return(1); > } > > @@ -164,8 +164,8 @@ void > writerec(char *dp, int isspcl) > { > > - slp->req[trecno].dblk = (ufs2_daddr_t)0; > - slp->req[trecno].count = 1; > + mlp->req[trecno].dblk = (ufs2_daddr_t)0; > + mlp->req[trecno].count = 1; > /* Can't do a structure assignment due to alignment problems */ > bcopy(dp, *(nextblock)++, sizeof (union u_spcl)); > if (isspcl) > @@ -185,8 +185,8 @@ dumpblock(ufs2_daddr_t blkno, int size) > dblkno = fsbtodb(sblock, blkno); > tpblks = size >> tp_bshift; > while ((avail = MIN(tpblks, ntrec - trecno)) > 0) { > - slp->req[trecno].dblk = dblkno; > - slp->req[trecno].count = avail; > + mlp->req[trecno].dblk = dblkno; > + mlp->req[trecno].count = avail; > trecno += avail; > spcl.c_tapea += avail; > if (trecno >= ntrec) > @@ -232,27 +232,27 @@ flushtape(void) > int i, blks, got; > int64_t lastfirstrec; > > - int siz = (char *)nextblock - (char *)slp->req; > + int siz = (char *)nextblock - (char *)mlp->req; > > - slp->req[trecno].count = 0; /* Sentinel */ > + mlp->req[trecno].count = 0; /* Sentinel */ > > - if (atomic(write, slp->fd, (char *)slp->req, siz) != siz) > + if (atomic(write, mlp->fd, (char *)mlp->req, siz) != siz) > quit("error writing command pipe: %s\n", strerror(errno)); > - slp->sent = 1; /* we sent a request, read the response later */ > + mlp->sent = 1; /* we sent a request, read the response later */ > > - lastfirstrec = slp->firstrec; > + lastfirstrec = mlp->firstrec; > > - if (++slp >= &slaves[SLAVES]) > - slp = &slaves[0]; > + if (++mlp >= &minions[MINIONS]) > + mlp = &minions[0]; > > - /* Read results back from next slave */ > - if (slp->sent) { > - if (atomic(read, slp->fd, (char *)&got, sizeof got) > + /* Read results back from next minion */ > + if (mlp->sent) { > + if (atomic(read, mlp->fd, (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - slp->sent = 0; > + mlp->sent = 0; > > /* Check for end of tape */ > if (got < writesize) { > @@ -262,15 +262,15 @@ flushtape(void) > * Drain the results, don't care what the values were. > * If we read them here then trewind won't... > */ > - for (i = 0; i < SLAVES; i++) { > - if (slaves[i].sent) { > - if (atomic(read, slaves[i].fd, > + for (i = 0; i < MINIONS; i++) { > + if (minions[i].sent) { > + if (atomic(read, minions[i].fd, > (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - slaves[i].sent = 0; > + minions[i].sent = 0; > } > } > > @@ -288,11 +288,11 @@ flushtape(void) > if (spcl.c_addr[i] != 0) > blks++; > } > - slp->count = lastspclrec + blks + 1 - spcl.c_tapea; > - slp->tapea = spcl.c_tapea; > - slp->firstrec = lastfirstrec + ntrec; > - slp->inode = curino; > - nextblock = slp->tblock; > + mlp->count = lastspclrec + blks + 1 - spcl.c_tapea; > + mlp->tapea = spcl.c_tapea; > + mlp->firstrec = lastfirstrec + ntrec; > + mlp->inode = curino; > + nextblock = mlp->tblock; > trecno = 0; > asize += tenths; > blockswritten += ntrec; > @@ -312,7 +312,7 @@ trewind(void) > int f; > int got; > > - for (f = 0; f < SLAVES; f++) { > + for (f = 0; f < MINIONS; f++) { > /* > * Drain the results, but unlike EOT we DO (or should) care > * what the return values were, since if we detect EOT after > @@ -321,22 +321,22 @@ trewind(void) > * > * fixme: punt for now. > */ > - if (slaves[f].sent) { > - if (atomic(read, slaves[f].fd, (char *)&got, sizeof got) > + if (minions[f].sent) { > + if (atomic(read, minions[f].fd, (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - slaves[f].sent = 0; > + minions[f].sent = 0; > if (got != writesize) { > msg("EOT detected in last 2 tape records!\n"); > msg("Use a longer tape, decrease the size estimate\n"); > quit("or use no size estimate at all.\n"); > } > } > - (void) close(slaves[f].fd); > + (void) close(minions[f].fd); > } > - while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ > + while (wait((int *)NULL) >= 0) /* wait for any signals from minions */ > /* void */; > > if (pipeout) > @@ -396,29 +396,29 @@ void > rollforward(void) > { > struct req *p, *q, *prev; > - struct slave *tslp; > + struct minion *tmlp; > int i, size, got; > int64_t savedtapea; > union u_spcl *ntb, *otb; > - tslp = &slaves[SLAVES]; > - ntb = (union u_spcl *)tslp->tblock[1]; > + tmlp = &minions[MINIONS]; > + ntb = (union u_spcl *)tmlp->tblock[1]; > > /* > - * Each of the N slaves should have requests that need to > - * be replayed on the next tape. Use the extra slave buffers > - * (slaves[SLAVES]) to construct request lists to be sent to > - * each slave in turn. > + * Each of the N minions should have requests that need to > + * be replayed on the next tape. Use the extra minion buffers > + * (minions[MINIONS]) to construct request lists to be sent to > + * each minion in turn. > */ > - for (i = 0; i < SLAVES; i++) { > - q = &tslp->req[1]; > - otb = (union u_spcl *)slp->tblock; > + for (i = 0; i < MINIONS; i++) { > + q = &tmlp->req[1]; > + otb = (union u_spcl *)mlp->tblock; > > /* > - * For each request in the current slave, copy it to tslp. > + * For each request in the current minion, copy it to tmlp. > */ > > prev = NULL; > - for (p = slp->req; p->count > 0; p += p->count) { > + for (p = mlp->req; p->count > 0; p += p->count) { > *q = *p; > if (p->dblk == 0) > *ntb++ = *otb++; /* copy the datablock also */ > @@ -433,26 +433,26 @@ rollforward(void) > ntb--; > q -= 1; > q->count = 0; > - q = &tslp->req[0]; > + q = &tmlp->req[0]; > if (i == 0) { > q->dblk = 0; > q->count = 1; > trecno = 0; > - nextblock = tslp->tblock; > + nextblock = tmlp->tblock; > savedtapea = spcl.c_tapea; > - spcl.c_tapea = slp->tapea; > + spcl.c_tapea = mlp->tapea; > startnewtape(0); > spcl.c_tapea = savedtapea; > lastspclrec = savedtapea - 1; > } > size = (char *)ntb - (char *)q; > - if (atomic(write, slp->fd, (char *)q, size) != size) { > + if (atomic(write, mlp->fd, (char *)q, size) != size) { > perror(" DUMP: error writing command pipe"); > dumpabort(0); > } > - slp->sent = 1; > - if (++slp >= &slaves[SLAVES]) > - slp = &slaves[0]; > + mlp->sent = 1; > + if (++mlp >= &minions[MINIONS]) > + mlp = &minions[0]; > > q->count = 1; > > @@ -464,34 +464,34 @@ rollforward(void) > */ > q->dblk = prev->dblk + > prev->count * (TP_BSIZE / DEV_BSIZE); > - ntb = (union u_spcl *)tslp->tblock; > + ntb = (union u_spcl *)tmlp->tblock; > } else { > /* > * It wasn't a disk block. Copy the data to its > * new location in the buffer. > */ > q->dblk = 0; > - *((union u_spcl *)tslp->tblock) = *ntb; > - ntb = (union u_spcl *)tslp->tblock[1]; > + *((union u_spcl *)tmlp->tblock) = *ntb; > + ntb = (union u_spcl *)tmlp->tblock[1]; > } > } > - slp->req[0] = *q; > - nextblock = slp->tblock; > + mlp->req[0] = *q; > + nextblock = mlp->tblock; > if (q->dblk == 0) > nextblock++; > trecno = 1; > > /* > - * Clear the first slaves' response. One hopes that it > + * Clear the first minions' response. One hopes that it > * worked ok, otherwise the tape is much too short! > */ > - if (slp->sent) { > - if (atomic(read, slp->fd, (char *)&got, sizeof got) > + if (mlp->sent) { > + if (atomic(read, mlp->fd, (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - slp->sent = 0; > + mlp->sent = 0; > > if (got != writesize) { > quit("EOT detected at start of the tape!\n"); > @@ -634,7 +634,7 @@ restore_check_point: > } > } > > - enslave(); /* Share open tape file descriptor with slaves */ > + enminion(); /* Share open tape file descriptor with minions */ > if (popenout) > close(tapefd); /* Give up our copy of it. */ > signal(SIGINFO, infosch); > @@ -643,18 +643,18 @@ restore_check_point: > blocksthisvol = 0; > if (top) > newtape++; /* new tape signal */ > - spcl.c_count = slp->count; > + spcl.c_count = mlp->count; > /* > * measure firstrec in TP_BSIZE units since restore doesn't > * know the correct ntrec value... > */ > - spcl.c_firstrec = slp->firstrec; > + spcl.c_firstrec = mlp->firstrec; > spcl.c_volume++; > spcl.c_type = TS_TAPE; > - writeheader((ino_t)slp->inode); > + writeheader((ino_t)mlp->inode); > if (tapeno > 1) > msg("Volume %d begins with blocks from inode %d\n", > - tapeno, slp->inode); > + tapeno, mlp->inode); > } > } > > @@ -687,7 +687,7 @@ Exit(status) > } > > /* > - * proceed - handler for SIGUSR2, used to synchronize IO between the slaves. > + * proceed - handler for SIGUSR2, used to synchronize IO between the minions. > */ > void > proceed(int signo __unused) > @@ -699,45 +699,45 @@ proceed(int signo __unused) > } > > void > -enslave(void) > +enminion(void) > { > int cmd[2]; > int i, j; > > master = getpid(); > > - signal(SIGTERM, dumpabort); /* Slave sends SIGTERM on dumpabort() */ > + signal(SIGTERM, dumpabort); /* Minion sends SIGTERM on dumpabort() */ > signal(SIGPIPE, sigpipe); > - signal(SIGUSR1, tperror); /* Slave sends SIGUSR1 on tape errors */ > - signal(SIGUSR2, proceed); /* Slave sends SIGUSR2 to next slave */ > + signal(SIGUSR1, tperror); /* Minion sends SIGUSR1 on tape errors */ > + signal(SIGUSR2, proceed); /* Minion sends SIGUSR2 to next minion */ > > - for (i = 0; i < SLAVES; i++) { > - if (i == slp - &slaves[0]) { > + for (i = 0; i < MINIONS; i++) { > + if (i == mlp - &minions[0]) { > caught = 1; > } else { > caught = 0; > } > > if (socketpair(AF_UNIX, SOCK_STREAM, 0, cmd) < 0 || > - (slaves[i].pid = fork()) < 0) > - quit("too many slaves, %d (recompile smaller): %s\n", > + (minions[i].pid = fork()) < 0) > + quit("too many minions, %d (recompile smaller): %s\n", > i, strerror(errno)); > > - slaves[i].fd = cmd[1]; > - slaves[i].sent = 0; > - if (slaves[i].pid == 0) { /* Slave starts up here */ > + minions[i].fd = cmd[1]; > + minions[i].sent = 0; > + if (minions[i].pid == 0) { /* Minion starts up here */ > for (j = 0; j <= i; j++) > - (void) close(slaves[j].fd); > + (void) close(minions[j].fd); > signal(SIGINT, SIG_IGN); /* Master handles this */ > - doslave(cmd[0], i); > + dominion(cmd[0], i); > Exit(X_FINOK); > } > } > > - for (i = 0; i < SLAVES; i++) > - (void) atomic(write, slaves[i].fd, > - (char *) &slaves[(i + 1) % SLAVES].pid, > - sizeof slaves[0].pid); > + for (i = 0; i < MINIONS; i++) > + (void) atomic(write, minions[i].fd, > + (char *) &minions[(i + 1) % MINIONS].pid, > + sizeof minions[0].pid); > > master = 0; > } > @@ -747,10 +747,10 @@ killall(void) > { > int i; > > - for (i = 0; i < SLAVES; i++) > - if (slaves[i].pid > 0) { > - (void) kill(slaves[i].pid, SIGKILL); > - slaves[i].sent = 0; > + for (i = 0; i < MINIONS; i++) > + if (minions[i].pid > 0) { > + (void) kill(minions[i].pid, SIGKILL); > + minions[i].sent = 0; > } > } > > @@ -762,42 +762,42 @@ killall(void) > * get the lock back for the next cycle by swapping descriptors. > */ > static void > -doslave(int cmd, int slave_number) > +dominion(int cmd, int minion_number) > { > int nread; > - int nextslave, size, wrote, eot_count; > + int nextminion, size, wrote, eot_count; > > /* > * Need our own seek pointer. > */ > (void) close(diskfd); > if ((diskfd = open(disk, O_RDONLY)) < 0) > - quit("slave couldn't reopen disk: %s\n", strerror(errno)); > + quit("minion couldn't reopen disk: %s\n", strerror(errno)); > > /* > - * Need the pid of the next slave in the loop... > + * Need the pid of the next minion in the loop... > */ > - if ((nread = atomic(read, cmd, (char *)&nextslave, sizeof nextslave)) > - != sizeof nextslave) { > - quit("master/slave protocol botched - didn't get pid of next slave.\n"); > + if ((nread = atomic(read, cmd, (char *)&nextminion, sizeof nextminion)) > + != sizeof nextminion) { > + quit("master/minion protocol botched - didn't get pid of next minion.\n"); > } > > /* > * Get list of blocks to dump, read the blocks into tape buffer > */ > - while ((nread = atomic(read, cmd, (char *)slp->req, reqsiz)) == reqsiz) { > - struct req *p = slp->req; > + while ((nread = atomic(read, cmd, (char *)mlp->req, reqsiz)) == reqsiz) { > + struct req *p = mlp->req; > > for (trecno = 0; trecno < ntrec; > trecno += p->count, p += p->count) { > if (p->dblk) { > - blkread(p->dblk, slp->tblock[trecno], > + blkread(p->dblk, mlp->tblock[trecno], > p->count * TP_BSIZE); > } else { > if (p->count != 1 || atomic(read, cmd, > - (char *)slp->tblock[trecno], > + (char *)mlp->tblock[trecno], > TP_BSIZE) != TP_BSIZE) > - quit("master/slave protocol botched.\n"); > + quit("master/minion protocol botched.\n"); > } > } > if (setjmp(jmpbuf) == 0) { > @@ -816,14 +816,14 @@ doslave(int cmd, int slave_number) > while (eot_count < 10 && size < writesize) { > #ifdef RDUMP > if (host) > - wrote = rmtwrite(slp->tblock[0]+size, > + wrote = rmtwrite(mlp->tblock[0]+size, > writesize-size); > else > #endif > - wrote = write(tapefd, slp->tblock[0]+size, > + wrote = write(tapefd, mlp->tblock[0]+size, > writesize-size); > #ifdef WRITEDEBUG > - printf("slave %d wrote %d\n", slave_number, wrote); > + printf("minion %d wrote %d\n", minion_number, wrote); > #endif > if (wrote < 0) > break; > @@ -834,8 +834,8 @@ doslave(int cmd, int slave_number) > > #ifdef WRITEDEBUG > if (size != writesize) > - printf("slave %d only wrote %d out of %d bytes and gave up.\n", > - slave_number, size, writesize); > + printf("minion %d only wrote %d out of %d bytes and gave up.\n", > + minion_number, size, writesize); > #endif > > /* > @@ -862,10 +862,10 @@ doslave(int cmd, int slave_number) > } > > /* > - * If partial write, don't want next slave to go. > + * If partial write, don't want next minion to go. > * Also jolts him awake. > */ > - (void) kill(nextslave, SIGUSR2); > + (void) kill(nextminion, SIGUSR2); > } > if (nread != 0) > quit("error reading command pipe: %s\n", strerror(errno)); > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jun 20 11:13:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7275A34E8CC; Sat, 20 Jun 2020 11:13:31 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49ptMb1796z3c2d; Sat, 20 Jun 2020 11:13:30 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05KBDTC3099484; Sat, 20 Jun 2020 04:13:29 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05KBDTJt099483; Sat, 20 Jun 2020 04:13:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006201113.05KBDTJt099483@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362420 - head/share/misc In-Reply-To: <20200620044421.GA97516@FreeBSD.org> To: Alexey Dokuchaev Date: Sat, 20 Jun 2020 04:13:29 -0700 (PDT) CC: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49ptMb1796z3c2d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 11:13:31 -0000 > On Sat, Jun 20, 2020 at 04:07:44AM +0000, Warner Losh wrote: > > New Revision: 362420 > > URL: https://svnweb.freebsd.org/changeset/base/362420 > > > > Log: > > Correct 1BSD release date. > > > > The Quarter Century of Unix book said that 1BSD was released March 1979. > > However, the 1BSD tape image that's on Kirk's historical unix collection > > has an earlier date. > > > > It was common practice, at the time, to create a new copy of the tape > > from the master system > ^^^^^^ > Ouch! :-) Given that this occured AFTER imp made a commit removing master/slave language I find it very ironic. Uh oh, we need to rewire our VCS system so we can correct our political incorrectness in our logs. > ./danfe -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jun 20 11:20:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D87CF34EA50; Sat, 20 Jun 2020 11:20:16 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ptWN5FxFz3cTX; Sat, 20 Jun 2020 11:20:16 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFB7CB941; Sat, 20 Jun 2020 11:20:16 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KBKGTE091367; Sat, 20 Jun 2020 11:20:16 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KBKGwC091366; Sat, 20 Jun 2020 11:20:16 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006201120.05KBKGwC091366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sat, 20 Jun 2020 11:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362434 - head/usr.bin/cmp X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/cmp X-SVN-Commit-Revision: 362434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 11:20:16 -0000 Author: fernape (ports committer) Date: Sat Jun 20 11:20:16 2020 New Revision: 362434 URL: https://svnweb.freebsd.org/changeset/base/362434 Log: cmp(1): Add EXAMPLES section Add a small number of examples depicting the use of -l, -z and byte offsets Approved by: 0mp@ Modified: head/usr.bin/cmp/cmp.1 Modified: head/usr.bin/cmp/cmp.1 ============================================================================== --- head/usr.bin/cmp/cmp.1 Sat Jun 20 08:22:57 2020 (r362433) +++ head/usr.bin/cmp/cmp.1 Sat Jun 20 11:20:16 2020 (r362434) @@ -31,7 +31,7 @@ .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 16, 2020 +.Dd June 20, 2020 .Dt CMP 1 .Os .Sh NAME @@ -107,26 +107,33 @@ file (before any differences were found). An error occurred. .El .Sh EXAMPLES -Assuming a file named example.txt with the following contents: +Assuming a file named +.Pa example.txt +with the following contents: .Bd -literal -offset indent a b c .Ed .Pp -Compare stdin with example.txt: +Compare stdin with +.Pa example.txt : .Bd -literal -offset indent $ echo -e "a\\nb\\nc" | cmp - example.txt .Ed .Pp -Same as above but introducing a change in byte three in stdin. +Same as above but introducing a change in the third byte of stdin. Show the byte number (decimal) and differing byte (octal): .Bd -literal -offset indent $ echo -e "a\\nR\\nc" | cmp -l - example.txt 3 122 142 .Ed .Pp -Compare example.txt and /boot/loader.conf exiting if size differs. +Compare file sizes of +.Pa example.txt +and +.Pa /boot/loader.conf +and return 1 if they are not equal. Note that .Fl z can only be used with regular files: @@ -135,8 +142,10 @@ $ cmp -z example.txt /boot/loader.conf example.txt /boot/loader.conf differ: size .Ed .Pp -Compare stdin with file example.txt omitting the 4 first bytes from stdin and -the 2 first bytes from example.txt: +Compare stdin with +.Pa example.txt +omitting the first 4 bytes from stdin and the first 2 bytes from +.Pa example.txt : .Bd -literal -offset indent $ echo -e "a\\nR\\nb\\nc" | cmp - example.txt 4 2 .Ed From owner-svn-src-all@freebsd.org Sat Jun 20 11:24:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C60F34EAFE; Sat, 20 Jun 2020 11:24:30 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ptcF6zqjz3cbd; Sat, 20 Jun 2020 11:24:29 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAF9EB572; Sat, 20 Jun 2020 11:24:29 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KBOTeH096946; Sat, 20 Jun 2020 11:24:29 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KBOTx3096945; Sat, 20 Jun 2020 11:24:29 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006201124.05KBOTx3096945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sat, 20 Jun 2020 11:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362435 - head/usr.bin/seq X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/seq X-SVN-Commit-Revision: 362435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 11:24:30 -0000 Author: fernape (ports committer) Date: Sat Jun 20 11:24:29 2020 New Revision: 362435 URL: https://svnweb.freebsd.org/changeset/base/362435 Log: seq(1): complete EXAMPLES section * Add a small description before the EXAMPLES that are already in the man page to explicitely state what we are trying to show instead of having the user guess what the example is doing. * Add two more examples to show usage of -s, -t and -f * mandoc -Tlint reports irrelevant use of .Tn so remove them since according to mdoc(7) it is there only for compatibility and should not be used in new manuals. Approved by: 0mp@ Modified: head/usr.bin/seq/seq.1 Modified: head/usr.bin/seq/seq.1 ============================================================================== --- head/usr.bin/seq/seq.1 Sat Jun 20 11:20:16 2020 (r362434) +++ head/usr.bin/seq/seq.1 Sat Jun 20 11:24:29 2020 (r362435) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2018 +.Dd June 20, 2020 .Dt SEQ 1 .Os .Sh NAME @@ -133,22 +133,51 @@ the default conversion is changed to .Sh EXIT STATUS .Ex -std .Sh EXAMPLES +Generate a sequence from 1 to 3 (included) with a default increment of 1: .Bd -literal -offset indent # seq 1 3 1 2 3 - +.Ed +.Pp +Generate a sequence from 3 to 1 (included) with a default increment of -1: +.Bd -literal -offset indent # seq 3 1 3 2 1 - +.Ed +.Pp +Generate a sequence from 0 to 0.1 (included) with an increment of 0.05 and padding +with leading zeroes. +.Bd -literal -offset indent # seq -w 0 .05 .1 0.00 0.05 0.10 .Ed +.Pp +Generate a sequence from 1 to 3 (included) with a default increment of 1, +a custom separator string and a custom terminator: +.Bd -literal -offset indent +# seq -s "-->" -t "[end of list]\\n" 1 3 +1-->2-->3-->[end of list] +.Ed +.Pp +Generate a sequence from 1 to 2 (included) with an increment of 0.2 and +print the results with two digits after the decimal point (using a +.Xr printf 3 +style format): +.Bd -literal -offset indent +# seq -f %.2f 1 0.2 2 +1.00 +1.20 +1.40 +1.60 +1.80 +2.00 +.Ed .Sh SEE ALSO .Xr jot 1 , .Xr printf 1 , @@ -165,12 +194,8 @@ command appeared in and was ported to .Fx 9.0 . This command was based on the command of the same name in -.Tn "Plan 9 from Bell Labs" -and the -.Tn GNU -core utilities. -The -.Tn GNU +Plan 9 from Bell Labs and the GNU core utilities. +The GNU .Nm command first appeared in the 1.13 shell utilities release. .Sh BUGS From owner-svn-src-all@freebsd.org Sat Jun 20 11:27:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBD0434F01B; Sat, 20 Jun 2020 11:27:59 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pthH4bByz3dDD; Sat, 20 Jun 2020 11:27:59 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98D00B95C; Sat, 20 Jun 2020 11:27:59 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KBRx4L097184; Sat, 20 Jun 2020 11:27:59 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KBRxNb097183; Sat, 20 Jun 2020 11:27:59 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006201127.05KBRxNb097183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sat, 20 Jun 2020 11:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362436 - head/usr.bin/join X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/join X-SVN-Commit-Revision: 362436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 11:27:59 -0000 Author: fernape (ports committer) Date: Sat Jun 20 11:27:59 2020 New Revision: 362436 URL: https://svnweb.freebsd.org/changeset/base/362436 Log: join(1): Add EXAMPLES section Add EXAMPLES covering options -e, -o, -t, -v, -1 Approved by: 0mp@ Differential Revision: https://reviews.freebsd.org/D25186 Modified: head/usr.bin/join/join.1 Modified: head/usr.bin/join/join.1 ============================================================================== --- head/usr.bin/join/join.1 Sat Jun 20 11:24:29 2020 (r362435) +++ head/usr.bin/join/join.1 Sat Jun 20 11:27:59 2020 (r362436) @@ -31,7 +31,7 @@ .\" @(#)join.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd July 5, 2004 +.Dd June 20, 2020 .Dt JOIN 1 .Os .Sh NAME @@ -164,6 +164,78 @@ is the standard input is used. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Assuming a file named +.Pa nobel_laureates.txt +with information about some of the first Nobel Peace Prize laureates: +.Bd -literal -offset indent +1901,Jean Henri Dunant,M +1901,Frederic Passy,M +1902,Elie Ducommun,M +1905,Baroness Bertha Sophie Felicita Von Suttner,F +1910,Permanent International Peace Bureau, +.Ed +.Pp +and a second file +.Pa nobel_nationalities.txt +with their nationalities: +.Bd -literal -offset indent +Jean Henri Dunant,Switzerland +Frederic Passy,France +Elie Ducommun,Switzerland +Baroness Bertha Sophie Felicita Von Suttner +.Ed +.Pp +Join the two files using the second column from first file and the default first +column from second file specifying a custom field delimiter: +.Bd -literal -offset indent +$ join -t, -1 2 nobel_laureates.txt nobel_nationalities.txt +Jean Henri Dunant,1901,M,Switzerland +Frederic Passy,1901,M,France +Elie Ducommun,1902,M,Switzerland +Baroness Bertha Sophie Felicita Von Suttner,1905,F +.Ed +.Pp +Show only the year and the nationality of the laureate using +.Ql <> +to replace empty fields: +.Bd -literal -offset indent +$ join -e "<>" -t, -1 2 -o "1.1 2.2" nobel_laureates.txt nobel_nationalities.txt +1901,Switzerland +1901,France +1902,Switzerland +1905,<> +.Ed +.Pp +Show only lines from first file which do not have a match in second file: +.Bd -literal -offset indent +$ join -v1 -t, -1 2 nobel_laureates.txt nobel_nationalities.txt +Permanent International Peace Bureau,1910, +.Ed +.Pp +Assuming a file named +.Pa capitals.txt +with the following content: +.Bd -literal -offset indent +Belgium,Brussels +France,Paris +Italy,Rome +Switzerland +.Ed +.Pp +Show the name and capital of the country where the laureate was born. +This example uses +.Pa nobel_nationalities.txt +as a bridge but does not show any information from that file. +Also see the note about +.Xr sort 1 +above to understand why we need to sort the intermediate result. +.Bd -literal -offset indent +$ join -t, -1 2 -o 1.2 2.2 nobel_laureates.txt nobel_nationalities.txt | \e + sort -k2 -t, | join -t, -e "<>" -1 2 -o 1.1 2.2 - capitals.txt +Elie Ducommun,<> +Jean Henri Dunant,<> +.Ed .Sh COMPATIBILITY For compatibility with historic versions of .Nm , From owner-svn-src-all@freebsd.org Sat Jun 20 12:20:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 231FC35062E for ; Sat, 20 Jun 2020 12:20:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pvry6qstz3yWh for ; Sat, 20 Jun 2020 12:20:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82e.google.com with SMTP id w90so9253989qtd.8 for ; Sat, 20 Jun 2020 05:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DiZafCxpT7lIM9rCOjGPgQyOni+CNfWDs5gG0lmJJJw=; b=PsA7OArZBmldOnepbAsy4CHUJnqj4Q11lDIrl7eILGRYvpVfX6vCxXH+1/FwArOImc Cwksp5t+b2HxuKokIJSAAxbtyng/Y/2CAz7ruoODWBfFSCujdteRDvkqmfo6aKF8prsc AYmFD1TczLAAUJ6bLC/sL124fdgYM1VLpgSnxoo+k3DeBxKAebU5mDbWr1tnYlp30GLq q2eEmvcCRs0W+j7pWvvtqPT7p7ul97snErI5aP4LFNk0adIxbitWHKKsffH2S+THaJgH N5aoz2mwAhwcRyOCS5Xh0NA4KCnPVwI7ZrQgObTGWJ9uzott7LCJ9G/XSlNrkajfLGc8 MnGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DiZafCxpT7lIM9rCOjGPgQyOni+CNfWDs5gG0lmJJJw=; b=aGr6cwDPgCVu912h9XjufkHlkegLI1QI0gAPDQfDyUS+YoAKVa9VIUOLsX9x/bHOdF uiRTAzmOfrIaMjnV+cylQxSj8KeFuf37ggIsH94Z4UYBHXqVx0ILkgAbw+BQyDlSAkEi 00XYFtvp1leE74J0I1aQRa430UABM6+Ut0H+B6W87ECzaPwfy2nu9n6oqSqizVeULAjU kVUrhLXmSJ4J3Vl1ZdZFM9APM3DVISfVtmxhWm5QlS9hSPs6lmljMzhKEo3zQd/ahOl1 QmnSwf2kDhPiog0lusbKUD+rz+RqBHqlEF+ZtqCbF4NNfyjl3Bf6fNqr8VMtIrjzQjUt n1Xg== X-Gm-Message-State: AOAM530LrDA5jAWKCFR4nlmKgMF3HQiqULe65/+tvDOYrUaDn8v1RCJu o9ztytp7H+XkYWuk5Vubl2vWUaaLqKi4TUP1XoEcrA== X-Google-Smtp-Source: ABdhPJz1V0rJZP7XneyjriHSi4Z3PSCy8Wg6iVaf0cLBjlzePkL83KKjm1AZ4XzAEHKa2l+5uC1JCydb2/Bji1rP+Lk= X-Received: by 2002:ac8:311d:: with SMTP id g29mr8047126qtb.242.1592655633763; Sat, 20 Jun 2020 05:20:33 -0700 (PDT) MIME-Version: 1.0 References: <20200620044421.GA97516@FreeBSD.org> <202006201113.05KBDTJt099483@gndrsh.dnsmgr.net> In-Reply-To: <202006201113.05KBDTJt099483@gndrsh.dnsmgr.net> From: Warner Losh Date: Sat, 20 Jun 2020 06:20:22 -0600 Message-ID: Subject: Re: svn commit: r362420 - head/share/misc To: "Rodney W. Grimes" Cc: Alexey Dokuchaev , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49pvry6qstz3yWh X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=PsA7OArZ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82e) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.20 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.40)[-0.396]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.51)[-0.508]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.30)[-0.296]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82e:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 12:20:36 -0000 On Sat, Jun 20, 2020 at 5:13 AM Rodney W. Grimes wrote: > > On Sat, Jun 20, 2020 at 04:07:44AM +0000, Warner Losh wrote: > > > New Revision: 362420 > > > URL: https://svnweb.freebsd.org/changeset/base/362420 > > > > > > Log: > > > Correct 1BSD release date. > > > > > > The Quarter Century of Unix book said that 1BSD was released March > 1979. > > > However, the 1BSD tape image that's on Kirk's historical unix > collection > > > has an earlier date. > > > > > > It was common practice, at the time, to create a new copy of the tape > > > from the master system > > ^^^^^^ > > Ouch! :-) > > Given that this occured AFTER imp made a commit removing master/slave > language I find it very ironic. > > Uh oh, we need to rewire our VCS system so we can correct our > political incorrectness in our logs. > Master copy has a completely different etymology than master slave. The only irony here is that you are over-reacting to this. Warner From owner-svn-src-all@freebsd.org Sat Jun 20 13:27:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F7063517D1; Sat, 20 Jun 2020 13:27:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49pxKr14rsz42S5; Sat, 20 Jun 2020 13:27:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 94D082600E7; Sat, 20 Jun 2020 15:27:10 +0200 (CEST) Subject: Re: svn commit: r362422 - head/sbin/dump To: rgrimes@freebsd.org, Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006201110.05KBAZBU099451@gndrsh.dnsmgr.net> From: Hans Petter Selasky Message-ID: <3bab2cbf-c221-7d18-5257-2d3971975558@selasky.org> Date: Sat, 20 Jun 2020 15:26:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202006201110.05KBAZBU099451@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49pxKr14rsz42S5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.21 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-0.92)[-0.919]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-0.82)[-0.820]; NEURAL_HAM_SHORT(-0.17)[-0.170]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 13:27:13 -0000 On 2020-06-20 13:10, Rodney W. Grimes wrote: >> Author: imp >> Date: Sat Jun 20 04:19:17 2020 >> New Revision: 362422 >> URL:https://svnweb.freebsd.org/changeset/base/362422 >> >> Log: >> Increase the whimsy in this file by famring dump's work out to minions. Adjust >> variables accordingly. Thankfully, we are able to do this without additional >> banana expenditures. > This flys in the face of its intent and as a "commit" is more > racially biased than the code was! > Hi Warner, Maybe a stupid question, but is this the correct meaning or description of minion? https://www.google.com/search?q=minions minion; plural noun: minions a follower or underling of a powerful person, especially a servile or unimportant one. "he gets oppressed minions like me to fob them off" "Minion" is still a person, like "slave" is, so I must say I agree with Rodney about this, I don't see how this makes it any better? Can you explain? --HPS From owner-svn-src-all@freebsd.org Sat Jun 20 13:57:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 559FA3525EB for ; Sat, 20 Jun 2020 13:57:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49py113xr5z43x6 for ; Sat, 20 Jun 2020 13:57:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf29.google.com with SMTP id p15so5863863qvr.9 for ; Sat, 20 Jun 2020 06:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1CY0F+xeC5gV7+iwm82l6CY4C3syRU5tsOXoIKWaOno=; b=k3HQUfPQs9HREFk4RyAa7GiFHpYcb9FGxEabG+LRGfpd9uEaGLoORVFX4dSPVLIZbI 0WsUesxjg5wdAj7xfIXq1lNboyeL/uprsjmdmEMyq/1keFSMAvOjZ3Tm0brxwUnD9d30 Pkf3rRNBR3BDtPBIUTLpq/N7dpBXHp/MrmqdPX1RWJ1paDMzkZw8VpIKwmA3U0iVhMfE KD+lYlBuVQNQ01Se8hPR9ZzPO7TzDxPR8seEAmjLFDyv3YRMvsFrL1JRuLsRHmU/3+8V GEbpe0oaVLC4CE6s/VxZPigraoI2qetv1qsTJnFPLUn1KTF7OrZOmhkAWKGvnEQ44cTV VFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1CY0F+xeC5gV7+iwm82l6CY4C3syRU5tsOXoIKWaOno=; b=C8wi3Dsmhvndrq3r4Di7RcUABOKROjBGi3kYsKzKsPoigl/MjDdl13CnJMLGApkCbw PSuxuuPqyOGWsjR8qBnHIuA0fYvFUcOmo9xBQ2bpJ9k+8WGp5J8WoIkxJAyQT1/rGly2 i7OgqHphkHRrS1Fks+MDGv336sfL6Eh5CNUBLjjKcOumndzREkdc05o0QWIhf9iSryYO BwE0ixbL/LWBANg3CT2DQWjUSLk7ZympXEPgapxW13+4vxqVm2nd0kz6uWjc5L77yxfw fKBpDw/DlEgLyt3dPNi3Mi4YiT9yjugJIUKmkfhRl0zZ4XcwarUN1HUzod1PXrMfE2Og 0pSQ== X-Gm-Message-State: AOAM5319T38eT4Q7NGg9I1iiJOv8t07T8AL1BM/ttES3K2wHY0mzzSSk +592kO6gtBUe00vDS7wF6AW7XlHNO9BjJ4iIDgOKMi391w4= X-Google-Smtp-Source: ABdhPJzaVMXQCSXIwpxWiTHRf9QX5nwEiuZjhv2an4SKl5As1Bz2xveQrhB3UOupiTGIb8ztwzoafeZlJPRhyKTE/pY= X-Received: by 2002:a05:6214:17cb:: with SMTP id cu11mr13489839qvb.202.1592661460453; Sat, 20 Jun 2020 06:57:40 -0700 (PDT) MIME-Version: 1.0 References: <202006201110.05KBAZBU099451@gndrsh.dnsmgr.net> <3bab2cbf-c221-7d18-5257-2d3971975558@selasky.org> In-Reply-To: <3bab2cbf-c221-7d18-5257-2d3971975558@selasky.org> From: Warner Losh Date: Sat, 20 Jun 2020 07:57:29 -0600 Message-ID: Subject: Re: svn commit: r362422 - head/sbin/dump To: Hans Petter Selasky Cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49py113xr5z43x6 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=k3HQUfPQ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f29) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.01 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.39)[-0.390]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.52)[-0.518]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.10)[-0.098]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f29:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 13:57:42 -0000 On Sat, Jun 20, 2020 at 7:27 AM Hans Petter Selasky wrote: > On 2020-06-20 13:10, Rodney W. Grimes wrote: > >> Author: imp > >> Date: Sat Jun 20 04:19:17 2020 > >> New Revision: 362422 > >> URL:https://svnweb.freebsd.org/changeset/base/362422 > >> > >> Log: > >> Increase the whimsy in this file by famring dump's work out to > minions. Adjust > >> variables accordingly. Thankfully, we are able to do this without > additional > >> banana expenditures. > > This flys in the face of its intent and as a "commit" is more > > racially biased than the code was! > > > > Hi Warner, > > Maybe a stupid question, but is this the correct meaning or description > of minion? > > https://www.google.com/search?q=minions > > minion; plural noun: minions > > a follower or underling of a powerful person, especially a servile > or unimportant one. > "he gets oppressed minions like me to fob them off" > > "Minion" is still a person, like "slave" is, so I must say I agree with > Rodney about this, I don't see how this makes it any better? Can you > explain? > For me, Minions come from the Despicable Me movies and sequels. They work for Gru, who pays them for their services. They love Bananas and often do crazy things for a banana. They work for Gru willingly. They are free to leave at any time. They are sad at the prospect of Gru having to lay them off. Minions are also, as you point out, employed by the powerful to accomplish things. Key word here is 'employed'. Servile doesn't mean 'involuntary servitude' but rather 'an excessive willingness to please.' Underling means only that them are below them on the org chart. There's no inherent implication of an abusive relationship, per se, though that happens as in any power relationship between people. And the extensive searching I did before the commit showed no complaints about the movies, or that this term had some coded, racist history. Or any other coded history that's problematic. Or any overt history for that matter. SaltStack uses it as their name for agents that carry out tasks, for example. So what am I missing? Warner From owner-svn-src-all@freebsd.org Sat Jun 20 14:16:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1448352A90; Sat, 20 Jun 2020 14:16:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pyQc4HZqz45Jf; Sat, 20 Jun 2020 14:16:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A03DDB25; Sat, 20 Jun 2020 14:16:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KEGOf8002009; Sat, 20 Jun 2020 14:16:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KEGOnV002008; Sat, 20 Jun 2020 14:16:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006201416.05KEGOnV002008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 20 Jun 2020 14:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362437 - head/sys/dev/sound/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/usb X-SVN-Commit-Revision: 362437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 14:16:24 -0000 Author: hselasky Date: Sat Jun 20 14:16:24 2020 New Revision: 362437 URL: https://svnweb.freebsd.org/changeset/base/362437 Log: Improve debug message to be more precise and clear. For the sake of the record, this is the last use of the words master and slave in the FreeBSD's USB stack, drivers and subsystems. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Sat Jun 20 11:27:59 2020 (r362436) +++ head/sys/dev/sound/usb/uaudio.c Sat Jun 20 14:16:24 2020 (r362437) @@ -1163,7 +1163,7 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_cla if (sc->sc_play_chan[i].num_alt > 0 && (sc->sc_child[i].mix_info & SOUND_MASK_PCM) == 0) { - DPRINTF("emulating master volume\n"); + DPRINTF("software controlled main volume\n"); /* * Emulate missing pcm mixer controller From owner-svn-src-all@freebsd.org Sat Jun 20 15:44:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D692335427C; Sat, 20 Jun 2020 15:44:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q0Mz5N3lz4B8H; Sat, 20 Jun 2020 15:44:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3F2DE8C9; Sat, 20 Jun 2020 15:44:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KFiF92056959; Sat, 20 Jun 2020 15:44:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KFiFLt056958; Sat, 20 Jun 2020 15:44:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202006201544.05KFiFLt056958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 20 Jun 2020 15:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r362438 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 362438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 15:44:15 -0000 Author: jhibbits Date: Sat Jun 20 15:44:15 2020 New Revision: 362438 URL: https://svnweb.freebsd.org/changeset/base/362438 Log: Let alfredo@ run free Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sat Jun 20 14:16:24 2020 (r362437) +++ svnadmin/conf/mentors Sat Jun 20 15:44:15 2020 (r362438) @@ -11,7 +11,6 @@ # Mentee Mentor Optional comment afedorov vmaffione Co-mentor: jhb -alfredo jhibbits anish jhb brd allanjude Co-mentor: bapt freqlabs mav Co-mentor: mmacy From owner-svn-src-all@freebsd.org Sat Jun 20 16:08:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23069355635; Sat, 20 Jun 2020 16:08:11 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q0vZ10Dwz4Dr5; Sat, 20 Jun 2020 16:08:09 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id v3so4989131wrc.1; Sat, 20 Jun 2020 09:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=L2OAi3Hly0gSdWxxmQekEruTUiv0IQ+gnbNMDexZtQ0=; b=rCDgouG6FEr8Q7AJdxuNnZNVv5uBvuwCsDzHv9CYrjgIadTVmNpIpwlwC3hF6D3qDR lwIqUHflscVZRHYfufMsczsU+jj5LT9NOTHojTcpsGUJt2f3kfYqZqMbJhpa/7ZzW5T8 lITbMK4oRGVHQth+3Vxd6zVFOiRD3FcFIXAf9vI2lfg7VA5eaaliq84gY0Md3Ow0wdhQ b++1lpS1eBRs+Ep/MY0s+iPNAYuW1LJ2HnFSIx7SmeV8xIDdPOS8aORxVvTreHJoYSzO S+UzdUysgcgnlPGE46wJu21vdprRJbqXNchHFLZv8QAtfRiyv1YzawxMnyYfpCwUryrb jzJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=L2OAi3Hly0gSdWxxmQekEruTUiv0IQ+gnbNMDexZtQ0=; b=d5quJxARZW5tLIU0qcqeBYHwimLg5KbwZND+PnCzgiKixwvizVThNpilRaQUaXv/lk X94cp7zHb+0KNFDjii3x/fMiho64l15F6LGGlnW9f8f7dmeKuzxagSkymemu1PJ5YV9D /nHZi8xn++eVNYcP9ABbIBSBMSkcUsGEgaWUIPiuCjuwd8iGyg2x596gAvqR0sv5vUF9 sCmkAMgws4ISYjR6y5YqVjHFL8Py8gQJlMWC2AAVqXLrgYI+Yge/Fu49txhVzU4tQL1H m/kWuarRv7I8UnRAD4zujaL7kaH/K8LhyAgHHprBvzDJKz4BsxmLbI6HY6JiBAYSy/SK oRtg== X-Gm-Message-State: AOAM530ki6xSKGsSUVYvlM/8LyySqvQx3N5GMRb0xW3AyEkxe9moz8g0 6lUi2aR0iEuCrRefxaLR2iE= X-Google-Smtp-Source: ABdhPJwMFmpDI/W8G1OoUepMkuXWq/3GUFEVd2+Aebu5sCy15FpmHpRPHh1G9uViInWb2xlEdso/ig== X-Received: by 2002:a5d:5449:: with SMTP id w9mr9889698wrv.106.1592669288810; Sat, 20 Jun 2020 09:08:08 -0700 (PDT) Received: from ernst.home (p5b3be131.dip0.t-ipconnect.de. [91.59.225.49]) by smtp.gmail.com with ESMTPSA id u13sm10021394wmm.6.2020.06.20.09.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jun 2020 09:08:08 -0700 (PDT) Date: Sat, 20 Jun 2020 18:08:06 +0200 From: Gary Jennejohn To: Warner Losh Cc: Hans Petter Selasky , "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r362422 - head/sbin/dump Message-ID: <20200620180806.6b50fbfc@ernst.home> In-Reply-To: References: <202006201110.05KBAZBU099451@gndrsh.dnsmgr.net> <3bab2cbf-c221-7d18-5257-2d3971975558@selasky.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49q0vZ10Dwz4Dr5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=rCDgouG6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::442 as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-2.91 / 15.00]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[7]; RECEIVED_SPAMHAUS_PBL(0.00)[91.59.225.49:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.019]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.19)[0.190]; NEURAL_HAM_LONG(-1.08)[-1.083]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::442:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 16:08:11 -0000 On Sat, 20 Jun 2020 07:57:29 -0600 Warner Losh wrote: > On Sat, Jun 20, 2020 at 7:27 AM Hans Petter Selasky wrote: > > > On 2020-06-20 13:10, Rodney W. Grimes wrote: > > >> Author: imp > > >> Date: Sat Jun 20 04:19:17 2020 > > >> New Revision: 362422 > > >> URL:https://svnweb.freebsd.org/changeset/base/362422 > > >> > > >> Log: > > >> Increase the whimsy in this file by famring dump's work out to > > minions. Adjust > > >> variables accordingly. Thankfully, we are able to do this without > > additional > > >> banana expenditures. > > > This flys in the face of its intent and as a "commit" is more > > > racially biased than the code was! > > > > > > > Hi Warner, > > > > Maybe a stupid question, but is this the correct meaning or description > > of minion? > > > > https://www.google.com/search?q=minions > > > > minion; plural noun: minions > > > > a follower or underling of a powerful person, especially a servile > > or unimportant one. > > "he gets oppressed minions like me to fob them off" > > > > "Minion" is still a person, like "slave" is, so I must say I agree with > > Rodney about this, I don't see how this makes it any better? Can you > > explain? > > > > For me, Minions come from the Despicable Me movies and sequels. They work > for Gru, who pays them for their services. They love Bananas and often do > crazy things for a banana. They work for Gru willingly. They are free to > leave at any time. They are sad at the prospect of Gru having to lay them > off. > > Minions are also, as you point out, employed by the powerful to accomplish > things. Key word here is 'employed'. Servile doesn't mean 'involuntary > servitude' but rather 'an excessive willingness to please.' Underling means > only that them are below them on the org chart. There's no inherent > implication of an abusive relationship, per se, though that happens as in > any power relationship between people. > > And the extensive searching I did before the commit showed no complaints > about the movies, or that this term had some coded, racist history. Or any > other coded history that's problematic. Or any overt history for that > matter. > > SaltStack uses it as their name for agents that carry out tasks, for > example. > > So what am I missing? > Why not simply use sub-processes? After all, that's exactly what the "minion processes" are. -- Gary Jennejohn From owner-svn-src-all@freebsd.org Sat Jun 20 17:22:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DEA535697D; Sat, 20 Jun 2020 17:22:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q2Yg1RF3z4PCW; Sat, 20 Jun 2020 17:22:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C773FD3A; Sat, 20 Jun 2020 17:22:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KHMlHu018178; Sat, 20 Jun 2020 17:22:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KHMlGc018177; Sat, 20 Jun 2020 17:22:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202006201722.05KHMlGc018177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Jun 2020 17:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362439 - head/sys/dev/oce X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/oce X-SVN-Commit-Revision: 362439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 17:22:47 -0000 Author: cem Date: Sat Jun 20 17:22:46 2020 New Revision: 362439 URL: https://svnweb.freebsd.org/changeset/base/362439 Log: oce(4): Account and trace mbufs before handing to hw Once tx mbufs have been handed to hardware, nothing serializes the tx path against completion and potential use-after-free of the outbound mbuf. Perform accounting and BPF tap before queueing to hardware to avoid this race. Submitted by: Steve Wirtz Reviewed by: markj, rstone Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25364 Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Sat Jun 20 15:44:15 2020 (r362438) +++ head/sys/dev/oce/oce_if.c Sat Jun 20 17:22:46 2020 (r362439) @@ -1225,6 +1225,11 @@ retry: */ oce_is_pkt_dest_bmc(sc, m, &os2bmc, &m_new); + if_inc_counter(sc->ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); + if (m->m_flags & M_MCAST) + if_inc_counter(sc->ifp, IFCOUNTER_OMCASTS, 1); + ETHER_BPF_MTAP(sc->ifp, m); + OCE_WRITE_REG32(sc, db, wq->db_offset, reg_value); } else if (rc == EFBIG) { @@ -1400,7 +1405,7 @@ oce_start(struct ifnet *ifp) if (!sc->link_status) return; - do { + while (true) { IF_DEQUEUE(&sc->ifp->if_snd, m); if (m == NULL) break; @@ -1417,12 +1422,7 @@ oce_start(struct ifnet *ifp) } break; } - if (m != NULL) - ETHER_BPF_MTAP(ifp, m); - - } while (TRUE); - - return; + } } @@ -1500,10 +1500,6 @@ oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, break; } drbr_advance(ifp, br); - if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len); - if (next->m_flags & M_MCAST) - if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - ETHER_BPF_MTAP(ifp, next); } return 0; From owner-svn-src-all@freebsd.org Sat Jun 20 18:29:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBCE4357F24; Sat, 20 Jun 2020 18:29:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q42Y4JZtz4VSR; Sat, 20 Jun 2020 18:29:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A4BD10851; Sat, 20 Jun 2020 18:29:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KITPR9055386; Sat, 20 Jun 2020 18:29:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KITM2O055374; Sat, 20 Jun 2020 18:29:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202006201829.05KITM2O055374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 20 Jun 2020 18:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362440 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux sys vm X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux sys vm X-SVN-Commit-Revision: 362440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 18:29:25 -0000 Author: trasz Date: Sat Jun 20 18:29:22 2020 New Revision: 362440 URL: https://svnweb.freebsd.org/changeset/base/362440 Log: Add linux_madvise(2) instead of having Linux apps call the native FreeBSD madvise(2) directly. While some of the flag values match, most don't. PR: kern/230160 Reported by: markj Reviewed by: markj Discussed with: brooks, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25272 Modified: head/sys/amd64/linux/linux_machdep.c head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/syscalls.master head/sys/arm64/linux/linux_machdep.c head/sys/arm64/linux/syscalls.master head/sys/compat/linux/linux_mmap.c head/sys/compat/linux/linux_mmap.h head/sys/i386/linux/linux_machdep.c head/sys/i386/linux/syscalls.master head/sys/sys/syscallsubr.h head/sys/vm/vm_mmap.c Modified: head/sys/amd64/linux/linux_machdep.c ============================================================================== --- head/sys/amd64/linux/linux_machdep.c Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/amd64/linux/linux_machdep.c Sat Jun 20 18:29:22 2020 (r362440) @@ -141,6 +141,13 @@ linux_mprotect(struct thread *td, struct linux_mprotec } int +linux_madvise(struct thread *td, struct linux_madvise_args *uap) +{ + + return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); +} + +int linux_iopl(struct thread *td, struct linux_iopl_args *args) { int error; Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/amd64/linux/syscalls.master Sat Jun 20 18:29:22 2020 (r362440) @@ -94,7 +94,7 @@ l_size_t len, l_int fl); } 27 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ l_size_t len, u_char *vec); } -28 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ +28 AUE_MADVISE STD { int linux_madvise(void *addr, size_t len, \ int behav); } 29 AUE_NULL STD { int linux_shmget(l_key_t key, l_size_t size, \ l_int shmflg); } Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/amd64/linux32/linux32_machdep.c Sat Jun 20 18:29:22 2020 (r362440) @@ -469,6 +469,13 @@ linux_mprotect(struct thread *td, struct linux_mprotec } int +linux_madvise(struct thread *td, struct linux_madvise_args *uap) +{ + + return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); +} + +int linux_iopl(struct thread *td, struct linux_iopl_args *args) { int error; Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/amd64/linux32/syscalls.master Sat Jun 20 18:29:22 2020 (r362440) @@ -390,7 +390,7 @@ char *put_old); } 218 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ l_size_t len, u_char *vec); } -219 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ +219 AUE_MADVISE STD { int linux_madvise(void *addr, size_t len, \ int behav); } 220 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ void *dirent, l_uint count); } Modified: head/sys/arm64/linux/linux_machdep.c ============================================================================== --- head/sys/arm64/linux/linux_machdep.c Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/arm64/linux/linux_machdep.c Sat Jun 20 18:29:22 2020 (r362440) @@ -104,6 +104,13 @@ linux_mprotect(struct thread *td, struct linux_mprotec uap->prot)); } +int +linux_madvise(struct thread *td, struct linux_madvise_args *uap) +{ + + return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); +} + /* LINUXTODO: implement arm64 linux_rt_sigsuspend */ int linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) Modified: head/sys/arm64/linux/syscalls.master ============================================================================== --- head/sys/arm64/linux/syscalls.master Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/arm64/linux/syscalls.master Sat Jun 20 18:29:22 2020 (r362440) @@ -1310,8 +1310,9 @@ u_char *vec ); } -233 AUE_MADVISE NOPROTO { - int madvise(void *addr, +233 AUE_MADVISE STD { + int linux_madvise( + void *addr, size_t len, int behav ); Modified: head/sys/compat/linux/linux_mmap.c ============================================================================== --- head/sys/compat/linux/linux_mmap.c Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/compat/linux/linux_mmap.c Sat Jun 20 18:29:22 2020 (r362440) @@ -242,6 +242,62 @@ linux_mprotect_common(struct thread *td, uintptr_t add return (kern_mprotect(td, addr, len, prot)); } +int +linux_madvise_common(struct thread *td, uintptr_t addr, size_t len, int behav) +{ + + switch (behav) { + case LINUX_MADV_NORMAL: + return (kern_madvise(td, addr, len, MADV_NORMAL)); + case LINUX_MADV_RANDOM: + return (kern_madvise(td, addr, len, MADV_RANDOM)); + case LINUX_MADV_SEQUENTIAL: + return (kern_madvise(td, addr, len, MADV_SEQUENTIAL)); + case LINUX_MADV_WILLNEED: + return (kern_madvise(td, addr, len, MADV_WILLNEED)); + case LINUX_MADV_DONTNEED: + return (kern_madvise(td, addr, len, MADV_DONTNEED)); + case LINUX_MADV_FREE: + return (kern_madvise(td, addr, len, MADV_FREE)); + case LINUX_MADV_REMOVE: + linux_msg(curthread, "unsupported madvise MADV_REMOVE"); + return (EINVAL); + case LINUX_MADV_DONTFORK: + return (kern_minherit(td, addr, len, INHERIT_NONE)); + case LINUX_MADV_DOFORK: + return (kern_minherit(td, addr, len, INHERIT_COPY)); + case LINUX_MADV_MERGEABLE: + linux_msg(curthread, "unsupported madvise MADV_MERGEABLE"); + return (EINVAL); + case LINUX_MADV_UNMERGEABLE: + /* We don't merge anyway. */ + return (0); + case LINUX_MADV_HUGEPAGE: + /* Ignored; on FreeBSD huge pages are always on. */ + return (0); + case LINUX_MADV_NOHUGEPAGE: + linux_msg(curthread, "unsupported madvise MADV_NOHUGEPAGE"); + return (EINVAL); + case LINUX_MADV_DONTDUMP: + return (kern_madvise(td, addr, len, MADV_NOCORE)); + case LINUX_MADV_DODUMP: + return (kern_madvise(td, addr, len, MADV_CORE)); + case LINUX_MADV_WIPEONFORK: + return (kern_minherit(td, addr, len, INHERIT_ZERO)); + case LINUX_MADV_KEEPONFORK: + return (kern_minherit(td, addr, len, INHERIT_COPY)); + case LINUX_MADV_HWPOISON: + linux_msg(curthread, "unsupported madvise MADV_HWPOISON"); + return (EINVAL); + case LINUX_MADV_SOFT_OFFLINE: + linux_msg(curthread, "unsupported madvise MADV_SOFT_OFFLINE"); + return (EINVAL); + default: + linux_msg(curthread, "unsupported madvise behav %d", behav); + return (EINVAL); + } +} + #if defined(__amd64__) static void linux_fixup_prot(struct thread *td, int *prot) Modified: head/sys/compat/linux/linux_mmap.h ============================================================================== --- head/sys/compat/linux/linux_mmap.h Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/compat/linux/linux_mmap.h Sat Jun 20 18:29:22 2020 (r362440) @@ -45,8 +45,29 @@ #define LINUX_PROT_GROWSDOWN 0x01000000 #define LINUX_PROT_GROWSUP 0x02000000 +#define LINUX_MADV_NORMAL 0 +#define LINUX_MADV_RANDOM 1 +#define LINUX_MADV_SEQUENTIAL 2 +#define LINUX_MADV_WILLNEED 3 +#define LINUX_MADV_DONTNEED 4 +#define LINUX_MADV_FREE 8 +#define LINUX_MADV_REMOVE 9 +#define LINUX_MADV_DONTFORK 10 +#define LINUX_MADV_DOFORK 11 +#define LINUX_MADV_MERGEABLE 12 +#define LINUX_MADV_UNMERGEABLE 13 +#define LINUX_MADV_HUGEPAGE 14 +#define LINUX_MADV_NOHUGEPAGE 15 +#define LINUX_MADV_DONTDUMP 16 +#define LINUX_MADV_DODUMP 17 +#define LINUX_MADV_WIPEONFORK 18 +#define LINUX_MADV_KEEPONFORK 19 +#define LINUX_MADV_HWPOISON 100 +#define LINUX_MADV_SOFT_OFFLINE 101 + int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, int, off_t); int linux_mprotect_common(struct thread *, uintptr_t, size_t, int); +int linux_madvise_common(struct thread *, uintptr_t, size_t, int); #endif /* _LINUX_MMAP_H_ */ Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/i386/linux/linux_machdep.c Sat Jun 20 18:29:22 2020 (r362440) @@ -354,6 +354,13 @@ linux_mprotect(struct thread *td, struct linux_mprotec } int +linux_madvise(struct thread *td, struct linux_madvise_args *uap) +{ + + return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); +} + +int linux_ioperm(struct thread *td, struct linux_ioperm_args *args) { int error; Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/i386/linux/syscalls.master Sat Jun 20 18:29:22 2020 (r362440) @@ -393,7 +393,7 @@ char *put_old); } 218 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ l_size_t len, u_char *vec); } -219 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ +219 AUE_MADVISE STD { int linux_madvise(void *addr, size_t len, \ int behav); } 220 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ void *dirent, l_uint count); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/sys/syscallsubr.h Sat Jun 20 18:29:22 2020 (r362440) @@ -185,6 +185,8 @@ int kern_lutimes(struct thread *td, const char *path, struct timeval *tptr, enum uio_seg tptrseg); int kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav); int kern_mincore(struct thread *td, uintptr_t addr, size_t len, char *vec); +int kern_minherit(struct thread *td, uintptr_t addr, size_t len, + int inherit); int kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg, int mode); int kern_mkfifoat(struct thread *td, int fd, const char *path, Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Jun 20 17:22:46 2020 (r362439) +++ head/sys/vm/vm_mmap.c Sat Jun 20 18:29:22 2020 (r362440) @@ -702,13 +702,21 @@ struct minherit_args { int sys_minherit(struct thread *td, struct minherit_args *uap) { + + return (kern_minherit(td, (uintptr_t)uap->addr, uap->len, + uap->inherit)); +} + +int +kern_minherit(struct thread *td, uintptr_t addr0, size_t len, int inherit0) +{ vm_offset_t addr; vm_size_t size, pageoff; vm_inherit_t inherit; - addr = (vm_offset_t)uap->addr; - size = uap->len; - inherit = uap->inherit; + addr = (vm_offset_t)addr0; + size = len; + inherit = inherit0; pageoff = (addr & PAGE_MASK); addr -= pageoff; From owner-svn-src-all@freebsd.org Sat Jun 20 18:31:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2783357F58; Sat, 20 Jun 2020 18:31:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q44W4d6Jz4VvN; Sat, 20 Jun 2020 18:31:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99A221054A; Sat, 20 Jun 2020 18:31:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KIV7gN056330; Sat, 20 Jun 2020 18:31:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KIV3e9056307; Sat, 20 Jun 2020 18:31:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202006201831.05KIV3e9056307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 20 Jun 2020 18:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362441 - in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux i386/linux X-SVN-Commit-Revision: 362441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 18:31:07 -0000 Author: trasz Date: Sat Jun 20 18:31:02 2020 New Revision: 362441 URL: https://svnweb.freebsd.org/changeset/base/362441 Log: Regen after r362440. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_syscall.h head/sys/amd64/linux/linux_syscalls.c head/sys/amd64/linux/linux_sysent.c head/sys/amd64/linux/linux_systrace_args.c head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/arm64/linux/linux_proto.h head/sys/arm64/linux/linux_syscall.h head/sys/arm64/linux/linux_syscalls.c head/sys/arm64/linux/linux_sysent.c head/sys/arm64/linux/linux_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux/linux_proto.h Sat Jun 20 18:31:02 2020 (r362441) @@ -136,6 +136,11 @@ struct linux_mincore_args { char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; }; +struct linux_madvise_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char behav_l_[PADL_(int)]; int behav; char behav_r_[PADR_(int)]; +}; struct linux_shmget_args { char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; @@ -1292,6 +1297,7 @@ int linux_select(struct thread *, struct linux_select_ int linux_mremap(struct thread *, struct linux_mremap_args *); int linux_msync(struct thread *, struct linux_msync_args *); int linux_mincore(struct thread *, struct linux_mincore_args *); +int linux_madvise(struct thread *, struct linux_madvise_args *); int linux_shmget(struct thread *, struct linux_shmget_args *); int linux_shmat(struct thread *, struct linux_shmat_args *); int linux_shmctl(struct thread *, struct linux_shmctl_args *); @@ -1622,6 +1628,7 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX_SYS_AUE_linux_mremap AUE_NULL #define LINUX_SYS_AUE_linux_msync AUE_MSYNC #define LINUX_SYS_AUE_linux_mincore AUE_MINCORE +#define LINUX_SYS_AUE_linux_madvise AUE_MADVISE #define LINUX_SYS_AUE_linux_shmget AUE_NULL #define LINUX_SYS_AUE_linux_shmat AUE_NULL #define LINUX_SYS_AUE_linux_shmctl AUE_NULL Modified: head/sys/amd64/linux/linux_syscall.h ============================================================================== --- head/sys/amd64/linux/linux_syscall.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux/linux_syscall.h Sat Jun 20 18:31:02 2020 (r362441) @@ -33,7 +33,7 @@ #define LINUX_SYS_linux_mremap 25 #define LINUX_SYS_linux_msync 26 #define LINUX_SYS_linux_mincore 27 -#define LINUX_SYS_madvise 28 +#define LINUX_SYS_linux_madvise 28 #define LINUX_SYS_linux_shmget 29 #define LINUX_SYS_linux_shmat 30 #define LINUX_SYS_linux_shmctl 31 Modified: head/sys/amd64/linux/linux_syscalls.c ============================================================================== --- head/sys/amd64/linux/linux_syscalls.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux/linux_syscalls.c Sat Jun 20 18:31:02 2020 (r362441) @@ -35,7 +35,7 @@ const char *linux_syscallnames[] = { "linux_mremap", /* 25 = linux_mremap */ "linux_msync", /* 26 = linux_msync */ "linux_mincore", /* 27 = linux_mincore */ - "madvise", /* 28 = madvise */ + "linux_madvise", /* 28 = linux_madvise */ "linux_shmget", /* 29 = linux_shmget */ "linux_shmat", /* 30 = linux_shmat */ "linux_shmctl", /* 31 = linux_shmctl */ Modified: head/sys/amd64/linux/linux_sysent.c ============================================================================== --- head/sys/amd64/linux/linux_sysent.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux/linux_sysent.c Sat Jun 20 18:31:02 2020 (r362441) @@ -45,7 +45,7 @@ struct sysent linux_sysent[] = { { AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 25 = linux_mremap */ { AS(linux_msync_args), (sy_call_t *)linux_msync, AUE_MSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = linux_msync */ { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 27 = linux_mincore */ - { AS(madvise_args), (sy_call_t *)sys_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = madvise */ + { AS(linux_madvise_args), (sy_call_t *)linux_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = linux_madvise */ { AS(linux_shmget_args), (sy_call_t *)linux_shmget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 29 = linux_shmget */ { AS(linux_shmat_args), (sy_call_t *)linux_shmat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 30 = linux_shmat */ { AS(linux_shmctl_args), (sy_call_t *)linux_shmctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 31 = linux_shmctl */ Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux/linux_systrace_args.c Sat Jun 20 18:31:02 2020 (r362441) @@ -258,9 +258,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* madvise */ + /* linux_madvise */ case 28: { - struct madvise_args *p = params; + struct linux_madvise_args *p = params; uarg[0] = (intptr_t) p->addr; /* void * */ uarg[1] = p->len; /* size_t */ iarg[2] = p->behav; /* int */ @@ -2983,7 +2983,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* madvise */ + /* linux_madvise */ case 28: switch(ndx) { case 0: @@ -6649,7 +6649,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* madvise */ + /* linux_madvise */ case 28: if (ndx == 0 || ndx == 1) p = "int"; Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux32/linux32_proto.h Sat Jun 20 18:31:02 2020 (r362441) @@ -687,6 +687,11 @@ struct linux_mincore_args { char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; }; +struct linux_madvise_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char behav_l_[PADL_(int)]; int behav; char behav_r_[PADR_(int)]; +}; struct linux_getdents64_args { char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)]; @@ -1691,6 +1696,7 @@ int linux_setfsuid(struct thread *, struct linux_setfs int linux_setfsgid(struct thread *, struct linux_setfsgid_args *); int linux_pivot_root(struct thread *, struct linux_pivot_root_args *); int linux_mincore(struct thread *, struct linux_mincore_args *); +int linux_madvise(struct thread *, struct linux_madvise_args *); int linux_getdents64(struct thread *, struct linux_getdents64_args *); int linux_fcntl64(struct thread *, struct linux_fcntl64_args *); int linux_gettid(struct thread *, struct linux_gettid_args *); @@ -2086,6 +2092,7 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX32_SYS_AUE_linux_setfsgid AUE_SETFSGID #define LINUX32_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT #define LINUX32_SYS_AUE_linux_mincore AUE_MINCORE +#define LINUX32_SYS_AUE_linux_madvise AUE_MADVISE #define LINUX32_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES #define LINUX32_SYS_AUE_linux_fcntl64 AUE_FCNTL #define LINUX32_SYS_AUE_linux_gettid AUE_NULL Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux32/linux32_syscall.h Sat Jun 20 18:31:02 2020 (r362441) @@ -199,7 +199,7 @@ #define LINUX32_SYS_linux_setfsgid 216 #define LINUX32_SYS_linux_pivot_root 217 #define LINUX32_SYS_linux_mincore 218 -#define LINUX32_SYS_madvise 219 +#define LINUX32_SYS_linux_madvise 219 #define LINUX32_SYS_linux_getdents64 220 #define LINUX32_SYS_linux_fcntl64 221 #define LINUX32_SYS_linux_gettid 224 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux32/linux32_syscalls.c Sat Jun 20 18:31:02 2020 (r362441) @@ -226,7 +226,7 @@ const char *linux32_syscallnames[] = { "linux_setfsgid", /* 216 = linux_setfsgid */ "linux_pivot_root", /* 217 = linux_pivot_root */ "linux_mincore", /* 218 = linux_mincore */ - "madvise", /* 219 = madvise */ + "linux_madvise", /* 219 = linux_madvise */ "linux_getdents64", /* 220 = linux_getdents64 */ "linux_fcntl64", /* 221 = linux_fcntl64 */ "#222", /* 222 = */ Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux32/linux32_sysent.c Sat Jun 20 18:31:02 2020 (r362441) @@ -236,7 +236,7 @@ struct sysent linux32_sysent[] = { { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid, AUE_SETFSGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 216 = linux_setfsgid */ { AS(linux_pivot_root_args), (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 217 = linux_pivot_root */ { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 218 = linux_mincore */ - { AS(madvise_args), (sy_call_t *)sys_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 219 = madvise */ + { AS(linux_madvise_args), (sy_call_t *)linux_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 219 = linux_madvise */ { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 220 = linux_getdents64 */ { AS(linux_fcntl64_args), (sy_call_t *)linux_fcntl64, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 221 = linux_fcntl64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 222 = */ Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sat Jun 20 18:31:02 2020 (r362441) @@ -1525,9 +1525,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* madvise */ + /* linux_madvise */ case 219: { - struct madvise_args *p = params; + struct linux_madvise_args *p = params; uarg[0] = (intptr_t) p->addr; /* void * */ uarg[1] = p->len; /* size_t */ iarg[2] = p->behav; /* int */ @@ -5363,7 +5363,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* madvise */ + /* linux_madvise */ case 219: switch(ndx) { case 0: @@ -8485,7 +8485,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* madvise */ + /* linux_madvise */ case 219: if (ndx == 0 || ndx == 1) p = "int"; Modified: head/sys/arm64/linux/linux_proto.h ============================================================================== --- head/sys/arm64/linux/linux_proto.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/arm64/linux/linux_proto.h Sat Jun 20 18:31:02 2020 (r362441) @@ -854,6 +854,11 @@ struct linux_mincore_args { char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; }; +struct linux_madvise_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char behav_l_[PADL_(int)]; int behav; char behav_r_[PADR_(int)]; +}; struct linux_remap_file_pages_args { register_t dummy; }; @@ -1240,6 +1245,7 @@ int linux_swapoff(struct thread *, struct linux_swapof int linux_mprotect(struct thread *, struct linux_mprotect_args *); int linux_msync(struct thread *, struct linux_msync_args *); int linux_mincore(struct thread *, struct linux_mincore_args *); +int linux_madvise(struct thread *, struct linux_madvise_args *); int linux_remap_file_pages(struct thread *, struct linux_remap_file_pages_args *); int linux_mbind(struct thread *, struct linux_mbind_args *); int linux_get_mempolicy(struct thread *, struct linux_get_mempolicy_args *); @@ -1514,6 +1520,7 @@ int linux_pkey_free(struct thread *, struct linux_pkey #define LINUX_SYS_AUE_linux_mprotect AUE_MPROTECT #define LINUX_SYS_AUE_linux_msync AUE_MSYNC #define LINUX_SYS_AUE_linux_mincore AUE_MINCORE +#define LINUX_SYS_AUE_linux_madvise AUE_MADVISE #define LINUX_SYS_AUE_linux_remap_file_pages AUE_NULL #define LINUX_SYS_AUE_linux_mbind AUE_NULL #define LINUX_SYS_AUE_linux_get_mempolicy AUE_NULL Modified: head/sys/arm64/linux/linux_syscall.h ============================================================================== --- head/sys/arm64/linux/linux_syscall.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/arm64/linux/linux_syscall.h Sat Jun 20 18:31:02 2020 (r362441) @@ -227,7 +227,7 @@ #define LINUX_SYS_mlockall 230 #define LINUX_SYS_munlockall 231 #define LINUX_SYS_linux_mincore 232 -#define LINUX_SYS_madvise 233 +#define LINUX_SYS_linux_madvise 233 #define LINUX_SYS_linux_remap_file_pages 234 #define LINUX_SYS_linux_mbind 235 #define LINUX_SYS_linux_get_mempolicy 236 Modified: head/sys/arm64/linux/linux_syscalls.c ============================================================================== --- head/sys/arm64/linux/linux_syscalls.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/arm64/linux/linux_syscalls.c Sat Jun 20 18:31:02 2020 (r362441) @@ -240,7 +240,7 @@ const char *linux_syscallnames[] = { "mlockall", /* 230 = mlockall */ "munlockall", /* 231 = munlockall */ "linux_mincore", /* 232 = linux_mincore */ - "madvise", /* 233 = madvise */ + "linux_madvise", /* 233 = linux_madvise */ "linux_remap_file_pages", /* 234 = linux_remap_file_pages */ "linux_mbind", /* 235 = linux_mbind */ "linux_get_mempolicy", /* 236 = linux_get_mempolicy */ Modified: head/sys/arm64/linux/linux_sysent.c ============================================================================== --- head/sys/arm64/linux/linux_sysent.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/arm64/linux/linux_sysent.c Sat Jun 20 18:31:02 2020 (r362441) @@ -250,7 +250,7 @@ struct sysent linux_sysent[] = { { AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 230 = mlockall */ { 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 231 = munlockall */ { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = linux_mincore */ - { AS(madvise_args), (sy_call_t *)sys_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = madvise */ + { AS(linux_madvise_args), (sy_call_t *)linux_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = linux_madvise */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = linux_remap_file_pages */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = linux_get_mempolicy */ Modified: head/sys/arm64/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm64/linux/linux_systrace_args.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/arm64/linux/linux_systrace_args.c Sat Jun 20 18:31:02 2020 (r362441) @@ -1766,9 +1766,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* madvise */ + /* linux_madvise */ case 233: { - struct madvise_args *p = params; + struct linux_madvise_args *p = params; uarg[0] = (intptr_t) p->addr; /* void * */ uarg[1] = p->len; /* size_t */ iarg[2] = p->behav; /* int */ @@ -4898,7 +4898,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* madvise */ + /* linux_madvise */ case 233: switch(ndx) { case 0: @@ -6449,7 +6449,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* madvise */ + /* linux_madvise */ case 233: if (ndx == 0 || ndx == 1) p = "int"; Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/i386/linux/linux_proto.h Sat Jun 20 18:31:02 2020 (r362441) @@ -684,6 +684,11 @@ struct linux_mincore_args { char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; }; +struct linux_madvise_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char behav_l_[PADL_(int)]; int behav; char behav_r_[PADR_(int)]; +}; struct linux_getdents64_args { char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)]; @@ -1699,6 +1704,7 @@ int linux_setfsuid(struct thread *, struct linux_setfs int linux_setfsgid(struct thread *, struct linux_setfsgid_args *); int linux_pivot_root(struct thread *, struct linux_pivot_root_args *); int linux_mincore(struct thread *, struct linux_mincore_args *); +int linux_madvise(struct thread *, struct linux_madvise_args *); int linux_getdents64(struct thread *, struct linux_getdents64_args *); int linux_fcntl64(struct thread *, struct linux_fcntl64_args *); int linux_gettid(struct thread *, struct linux_gettid_args *); @@ -2096,6 +2102,7 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX_SYS_AUE_linux_setfsgid AUE_SETFSGID #define LINUX_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT #define LINUX_SYS_AUE_linux_mincore AUE_MINCORE +#define LINUX_SYS_AUE_linux_madvise AUE_MADVISE #define LINUX_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES #define LINUX_SYS_AUE_linux_fcntl64 AUE_FCNTL #define LINUX_SYS_AUE_linux_gettid AUE_NULL Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/i386/linux/linux_syscall.h Sat Jun 20 18:31:02 2020 (r362441) @@ -205,7 +205,7 @@ #define LINUX_SYS_linux_setfsgid 216 #define LINUX_SYS_linux_pivot_root 217 #define LINUX_SYS_linux_mincore 218 -#define LINUX_SYS_madvise 219 +#define LINUX_SYS_linux_madvise 219 #define LINUX_SYS_linux_getdents64 220 #define LINUX_SYS_linux_fcntl64 221 #define LINUX_SYS_linux_gettid 224 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/i386/linux/linux_syscalls.c Sat Jun 20 18:31:02 2020 (r362441) @@ -226,7 +226,7 @@ const char *linux_syscallnames[] = { "linux_setfsgid", /* 216 = linux_setfsgid */ "linux_pivot_root", /* 217 = linux_pivot_root */ "linux_mincore", /* 218 = linux_mincore */ - "madvise", /* 219 = madvise */ + "linux_madvise", /* 219 = linux_madvise */ "linux_getdents64", /* 220 = linux_getdents64 */ "linux_fcntl64", /* 221 = linux_fcntl64 */ "#222", /* 222 = */ Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/i386/linux/linux_sysent.c Sat Jun 20 18:31:02 2020 (r362441) @@ -236,7 +236,7 @@ struct sysent linux_sysent[] = { { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid, AUE_SETFSGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 216 = linux_setfsgid */ { AS(linux_pivot_root_args), (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 217 = linux_pivot_root */ { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 218 = linux_mincore */ - { AS(madvise_args), (sy_call_t *)sys_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 219 = madvise */ + { AS(linux_madvise_args), (sy_call_t *)linux_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 219 = linux_madvise */ { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 220 = linux_getdents64 */ { AS(linux_fcntl64_args), (sy_call_t *)linux_fcntl64, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 221 = linux_fcntl64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 222 = */ Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Sat Jun 20 18:29:22 2020 (r362440) +++ head/sys/i386/linux/linux_systrace_args.c Sat Jun 20 18:31:02 2020 (r362441) @@ -1564,9 +1564,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* madvise */ + /* linux_madvise */ case 219: { - struct madvise_args *p = params; + struct linux_madvise_args *p = params; uarg[0] = (intptr_t) p->addr; /* void * */ uarg[1] = p->len; /* size_t */ iarg[2] = p->behav; /* int */ @@ -5477,7 +5477,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* madvise */ + /* linux_madvise */ case 219: switch(ndx) { case 0: @@ -8696,7 +8696,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* madvise */ + /* linux_madvise */ case 219: if (ndx == 0 || ndx == 1) p = "int"; From owner-svn-src-all@freebsd.org Sat Jun 20 18:46:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C45F330852 for ; Sat, 20 Jun 2020 18:46:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49q4Pq0FY3z4YGr for ; Sat, 20 Jun 2020 18:46:06 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1592678766; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=v9C3AW7dXIjNNlfBjygI2uJXKEUzDQkKtcW2SVJqSZFVDOh48zPRSBX1Oy8GGsQTh6jcSmAIwZzgi /RztV1ogZxJGv6ROrMYqoCRH4sAvSDKDnZuksiSlQo/WqYd103alQ4davq6DgdNWhPMwJF8fn2xa6j zUCzmK+ofZHIXEQge8AYNp5GxZ7r1c628ZC7FqSItbl+U+1Qj/MIehOHjqhsRUBmN11MAGO7gwhpUw xFjt9GXgppKIRwe+fGUathJGomxZN/XWLpAvmvEi9a4tuBniUUE+F41z9wcnW8b9tWu3OPtEqO3qEw XV96K9Eugxk3aSl8DEbZut9JlHGCFiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=y2uGqguTY49iTiynocLHA7uokM1kFBTuKBS/UbFETr4=; b=kYwczOrIAnccr7pfnASXg/zq7iBUIzMQDPaz05ZD+sBi4OxujITNiYWNyrNN1pYYBs7Q81UocXUTs 3qXAzMxHMGV5PLwjx1lO11BNM185Zt7BHI4+V/0MeDNdgZ+NoCFrWFUneWK07YD0iMDXQGhAk/UY5D Lf3Nn1I3W7PBDEkCTju1v6T1uRR6tRxHxP9Bl+6YYV1/3xXxXDrdlJS+XwpdeKDNIJNNZWfjX7LQ/o mPPH1EVmagNL8WOPMRo03MisKClV+eIJ1iEXMTKx+mg0q268ZOjji77wiHHQUjOwmI1iHY5DfFmLeB Q1NywarzPoRwSlmT8biW8W1+VBiTEBA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=y2uGqguTY49iTiynocLHA7uokM1kFBTuKBS/UbFETr4=; b=AD7FThtkG3nRigUzp+DllCJOCAa13bMwrbyYHXICowqBrnu0Cs2GFxFfyg2zAQ8sZFNcQwwmQN+48 cd1wZXtehFW9g7PXKFMXYnHRyfGTr7POGWfc/h0VZVh144D2NsrA2ibtGlERdoK3OKSoC/KO0YGHTA iYjNTQUzqEN0kxugtsSWkOyUA3OBHYDIQcSK7eTOTBeoVz0/Dm1k2JnXSnUu6WB2X5ImfBkxg6xK2e iEe+ZC5umooJaKfDHk6DAHcoIra1p2LIpTI9MTipoRgEEKy6sJ3UpX+tn6lU6WUO/iweQmx390+dj6 zi8rMlyXpNwnRqixY1a0bVlNTqiOqoQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 4a448942-b326-11ea-a2ba-9f0c275c2f69 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 4a448942-b326-11ea-a2ba-9f0c275c2f69; Sat, 20 Jun 2020 18:46:04 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 05KIk28q043799; Sat, 20 Jun 2020 12:46:02 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <93ca6b8e4c1f8a76ea6ad602591dcd2e39c2d89c.camel@freebsd.org> Subject: Re: svn commit: r362422 - head/sbin/dump From: Ian Lepore To: Warner Losh , Hans Petter Selasky Cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all , svn-src-head Date: Sat, 20 Jun 2020 12:46:02 -0600 In-Reply-To: References: <202006201110.05KBAZBU099451@gndrsh.dnsmgr.net> <3bab2cbf-c221-7d18-5257-2d3971975558@selasky.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49q4Pq0FY3z4YGr X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 18:46:07 -0000 On Sat, 2020-06-20 at 07:57 -0600, Warner Losh wrote: > On Sat, Jun 20, 2020 at 7:27 AM Hans Petter Selasky wrote: > > > On 2020-06-20 13:10, Rodney W. Grimes wrote: > > > > Author: imp > > > > Date: Sat Jun 20 04:19:17 2020 > > > > New Revision: 362422 > > > > URL:https://svnweb.freebsd.org/changeset/base/362422 > > > > > > > > Log: > > > > Increase the whimsy in this file by famring dump's work out to > > > > minions. Adjust > > > > variables accordingly. Thankfully, we are able to do this without > > > > additional > > > > banana expenditures. > > > > > > This flys in the face of its intent and as a "commit" is more > > > racially biased than the code was! > > > > > > > Hi Warner, > > > > Maybe a stupid question, but is this the correct meaning or description > > of minion? > > > > https://www.google.com/search?q=minions > > > > minion; plural noun: minions > > > > a follower or underling of a powerful person, especially a servile > > or unimportant one. > > "he gets oppressed minions like me to fob them off" > > > > "Minion" is still a person, like "slave" is, so I must say I agree with > > Rodney about this, I don't see how this makes it any better? Can you > > explain? > > > > For me, Minions come from the Despicable Me movies and sequels. They work > for Gru, who pays them for their services. They love Bananas and often do > crazy things for a banana. They work for Gru willingly. They are free to > leave at any time. They are sad at the prospect of Gru having to lay them > off. > > Minions are also, as you point out, employed by the powerful to accomplish > things. Key word here is 'employed'. Servile doesn't mean 'involuntary > servitude' but rather 'an excessive willingness to please.' Underling means > only that them are below them on the org chart. There's no inherent > implication of an abusive relationship, per se, though that happens as in > any power relationship between people. > > And the extensive searching I did before the commit showed no complaints > about the movies, or that this term had some coded, racist history. Or any > other coded history that's problematic. Or any overt history for that > matter. > > SaltStack uses it as their name for agents that carry out tasks, for > example. > > So what am I missing? > Common sense, apparently. -- Ian From owner-svn-src-all@freebsd.org Sat Jun 20 18:49:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BADE3305F2; Sat, 20 Jun 2020 18:49:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q4TV5Bbfz4YNc; Sat, 20 Jun 2020 18:49:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF07810C92; Sat, 20 Jun 2020 18:49:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KInH1D067522; Sat, 20 Jun 2020 18:49:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KInDJ1067498; Sat, 20 Jun 2020 18:49:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202006201849.05KInDJ1067498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jun 2020 18:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362442 - in vendor/llvm-project/release-10.x: clang/lib/Sema clang/lib/Tooling/Syntax clang/utils/TableGen lld/COFF lld/ELF llvm/include/llvm/Support llvm/lib/CodeGen llvm/lib/Target/A... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm-project/release-10.x: clang/lib/Sema clang/lib/Tooling/Syntax clang/utils/TableGen lld/COFF lld/ELF llvm/include/llvm/Support llvm/lib/CodeGen llvm/lib/Target/AArch64 llvm/lib/Target/X8... X-SVN-Commit-Revision: 362442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 18:49:22 -0000 Author: dim Date: Sat Jun 20 18:49:12 2020 New Revision: 362442 URL: https://svnweb.freebsd.org/changeset/base/362442 Log: Vendor import of llvm-project branch release/10.x llvmorg-10.0.0-97-g6f71678ecd2. Added: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td Modified: vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplate.cpp vendor/llvm-project/release-10.x/clang/lib/Tooling/Syntax/Tokens.cpp vendor/llvm-project/release-10.x/clang/utils/TableGen/ClangAttrEmitter.cpp vendor/llvm-project/release-10.x/lld/COFF/Chunks.h vendor/llvm-project/release-10.x/lld/COFF/DLL.cpp vendor/llvm-project/release-10.x/lld/ELF/ScriptLexer.cpp vendor/llvm-project/release-10.x/lld/ELF/ScriptParser.cpp vendor/llvm-project/release-10.x/llvm/include/llvm/Support/AArch64TargetParser.def vendor/llvm-project/release-10.x/llvm/lib/CodeGen/BranchFolding.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA53.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA57.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedCyclone.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedFalkor.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedKryo.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64Subtarget.h vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86AsmPrinter.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86ISelLowering.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86InstrInfo.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/Utils/ValueMapper.cpp Modified: vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplate.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplate.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplate.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -3817,6 +3817,9 @@ TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgsIn, SourceLocation RAngleLoc) { + if (SS.isInvalid()) + return TypeResult(true); + TemplateName Template = TemplateD.get(); // Translate the parser's template argument list in our AST format. @@ -5925,7 +5928,9 @@ bool UnnamedLocalNoLinkageFinder::VisitDependentNameTy bool UnnamedLocalNoLinkageFinder::VisitDependentTemplateSpecializationType( const DependentTemplateSpecializationType* T) { - return VisitNestedNameSpecifier(T->getQualifier()); + if (auto *Q = T->getQualifier()) + return VisitNestedNameSpecifier(Q); + return false; } bool UnnamedLocalNoLinkageFinder::VisitPackExpansionType( @@ -5979,6 +5984,7 @@ bool UnnamedLocalNoLinkageFinder::VisitTagDecl(const T bool UnnamedLocalNoLinkageFinder::VisitNestedNameSpecifier( NestedNameSpecifier *NNS) { + assert(NNS); if (NNS->getPrefix() && VisitNestedNameSpecifier(NNS->getPrefix())) return true; Modified: vendor/llvm-project/release-10.x/clang/lib/Tooling/Syntax/Tokens.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Tooling/Syntax/Tokens.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/clang/lib/Tooling/Syntax/Tokens.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -335,14 +335,38 @@ class TokenCollector::CollectPPExpansions : public PPC SourceRange Range, const MacroArgs *Args) override { if (!Collector) return; - // Only record top-level expansions, not those where: + const auto &SM = Collector->PP.getSourceManager(); + // Only record top-level expansions that directly produce expanded tokens. + // This excludes those where: // - the macro use is inside a macro body, // - the macro appears in an argument to another macro. - if (!MacroNameTok.getLocation().isFileID() || - (LastExpansionEnd.isValid() && - Collector->PP.getSourceManager().isBeforeInTranslationUnit( - Range.getBegin(), LastExpansionEnd))) + // However macro expansion isn't really a tree, it's token rewrite rules, + // so there are other cases, e.g. + // #define B(X) X + // #define A 1 + B + // A(2) + // Both A and B produce expanded tokens, though the macro name 'B' comes + // from an expansion. The best we can do is merge the mappings for both. + + // The *last* token of any top-level macro expansion must be in a file. + // (In the example above, see the closing paren of the expansion of B). + if (!Range.getEnd().isFileID()) return; + // If there's a current expansion that encloses this one, this one can't be + // top-level. + if (LastExpansionEnd.isValid() && + !SM.isBeforeInTranslationUnit(LastExpansionEnd, Range.getEnd())) + return; + + // If the macro invocation (B) starts in a macro (A) but ends in a file, + // we'll create a merged mapping for A + B by overwriting the endpoint for + // A's startpoint. + if (!Range.getBegin().isFileID()) { + Range.setBegin(SM.getExpansionLoc(Range.getBegin())); + assert(Collector->Expansions.count(Range.getBegin().getRawEncoding()) && + "Overlapping macros should have same expansion location"); + } + Collector->Expansions[Range.getBegin().getRawEncoding()] = Range.getEnd(); LastExpansionEnd = Range.getEnd(); } @@ -399,197 +423,167 @@ class TokenCollector::Builder { (public) } TokenBuffer build() && { - buildSpelledTokens(); - - // Walk over expanded tokens and spelled tokens in parallel, building the - // mappings between those using source locations. - // To correctly recover empty macro expansions, we also take locations - // reported to PPCallbacks::MacroExpands into account as we do not have any - // expanded tokens with source locations to guide us. - - // The 'eof' token is special, it is not part of spelled token stream. We - // handle it separately at the end. assert(!Result.ExpandedTokens.empty()); assert(Result.ExpandedTokens.back().kind() == tok::eof); - for (unsigned I = 0; I < Result.ExpandedTokens.size() - 1; ++I) { - // (!) I might be updated by the following call. - processExpandedToken(I); - } - // 'eof' not handled in the loop, do it here. - assert(SM.getMainFileID() == - SM.getFileID(Result.ExpandedTokens.back().location())); - fillGapUntil(Result.Files[SM.getMainFileID()], - Result.ExpandedTokens.back().location(), - Result.ExpandedTokens.size() - 1); - Result.Files[SM.getMainFileID()].EndExpanded = Result.ExpandedTokens.size(); + // Tokenize every file that contributed tokens to the expanded stream. + buildSpelledTokens(); - // Some files might have unaccounted spelled tokens at the end, add an empty - // mapping for those as they did not have expanded counterparts. - fillGapsAtEndOfFiles(); + // The expanded token stream consists of runs of tokens that came from + // the same source (a macro expansion, part of a file etc). + // Between these runs are the logical positions of spelled tokens that + // didn't expand to anything. + while (NextExpanded < Result.ExpandedTokens.size() - 1 /* eof */) { + // Create empty mappings for spelled tokens that expanded to nothing here. + // May advance NextSpelled, but NextExpanded is unchanged. + discard(); + // Create mapping for a contiguous run of expanded tokens. + // Advances NextExpanded past the run, and NextSpelled accordingly. + unsigned OldPosition = NextExpanded; + advance(); + if (NextExpanded == OldPosition) + diagnoseAdvanceFailure(); + } + // If any tokens remain in any of the files, they didn't expand to anything. + // Create empty mappings up until the end of the file. + for (const auto &File : Result.Files) + discard(File.first); return std::move(Result); } private: - /// Process the next token in an expanded stream and move corresponding - /// spelled tokens, record any mapping if needed. - /// (!) \p I will be updated if this had to skip tokens, e.g. for macros. - void processExpandedToken(unsigned &I) { - auto L = Result.ExpandedTokens[I].location(); - if (L.isMacroID()) { - processMacroExpansion(SM.getExpansionRange(L), I); - return; - } - if (L.isFileID()) { - auto FID = SM.getFileID(L); - TokenBuffer::MarkedFile &File = Result.Files[FID]; + // Consume a sequence of spelled tokens that didn't expand to anything. + // In the simplest case, skips spelled tokens until finding one that produced + // the NextExpanded token, and creates an empty mapping for them. + // If Drain is provided, skips remaining tokens from that file instead. + void discard(llvm::Optional Drain = llvm::None) { + SourceLocation Target = + Drain ? SM.getLocForEndOfFile(*Drain) + : SM.getExpansionLoc( + Result.ExpandedTokens[NextExpanded].location()); + FileID File = SM.getFileID(Target); + const auto &SpelledTokens = Result.Files[File].SpelledTokens; + auto &NextSpelled = this->NextSpelled[File]; - fillGapUntil(File, L, I); + TokenBuffer::Mapping Mapping; + Mapping.BeginSpelled = NextSpelled; + // When dropping trailing tokens from a file, the empty mapping should + // be positioned within the file's expanded-token range (at the end). + Mapping.BeginExpanded = Mapping.EndExpanded = + Drain ? Result.Files[*Drain].EndExpanded : NextExpanded; + // We may want to split into several adjacent empty mappings. + // FlushMapping() emits the current mapping and starts a new one. + auto FlushMapping = [&, this] { + Mapping.EndSpelled = NextSpelled; + if (Mapping.BeginSpelled != Mapping.EndSpelled) + Result.Files[File].Mappings.push_back(Mapping); + Mapping.BeginSpelled = NextSpelled; + }; - // Skip the token. - assert(File.SpelledTokens[NextSpelled[FID]].location() == L && - "no corresponding token in the spelled stream"); - ++NextSpelled[FID]; - return; + while (NextSpelled < SpelledTokens.size() && + SpelledTokens[NextSpelled].location() < Target) { + // If we know mapping bounds at [NextSpelled, KnownEnd] (macro expansion) + // then we want to partition our (empty) mapping. + // [Start, NextSpelled) [NextSpelled, KnownEnd] (KnownEnd, Target) + SourceLocation KnownEnd = CollectedExpansions.lookup( + SpelledTokens[NextSpelled].location().getRawEncoding()); + if (KnownEnd.isValid()) { + FlushMapping(); // Emits [Start, NextSpelled) + while (NextSpelled < SpelledTokens.size() && + SpelledTokens[NextSpelled].location() <= KnownEnd) + ++NextSpelled; + FlushMapping(); // Emits [NextSpelled, KnownEnd] + // Now the loop contitues and will emit (KnownEnd, Target). + } else { + ++NextSpelled; + } } + FlushMapping(); } - /// Skipped expanded and spelled tokens of a macro expansion that covers \p - /// SpelledRange. Add a corresponding mapping. - /// (!) \p I will be the index of the last token in an expansion after this - /// function returns. - void processMacroExpansion(CharSourceRange SpelledRange, unsigned &I) { - auto FID = SM.getFileID(SpelledRange.getBegin()); - assert(FID == SM.getFileID(SpelledRange.getEnd())); - TokenBuffer::MarkedFile &File = Result.Files[FID]; + // Consumes the NextExpanded token and others that are part of the same run. + // Increases NextExpanded and NextSpelled by at least one, and adds a mapping + // (unless this is a run of file tokens, which we represent with no mapping). + void advance() { + const syntax::Token &Tok = Result.ExpandedTokens[NextExpanded]; + SourceLocation Expansion = SM.getExpansionLoc(Tok.location()); + FileID File = SM.getFileID(Expansion); + const auto &SpelledTokens = Result.Files[File].SpelledTokens; + auto &NextSpelled = this->NextSpelled[File]; - fillGapUntil(File, SpelledRange.getBegin(), I); + if (Tok.location().isFileID()) { + // A run of file tokens continues while the expanded/spelled tokens match. + while (NextSpelled < SpelledTokens.size() && + NextExpanded < Result.ExpandedTokens.size() && + SpelledTokens[NextSpelled].location() == + Result.ExpandedTokens[NextExpanded].location()) { + ++NextSpelled; + ++NextExpanded; + } + // We need no mapping for file tokens copied to the expanded stream. + } else { + // We found a new macro expansion. We should have its spelling bounds. + auto End = CollectedExpansions.lookup(Expansion.getRawEncoding()); + assert(End.isValid() && "Macro expansion wasn't captured?"); - // Skip all expanded tokens from the same macro expansion. - unsigned BeginExpanded = I; - for (; I + 1 < Result.ExpandedTokens.size(); ++I) { - auto NextL = Result.ExpandedTokens[I + 1].location(); - if (!NextL.isMacroID() || - SM.getExpansionLoc(NextL) != SpelledRange.getBegin()) - break; + // Mapping starts here... + TokenBuffer::Mapping Mapping; + Mapping.BeginExpanded = NextExpanded; + Mapping.BeginSpelled = NextSpelled; + // ... consumes spelled tokens within bounds we captured ... + while (NextSpelled < SpelledTokens.size() && + SpelledTokens[NextSpelled].location() <= End) + ++NextSpelled; + // ... consumes expanded tokens rooted at the same expansion ... + while (NextExpanded < Result.ExpandedTokens.size() && + SM.getExpansionLoc( + Result.ExpandedTokens[NextExpanded].location()) == Expansion) + ++NextExpanded; + // ... and ends here. + Mapping.EndExpanded = NextExpanded; + Mapping.EndSpelled = NextSpelled; + Result.Files[File].Mappings.push_back(Mapping); } - unsigned EndExpanded = I + 1; - consumeMapping(File, SM.getFileOffset(SpelledRange.getEnd()), BeginExpanded, - EndExpanded, NextSpelled[FID]); } + // advance() is supposed to consume at least one token - if not, we crash. + void diagnoseAdvanceFailure() { +#ifndef NDEBUG + // Show the failed-to-map token in context. + for (unsigned I = (NextExpanded < 10) ? 0 : NextExpanded - 10; + I < NextExpanded + 5 && I < Result.ExpandedTokens.size(); ++I) { + const char *L = + (I == NextExpanded) ? "!! " : (I < NextExpanded) ? "ok " : " "; + llvm::errs() << L << Result.ExpandedTokens[I].dumpForTests(SM) << "\n"; + } +#endif + llvm_unreachable("Couldn't map expanded token to spelled tokens!"); + } + /// Initializes TokenBuffer::Files and fills spelled tokens and expanded /// ranges for each of the files. void buildSpelledTokens() { for (unsigned I = 0; I < Result.ExpandedTokens.size(); ++I) { - auto FID = - SM.getFileID(SM.getExpansionLoc(Result.ExpandedTokens[I].location())); + const auto &Tok = Result.ExpandedTokens[I]; + auto FID = SM.getFileID(SM.getExpansionLoc(Tok.location())); auto It = Result.Files.try_emplace(FID); TokenBuffer::MarkedFile &File = It.first->second; - File.EndExpanded = I + 1; + // The eof token should not be considered part of the main-file's range. + File.EndExpanded = Tok.kind() == tok::eof ? I : I + 1; + if (!It.second) continue; // we have seen this file before. - // This is the first time we see this file. File.BeginExpanded = I; File.SpelledTokens = tokenize(FID, SM, LangOpts); } } - void consumeEmptyMapping(TokenBuffer::MarkedFile &File, unsigned EndOffset, - unsigned ExpandedIndex, unsigned &SpelledIndex) { - consumeMapping(File, EndOffset, ExpandedIndex, ExpandedIndex, SpelledIndex); - } - - /// Consumes spelled tokens that form a macro expansion and adds a entry to - /// the resulting token buffer. - /// (!) SpelledIndex is updated in-place. - void consumeMapping(TokenBuffer::MarkedFile &File, unsigned EndOffset, - unsigned BeginExpanded, unsigned EndExpanded, - unsigned &SpelledIndex) { - // We need to record this mapping before continuing. - unsigned MappingBegin = SpelledIndex; - ++SpelledIndex; - - bool HitMapping = - tryConsumeSpelledUntil(File, EndOffset + 1, SpelledIndex).hasValue(); - (void)HitMapping; - assert(!HitMapping && "recursive macro expansion?"); - - TokenBuffer::Mapping M; - M.BeginExpanded = BeginExpanded; - M.EndExpanded = EndExpanded; - M.BeginSpelled = MappingBegin; - M.EndSpelled = SpelledIndex; - - File.Mappings.push_back(M); - } - - /// Consumes spelled tokens until location \p L is reached and adds a mapping - /// covering the consumed tokens. The mapping will point to an empty expanded - /// range at position \p ExpandedIndex. - void fillGapUntil(TokenBuffer::MarkedFile &File, SourceLocation L, - unsigned ExpandedIndex) { - assert(L.isFileID()); - FileID FID; - unsigned Offset; - std::tie(FID, Offset) = SM.getDecomposedLoc(L); - - unsigned &SpelledIndex = NextSpelled[FID]; - unsigned MappingBegin = SpelledIndex; - while (true) { - auto EndLoc = tryConsumeSpelledUntil(File, Offset, SpelledIndex); - if (SpelledIndex != MappingBegin) { - TokenBuffer::Mapping M; - M.BeginSpelled = MappingBegin; - M.EndSpelled = SpelledIndex; - M.BeginExpanded = M.EndExpanded = ExpandedIndex; - File.Mappings.push_back(M); - } - if (!EndLoc) - break; - consumeEmptyMapping(File, SM.getFileOffset(*EndLoc), ExpandedIndex, - SpelledIndex); - - MappingBegin = SpelledIndex; - } - }; - - /// Consumes spelled tokens until it reaches Offset or a mapping boundary, - /// i.e. a name of a macro expansion or the start '#' token of a PP directive. - /// (!) NextSpelled is updated in place. - /// - /// returns None if \p Offset was reached, otherwise returns the end location - /// of a mapping that starts at \p NextSpelled. - llvm::Optional - tryConsumeSpelledUntil(TokenBuffer::MarkedFile &File, unsigned Offset, - unsigned &NextSpelled) { - for (; NextSpelled < File.SpelledTokens.size(); ++NextSpelled) { - auto L = File.SpelledTokens[NextSpelled].location(); - if (Offset <= SM.getFileOffset(L)) - return llvm::None; // reached the offset we are looking for. - auto Mapping = CollectedExpansions.find(L.getRawEncoding()); - if (Mapping != CollectedExpansions.end()) - return Mapping->second; // found a mapping before the offset. - } - return llvm::None; // no more tokens, we "reached" the offset. - } - - /// Adds empty mappings for unconsumed spelled tokens at the end of each file. - void fillGapsAtEndOfFiles() { - for (auto &F : Result.Files) { - if (F.second.SpelledTokens.empty()) - continue; - fillGapUntil(F.second, F.second.SpelledTokens.back().endLocation(), - F.second.EndExpanded); - } - } - TokenBuffer Result; - /// For each file, a position of the next spelled token we will consume. - llvm::DenseMap NextSpelled; + unsigned NextExpanded = 0; // cursor in ExpandedTokens + llvm::DenseMap NextSpelled; // cursor in SpelledTokens PPExpansions CollectedExpansions; const SourceManager &SM; const LangOptions &LangOpts; Modified: vendor/llvm-project/release-10.x/clang/utils/TableGen/ClangAttrEmitter.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/utils/TableGen/ClangAttrEmitter.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/clang/utils/TableGen/ClangAttrEmitter.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -2825,6 +2825,7 @@ void EmitClangAttrPCHRead(RecordKeeper &Records, raw_o if (R.isSubClassOf(InhClass)) OS << " bool isInherited = Record.readInt();\n"; OS << " bool isImplicit = Record.readInt();\n"; + OS << " bool isPackExpansion = Record.readInt();\n"; ArgRecords = R.getValueAsListOfDefs("Args"); Args.clear(); for (const auto *Arg : ArgRecords) { @@ -2840,6 +2841,7 @@ void EmitClangAttrPCHRead(RecordKeeper &Records, raw_o if (R.isSubClassOf(InhClass)) OS << " cast(New)->setInherited(isInherited);\n"; OS << " New->setImplicit(isImplicit);\n"; + OS << " New->setPackExpansion(isPackExpansion);\n"; OS << " break;\n"; OS << " }\n"; } @@ -2866,6 +2868,7 @@ void EmitClangAttrPCHWrite(RecordKeeper &Records, raw_ if (R.isSubClassOf(InhClass)) OS << " Record.push_back(SA->isInherited());\n"; OS << " Record.push_back(A->isImplicit());\n"; + OS << " Record.push_back(A->isPackExpansion());\n"; for (const auto *Arg : Args) createArgument(*Arg, R.getName())->writePCHWrite(OS); Modified: vendor/llvm-project/release-10.x/lld/COFF/Chunks.h ============================================================================== --- vendor/llvm-project/release-10.x/lld/COFF/Chunks.h Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/lld/COFF/Chunks.h Sat Jun 20 18:49:12 2020 (r362442) @@ -486,7 +486,9 @@ class ImportThunkChunkX86 : public ImportThunkChunk { class ImportThunkChunkARM : public ImportThunkChunk { public: - explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) {} + explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) { + setAlignment(2); + } size_t getSize() const override { return sizeof(importThunkARM); } void getBaserels(std::vector *res) override; void writeTo(uint8_t *buf) const override; @@ -494,14 +496,16 @@ class ImportThunkChunkARM : public ImportThunkChunk { class ImportThunkChunkARM64 : public ImportThunkChunk { public: - explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) {} + explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) { + setAlignment(4); + } size_t getSize() const override { return sizeof(importThunkARM64); } void writeTo(uint8_t *buf) const override; }; class RangeExtensionThunkARM : public NonSectionChunk { public: - explicit RangeExtensionThunkARM(Defined *t) : target(t) {} + explicit RangeExtensionThunkARM(Defined *t) : target(t) { setAlignment(2); } size_t getSize() const override; void writeTo(uint8_t *buf) const override; Modified: vendor/llvm-project/release-10.x/lld/COFF/DLL.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/COFF/DLL.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/lld/COFF/DLL.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -365,7 +365,9 @@ class TailMergeChunkX86 : public NonSectionChunk { (pu class ThunkChunkARM : public NonSectionChunk { public: - ThunkChunkARM(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) {} + ThunkChunkARM(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) { + setAlignment(2); + } size_t getSize() const override { return sizeof(thunkARM); } @@ -385,7 +387,9 @@ class ThunkChunkARM : public NonSectionChunk { (public class TailMergeChunkARM : public NonSectionChunk { public: - TailMergeChunkARM(Chunk *d, Defined *h) : desc(d), helper(h) {} + TailMergeChunkARM(Chunk *d, Defined *h) : desc(d), helper(h) { + setAlignment(2); + } size_t getSize() const override { return sizeof(tailMergeARM); } @@ -405,7 +409,9 @@ class TailMergeChunkARM : public NonSectionChunk { (pu class ThunkChunkARM64 : public NonSectionChunk { public: - ThunkChunkARM64(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) {} + ThunkChunkARM64(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) { + setAlignment(4); + } size_t getSize() const override { return sizeof(thunkARM64); } @@ -422,7 +428,9 @@ class ThunkChunkARM64 : public NonSectionChunk { (publ class TailMergeChunkARM64 : public NonSectionChunk { public: - TailMergeChunkARM64(Chunk *d, Defined *h) : desc(d), helper(h) {} + TailMergeChunkARM64(Chunk *d, Defined *h) : desc(d), helper(h) { + setAlignment(4); + } size_t getSize() const override { return sizeof(tailMergeARM64); } Modified: vendor/llvm-project/release-10.x/lld/ELF/ScriptLexer.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/ELF/ScriptLexer.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/lld/ELF/ScriptLexer.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -52,6 +52,8 @@ StringRef ScriptLexer::getLine() { // Returns 1-based line number of the current token. size_t ScriptLexer::getLineNumber() { + if (pos == 0) + return 1; StringRef s = getCurrentMB().getBuffer(); StringRef tok = tokens[pos - 1]; return s.substr(0, tok.data() - s.data()).count('\n') + 1; @@ -292,7 +294,9 @@ static bool encloses(StringRef s, StringRef t) { MemoryBufferRef ScriptLexer::getCurrentMB() { // Find input buffer containing the current token. - assert(!mbs.empty() && pos > 0); + assert(!mbs.empty()); + if (pos == 0) + return mbs.back(); for (MemoryBufferRef mb : mbs) if (encloses(mb.getBuffer(), tokens[pos - 1])) return mb; Modified: vendor/llvm-project/release-10.x/lld/ELF/ScriptParser.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/ELF/ScriptParser.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/lld/ELF/ScriptParser.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -737,6 +737,7 @@ bool ScriptParser::readSectionDirective(OutputSection expect("("); if (consume("NOLOAD")) { cmd->noload = true; + cmd->type = SHT_NOBITS; } else { skip(); // This is "COPY", "INFO" or "OVERLAY". cmd->nonAlloc = true; Modified: vendor/llvm-project/release-10.x/llvm/include/llvm/Support/AArch64TargetParser.def ============================================================================== --- vendor/llvm-project/release-10.x/llvm/include/llvm/Support/AArch64TargetParser.def Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/include/llvm/Support/AArch64TargetParser.def Sat Jun 20 18:49:12 2020 (r362442) @@ -152,6 +152,10 @@ AARCH64_CPU_NAME("kryo", ARMV8A, FK_CRYPTO_NEON_FP_ARM (AArch64::AEK_CRC)) AARCH64_CPU_NAME("thunderx2t99", ARMV8_1A, FK_CRYPTO_NEON_FP_ARMV8, false, (AArch64::AEK_NONE)) +AARCH64_CPU_NAME("thunderx3t110", ARMV8_3A, FK_CRYPTO_NEON_FP_ARMV8, false, + (AArch64::AEK_CRC | AEK_CRYPTO | AEK_FP | AEK_SIMD | + AEK_LSE | AEK_RAND | AArch64::AEK_PROFILE | + AArch64::AEK_RAS)) AARCH64_CPU_NAME("thunderx", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, (AArch64::AEK_CRC | AArch64::AEK_PROFILE)) AARCH64_CPU_NAME("thunderxt88", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, Modified: vendor/llvm-project/release-10.x/llvm/lib/CodeGen/BranchFolding.cpp ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/CodeGen/BranchFolding.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/CodeGen/BranchFolding.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -963,10 +963,10 @@ bool BranchFolder::TryTailMergeBlocks(MachineBasicBloc continue; } - // If one of the blocks is the entire common tail (and not the entry - // block, which we can't jump to), we can treat all blocks with this same - // tail at once. Use PredBB if that is one of the possibilities, as that - // will not introduce any extra branches. + // If one of the blocks is the entire common tail (and is not the entry + // block/an EH pad, which we can't jump to), we can treat all blocks with + // this same tail at once. Use PredBB if that is one of the possibilities, + // as that will not introduce any extra branches. MachineBasicBlock *EntryBB = &MergePotentials.front().getBlock()->getParent()->front(); unsigned commonTailIndex = SameTails.size(); @@ -974,19 +974,21 @@ bool BranchFolder::TryTailMergeBlocks(MachineBasicBloc // into the other. if (SameTails.size() == 2 && SameTails[0].getBlock()->isLayoutSuccessor(SameTails[1].getBlock()) && - SameTails[1].tailIsWholeBlock()) + SameTails[1].tailIsWholeBlock() && !SameTails[1].getBlock()->isEHPad()) commonTailIndex = 1; else if (SameTails.size() == 2 && SameTails[1].getBlock()->isLayoutSuccessor( - SameTails[0].getBlock()) && - SameTails[0].tailIsWholeBlock()) + SameTails[0].getBlock()) && + SameTails[0].tailIsWholeBlock() && + !SameTails[0].getBlock()->isEHPad()) commonTailIndex = 0; else { // Otherwise just pick one, favoring the fall-through predecessor if // there is one. for (unsigned i = 0, e = SameTails.size(); i != e; ++i) { MachineBasicBlock *MBB = SameTails[i].getBlock(); - if (MBB == EntryBB && SameTails[i].tailIsWholeBlock()) + if ((MBB == EntryBB || MBB->isEHPad()) && + SameTails[i].tailIsWholeBlock()) continue; if (MBB == PredBB) { commonTailIndex = i; Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64.td Sat Jun 20 18:49:12 2020 (r362442) @@ -443,6 +443,10 @@ def SVEUnsupported : AArch64Unsupported { HasSVE2BitPerm]; } +def PAUnsupported : AArch64Unsupported { + let F = [HasPA]; +} + include "AArch64SchedA53.td" include "AArch64SchedA57.td" include "AArch64SchedCyclone.td" @@ -453,6 +457,7 @@ include "AArch64SchedExynosM4.td" include "AArch64SchedExynosM5.td" include "AArch64SchedThunderX.td" include "AArch64SchedThunderX2T99.td" +include "AArch64SchedThunderX3T110.td" def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35", "Cortex-A35 ARM processors", [ @@ -780,6 +785,25 @@ def ProcThunderX2T99 : SubtargetFeature<"thunderx2t99 FeatureLSE, HasV8_1aOps]>; +def ProcThunderX3T110 : SubtargetFeature<"thunderx3t110", "ARMProcFamily", + "ThunderX3T110", + "Marvell ThunderX3 processors", [ + FeatureAggressiveFMA, + FeatureCRC, + FeatureCrypto, + FeatureFPARMv8, + FeatureArithmeticBccFusion, + FeatureNEON, + FeaturePostRAScheduler, + FeaturePredictableSelectIsExpensive, + FeatureLSE, + FeaturePA, + FeatureUseAA, + FeatureBalanceFPOps, + FeaturePerfMon, + FeatureStrictAlign, + HasV8_3aOps]>; + def ProcThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX", "Cavium ThunderX processors", [ FeatureCRC, @@ -878,6 +902,8 @@ def : ProcessorModel<"thunderxt81", ThunderXT8XModel, def : ProcessorModel<"thunderxt83", ThunderXT8XModel, [ProcThunderXT83]>; // Cavium ThunderX2T9X Processors. Formerly Broadcom Vulcan. def : ProcessorModel<"thunderx2t99", ThunderX2T99Model, [ProcThunderX2T99]>; +// Marvell ThunderX3T110 Processors. +def : ProcessorModel<"thunderx3t110", ThunderX3T110Model, [ProcThunderX3T110]>; // FIXME: HiSilicon TSV110 is currently modeled as a Cortex-A57. def : ProcessorModel<"tsv110", CortexA57Model, [ProcTSV110]>; Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp Sat Jun 20 18:49:12 2020 (r362442) @@ -118,9 +118,15 @@ void AArch64BranchTargets::addBTI(MachineBasicBlock &M auto MBBI = MBB.begin(); - // PACI[AB]SP are implicitly BTI JC, so no BTI instruction needed there. - if (MBBI != MBB.end() && (MBBI->getOpcode() == AArch64::PACIASP || - MBBI->getOpcode() == AArch64::PACIBSP)) + // Skip the meta instuctions, those will be removed anyway. + for (; MBBI != MBB.end() && MBBI->isMetaInstruction(); ++MBBI) + ; + + // SCTLR_EL1.BT[01] is set to 0 by default which means + // PACI[AB]SP are implicitly BTI C so no BTI C instruction is needed there. + if (MBBI != MBB.end() && HintNum == 34 && + (MBBI->getOpcode() == AArch64::PACIASP || + MBBI->getOpcode() == AArch64::PACIBSP)) return; BuildMI(MBB, MBB.begin(), MBB.findDebugLoc(MBB.begin()), Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA53.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA53.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA53.td Sat Jun 20 18:49:12 2020 (r362442) @@ -26,7 +26,8 @@ def CortexA53Model : SchedMachineModel { // v 1.0 Spreadsheet let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA57.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA57.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedA57.td Sat Jun 20 18:49:12 2020 (r362442) @@ -31,7 +31,8 @@ def CortexA57Model : SchedMachineModel { let LoopMicroOpBufferSize = 16; let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedCyclone.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedCyclone.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedCyclone.td Sat Jun 20 18:49:12 2020 (r362442) @@ -18,7 +18,8 @@ def CycloneModel : SchedMachineModel { let MispredictPenalty = 16; // 14-19 cycles are typical. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td Sat Jun 20 18:49:12 2020 (r362442) @@ -24,7 +24,8 @@ def ExynosM3Model : SchedMachineModel { let MispredictPenalty = 16; // Minimum branch misprediction penalty. let CompleteModel = 1; // Use the default model otherwise. - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Sat Jun 20 18:49:12 2020 (r362442) @@ -24,7 +24,8 @@ def ExynosM4Model : SchedMachineModel { let MispredictPenalty = 16; // Minimum branch misprediction penalty. let CompleteModel = 1; // Use the default model otherwise. - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td Sat Jun 20 18:49:12 2020 (r362442) @@ -24,7 +24,8 @@ def ExynosM5Model : SchedMachineModel { let MispredictPenalty = 15; // Minimum branch misprediction penalty. let CompleteModel = 1; // Use the default model otherwise. - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedFalkor.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedFalkor.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedFalkor.td Sat Jun 20 18:49:12 2020 (r362442) @@ -23,8 +23,8 @@ def FalkorModel : SchedMachineModel { let MispredictPenalty = 11; // Minimum branch misprediction penalty. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedKryo.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedKryo.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedKryo.td Sat Jun 20 18:49:12 2020 (r362442) @@ -27,8 +27,8 @@ def KryoModel : SchedMachineModel { let LoopMicroOpBufferSize = 16; let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX.td Sat Jun 20 18:49:12 2020 (r362442) @@ -25,8 +25,8 @@ def ThunderXT8XModel : SchedMachineModel { let PostRAScheduler = 1; // Use PostRA scheduler. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Modified: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td ============================================================================== --- vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td Sat Jun 20 18:31:02 2020 (r362441) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td Sat Jun 20 18:49:12 2020 (r362442) @@ -25,8 +25,8 @@ def ThunderX2T99Model : SchedMachineModel { let PostRAScheduler = 1; // Using PostRA sched. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Added: vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td Sat Jun 20 18:49:12 2020 (r362442) @@ -0,0 +1,1997 @@ +//=- AArch64SchedThunderX3T110.td - Marvell ThunderX3 T110 ---*- tablegen -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file defines the scheduling model for Marvell ThunderX3T110 +// family of processors. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Pipeline Description. + +def ThunderX3T110Model : SchedMachineModel { + let IssueWidth = 4; // 4 micro-ops dispatched at a time. + let MicroOpBufferSize = 70; // 70 entries in micro-op re-order buffer. + let LoadLatency = 4; // Optimistic load latency. + let MispredictPenalty = 12; // Extra cycles for mispredicted branch. + // Determined via a mix of micro-arch details and experimentation. + let LoopMicroOpBufferSize = 128; // FIXME: might be much bigger in TX3. + let PostRAScheduler = 1; // Using PostRA sched. + let CompleteModel = 1; + + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); + // FIXME: Remove when all errors have been fixed. + let FullInstRWOverlapCheck = 0; +} + +let SchedModel = ThunderX3T110Model in { + +// Issue ports. + +// Port 0: ALU. +def THX3T110P0 : ProcResource<1>; + +// Port 1: ALU. +def THX3T110P1 : ProcResource<1>; + +// Port 2: ALU/Branch. +def THX3T110P2 : ProcResource<1>; + +// Port 3: ALU/Branch. +def THX3T110P3 : ProcResource<1>; + +// Port 4: Load/Store. +def THX3T110P4 : ProcResource<1>; + +// Port 5: Load/store. +def THX3T110P5 : ProcResource<1>; + +// Port 6: FP/Neon/SIMD/Crypto. +def THX3T110P6FP0 : ProcResource<1>; + +// Port 7: FP/Neon/SIMD/Crypto. +def THX3T110P7FP1 : ProcResource<1>; + +// Port 8: FP/Neon/SIMD/Crypto. +def THX3T110P8FP2 : ProcResource<1>; + +// Port 9: FP/Neon/SIMD/Crypto. +def THX3T110P9FP3 : ProcResource<1>; + +// Port 10: Store Data Unit. +def THX3T110SD0 : ProcResource<1>; + +// Define groups for the functional units on each issue port. Each group +// created will be used by a WriteRes. + +// Integer divide/mulhi micro-ops only on port I1. +def THX3T110I1 : ProcResGroup<[THX3T110P1]>; + +// Branch micro-ops on ports I2/I3. +def THX3T110I23 : ProcResGroup<[THX3T110P2, THX3T110P3]>; + +// Branch micro-ops on ports I1/I2/I3. +def THX3T110I123 : ProcResGroup<[THX3T110P1, THX3T110P2, THX3T110P3]>; + +// Integer micro-ops on ports I0/I1/I2. +def THX3T110I012 : ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2]>; + +// Integer micro-ops on ports I0/I1/I2/I3. +def THX3T110I0123 : ProcResGroup<[THX3T110P0, THX3T110P1, + THX3T110P2, THX3T110P3]>; + +// FP micro-ops on ports FP0/FP1/FP2/FP3. +def THX3T110FP0123 : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1, + THX3T110P8FP2, THX3T110P9FP3]>; + +// FP micro-ops on ports FP2/FP3. +def THX3T110FP23 : ProcResGroup<[THX3T110P8FP2, THX3T110P9FP3]>; + +// ASIMD micro-ops on ports FP0/FP1/FP2/FP3. +def THX3T110SIMD : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1, + THX3T110P8FP2, THX3T110P9FP3]>; + +// Store data micro-ops only on port 10. +def THX3T110SD : ProcResGroup<[THX3T110SD0]>; + +// Load/store micro-ops on ports P4/P5. +def THX3T110LS : ProcResGroup<[THX3T110P4, THX3T110P5]>; + +// 70 entry unified scheduler. +def THX3T110ANY: ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2, + THX3T110P3, THX3T110P4, THX3T110P5, + THX3T110P6FP0, THX3T110P7FP1, + THX3T110P8FP2, THX3T110P9FP3]> { + let BufferSize = 70; +} + +// Define commonly used write types for InstRW specializations. +// All definitions follow the format: THX3T110Write_Cyc_. + +// 3 cycles on I1. +def THX3T110Write_3Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 3; + let NumMicroOps = 2; +} + +// 4 cycles on I1. +def THX3T110Write_4Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 4; + let NumMicroOps = 2; +} + +// 5 cycles on I1. +def THX3T110Write_5Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 5; + let NumMicroOps = 2; +} + +// 7 cycles on I1. +def THX3T110Write_7Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 7; + let NumMicroOps = 3; +} + +// 23 cycles on I1. +def THX3T110Write_23Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 23; + let ResourceCycles = [13, 23]; + let NumMicroOps = 4; +} + +// 39 cycles on I1. +def THX3T110Write_39Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 39; + let ResourceCycles = [13, 39]; + let NumMicroOps = 4; +} + +// 1 cycle on I2/I3 +def THX3T110Write_1Cyc_I23 : SchedWriteRes<[THX3T110I23]> { + let Latency = 1; + let NumMicroOps = 2; +} + +// 8 cycles on I2/I3 +def THX3T110Write_8Cyc_I23 : SchedWriteRes<[THX3T110I23]> { + let Latency = 8; + let NumMicroOps = 3; +} + +// 1 cycle on I1/I2/I3 +def THX3T110Write_1Cyc_I123 : SchedWriteRes<[THX3T110I123]> { + let Latency = 1; + let NumMicroOps = 2; +} + +// 8 cycles on I1/I2/I3 +def THX3T110Write_8Cyc_I123 : SchedWriteRes<[THX3T110I123]> { + let Latency = 8; + let NumMicroOps = 3; +} + +// 1 cycle on I0/I1/I2/I3. +def THX3T110Write_1Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> { + let Latency = 1; + let NumMicroOps = 2; +} + +// 2 cycles on I0/I1/I2/I3. +def THX3T110Write_2Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> { + let Latency = 2; + let NumMicroOps = 2; +} + +// 3 cycles on I0/I1/I2/I3. +def THX3T110Write_3Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> { + let Latency = 3; + let NumMicroOps = 2; +} + +// 4 cycles on I0/I1/I2/I3. +def THX3T110Write_4Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> { + let Latency = 4; + let NumMicroOps = 3; +} + +// 5 cycles on I0/I1/I2/I3. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 20 18:50:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 292A233099D; Sat, 20 Jun 2020 18:50:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q4Vg0Dj4z4Z5J; Sat, 20 Jun 2020 18:50:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDD72108E9; Sat, 20 Jun 2020 18:50:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KIoIqX067656; Sat, 20 Jun 2020 18:50:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KIoIJe067655; Sat, 20 Jun 2020 18:50:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202006201850.05KIoIJe067655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jun 2020 18:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362443 - vendor/llvm-project/llvmorg-10.0.0-97-g6f71678ecd2 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-project/llvmorg-10.0.0-97-g6f71678ecd2 X-SVN-Commit-Revision: 362443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 18:50:19 -0000 Author: dim Date: Sat Jun 20 18:50:18 2020 New Revision: 362443 URL: https://svnweb.freebsd.org/changeset/base/362443 Log: Tag llvm-project branch release/10.x llvmorg-10.0.0-97-g6f71678ecd2. Added: vendor/llvm-project/llvmorg-10.0.0-97-g6f71678ecd2/ - copied from r362442, vendor/llvm-project/release-10.x/ From owner-svn-src-all@freebsd.org Sat Jun 20 20:06:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3AB53334CE; Sat, 20 Jun 2020 20:06:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6BG4q4Zz3V2d; Sat, 20 Jun 2020 20:06:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A077411944; Sat, 20 Jun 2020 20:06:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KK6E8D016500; Sat, 20 Jun 2020 20:06:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KK6EqK016498; Sat, 20 Jun 2020 20:06:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202006202006.05KK6EqK016498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Jun 2020 20:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362444 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 362444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:06:14 -0000 Author: imp Date: Sat Jun 20 20:06:14 2020 New Revision: 362444 URL: https://svnweb.freebsd.org/changeset/base/362444 Log: Revert -r362422. While whimsical, there's too much negative energy around minion as well as the positive. Modified: head/sbin/dump/tape.c Modified: head/sbin/dump/tape.c ============================================================================== --- head/sbin/dump/tape.c Sat Jun 20 18:50:18 2020 (r362443) +++ head/sbin/dump/tape.c Sat Jun 20 20:06:14 2020 (r362444) @@ -75,19 +75,19 @@ static char *nexttape; static FILE *popenfp = NULL; static int atomic(ssize_t (*)(), int, char *, int); -static void dominion(int, int); -static void enminion(void); +static void doslave(int, int); +static void enslave(void); static void flushtape(void); static void killall(void); static void rollforward(void); /* * Concurrent dump mods (Caltech) - disk block reading and tape writing - * are exported to several minion processes. While one minion writes the + * are exported to several slave processes. While one slave writes the * tape, the others read disk blocks; they pass control of the tape in * a ring via signals. The parent process traverses the file system and - * sends writeheader()'s and lists of daddr's to the minions via pipes. - * The following structure defines the instruction packets sent to minions. + * sends writeheader()'s and lists of daddr's to the slaves via pipes. + * The following structure defines the instruction packets sent to slaves. */ struct req { ufs2_daddr_t dblk; @@ -95,20 +95,20 @@ struct req { }; static int reqsiz; -#define MINIONS 3 /* 1 minion writing, 1 reading, 1 for slack */ -static struct minion { +#define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */ +static struct slave { int64_t tapea; /* header number at start of this chunk */ int64_t firstrec; /* record number of this block */ int count; /* count to next header (used for TS_TAPE */ /* after EOT) */ int inode; /* inode that we are currently dealing with */ - int fd; /* FD for this minion */ - int pid; /* PID for this minion */ - int sent; /* 1 == we've sent this minion requests */ + int fd; /* FD for this slave */ + int pid; /* PID for this slave */ + int sent; /* 1 == we've sent this slave requests */ char (*tblock)[TP_BSIZE]; /* buffer for data blocks */ struct req *req; /* buffer for requests */ -} minions[MINIONS+1]; -static struct minion *mlp; +} slaves[SLAVES+1]; +static struct slave *slp; static char (*nextblock)[TP_BSIZE]; @@ -116,9 +116,9 @@ static int master; /* pid of master, for sending error static int tenths; /* length of tape used per block written */ static volatile sig_atomic_t caught; /* have we caught the signal to proceed? */ static volatile sig_atomic_t ready; /* reached the lock point without having */ - /* received the SIGUSR2 signal from the prev minion? */ + /* received the SIGUSR2 signal from the prev slave? */ static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ - /* SIGUSR2 arrives from the previous minion */ + /* SIGUSR2 arrives from the previous slave */ int alloctape(void) @@ -143,20 +143,20 @@ alloctape(void) * packets, so flushtape() can write them together with one write(). * Align tape buffer on page boundary to speed up tape write(). */ - for (i = 0; i <= MINIONS; i++) { + for (i = 0; i <= SLAVES; i++) { buf = (char *) malloc((unsigned)(reqsiz + writesize + pgoff + TP_BSIZE)); if (buf == NULL) return(0); - minions[i].tblock = (char (*)[TP_BSIZE]) + slaves[i].tblock = (char (*)[TP_BSIZE]) (((long)&buf[ntrec + 1] + pgoff) &~ pgoff); - minions[i].req = (struct req *)minions[i].tblock - ntrec - 1; + slaves[i].req = (struct req *)slaves[i].tblock - ntrec - 1; } - mlp = &minions[0]; - mlp->count = 1; - mlp->tapea = 0; - mlp->firstrec = 0; - nextblock = mlp->tblock; + slp = &slaves[0]; + slp->count = 1; + slp->tapea = 0; + slp->firstrec = 0; + nextblock = slp->tblock; return(1); } @@ -164,8 +164,8 @@ void writerec(char *dp, int isspcl) { - mlp->req[trecno].dblk = (ufs2_daddr_t)0; - mlp->req[trecno].count = 1; + slp->req[trecno].dblk = (ufs2_daddr_t)0; + slp->req[trecno].count = 1; /* Can't do a structure assignment due to alignment problems */ bcopy(dp, *(nextblock)++, sizeof (union u_spcl)); if (isspcl) @@ -185,8 +185,8 @@ dumpblock(ufs2_daddr_t blkno, int size) dblkno = fsbtodb(sblock, blkno); tpblks = size >> tp_bshift; while ((avail = MIN(tpblks, ntrec - trecno)) > 0) { - mlp->req[trecno].dblk = dblkno; - mlp->req[trecno].count = avail; + slp->req[trecno].dblk = dblkno; + slp->req[trecno].count = avail; trecno += avail; spcl.c_tapea += avail; if (trecno >= ntrec) @@ -232,27 +232,27 @@ flushtape(void) int i, blks, got; int64_t lastfirstrec; - int siz = (char *)nextblock - (char *)mlp->req; + int siz = (char *)nextblock - (char *)slp->req; - mlp->req[trecno].count = 0; /* Sentinel */ + slp->req[trecno].count = 0; /* Sentinel */ - if (atomic(write, mlp->fd, (char *)mlp->req, siz) != siz) + if (atomic(write, slp->fd, (char *)slp->req, siz) != siz) quit("error writing command pipe: %s\n", strerror(errno)); - mlp->sent = 1; /* we sent a request, read the response later */ + slp->sent = 1; /* we sent a request, read the response later */ - lastfirstrec = mlp->firstrec; + lastfirstrec = slp->firstrec; - if (++mlp >= &minions[MINIONS]) - mlp = &minions[0]; + if (++slp >= &slaves[SLAVES]) + slp = &slaves[0]; - /* Read results back from next minion */ - if (mlp->sent) { - if (atomic(read, mlp->fd, (char *)&got, sizeof got) + /* Read results back from next slave */ + if (slp->sent) { + if (atomic(read, slp->fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - mlp->sent = 0; + slp->sent = 0; /* Check for end of tape */ if (got < writesize) { @@ -262,15 +262,15 @@ flushtape(void) * Drain the results, don't care what the values were. * If we read them here then trewind won't... */ - for (i = 0; i < MINIONS; i++) { - if (minions[i].sent) { - if (atomic(read, minions[i].fd, + for (i = 0; i < SLAVES; i++) { + if (slaves[i].sent) { + if (atomic(read, slaves[i].fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - minions[i].sent = 0; + slaves[i].sent = 0; } } @@ -288,11 +288,11 @@ flushtape(void) if (spcl.c_addr[i] != 0) blks++; } - mlp->count = lastspclrec + blks + 1 - spcl.c_tapea; - mlp->tapea = spcl.c_tapea; - mlp->firstrec = lastfirstrec + ntrec; - mlp->inode = curino; - nextblock = mlp->tblock; + slp->count = lastspclrec + blks + 1 - spcl.c_tapea; + slp->tapea = spcl.c_tapea; + slp->firstrec = lastfirstrec + ntrec; + slp->inode = curino; + nextblock = slp->tblock; trecno = 0; asize += tenths; blockswritten += ntrec; @@ -312,7 +312,7 @@ trewind(void) int f; int got; - for (f = 0; f < MINIONS; f++) { + for (f = 0; f < SLAVES; f++) { /* * Drain the results, but unlike EOT we DO (or should) care * what the return values were, since if we detect EOT after @@ -321,22 +321,22 @@ trewind(void) * * fixme: punt for now. */ - if (minions[f].sent) { - if (atomic(read, minions[f].fd, (char *)&got, sizeof got) + if (slaves[f].sent) { + if (atomic(read, slaves[f].fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - minions[f].sent = 0; + slaves[f].sent = 0; if (got != writesize) { msg("EOT detected in last 2 tape records!\n"); msg("Use a longer tape, decrease the size estimate\n"); quit("or use no size estimate at all.\n"); } } - (void) close(minions[f].fd); + (void) close(slaves[f].fd); } - while (wait((int *)NULL) >= 0) /* wait for any signals from minions */ + while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ /* void */; if (pipeout) @@ -396,29 +396,29 @@ void rollforward(void) { struct req *p, *q, *prev; - struct minion *tmlp; + struct slave *tslp; int i, size, got; int64_t savedtapea; union u_spcl *ntb, *otb; - tmlp = &minions[MINIONS]; - ntb = (union u_spcl *)tmlp->tblock[1]; + tslp = &slaves[SLAVES]; + ntb = (union u_spcl *)tslp->tblock[1]; /* - * Each of the N minions should have requests that need to - * be replayed on the next tape. Use the extra minion buffers - * (minions[MINIONS]) to construct request lists to be sent to - * each minion in turn. + * Each of the N slaves should have requests that need to + * be replayed on the next tape. Use the extra slave buffers + * (slaves[SLAVES]) to construct request lists to be sent to + * each slave in turn. */ - for (i = 0; i < MINIONS; i++) { - q = &tmlp->req[1]; - otb = (union u_spcl *)mlp->tblock; + for (i = 0; i < SLAVES; i++) { + q = &tslp->req[1]; + otb = (union u_spcl *)slp->tblock; /* - * For each request in the current minion, copy it to tmlp. + * For each request in the current slave, copy it to tslp. */ prev = NULL; - for (p = mlp->req; p->count > 0; p += p->count) { + for (p = slp->req; p->count > 0; p += p->count) { *q = *p; if (p->dblk == 0) *ntb++ = *otb++; /* copy the datablock also */ @@ -433,26 +433,26 @@ rollforward(void) ntb--; q -= 1; q->count = 0; - q = &tmlp->req[0]; + q = &tslp->req[0]; if (i == 0) { q->dblk = 0; q->count = 1; trecno = 0; - nextblock = tmlp->tblock; + nextblock = tslp->tblock; savedtapea = spcl.c_tapea; - spcl.c_tapea = mlp->tapea; + spcl.c_tapea = slp->tapea; startnewtape(0); spcl.c_tapea = savedtapea; lastspclrec = savedtapea - 1; } size = (char *)ntb - (char *)q; - if (atomic(write, mlp->fd, (char *)q, size) != size) { + if (atomic(write, slp->fd, (char *)q, size) != size) { perror(" DUMP: error writing command pipe"); dumpabort(0); } - mlp->sent = 1; - if (++mlp >= &minions[MINIONS]) - mlp = &minions[0]; + slp->sent = 1; + if (++slp >= &slaves[SLAVES]) + slp = &slaves[0]; q->count = 1; @@ -464,34 +464,34 @@ rollforward(void) */ q->dblk = prev->dblk + prev->count * (TP_BSIZE / DEV_BSIZE); - ntb = (union u_spcl *)tmlp->tblock; + ntb = (union u_spcl *)tslp->tblock; } else { /* * It wasn't a disk block. Copy the data to its * new location in the buffer. */ q->dblk = 0; - *((union u_spcl *)tmlp->tblock) = *ntb; - ntb = (union u_spcl *)tmlp->tblock[1]; + *((union u_spcl *)tslp->tblock) = *ntb; + ntb = (union u_spcl *)tslp->tblock[1]; } } - mlp->req[0] = *q; - nextblock = mlp->tblock; + slp->req[0] = *q; + nextblock = slp->tblock; if (q->dblk == 0) nextblock++; trecno = 1; /* - * Clear the first minions' response. One hopes that it + * Clear the first slaves' response. One hopes that it * worked ok, otherwise the tape is much too short! */ - if (mlp->sent) { - if (atomic(read, mlp->fd, (char *)&got, sizeof got) + if (slp->sent) { + if (atomic(read, slp->fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - mlp->sent = 0; + slp->sent = 0; if (got != writesize) { quit("EOT detected at start of the tape!\n"); @@ -634,7 +634,7 @@ restore_check_point: } } - enminion(); /* Share open tape file descriptor with minions */ + enslave(); /* Share open tape file descriptor with slaves */ if (popenout) close(tapefd); /* Give up our copy of it. */ signal(SIGINFO, infosch); @@ -643,18 +643,18 @@ restore_check_point: blocksthisvol = 0; if (top) newtape++; /* new tape signal */ - spcl.c_count = mlp->count; + spcl.c_count = slp->count; /* * measure firstrec in TP_BSIZE units since restore doesn't * know the correct ntrec value... */ - spcl.c_firstrec = mlp->firstrec; + spcl.c_firstrec = slp->firstrec; spcl.c_volume++; spcl.c_type = TS_TAPE; - writeheader((ino_t)mlp->inode); + writeheader((ino_t)slp->inode); if (tapeno > 1) msg("Volume %d begins with blocks from inode %d\n", - tapeno, mlp->inode); + tapeno, slp->inode); } } @@ -687,7 +687,7 @@ Exit(status) } /* - * proceed - handler for SIGUSR2, used to synchronize IO between the minions. + * proceed - handler for SIGUSR2, used to synchronize IO between the slaves. */ void proceed(int signo __unused) @@ -699,45 +699,45 @@ proceed(int signo __unused) } void -enminion(void) +enslave(void) { int cmd[2]; int i, j; master = getpid(); - signal(SIGTERM, dumpabort); /* Minion sends SIGTERM on dumpabort() */ + signal(SIGTERM, dumpabort); /* Slave sends SIGTERM on dumpabort() */ signal(SIGPIPE, sigpipe); - signal(SIGUSR1, tperror); /* Minion sends SIGUSR1 on tape errors */ - signal(SIGUSR2, proceed); /* Minion sends SIGUSR2 to next minion */ + signal(SIGUSR1, tperror); /* Slave sends SIGUSR1 on tape errors */ + signal(SIGUSR2, proceed); /* Slave sends SIGUSR2 to next slave */ - for (i = 0; i < MINIONS; i++) { - if (i == mlp - &minions[0]) { + for (i = 0; i < SLAVES; i++) { + if (i == slp - &slaves[0]) { caught = 1; } else { caught = 0; } if (socketpair(AF_UNIX, SOCK_STREAM, 0, cmd) < 0 || - (minions[i].pid = fork()) < 0) - quit("too many minions, %d (recompile smaller): %s\n", + (slaves[i].pid = fork()) < 0) + quit("too many slaves, %d (recompile smaller): %s\n", i, strerror(errno)); - minions[i].fd = cmd[1]; - minions[i].sent = 0; - if (minions[i].pid == 0) { /* Minion starts up here */ + slaves[i].fd = cmd[1]; + slaves[i].sent = 0; + if (slaves[i].pid == 0) { /* Slave starts up here */ for (j = 0; j <= i; j++) - (void) close(minions[j].fd); + (void) close(slaves[j].fd); signal(SIGINT, SIG_IGN); /* Master handles this */ - dominion(cmd[0], i); + doslave(cmd[0], i); Exit(X_FINOK); } } - for (i = 0; i < MINIONS; i++) - (void) atomic(write, minions[i].fd, - (char *) &minions[(i + 1) % MINIONS].pid, - sizeof minions[0].pid); + for (i = 0; i < SLAVES; i++) + (void) atomic(write, slaves[i].fd, + (char *) &slaves[(i + 1) % SLAVES].pid, + sizeof slaves[0].pid); master = 0; } @@ -747,10 +747,10 @@ killall(void) { int i; - for (i = 0; i < MINIONS; i++) - if (minions[i].pid > 0) { - (void) kill(minions[i].pid, SIGKILL); - minions[i].sent = 0; + for (i = 0; i < SLAVES; i++) + if (slaves[i].pid > 0) { + (void) kill(slaves[i].pid, SIGKILL); + slaves[i].sent = 0; } } @@ -762,42 +762,42 @@ killall(void) * get the lock back for the next cycle by swapping descriptors. */ static void -dominion(int cmd, int minion_number) +doslave(int cmd, int slave_number) { int nread; - int nextminion, size, wrote, eot_count; + int nextslave, size, wrote, eot_count; /* * Need our own seek pointer. */ (void) close(diskfd); if ((diskfd = open(disk, O_RDONLY)) < 0) - quit("minion couldn't reopen disk: %s\n", strerror(errno)); + quit("slave couldn't reopen disk: %s\n", strerror(errno)); /* - * Need the pid of the next minion in the loop... + * Need the pid of the next slave in the loop... */ - if ((nread = atomic(read, cmd, (char *)&nextminion, sizeof nextminion)) - != sizeof nextminion) { - quit("master/minion protocol botched - didn't get pid of next minion.\n"); + if ((nread = atomic(read, cmd, (char *)&nextslave, sizeof nextslave)) + != sizeof nextslave) { + quit("master/slave protocol botched - didn't get pid of next slave.\n"); } /* * Get list of blocks to dump, read the blocks into tape buffer */ - while ((nread = atomic(read, cmd, (char *)mlp->req, reqsiz)) == reqsiz) { - struct req *p = mlp->req; + while ((nread = atomic(read, cmd, (char *)slp->req, reqsiz)) == reqsiz) { + struct req *p = slp->req; for (trecno = 0; trecno < ntrec; trecno += p->count, p += p->count) { if (p->dblk) { - blkread(p->dblk, mlp->tblock[trecno], + blkread(p->dblk, slp->tblock[trecno], p->count * TP_BSIZE); } else { if (p->count != 1 || atomic(read, cmd, - (char *)mlp->tblock[trecno], + (char *)slp->tblock[trecno], TP_BSIZE) != TP_BSIZE) - quit("master/minion protocol botched.\n"); + quit("master/slave protocol botched.\n"); } } if (setjmp(jmpbuf) == 0) { @@ -816,14 +816,14 @@ dominion(int cmd, int minion_number) while (eot_count < 10 && size < writesize) { #ifdef RDUMP if (host) - wrote = rmtwrite(mlp->tblock[0]+size, + wrote = rmtwrite(slp->tblock[0]+size, writesize-size); else #endif - wrote = write(tapefd, mlp->tblock[0]+size, + wrote = write(tapefd, slp->tblock[0]+size, writesize-size); #ifdef WRITEDEBUG - printf("minion %d wrote %d\n", minion_number, wrote); + printf("slave %d wrote %d\n", slave_number, wrote); #endif if (wrote < 0) break; @@ -834,8 +834,8 @@ dominion(int cmd, int minion_number) #ifdef WRITEDEBUG if (size != writesize) - printf("minion %d only wrote %d out of %d bytes and gave up.\n", - minion_number, size, writesize); + printf("slave %d only wrote %d out of %d bytes and gave up.\n", + slave_number, size, writesize); #endif /* @@ -862,10 +862,10 @@ dominion(int cmd, int minion_number) } /* - * If partial write, don't want next minion to go. + * If partial write, don't want next slave to go. * Also jolts him awake. */ - (void) kill(nextminion, SIGUSR2); + (void) kill(nextslave, SIGUSR2); } if (nread != 0) quit("error reading command pipe: %s\n", strerror(errno)); From owner-svn-src-all@freebsd.org Sat Jun 20 20:06:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7631332CF8; Sat, 20 Jun 2020 20:06:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6C55ck0z3VHq; Sat, 20 Jun 2020 20:06:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB8F61147E; Sat, 20 Jun 2020 20:06:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KK6vMI016597; Sat, 20 Jun 2020 20:06:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KK6qJA016572; Sat, 20 Jun 2020 20:06:52 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202006202006.05KK6qJA016572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Jun 2020 20:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362445 - in head: contrib/llvm-project contrib/llvm-project/clang/lib/Sema contrib/llvm-project/clang/lib/Tooling/Syntax contrib/llvm-project/clang/utils/TableGen contrib/llvm-project/... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm-project contrib/llvm-project/clang/lib/Sema contrib/llvm-project/clang/lib/Tooling/Syntax contrib/llvm-project/clang/utils/TableGen contrib/llvm-project/lld/COFF contrib/llvm-pro... X-SVN-Commit-Revision: 362445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:06:57 -0000 Author: dim Date: Sat Jun 20 20:06:52 2020 New Revision: 362445 URL: https://svnweb.freebsd.org/changeset/base/362445 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-97-g6f71678ecd2 (not quite 10.0.1 rc2, as more fixes are still pending). MFC after: 3 weeks Added: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td - copied unchanged from r362443, vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td Modified: head/contrib/llvm-project/FREEBSD-Xlist head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp head/contrib/llvm-project/clang/utils/TableGen/ClangAttrEmitter.cpp head/contrib/llvm-project/lld/COFF/Chunks.h head/contrib/llvm-project/lld/COFF/DLL.cpp head/contrib/llvm-project/lld/ELF/ScriptLexer.cpp head/contrib/llvm-project/lld/ELF/ScriptParser.cpp head/contrib/llvm-project/llvm/include/llvm/Support/AArch64TargetParser.def head/contrib/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA53.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA57.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedCyclone.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedFalkor.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedKryo.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64Subtarget.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64Subtarget.h head/contrib/llvm-project/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm-project/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp head/lib/clang/include/VCSVersion.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/llvm/ (props changed) Modified: head/contrib/llvm-project/FREEBSD-Xlist ============================================================================== --- head/contrib/llvm-project/FREEBSD-Xlist Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/FREEBSD-Xlist Sat Jun 20 20:06:52 2020 (r362445) @@ -531,6 +531,7 @@ llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt +llvm/lib/Extensions/ llvm/lib/Frontend/CMakeLists.txt llvm/lib/Frontend/LLVMBuild.txt llvm/lib/Frontend/OpenMP/CMakeLists.txt Modified: head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -3817,6 +3817,9 @@ TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgsIn, SourceLocation RAngleLoc) { + if (SS.isInvalid()) + return TypeResult(true); + TemplateName Template = TemplateD.get(); // Translate the parser's template argument list in our AST format. @@ -5925,7 +5928,9 @@ bool UnnamedLocalNoLinkageFinder::VisitDependentNameTy bool UnnamedLocalNoLinkageFinder::VisitDependentTemplateSpecializationType( const DependentTemplateSpecializationType* T) { - return VisitNestedNameSpecifier(T->getQualifier()); + if (auto *Q = T->getQualifier()) + return VisitNestedNameSpecifier(Q); + return false; } bool UnnamedLocalNoLinkageFinder::VisitPackExpansionType( @@ -5979,6 +5984,7 @@ bool UnnamedLocalNoLinkageFinder::VisitTagDecl(const T bool UnnamedLocalNoLinkageFinder::VisitNestedNameSpecifier( NestedNameSpecifier *NNS) { + assert(NNS); if (NNS->getPrefix() && VisitNestedNameSpecifier(NNS->getPrefix())) return true; Modified: head/contrib/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -335,14 +335,38 @@ class TokenCollector::CollectPPExpansions : public PPC SourceRange Range, const MacroArgs *Args) override { if (!Collector) return; - // Only record top-level expansions, not those where: + const auto &SM = Collector->PP.getSourceManager(); + // Only record top-level expansions that directly produce expanded tokens. + // This excludes those where: // - the macro use is inside a macro body, // - the macro appears in an argument to another macro. - if (!MacroNameTok.getLocation().isFileID() || - (LastExpansionEnd.isValid() && - Collector->PP.getSourceManager().isBeforeInTranslationUnit( - Range.getBegin(), LastExpansionEnd))) + // However macro expansion isn't really a tree, it's token rewrite rules, + // so there are other cases, e.g. + // #define B(X) X + // #define A 1 + B + // A(2) + // Both A and B produce expanded tokens, though the macro name 'B' comes + // from an expansion. The best we can do is merge the mappings for both. + + // The *last* token of any top-level macro expansion must be in a file. + // (In the example above, see the closing paren of the expansion of B). + if (!Range.getEnd().isFileID()) return; + // If there's a current expansion that encloses this one, this one can't be + // top-level. + if (LastExpansionEnd.isValid() && + !SM.isBeforeInTranslationUnit(LastExpansionEnd, Range.getEnd())) + return; + + // If the macro invocation (B) starts in a macro (A) but ends in a file, + // we'll create a merged mapping for A + B by overwriting the endpoint for + // A's startpoint. + if (!Range.getBegin().isFileID()) { + Range.setBegin(SM.getExpansionLoc(Range.getBegin())); + assert(Collector->Expansions.count(Range.getBegin().getRawEncoding()) && + "Overlapping macros should have same expansion location"); + } + Collector->Expansions[Range.getBegin().getRawEncoding()] = Range.getEnd(); LastExpansionEnd = Range.getEnd(); } @@ -399,197 +423,167 @@ class TokenCollector::Builder { (public) } TokenBuffer build() && { - buildSpelledTokens(); - - // Walk over expanded tokens and spelled tokens in parallel, building the - // mappings between those using source locations. - // To correctly recover empty macro expansions, we also take locations - // reported to PPCallbacks::MacroExpands into account as we do not have any - // expanded tokens with source locations to guide us. - - // The 'eof' token is special, it is not part of spelled token stream. We - // handle it separately at the end. assert(!Result.ExpandedTokens.empty()); assert(Result.ExpandedTokens.back().kind() == tok::eof); - for (unsigned I = 0; I < Result.ExpandedTokens.size() - 1; ++I) { - // (!) I might be updated by the following call. - processExpandedToken(I); - } - // 'eof' not handled in the loop, do it here. - assert(SM.getMainFileID() == - SM.getFileID(Result.ExpandedTokens.back().location())); - fillGapUntil(Result.Files[SM.getMainFileID()], - Result.ExpandedTokens.back().location(), - Result.ExpandedTokens.size() - 1); - Result.Files[SM.getMainFileID()].EndExpanded = Result.ExpandedTokens.size(); + // Tokenize every file that contributed tokens to the expanded stream. + buildSpelledTokens(); - // Some files might have unaccounted spelled tokens at the end, add an empty - // mapping for those as they did not have expanded counterparts. - fillGapsAtEndOfFiles(); + // The expanded token stream consists of runs of tokens that came from + // the same source (a macro expansion, part of a file etc). + // Between these runs are the logical positions of spelled tokens that + // didn't expand to anything. + while (NextExpanded < Result.ExpandedTokens.size() - 1 /* eof */) { + // Create empty mappings for spelled tokens that expanded to nothing here. + // May advance NextSpelled, but NextExpanded is unchanged. + discard(); + // Create mapping for a contiguous run of expanded tokens. + // Advances NextExpanded past the run, and NextSpelled accordingly. + unsigned OldPosition = NextExpanded; + advance(); + if (NextExpanded == OldPosition) + diagnoseAdvanceFailure(); + } + // If any tokens remain in any of the files, they didn't expand to anything. + // Create empty mappings up until the end of the file. + for (const auto &File : Result.Files) + discard(File.first); return std::move(Result); } private: - /// Process the next token in an expanded stream and move corresponding - /// spelled tokens, record any mapping if needed. - /// (!) \p I will be updated if this had to skip tokens, e.g. for macros. - void processExpandedToken(unsigned &I) { - auto L = Result.ExpandedTokens[I].location(); - if (L.isMacroID()) { - processMacroExpansion(SM.getExpansionRange(L), I); - return; - } - if (L.isFileID()) { - auto FID = SM.getFileID(L); - TokenBuffer::MarkedFile &File = Result.Files[FID]; + // Consume a sequence of spelled tokens that didn't expand to anything. + // In the simplest case, skips spelled tokens until finding one that produced + // the NextExpanded token, and creates an empty mapping for them. + // If Drain is provided, skips remaining tokens from that file instead. + void discard(llvm::Optional Drain = llvm::None) { + SourceLocation Target = + Drain ? SM.getLocForEndOfFile(*Drain) + : SM.getExpansionLoc( + Result.ExpandedTokens[NextExpanded].location()); + FileID File = SM.getFileID(Target); + const auto &SpelledTokens = Result.Files[File].SpelledTokens; + auto &NextSpelled = this->NextSpelled[File]; - fillGapUntil(File, L, I); + TokenBuffer::Mapping Mapping; + Mapping.BeginSpelled = NextSpelled; + // When dropping trailing tokens from a file, the empty mapping should + // be positioned within the file's expanded-token range (at the end). + Mapping.BeginExpanded = Mapping.EndExpanded = + Drain ? Result.Files[*Drain].EndExpanded : NextExpanded; + // We may want to split into several adjacent empty mappings. + // FlushMapping() emits the current mapping and starts a new one. + auto FlushMapping = [&, this] { + Mapping.EndSpelled = NextSpelled; + if (Mapping.BeginSpelled != Mapping.EndSpelled) + Result.Files[File].Mappings.push_back(Mapping); + Mapping.BeginSpelled = NextSpelled; + }; - // Skip the token. - assert(File.SpelledTokens[NextSpelled[FID]].location() == L && - "no corresponding token in the spelled stream"); - ++NextSpelled[FID]; - return; + while (NextSpelled < SpelledTokens.size() && + SpelledTokens[NextSpelled].location() < Target) { + // If we know mapping bounds at [NextSpelled, KnownEnd] (macro expansion) + // then we want to partition our (empty) mapping. + // [Start, NextSpelled) [NextSpelled, KnownEnd] (KnownEnd, Target) + SourceLocation KnownEnd = CollectedExpansions.lookup( + SpelledTokens[NextSpelled].location().getRawEncoding()); + if (KnownEnd.isValid()) { + FlushMapping(); // Emits [Start, NextSpelled) + while (NextSpelled < SpelledTokens.size() && + SpelledTokens[NextSpelled].location() <= KnownEnd) + ++NextSpelled; + FlushMapping(); // Emits [NextSpelled, KnownEnd] + // Now the loop contitues and will emit (KnownEnd, Target). + } else { + ++NextSpelled; + } } + FlushMapping(); } - /// Skipped expanded and spelled tokens of a macro expansion that covers \p - /// SpelledRange. Add a corresponding mapping. - /// (!) \p I will be the index of the last token in an expansion after this - /// function returns. - void processMacroExpansion(CharSourceRange SpelledRange, unsigned &I) { - auto FID = SM.getFileID(SpelledRange.getBegin()); - assert(FID == SM.getFileID(SpelledRange.getEnd())); - TokenBuffer::MarkedFile &File = Result.Files[FID]; + // Consumes the NextExpanded token and others that are part of the same run. + // Increases NextExpanded and NextSpelled by at least one, and adds a mapping + // (unless this is a run of file tokens, which we represent with no mapping). + void advance() { + const syntax::Token &Tok = Result.ExpandedTokens[NextExpanded]; + SourceLocation Expansion = SM.getExpansionLoc(Tok.location()); + FileID File = SM.getFileID(Expansion); + const auto &SpelledTokens = Result.Files[File].SpelledTokens; + auto &NextSpelled = this->NextSpelled[File]; - fillGapUntil(File, SpelledRange.getBegin(), I); + if (Tok.location().isFileID()) { + // A run of file tokens continues while the expanded/spelled tokens match. + while (NextSpelled < SpelledTokens.size() && + NextExpanded < Result.ExpandedTokens.size() && + SpelledTokens[NextSpelled].location() == + Result.ExpandedTokens[NextExpanded].location()) { + ++NextSpelled; + ++NextExpanded; + } + // We need no mapping for file tokens copied to the expanded stream. + } else { + // We found a new macro expansion. We should have its spelling bounds. + auto End = CollectedExpansions.lookup(Expansion.getRawEncoding()); + assert(End.isValid() && "Macro expansion wasn't captured?"); - // Skip all expanded tokens from the same macro expansion. - unsigned BeginExpanded = I; - for (; I + 1 < Result.ExpandedTokens.size(); ++I) { - auto NextL = Result.ExpandedTokens[I + 1].location(); - if (!NextL.isMacroID() || - SM.getExpansionLoc(NextL) != SpelledRange.getBegin()) - break; + // Mapping starts here... + TokenBuffer::Mapping Mapping; + Mapping.BeginExpanded = NextExpanded; + Mapping.BeginSpelled = NextSpelled; + // ... consumes spelled tokens within bounds we captured ... + while (NextSpelled < SpelledTokens.size() && + SpelledTokens[NextSpelled].location() <= End) + ++NextSpelled; + // ... consumes expanded tokens rooted at the same expansion ... + while (NextExpanded < Result.ExpandedTokens.size() && + SM.getExpansionLoc( + Result.ExpandedTokens[NextExpanded].location()) == Expansion) + ++NextExpanded; + // ... and ends here. + Mapping.EndExpanded = NextExpanded; + Mapping.EndSpelled = NextSpelled; + Result.Files[File].Mappings.push_back(Mapping); } - unsigned EndExpanded = I + 1; - consumeMapping(File, SM.getFileOffset(SpelledRange.getEnd()), BeginExpanded, - EndExpanded, NextSpelled[FID]); } + // advance() is supposed to consume at least one token - if not, we crash. + void diagnoseAdvanceFailure() { +#ifndef NDEBUG + // Show the failed-to-map token in context. + for (unsigned I = (NextExpanded < 10) ? 0 : NextExpanded - 10; + I < NextExpanded + 5 && I < Result.ExpandedTokens.size(); ++I) { + const char *L = + (I == NextExpanded) ? "!! " : (I < NextExpanded) ? "ok " : " "; + llvm::errs() << L << Result.ExpandedTokens[I].dumpForTests(SM) << "\n"; + } +#endif + llvm_unreachable("Couldn't map expanded token to spelled tokens!"); + } + /// Initializes TokenBuffer::Files and fills spelled tokens and expanded /// ranges for each of the files. void buildSpelledTokens() { for (unsigned I = 0; I < Result.ExpandedTokens.size(); ++I) { - auto FID = - SM.getFileID(SM.getExpansionLoc(Result.ExpandedTokens[I].location())); + const auto &Tok = Result.ExpandedTokens[I]; + auto FID = SM.getFileID(SM.getExpansionLoc(Tok.location())); auto It = Result.Files.try_emplace(FID); TokenBuffer::MarkedFile &File = It.first->second; - File.EndExpanded = I + 1; + // The eof token should not be considered part of the main-file's range. + File.EndExpanded = Tok.kind() == tok::eof ? I : I + 1; + if (!It.second) continue; // we have seen this file before. - // This is the first time we see this file. File.BeginExpanded = I; File.SpelledTokens = tokenize(FID, SM, LangOpts); } } - void consumeEmptyMapping(TokenBuffer::MarkedFile &File, unsigned EndOffset, - unsigned ExpandedIndex, unsigned &SpelledIndex) { - consumeMapping(File, EndOffset, ExpandedIndex, ExpandedIndex, SpelledIndex); - } - - /// Consumes spelled tokens that form a macro expansion and adds a entry to - /// the resulting token buffer. - /// (!) SpelledIndex is updated in-place. - void consumeMapping(TokenBuffer::MarkedFile &File, unsigned EndOffset, - unsigned BeginExpanded, unsigned EndExpanded, - unsigned &SpelledIndex) { - // We need to record this mapping before continuing. - unsigned MappingBegin = SpelledIndex; - ++SpelledIndex; - - bool HitMapping = - tryConsumeSpelledUntil(File, EndOffset + 1, SpelledIndex).hasValue(); - (void)HitMapping; - assert(!HitMapping && "recursive macro expansion?"); - - TokenBuffer::Mapping M; - M.BeginExpanded = BeginExpanded; - M.EndExpanded = EndExpanded; - M.BeginSpelled = MappingBegin; - M.EndSpelled = SpelledIndex; - - File.Mappings.push_back(M); - } - - /// Consumes spelled tokens until location \p L is reached and adds a mapping - /// covering the consumed tokens. The mapping will point to an empty expanded - /// range at position \p ExpandedIndex. - void fillGapUntil(TokenBuffer::MarkedFile &File, SourceLocation L, - unsigned ExpandedIndex) { - assert(L.isFileID()); - FileID FID; - unsigned Offset; - std::tie(FID, Offset) = SM.getDecomposedLoc(L); - - unsigned &SpelledIndex = NextSpelled[FID]; - unsigned MappingBegin = SpelledIndex; - while (true) { - auto EndLoc = tryConsumeSpelledUntil(File, Offset, SpelledIndex); - if (SpelledIndex != MappingBegin) { - TokenBuffer::Mapping M; - M.BeginSpelled = MappingBegin; - M.EndSpelled = SpelledIndex; - M.BeginExpanded = M.EndExpanded = ExpandedIndex; - File.Mappings.push_back(M); - } - if (!EndLoc) - break; - consumeEmptyMapping(File, SM.getFileOffset(*EndLoc), ExpandedIndex, - SpelledIndex); - - MappingBegin = SpelledIndex; - } - }; - - /// Consumes spelled tokens until it reaches Offset or a mapping boundary, - /// i.e. a name of a macro expansion or the start '#' token of a PP directive. - /// (!) NextSpelled is updated in place. - /// - /// returns None if \p Offset was reached, otherwise returns the end location - /// of a mapping that starts at \p NextSpelled. - llvm::Optional - tryConsumeSpelledUntil(TokenBuffer::MarkedFile &File, unsigned Offset, - unsigned &NextSpelled) { - for (; NextSpelled < File.SpelledTokens.size(); ++NextSpelled) { - auto L = File.SpelledTokens[NextSpelled].location(); - if (Offset <= SM.getFileOffset(L)) - return llvm::None; // reached the offset we are looking for. - auto Mapping = CollectedExpansions.find(L.getRawEncoding()); - if (Mapping != CollectedExpansions.end()) - return Mapping->second; // found a mapping before the offset. - } - return llvm::None; // no more tokens, we "reached" the offset. - } - - /// Adds empty mappings for unconsumed spelled tokens at the end of each file. - void fillGapsAtEndOfFiles() { - for (auto &F : Result.Files) { - if (F.second.SpelledTokens.empty()) - continue; - fillGapUntil(F.second, F.second.SpelledTokens.back().endLocation(), - F.second.EndExpanded); - } - } - TokenBuffer Result; - /// For each file, a position of the next spelled token we will consume. - llvm::DenseMap NextSpelled; + unsigned NextExpanded = 0; // cursor in ExpandedTokens + llvm::DenseMap NextSpelled; // cursor in SpelledTokens PPExpansions CollectedExpansions; const SourceManager &SM; const LangOptions &LangOpts; Modified: head/contrib/llvm-project/clang/utils/TableGen/ClangAttrEmitter.cpp ============================================================================== --- head/contrib/llvm-project/clang/utils/TableGen/ClangAttrEmitter.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/clang/utils/TableGen/ClangAttrEmitter.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -2825,6 +2825,7 @@ void EmitClangAttrPCHRead(RecordKeeper &Records, raw_o if (R.isSubClassOf(InhClass)) OS << " bool isInherited = Record.readInt();\n"; OS << " bool isImplicit = Record.readInt();\n"; + OS << " bool isPackExpansion = Record.readInt();\n"; ArgRecords = R.getValueAsListOfDefs("Args"); Args.clear(); for (const auto *Arg : ArgRecords) { @@ -2840,6 +2841,7 @@ void EmitClangAttrPCHRead(RecordKeeper &Records, raw_o if (R.isSubClassOf(InhClass)) OS << " cast(New)->setInherited(isInherited);\n"; OS << " New->setImplicit(isImplicit);\n"; + OS << " New->setPackExpansion(isPackExpansion);\n"; OS << " break;\n"; OS << " }\n"; } @@ -2866,6 +2868,7 @@ void EmitClangAttrPCHWrite(RecordKeeper &Records, raw_ if (R.isSubClassOf(InhClass)) OS << " Record.push_back(SA->isInherited());\n"; OS << " Record.push_back(A->isImplicit());\n"; + OS << " Record.push_back(A->isPackExpansion());\n"; for (const auto *Arg : Args) createArgument(*Arg, R.getName())->writePCHWrite(OS); Modified: head/contrib/llvm-project/lld/COFF/Chunks.h ============================================================================== --- head/contrib/llvm-project/lld/COFF/Chunks.h Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/lld/COFF/Chunks.h Sat Jun 20 20:06:52 2020 (r362445) @@ -486,7 +486,9 @@ class ImportThunkChunkX86 : public ImportThunkChunk { class ImportThunkChunkARM : public ImportThunkChunk { public: - explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) {} + explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) { + setAlignment(2); + } size_t getSize() const override { return sizeof(importThunkARM); } void getBaserels(std::vector *res) override; void writeTo(uint8_t *buf) const override; @@ -494,14 +496,16 @@ class ImportThunkChunkARM : public ImportThunkChunk { class ImportThunkChunkARM64 : public ImportThunkChunk { public: - explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) {} + explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) { + setAlignment(4); + } size_t getSize() const override { return sizeof(importThunkARM64); } void writeTo(uint8_t *buf) const override; }; class RangeExtensionThunkARM : public NonSectionChunk { public: - explicit RangeExtensionThunkARM(Defined *t) : target(t) {} + explicit RangeExtensionThunkARM(Defined *t) : target(t) { setAlignment(2); } size_t getSize() const override; void writeTo(uint8_t *buf) const override; Modified: head/contrib/llvm-project/lld/COFF/DLL.cpp ============================================================================== --- head/contrib/llvm-project/lld/COFF/DLL.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/lld/COFF/DLL.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -365,7 +365,9 @@ class TailMergeChunkX86 : public NonSectionChunk { (pu class ThunkChunkARM : public NonSectionChunk { public: - ThunkChunkARM(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) {} + ThunkChunkARM(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) { + setAlignment(2); + } size_t getSize() const override { return sizeof(thunkARM); } @@ -385,7 +387,9 @@ class ThunkChunkARM : public NonSectionChunk { (public class TailMergeChunkARM : public NonSectionChunk { public: - TailMergeChunkARM(Chunk *d, Defined *h) : desc(d), helper(h) {} + TailMergeChunkARM(Chunk *d, Defined *h) : desc(d), helper(h) { + setAlignment(2); + } size_t getSize() const override { return sizeof(tailMergeARM); } @@ -405,7 +409,9 @@ class TailMergeChunkARM : public NonSectionChunk { (pu class ThunkChunkARM64 : public NonSectionChunk { public: - ThunkChunkARM64(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) {} + ThunkChunkARM64(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) { + setAlignment(4); + } size_t getSize() const override { return sizeof(thunkARM64); } @@ -422,7 +428,9 @@ class ThunkChunkARM64 : public NonSectionChunk { (publ class TailMergeChunkARM64 : public NonSectionChunk { public: - TailMergeChunkARM64(Chunk *d, Defined *h) : desc(d), helper(h) {} + TailMergeChunkARM64(Chunk *d, Defined *h) : desc(d), helper(h) { + setAlignment(4); + } size_t getSize() const override { return sizeof(tailMergeARM64); } Modified: head/contrib/llvm-project/lld/ELF/ScriptLexer.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/ScriptLexer.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/lld/ELF/ScriptLexer.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -52,6 +52,8 @@ StringRef ScriptLexer::getLine() { // Returns 1-based line number of the current token. size_t ScriptLexer::getLineNumber() { + if (pos == 0) + return 1; StringRef s = getCurrentMB().getBuffer(); StringRef tok = tokens[pos - 1]; return s.substr(0, tok.data() - s.data()).count('\n') + 1; @@ -292,7 +294,9 @@ static bool encloses(StringRef s, StringRef t) { MemoryBufferRef ScriptLexer::getCurrentMB() { // Find input buffer containing the current token. - assert(!mbs.empty() && pos > 0); + assert(!mbs.empty()); + if (pos == 0) + return mbs.back(); for (MemoryBufferRef mb : mbs) if (encloses(mb.getBuffer(), tokens[pos - 1])) return mb; Modified: head/contrib/llvm-project/lld/ELF/ScriptParser.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/ScriptParser.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/lld/ELF/ScriptParser.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -737,6 +737,7 @@ bool ScriptParser::readSectionDirective(OutputSection expect("("); if (consume("NOLOAD")) { cmd->noload = true; + cmd->type = SHT_NOBITS; } else { skip(); // This is "COPY", "INFO" or "OVERLAY". cmd->nonAlloc = true; Modified: head/contrib/llvm-project/llvm/include/llvm/Support/AArch64TargetParser.def ============================================================================== --- head/contrib/llvm-project/llvm/include/llvm/Support/AArch64TargetParser.def Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/include/llvm/Support/AArch64TargetParser.def Sat Jun 20 20:06:52 2020 (r362445) @@ -152,6 +152,10 @@ AARCH64_CPU_NAME("kryo", ARMV8A, FK_CRYPTO_NEON_FP_ARM (AArch64::AEK_CRC)) AARCH64_CPU_NAME("thunderx2t99", ARMV8_1A, FK_CRYPTO_NEON_FP_ARMV8, false, (AArch64::AEK_NONE)) +AARCH64_CPU_NAME("thunderx3t110", ARMV8_3A, FK_CRYPTO_NEON_FP_ARMV8, false, + (AArch64::AEK_CRC | AEK_CRYPTO | AEK_FP | AEK_SIMD | + AEK_LSE | AEK_RAND | AArch64::AEK_PROFILE | + AArch64::AEK_RAS)) AARCH64_CPU_NAME("thunderx", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, (AArch64::AEK_CRC | AArch64::AEK_PROFILE)) AARCH64_CPU_NAME("thunderxt88", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, Modified: head/contrib/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -963,10 +963,10 @@ bool BranchFolder::TryTailMergeBlocks(MachineBasicBloc continue; } - // If one of the blocks is the entire common tail (and not the entry - // block, which we can't jump to), we can treat all blocks with this same - // tail at once. Use PredBB if that is one of the possibilities, as that - // will not introduce any extra branches. + // If one of the blocks is the entire common tail (and is not the entry + // block/an EH pad, which we can't jump to), we can treat all blocks with + // this same tail at once. Use PredBB if that is one of the possibilities, + // as that will not introduce any extra branches. MachineBasicBlock *EntryBB = &MergePotentials.front().getBlock()->getParent()->front(); unsigned commonTailIndex = SameTails.size(); @@ -974,19 +974,21 @@ bool BranchFolder::TryTailMergeBlocks(MachineBasicBloc // into the other. if (SameTails.size() == 2 && SameTails[0].getBlock()->isLayoutSuccessor(SameTails[1].getBlock()) && - SameTails[1].tailIsWholeBlock()) + SameTails[1].tailIsWholeBlock() && !SameTails[1].getBlock()->isEHPad()) commonTailIndex = 1; else if (SameTails.size() == 2 && SameTails[1].getBlock()->isLayoutSuccessor( - SameTails[0].getBlock()) && - SameTails[0].tailIsWholeBlock()) + SameTails[0].getBlock()) && + SameTails[0].tailIsWholeBlock() && + !SameTails[0].getBlock()->isEHPad()) commonTailIndex = 0; else { // Otherwise just pick one, favoring the fall-through predecessor if // there is one. for (unsigned i = 0, e = SameTails.size(); i != e; ++i) { MachineBasicBlock *MBB = SameTails[i].getBlock(); - if (MBB == EntryBB && SameTails[i].tailIsWholeBlock()) + if ((MBB == EntryBB || MBB->isEHPad()) && + SameTails[i].tailIsWholeBlock()) continue; if (MBB == PredBB) { commonTailIndex = i; Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td Sat Jun 20 20:06:52 2020 (r362445) @@ -443,6 +443,10 @@ def SVEUnsupported : AArch64Unsupported { HasSVE2BitPerm]; } +def PAUnsupported : AArch64Unsupported { + let F = [HasPA]; +} + include "AArch64SchedA53.td" include "AArch64SchedA57.td" include "AArch64SchedCyclone.td" @@ -453,6 +457,7 @@ include "AArch64SchedExynosM4.td" include "AArch64SchedExynosM5.td" include "AArch64SchedThunderX.td" include "AArch64SchedThunderX2T99.td" +include "AArch64SchedThunderX3T110.td" def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35", "Cortex-A35 ARM processors", [ @@ -780,6 +785,25 @@ def ProcThunderX2T99 : SubtargetFeature<"thunderx2t99 FeatureLSE, HasV8_1aOps]>; +def ProcThunderX3T110 : SubtargetFeature<"thunderx3t110", "ARMProcFamily", + "ThunderX3T110", + "Marvell ThunderX3 processors", [ + FeatureAggressiveFMA, + FeatureCRC, + FeatureCrypto, + FeatureFPARMv8, + FeatureArithmeticBccFusion, + FeatureNEON, + FeaturePostRAScheduler, + FeaturePredictableSelectIsExpensive, + FeatureLSE, + FeaturePA, + FeatureUseAA, + FeatureBalanceFPOps, + FeaturePerfMon, + FeatureStrictAlign, + HasV8_3aOps]>; + def ProcThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX", "Cavium ThunderX processors", [ FeatureCRC, @@ -878,6 +902,8 @@ def : ProcessorModel<"thunderxt81", ThunderXT8XModel, def : ProcessorModel<"thunderxt83", ThunderXT8XModel, [ProcThunderXT83]>; // Cavium ThunderX2T9X Processors. Formerly Broadcom Vulcan. def : ProcessorModel<"thunderx2t99", ThunderX2T99Model, [ProcThunderX2T99]>; +// Marvell ThunderX3T110 Processors. +def : ProcessorModel<"thunderx3t110", ThunderX3T110Model, [ProcThunderX3T110]>; // FIXME: HiSilicon TSV110 is currently modeled as a Cortex-A57. def : ProcessorModel<"tsv110", CortexA57Model, [ProcTSV110]>; Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp Sat Jun 20 20:06:52 2020 (r362445) @@ -118,9 +118,15 @@ void AArch64BranchTargets::addBTI(MachineBasicBlock &M auto MBBI = MBB.begin(); - // PACI[AB]SP are implicitly BTI JC, so no BTI instruction needed there. - if (MBBI != MBB.end() && (MBBI->getOpcode() == AArch64::PACIASP || - MBBI->getOpcode() == AArch64::PACIBSP)) + // Skip the meta instuctions, those will be removed anyway. + for (; MBBI != MBB.end() && MBBI->isMetaInstruction(); ++MBBI) + ; + + // SCTLR_EL1.BT[01] is set to 0 by default which means + // PACI[AB]SP are implicitly BTI C so no BTI C instruction is needed there. + if (MBBI != MBB.end() && HintNum == 34 && + (MBBI->getOpcode() == AArch64::PACIASP || + MBBI->getOpcode() == AArch64::PACIBSP)) return; BuildMI(MBB, MBB.begin(), MBB.findDebugLoc(MBB.begin()), Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA53.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA53.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA53.td Sat Jun 20 20:06:52 2020 (r362445) @@ -26,7 +26,8 @@ def CortexA53Model : SchedMachineModel { // v 1.0 Spreadsheet let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA57.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA57.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA57.td Sat Jun 20 20:06:52 2020 (r362445) @@ -31,7 +31,8 @@ def CortexA57Model : SchedMachineModel { let LoopMicroOpBufferSize = 16; let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedCyclone.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedCyclone.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedCyclone.td Sat Jun 20 20:06:52 2020 (r362445) @@ -18,7 +18,8 @@ def CycloneModel : SchedMachineModel { let MispredictPenalty = 16; // 14-19 cycles are typical. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td Sat Jun 20 20:06:52 2020 (r362445) @@ -24,7 +24,8 @@ def ExynosM3Model : SchedMachineModel { let MispredictPenalty = 16; // Minimum branch misprediction penalty. let CompleteModel = 1; // Use the default model otherwise. - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Sat Jun 20 20:06:52 2020 (r362445) @@ -24,7 +24,8 @@ def ExynosM4Model : SchedMachineModel { let MispredictPenalty = 16; // Minimum branch misprediction penalty. let CompleteModel = 1; // Use the default model otherwise. - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td Sat Jun 20 20:06:52 2020 (r362445) @@ -24,7 +24,8 @@ def ExynosM5Model : SchedMachineModel { let MispredictPenalty = 15; // Minimum branch misprediction penalty. let CompleteModel = 1; // Use the default model otherwise. - list UnsupportedFeatures = SVEUnsupported.F; + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); } //===----------------------------------------------------------------------===// Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedFalkor.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedFalkor.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedFalkor.td Sat Jun 20 20:06:52 2020 (r362445) @@ -23,8 +23,8 @@ def FalkorModel : SchedMachineModel { let MispredictPenalty = 11; // Minimum branch misprediction penalty. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedKryo.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedKryo.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedKryo.td Sat Jun 20 20:06:52 2020 (r362445) @@ -27,8 +27,8 @@ def KryoModel : SchedMachineModel { let LoopMicroOpBufferSize = 16; let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX.td Sat Jun 20 20:06:52 2020 (r362445) @@ -25,8 +25,8 @@ def ThunderXT8XModel : SchedMachineModel { let PostRAScheduler = 1; // Use PostRA scheduler. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td Sat Jun 20 20:06:14 2020 (r362444) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td Sat Jun 20 20:06:52 2020 (r362445) @@ -25,8 +25,8 @@ def ThunderX2T99Model : SchedMachineModel { let PostRAScheduler = 1; // Using PostRA sched. let CompleteModel = 1; - list UnsupportedFeatures = SVEUnsupported.F; - + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); // FIXME: Remove when all errors have been fixed. let FullInstRWOverlapCheck = 0; } Copied: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td (from r362443, vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td Sat Jun 20 20:06:52 2020 (r362445, copy of r362443, vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td) @@ -0,0 +1,1997 @@ +//=- AArch64SchedThunderX3T110.td - Marvell ThunderX3 T110 ---*- tablegen -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file defines the scheduling model for Marvell ThunderX3T110 +// family of processors. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Pipeline Description. + +def ThunderX3T110Model : SchedMachineModel { + let IssueWidth = 4; // 4 micro-ops dispatched at a time. + let MicroOpBufferSize = 70; // 70 entries in micro-op re-order buffer. + let LoadLatency = 4; // Optimistic load latency. + let MispredictPenalty = 12; // Extra cycles for mispredicted branch. + // Determined via a mix of micro-arch details and experimentation. + let LoopMicroOpBufferSize = 128; // FIXME: might be much bigger in TX3. + let PostRAScheduler = 1; // Using PostRA sched. + let CompleteModel = 1; + + list UnsupportedFeatures = !listconcat(SVEUnsupported.F, + PAUnsupported.F); + // FIXME: Remove when all errors have been fixed. + let FullInstRWOverlapCheck = 0; +} + +let SchedModel = ThunderX3T110Model in { + +// Issue ports. + +// Port 0: ALU. +def THX3T110P0 : ProcResource<1>; + +// Port 1: ALU. +def THX3T110P1 : ProcResource<1>; + +// Port 2: ALU/Branch. +def THX3T110P2 : ProcResource<1>; + +// Port 3: ALU/Branch. +def THX3T110P3 : ProcResource<1>; + +// Port 4: Load/Store. +def THX3T110P4 : ProcResource<1>; + +// Port 5: Load/store. +def THX3T110P5 : ProcResource<1>; + +// Port 6: FP/Neon/SIMD/Crypto. +def THX3T110P6FP0 : ProcResource<1>; + +// Port 7: FP/Neon/SIMD/Crypto. +def THX3T110P7FP1 : ProcResource<1>; + +// Port 8: FP/Neon/SIMD/Crypto. +def THX3T110P8FP2 : ProcResource<1>; + +// Port 9: FP/Neon/SIMD/Crypto. +def THX3T110P9FP3 : ProcResource<1>; + +// Port 10: Store Data Unit. +def THX3T110SD0 : ProcResource<1>; + +// Define groups for the functional units on each issue port. Each group +// created will be used by a WriteRes. + +// Integer divide/mulhi micro-ops only on port I1. +def THX3T110I1 : ProcResGroup<[THX3T110P1]>; + +// Branch micro-ops on ports I2/I3. +def THX3T110I23 : ProcResGroup<[THX3T110P2, THX3T110P3]>; + +// Branch micro-ops on ports I1/I2/I3. +def THX3T110I123 : ProcResGroup<[THX3T110P1, THX3T110P2, THX3T110P3]>; + +// Integer micro-ops on ports I0/I1/I2. +def THX3T110I012 : ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2]>; + +// Integer micro-ops on ports I0/I1/I2/I3. +def THX3T110I0123 : ProcResGroup<[THX3T110P0, THX3T110P1, + THX3T110P2, THX3T110P3]>; + +// FP micro-ops on ports FP0/FP1/FP2/FP3. +def THX3T110FP0123 : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1, + THX3T110P8FP2, THX3T110P9FP3]>; + +// FP micro-ops on ports FP2/FP3. +def THX3T110FP23 : ProcResGroup<[THX3T110P8FP2, THX3T110P9FP3]>; + +// ASIMD micro-ops on ports FP0/FP1/FP2/FP3. +def THX3T110SIMD : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1, + THX3T110P8FP2, THX3T110P9FP3]>; + +// Store data micro-ops only on port 10. +def THX3T110SD : ProcResGroup<[THX3T110SD0]>; + +// Load/store micro-ops on ports P4/P5. +def THX3T110LS : ProcResGroup<[THX3T110P4, THX3T110P5]>; + +// 70 entry unified scheduler. +def THX3T110ANY: ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2, + THX3T110P3, THX3T110P4, THX3T110P5, + THX3T110P6FP0, THX3T110P7FP1, + THX3T110P8FP2, THX3T110P9FP3]> { + let BufferSize = 70; +} + +// Define commonly used write types for InstRW specializations. +// All definitions follow the format: THX3T110Write_Cyc_. + +// 3 cycles on I1. +def THX3T110Write_3Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 3; + let NumMicroOps = 2; +} + +// 4 cycles on I1. +def THX3T110Write_4Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 4; + let NumMicroOps = 2; +} + +// 5 cycles on I1. +def THX3T110Write_5Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 5; + let NumMicroOps = 2; +} + +// 7 cycles on I1. +def THX3T110Write_7Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 7; + let NumMicroOps = 3; +} + +// 23 cycles on I1. +def THX3T110Write_23Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 23; + let ResourceCycles = [13, 23]; + let NumMicroOps = 4; +} + +// 39 cycles on I1. +def THX3T110Write_39Cyc_I1 : SchedWriteRes<[THX3T110I1]> { + let Latency = 39; + let ResourceCycles = [13, 39]; + let NumMicroOps = 4; +} + +// 1 cycle on I2/I3 +def THX3T110Write_1Cyc_I23 : SchedWriteRes<[THX3T110I23]> { + let Latency = 1; + let NumMicroOps = 2; +} + +// 8 cycles on I2/I3 +def THX3T110Write_8Cyc_I23 : SchedWriteRes<[THX3T110I23]> { + let Latency = 8; + let NumMicroOps = 3; +} + +// 1 cycle on I1/I2/I3 +def THX3T110Write_1Cyc_I123 : SchedWriteRes<[THX3T110I123]> { + let Latency = 1; + let NumMicroOps = 2; +} + +// 8 cycles on I1/I2/I3 +def THX3T110Write_8Cyc_I123 : SchedWriteRes<[THX3T110I123]> { + let Latency = 8; + let NumMicroOps = 3; +} + +// 1 cycle on I0/I1/I2/I3. +def THX3T110Write_1Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> { + let Latency = 1; + let NumMicroOps = 2; +} + +// 2 cycles on I0/I1/I2/I3. +def THX3T110Write_2Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> { + let Latency = 2; + let NumMicroOps = 2; +} + +// 3 cycles on I0/I1/I2/I3. +def THX3T110Write_3Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> { + let Latency = 3; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 20 20:10:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F63533358F; Sat, 20 Jun 2020 20:10:44 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6HS0YDZz3VYl; Sat, 20 Jun 2020 20:10:44 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C21B117F8; Sat, 20 Jun 2020 20:10:44 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KKAhTZ018350; Sat, 20 Jun 2020 20:10:43 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KKAhmJ017599; Sat, 20 Jun 2020 20:10:43 GMT (envelope-from karels@FreeBSD.org) Message-Id: <202006202010.05KKAhmJ017599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 20 Jun 2020 20:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362446 - in stable/12/sys: netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: karels X-SVN-Commit-Paths: in stable/12/sys: netinet netinet6 X-SVN-Commit-Revision: 362446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:10:44 -0000 Author: karels Date: Sat Jun 20 20:10:42 2020 New Revision: 362446 URL: https://svnweb.freebsd.org/changeset/base/362446 Log: Allow TCP to reuse local port with different destinations MFC r361228, r361231: Previously, tcp_connect() would bind a local port before connecting, forcing the local port to be unique across all outgoing TCP connections for the address family. Instead, choose a local port after selecting the destination and the local address, requiring only that the tuple is unique and does not match a wildcard binding. Note that in_pcb_lport and in_pcb_lport_dest can be called with a NULL local address for IPv6 sockets; handle it. Sponsored by: Forcepoint LLC Modified: stable/12/sys/netinet/in_pcb.c stable/12/sys/netinet/in_pcb.h stable/12/sys/netinet/tcp_usrreq.c stable/12/sys/netinet6/in6_pcb.c stable/12/sys/netinet6/in6_pcb.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Sat Jun 20 20:06:52 2020 (r362445) +++ stable/12/sys/netinet/in_pcb.c Sat Jun 20 20:10:42 2020 (r362446) @@ -591,13 +591,16 @@ in_pcbbind(struct inpcb *inp, struct sockaddr *nam, st } #endif +#if defined(INET) || defined(INET6) /* - * Select a local port (number) to use. + * Assign a local port like in_pcb_lport(), but also used with connect() + * and a foreign address and port. If fsa is non-NULL, choose a local port + * that is unused with those, otherwise one that is completely unused. + * lsa can be NULL for IPv6. */ -#if defined(INET) || defined(INET6) int -in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, - struct ucred *cred, int lookupflags) +in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, + struct sockaddr *fsa, u_short fport, struct ucred *cred, int lookupflags) { struct inpcbinfo *pcbinfo; struct inpcb *tmpinp; @@ -605,8 +608,11 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp int count, dorandom, error; u_short aux, first, last, lport; #ifdef INET - struct in_addr laddr; + struct in_addr laddr, faddr; #endif +#ifdef INET6 + struct in6_addr *laddr6, *faddr6; +#endif pcbinfo = inp->inp_pcbinfo; @@ -666,15 +672,25 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp } #ifdef INET - /* Make the compiler happy. */ - laddr.s_addr = 0; + laddr.s_addr = INADDR_ANY; if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { - KASSERT(laddrp != NULL, ("%s: laddrp NULL for v4 inp %p", - __func__, inp)); - laddr = *laddrp; + if (lsa != NULL) + laddr = ((struct sockaddr_in *)lsa)->sin_addr; + if (fsa != NULL) + faddr = ((struct sockaddr_in *)fsa)->sin_addr; } #endif - tmpinp = NULL; /* Make compiler happy. */ +#ifdef INET6 + laddr6 = NULL; + if ((inp->inp_vflag & INP_IPV6) != 0) { + if (lsa != NULL) + laddr6 = &((struct sockaddr_in6 *)lsa)->sin6_addr; + if (fsa != NULL) + faddr6 = &((struct sockaddr_in6 *)fsa)->sin6_addr; + } +#endif + + tmpinp = NULL; lport = *lportp; if (dorandom) @@ -690,30 +706,62 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp *lastport = first; lport = htons(*lastport); + if (fsa != NULL) { + +#ifdef INET + if (lsa->sa_family == AF_INET) { + tmpinp = in_pcblookup_hash_locked(pcbinfo, + faddr, fport, laddr, lport, lookupflags, + NULL); + } +#endif #ifdef INET6 - if ((inp->inp_vflag & INP_IPV6) != 0) - tmpinp = in6_pcblookup_local(pcbinfo, - &inp->in6p_laddr, lport, lookupflags, cred); + if (lsa->sa_family == AF_INET6) { + tmpinp = in6_pcblookup_hash_locked(pcbinfo, + faddr6, fport, laddr6, lport, lookupflags, + NULL); + } #endif + } else { +#ifdef INET6 + if ((inp->inp_vflag & INP_IPV6) != 0) + tmpinp = in6_pcblookup_local(pcbinfo, + &inp->in6p_laddr, lport, lookupflags, cred); +#endif #if defined(INET) && defined(INET6) - else + else #endif #ifdef INET - tmpinp = in_pcblookup_local(pcbinfo, laddr, - lport, lookupflags, cred); + tmpinp = in_pcblookup_local(pcbinfo, laddr, + lport, lookupflags, cred); #endif + } } while (tmpinp != NULL); -#ifdef INET - if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) - laddrp->s_addr = laddr.s_addr; -#endif *lportp = lport; return (0); } /* + * Select a local port (number) to use. + */ +int +in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, + struct ucred *cred, int lookupflags) +{ + struct sockaddr_in laddr; + + if (laddrp) { + bzero(&laddr, sizeof(laddr)); + laddr.sin_family = AF_INET; + laddr.sin_addr = *laddrp; + } + return (in_pcb_lport_dest(inp, laddrp ? (struct sockaddr *) &laddr : + NULL, lportp, NULL, 0, cred, lookupflags)); +} + +/* * Return cached socket options. */ int @@ -1327,16 +1375,26 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr if (error) return (error); } - oinp = in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, fport, - laddr, lport, 0, NULL); - if (oinp != NULL) { - if (oinpp != NULL) - *oinpp = oinp; - return (EADDRINUSE); - } - if (lport == 0) { - error = in_pcbbind_setup(inp, NULL, &laddr.s_addr, &lport, - cred); + if (lport != 0) { + oinp = in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, + fport, laddr, lport, 0, NULL); + if (oinp != NULL) { + if (oinpp != NULL) + *oinpp = oinp; + return (EADDRINUSE); + } + } else { + struct sockaddr_in lsin, fsin; + + bzero(&lsin, sizeof(lsin)); + bzero(&fsin, sizeof(fsin)); + lsin.sin_family = AF_INET; + lsin.sin_addr = laddr; + fsin.sin_family = AF_INET; + fsin.sin_addr = faddr; + error = in_pcb_lport_dest(inp, (struct sockaddr *) &lsin, + &lport, (struct sockaddr *)& fsin, fport, cred, + INPLOOKUP_WILDCARD); if (error) return (error); } Modified: stable/12/sys/netinet/in_pcb.h ============================================================================== --- stable/12/sys/netinet/in_pcb.h Sat Jun 20 20:06:52 2020 (r362445) +++ stable/12/sys/netinet/in_pcb.h Sat Jun 20 20:10:42 2020 (r362446) @@ -837,6 +837,9 @@ void in_pcbgroup_update_mbuf(struct inpcb *, struct mb void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); int in_pcballoc(struct socket *, struct inpcbinfo *); int in_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *); +int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, + u_short *lportp, struct sockaddr *fsa, u_short fport, + struct ucred *cred, int lookupflags); int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *, struct ucred *, int); int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *, Modified: stable/12/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/12/sys/netinet/tcp_usrreq.c Sat Jun 20 20:06:52 2020 (r362445) +++ stable/12/sys/netinet/tcp_usrreq.c Sat Jun 20 20:10:42 2020 (r362446) @@ -134,6 +134,16 @@ static void tcp_fill_info(struct tcpcb *, struct tcp_i #endif /* + * tcp_require_unique port requires a globally-unique source port for each + * outgoing connection. The default is to require the 4-tuple to be unique. + */ +VNET_DEFINE(int, tcp_require_unique_port) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, require_unique_port, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_require_unique_port), 0, + "Require globally-unique ephemeral port for outgoing connections"); +#define V_tcp_require_unique_port VNET(tcp_require_unique_port) + +/* * TCP attaches to socket via pru_attach(), reserving space, * and an internet control block. */ @@ -1456,7 +1466,7 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(&V_tcbinfo); - if (inp->inp_lport == 0) { + if (V_tcp_require_unique_port && inp->inp_lport == 0) { error = in_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); if (error) goto out; @@ -1477,6 +1487,15 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st error = EADDRINUSE; goto out; } + /* Handle initial bind if it hadn't been done in advance. */ + if (inp->inp_lport == 0) { + inp->inp_lport = lport; + if (in_pcbinshash(inp) != 0) { + inp->inp_lport = 0; + error = EAGAIN; + goto out; + } + } inp->inp_laddr = laddr; in_pcbrehash(inp); INP_HASH_WUNLOCK(&V_tcbinfo); @@ -1516,7 +1535,7 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, s INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(&V_tcbinfo); - if (inp->inp_lport == 0) { + if (V_tcp_require_unique_port && inp->inp_lport == 0) { error = in6_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); if (error) goto out; Modified: stable/12/sys/netinet6/in6_pcb.c ============================================================================== --- stable/12/sys/netinet6/in6_pcb.c Sat Jun 20 20:06:52 2020 (r362445) +++ stable/12/sys/netinet6/in6_pcb.c Sat Jun 20 20:10:42 2020 (r362446) @@ -111,9 +111,6 @@ __FBSDID("$FreeBSD$"); #include #include -static struct inpcb *in6_pcblookup_hash_locked(struct inpcbinfo *, - struct in6_addr *, u_int, struct in6_addr *, u_int, int, struct ifnet *); - int in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) @@ -416,9 +413,13 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; - struct in6_addr addr6; + struct sockaddr_in6 laddr6; int error; + bool rehash = true; + bzero(&laddr6, sizeof(laddr6)); + laddr6.sin6_family = AF_INET6; + INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -426,23 +427,26 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr * Call inner routine, to assign local interface address. * in6_pcbladdr() may automatically fill in sin6_scope_id. */ - if ((error = in6_pcbladdr(inp, nam, &addr6)) != 0) + if ((error = in6_pcbladdr(inp, nam, &laddr6.sin6_addr)) != 0) return (error); if (in6_pcblookup_hash_locked(pcbinfo, &sin6->sin6_addr, sin6->sin6_port, IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) - ? &addr6 : &inp->in6p_laddr, + ? &laddr6.sin6_addr : &inp->in6p_laddr, inp->inp_lport, 0, NULL) != NULL) { return (EADDRINUSE); } if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) { if (inp->inp_lport == 0) { - error = in6_pcbbind(inp, (struct sockaddr *)0, cred); + rehash = false; + error = in_pcb_lport_dest(inp, + (struct sockaddr *) &laddr6, &inp->inp_lport, + (struct sockaddr *) sin6, sin6->sin6_port, cred, 0); if (error) return (error); } - inp->in6p_laddr = addr6; + inp->in6p_laddr = laddr6.sin6_addr; } inp->in6p_faddr = sin6->sin6_addr; inp->inp_fport = sin6->sin6_port; @@ -452,7 +456,11 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr inp->inp_flow |= (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); - in_pcbrehash_mbuf(inp, m); + if (rehash) { + in_pcbrehash_mbuf(inp, m); + } else { + in_pcbinshash(inp); + } return (0); } @@ -1115,9 +1123,9 @@ found: #endif /* PCBGROUP */ /* - * Lookup PCB in hash list. + * Lookup PCB in hash list. Used in in_pcb.c as well as here. */ -static struct inpcb * +struct inpcb * in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, u_int fport_arg, struct in6_addr *laddr, u_int lport_arg, int lookupflags, struct ifnet *ifp) Modified: stable/12/sys/netinet6/in6_pcb.h ============================================================================== --- stable/12/sys/netinet6/in6_pcb.h Sat Jun 20 20:06:52 2020 (r362445) +++ stable/12/sys/netinet6/in6_pcb.h Sat Jun 20 20:10:42 2020 (r362446) @@ -92,6 +92,10 @@ struct inpcb * in6_pcblookup_local(struct inpcbinfo *, struct in6_addr *, u_short, int, struct ucred *); +struct inpcb * + in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, + struct in6_addr *faddr, u_int fport_arg, struct in6_addr *laddr, + u_int lport_arg, int lookupflags, struct ifnet *ifp); struct inpcb * in6_pcblookup(struct inpcbinfo *, struct in6_addr *, u_int, struct in6_addr *, u_int, int, From owner-svn-src-all@freebsd.org Sat Jun 20 20:12:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDF2B3335AD for ; Sat, 20 Jun 2020 20:12:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6Kb0QHrz3VvV for ; Sat, 20 Jun 2020 20:12:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id o38so1189330qtf.6 for ; Sat, 20 Jun 2020 13:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GEOM2NkEGDFP39zVdVbosQRoJD7kY+0kG4XxC+9nCaA=; b=qmoNA4S3Z9i0Bfgqttgmb+3YI+ttJd5FJ2S5QUNPjZO+T0yZfJOUMNTCsKuMHI+GX6 HMS3//4RONQ9uKJlh0kicPdlKuDK7x9QvMvpNYWHDlJXX7iLUypNisd4JHzyjpThNr3Z tix1cvwz3PG8PS05mFCspr0aN1Q3m0wMEcXZUeFWPpk93z1bF2d2UIksqqLFIjc3kfNp eaWs3TvjwAExU9a/svwPEztWJ1agOQRx5EKsWomNzn/Gg21BIW1DveAPUhPc7MZuRB1g XgdRNbsYjntv05wvtzZp3nnisC5IxggA0moVgEREwVdbaPA+6GiRIHScwLJah63rsu3h KmzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GEOM2NkEGDFP39zVdVbosQRoJD7kY+0kG4XxC+9nCaA=; b=lbMrobZ9xL0i8Vsw01UyNPuNzZG5XS+VpJ23gJsVNLZMrGB49C9dv4RSv96Uxv2kBz 7SdW3mBmTg2fFzoYbEdN++0rgLY5MbysYE0bGX48UPvZR9qKMtjl4DIcOdIl2gnhr0en yv6KbkRbiHunRyG4Ld1O0FSy7BHY2pgKSM+VenlyKC8UaotEazBhQ6Cof44VZR+luVur ZhQadwUMzPD3Enap2r+5Fkasco/1jv0pXRkKO2vwEiBLGRUh/iT8EPFdnnrF3yGTYVJU AFPwZL79rYjJp9DW0qAIan7edD4Dc/LUqLV0j4Q0z4hduOQ2SPYlxuPM6uvXOVusq692 sAnA== X-Gm-Message-State: AOAM533MBEZKTfKHC9fDuXCK8Sba8gbWMZ72xmBERAuc6hFiweBKLKlB 8p3UECwA5AZLW85JgzZy/TkEN5T4YLcDkVAWPG61Gg== X-Google-Smtp-Source: ABdhPJwVHezaY4uzAmESnw7k4qrnPs2xkgLBNYgf5ngxlsopbO52Kl4qY4Sk2NkbM61IDJB82Xp/A6vnwrx5t/lSGZo= X-Received: by 2002:ac8:1082:: with SMTP id a2mr7336477qtj.32.1592683954084; Sat, 20 Jun 2020 13:12:34 -0700 (PDT) MIME-Version: 1.0 References: <202006201110.05KBAZBU099451@gndrsh.dnsmgr.net> <3bab2cbf-c221-7d18-5257-2d3971975558@selasky.org> <93ca6b8e4c1f8a76ea6ad602591dcd2e39c2d89c.camel@freebsd.org> In-Reply-To: <93ca6b8e4c1f8a76ea6ad602591dcd2e39c2d89c.camel@freebsd.org> From: Warner Losh Date: Sat, 20 Jun 2020 14:12:23 -0600 Message-ID: Subject: Re: svn commit: r362422 - head/sbin/dump To: Ian Lepore Cc: Hans Petter Selasky , "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49q6Kb0QHrz3VvV X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=qmoNA4S3; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::844) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.72 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.52)[-0.515]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.57)[-0.571]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.64)[-0.636]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:12:35 -0000 On Sat, Jun 20, 2020 at 12:46 PM Ian Lepore wrote: > On Sat, 2020-06-20 at 07:57 -0600, Warner Losh wrote: > > On Sat, Jun 20, 2020 at 7:27 AM Hans Petter Selasky > wrote: > > > > > On 2020-06-20 13:10, Rodney W. Grimes wrote: > > > > > Author: imp > > > > > Date: Sat Jun 20 04:19:17 2020 > > > > > New Revision: 362422 > > > > > URL:https://svnweb.freebsd.org/changeset/base/362422 > > > > > > > > > > Log: > > > > > Increase the whimsy in this file by famring dump's work out to > > > > > > minions. Adjust > > > > > variables accordingly. Thankfully, we are able to do this > without > > > > > > additional > > > > > banana expenditures. > > > > > > > > This flys in the face of its intent and as a "commit" is more > > > > racially biased than the code was! > > > > > > > > > > Hi Warner, > > > > > > Maybe a stupid question, but is this the correct meaning or description > > > of minion? > > > > > > https://www.google.com/search?q=minions > > > > > > minion; plural noun: minions > > > > > > a follower or underling of a powerful person, especially a servile > > > or unimportant one. > > > "he gets oppressed minions like me to fob them off" > > > > > > "Minion" is still a person, like "slave" is, so I must say I agree with > > > Rodney about this, I don't see how this makes it any better? Can you > > > explain? > > > > > > > For me, Minions come from the Despicable Me movies and sequels. They work > > for Gru, who pays them for their services. They love Bananas and often do > > crazy things for a banana. They work for Gru willingly. They are free to > > leave at any time. They are sad at the prospect of Gru having to lay them > > off. > > > > Minions are also, as you point out, employed by the powerful to > accomplish > > things. Key word here is 'employed'. Servile doesn't mean 'involuntary > > servitude' but rather 'an excessive willingness to please.' Underling > means > > only that them are below them on the org chart. There's no inherent > > implication of an abusive relationship, per se, though that happens as in > > any power relationship between people. > > > > And the extensive searching I did before the commit showed no complaints > > about the movies, or that this term had some coded, racist history. Or > any > > other coded history that's problematic. Or any overt history for that > > matter. > > > > SaltStack uses it as their name for agents that carry out tasks, for > > example. > > > > So what am I missing? > > > > Common sense, apparently > Not helpful. However, I've had a couple other, private email messages that were helpful and gave the context I was missing. I've reverted. Warner From owner-svn-src-all@freebsd.org Sat Jun 20 20:12:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AD1233337A for ; Sat, 20 Jun 2020 20:12:44 +0000 (UTC) (envelope-from 01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@amazonses.com) Received: from a8-237.smtp-out.amazonses.com (a8-237.smtp-out.amazonses.com [54.240.8.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6Kk5rhsz3VyN for ; Sat, 20 Jun 2020 20:12:42 +0000 (UTC) (envelope-from 01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1592683961; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=E+l7r/9AM8gJ8cjPzK/L6vfyCGF4F8yTuIRGb2hKGes=; b=bmJt3Oo56Cj0wn8LpyPrM8Y9EmbVX++hP4ZETtlAHNGGoLZLHD/LOhEkikrmL2o3 ktX/+mkJWvx/XMQgQUIT/lVw4Okx8Z4whoZUxGT2Y38lusKhctLRj90hyNIBiXvTbVU j0gAL1S6RBhV424cDyiUI0Thb70wbwXOl72ughRk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1592683961; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=E+l7r/9AM8gJ8cjPzK/L6vfyCGF4F8yTuIRGb2hKGes=; b=OZFtNpCnlr5hO0dFIPwr6+ns5UsKhvB5zmnBeOVaP7hVcPuGCNWhSCFMuhwcuWRl 2mRyPLeYmqkq99gFGShkXlqPi4o2VDpkW7wUjpsmP2wUYGYEEf0eVZHB5pvUfiNDg1B eDKA5E0qdI9fQO2sgo0tgbhsEHLJdB+Jr7rbAPTw= Subject: Re: svn commit: r362444 - head/sbin/dump To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006202006.05KK6EqK016498@repo.freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@email.amazonses.com> Date: Sat, 20 Jun 2020 20:12:40 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <202006202006.05KK6EqK016498@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2020.06.20-54.240.8.237 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 49q6Kk5rhsz3VyN X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn header.b=bmJt3Oo5; dkim=pass header.d=amazonses.com header.s=224i4yxa5dv7c2xz3womw6peuasteono header.b=OZFtNpCn; dmarc=none; spf=pass (mx1.freebsd.org: domain of 01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@amazonses.com designates 54.240.8.237 as permitted sender) smtp.mailfrom=01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@amazonses.com X-Spamd-Result: default: False [-0.27 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.86)[-0.863]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn,amazonses.com:s=224i4yxa5dv7c2xz3womw6peuasteono]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18:c]; NEURAL_HAM_LONG(-0.99)[-0.985]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[tarsnap.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; NEURAL_HAM_SHORT(-0.72)[-0.723]; RCVD_IN_DNSWL_NONE(0.00)[54.240.8.237:from]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; RWL_MAILSPIKE_POSSIBLE(0.00)[54.240.8.237:from]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com,01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@amazonses.com]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:12:47 -0000 Thanks for backing this out, Warner. I'd like to change "slave" to "worker" here (which I think is a reasonably neutral and entirely inoffensive term), and in the process perhaps make some associated grammatical changes (since "enworker" is dubious at best). To avoid causing any further issues: If anyone objects to the word "worker" please let me know in the next ~48 hours. I think there's enough people reading svn-src-all that I can anticipate feedback now if anyone will care deeply about that word. Colin Percival On 2020-06-20 13:06, Warner Losh wrote: > Author: imp > Date: Sat Jun 20 20:06:14 2020 > New Revision: 362444 > URL: https://svnweb.freebsd.org/changeset/base/362444 > > Log: > Revert -r362422. > > While whimsical, there's too much negative energy around minion as well as the > positive. > > Modified: > head/sbin/dump/tape.c > > Modified: head/sbin/dump/tape.c > ============================================================================== > --- head/sbin/dump/tape.c Sat Jun 20 18:50:18 2020 (r362443) > +++ head/sbin/dump/tape.c Sat Jun 20 20:06:14 2020 (r362444) > @@ -75,19 +75,19 @@ static char *nexttape; > static FILE *popenfp = NULL; > > static int atomic(ssize_t (*)(), int, char *, int); > -static void dominion(int, int); > -static void enminion(void); > +static void doslave(int, int); > +static void enslave(void); > static void flushtape(void); > static void killall(void); > static void rollforward(void); > > /* > * Concurrent dump mods (Caltech) - disk block reading and tape writing > - * are exported to several minion processes. While one minion writes the > + * are exported to several slave processes. While one slave writes the > * tape, the others read disk blocks; they pass control of the tape in > * a ring via signals. The parent process traverses the file system and > - * sends writeheader()'s and lists of daddr's to the minions via pipes. > - * The following structure defines the instruction packets sent to minions. > + * sends writeheader()'s and lists of daddr's to the slaves via pipes. > + * The following structure defines the instruction packets sent to slaves. > */ > struct req { > ufs2_daddr_t dblk; > @@ -95,20 +95,20 @@ struct req { > }; > static int reqsiz; > > -#define MINIONS 3 /* 1 minion writing, 1 reading, 1 for slack */ > -static struct minion { > +#define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */ > +static struct slave { > int64_t tapea; /* header number at start of this chunk */ > int64_t firstrec; /* record number of this block */ > int count; /* count to next header (used for TS_TAPE */ > /* after EOT) */ > int inode; /* inode that we are currently dealing with */ > - int fd; /* FD for this minion */ > - int pid; /* PID for this minion */ > - int sent; /* 1 == we've sent this minion requests */ > + int fd; /* FD for this slave */ > + int pid; /* PID for this slave */ > + int sent; /* 1 == we've sent this slave requests */ > char (*tblock)[TP_BSIZE]; /* buffer for data blocks */ > struct req *req; /* buffer for requests */ > -} minions[MINIONS+1]; > -static struct minion *mlp; > +} slaves[SLAVES+1]; > +static struct slave *slp; > > static char (*nextblock)[TP_BSIZE]; > > @@ -116,9 +116,9 @@ static int master; /* pid of master, for sending error > static int tenths; /* length of tape used per block written */ > static volatile sig_atomic_t caught; /* have we caught the signal to proceed? */ > static volatile sig_atomic_t ready; /* reached the lock point without having */ > - /* received the SIGUSR2 signal from the prev minion? */ > + /* received the SIGUSR2 signal from the prev slave? */ > static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ > - /* SIGUSR2 arrives from the previous minion */ > + /* SIGUSR2 arrives from the previous slave */ > > int > alloctape(void) > @@ -143,20 +143,20 @@ alloctape(void) > * packets, so flushtape() can write them together with one write(). > * Align tape buffer on page boundary to speed up tape write(). > */ > - for (i = 0; i <= MINIONS; i++) { > + for (i = 0; i <= SLAVES; i++) { > buf = (char *) > malloc((unsigned)(reqsiz + writesize + pgoff + TP_BSIZE)); > if (buf == NULL) > return(0); > - minions[i].tblock = (char (*)[TP_BSIZE]) > + slaves[i].tblock = (char (*)[TP_BSIZE]) > (((long)&buf[ntrec + 1] + pgoff) &~ pgoff); > - minions[i].req = (struct req *)minions[i].tblock - ntrec - 1; > + slaves[i].req = (struct req *)slaves[i].tblock - ntrec - 1; > } > - mlp = &minions[0]; > - mlp->count = 1; > - mlp->tapea = 0; > - mlp->firstrec = 0; > - nextblock = mlp->tblock; > + slp = &slaves[0]; > + slp->count = 1; > + slp->tapea = 0; > + slp->firstrec = 0; > + nextblock = slp->tblock; > return(1); > } > > @@ -164,8 +164,8 @@ void > writerec(char *dp, int isspcl) > { > > - mlp->req[trecno].dblk = (ufs2_daddr_t)0; > - mlp->req[trecno].count = 1; > + slp->req[trecno].dblk = (ufs2_daddr_t)0; > + slp->req[trecno].count = 1; > /* Can't do a structure assignment due to alignment problems */ > bcopy(dp, *(nextblock)++, sizeof (union u_spcl)); > if (isspcl) > @@ -185,8 +185,8 @@ dumpblock(ufs2_daddr_t blkno, int size) > dblkno = fsbtodb(sblock, blkno); > tpblks = size >> tp_bshift; > while ((avail = MIN(tpblks, ntrec - trecno)) > 0) { > - mlp->req[trecno].dblk = dblkno; > - mlp->req[trecno].count = avail; > + slp->req[trecno].dblk = dblkno; > + slp->req[trecno].count = avail; > trecno += avail; > spcl.c_tapea += avail; > if (trecno >= ntrec) > @@ -232,27 +232,27 @@ flushtape(void) > int i, blks, got; > int64_t lastfirstrec; > > - int siz = (char *)nextblock - (char *)mlp->req; > + int siz = (char *)nextblock - (char *)slp->req; > > - mlp->req[trecno].count = 0; /* Sentinel */ > + slp->req[trecno].count = 0; /* Sentinel */ > > - if (atomic(write, mlp->fd, (char *)mlp->req, siz) != siz) > + if (atomic(write, slp->fd, (char *)slp->req, siz) != siz) > quit("error writing command pipe: %s\n", strerror(errno)); > - mlp->sent = 1; /* we sent a request, read the response later */ > + slp->sent = 1; /* we sent a request, read the response later */ > > - lastfirstrec = mlp->firstrec; > + lastfirstrec = slp->firstrec; > > - if (++mlp >= &minions[MINIONS]) > - mlp = &minions[0]; > + if (++slp >= &slaves[SLAVES]) > + slp = &slaves[0]; > > - /* Read results back from next minion */ > - if (mlp->sent) { > - if (atomic(read, mlp->fd, (char *)&got, sizeof got) > + /* Read results back from next slave */ > + if (slp->sent) { > + if (atomic(read, slp->fd, (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - mlp->sent = 0; > + slp->sent = 0; > > /* Check for end of tape */ > if (got < writesize) { > @@ -262,15 +262,15 @@ flushtape(void) > * Drain the results, don't care what the values were. > * If we read them here then trewind won't... > */ > - for (i = 0; i < MINIONS; i++) { > - if (minions[i].sent) { > - if (atomic(read, minions[i].fd, > + for (i = 0; i < SLAVES; i++) { > + if (slaves[i].sent) { > + if (atomic(read, slaves[i].fd, > (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - minions[i].sent = 0; > + slaves[i].sent = 0; > } > } > > @@ -288,11 +288,11 @@ flushtape(void) > if (spcl.c_addr[i] != 0) > blks++; > } > - mlp->count = lastspclrec + blks + 1 - spcl.c_tapea; > - mlp->tapea = spcl.c_tapea; > - mlp->firstrec = lastfirstrec + ntrec; > - mlp->inode = curino; > - nextblock = mlp->tblock; > + slp->count = lastspclrec + blks + 1 - spcl.c_tapea; > + slp->tapea = spcl.c_tapea; > + slp->firstrec = lastfirstrec + ntrec; > + slp->inode = curino; > + nextblock = slp->tblock; > trecno = 0; > asize += tenths; > blockswritten += ntrec; > @@ -312,7 +312,7 @@ trewind(void) > int f; > int got; > > - for (f = 0; f < MINIONS; f++) { > + for (f = 0; f < SLAVES; f++) { > /* > * Drain the results, but unlike EOT we DO (or should) care > * what the return values were, since if we detect EOT after > @@ -321,22 +321,22 @@ trewind(void) > * > * fixme: punt for now. > */ > - if (minions[f].sent) { > - if (atomic(read, minions[f].fd, (char *)&got, sizeof got) > + if (slaves[f].sent) { > + if (atomic(read, slaves[f].fd, (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - minions[f].sent = 0; > + slaves[f].sent = 0; > if (got != writesize) { > msg("EOT detected in last 2 tape records!\n"); > msg("Use a longer tape, decrease the size estimate\n"); > quit("or use no size estimate at all.\n"); > } > } > - (void) close(minions[f].fd); > + (void) close(slaves[f].fd); > } > - while (wait((int *)NULL) >= 0) /* wait for any signals from minions */ > + while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ > /* void */; > > if (pipeout) > @@ -396,29 +396,29 @@ void > rollforward(void) > { > struct req *p, *q, *prev; > - struct minion *tmlp; > + struct slave *tslp; > int i, size, got; > int64_t savedtapea; > union u_spcl *ntb, *otb; > - tmlp = &minions[MINIONS]; > - ntb = (union u_spcl *)tmlp->tblock[1]; > + tslp = &slaves[SLAVES]; > + ntb = (union u_spcl *)tslp->tblock[1]; > > /* > - * Each of the N minions should have requests that need to > - * be replayed on the next tape. Use the extra minion buffers > - * (minions[MINIONS]) to construct request lists to be sent to > - * each minion in turn. > + * Each of the N slaves should have requests that need to > + * be replayed on the next tape. Use the extra slave buffers > + * (slaves[SLAVES]) to construct request lists to be sent to > + * each slave in turn. > */ > - for (i = 0; i < MINIONS; i++) { > - q = &tmlp->req[1]; > - otb = (union u_spcl *)mlp->tblock; > + for (i = 0; i < SLAVES; i++) { > + q = &tslp->req[1]; > + otb = (union u_spcl *)slp->tblock; > > /* > - * For each request in the current minion, copy it to tmlp. > + * For each request in the current slave, copy it to tslp. > */ > > prev = NULL; > - for (p = mlp->req; p->count > 0; p += p->count) { > + for (p = slp->req; p->count > 0; p += p->count) { > *q = *p; > if (p->dblk == 0) > *ntb++ = *otb++; /* copy the datablock also */ > @@ -433,26 +433,26 @@ rollforward(void) > ntb--; > q -= 1; > q->count = 0; > - q = &tmlp->req[0]; > + q = &tslp->req[0]; > if (i == 0) { > q->dblk = 0; > q->count = 1; > trecno = 0; > - nextblock = tmlp->tblock; > + nextblock = tslp->tblock; > savedtapea = spcl.c_tapea; > - spcl.c_tapea = mlp->tapea; > + spcl.c_tapea = slp->tapea; > startnewtape(0); > spcl.c_tapea = savedtapea; > lastspclrec = savedtapea - 1; > } > size = (char *)ntb - (char *)q; > - if (atomic(write, mlp->fd, (char *)q, size) != size) { > + if (atomic(write, slp->fd, (char *)q, size) != size) { > perror(" DUMP: error writing command pipe"); > dumpabort(0); > } > - mlp->sent = 1; > - if (++mlp >= &minions[MINIONS]) > - mlp = &minions[0]; > + slp->sent = 1; > + if (++slp >= &slaves[SLAVES]) > + slp = &slaves[0]; > > q->count = 1; > > @@ -464,34 +464,34 @@ rollforward(void) > */ > q->dblk = prev->dblk + > prev->count * (TP_BSIZE / DEV_BSIZE); > - ntb = (union u_spcl *)tmlp->tblock; > + ntb = (union u_spcl *)tslp->tblock; > } else { > /* > * It wasn't a disk block. Copy the data to its > * new location in the buffer. > */ > q->dblk = 0; > - *((union u_spcl *)tmlp->tblock) = *ntb; > - ntb = (union u_spcl *)tmlp->tblock[1]; > + *((union u_spcl *)tslp->tblock) = *ntb; > + ntb = (union u_spcl *)tslp->tblock[1]; > } > } > - mlp->req[0] = *q; > - nextblock = mlp->tblock; > + slp->req[0] = *q; > + nextblock = slp->tblock; > if (q->dblk == 0) > nextblock++; > trecno = 1; > > /* > - * Clear the first minions' response. One hopes that it > + * Clear the first slaves' response. One hopes that it > * worked ok, otherwise the tape is much too short! > */ > - if (mlp->sent) { > - if (atomic(read, mlp->fd, (char *)&got, sizeof got) > + if (slp->sent) { > + if (atomic(read, slp->fd, (char *)&got, sizeof got) > != sizeof got) { > perror(" DUMP: error reading command pipe in master"); > dumpabort(0); > } > - mlp->sent = 0; > + slp->sent = 0; > > if (got != writesize) { > quit("EOT detected at start of the tape!\n"); > @@ -634,7 +634,7 @@ restore_check_point: > } > } > > - enminion(); /* Share open tape file descriptor with minions */ > + enslave(); /* Share open tape file descriptor with slaves */ > if (popenout) > close(tapefd); /* Give up our copy of it. */ > signal(SIGINFO, infosch); > @@ -643,18 +643,18 @@ restore_check_point: > blocksthisvol = 0; > if (top) > newtape++; /* new tape signal */ > - spcl.c_count = mlp->count; > + spcl.c_count = slp->count; > /* > * measure firstrec in TP_BSIZE units since restore doesn't > * know the correct ntrec value... > */ > - spcl.c_firstrec = mlp->firstrec; > + spcl.c_firstrec = slp->firstrec; > spcl.c_volume++; > spcl.c_type = TS_TAPE; > - writeheader((ino_t)mlp->inode); > + writeheader((ino_t)slp->inode); > if (tapeno > 1) > msg("Volume %d begins with blocks from inode %d\n", > - tapeno, mlp->inode); > + tapeno, slp->inode); > } > } > > @@ -687,7 +687,7 @@ Exit(status) > } > > /* > - * proceed - handler for SIGUSR2, used to synchronize IO between the minions. > + * proceed - handler for SIGUSR2, used to synchronize IO between the slaves. > */ > void > proceed(int signo __unused) > @@ -699,45 +699,45 @@ proceed(int signo __unused) > } > > void > -enminion(void) > +enslave(void) > { > int cmd[2]; > int i, j; > > master = getpid(); > > - signal(SIGTERM, dumpabort); /* Minion sends SIGTERM on dumpabort() */ > + signal(SIGTERM, dumpabort); /* Slave sends SIGTERM on dumpabort() */ > signal(SIGPIPE, sigpipe); > - signal(SIGUSR1, tperror); /* Minion sends SIGUSR1 on tape errors */ > - signal(SIGUSR2, proceed); /* Minion sends SIGUSR2 to next minion */ > + signal(SIGUSR1, tperror); /* Slave sends SIGUSR1 on tape errors */ > + signal(SIGUSR2, proceed); /* Slave sends SIGUSR2 to next slave */ > > - for (i = 0; i < MINIONS; i++) { > - if (i == mlp - &minions[0]) { > + for (i = 0; i < SLAVES; i++) { > + if (i == slp - &slaves[0]) { > caught = 1; > } else { > caught = 0; > } > > if (socketpair(AF_UNIX, SOCK_STREAM, 0, cmd) < 0 || > - (minions[i].pid = fork()) < 0) > - quit("too many minions, %d (recompile smaller): %s\n", > + (slaves[i].pid = fork()) < 0) > + quit("too many slaves, %d (recompile smaller): %s\n", > i, strerror(errno)); > > - minions[i].fd = cmd[1]; > - minions[i].sent = 0; > - if (minions[i].pid == 0) { /* Minion starts up here */ > + slaves[i].fd = cmd[1]; > + slaves[i].sent = 0; > + if (slaves[i].pid == 0) { /* Slave starts up here */ > for (j = 0; j <= i; j++) > - (void) close(minions[j].fd); > + (void) close(slaves[j].fd); > signal(SIGINT, SIG_IGN); /* Master handles this */ > - dominion(cmd[0], i); > + doslave(cmd[0], i); > Exit(X_FINOK); > } > } > > - for (i = 0; i < MINIONS; i++) > - (void) atomic(write, minions[i].fd, > - (char *) &minions[(i + 1) % MINIONS].pid, > - sizeof minions[0].pid); > + for (i = 0; i < SLAVES; i++) > + (void) atomic(write, slaves[i].fd, > + (char *) &slaves[(i + 1) % SLAVES].pid, > + sizeof slaves[0].pid); > > master = 0; > } > @@ -747,10 +747,10 @@ killall(void) > { > int i; > > - for (i = 0; i < MINIONS; i++) > - if (minions[i].pid > 0) { > - (void) kill(minions[i].pid, SIGKILL); > - minions[i].sent = 0; > + for (i = 0; i < SLAVES; i++) > + if (slaves[i].pid > 0) { > + (void) kill(slaves[i].pid, SIGKILL); > + slaves[i].sent = 0; > } > } > > @@ -762,42 +762,42 @@ killall(void) > * get the lock back for the next cycle by swapping descriptors. > */ > static void > -dominion(int cmd, int minion_number) > +doslave(int cmd, int slave_number) > { > int nread; > - int nextminion, size, wrote, eot_count; > + int nextslave, size, wrote, eot_count; > > /* > * Need our own seek pointer. > */ > (void) close(diskfd); > if ((diskfd = open(disk, O_RDONLY)) < 0) > - quit("minion couldn't reopen disk: %s\n", strerror(errno)); > + quit("slave couldn't reopen disk: %s\n", strerror(errno)); > > /* > - * Need the pid of the next minion in the loop... > + * Need the pid of the next slave in the loop... > */ > - if ((nread = atomic(read, cmd, (char *)&nextminion, sizeof nextminion)) > - != sizeof nextminion) { > - quit("master/minion protocol botched - didn't get pid of next minion.\n"); > + if ((nread = atomic(read, cmd, (char *)&nextslave, sizeof nextslave)) > + != sizeof nextslave) { > + quit("master/slave protocol botched - didn't get pid of next slave.\n"); > } > > /* > * Get list of blocks to dump, read the blocks into tape buffer > */ > - while ((nread = atomic(read, cmd, (char *)mlp->req, reqsiz)) == reqsiz) { > - struct req *p = mlp->req; > + while ((nread = atomic(read, cmd, (char *)slp->req, reqsiz)) == reqsiz) { > + struct req *p = slp->req; > > for (trecno = 0; trecno < ntrec; > trecno += p->count, p += p->count) { > if (p->dblk) { > - blkread(p->dblk, mlp->tblock[trecno], > + blkread(p->dblk, slp->tblock[trecno], > p->count * TP_BSIZE); > } else { > if (p->count != 1 || atomic(read, cmd, > - (char *)mlp->tblock[trecno], > + (char *)slp->tblock[trecno], > TP_BSIZE) != TP_BSIZE) > - quit("master/minion protocol botched.\n"); > + quit("master/slave protocol botched.\n"); > } > } > if (setjmp(jmpbuf) == 0) { > @@ -816,14 +816,14 @@ dominion(int cmd, int minion_number) > while (eot_count < 10 && size < writesize) { > #ifdef RDUMP > if (host) > - wrote = rmtwrite(mlp->tblock[0]+size, > + wrote = rmtwrite(slp->tblock[0]+size, > writesize-size); > else > #endif > - wrote = write(tapefd, mlp->tblock[0]+size, > + wrote = write(tapefd, slp->tblock[0]+size, > writesize-size); > #ifdef WRITEDEBUG > - printf("minion %d wrote %d\n", minion_number, wrote); > + printf("slave %d wrote %d\n", slave_number, wrote); > #endif > if (wrote < 0) > break; > @@ -834,8 +834,8 @@ dominion(int cmd, int minion_number) > > #ifdef WRITEDEBUG > if (size != writesize) > - printf("minion %d only wrote %d out of %d bytes and gave up.\n", > - minion_number, size, writesize); > + printf("slave %d only wrote %d out of %d bytes and gave up.\n", > + slave_number, size, writesize); > #endif > > /* > @@ -862,10 +862,10 @@ dominion(int cmd, int minion_number) > } > > /* > - * If partial write, don't want next minion to go. > + * If partial write, don't want next slave to go. > * Also jolts him awake. > */ > - (void) kill(nextminion, SIGUSR2); > + (void) kill(nextslave, SIGUSR2); > } > if (nread != 0) > quit("error reading command pipe: %s\n", strerror(errno)); > -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Sat Jun 20 20:14:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3616E33398C; Sat, 20 Jun 2020 20:14:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6NC16BSz3WDx; Sat, 20 Jun 2020 20:14:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2126F11EC9; Sat, 20 Jun 2020 20:14:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KKEpJ2022508; Sat, 20 Jun 2020 20:14:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KKEpoE022507; Sat, 20 Jun 2020 20:14:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202006202014.05KKEpoE022507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Jun 2020 20:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362447 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 362447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:14:51 -0000 Author: cem Date: Sat Jun 20 20:14:50 2020 New Revision: 362447 URL: https://svnweb.freebsd.org/changeset/base/362447 Log: dump(8): Reapply slightly modified r362422 Go ahead and replace the distasteful slave language for worker processes with the straightforward description, "worker(s)." Modified: head/sbin/dump/tape.c Modified: head/sbin/dump/tape.c ============================================================================== --- head/sbin/dump/tape.c Sat Jun 20 20:10:42 2020 (r362446) +++ head/sbin/dump/tape.c Sat Jun 20 20:14:50 2020 (r362447) @@ -75,19 +75,19 @@ static char *nexttape; static FILE *popenfp = NULL; static int atomic(ssize_t (*)(), int, char *, int); -static void doslave(int, int); -static void enslave(void); +static void worker(int, int); +static void enworker(void); static void flushtape(void); static void killall(void); static void rollforward(void); /* * Concurrent dump mods (Caltech) - disk block reading and tape writing - * are exported to several slave processes. While one slave writes the + * are exported to several worker processes. While one worker writes the * tape, the others read disk blocks; they pass control of the tape in * a ring via signals. The parent process traverses the file system and - * sends writeheader()'s and lists of daddr's to the slaves via pipes. - * The following structure defines the instruction packets sent to slaves. + * sends writeheader()'s and lists of daddr's to the workers via pipes. + * The following structure defines the instruction packets sent to workers. */ struct req { ufs2_daddr_t dblk; @@ -95,20 +95,20 @@ struct req { }; static int reqsiz; -#define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */ -static struct slave { +#define WORKERS 3 /* 1 worker writing, 1 reading, 1 for slack */ +static struct worker { int64_t tapea; /* header number at start of this chunk */ int64_t firstrec; /* record number of this block */ int count; /* count to next header (used for TS_TAPE */ /* after EOT) */ int inode; /* inode that we are currently dealing with */ - int fd; /* FD for this slave */ - int pid; /* PID for this slave */ - int sent; /* 1 == we've sent this slave requests */ + int fd; /* FD for this worker */ + int pid; /* PID for this worker */ + int sent; /* 1 == we've sent this worker requests */ char (*tblock)[TP_BSIZE]; /* buffer for data blocks */ struct req *req; /* buffer for requests */ -} slaves[SLAVES+1]; -static struct slave *slp; +} workers[WORKERS+1]; +static struct worker *mlp; static char (*nextblock)[TP_BSIZE]; @@ -116,9 +116,9 @@ static int master; /* pid of master, for sending error static int tenths; /* length of tape used per block written */ static volatile sig_atomic_t caught; /* have we caught the signal to proceed? */ static volatile sig_atomic_t ready; /* reached the lock point without having */ - /* received the SIGUSR2 signal from the prev slave? */ + /* received the SIGUSR2 signal from the prev worker? */ static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ - /* SIGUSR2 arrives from the previous slave */ + /* SIGUSR2 arrives from the previous worker */ int alloctape(void) @@ -143,20 +143,20 @@ alloctape(void) * packets, so flushtape() can write them together with one write(). * Align tape buffer on page boundary to speed up tape write(). */ - for (i = 0; i <= SLAVES; i++) { + for (i = 0; i <= WORKERS; i++) { buf = (char *) malloc((unsigned)(reqsiz + writesize + pgoff + TP_BSIZE)); if (buf == NULL) return(0); - slaves[i].tblock = (char (*)[TP_BSIZE]) + workers[i].tblock = (char (*)[TP_BSIZE]) (((long)&buf[ntrec + 1] + pgoff) &~ pgoff); - slaves[i].req = (struct req *)slaves[i].tblock - ntrec - 1; + workers[i].req = (struct req *)workers[i].tblock - ntrec - 1; } - slp = &slaves[0]; - slp->count = 1; - slp->tapea = 0; - slp->firstrec = 0; - nextblock = slp->tblock; + mlp = &workers[0]; + mlp->count = 1; + mlp->tapea = 0; + mlp->firstrec = 0; + nextblock = mlp->tblock; return(1); } @@ -164,8 +164,8 @@ void writerec(char *dp, int isspcl) { - slp->req[trecno].dblk = (ufs2_daddr_t)0; - slp->req[trecno].count = 1; + mlp->req[trecno].dblk = (ufs2_daddr_t)0; + mlp->req[trecno].count = 1; /* Can't do a structure assignment due to alignment problems */ bcopy(dp, *(nextblock)++, sizeof (union u_spcl)); if (isspcl) @@ -185,8 +185,8 @@ dumpblock(ufs2_daddr_t blkno, int size) dblkno = fsbtodb(sblock, blkno); tpblks = size >> tp_bshift; while ((avail = MIN(tpblks, ntrec - trecno)) > 0) { - slp->req[trecno].dblk = dblkno; - slp->req[trecno].count = avail; + mlp->req[trecno].dblk = dblkno; + mlp->req[trecno].count = avail; trecno += avail; spcl.c_tapea += avail; if (trecno >= ntrec) @@ -232,27 +232,27 @@ flushtape(void) int i, blks, got; int64_t lastfirstrec; - int siz = (char *)nextblock - (char *)slp->req; + int siz = (char *)nextblock - (char *)mlp->req; - slp->req[trecno].count = 0; /* Sentinel */ + mlp->req[trecno].count = 0; /* Sentinel */ - if (atomic(write, slp->fd, (char *)slp->req, siz) != siz) + if (atomic(write, mlp->fd, (char *)mlp->req, siz) != siz) quit("error writing command pipe: %s\n", strerror(errno)); - slp->sent = 1; /* we sent a request, read the response later */ + mlp->sent = 1; /* we sent a request, read the response later */ - lastfirstrec = slp->firstrec; + lastfirstrec = mlp->firstrec; - if (++slp >= &slaves[SLAVES]) - slp = &slaves[0]; + if (++mlp >= &workers[WORKERS]) + mlp = &workers[0]; - /* Read results back from next slave */ - if (slp->sent) { - if (atomic(read, slp->fd, (char *)&got, sizeof got) + /* Read results back from next worker */ + if (mlp->sent) { + if (atomic(read, mlp->fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slp->sent = 0; + mlp->sent = 0; /* Check for end of tape */ if (got < writesize) { @@ -262,15 +262,15 @@ flushtape(void) * Drain the results, don't care what the values were. * If we read them here then trewind won't... */ - for (i = 0; i < SLAVES; i++) { - if (slaves[i].sent) { - if (atomic(read, slaves[i].fd, + for (i = 0; i < WORKERS; i++) { + if (workers[i].sent) { + if (atomic(read, workers[i].fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slaves[i].sent = 0; + workers[i].sent = 0; } } @@ -288,11 +288,11 @@ flushtape(void) if (spcl.c_addr[i] != 0) blks++; } - slp->count = lastspclrec + blks + 1 - spcl.c_tapea; - slp->tapea = spcl.c_tapea; - slp->firstrec = lastfirstrec + ntrec; - slp->inode = curino; - nextblock = slp->tblock; + mlp->count = lastspclrec + blks + 1 - spcl.c_tapea; + mlp->tapea = spcl.c_tapea; + mlp->firstrec = lastfirstrec + ntrec; + mlp->inode = curino; + nextblock = mlp->tblock; trecno = 0; asize += tenths; blockswritten += ntrec; @@ -312,7 +312,7 @@ trewind(void) int f; int got; - for (f = 0; f < SLAVES; f++) { + for (f = 0; f < WORKERS; f++) { /* * Drain the results, but unlike EOT we DO (or should) care * what the return values were, since if we detect EOT after @@ -321,22 +321,22 @@ trewind(void) * * fixme: punt for now. */ - if (slaves[f].sent) { - if (atomic(read, slaves[f].fd, (char *)&got, sizeof got) + if (workers[f].sent) { + if (atomic(read, workers[f].fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slaves[f].sent = 0; + workers[f].sent = 0; if (got != writesize) { msg("EOT detected in last 2 tape records!\n"); msg("Use a longer tape, decrease the size estimate\n"); quit("or use no size estimate at all.\n"); } } - (void) close(slaves[f].fd); + (void) close(workers[f].fd); } - while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ + while (wait((int *)NULL) >= 0) /* wait for any signals from workers */ /* void */; if (pipeout) @@ -396,29 +396,29 @@ void rollforward(void) { struct req *p, *q, *prev; - struct slave *tslp; + struct worker *tmlp; int i, size, got; int64_t savedtapea; union u_spcl *ntb, *otb; - tslp = &slaves[SLAVES]; - ntb = (union u_spcl *)tslp->tblock[1]; + tmlp = &workers[WORKERS]; + ntb = (union u_spcl *)tmlp->tblock[1]; /* - * Each of the N slaves should have requests that need to - * be replayed on the next tape. Use the extra slave buffers - * (slaves[SLAVES]) to construct request lists to be sent to - * each slave in turn. + * Each of the N workers should have requests that need to + * be replayed on the next tape. Use the extra worker buffers + * (workers[WORKERS]) to construct request lists to be sent to + * each worker in turn. */ - for (i = 0; i < SLAVES; i++) { - q = &tslp->req[1]; - otb = (union u_spcl *)slp->tblock; + for (i = 0; i < WORKERS; i++) { + q = &tmlp->req[1]; + otb = (union u_spcl *)mlp->tblock; /* - * For each request in the current slave, copy it to tslp. + * For each request in the current worker, copy it to tmlp. */ prev = NULL; - for (p = slp->req; p->count > 0; p += p->count) { + for (p = mlp->req; p->count > 0; p += p->count) { *q = *p; if (p->dblk == 0) *ntb++ = *otb++; /* copy the datablock also */ @@ -433,26 +433,26 @@ rollforward(void) ntb--; q -= 1; q->count = 0; - q = &tslp->req[0]; + q = &tmlp->req[0]; if (i == 0) { q->dblk = 0; q->count = 1; trecno = 0; - nextblock = tslp->tblock; + nextblock = tmlp->tblock; savedtapea = spcl.c_tapea; - spcl.c_tapea = slp->tapea; + spcl.c_tapea = mlp->tapea; startnewtape(0); spcl.c_tapea = savedtapea; lastspclrec = savedtapea - 1; } size = (char *)ntb - (char *)q; - if (atomic(write, slp->fd, (char *)q, size) != size) { + if (atomic(write, mlp->fd, (char *)q, size) != size) { perror(" DUMP: error writing command pipe"); dumpabort(0); } - slp->sent = 1; - if (++slp >= &slaves[SLAVES]) - slp = &slaves[0]; + mlp->sent = 1; + if (++mlp >= &workers[WORKERS]) + mlp = &workers[0]; q->count = 1; @@ -464,34 +464,34 @@ rollforward(void) */ q->dblk = prev->dblk + prev->count * (TP_BSIZE / DEV_BSIZE); - ntb = (union u_spcl *)tslp->tblock; + ntb = (union u_spcl *)tmlp->tblock; } else { /* * It wasn't a disk block. Copy the data to its * new location in the buffer. */ q->dblk = 0; - *((union u_spcl *)tslp->tblock) = *ntb; - ntb = (union u_spcl *)tslp->tblock[1]; + *((union u_spcl *)tmlp->tblock) = *ntb; + ntb = (union u_spcl *)tmlp->tblock[1]; } } - slp->req[0] = *q; - nextblock = slp->tblock; + mlp->req[0] = *q; + nextblock = mlp->tblock; if (q->dblk == 0) nextblock++; trecno = 1; /* - * Clear the first slaves' response. One hopes that it + * Clear the first workers' response. One hopes that it * worked ok, otherwise the tape is much too short! */ - if (slp->sent) { - if (atomic(read, slp->fd, (char *)&got, sizeof got) + if (mlp->sent) { + if (atomic(read, mlp->fd, (char *)&got, sizeof got) != sizeof got) { perror(" DUMP: error reading command pipe in master"); dumpabort(0); } - slp->sent = 0; + mlp->sent = 0; if (got != writesize) { quit("EOT detected at start of the tape!\n"); @@ -634,7 +634,7 @@ restore_check_point: } } - enslave(); /* Share open tape file descriptor with slaves */ + enworker(); /* Share open tape file descriptor with workers */ if (popenout) close(tapefd); /* Give up our copy of it. */ signal(SIGINFO, infosch); @@ -643,18 +643,18 @@ restore_check_point: blocksthisvol = 0; if (top) newtape++; /* new tape signal */ - spcl.c_count = slp->count; + spcl.c_count = mlp->count; /* * measure firstrec in TP_BSIZE units since restore doesn't * know the correct ntrec value... */ - spcl.c_firstrec = slp->firstrec; + spcl.c_firstrec = mlp->firstrec; spcl.c_volume++; spcl.c_type = TS_TAPE; - writeheader((ino_t)slp->inode); + writeheader((ino_t)mlp->inode); if (tapeno > 1) msg("Volume %d begins with blocks from inode %d\n", - tapeno, slp->inode); + tapeno, mlp->inode); } } @@ -687,7 +687,7 @@ Exit(status) } /* - * proceed - handler for SIGUSR2, used to synchronize IO between the slaves. + * proceed - handler for SIGUSR2, used to synchronize IO between the workers. */ void proceed(int signo __unused) @@ -699,45 +699,45 @@ proceed(int signo __unused) } void -enslave(void) +enworker(void) { int cmd[2]; int i, j; master = getpid(); - signal(SIGTERM, dumpabort); /* Slave sends SIGTERM on dumpabort() */ + signal(SIGTERM, dumpabort); /* Worker sends SIGTERM on dumpabort() */ signal(SIGPIPE, sigpipe); - signal(SIGUSR1, tperror); /* Slave sends SIGUSR1 on tape errors */ - signal(SIGUSR2, proceed); /* Slave sends SIGUSR2 to next slave */ + signal(SIGUSR1, tperror); /* Worker sends SIGUSR1 on tape errors */ + signal(SIGUSR2, proceed); /* Worker sends SIGUSR2 to next worker */ - for (i = 0; i < SLAVES; i++) { - if (i == slp - &slaves[0]) { + for (i = 0; i < WORKERS; i++) { + if (i == mlp - &workers[0]) { caught = 1; } else { caught = 0; } if (socketpair(AF_UNIX, SOCK_STREAM, 0, cmd) < 0 || - (slaves[i].pid = fork()) < 0) - quit("too many slaves, %d (recompile smaller): %s\n", + (workers[i].pid = fork()) < 0) + quit("too many workers, %d (recompile smaller): %s\n", i, strerror(errno)); - slaves[i].fd = cmd[1]; - slaves[i].sent = 0; - if (slaves[i].pid == 0) { /* Slave starts up here */ + workers[i].fd = cmd[1]; + workers[i].sent = 0; + if (workers[i].pid == 0) { /* Worker starts up here */ for (j = 0; j <= i; j++) - (void) close(slaves[j].fd); + (void) close(workers[j].fd); signal(SIGINT, SIG_IGN); /* Master handles this */ - doslave(cmd[0], i); + worker(cmd[0], i); Exit(X_FINOK); } } - for (i = 0; i < SLAVES; i++) - (void) atomic(write, slaves[i].fd, - (char *) &slaves[(i + 1) % SLAVES].pid, - sizeof slaves[0].pid); + for (i = 0; i < WORKERS; i++) + (void) atomic(write, workers[i].fd, + (char *) &workers[(i + 1) % WORKERS].pid, + sizeof workers[0].pid); master = 0; } @@ -747,10 +747,10 @@ killall(void) { int i; - for (i = 0; i < SLAVES; i++) - if (slaves[i].pid > 0) { - (void) kill(slaves[i].pid, SIGKILL); - slaves[i].sent = 0; + for (i = 0; i < WORKERS; i++) + if (workers[i].pid > 0) { + (void) kill(workers[i].pid, SIGKILL); + workers[i].sent = 0; } } @@ -762,42 +762,42 @@ killall(void) * get the lock back for the next cycle by swapping descriptors. */ static void -doslave(int cmd, int slave_number) +worker(int cmd, int worker_number) { int nread; - int nextslave, size, wrote, eot_count; + int nextworker, size, wrote, eot_count; /* * Need our own seek pointer. */ (void) close(diskfd); if ((diskfd = open(disk, O_RDONLY)) < 0) - quit("slave couldn't reopen disk: %s\n", strerror(errno)); + quit("worker couldn't reopen disk: %s\n", strerror(errno)); /* - * Need the pid of the next slave in the loop... + * Need the pid of the next worker in the loop... */ - if ((nread = atomic(read, cmd, (char *)&nextslave, sizeof nextslave)) - != sizeof nextslave) { - quit("master/slave protocol botched - didn't get pid of next slave.\n"); + if ((nread = atomic(read, cmd, (char *)&nextworker, sizeof nextworker)) + != sizeof nextworker) { + quit("master/worker protocol botched - didn't get pid of next worker.\n"); } /* * Get list of blocks to dump, read the blocks into tape buffer */ - while ((nread = atomic(read, cmd, (char *)slp->req, reqsiz)) == reqsiz) { - struct req *p = slp->req; + while ((nread = atomic(read, cmd, (char *)mlp->req, reqsiz)) == reqsiz) { + struct req *p = mlp->req; for (trecno = 0; trecno < ntrec; trecno += p->count, p += p->count) { if (p->dblk) { - blkread(p->dblk, slp->tblock[trecno], + blkread(p->dblk, mlp->tblock[trecno], p->count * TP_BSIZE); } else { if (p->count != 1 || atomic(read, cmd, - (char *)slp->tblock[trecno], + (char *)mlp->tblock[trecno], TP_BSIZE) != TP_BSIZE) - quit("master/slave protocol botched.\n"); + quit("master/worker protocol botched.\n"); } } if (setjmp(jmpbuf) == 0) { @@ -816,14 +816,14 @@ doslave(int cmd, int slave_number) while (eot_count < 10 && size < writesize) { #ifdef RDUMP if (host) - wrote = rmtwrite(slp->tblock[0]+size, + wrote = rmtwrite(mlp->tblock[0]+size, writesize-size); else #endif - wrote = write(tapefd, slp->tblock[0]+size, + wrote = write(tapefd, mlp->tblock[0]+size, writesize-size); #ifdef WRITEDEBUG - printf("slave %d wrote %d\n", slave_number, wrote); + printf("worker %d wrote %d\n", worker_number, wrote); #endif if (wrote < 0) break; @@ -834,8 +834,8 @@ doslave(int cmd, int slave_number) #ifdef WRITEDEBUG if (size != writesize) - printf("slave %d only wrote %d out of %d bytes and gave up.\n", - slave_number, size, writesize); + printf("worker %d only wrote %d out of %d bytes and gave up.\n", + worker_number, size, writesize); #endif /* @@ -862,10 +862,10 @@ doslave(int cmd, int slave_number) } /* - * If partial write, don't want next slave to go. + * If partial write, don't want next worker to go. * Also jolts him awake. */ - (void) kill(nextslave, SIGUSR2); + (void) kill(nextworker, SIGUSR2); } if (nread != 0) quit("error reading command pipe: %s\n", strerror(errno)); From owner-svn-src-all@freebsd.org Sat Jun 20 20:17:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 337A7333948 for ; Sat, 20 Jun 2020 20:17:14 +0000 (UTC) (envelope-from 01000172d360befb-33548c40-a644-4c19-88a0-a95df727e79a-000000@amazonses.com) Received: from a8-60.smtp-out.amazonses.com (a8-60.smtp-out.amazonses.com [54.240.8.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6Qx3bBVz3WV9 for ; Sat, 20 Jun 2020 20:17:13 +0000 (UTC) (envelope-from 01000172d360befb-33548c40-a644-4c19-88a0-a95df727e79a-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1592684232; h=Subject:From:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=eeJpO3j4f3GEr5UDdIPijZVHrw/CfPXDbFneDeyfJ2U=; b=DQixJtE9VQOjvLIJCrWQIB3IiGpktvHIxw3vNDSfrpDADTMdAdznVEuDxdmvCnDR nqS1NjZhOPUx1qwzahJ2hBlvTPdoc4LmBmrJIwn8f4Q2pwgMnczWLa0hNs6VAcXkOi0 ws3EGu8ilJ5b1evaPDg5tSbIjTv5bm4sABJxZ9zo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1592684232; h=Subject:From:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=eeJpO3j4f3GEr5UDdIPijZVHrw/CfPXDbFneDeyfJ2U=; b=Rh7csgc6yhEYh4SAQRJohmNVRGgN16eiYK2ItBmrD2hm3djeH6p/+U60oFBqGv4H UGF5cJOkBFDMUMB2qRRXuYh6GgHLxCwOGad+B8RBnRE9sLuDO29iU1syL4gjPUQD9ff 2WHtugKd4MTu/6mZvTNXfkTnfRspWzrLQTsXYWcI= Subject: Re: svn commit: r362444 - head/sbin/dump From: Colin Percival To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006202006.05KK6EqK016498@repo.freebsd.org> <01000172d35c9a9c-43c20dd3-498e-4541-80cf-eb96d7cc406b-000000@email.amazonses.com> Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <01000172d360befb-33548c40-a644-4c19-88a0-a95df727e79a-000000@email.amazonses.com> Date: Sat, 20 Jun 2020 20:17:12 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <01000172d35c9a9c-43c20dd3-498e-4541-80cf-eb96d7cc406b-000000@email.amazonses.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2020.06.20-54.240.8.60 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 49q6Qx3bBVz3WV9 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn header.b=DQixJtE9; dkim=pass header.d=amazonses.com header.s=224i4yxa5dv7c2xz3womw6peuasteono header.b=Rh7csgc6; dmarc=none; spf=pass (mx1.freebsd.org: domain of 01000172d360befb-33548c40-a644-4c19-88a0-a95df727e79a-000000@amazonses.com designates 54.240.8.60 as permitted sender) smtp.mailfrom=01000172d360befb-33548c40-a644-4c19-88a0-a95df727e79a-000000@amazonses.com X-Spamd-Result: default: False [-0.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.80)[-0.805]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn,amazonses.com:s=224i4yxa5dv7c2xz3womw6peuasteono]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18:c]; NEURAL_HAM_LONG(-0.97)[-0.971]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[tarsnap.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; NEURAL_HAM_SHORT(-0.68)[-0.677]; RCVD_IN_DNSWL_NONE(0.00)[54.240.8.60:from]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,01000172d360befb-33548c40-a644-4c19-88a0-a95df727e79a-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; RWL_MAILSPIKE_POSSIBLE(0.00)[54.240.8.60:from]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com,01000172d360befb-33548c40-a644-4c19-88a0-a95df727e79a-000000@amazonses.com]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:17:14 -0000 ... never mind, it looks like Conrad got here first with r362447. On 2020-06-20 13:12, Colin Percival wrote: > Thanks for backing this out, Warner. > > I'd like to change "slave" to "worker" here (which I think is a reasonably > neutral and entirely inoffensive term), and in the process perhaps make some > associated grammatical changes (since "enworker" is dubious at best). > > To avoid causing any further issues: If anyone objects to the word "worker" > please let me know in the next ~48 hours. I think there's enough people > reading svn-src-all that I can anticipate feedback now if anyone will care > deeply about that word. > > Colin Percival > > On 2020-06-20 13:06, Warner Losh wrote: >> Author: imp >> Date: Sat Jun 20 20:06:14 2020 >> New Revision: 362444 >> URL: https://svnweb.freebsd.org/changeset/base/362444 >> >> Log: >> Revert -r362422. >> >> While whimsical, there's too much negative energy around minion as well as the >> positive. >> >> Modified: >> head/sbin/dump/tape.c >> >> Modified: head/sbin/dump/tape.c >> ============================================================================== >> --- head/sbin/dump/tape.c Sat Jun 20 18:50:18 2020 (r362443) >> +++ head/sbin/dump/tape.c Sat Jun 20 20:06:14 2020 (r362444) >> @@ -75,19 +75,19 @@ static char *nexttape; >> static FILE *popenfp = NULL; >> >> static int atomic(ssize_t (*)(), int, char *, int); >> -static void dominion(int, int); >> -static void enminion(void); >> +static void doslave(int, int); >> +static void enslave(void); >> static void flushtape(void); >> static void killall(void); >> static void rollforward(void); >> >> /* >> * Concurrent dump mods (Caltech) - disk block reading and tape writing >> - * are exported to several minion processes. While one minion writes the >> + * are exported to several slave processes. While one slave writes the >> * tape, the others read disk blocks; they pass control of the tape in >> * a ring via signals. The parent process traverses the file system and >> - * sends writeheader()'s and lists of daddr's to the minions via pipes. >> - * The following structure defines the instruction packets sent to minions. >> + * sends writeheader()'s and lists of daddr's to the slaves via pipes. >> + * The following structure defines the instruction packets sent to slaves. >> */ >> struct req { >> ufs2_daddr_t dblk; >> @@ -95,20 +95,20 @@ struct req { >> }; >> static int reqsiz; >> >> -#define MINIONS 3 /* 1 minion writing, 1 reading, 1 for slack */ >> -static struct minion { >> +#define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */ >> +static struct slave { >> int64_t tapea; /* header number at start of this chunk */ >> int64_t firstrec; /* record number of this block */ >> int count; /* count to next header (used for TS_TAPE */ >> /* after EOT) */ >> int inode; /* inode that we are currently dealing with */ >> - int fd; /* FD for this minion */ >> - int pid; /* PID for this minion */ >> - int sent; /* 1 == we've sent this minion requests */ >> + int fd; /* FD for this slave */ >> + int pid; /* PID for this slave */ >> + int sent; /* 1 == we've sent this slave requests */ >> char (*tblock)[TP_BSIZE]; /* buffer for data blocks */ >> struct req *req; /* buffer for requests */ >> -} minions[MINIONS+1]; >> -static struct minion *mlp; >> +} slaves[SLAVES+1]; >> +static struct slave *slp; >> >> static char (*nextblock)[TP_BSIZE]; >> >> @@ -116,9 +116,9 @@ static int master; /* pid of master, for sending error >> static int tenths; /* length of tape used per block written */ >> static volatile sig_atomic_t caught; /* have we caught the signal to proceed? */ >> static volatile sig_atomic_t ready; /* reached the lock point without having */ >> - /* received the SIGUSR2 signal from the prev minion? */ >> + /* received the SIGUSR2 signal from the prev slave? */ >> static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ >> - /* SIGUSR2 arrives from the previous minion */ >> + /* SIGUSR2 arrives from the previous slave */ >> >> int >> alloctape(void) >> @@ -143,20 +143,20 @@ alloctape(void) >> * packets, so flushtape() can write them together with one write(). >> * Align tape buffer on page boundary to speed up tape write(). >> */ >> - for (i = 0; i <= MINIONS; i++) { >> + for (i = 0; i <= SLAVES; i++) { >> buf = (char *) >> malloc((unsigned)(reqsiz + writesize + pgoff + TP_BSIZE)); >> if (buf == NULL) >> return(0); >> - minions[i].tblock = (char (*)[TP_BSIZE]) >> + slaves[i].tblock = (char (*)[TP_BSIZE]) >> (((long)&buf[ntrec + 1] + pgoff) &~ pgoff); >> - minions[i].req = (struct req *)minions[i].tblock - ntrec - 1; >> + slaves[i].req = (struct req *)slaves[i].tblock - ntrec - 1; >> } >> - mlp = &minions[0]; >> - mlp->count = 1; >> - mlp->tapea = 0; >> - mlp->firstrec = 0; >> - nextblock = mlp->tblock; >> + slp = &slaves[0]; >> + slp->count = 1; >> + slp->tapea = 0; >> + slp->firstrec = 0; >> + nextblock = slp->tblock; >> return(1); >> } >> >> @@ -164,8 +164,8 @@ void >> writerec(char *dp, int isspcl) >> { >> >> - mlp->req[trecno].dblk = (ufs2_daddr_t)0; >> - mlp->req[trecno].count = 1; >> + slp->req[trecno].dblk = (ufs2_daddr_t)0; >> + slp->req[trecno].count = 1; >> /* Can't do a structure assignment due to alignment problems */ >> bcopy(dp, *(nextblock)++, sizeof (union u_spcl)); >> if (isspcl) >> @@ -185,8 +185,8 @@ dumpblock(ufs2_daddr_t blkno, int size) >> dblkno = fsbtodb(sblock, blkno); >> tpblks = size >> tp_bshift; >> while ((avail = MIN(tpblks, ntrec - trecno)) > 0) { >> - mlp->req[trecno].dblk = dblkno; >> - mlp->req[trecno].count = avail; >> + slp->req[trecno].dblk = dblkno; >> + slp->req[trecno].count = avail; >> trecno += avail; >> spcl.c_tapea += avail; >> if (trecno >= ntrec) >> @@ -232,27 +232,27 @@ flushtape(void) >> int i, blks, got; >> int64_t lastfirstrec; >> >> - int siz = (char *)nextblock - (char *)mlp->req; >> + int siz = (char *)nextblock - (char *)slp->req; >> >> - mlp->req[trecno].count = 0; /* Sentinel */ >> + slp->req[trecno].count = 0; /* Sentinel */ >> >> - if (atomic(write, mlp->fd, (char *)mlp->req, siz) != siz) >> + if (atomic(write, slp->fd, (char *)slp->req, siz) != siz) >> quit("error writing command pipe: %s\n", strerror(errno)); >> - mlp->sent = 1; /* we sent a request, read the response later */ >> + slp->sent = 1; /* we sent a request, read the response later */ >> >> - lastfirstrec = mlp->firstrec; >> + lastfirstrec = slp->firstrec; >> >> - if (++mlp >= &minions[MINIONS]) >> - mlp = &minions[0]; >> + if (++slp >= &slaves[SLAVES]) >> + slp = &slaves[0]; >> >> - /* Read results back from next minion */ >> - if (mlp->sent) { >> - if (atomic(read, mlp->fd, (char *)&got, sizeof got) >> + /* Read results back from next slave */ >> + if (slp->sent) { >> + if (atomic(read, slp->fd, (char *)&got, sizeof got) >> != sizeof got) { >> perror(" DUMP: error reading command pipe in master"); >> dumpabort(0); >> } >> - mlp->sent = 0; >> + slp->sent = 0; >> >> /* Check for end of tape */ >> if (got < writesize) { >> @@ -262,15 +262,15 @@ flushtape(void) >> * Drain the results, don't care what the values were. >> * If we read them here then trewind won't... >> */ >> - for (i = 0; i < MINIONS; i++) { >> - if (minions[i].sent) { >> - if (atomic(read, minions[i].fd, >> + for (i = 0; i < SLAVES; i++) { >> + if (slaves[i].sent) { >> + if (atomic(read, slaves[i].fd, >> (char *)&got, sizeof got) >> != sizeof got) { >> perror(" DUMP: error reading command pipe in master"); >> dumpabort(0); >> } >> - minions[i].sent = 0; >> + slaves[i].sent = 0; >> } >> } >> >> @@ -288,11 +288,11 @@ flushtape(void) >> if (spcl.c_addr[i] != 0) >> blks++; >> } >> - mlp->count = lastspclrec + blks + 1 - spcl.c_tapea; >> - mlp->tapea = spcl.c_tapea; >> - mlp->firstrec = lastfirstrec + ntrec; >> - mlp->inode = curino; >> - nextblock = mlp->tblock; >> + slp->count = lastspclrec + blks + 1 - spcl.c_tapea; >> + slp->tapea = spcl.c_tapea; >> + slp->firstrec = lastfirstrec + ntrec; >> + slp->inode = curino; >> + nextblock = slp->tblock; >> trecno = 0; >> asize += tenths; >> blockswritten += ntrec; >> @@ -312,7 +312,7 @@ trewind(void) >> int f; >> int got; >> >> - for (f = 0; f < MINIONS; f++) { >> + for (f = 0; f < SLAVES; f++) { >> /* >> * Drain the results, but unlike EOT we DO (or should) care >> * what the return values were, since if we detect EOT after >> @@ -321,22 +321,22 @@ trewind(void) >> * >> * fixme: punt for now. >> */ >> - if (minions[f].sent) { >> - if (atomic(read, minions[f].fd, (char *)&got, sizeof got) >> + if (slaves[f].sent) { >> + if (atomic(read, slaves[f].fd, (char *)&got, sizeof got) >> != sizeof got) { >> perror(" DUMP: error reading command pipe in master"); >> dumpabort(0); >> } >> - minions[f].sent = 0; >> + slaves[f].sent = 0; >> if (got != writesize) { >> msg("EOT detected in last 2 tape records!\n"); >> msg("Use a longer tape, decrease the size estimate\n"); >> quit("or use no size estimate at all.\n"); >> } >> } >> - (void) close(minions[f].fd); >> + (void) close(slaves[f].fd); >> } >> - while (wait((int *)NULL) >= 0) /* wait for any signals from minions */ >> + while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ >> /* void */; >> >> if (pipeout) >> @@ -396,29 +396,29 @@ void >> rollforward(void) >> { >> struct req *p, *q, *prev; >> - struct minion *tmlp; >> + struct slave *tslp; >> int i, size, got; >> int64_t savedtapea; >> union u_spcl *ntb, *otb; >> - tmlp = &minions[MINIONS]; >> - ntb = (union u_spcl *)tmlp->tblock[1]; >> + tslp = &slaves[SLAVES]; >> + ntb = (union u_spcl *)tslp->tblock[1]; >> >> /* >> - * Each of the N minions should have requests that need to >> - * be replayed on the next tape. Use the extra minion buffers >> - * (minions[MINIONS]) to construct request lists to be sent to >> - * each minion in turn. >> + * Each of the N slaves should have requests that need to >> + * be replayed on the next tape. Use the extra slave buffers >> + * (slaves[SLAVES]) to construct request lists to be sent to >> + * each slave in turn. >> */ >> - for (i = 0; i < MINIONS; i++) { >> - q = &tmlp->req[1]; >> - otb = (union u_spcl *)mlp->tblock; >> + for (i = 0; i < SLAVES; i++) { >> + q = &tslp->req[1]; >> + otb = (union u_spcl *)slp->tblock; >> >> /* >> - * For each request in the current minion, copy it to tmlp. >> + * For each request in the current slave, copy it to tslp. >> */ >> >> prev = NULL; >> - for (p = mlp->req; p->count > 0; p += p->count) { >> + for (p = slp->req; p->count > 0; p += p->count) { >> *q = *p; >> if (p->dblk == 0) >> *ntb++ = *otb++; /* copy the datablock also */ >> @@ -433,26 +433,26 @@ rollforward(void) >> ntb--; >> q -= 1; >> q->count = 0; >> - q = &tmlp->req[0]; >> + q = &tslp->req[0]; >> if (i == 0) { >> q->dblk = 0; >> q->count = 1; >> trecno = 0; >> - nextblock = tmlp->tblock; >> + nextblock = tslp->tblock; >> savedtapea = spcl.c_tapea; >> - spcl.c_tapea = mlp->tapea; >> + spcl.c_tapea = slp->tapea; >> startnewtape(0); >> spcl.c_tapea = savedtapea; >> lastspclrec = savedtapea - 1; >> } >> size = (char *)ntb - (char *)q; >> - if (atomic(write, mlp->fd, (char *)q, size) != size) { >> + if (atomic(write, slp->fd, (char *)q, size) != size) { >> perror(" DUMP: error writing command pipe"); >> dumpabort(0); >> } >> - mlp->sent = 1; >> - if (++mlp >= &minions[MINIONS]) >> - mlp = &minions[0]; >> + slp->sent = 1; >> + if (++slp >= &slaves[SLAVES]) >> + slp = &slaves[0]; >> >> q->count = 1; >> >> @@ -464,34 +464,34 @@ rollforward(void) >> */ >> q->dblk = prev->dblk + >> prev->count * (TP_BSIZE / DEV_BSIZE); >> - ntb = (union u_spcl *)tmlp->tblock; >> + ntb = (union u_spcl *)tslp->tblock; >> } else { >> /* >> * It wasn't a disk block. Copy the data to its >> * new location in the buffer. >> */ >> q->dblk = 0; >> - *((union u_spcl *)tmlp->tblock) = *ntb; >> - ntb = (union u_spcl *)tmlp->tblock[1]; >> + *((union u_spcl *)tslp->tblock) = *ntb; >> + ntb = (union u_spcl *)tslp->tblock[1]; >> } >> } >> - mlp->req[0] = *q; >> - nextblock = mlp->tblock; >> + slp->req[0] = *q; >> + nextblock = slp->tblock; >> if (q->dblk == 0) >> nextblock++; >> trecno = 1; >> >> /* >> - * Clear the first minions' response. One hopes that it >> + * Clear the first slaves' response. One hopes that it >> * worked ok, otherwise the tape is much too short! >> */ >> - if (mlp->sent) { >> - if (atomic(read, mlp->fd, (char *)&got, sizeof got) >> + if (slp->sent) { >> + if (atomic(read, slp->fd, (char *)&got, sizeof got) >> != sizeof got) { >> perror(" DUMP: error reading command pipe in master"); >> dumpabort(0); >> } >> - mlp->sent = 0; >> + slp->sent = 0; >> >> if (got != writesize) { >> quit("EOT detected at start of the tape!\n"); >> @@ -634,7 +634,7 @@ restore_check_point: >> } >> } >> >> - enminion(); /* Share open tape file descriptor with minions */ >> + enslave(); /* Share open tape file descriptor with slaves */ >> if (popenout) >> close(tapefd); /* Give up our copy of it. */ >> signal(SIGINFO, infosch); >> @@ -643,18 +643,18 @@ restore_check_point: >> blocksthisvol = 0; >> if (top) >> newtape++; /* new tape signal */ >> - spcl.c_count = mlp->count; >> + spcl.c_count = slp->count; >> /* >> * measure firstrec in TP_BSIZE units since restore doesn't >> * know the correct ntrec value... >> */ >> - spcl.c_firstrec = mlp->firstrec; >> + spcl.c_firstrec = slp->firstrec; >> spcl.c_volume++; >> spcl.c_type = TS_TAPE; >> - writeheader((ino_t)mlp->inode); >> + writeheader((ino_t)slp->inode); >> if (tapeno > 1) >> msg("Volume %d begins with blocks from inode %d\n", >> - tapeno, mlp->inode); >> + tapeno, slp->inode); >> } >> } >> >> @@ -687,7 +687,7 @@ Exit(status) >> } >> >> /* >> - * proceed - handler for SIGUSR2, used to synchronize IO between the minions. >> + * proceed - handler for SIGUSR2, used to synchronize IO between the slaves. >> */ >> void >> proceed(int signo __unused) >> @@ -699,45 +699,45 @@ proceed(int signo __unused) >> } >> >> void >> -enminion(void) >> +enslave(void) >> { >> int cmd[2]; >> int i, j; >> >> master = getpid(); >> >> - signal(SIGTERM, dumpabort); /* Minion sends SIGTERM on dumpabort() */ >> + signal(SIGTERM, dumpabort); /* Slave sends SIGTERM on dumpabort() */ >> signal(SIGPIPE, sigpipe); >> - signal(SIGUSR1, tperror); /* Minion sends SIGUSR1 on tape errors */ >> - signal(SIGUSR2, proceed); /* Minion sends SIGUSR2 to next minion */ >> + signal(SIGUSR1, tperror); /* Slave sends SIGUSR1 on tape errors */ >> + signal(SIGUSR2, proceed); /* Slave sends SIGUSR2 to next slave */ >> >> - for (i = 0; i < MINIONS; i++) { >> - if (i == mlp - &minions[0]) { >> + for (i = 0; i < SLAVES; i++) { >> + if (i == slp - &slaves[0]) { >> caught = 1; >> } else { >> caught = 0; >> } >> >> if (socketpair(AF_UNIX, SOCK_STREAM, 0, cmd) < 0 || >> - (minions[i].pid = fork()) < 0) >> - quit("too many minions, %d (recompile smaller): %s\n", >> + (slaves[i].pid = fork()) < 0) >> + quit("too many slaves, %d (recompile smaller): %s\n", >> i, strerror(errno)); >> >> - minions[i].fd = cmd[1]; >> - minions[i].sent = 0; >> - if (minions[i].pid == 0) { /* Minion starts up here */ >> + slaves[i].fd = cmd[1]; >> + slaves[i].sent = 0; >> + if (slaves[i].pid == 0) { /* Slave starts up here */ >> for (j = 0; j <= i; j++) >> - (void) close(minions[j].fd); >> + (void) close(slaves[j].fd); >> signal(SIGINT, SIG_IGN); /* Master handles this */ >> - dominion(cmd[0], i); >> + doslave(cmd[0], i); >> Exit(X_FINOK); >> } >> } >> >> - for (i = 0; i < MINIONS; i++) >> - (void) atomic(write, minions[i].fd, >> - (char *) &minions[(i + 1) % MINIONS].pid, >> - sizeof minions[0].pid); >> + for (i = 0; i < SLAVES; i++) >> + (void) atomic(write, slaves[i].fd, >> + (char *) &slaves[(i + 1) % SLAVES].pid, >> + sizeof slaves[0].pid); >> >> master = 0; >> } >> @@ -747,10 +747,10 @@ killall(void) >> { >> int i; >> >> - for (i = 0; i < MINIONS; i++) >> - if (minions[i].pid > 0) { >> - (void) kill(minions[i].pid, SIGKILL); >> - minions[i].sent = 0; >> + for (i = 0; i < SLAVES; i++) >> + if (slaves[i].pid > 0) { >> + (void) kill(slaves[i].pid, SIGKILL); >> + slaves[i].sent = 0; >> } >> } >> >> @@ -762,42 +762,42 @@ killall(void) >> * get the lock back for the next cycle by swapping descriptors. >> */ >> static void >> -dominion(int cmd, int minion_number) >> +doslave(int cmd, int slave_number) >> { >> int nread; >> - int nextminion, size, wrote, eot_count; >> + int nextslave, size, wrote, eot_count; >> >> /* >> * Need our own seek pointer. >> */ >> (void) close(diskfd); >> if ((diskfd = open(disk, O_RDONLY)) < 0) >> - quit("minion couldn't reopen disk: %s\n", strerror(errno)); >> + quit("slave couldn't reopen disk: %s\n", strerror(errno)); >> >> /* >> - * Need the pid of the next minion in the loop... >> + * Need the pid of the next slave in the loop... >> */ >> - if ((nread = atomic(read, cmd, (char *)&nextminion, sizeof nextminion)) >> - != sizeof nextminion) { >> - quit("master/minion protocol botched - didn't get pid of next minion.\n"); >> + if ((nread = atomic(read, cmd, (char *)&nextslave, sizeof nextslave)) >> + != sizeof nextslave) { >> + quit("master/slave protocol botched - didn't get pid of next slave.\n"); >> } >> >> /* >> * Get list of blocks to dump, read the blocks into tape buffer >> */ >> - while ((nread = atomic(read, cmd, (char *)mlp->req, reqsiz)) == reqsiz) { >> - struct req *p = mlp->req; >> + while ((nread = atomic(read, cmd, (char *)slp->req, reqsiz)) == reqsiz) { >> + struct req *p = slp->req; >> >> for (trecno = 0; trecno < ntrec; >> trecno += p->count, p += p->count) { >> if (p->dblk) { >> - blkread(p->dblk, mlp->tblock[trecno], >> + blkread(p->dblk, slp->tblock[trecno], >> p->count * TP_BSIZE); >> } else { >> if (p->count != 1 || atomic(read, cmd, >> - (char *)mlp->tblock[trecno], >> + (char *)slp->tblock[trecno], >> TP_BSIZE) != TP_BSIZE) >> - quit("master/minion protocol botched.\n"); >> + quit("master/slave protocol botched.\n"); >> } >> } >> if (setjmp(jmpbuf) == 0) { >> @@ -816,14 +816,14 @@ dominion(int cmd, int minion_number) >> while (eot_count < 10 && size < writesize) { >> #ifdef RDUMP >> if (host) >> - wrote = rmtwrite(mlp->tblock[0]+size, >> + wrote = rmtwrite(slp->tblock[0]+size, >> writesize-size); >> else >> #endif >> - wrote = write(tapefd, mlp->tblock[0]+size, >> + wrote = write(tapefd, slp->tblock[0]+size, >> writesize-size); >> #ifdef WRITEDEBUG >> - printf("minion %d wrote %d\n", minion_number, wrote); >> + printf("slave %d wrote %d\n", slave_number, wrote); >> #endif >> if (wrote < 0) >> break; >> @@ -834,8 +834,8 @@ dominion(int cmd, int minion_number) >> >> #ifdef WRITEDEBUG >> if (size != writesize) >> - printf("minion %d only wrote %d out of %d bytes and gave up.\n", >> - minion_number, size, writesize); >> + printf("slave %d only wrote %d out of %d bytes and gave up.\n", >> + slave_number, size, writesize); >> #endif >> >> /* >> @@ -862,10 +862,10 @@ dominion(int cmd, int minion_number) >> } >> >> /* >> - * If partial write, don't want next minion to go. >> + * If partial write, don't want next slave to go. >> * Also jolts him awake. >> */ >> - (void) kill(nextminion, SIGUSR2); >> + (void) kill(nextslave, SIGUSR2); >> } >> if (nread != 0) >> quit("error reading command pipe: %s\n", strerror(errno)); >> > -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Sat Jun 20 20:19:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2857B333B0F; Sat, 20 Jun 2020 20:19:35 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6Tg0Htbz3WTL; Sat, 20 Jun 2020 20:19:35 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F0FC81CC96; Sat, 20 Jun 2020 20:19:34 +0000 (UTC) Date: Sat, 20 Jun 2020 20:19:34 +0000 From: Alexey Dokuchaev To: Colin Percival Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362444 - head/sbin/dump Message-ID: <20200620201934.GA8270@FreeBSD.org> References: <202006202006.05KK6EqK016498@repo.freebsd.org> <01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@email.amazonses.com> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:19:35 -0000 On Sat, Jun 20, 2020 at 08:12:40PM +0000, Colin Percival wrote: > Thanks for backing this out, Warner. I also appreciate it. > I'd like to change "slave" to "worker" here (which I think is a reasonably > neutral and entirely inoffensive term), and in the process perhaps make some > associated grammatical changes (since "enworker" is dubious at best). > > To avoid causing any further issues: If anyone objects to the word "worker" > please let me know in the next ~48 hours. I think there's enough people > reading svn-src-all that I can anticipate feedback now if anyone will care > deeply about that word. Please, just open a DR for that so all interested parties can participate and fine-tune particular grammar and language choices. Also, r362447 should be reverted on the same grounds as r362422. ./danfe From owner-svn-src-all@freebsd.org Sat Jun 20 20:20:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91DCE333BA1; Sat, 20 Jun 2020 20:20:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6VT3JvZz3WZh; Sat, 20 Jun 2020 20:20:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D07011ECA; Sat, 20 Jun 2020 20:20:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KKKHOY022968; Sat, 20 Jun 2020 20:20:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KKKGj3022964; Sat, 20 Jun 2020 20:20:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006202020.05KKKGj3022964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Jun 2020 20:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362448 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:20:17 -0000 Author: tuexen Date: Sat Jun 20 20:20:16 2020 New Revision: 362448 URL: https://svnweb.freebsd.org/changeset/base/362448 Log: Cleanup the adding and deleting of addresses via sctp_bindx(). There is no need to use the association identifier, so remove it. While there, cleanup the code a bit. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Jun 20 20:14:50 2020 (r362447) +++ head/sys/netinet/sctp_usrreq.c Sat Jun 20 20:20:16 2020 (r362448) @@ -6032,9 +6032,7 @@ sctp_setopt(struct socket *so, int optname, void *optv error = EAFNOSUPPORT; break; } - sctp_bindx_add_address(so, inp, addrs->addr, - addrs->sget_assoc_id, vrf_id, - &error, p); + sctp_bindx_add_address(so, inp, addrs->addr, vrf_id, &error, p); break; } case SCTP_BINDX_REM_ADDR: @@ -6078,9 +6076,7 @@ sctp_setopt(struct socket *so, int optname, void *optv error = EAFNOSUPPORT; break; } - sctp_bindx_delete_address(inp, addrs->addr, - addrs->sget_assoc_id, vrf_id, - &error); + sctp_bindx_delete_address(inp, addrs->addr, vrf_id, &error); break; } case SCTP_EVENT: Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Jun 20 20:14:50 2020 (r362447) +++ head/sys/netinet/sctputil.c Sat Jun 20 20:20:16 2020 (r362448) @@ -6694,13 +6694,21 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, stru */ void sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp, - struct sockaddr *sa, sctp_assoc_t assoc_id, - uint32_t vrf_id, int *error, void *p) + struct sockaddr *sa, uint32_t vrf_id, int *error, + void *p) { - struct sockaddr *addr_touse; #if defined(INET) && defined(INET6) struct sockaddr_in sin; #endif +#ifdef INET6 + struct sockaddr_in6 *sin6; +#endif +#ifdef INET + struct sockaddr_in *sinp; +#endif + struct sockaddr *addr_to_use; + struct sctp_inpcb *lep; + uint16_t port; /* see if we're bound all already! */ if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { @@ -6708,13 +6716,9 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ *error = EINVAL; return; } - addr_touse = sa; + switch (sa->sa_family) { #ifdef INET6 - if (sa->sa_family == AF_INET6) { -#ifdef INET - struct sockaddr_in6 *sin6; - -#endif + case AF_INET6: if (sa->sa_len != sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6726,8 +6730,9 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ *error = EINVAL; return; } + sin6 = (struct sockaddr_in6 *)sa; + port = sin6->sin6_port; #ifdef INET - sin6 = (struct sockaddr_in6 *)addr_touse; if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && SCTP_IPV6_V6ONLY(inp)) { @@ -6737,13 +6742,15 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ return; } in6_sin6_2_sin(&sin, sin6); - addr_touse = (struct sockaddr *)&sin; + addr_to_use = (struct sockaddr *)&sin; + } else { + addr_to_use = sa; } #endif - } + break; #endif #ifdef INET - if (sa->sa_family == AF_INET) { + case AF_INET: if (sa->sa_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6756,8 +6763,16 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ *error = EINVAL; return; } - } + sinp = (struct sockaddr_in *)sa; + port = sinp->sin_port; + addr_to_use = sa; + break; #endif + default: + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + *error = EINVAL; + return; + } if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { if (p == NULL) { /* Can't get proc for Net/Open BSD */ @@ -6765,55 +6780,25 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ *error = EINVAL; return; } - *error = sctp_inpcb_bind(so, addr_touse, NULL, p); + *error = sctp_inpcb_bind(so, addr_to_use, NULL, p); return; } - /* - * No locks required here since bind and mgmt_ep_sa all do their own - * locking. If we do something for the FIX: below we may need to - * lock in that case. - */ - if (assoc_id == 0) { + /* Validate the incoming port. */ + if ((port != 0) && (port != inp->sctp_lport)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + *error = EINVAL; + return; + } + lep = sctp_pcb_findep(addr_to_use, 1, 0, vrf_id); + if (lep == NULL) { /* add the address */ - struct sctp_inpcb *lep; - struct sockaddr_in *lsin = (struct sockaddr_in *)addr_touse; - - /* validate the incoming port */ - if ((lsin->sin_port != 0) && - (lsin->sin_port != inp->sctp_lport)) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - return; - } else { - /* user specified 0 port, set it to existing port */ - lsin->sin_port = inp->sctp_lport; - } - - lep = sctp_pcb_findep(addr_touse, 1, 0, vrf_id); - if (lep != NULL) { - /* - * We must decrement the refcount since we have the - * ep already and are binding. No remove going on - * here. - */ - SCTP_INP_DECR_REF(lep); - } - if (lep == inp) { - /* already bound to it.. ok */ - return; - } else if (lep == NULL) { - ((struct sockaddr_in *)addr_touse)->sin_port = 0; - *error = sctp_addr_mgmt_ep_sa(inp, addr_touse, - SCTP_ADD_IP_ADDRESS, vrf_id); - } else { + *error = sctp_addr_mgmt_ep_sa(inp, addr_to_use, + SCTP_ADD_IP_ADDRESS, vrf_id); + } else { + if (lep != inp) { *error = EADDRINUSE; } - if (*error) - return; - } else { - /* - * FIX: decide whether we allow assoc based bindx - */ + SCTP_INP_DECR_REF(lep); } } @@ -6823,11 +6808,11 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ */ void sctp_bindx_delete_address(struct sctp_inpcb *inp, - struct sockaddr *sa, sctp_assoc_t assoc_id, - uint32_t vrf_id, int *error) + struct sockaddr *sa, uint32_t vrf_id, int *error) { - struct sockaddr *addr_touse; + struct sockaddr *addr_to_use; #if defined(INET) && defined(INET6) + struct sockaddr_in6 *sin6; struct sockaddr_in sin; #endif @@ -6837,13 +6822,9 @@ sctp_bindx_delete_address(struct sctp_inpcb *inp, *error = EINVAL; return; } - addr_touse = sa; + switch (sa->sa_family) { #ifdef INET6 - if (sa->sa_family == AF_INET6) { -#ifdef INET - struct sockaddr_in6 *sin6; -#endif - + case AF_INET6: if (sa->sa_len != sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6856,7 +6837,7 @@ sctp_bindx_delete_address(struct sctp_inpcb *inp, return; } #ifdef INET - sin6 = (struct sockaddr_in6 *)addr_touse; + sin6 = (struct sockaddr_in6 *)sa; if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && SCTP_IPV6_V6ONLY(inp)) { @@ -6866,13 +6847,15 @@ sctp_bindx_delete_address(struct sctp_inpcb *inp, return; } in6_sin6_2_sin(&sin, sin6); - addr_touse = (struct sockaddr *)&sin; + addr_to_use = (struct sockaddr *)&sin; + } else { + addr_to_use = sa; } #endif - } + break; #endif #ifdef INET - if (sa->sa_family == AF_INET) { + case AF_INET: if (sa->sa_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6885,22 +6868,17 @@ sctp_bindx_delete_address(struct sctp_inpcb *inp, *error = EINVAL; return; } - } + addr_to_use = sa; + break; #endif - /* - * No lock required mgmt_ep_sa does its own locking. If the FIX: - * below is ever changed we may need to lock before calling - * association level binding. - */ - if (assoc_id == 0) { - /* delete the address */ - *error = sctp_addr_mgmt_ep_sa(inp, addr_touse, - SCTP_DEL_IP_ADDRESS, vrf_id); - } else { - /* - * FIX: decide whether we allow assoc based bindx - */ + default: + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + *error = EINVAL; + return; } + /* No lock required mgmt_ep_sa does its own locking. */ + *error = sctp_addr_mgmt_ep_sa(inp, addr_to_use, SCTP_DEL_IP_ADDRESS, + vrf_id); } /* Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sat Jun 20 20:14:50 2020 (r362447) +++ head/sys/netinet/sctputil.h Sat Jun 20 20:20:16 2020 (r362448) @@ -229,11 +229,10 @@ struct mbuf *sctp_generate_no_user_data_cause(uint32_t void sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp, - struct sockaddr *sa, sctp_assoc_t assoc_id, - uint32_t vrf_id, int *error, void *p); + struct sockaddr *sa, uint32_t vrf_id, int *error, + void *p); void -sctp_bindx_delete_address(struct sctp_inpcb *inp, - struct sockaddr *sa, sctp_assoc_t assoc_id, +sctp_bindx_delete_address(struct sctp_inpcb *inp, struct sockaddr *sa, uint32_t vrf_id, int *error); int sctp_local_addr_count(struct sctp_tcb *stcb); From owner-svn-src-all@freebsd.org Sat Jun 20 20:21:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6697333B45; Sat, 20 Jun 2020 20:21:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6WP5N5Cz3WxC; Sat, 20 Jun 2020 20:21:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3EF711F02; Sat, 20 Jun 2020 20:21:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KKL5ta023051; Sat, 20 Jun 2020 20:21:05 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KKL5Ju023048; Sat, 20 Jun 2020 20:21:05 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202006202021.05KKL5Ju023048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 20 Jun 2020 20:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362449 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 362449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:21:05 -0000 Author: jeff Date: Sat Jun 20 20:21:04 2020 New Revision: 362449 URL: https://svnweb.freebsd.org/changeset/base/362449 Log: Clarify some language. Favor primary where both master and primary were used in conjunction with secondary. Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sat Jun 20 20:20:16 2020 (r362448) +++ head/sys/vm/uma.h Sat Jun 20 20:21:04 2020 (r362449) @@ -197,24 +197,23 @@ uma_zone_t uma_zcreate(const char *name, size_t size, * ctor/dtor/zinit/zfini may all be null, see notes above. * Note that the zinit and zfini specified here are NOT * exactly the same as the init/fini specified to uma_zcreate() - * when creating a master zone. These zinit/zfini are called + * when creating a primary zone. These zinit/zfini are called * on the TRANSITION from keg to zone (and vice-versa). Once * these are set, the primary zone may alter its init/fini * (which are called when the object passes from VM to keg) * using uma_zone_set_init/fini()) as well as its own - * zinit/zfini (unset by default for master zone) with + * zinit/zfini (unset by default for primary zone) with * uma_zone_set_zinit/zfini() (note subtle 'z' prefix). * - * master A reference to this zone's Master Zone (Primary Zone), - * which contains the backing Keg for the Secondary Zone - * being added. + * primary A reference to this zone's Primary Zone which contains the + * backing Keg for the Secondary Zone being added. * * Returns: * A pointer to a structure which is intended to be opaque to users of * the interface. The value may be null if the wait flag is not set. */ uma_zone_t uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor, - uma_init zinit, uma_fini zfini, uma_zone_t master); + uma_init zinit, uma_fini zfini, uma_zone_t primary); /* * Create cache-only zones. Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Jun 20 20:20:16 2020 (r362448) +++ head/sys/vm/uma_core.c Sat Jun 20 20:21:04 2020 (r362449) @@ -2197,7 +2197,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_dr.dr_iter = 0; /* - * The master zone is passed to us at keg-creation time. + * The primary zone is passed to us at keg-creation time. */ zone = arg->zone; keg->uk_name = zone->uz_name; @@ -2808,7 +2808,7 @@ uma_startup1(vm_offset_t virtual_avail) { struct uma_zctor_args args; size_t ksize, zsize, size; - uma_keg_t masterkeg; + uma_keg_t primarykeg; uintptr_t m; int domain; uint8_t pflag; @@ -2838,7 +2838,7 @@ uma_startup1(vm_offset_t virtual_avail) m += zsize; kegs = (uma_zone_t)m; m += zsize; - masterkeg = (uma_keg_t)m; + primarykeg = (uma_keg_t)m; /* "manually" create the initial zone */ memset(&args, 0, sizeof(args)); @@ -2848,7 +2848,7 @@ uma_startup1(vm_offset_t virtual_avail) args.dtor = keg_dtor; args.uminit = zero_init; args.fini = NULL; - args.keg = masterkeg; + args.keg = primarykeg; args.align = UMA_SUPER_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); @@ -3024,13 +3024,13 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct /* See uma.h */ uma_zone_t uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor, - uma_init zinit, uma_fini zfini, uma_zone_t master) + uma_init zinit, uma_fini zfini, uma_zone_t primary) { struct uma_zctor_args args; uma_keg_t keg; uma_zone_t res; - keg = master->uz_keg; + keg = primary->uz_keg; memset(&args, 0, sizeof(args)); args.name = name; args.size = keg->uk_size; Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sat Jun 20 20:20:16 2020 (r362448) +++ head/sys/vm/uma_int.h Sat Jun 20 20:21:04 2020 (r362449) @@ -97,8 +97,8 @@ * safely only from their associated CPU, while the Zones backed by the same * Keg all share a common Keg lock (to coalesce contention on the backing * slabs). The backing Keg typically only serves one Zone but in the case of - * multiple Zones, one of the Zones is considered the Master Zone and all - * Zone-related stats from the Keg are done in the Master Zone. For an + * multiple Zones, one of the Zones is considered the Primary Zone and all + * Zone-related stats from the Keg are done in the Primary Zone. For an * example of a Multi-Zone setup, refer to the Mbuf allocation code. */ From owner-svn-src-all@freebsd.org Sat Jun 20 20:23:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CC94333DB8; Sat, 20 Jun 2020 20:23:54 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6Zd6WW8z3XKd; Sat, 20 Jun 2020 20:23:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D09441CCF5; Sat, 20 Jun 2020 20:23:53 +0000 (UTC) Date: Sat, 20 Jun 2020 20:23:53 +0000 From: Alexey Dokuchaev To: Colin Percival Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362444 - head/sbin/dump Message-ID: <20200620202353.GB8270@FreeBSD.org> References: <202006202006.05KK6EqK016498@repo.freebsd.org> <01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@email.amazonses.com> <20200620201934.GA8270@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200620201934.GA8270@FreeBSD.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:23:54 -0000 On Sat, Jun 20, 2020 at 08:19:35PM +0000, Alexey Dokuchaev wrote: > ... > Please, just open a DR for that so all interested parties can participate > and fine-tune particular grammar and language choices. Also, r362447 > should be reverted on the same grounds as r362422. Perhaps full backout is not necessary as r362447 looks mostly okay, but it would be nice to do something about enworker(). ./danfe From owner-svn-src-all@freebsd.org Sat Jun 20 20:25:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68E32333C6A; Sat, 20 Jun 2020 20:25:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q6ch28HHz3XRS; Sat, 20 Jun 2020 20:25:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4511211BED; Sat, 20 Jun 2020 20:25:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KKPeGL029119; Sat, 20 Jun 2020 20:25:40 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KKPe1t029118; Sat, 20 Jun 2020 20:25:40 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202006202025.05KKPe1t029118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 20 Jun 2020 20:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362450 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 362450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 20:25:40 -0000 Author: dougm Date: Sat Jun 20 20:25:39 2020 New Revision: 362450 URL: https://svnweb.freebsd.org/changeset/base/362450 Log: In concluding RB_REMOVE_COLOR, in the case when the sibling of the root of the too-short tree is black and at least one of the children of that sibling is red, either one or two rotations finish the rebalancing. In the case when both of the children are red, the current implementation uses two rotations where only one is necessary. This change removes that extra rotation, and in that case also removes a needless black-to-red-to-black recoloring. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25335 Modified: head/sys/sys/tree.h Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Sat Jun 20 20:21:04 2020 (r362449) +++ head/sys/sys/tree.h Sat Jun 20 20:25:39 2020 (r362450) @@ -493,21 +493,19 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type RB_ROTATE_LEFT(head, parent, tmp, field);\ tmp = RB_RIGHT(parent, field); \ } \ - if (RB_ISRED(RB_LEFT(tmp, field), field)) { \ + if (RB_ISRED(RB_RIGHT(tmp, field), field)) \ + RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK; \ + else if (RB_ISRED(RB_LEFT(tmp, field), field)) { \ struct type *oleft; \ - oleft = RB_LEFT(tmp, field); \ + RB_ROTATE_RIGHT(head, tmp, oleft, field); \ RB_COLOR(oleft, field) = RB_BLACK; \ + tmp = oleft; \ + } else { \ RB_COLOR(tmp, field) = RB_RED; \ - RB_ROTATE_RIGHT(head, tmp, oleft, field); \ - tmp = RB_RIGHT(parent, field); \ - } else if (!RB_ISRED(RB_RIGHT(tmp, field), field)) { \ - RB_COLOR(tmp, field) = RB_RED; \ elm = parent; \ parent = RB_PARENT(elm, field); \ continue; \ } \ - if (RB_ISRED(RB_RIGHT(tmp, field), field)) \ - RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK; \ RB_COLOR(tmp, field) = RB_COLOR(parent, field); \ RB_COLOR(parent, field) = RB_BLACK; \ RB_ROTATE_LEFT(head, parent, tmp, field); \ @@ -520,21 +518,19 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type RB_ROTATE_RIGHT(head, parent, tmp, field);\ tmp = RB_LEFT(parent, field); \ } \ - if (RB_ISRED(RB_RIGHT(tmp, field), field)) { \ + if (RB_ISRED(RB_LEFT(tmp, field), field)) \ + RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK; \ + else if (RB_ISRED(RB_RIGHT(tmp, field), field)) { \ struct type *oright; \ - oright = RB_RIGHT(tmp, field); \ - RB_COLOR(oright, field) = RB_BLACK; \ - RB_COLOR(tmp, field) = RB_RED; \ RB_ROTATE_LEFT(head, tmp, oright, field); \ - tmp = RB_LEFT(parent, field); \ + RB_COLOR(oright, field) = RB_BLACK; \ + tmp = oright; \ } else if (!RB_ISRED(RB_LEFT(tmp, field), field)) { \ RB_COLOR(tmp, field) = RB_RED; \ elm = parent; \ parent = RB_PARENT(elm, field); \ continue; \ } \ - if (RB_ISRED(RB_LEFT(tmp, field), field)) \ - RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK; \ RB_COLOR(tmp, field) = RB_COLOR(parent, field); \ RB_COLOR(parent, field) = RB_BLACK; \ RB_ROTATE_RIGHT(head, parent, tmp, field); \ From owner-svn-src-all@freebsd.org Sat Jun 20 21:03:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A82DF334B27 for ; Sat, 20 Jun 2020 21:03:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q7SH4mmgz3ZtM for ; Sat, 20 Jun 2020 21:03:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82e.google.com with SMTP id j10so1322938qtq.11 for ; Sat, 20 Jun 2020 14:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UAh/2NLDqh6WDFLTCMyPDWk8MkZ2NS3P0vJ046AC/rE=; b=ewCTM23geQ1LS7u6obXXTdmtBpcHtxEzQC7dqN23RlCFrpKXpnQQp8MEclKJk+jrcR rQM2KTfDn3xkgKsaYBwMHpNeZfb7JBNFWDnCWays2CUVidHvhOCXLodyCE3dtrnXSO1Q 16mrrKdbwNtEBMCLCrUbRGwJlDz073czxKaqXORHqDsI1mwY1P2r23/6LyTJVfdA8EGF /Ccv+VPIyfg+D6IgdL977OFDdej1MMyN1vNzbUnmGJxFt620slMba2WHz5FDSSe/n3Cb YI8fABOnR9G3mYTyhOx9/tu1eDgKCgUyspRZpeiEm7SlXUBlTSIKU3HgXWHv/vU6f3R3 Kvpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UAh/2NLDqh6WDFLTCMyPDWk8MkZ2NS3P0vJ046AC/rE=; b=PAxVuRi3hPz0y8A7mrqM2gWZ+0sDVRBS7Ijl5GoKo7bnWHawr5zqhzzwZIZ2Xyujg/ uEEUFcnIZiZTcTb55XxVYORMW3u4jD5IY/FGs/74+M3rusdOrawYE+llAqraDXzQAhS2 OwHYv4v/35Rv+FHtLpV3KwkWPKpYZl0lWuR56U5TYwjMGsCzzKOMQBUUhcGUCd4bdAl5 KRVXQig3dk4XR+H3yHCEtqUowrSGdF4UHqd7xluDsxtrsavrZ66VzVHcf5wuhoJPl3Er J7bFKlbF3NUIOjP/oqdHHcv8vlBx44EFsd4OXnUxW/9zgFZclaSb3HVuPXgwfqjJr4+Q sLHA== X-Gm-Message-State: AOAM532iWMdcUmTpbtU5cGb7RpA5YzZ8UqeqKmjizLXkyPJWhvjfxzCS Jb9uDKdXBlgR8MSWnBJ1Bll+F6Ycpr7Puoi2vgr59w== X-Google-Smtp-Source: ABdhPJwAjwS3YmE0J4DtIrQsCXAuuXUgCtlR+FdRHO736KbVMNEWe29Bi4IKgW2z0siR4JX/R01e/cDjml1h5JZdCZw= X-Received: by 2002:ac8:34e8:: with SMTP id x37mr9800943qtb.291.1592687006731; Sat, 20 Jun 2020 14:03:26 -0700 (PDT) MIME-Version: 1.0 References: <202006202006.05KK6EqK016498@repo.freebsd.org> <01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@email.amazonses.com> <20200620201934.GA8270@FreeBSD.org> In-Reply-To: <20200620201934.GA8270@FreeBSD.org> From: Warner Losh Date: Sat, 20 Jun 2020 15:03:15 -0600 Message-ID: Subject: Re: svn commit: r362444 - head/sbin/dump To: Alexey Dokuchaev Cc: Colin Percival , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 49q7SH4mmgz3ZtM X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=ewCTM23g; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82e) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.96 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.90)[-0.895]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.48)[-0.481]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.58)[-0.579]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82e:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 21:03:28 -0000 On Sat, Jun 20, 2020 at 2:19 PM Alexey Dokuchaev wrote: > On Sat, Jun 20, 2020 at 08:12:40PM +0000, Colin Percival wrote: > > Thanks for backing this out, Warner. > > I also appreciate it. > You bet. I had enough people send me dispassionate context around to realize that minion was no longer a hill worth dying on. While it wasn't problematic in the way slave was, it had other issues my pre-commit research completely was blind to... > > I'd like to change "slave" to "worker" here (which I think is a > reasonably > > neutral and entirely inoffensive term), and in the process perhaps make > some > > associated grammatical changes (since "enworker" is dubious at best). > > > > To avoid causing any further issues: If anyone objects to the word > "worker" > > please let me know in the next ~48 hours. I think there's enough people > > reading svn-src-all that I can anticipate feedback now if anyone will > care > > deeply about that word. > > Please, just open a DR for that so all interested parties can participate > and fine-tune particular grammar and language choices. Also, r362447 > should be reverted on the same grounds as r362422. > I'd have rather r362447 go through review as well, but really, it's fine enough for now that it's not worth the churn to back it out. Warner From owner-svn-src-all@freebsd.org Sat Jun 20 21:06:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41674334959; Sat, 20 Jun 2020 21:06:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q7WH11Mhz3Zt0; Sat, 20 Jun 2020 21:06:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E0FC125CE; Sat, 20 Jun 2020 21:06:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KL63Gq053401; Sat, 20 Jun 2020 21:06:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KL62T2053400; Sat, 20 Jun 2020 21:06:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006202106.05KL62T2053400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Jun 2020 21:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362451 - in head: lib/libc/net sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head: lib/libc/net sys/netinet X-SVN-Commit-Revision: 362451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 21:06:03 -0000 Author: tuexen Date: Sat Jun 20 21:06:02 2020 New Revision: 362451 URL: https://svnweb.freebsd.org/changeset/base/362451 Log: Use a struct sockaddr_in pr struct sockaddr_in6 as the option value for the IPPROTO_SCTP level socket options SCTP_BINDX_ADD_ADDR and SCTP_BINDX_REM_ADDR. These socket option are intended for internal use only to implement sctp_bindx(). This is one user of struct sctp_getaddresses less. struct sctp_getaddresses is strange and will be changed shortly. Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp_usrreq.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sat Jun 20 20:25:39 2020 (r362450) +++ head/lib/libc/net/sctp_sys_calls.c Sat Jun 20 21:06:02 2020 (r362451) @@ -35,6 +35,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -170,13 +171,12 @@ sctp_connectx(int sd, const struct sockaddr *addrs, in int sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt, int flags) { - struct sctp_getaddresses *gaddrs; struct sockaddr *sa; struct sockaddr_in *sin; struct sockaddr_in6 *sin6; int i; - size_t argsz; - uint16_t sport = 0; + uint16_t sport; + bool fix_port; /* validate the flags */ if ((flags != SCTP_BINDX_ADD_ADDR) && @@ -189,6 +189,8 @@ sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt errno = EINVAL; return (-1); } + sport = 0; + fix_port = false; /* First pre-screen the addresses */ sa = addrs; for (i = 0; i < addrcnt; i++) { @@ -210,6 +212,7 @@ sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt } else { /* save off the port */ sport = sin->sin_port; + fix_port = (i > 0); } } break; @@ -230,6 +233,7 @@ sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt } else { /* save off the port */ sport = sin6->sin6_port; + fix_port = (i > 0); } } break; @@ -240,42 +244,29 @@ sctp_bindx(int sd, struct sockaddr *addrs, int addrcnt } sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } - argsz = sizeof(struct sctp_getaddresses) + - sizeof(struct sockaddr_storage); - if ((gaddrs = (struct sctp_getaddresses *)malloc(argsz)) == NULL) { - errno = ENOMEM; - return (-1); - } sa = addrs; for (i = 0; i < addrcnt; i++) { - memset(gaddrs, 0, argsz); - gaddrs->sget_assoc_id = 0; - memcpy(gaddrs->addr, sa, sa->sa_len); /* * Now, if there was a port mentioned, assure that the first * address has that port to make sure it fails or succeeds * correctly. */ - if ((i == 0) && (sport != 0)) { - switch (gaddrs->addr->sa_family) { + if (fix_port) { + switch (sa->sa_family) { case AF_INET: - sin = (struct sockaddr_in *)gaddrs->addr; - sin->sin_port = sport; + ((struct sockaddr_in *)sa)->sin_port = sport; break; case AF_INET6: - sin6 = (struct sockaddr_in6 *)gaddrs->addr; - sin6->sin6_port = sport; + ((struct sockaddr_in6 *)sa)->sin6_port = sport; break; } + fix_port = false; } - if (setsockopt(sd, IPPROTO_SCTP, flags, gaddrs, - (socklen_t)argsz) != 0) { - free(gaddrs); + if (setsockopt(sd, IPPROTO_SCTP, flags, sa, sa->sa_len) != 0) { return (-1); } sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } - free(gaddrs); return (0); } Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Jun 20 20:25:39 2020 (r362450) +++ head/sys/netinet/sctp_usrreq.c Sat Jun 20 21:06:02 2020 (r362451) @@ -5995,33 +5995,35 @@ sctp_setopt(struct socket *so, int optname, void *optv } case SCTP_BINDX_ADD_ADDR: { - struct sctp_getaddresses *addrs; + struct sockaddr *sa; struct thread *td; td = (struct thread *)p; - SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, - optsize); + SCTP_CHECK_AND_CAST(sa, optval, struct sockaddr, optsize); #ifdef INET - if (addrs->addr->sa_family == AF_INET) { - if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { + if (sa->sa_family == AF_INET) { + if (optsize < sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } - if (td != NULL && (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr)))) { + if (td != NULL && + (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)sa)->sin_addr)))) { SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } } else #endif #ifdef INET6 - if (addrs->addr->sa_family == AF_INET6) { - if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { + if (sa->sa_family == AF_INET6) { + if (optsize < sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } - if (td != NULL && (error = prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), + if (td != NULL && + (error = prison_local_ip6(td->td_ucred, + &(((struct sockaddr_in6 *)sa)->sin6_addr), (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; @@ -6032,40 +6034,41 @@ sctp_setopt(struct socket *so, int optname, void *optv error = EAFNOSUPPORT; break; } - sctp_bindx_add_address(so, inp, addrs->addr, vrf_id, &error, p); + sctp_bindx_add_address(so, inp, sa, vrf_id, &error, p); break; } case SCTP_BINDX_REM_ADDR: { - struct sctp_getaddresses *addrs; + struct sockaddr *sa; struct thread *td; td = (struct thread *)p; - SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, optsize); + SCTP_CHECK_AND_CAST(sa, optval, struct sockaddr, optsize); #ifdef INET - if (addrs->addr->sa_family == AF_INET) { - if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { + if (sa->sa_family == AF_INET) { + if (optsize < sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } - if (td != NULL && (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr)))) { + if (td != NULL && + (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)sa)->sin_addr)))) { SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } } else #endif #ifdef INET6 - if (addrs->addr->sa_family == AF_INET6) { - if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { + if (sa->sa_family == AF_INET6) { + if (optsize < sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } if (td != NULL && (error = prison_local_ip6(td->td_ucred, - &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), + &(((struct sockaddr_in6 *)sa)->sin6_addr), (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; @@ -6076,7 +6079,7 @@ sctp_setopt(struct socket *so, int optname, void *optv error = EAFNOSUPPORT; break; } - sctp_bindx_delete_address(inp, addrs->addr, vrf_id, &error); + sctp_bindx_delete_address(inp, sa, vrf_id, &error); break; } case SCTP_EVENT: From owner-svn-src-all@freebsd.org Sat Jun 20 21:18:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14374334F8E; Sat, 20 Jun 2020 21:18:49 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q7p06pxVz3cQx; Sat, 20 Jun 2020 21:18:48 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id DDA791EB63; Sat, 20 Jun 2020 21:18:48 +0000 (UTC) Date: Sat, 20 Jun 2020 21:18:48 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: Colin Percival , Warner Losh , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r362444 - head/sbin/dump Message-ID: <20200620211848.GA2087@FreeBSD.org> References: <202006202006.05KK6EqK016498@repo.freebsd.org> <01000172d35c996f-523a3c65-2f6b-472e-ad04-070e2b22bfe0-000000@email.amazonses.com> <20200620201934.GA8270@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 21:18:49 -0000 On Sat, Jun 20, 2020 at 03:03:15PM -0600, Warner Losh wrote: > On Sat, Jun 20, 2020 at 2:19 PM Alexey Dokuchaev wrote: > > ... > > Please, just open a DR for that so all interested parties can participate > > and fine-tune particular grammar and language choices. Also, r362447 > > should be reverted on the same grounds as r362422. > > I'd have rather r362447 go through review as well, but really, it's fine > enough for now that it's not worth the churn to back it out. Agreed; I've basically said the same in the follow-up email. If we could fix the "enworker" then it should be as technically correct yet neutral as possible, but even now it's an improvement. So is r362449 (notice how no one had objected to it). ./danfe From owner-svn-src-all@freebsd.org Sat Jun 20 21:24:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA72C3353AD; Sat, 20 Jun 2020 21:24:51 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49q7wy4wcHz3dhN; Sat, 20 Jun 2020 21:24:50 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05KLOlhu001978; Sat, 20 Jun 2020 14:24:47 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05KLOlxQ001977; Sat, 20 Jun 2020 14:24:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006202124.05KLOlxQ001977@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362444 - head/sbin/dump In-Reply-To: To: Warner Losh Date: Sat, 20 Jun 2020 14:24:47 -0700 (PDT) CC: Alexey Dokuchaev , Colin Percival , Warner Losh , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49q7wy4wcHz3dhN X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.12 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.05)[-0.047]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.46)[-0.459]; NEURAL_SPAM_LONG(0.72)[0.723]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 21:24:51 -0000 > On Sat, Jun 20, 2020 at 2:19 PM Alexey Dokuchaev wrote: > > > On Sat, Jun 20, 2020 at 08:12:40PM +0000, Colin Percival wrote: > > > Thanks for backing this out, Warner. > > > > I also appreciate it. > > > > You bet. I had enough people send me dispassionate context around to > realize that minion was no longer a hill worth dying on. While it wasn't > problematic in the way slave was, it had other issues my pre-commit > research completely was blind to... > > > > > I'd like to change "slave" to "worker" here (which I think is a > > reasonably > > > neutral and entirely inoffensive term), and in the process perhaps make > > some > > > associated grammatical changes (since "enworker" is dubious at best). > > > > > > To avoid causing any further issues: If anyone objects to the word > > "worker" > > > please let me know in the next ~48 hours. I think there's enough people > > > reading svn-src-all that I can anticipate feedback now if anyone will > > care > > > deeply about that word. > > > > Please, just open a DR for that so all interested parties can participate > > and fine-tune particular grammar and language choices. Also, r362447 > > should be reverted on the same grounds as r362422. > > > > I'd have rather r362447 go through review as well, but really, it's fine > enough for now that it's not worth the churn to back it out. Agreed, but can we stop the apparent haste to make changes? > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jun 20 21:32:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E7AE335524; Sat, 20 Jun 2020 21:32:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q85N3mw3z3f2h; Sat, 20 Jun 2020 21:32:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CDBC12A44; Sat, 20 Jun 2020 21:32:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KLW87b071061; Sat, 20 Jun 2020 21:32:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KLW781071057; Sat, 20 Jun 2020 21:32:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202006202132.05KLW781071057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 20 Jun 2020 21:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362452 - in head: contrib/xz/src/liblzma/check lib/liblzma share/mk X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/xz/src/liblzma/check lib/liblzma share/mk X-SVN-Commit-Revision: 362452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 21:32:08 -0000 Author: delphij Date: Sat Jun 20 21:32:07 2020 New Revision: 362452 URL: https://svnweb.freebsd.org/changeset/base/362452 Log: liblzma: Make liblzma use libmd implementation of SHA256. MFC after: 2 weeks PR: 200142 Deleted: head/contrib/xz/src/liblzma/check/sha256.c Modified: head/lib/liblzma/Makefile head/lib/liblzma/Symbol.map head/lib/liblzma/config.h head/share/mk/src.libnames.mk Modified: head/lib/liblzma/Makefile ============================================================================== --- head/lib/liblzma/Makefile Sat Jun 20 21:06:02 2020 (r362451) +++ head/lib/liblzma/Makefile Sat Jun 20 21:32:07 2020 (r362452) @@ -78,8 +78,7 @@ SRCS+= common.c \ .PATH: ${LZMADIR}/check SRCS+= check.c \ crc32_table.c \ - crc64_table.c \ - sha256.c + crc64_table.c .if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386" SRCS+= crc32_x86.S \ crc64_x86.S @@ -125,11 +124,11 @@ SRCS+= simple_coder.c \ .PATH: ${LZMADIR} -VERSION_MAJOR!= awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MAJOR" {print $$3 } ' \ +VERSION_MAJOR!= sed -n '/define.*LZMA_VERSION_MAJOR/{s,[^0-9.],,gp;q;}' \ ${LZMADIR}/api/lzma/version.h -VERSION_MINOR!= awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MINOR" {print $$3 } ' \ +VERSION_MINOR!= sed -n '/define.*LZMA_VERSION_MINOR/{s,[^0-9.],,gp;q;}' \ ${LZMADIR}/api/lzma/version.h -VERSION_PATCH!= awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_PATCH" {print $$3 } ' \ +VERSION_PATCH!= sed -n '/define.*LZMA_VERSION_PATCH/{s,[^0-9.],,gp;q;}' \ ${LZMADIR}/api/lzma/version.h WARNS?= 3 @@ -147,7 +146,7 @@ CFLAGS+= -DHAVE_CONFIG_H \ -I${LZMADIR}/simple \ -I${LZMADIR:H}/common -LIBADD+= pthread +LIBADD+= md pthread VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map @@ -160,10 +159,11 @@ FILESDIR= ${LIBDATADIR}/pkgconfig liblzma.pc: liblzma.pc.in sed -e 's,@prefix@,/usr,g ; \ - s,@exec_prefix@,/usr,g ; \ + s,@exec_prefix@,/usr,g ; \ s,@libdir@,/usr/lib,g ; \ s,@includedir@,/usr/include,g ; \ - s,@PACKAGE_URL@,http://tukaani.org/xz/,g ; \ + s,@LIBS@,-pthread -lmd,g ; \ + s,@PACKAGE_URL@,https://tukaani.org/xz/,g ; \ s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \ s,@PTHREAD_CFLAGS@,,g ; \ s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET} Modified: head/lib/liblzma/Symbol.map ============================================================================== --- head/lib/liblzma/Symbol.map Sat Jun 20 21:06:02 2020 (r362451) +++ head/lib/liblzma/Symbol.map Sat Jun 20 21:32:07 2020 (r362452) @@ -180,9 +180,6 @@ XZprivate_1.0 { lzma_raw_coder_memusage; lzma_raw_decoder_init; lzma_raw_encoder_init; - lzma_sha256_finish; - lzma_sha256_init; - lzma_sha256_update; lzma_simple_arm_decoder_init; lzma_simple_arm_encoder_init; lzma_simple_armthumb_decoder_init; Modified: head/lib/liblzma/config.h ============================================================================== --- head/lib/liblzma/config.h Sat Jun 20 21:06:02 2020 (r362451) +++ head/lib/liblzma/config.h Sat Jun 20 21:32:07 2020 (r362452) @@ -211,16 +211,13 @@ /* #undef HAVE_SHA256INIT */ /* Define to 1 if the system has the type `SHA256_CTX'. */ -/* FreeBSD - disabled libmd SHA256 for now */ -/* #undef HAVE_SHA256_CTX */ +#define HAVE_SHA256_CTX 1 /* Define to 1 if you have the header file. */ -/* FreeBSD - disabled libmd SHA256 for now */ -/* #undef HAVE_SHA256_H */ +#define HAVE_SHA256_H 1 /* Define to 1 if you have the `SHA256_Init' function. */ -/* FreeBSD - disabled libmd SHA256 for now */ -/* #undef HAVE_SHA256_INIT */ +#define HAVE_SHA256_INIT 1 /* Define to 1 if the system has the type `SHA2_CTX'. */ /* #undef HAVE_SHA2_CTX */ Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Jun 20 21:06:02 2020 (r362451) +++ head/share/mk/src.libnames.mk Sat Jun 20 21:32:07 2020 (r362452) @@ -350,7 +350,7 @@ _DP_heimipcs= heimbase roken pthread _DP_kafs5= asn1 krb5 roken _DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc _DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_err -_DP_lzma= pthread +_DP_lzma= md pthread _DP_ucl= m _DP_vmmapi= util _DP_opencsd= cxxrt From owner-svn-src-all@freebsd.org Sat Jun 20 21:32:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A141C3357C6; Sat, 20 Jun 2020 21:32:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49q85W0qLmz3f7Y; Sat, 20 Jun 2020 21:32:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C412D12E00; Sat, 20 Jun 2020 21:32:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KLWEUi071134; Sat, 20 Jun 2020 21:32:14 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KLWEMP071133; Sat, 20 Jun 2020 21:32:14 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202006202132.05KLWEMP071133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 20 Jun 2020 21:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362453 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 362453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 21:32:17 -0000 Author: delphij Date: Sat Jun 20 21:32:14 2020 New Revision: 362453 URL: https://svnweb.freebsd.org/changeset/base/362453 Log: Bump __FreeBSD_version after making liblzma to use libmd implementation of SHA256. PR: 200142 Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Jun 20 21:32:07 2020 (r362452) +++ head/sys/sys/param.h Sat Jun 20 21:32:14 2020 (r362453) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300098 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300099 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sat Jun 20 22:21:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 699EB336838; Sat, 20 Jun 2020 22:21:50 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49q9Bj3wLzz40mM; Sat, 20 Jun 2020 22:21:49 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 05KMLl42002192; Sat, 20 Jun 2020 15:21:47 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 05KMLlEc002191; Sat, 20 Jun 2020 15:21:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202006202221.05KMLlEc002191@gndrsh.dnsmgr.net> Subject: Re: svn commit: r362420 - head/share/misc In-Reply-To: To: Warner Losh Date: Sat, 20 Jun 2020 15:21:47 -0700 (PDT) CC: "Rodney W. Grimes" , Alexey Dokuchaev , Warner Losh , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49q9Bj3wLzz40mM X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.02 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.03)[-0.031]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.43)[0.432]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.72)[0.718]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 22:21:50 -0000 > On Sat, Jun 20, 2020 at 5:13 AM Rodney W. Grimes > wrote: > > > > On Sat, Jun 20, 2020 at 04:07:44AM +0000, Warner Losh wrote: > > > > New Revision: 362420 > > > > URL: https://svnweb.freebsd.org/changeset/base/362420 > > > > > > > > Log: > > > > Correct 1BSD release date. > > > > > > > > The Quarter Century of Unix book said that 1BSD was released March > > 1979. > > > > However, the 1BSD tape image that's on Kirk's historical unix > > collection > > > > has an earlier date. > > > > > > > > It was common practice, at the time, to create a new copy of the tape > > > > from the master system > > > ^^^^^^ > > > Ouch! :-) > > > > Given that this occured AFTER imp made a commit removing master/slave > > language I find it very ironic. > > > > Uh oh, we need to rewire our VCS system so we can correct our > > political incorrectness in our logs. > > > > Master copy has a completely different etymology than master slave. > > The only irony here is that you are over-reacting to this. Very interesting that you reply to me, and not the original poster on the reaction, that I reacted to. Bias perhaps? > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Jun 20 23:48:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46C11337EC5; Sat, 20 Jun 2020 23:48:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49qC7G17D3z45GV; Sat, 20 Jun 2020 23:48:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D61114422; Sat, 20 Jun 2020 23:48:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KNmvTm051739; Sat, 20 Jun 2020 23:48:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KNmvgX051738; Sat, 20 Jun 2020 23:48:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202006202348.05KNmvgX051738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Jun 2020 23:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362454 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 362454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 23:48:58 -0000 Author: tuexen Date: Sat Jun 20 23:48:57 2020 New Revision: 362454 URL: https://svnweb.freebsd.org/changeset/base/362454 Log: Set a variable also in the case of an INET6 only kernel MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Jun 20 21:32:14 2020 (r362453) +++ head/sys/netinet/sctputil.c Sat Jun 20 23:48:57 2020 (r362454) @@ -6746,6 +6746,8 @@ sctp_bindx_add_address(struct socket *so, struct sctp_ } else { addr_to_use = sa; } +#else + addr_to_use = sa; #endif break; #endif