From owner-svn-src-head@freebsd.org Sun Oct 16 02:05:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5293BC12E46; Sun, 16 Oct 2016 02:05:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0BBC0955; Sun, 16 Oct 2016 02:05:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9G25NiA035494; Sun, 16 Oct 2016 02:05:23 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9G25Mb2035486; Sun, 16 Oct 2016 02:05:22 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201610160205.u9G25Mb2035486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 16 Oct 2016 02:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307385 - in head: etc/mtree include sys/sys sys/sys/disk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 02:05:24 -0000 Author: marcel Date: Sun Oct 16 02:05:22 2016 New Revision: 307385 URL: https://svnweb.freebsd.org/changeset/base/307385 Log: Revert change 306811 so that the change can be re-done using svn copy instead of svn move. This to preserve history on the originals headers as well. Replaced: head/sys/sys/apm.h - copied unchanged from r306810, head/sys/sys/apm.h head/sys/sys/disklabel.h - copied unchanged from r306810, head/sys/sys/disklabel.h head/sys/sys/diskmbr.h - copied unchanged from r306810, head/sys/sys/diskmbr.h head/sys/sys/diskpc98.h - copied unchanged from r306810, head/sys/sys/diskpc98.h head/sys/sys/gpt.h - copied unchanged from r306810, head/sys/sys/gpt.h head/sys/sys/vtoc.h - copied unchanged from r306810, head/sys/sys/vtoc.h Deleted: head/sys/sys/disk/ Modified: head/etc/mtree/BSD.include.dist head/include/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sat Oct 15 23:46:55 2016 (r307384) +++ head/etc/mtree/BSD.include.dist Sun Oct 16 02:05:22 2016 (r307385) @@ -336,8 +336,6 @@ ssp .. sys - disk - .. .. teken .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Oct 15 23:46:55 2016 (r307384) +++ head/include/Makefile Sun Oct 16 02:05:22 2016 (r307385) @@ -59,7 +59,6 @@ LSUBDIRS= cam/ata cam/nvme cam/scsi \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ security/mac_mls security/mac_partition \ - sys/disk \ ufs/ffs ufs/ufs LSUBSUBDIRS= dev/mpt/mpilib Copied: head/sys/sys/apm.h (from r306810, head/sys/sys/apm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/apm.h Sun Oct 16 02:05:22 2016 (r307385, copy of r306810, head/sys/sys/apm.h) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2007 Marcel Moolenaar + * 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 ``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$ + */ + +#ifndef _SYS_APM_H_ +#define _SYS_APM_H_ + +/* Driver Descriptor Record. */ +struct apm_ddr { + uint16_t ddr_sig; +#define APM_DDR_SIG 0x4552 + uint16_t ddr_blksize; + uint32_t ddr_blkcount; +}; + +#define APM_ENT_NAMELEN 32 +#define APM_ENT_TYPELEN 32 + +/* Partition Map Entry Record. */ +struct apm_ent { + uint16_t ent_sig; +#define APM_ENT_SIG 0x504d + uint16_t _pad_; + uint32_t ent_pmblkcnt; + uint32_t ent_start; + uint32_t ent_size; + char ent_name[APM_ENT_NAMELEN]; + char ent_type[APM_ENT_TYPELEN]; +}; + +#define APM_ENT_TYPE_SELF "Apple_partition_map" +#define APM_ENT_TYPE_UNUSED "Apple_Free" + +#define APM_ENT_TYPE_FREEBSD "FreeBSD" +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" +#define APM_ENT_TYPE_FREEBSD_SWAP "FreeBSD-swap" +#define APM_ENT_TYPE_FREEBSD_UFS "FreeBSD-UFS" +#define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" +#define APM_ENT_TYPE_FREEBSD_ZFS "FreeBSD-ZFS" + +#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" +#define APM_ENT_TYPE_APPLE_HFS "Apple_HFS" +#define APM_ENT_TYPE_APPLE_UFS "Apple_UNIX_SVR2" + +#endif /* _SYS_APM_H_ */ Copied: head/sys/sys/disklabel.h (from r306810, head/sys/sys/disklabel.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/disklabel.h Sun Oct 16 02:05:22 2016 (r307385, copy of r306810, head/sys/sys/disklabel.h) @@ -0,0 +1,305 @@ +/*- + * Copyright (c) 1987, 1988, 1993 + * The Regents of the University of California. 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. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 + * $FreeBSD$ + */ + +#ifndef _SYS_DISKLABEL_H_ +#define _SYS_DISKLABEL_H_ + +#ifndef _KERNEL +#include +#endif +#include + +/* + * Disk description table, see disktab(5) + */ +#define _PATH_DISKTAB "/etc/disktab" + +/* + * Each disk has a label which includes information about the hardware + * disk geometry, filesystem partitions, and drive specific information. + * The label is in block 0 or 1, possibly offset from the beginning + * to leave room for a bootstrap, etc. + */ + +/* XXX these should be defined per controller (or drive) elsewhere, not here! */ +#if defined(__i386__) || defined(__amd64__) || defined(__arm__) || \ + defined(__powerpc__) || defined(__mips__) +#define LABELSECTOR 1 /* sector containing label */ +#define LABELOFFSET 0 /* offset of label in sector */ +#endif + +#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */ +#ifndef MAXPARTITIONS +#define MAXPARTITIONS 8 +#endif + +/* Size of bootblock area in sector-size neutral bytes */ +#define BBSIZE 8192 + +#define LABEL_PART 2 /* partition containing label */ +#define RAW_PART 2 /* partition containing whole disk */ +#define SWAP_PART 1 /* partition normally containing swap */ + +struct disklabel { + u_int32_t d_magic; /* the magic number */ + u_int16_t d_type; /* drive type */ + u_int16_t d_subtype; /* controller/d_type specific */ + char d_typename[16]; /* type name, e.g. "eagle" */ + + char d_packname[16]; /* pack identifier */ + + /* disk geometry: */ + u_int32_t d_secsize; /* # of bytes per sector */ + u_int32_t d_nsectors; /* # of data sectors per track */ + u_int32_t d_ntracks; /* # of tracks per cylinder */ + u_int32_t d_ncylinders; /* # of data cylinders per unit */ + u_int32_t d_secpercyl; /* # of data sectors per cylinder */ + u_int32_t d_secperunit; /* # of data sectors per unit */ + + /* + * Spares (bad sector replacements) below are not counted in + * d_nsectors or d_secpercyl. Spare sectors are assumed to + * be physical sectors which occupy space at the end of each + * track and/or cylinder. + */ + u_int16_t d_sparespertrack; /* # of spare sectors per track */ + u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */ + /* + * Alternate cylinders include maintenance, replacement, configuration + * description areas, etc. + */ + u_int32_t d_acylinders; /* # of alt. cylinders per unit */ + + /* hardware characteristics: */ + /* + * d_interleave, d_trackskew and d_cylskew describe perturbations + * in the media format used to compensate for a slow controller. + * Interleave is physical sector interleave, set up by the + * formatter or controller when formatting. When interleaving is + * in use, logically adjacent sectors are not physically + * contiguous, but instead are separated by some number of + * sectors. It is specified as the ratio of physical sectors + * traversed per logical sector. Thus an interleave of 1:1 + * implies contiguous layout, while 2:1 implies that logical + * sector 0 is separated by one sector from logical sector 1. + * d_trackskew is the offset of sector 0 on track N relative to + * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew + * is the offset of sector 0 on cylinder N relative to sector 0 + * on cylinder N-1. + */ + u_int16_t d_rpm; /* rotational speed */ + u_int16_t d_interleave; /* hardware sector interleave */ + u_int16_t d_trackskew; /* sector 0 skew, per track */ + u_int16_t d_cylskew; /* sector 0 skew, per cylinder */ + u_int32_t d_headswitch; /* head switch time, usec */ + u_int32_t d_trkseek; /* track-to-track seek, usec */ + u_int32_t d_flags; /* generic flags */ +#define NDDATA 5 + u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */ +#define NSPARE 5 + u_int32_t d_spare[NSPARE]; /* reserved for future use */ + u_int32_t d_magic2; /* the magic number (again) */ + u_int16_t d_checksum; /* xor of data incl. partitions */ + + /* filesystem and partition information: */ + u_int16_t d_npartitions; /* number of partitions in following */ + u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ + u_int32_t d_sbsize; /* max size of fs superblock, bytes */ + struct partition { /* the partition table */ + u_int32_t p_size; /* number of sectors in partition */ + u_int32_t p_offset; /* starting sector */ + u_int32_t p_fsize; /* filesystem basic fragment size */ + u_int8_t p_fstype; /* filesystem type, see below */ + u_int8_t p_frag; /* filesystem fragments per block */ + u_int16_t p_cpg; /* filesystem cylinders per group */ + } d_partitions[MAXPARTITIONS]; /* actually may be more */ +}; + +#ifdef CTASSERT +CTASSERT(sizeof(struct disklabel) == 148 + MAXPARTITIONS * 16); +#endif + +static __inline u_int16_t dkcksum(struct disklabel *lp); +static __inline u_int16_t +dkcksum(struct disklabel *lp) +{ + u_int16_t *start, *end; + u_int16_t sum = 0; + + start = (u_int16_t *)lp; + end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions]; + while (start < end) + sum ^= *start++; + return (sum); +} + + +/* d_type values: */ +#define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ +#define DTYPE_MSCP 2 /* MSCP */ +#define DTYPE_DEC 3 /* other DEC (rk, rl) */ +#define DTYPE_SCSI 4 /* SCSI */ +#define DTYPE_ESDI 5 /* ESDI interface */ +#define DTYPE_ST506 6 /* ST506 etc. */ +#define DTYPE_HPIB 7 /* CS/80 on HP-IB */ +#define DTYPE_HPFL 8 /* HP Fiber-link */ +#define DTYPE_FLOPPY 10 /* floppy */ +#define DTYPE_CCD 11 /* concatenated disk */ +#define DTYPE_VINUM 12 /* vinum volume */ +#define DTYPE_DOC2K 13 /* Msys DiskOnChip */ +#define DTYPE_RAID 14 /* CMU RAIDFrame */ +#define DTYPE_JFS2 16 /* IBM JFS 2 */ + +#ifdef DKTYPENAMES +static const char *dktypenames[] = { + "unknown", + "SMD", + "MSCP", + "old DEC", + "SCSI", + "ESDI", + "ST506", + "HP-IB", + "HP-FL", + "type 9", + "floppy", + "CCD", + "Vinum", + "DOC2K", + "Raid", + "?", + "jfs", + NULL +}; +#define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) +#endif + +/* + * Filesystem type and version. + * Used to interpret other filesystem-specific + * per-partition information. + */ +#define FS_UNUSED 0 /* unused */ +#define FS_SWAP 1 /* swap */ +#define FS_V6 2 /* Sixth Edition */ +#define FS_V7 3 /* Seventh Edition */ +#define FS_SYSV 4 /* System V */ +#define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */ +#define FS_V8 6 /* Eighth Edition, 4K blocks */ +#define FS_BSDFFS 7 /* 4.2BSD fast filesystem */ +#define FS_MSDOS 8 /* MSDOS filesystem */ +#define FS_BSDLFS 9 /* 4.4BSD log-structured filesystem */ +#define FS_OTHER 10 /* in use, but unknown/unsupported */ +#define FS_HPFS 11 /* OS/2 high-performance filesystem */ +#define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */ +#define FS_BOOT 13 /* partition contains bootstrap */ +#define FS_VINUM 14 /* Vinum drive */ +#define FS_RAID 15 /* RAIDFrame drive */ +#define FS_FILECORE 16 /* Acorn Filecore Filing System */ +#define FS_EXT2FS 17 /* ext2fs */ +#define FS_NTFS 18 /* Windows/NT file system */ +#define FS_CCD 20 /* concatenated disk component */ +#define FS_JFS2 21 /* IBM JFS2 */ +#define FS_HAMMER 22 /* DragonFlyBSD Hammer FS */ +#define FS_HAMMER2 23 /* DragonFlyBSD Hammer2 FS */ +#define FS_UDF 24 /* UDF */ +#define FS_EFS 26 /* SGI's Extent File system */ +#define FS_ZFS 27 /* Sun's ZFS */ +#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ + +#ifdef FSTYPENAMES +static const char *fstypenames[] = { + "unused", + "swap", + "Version 6", + "Version 7", + "System V", + "4.1BSD", + "Eighth Edition", + "4.2BSD", + "MSDOS", + "4.4LFS", + "unknown", + "HPFS", + "ISO9660", + "boot", + "vinum", + "raid", + "Filecore", + "EXT2FS", + "NTFS", + "?", + "ccd", + "jfs", + "HAMMER", + "HAMMER2", + "UDF", + "?", + "EFS", + "ZFS", + "?", + "?", + "nandfs", + NULL +}; +#define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) +#endif + +/* + * flags shared by various drives: + */ +#define D_REMOVABLE 0x01 /* removable media */ +#define D_ECC 0x02 /* supports ECC */ +#define D_BADSECT 0x04 /* supports bad sector forw. */ +#define D_RAMDISK 0x08 /* disk emulator */ +#define D_CHAIN 0x10 /* can do back-back transfers */ + +/* + * NB: defines ioctls from 'd'/128 and up. + */ + +/* + * Functions for proper encoding/decoding of struct disklabel into/from + * bytestring. + */ +void bsd_partition_le_dec(u_char *ptr, struct partition *d); +int bsd_disklabel_le_dec(u_char *ptr, struct disklabel *d, int maxpart); +void bsd_partition_le_enc(u_char *ptr, struct partition *d); +void bsd_disklabel_le_enc(u_char *ptr, struct disklabel *d); + +#ifndef _KERNEL +__BEGIN_DECLS +struct disklabel *getdiskbyname(const char *); +__END_DECLS +#endif + +#endif /* !_SYS_DISKLABEL_H_ */ Copied: head/sys/sys/diskmbr.h (from r306810, head/sys/sys/diskmbr.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/diskmbr.h Sun Oct 16 02:05:22 2016 (r307385, copy of r306810, head/sys/sys/diskmbr.h) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 1987, 1988, 1993 + * The Regents of the University of California. 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. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 + * $FreeBSD$ + */ + +#ifndef _SYS_DISKMBR_H_ +#define _SYS_DISKMBR_H_ + +#include + +#define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ +#define DOSPARTOFF 446 +#define DOSPARTSIZE 16 +#define NDOSPART 4 +#define NEXTDOSPART 32 +#define DOSMAGICOFFSET 510 +#define DOSMAGIC 0xAA55 + +#define DOSPTYP_EXT 0x05 /* DOS extended partition */ +#define DOSPTYP_FAT16 0x06 /* FAT16 partition */ +#define DOSPTYP_NTFS 0x07 /* NTFS partition */ +#define DOSPTYP_FAT32 0x0b /* FAT32 partition */ +#define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ +#define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ +#define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ +#define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ +#define DOSPTYP_LINUX 0x83 /* Linux partition */ +#define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ +#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ +#define DOSPTYP_APPLE_UFS 0xa8 /* Apple Mac OS X boot */ +#define DOSPTYP_APPLE_BOOT 0xab /* Apple Mac OS X UFS */ +#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ +#define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ +#define DOSPTYP_EFI 0xef /* EFI FAT parition */ +#define DOSPTYP_VMFS 0xfb /* VMware VMFS partition */ +#define DOSPTYP_VMKDIAG 0xfc /* VMware vmkDiagnostic partition */ +#define DOSPTYP_LINRAID 0xfd /* Linux raid partition */ + +struct dos_partition { + unsigned char dp_flag; /* bootstrap flags */ + unsigned char dp_shd; /* starting head */ + unsigned char dp_ssect; /* starting sector */ + unsigned char dp_scyl; /* starting cylinder */ + unsigned char dp_typ; /* partition type */ + unsigned char dp_ehd; /* end head */ + unsigned char dp_esect; /* end sector */ + unsigned char dp_ecyl; /* end cylinder */ + u_int32_t dp_start; /* absolute starting sector number */ + u_int32_t dp_size; /* partition size in sectors */ +}; +#ifdef CTASSERT +CTASSERT(sizeof (struct dos_partition) == DOSPARTSIZE); +#endif + +void dos_partition_dec(void const *pp, struct dos_partition *d); +void dos_partition_enc(void *pp, struct dos_partition *d); + +#define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ +#define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ + +#define DIOCSMBR _IOW('M', 129, u_char[512]) + +#endif /* !_SYS_DISKMBR_H_ */ Copied: head/sys/sys/diskpc98.h (from r306810, head/sys/sys/diskpc98.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/diskpc98.h Sun Oct 16 02:05:22 2016 (r307385, copy of r306810, head/sys/sys/diskpc98.h) @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 1987, 1988, 1993 + * The Regents of the University of California. 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. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 + * $FreeBSD$ + */ + +#ifndef _SYS_DISKPC98_H_ +#define _SYS_DISKPC98_H_ + +#include + +#define PC98_BBSECTOR 1 /* DOS boot block relative sector number */ +#define PC98_PARTOFF 0 +#define PC98_PARTSIZE 32 +#define PC98_NPARTS 16 +#define PC98_MAGICOFS 510 +#define PC98_MAGIC 0xAA55 + +#define PC98_MID_BOOTABLE 0x80 +#define PC98_MID_MASK 0x7f +#define PC98_MID_386BSD 0x14 + +#define PC98_SID_ACTIVE 0x80 +#define PC98_SID_MASK 0x7f +#define PC98_SID_386BSD 0x44 + +#define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) +#define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) +#define PC98_PTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) + +struct pc98_partition { + unsigned char dp_mid; + unsigned char dp_sid; + unsigned char dp_dum1; + unsigned char dp_dum2; + unsigned char dp_ipl_sct; + unsigned char dp_ipl_head; + unsigned short dp_ipl_cyl; + unsigned char dp_ssect; /* starting sector */ + unsigned char dp_shd; /* starting head */ + unsigned short dp_scyl; /* starting cylinder */ + unsigned char dp_esect; /* end sector */ + unsigned char dp_ehd; /* end head */ + unsigned short dp_ecyl; /* end cylinder */ + unsigned char dp_name[16]; +}; +#ifdef CTASSERT +CTASSERT(sizeof (struct pc98_partition) == PC98_PARTSIZE); +#endif + +void pc98_partition_dec(void const *pp, struct pc98_partition *d); +void pc98_partition_enc(void *pp, struct pc98_partition *d); + +#define DIOCSPC98 _IOW('M', 129, u_char[8192]) + +#endif /* !_SYS_DISKPC98_H_ */ Copied: head/sys/sys/gpt.h (from r306810, head/sys/sys/gpt.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/gpt.h Sun Oct 16 02:05:22 2016 (r307385, copy of r306810, head/sys/sys/gpt.h) @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 2002 Marcel Moolenaar + * 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 ``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$ + */ + +#ifndef _SYS_GPT_H_ +#define _SYS_GPT_H_ + +#include + +struct gpt_hdr { + char hdr_sig[8]; +#define GPT_HDR_SIG "EFI PART" + uint32_t hdr_revision; +#define GPT_HDR_REVISION 0x00010000 + uint32_t hdr_size; + uint32_t hdr_crc_self; + uint32_t __reserved; + uint64_t hdr_lba_self; + uint64_t hdr_lba_alt; + uint64_t hdr_lba_start; + uint64_t hdr_lba_end; + struct uuid hdr_uuid; + uint64_t hdr_lba_table; + uint32_t hdr_entries; + uint32_t hdr_entsz; + uint32_t hdr_crc_table; + /* + * The header as defined in the EFI spec is not a multiple of 8 bytes + * and given that the alignment requirement is on an 8 byte boundary, + * padding will happen. We make the padding explicit so that we can + * correct the value returned by sizeof() when we put the size of the + * header in field hdr_size, or otherwise use offsetof(). + */ + uint32_t padding; +}; + +struct gpt_ent { + struct uuid ent_type; + struct uuid ent_uuid; + uint64_t ent_lba_start; + uint64_t ent_lba_end; + uint64_t ent_attr; +#define GPT_ENT_ATTR_PLATFORM (1ULL << 0) +#define GPT_ENT_ATTR_BOOTME (1ULL << 59) +#define GPT_ENT_ATTR_BOOTONCE (1ULL << 58) +#define GPT_ENT_ATTR_BOOTFAILED (1ULL << 57) + uint16_t ent_name[36]; /* UTF-16. */ +}; + +#define GPT_ENT_TYPE_UNUSED \ + {0x00000000,0x0000,0x0000,0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}} +#define GPT_ENT_TYPE_EFI \ + {0xc12a7328,0xf81f,0x11d2,0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}} +#define GPT_ENT_TYPE_MBR \ + {0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}} +#define GPT_ENT_TYPE_FREEBSD \ + {0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_BOOT \ + {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} +#define GPT_ENT_TYPE_FREEBSD_SWAP \ + {0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_UFS \ + {0x516e7cb6,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_VINUM \ + {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_ZFS \ + {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_PREP_BOOT \ + {0x9e1a2d38,0xc612,0x4316,0xaa,0x26,{0x8b,0x49,0x52,0x1e,0x5a,0x8b}} + +/* + * The following are unused but documented here to avoid reuse. + * + * GPT_ENT_TYPE_FREEBSD_UFS2 \ + * {0x516e7cb7,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} + */ + +/* + * Foreign partition types that we're likely to encounter. Note that Linux + * apparently choose to share data partitions with MS. I don't what the + * advantage might be. I can see how sharing swap partitions is advantageous + * though. + */ +#define GPT_ENT_TYPE_MS_BASIC_DATA \ + {0xebd0a0a2,0xb9e5,0x4433,0x87,0xc0,{0x68,0xb6,0xb7,0x26,0x99,0xc7}} +#define GPT_ENT_TYPE_MS_LDM_DATA \ + {0xaf9b60a0,0x1431,0x4f62,0xbc,0x68,{0x33,0x11,0x71,0x4a,0x69,0xad}} +#define GPT_ENT_TYPE_MS_LDM_METADATA \ + {0x5808c8aa,0x7e8f,0x42e0,0x85,0xd2,{0xe1,0xe9,0x04,0x34,0xcf,0xb3}} +#define GPT_ENT_TYPE_MS_RECOVERY \ + {0xde94bba4,0x06d1,0x4d40,0xa1,0x6a,{0xbf,0xd5,0x01,0x79,0xd6,0xac}} +#define GPT_ENT_TYPE_MS_RESERVED \ + {0xe3c9e316,0x0b5c,0x4db8,0x81,0x7d,{0xf9,0x2d,0xf0,0x02,0x15,0xae}} +#define GPT_ENT_TYPE_MS_SPACES \ + {0xe75caf8f,0xf680,0x4cee,0xaf,0xa3,{0xb0,0x01,0xe5,0x6e,0xfc,0x2d}} + +#define GPT_ENT_TYPE_LINUX_DATA \ + {0x0fc63daf,0x8483,0x4772,0x8e,0x79,{0x3d,0x69,0xd8,0x47,0x7d,0xe4}} +#define GPT_ENT_TYPE_LINUX_RAID \ + {0xa19d880f,0x05fc,0x4d3b,0xa0,0x06,{0x74,0x3f,0x0f,0x84,0x91,0x1e}} +#define GPT_ENT_TYPE_LINUX_SWAP \ + {0x0657fd6d,0xa4ab,0x43c4,0x84,0xe5,{0x09,0x33,0xc8,0x4b,0x4f,0x4f}} +#define GPT_ENT_TYPE_LINUX_LVM \ + {0xe6d6d379,0xf507,0x44c2,0xa2,0x3c,{0x23,0x8f,0x2a,0x3d,0xf9,0x28}} + +#define GPT_ENT_TYPE_VMFS \ + {0xaa31e02a,0x400f,0x11db,0x95,0x90,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} +#define GPT_ENT_TYPE_VMKDIAG \ + {0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} +#define GPT_ENT_TYPE_VMRESERVED \ + {0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} +#define GPT_ENT_TYPE_VMVSANHDR \ + {0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}} + +#define GPT_ENT_TYPE_APPLE_BOOT \ + {0x426F6F74,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_HFS \ + {0x48465300,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_UFS \ + {0x55465300,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_ZFS \ + {0x6a898cc3,0x1dd2,0x11b2,0x99,0xa6,{0x08,0x00,0x20,0x73,0x66,0x31}} +#define GPT_ENT_TYPE_APPLE_RAID \ + {0x52414944,0x0000,0x11aa,0xaa,0x22,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_RAID_OFFLINE \ + {0x52414944,0x5f4f,0x11aa,0xaa,0x22,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_LABEL \ + {0x4C616265,0x6c00,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_TV_RECOVERY \ + {0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_CORE_STORAGE \ + {0x53746f72,0x6167,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} + +#define GPT_ENT_TYPE_NETBSD_FFS \ + {0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} +#define GPT_ENT_TYPE_NETBSD_LFS \ + {0x49f48d82,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} +#define GPT_ENT_TYPE_NETBSD_SWAP \ + {0x49f48d32,0xb10e,0x11dc,0xB9,0x9B,{0x00,0x19,0xd1,0x87,0x96,0x48}} +#define GPT_ENT_TYPE_NETBSD_RAID \ + {0x49f48daa,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} +#define GPT_ENT_TYPE_NETBSD_CCD \ + {0x2db519c4,0xb10f,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} +#define GPT_ENT_TYPE_NETBSD_CGD \ + {0x2db519ec,0xb10f,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} + +#define GPT_ENT_TYPE_DRAGONFLY_LABEL32 \ + {0x9d087404,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_SWAP \ + {0x9d58fdbd,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_UFS1 \ + {0x9d94ce7c,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_VINUM \ + {0x9dd4478f,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_CCD \ + {0xdbd5211b,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_LABEL64 \ + {0x3d48ce54,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_LEGACY \ + {0xbd215ab2,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_HAMMER \ + {0x61dc63ac,0x6e38,0x11dc,0x85,0x13,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_HAMMER2 \ + {0x5cbb9ad1,0x862d,0x11dc,0xa9,0x4d,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} + +#define GPT_ENT_TYPE_CHROMEOS_FIRMWARE \ + {0xcab6e88e,0xabf3,0x4102,0xa0,0x7a,{0xd4,0xbb,0x9b,0xe3,0xc1,0xd3}} +#define GPT_ENT_TYPE_CHROMEOS_KERNEL \ + {0xfe3a2a5d,0x4f32,0x41a7,0xb7,0x25,{0xac,0xcc,0x32,0x85,0xa3,0x09}} +#define GPT_ENT_TYPE_CHROMEOS_RESERVED \ + {0x2e0a753d,0x9e48,0x43b0,0x83,0x37,{0xb1,0x51,0x92,0xcb,0x1b,0x5e}} +#define GPT_ENT_TYPE_CHROMEOS_ROOT \ + {0x3cb8e202,0x3b7e,0x47dd,0x8a,0x3c,{0x7f,0xf2,0xa1,0x3c,0xfc,0xec}} + +#define GPT_ENT_TYPE_OPENBSD_DATA \ + {0x824cc7a0,0x36a8,0x11e3,0x89,0x0a,{0x95,0x25,0x19,0xad,0x3f,0x61}} + +/* + * Boot partition used by GRUB 2. + */ +#define GPT_ENT_TYPE_BIOS_BOOT \ + {0x21686148,0x6449,0x6e6f,0x74,0x4e,{0x65,0x65,0x64,0x45,0x46,0x49}} + +#endif /* _SYS_GPT_H_ */ Copied: head/sys/sys/vtoc.h (from r306810, head/sys/sys/vtoc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/vtoc.h Sun Oct 16 02:05:22 2016 (r307385, copy of r306810, head/sys/sys/vtoc.h) @@ -0,0 +1,108 @@ +/*- + * Copyright (c) 2008 Marcel Moolenaar + * 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 ``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$ + */ + +#ifndef _SYS_VTOC_H_ +#define _SYS_VTOC_H_ + +#define VTOC_TAG_UNASSIGNED 0x00 +#define VTOC_TAG_BOOT 0x01 +#define VTOC_TAG_ROOT 0x02 +#define VTOC_TAG_SWAP 0x03 +#define VTOC_TAG_USR 0x04 +#define VTOC_TAG_BACKUP 0x05 /* "c" partition */ +#define VTOC_TAG_STAND 0x06 +#define VTOC_TAG_VAR 0x07 +#define VTOC_TAG_HOME 0x08 +#define VTOC_TAG_ALTSCTR 0x09 /* alternate sector partition */ +#define VTOC_TAG_CACHE 0x0a /* Solaris cachefs partition */ +#define VTOC_TAG_VXVM_PUB 0x0e /* VxVM public region */ +#define VTOC_TAG_VXVM_PRIV 0x0f /* VxVM private region */ + +/* NetBSD/mips defines this */ +#define VTOC_TAG_NETBSD_FFS 0xff + +/* FreeBSD tags: the high byte equals ELFOSABI_FREEBSD */ +#define VTOC_TAG_FREEBSD_SWAP 0x0901 +#define VTOC_TAG_FREEBSD_UFS 0x0902 +#define VTOC_TAG_FREEBSD_VINUM 0x0903 +#define VTOC_TAG_FREEBSD_ZFS 0x0904 +#define VTOC_TAG_FREEBSD_NANDFS 0x0905 + +#define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ +#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ + +#define VTOC_ASCII_LEN 128 +#define VTOC_BOOTSIZE 8192 /* 16 sectors */ +#define VTOC_MAGIC 0xdabe +#define VTOC_RAW_PART 2 +#define VTOC_SANITY 0x600ddeee +#define VTOC_VERSION 1 +#define VTOC_VOLUME_LEN 8 + +#define VTOC8_NPARTS 8 + +struct vtoc8 { + char ascii[VTOC_ASCII_LEN]; + uint32_t version; + char volume[VTOC_VOLUME_LEN]; + uint16_t nparts; + struct { + uint16_t tag; + uint16_t flag; + } part[VTOC8_NPARTS] __packed; + uint16_t __alignment; + uint32_t bootinfo[3]; + uint32_t sanity; + uint32_t reserved[10]; + uint32_t timestamp[VTOC8_NPARTS]; + uint16_t wskip; + uint16_t rskip; + char padding[152]; + uint16_t rpm; + uint16_t physcyls; + uint16_t sparesecs; + uint16_t spare1[2]; + uint16_t interleave; + uint16_t ncyls; + uint16_t altcyls; + uint16_t nheads; + uint16_t nsecs; + uint16_t spare2[2]; + struct { + uint32_t cyl; + uint32_t nblks; + } map[VTOC8_NPARTS]; + uint16_t magic; + uint16_t cksum; +} __packed; + +#ifdef CTASSERT +CTASSERT(sizeof(struct vtoc8) == 512); +#endif + +#endif /* _SYS_VTOC_H_ */ From owner-svn-src-head@freebsd.org Sun Oct 16 02:43:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D8AEC11702; Sun, 16 Oct 2016 02:43:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0E1CB80D; Sun, 16 Oct 2016 02:43:53 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9G2hrhn050591; Sun, 16 Oct 2016 02:43:53 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9G2hpJE050577; Sun, 16 Oct 2016 02:43:51 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201610160243.u9G2hpJE050577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 16 Oct 2016 02:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307386 - in head: etc/mtree include sys/sys sys/sys/disk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 02:43:54 -0000 Author: marcel Date: Sun Oct 16 02:43:51 2016 New Revision: 307386 URL: https://svnweb.freebsd.org/changeset/base/307386 Log: Re-apply change 306811 or alternatively, revert change 307385. Added: head/sys/sys/disk/ head/sys/sys/disk/apm.h - copied, changed from r307385, head/sys/sys/apm.h head/sys/sys/disk/bsd.h - copied, changed from r307385, head/sys/sys/disklabel.h head/sys/sys/disk/gpt.h - copied, changed from r307385, head/sys/sys/gpt.h head/sys/sys/disk/mbr.h - copied, changed from r307385, head/sys/sys/diskmbr.h head/sys/sys/disk/pc98.h - copied, changed from r307385, head/sys/sys/diskpc98.h head/sys/sys/disk/vtoc.h - copied, changed from r307385, head/sys/sys/vtoc.h Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/sys/apm.h head/sys/sys/disklabel.h head/sys/sys/diskmbr.h head/sys/sys/diskpc98.h head/sys/sys/gpt.h head/sys/sys/vtoc.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Oct 16 02:05:22 2016 (r307385) +++ head/etc/mtree/BSD.include.dist Sun Oct 16 02:43:51 2016 (r307386) @@ -336,6 +336,8 @@ ssp .. sys + disk + .. .. teken .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Oct 16 02:05:22 2016 (r307385) +++ head/include/Makefile Sun Oct 16 02:43:51 2016 (r307386) @@ -59,6 +59,7 @@ LSUBDIRS= cam/ata cam/nvme cam/scsi \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ security/mac_mls security/mac_partition \ + sys/disk \ ufs/ffs ufs/ufs LSUBSUBDIRS= dev/mpt/mpilib Modified: head/sys/sys/apm.h ============================================================================== --- head/sys/sys/apm.h Sun Oct 16 02:05:22 2016 (r307385) +++ head/sys/sys/apm.h Sun Oct 16 02:43:51 2016 (r307386) @@ -1,69 +1,5 @@ /*- - * Copyright (c) 2007 Marcel Moolenaar - * 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 ``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$ + * This file is in the public domain. */ - -#ifndef _SYS_APM_H_ -#define _SYS_APM_H_ - -/* Driver Descriptor Record. */ -struct apm_ddr { - uint16_t ddr_sig; -#define APM_DDR_SIG 0x4552 - uint16_t ddr_blksize; - uint32_t ddr_blkcount; -}; - -#define APM_ENT_NAMELEN 32 -#define APM_ENT_TYPELEN 32 - -/* Partition Map Entry Record. */ -struct apm_ent { - uint16_t ent_sig; -#define APM_ENT_SIG 0x504d - uint16_t _pad_; - uint32_t ent_pmblkcnt; - uint32_t ent_start; - uint32_t ent_size; - char ent_name[APM_ENT_NAMELEN]; - char ent_type[APM_ENT_TYPELEN]; -}; - -#define APM_ENT_TYPE_SELF "Apple_partition_map" -#define APM_ENT_TYPE_UNUSED "Apple_Free" - -#define APM_ENT_TYPE_FREEBSD "FreeBSD" -#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" -#define APM_ENT_TYPE_FREEBSD_SWAP "FreeBSD-swap" -#define APM_ENT_TYPE_FREEBSD_UFS "FreeBSD-UFS" -#define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" -#define APM_ENT_TYPE_FREEBSD_ZFS "FreeBSD-ZFS" - -#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" -#define APM_ENT_TYPE_APPLE_HFS "Apple_HFS" -#define APM_ENT_TYPE_APPLE_UFS "Apple_UNIX_SVR2" - -#endif /* _SYS_APM_H_ */ +/* $FreeBSD$ */ +#include Copied and modified: head/sys/sys/disk/apm.h (from r307385, head/sys/sys/apm.h) ============================================================================== --- head/sys/sys/apm.h Sun Oct 16 02:05:22 2016 (r307385, copy source) +++ head/sys/sys/disk/apm.h Sun Oct 16 02:43:51 2016 (r307386) @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef _SYS_APM_H_ -#define _SYS_APM_H_ +#ifndef _SYS_DISK_APM_H_ +#define _SYS_DISK_APM_H_ /* Driver Descriptor Record. */ struct apm_ddr { @@ -66,4 +66,4 @@ struct apm_ent { #define APM_ENT_TYPE_APPLE_HFS "Apple_HFS" #define APM_ENT_TYPE_APPLE_UFS "Apple_UNIX_SVR2" -#endif /* _SYS_APM_H_ */ +#endif /* _SYS_DISK_APM_H_ */ Copied and modified: head/sys/sys/disk/bsd.h (from r307385, head/sys/sys/disklabel.h) ============================================================================== --- head/sys/sys/disklabel.h Sun Oct 16 02:05:22 2016 (r307385, copy source) +++ head/sys/sys/disk/bsd.h Sun Oct 16 02:43:51 2016 (r307386) @@ -30,60 +30,45 @@ * $FreeBSD$ */ -#ifndef _SYS_DISKLABEL_H_ -#define _SYS_DISKLABEL_H_ +#ifndef _SYS_DISK_BSD_H_ +#define _SYS_DISK_BSD_H_ -#ifndef _KERNEL -#include -#endif -#include +/* The disk magic number */ +#define BSD_MAGIC 0x82564557U -/* - * Disk description table, see disktab(5) - */ -#define _PATH_DISKTAB "/etc/disktab" +#define BSD_NPARTS_MIN 8 +#define BSD_NPARTS_MAX 20 -/* - * Each disk has a label which includes information about the hardware - * disk geometry, filesystem partitions, and drive specific information. - * The label is in block 0 or 1, possibly offset from the beginning - * to leave room for a bootstrap, etc. - */ +/* Size of bootblock area in sector-size neutral bytes */ +#define BSD_BOOTBLOCK_SIZE 8192 -/* XXX these should be defined per controller (or drive) elsewhere, not here! */ -#if defined(__i386__) || defined(__amd64__) || defined(__arm__) || \ - defined(__powerpc__) || defined(__mips__) -#define LABELSECTOR 1 /* sector containing label */ -#define LABELOFFSET 0 /* offset of label in sector */ -#endif +/* partition containing whole disk */ +#define BSD_PART_RAW 2 -#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */ -#ifndef MAXPARTITIONS -#define MAXPARTITIONS 8 -#endif +/* partition normally containing swap */ +#define BSD_PART_SWAP 1 -/* Size of bootblock area in sector-size neutral bytes */ -#define BBSIZE 8192 +/* Drive-type specific data size (in number of 32-bit inegrals) */ +#define BSD_NDRIVEDATA 5 -#define LABEL_PART 2 /* partition containing label */ -#define RAW_PART 2 /* partition containing whole disk */ -#define SWAP_PART 1 /* partition normally containing swap */ +/* Number of spare 32-bit integrals following drive-type data */ +#define BSD_NSPARE 5 struct disklabel { - u_int32_t d_magic; /* the magic number */ - u_int16_t d_type; /* drive type */ - u_int16_t d_subtype; /* controller/d_type specific */ - char d_typename[16]; /* type name, e.g. "eagle" */ + uint32_t d_magic; /* the magic number */ + uint16_t d_type; /* drive type */ + uint16_t d_subtype; /* controller/d_type specific */ + char d_typename[16]; /* type name, e.g. "eagle" */ - char d_packname[16]; /* pack identifier */ + char d_packname[16]; /* pack identifier */ /* disk geometry: */ - u_int32_t d_secsize; /* # of bytes per sector */ - u_int32_t d_nsectors; /* # of data sectors per track */ - u_int32_t d_ntracks; /* # of tracks per cylinder */ - u_int32_t d_ncylinders; /* # of data cylinders per unit */ - u_int32_t d_secpercyl; /* # of data sectors per cylinder */ - u_int32_t d_secperunit; /* # of data sectors per unit */ + uint32_t d_secsize; /* # of bytes per sector */ + uint32_t d_nsectors; /* # of data sectors per track */ + uint32_t d_ntracks; /* # of tracks per cylinder */ + uint32_t d_ncylinders; /* # of data cylinders per unit */ + uint32_t d_secpercyl; /* # of data sectors per cylinder */ + uint32_t d_secperunit; /* # of data sectors per unit */ /* * Spares (bad sector replacements) below are not counted in @@ -91,13 +76,13 @@ struct disklabel { * be physical sectors which occupy space at the end of each * track and/or cylinder. */ - u_int16_t d_sparespertrack; /* # of spare sectors per track */ - u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */ + uint16_t d_sparespertrack; /* # of spare sectors per track */ + uint16_t d_sparespercyl; /* # of spare sectors per cylinder */ /* * Alternate cylinders include maintenance, replacement, configuration * description areas, etc. */ - u_int32_t d_acylinders; /* # of alt. cylinders per unit */ + uint32_t d_acylinders; /* # of alt. cylinders per unit */ /* hardware characteristics: */ /* @@ -116,53 +101,35 @@ struct disklabel { * is the offset of sector 0 on cylinder N relative to sector 0 * on cylinder N-1. */ - u_int16_t d_rpm; /* rotational speed */ - u_int16_t d_interleave; /* hardware sector interleave */ - u_int16_t d_trackskew; /* sector 0 skew, per track */ - u_int16_t d_cylskew; /* sector 0 skew, per cylinder */ - u_int32_t d_headswitch; /* head switch time, usec */ - u_int32_t d_trkseek; /* track-to-track seek, usec */ - u_int32_t d_flags; /* generic flags */ -#define NDDATA 5 - u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */ -#define NSPARE 5 - u_int32_t d_spare[NSPARE]; /* reserved for future use */ - u_int32_t d_magic2; /* the magic number (again) */ - u_int16_t d_checksum; /* xor of data incl. partitions */ + uint16_t d_rpm; /* rotational speed */ + uint16_t d_interleave; /* hardware sector interleave */ + uint16_t d_trackskew; /* sector 0 skew, per track */ + uint16_t d_cylskew; /* sector 0 skew, per cylinder */ + uint32_t d_headswitch; /* head switch time, usec */ + uint32_t d_trkseek; /* track-to-track seek, usec */ + uint32_t d_flags; /* generic flags */ + uint32_t d_drivedata[BSD_NDRIVEDATA]; /* drive-type specific data */ + uint32_t d_spare[BSD_NSPARE]; /* reserved for future use */ + uint32_t d_magic2; /* the magic number (again) */ + uint16_t d_checksum; /* xor of data incl. partitions */ /* filesystem and partition information: */ - u_int16_t d_npartitions; /* number of partitions in following */ - u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ - u_int32_t d_sbsize; /* max size of fs superblock, bytes */ + uint16_t d_npartitions; /* number of partitions in following */ + uint32_t d_bbsize; /* size of boot area at sn0, bytes */ + uint32_t d_sbsize; /* max size of fs superblock, bytes */ struct partition { /* the partition table */ - u_int32_t p_size; /* number of sectors in partition */ - u_int32_t p_offset; /* starting sector */ - u_int32_t p_fsize; /* filesystem basic fragment size */ - u_int8_t p_fstype; /* filesystem type, see below */ - u_int8_t p_frag; /* filesystem fragments per block */ - u_int16_t p_cpg; /* filesystem cylinders per group */ - } d_partitions[MAXPARTITIONS]; /* actually may be more */ + uint32_t p_size; /* number of sectors in partition */ + uint32_t p_offset; /* starting sector */ + uint32_t p_fsize; /* filesystem basic fragment size */ + uint8_t p_fstype; /* filesystem type, see below */ + uint8_t p_frag; /* filesystem fragments per block */ + uint16_t p_cpg; /* filesystem cylinders per group */ + } d_partitions[BSD_NPARTS_MIN]; /* actually may be more */ }; - #ifdef CTASSERT -CTASSERT(sizeof(struct disklabel) == 148 + MAXPARTITIONS * 16); +CTASSERT(sizeof(struct disklabel) == 148 + BSD_NPARTS_MIN * 16); #endif -static __inline u_int16_t dkcksum(struct disklabel *lp); -static __inline u_int16_t -dkcksum(struct disklabel *lp) -{ - u_int16_t *start, *end; - u_int16_t sum = 0; - - start = (u_int16_t *)lp; - end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions]; - while (start < end) - sum ^= *start++; - return (sum); -} - - /* d_type values: */ #define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ #define DTYPE_MSCP 2 /* MSCP */ @@ -179,30 +146,6 @@ dkcksum(struct disklabel *lp) #define DTYPE_RAID 14 /* CMU RAIDFrame */ #define DTYPE_JFS2 16 /* IBM JFS 2 */ -#ifdef DKTYPENAMES -static const char *dktypenames[] = { - "unknown", - "SMD", - "MSCP", - "old DEC", - "SCSI", - "ESDI", - "ST506", - "HP-IB", - "HP-FL", - "type 9", - "floppy", - "CCD", - "Vinum", - "DOC2K", - "Raid", - "?", - "jfs", - NULL -}; -#define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) -#endif - /* * Filesystem type and version. * Used to interpret other filesystem-specific @@ -236,44 +179,6 @@ static const char *dktypenames[] = { #define FS_ZFS 27 /* Sun's ZFS */ #define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ -#ifdef FSTYPENAMES -static const char *fstypenames[] = { - "unused", - "swap", - "Version 6", - "Version 7", - "System V", - "4.1BSD", - "Eighth Edition", - "4.2BSD", - "MSDOS", - "4.4LFS", - "unknown", - "HPFS", - "ISO9660", - "boot", - "vinum", - "raid", - "Filecore", - "EXT2FS", - "NTFS", - "?", - "ccd", - "jfs", - "HAMMER", - "HAMMER2", - "UDF", - "?", - "EFS", - "ZFS", - "?", - "?", - "nandfs", - NULL -}; -#define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) -#endif - /* * flags shared by various drives: */ @@ -283,23 +188,4 @@ static const char *fstypenames[] = { #define D_RAMDISK 0x08 /* disk emulator */ #define D_CHAIN 0x10 /* can do back-back transfers */ -/* - * NB: defines ioctls from 'd'/128 and up. - */ - -/* - * Functions for proper encoding/decoding of struct disklabel into/from - * bytestring. - */ -void bsd_partition_le_dec(u_char *ptr, struct partition *d); -int bsd_disklabel_le_dec(u_char *ptr, struct disklabel *d, int maxpart); -void bsd_partition_le_enc(u_char *ptr, struct partition *d); -void bsd_disklabel_le_enc(u_char *ptr, struct disklabel *d); - -#ifndef _KERNEL -__BEGIN_DECLS -struct disklabel *getdiskbyname(const char *); -__END_DECLS -#endif - -#endif /* !_SYS_DISKLABEL_H_ */ +#endif /* !_SYS_DISK_BSD_H_ */ Copied and modified: head/sys/sys/disk/gpt.h (from r307385, head/sys/sys/gpt.h) ============================================================================== --- head/sys/sys/gpt.h Sun Oct 16 02:05:22 2016 (r307385, copy source) +++ head/sys/sys/disk/gpt.h Sun Oct 16 02:43:51 2016 (r307386) @@ -26,10 +26,31 @@ * $FreeBSD$ */ -#ifndef _SYS_GPT_H_ -#define _SYS_GPT_H_ +#ifndef _SYS_DISK_GPT_H_ +#define _SYS_DISK_GPT_H_ -#include +/* + * Applications can define GPT_UUID_TYPE if they want the GPT structures + * to use a particular type definition for UUIDs/GUIDs. This header uses + * a generic (DCE 1.1 compatible) definition otherwise. + */ +#ifndef GPT_UUID_TYPE +struct gpt_uuid { + uint32_t time_low; + uint16_t time_mid; + uint16_t time_hi_and_version; + uint8_t clock_seq_hi_and_reserved; + uint8_t clock_seq_low; + uint8_t node[6]; +}; +#define GPT_UUID_TYPE struct gpt_uuid +#endif /* !GPT_UUID_TYPE */ + +typedef GPT_UUID_TYPE gpt_uuid_t; + +#ifdef CTASSERT +CTASSERT(sizeof(gpt_uuid_t) == 16); +#endif struct gpt_hdr { char hdr_sig[8]; @@ -43,7 +64,7 @@ struct gpt_hdr { uint64_t hdr_lba_alt; uint64_t hdr_lba_start; uint64_t hdr_lba_end; - struct uuid hdr_uuid; + gpt_uuid_t hdr_uuid; uint64_t hdr_lba_table; uint32_t hdr_entries; uint32_t hdr_entsz; @@ -57,10 +78,13 @@ struct gpt_hdr { */ uint32_t padding; }; +#ifdef CTASSERT +CTASSERT(offsetof(struct gpt_hdr, padding) == 92); +#endif struct gpt_ent { - struct uuid ent_type; - struct uuid ent_uuid; + gpt_uuid_t ent_type; + gpt_uuid_t ent_uuid; uint64_t ent_lba_start; uint64_t ent_lba_end; uint64_t ent_attr; @@ -70,6 +94,9 @@ struct gpt_ent { #define GPT_ENT_ATTR_BOOTFAILED (1ULL << 57) uint16_t ent_name[36]; /* UTF-16. */ }; +#ifdef CTASSERT +CTASSERT(sizeof(struct gpt_ent) == 128); +#endif /* CTASSERT */ #define GPT_ENT_TYPE_UNUSED \ {0x00000000,0x0000,0x0000,0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}} @@ -207,4 +234,4 @@ struct gpt_ent { #define GPT_ENT_TYPE_BIOS_BOOT \ {0x21686148,0x6449,0x6e6f,0x74,0x4e,{0x65,0x65,0x64,0x45,0x46,0x49}} -#endif /* _SYS_GPT_H_ */ +#endif /* _SYS_DISK_GPT_H_ */ Copied and modified: head/sys/sys/disk/mbr.h (from r307385, head/sys/sys/diskmbr.h) ============================================================================== --- head/sys/sys/diskmbr.h Sun Oct 16 02:05:22 2016 (r307385, copy source) +++ head/sys/sys/disk/mbr.h Sun Oct 16 02:43:51 2016 (r307386) @@ -30,10 +30,8 @@ * $FreeBSD$ */ -#ifndef _SYS_DISKMBR_H_ -#define _SYS_DISKMBR_H_ - -#include +#ifndef _SYS_DISK_MBR_H_ +#define _SYS_DISK_MBR_H_ #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ @@ -73,19 +71,14 @@ struct dos_partition { unsigned char dp_ehd; /* end head */ unsigned char dp_esect; /* end sector */ unsigned char dp_ecyl; /* end cylinder */ - u_int32_t dp_start; /* absolute starting sector number */ - u_int32_t dp_size; /* partition size in sectors */ + uint32_t dp_start; /* absolute starting sector number */ + uint32_t dp_size; /* partition size in sectors */ }; #ifdef CTASSERT CTASSERT(sizeof (struct dos_partition) == DOSPARTSIZE); #endif -void dos_partition_dec(void const *pp, struct dos_partition *d); -void dos_partition_enc(void *pp, struct dos_partition *d); - #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ -#define DIOCSMBR _IOW('M', 129, u_char[512]) - -#endif /* !_SYS_DISKMBR_H_ */ +#endif /* !_SYS_DISK_MBR_H_ */ Copied and modified: head/sys/sys/disk/pc98.h (from r307385, head/sys/sys/diskpc98.h) ============================================================================== --- head/sys/sys/diskpc98.h Sun Oct 16 02:05:22 2016 (r307385, copy source) +++ head/sys/sys/disk/pc98.h Sun Oct 16 02:43:51 2016 (r307386) @@ -30,10 +30,8 @@ * $FreeBSD$ */ -#ifndef _SYS_DISKPC98_H_ -#define _SYS_DISKPC98_H_ - -#include +#ifndef _SYS_DISK_PC98_H_ +#define _SYS_DISK_PC98_H_ #define PC98_BBSECTOR 1 /* DOS boot block relative sector number */ #define PC98_PARTOFF 0 @@ -50,12 +48,12 @@ #define PC98_SID_MASK 0x7f #define PC98_SID_386BSD 0x44 -#define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) -#define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) -#define PC98_PTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) +#define __DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) +#define __DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) +#define PC98_PTYP_386BSD (__DOSSID_386BSD << 8 | __DOSMID_386BSD) struct pc98_partition { - unsigned char dp_mid; + unsigned char dp_mid; unsigned char dp_sid; unsigned char dp_dum1; unsigned char dp_dum2; @@ -74,9 +72,4 @@ struct pc98_partition { CTASSERT(sizeof (struct pc98_partition) == PC98_PARTSIZE); #endif -void pc98_partition_dec(void const *pp, struct pc98_partition *d); -void pc98_partition_enc(void *pp, struct pc98_partition *d); - -#define DIOCSPC98 _IOW('M', 129, u_char[8192]) - -#endif /* !_SYS_DISKPC98_H_ */ +#endif /* !_SYS_DISK_PC98_H_ */ Copied and modified: head/sys/sys/disk/vtoc.h (from r307385, head/sys/sys/vtoc.h) ============================================================================== --- head/sys/sys/vtoc.h Sun Oct 16 02:05:22 2016 (r307385, copy source) +++ head/sys/sys/disk/vtoc.h Sun Oct 16 02:43:51 2016 (r307386) @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef _SYS_VTOC_H_ -#define _SYS_VTOC_H_ +#ifndef _SYS_DISK_VTOC_H_ +#define _SYS_DISK_VTOC_H_ #define VTOC_TAG_UNASSIGNED 0x00 #define VTOC_TAG_BOOT 0x01 @@ -74,7 +74,7 @@ struct vtoc8 { struct { uint16_t tag; uint16_t flag; - } part[VTOC8_NPARTS] __packed; + } part[VTOC8_NPARTS]; uint16_t __alignment; uint32_t bootinfo[3]; uint32_t sanity; @@ -99,10 +99,10 @@ struct vtoc8 { } map[VTOC8_NPARTS]; uint16_t magic; uint16_t cksum; -} __packed; +}; #ifdef CTASSERT CTASSERT(sizeof(struct vtoc8) == 512); #endif -#endif /* _SYS_VTOC_H_ */ +#endif /* _SYS_DISK_VTOC_H_ */ Modified: head/sys/sys/disklabel.h ============================================================================== --- head/sys/sys/disklabel.h Sun Oct 16 02:05:22 2016 (r307385) +++ head/sys/sys/disklabel.h Sun Oct 16 02:43:51 2016 (r307386) @@ -38,115 +38,38 @@ #endif #include -/* - * Disk description table, see disktab(5) - */ +#include + +/* Disk description table, see disktab(5) */ #define _PATH_DISKTAB "/etc/disktab" /* - * Each disk has a label which includes information about the hardware - * disk geometry, filesystem partitions, and drive specific information. * The label is in block 0 or 1, possibly offset from the beginning * to leave room for a bootstrap, etc. + * XXX these should be defined per controller (or drive) elsewhere, not here! + * XXX in actuality it can't even be per controller or drive. It should be + * constant/fixed across storage hardware and CPU architectures. Disks can + * travel from one machine to another and a label created on one machine + * should be detectable and understood by the other. */ - -/* XXX these should be defined per controller (or drive) elsewhere, not here! */ -#if defined(__i386__) || defined(__amd64__) || defined(__arm__) || \ - defined(__powerpc__) || defined(__mips__) #define LABELSECTOR 1 /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ -#endif -#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */ +#define DISKMAGIC BSD_MAGIC /* The disk magic number */ + #ifndef MAXPARTITIONS -#define MAXPARTITIONS 8 +#define MAXPARTITIONS BSD_NPARTS_MIN #endif /* Size of bootblock area in sector-size neutral bytes */ -#define BBSIZE 8192 +#define BBSIZE BSD_BOOTBLOCK_SIZE -#define LABEL_PART 2 /* partition containing label */ -#define RAW_PART 2 /* partition containing whole disk */ -#define SWAP_PART 1 /* partition normally containing swap */ - -struct disklabel { - u_int32_t d_magic; /* the magic number */ - u_int16_t d_type; /* drive type */ - u_int16_t d_subtype; /* controller/d_type specific */ - char d_typename[16]; /* type name, e.g. "eagle" */ - - char d_packname[16]; /* pack identifier */ - - /* disk geometry: */ - u_int32_t d_secsize; /* # of bytes per sector */ - u_int32_t d_nsectors; /* # of data sectors per track */ - u_int32_t d_ntracks; /* # of tracks per cylinder */ - u_int32_t d_ncylinders; /* # of data cylinders per unit */ - u_int32_t d_secpercyl; /* # of data sectors per cylinder */ - u_int32_t d_secperunit; /* # of data sectors per unit */ - - /* - * Spares (bad sector replacements) below are not counted in - * d_nsectors or d_secpercyl. Spare sectors are assumed to - * be physical sectors which occupy space at the end of each - * track and/or cylinder. - */ - u_int16_t d_sparespertrack; /* # of spare sectors per track */ - u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */ - /* - * Alternate cylinders include maintenance, replacement, configuration - * description areas, etc. - */ - u_int32_t d_acylinders; /* # of alt. cylinders per unit */ - - /* hardware characteristics: */ - /* - * d_interleave, d_trackskew and d_cylskew describe perturbations - * in the media format used to compensate for a slow controller. - * Interleave is physical sector interleave, set up by the - * formatter or controller when formatting. When interleaving is - * in use, logically adjacent sectors are not physically - * contiguous, but instead are separated by some number of - * sectors. It is specified as the ratio of physical sectors - * traversed per logical sector. Thus an interleave of 1:1 - * implies contiguous layout, while 2:1 implies that logical - * sector 0 is separated by one sector from logical sector 1. - * d_trackskew is the offset of sector 0 on track N relative to - * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew - * is the offset of sector 0 on cylinder N relative to sector 0 - * on cylinder N-1. - */ - u_int16_t d_rpm; /* rotational speed */ - u_int16_t d_interleave; /* hardware sector interleave */ - u_int16_t d_trackskew; /* sector 0 skew, per track */ - u_int16_t d_cylskew; /* sector 0 skew, per cylinder */ - u_int32_t d_headswitch; /* head switch time, usec */ - u_int32_t d_trkseek; /* track-to-track seek, usec */ - u_int32_t d_flags; /* generic flags */ -#define NDDATA 5 - u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */ -#define NSPARE 5 - u_int32_t d_spare[NSPARE]; /* reserved for future use */ - u_int32_t d_magic2; /* the magic number (again) */ - u_int16_t d_checksum; /* xor of data incl. partitions */ - - /* filesystem and partition information: */ - u_int16_t d_npartitions; /* number of partitions in following */ - u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ - u_int32_t d_sbsize; /* max size of fs superblock, bytes */ - struct partition { /* the partition table */ - u_int32_t p_size; /* number of sectors in partition */ - u_int32_t p_offset; /* starting sector */ - u_int32_t p_fsize; /* filesystem basic fragment size */ - u_int8_t p_fstype; /* filesystem type, see below */ - u_int8_t p_frag; /* filesystem fragments per block */ - u_int16_t p_cpg; /* filesystem cylinders per group */ - } d_partitions[MAXPARTITIONS]; /* actually may be more */ -}; +#define LABEL_PART BSD_PART_RAW +#define RAW_PART BSD_PART_RAW +#define SWAP_PART BSD_PART_SWAP -#ifdef CTASSERT -CTASSERT(sizeof(struct disklabel) == 148 + MAXPARTITIONS * 16); -#endif +#define NDDATA BSD_NDRIVEDATA +#define NSPARE BSD_NSPARE static __inline u_int16_t dkcksum(struct disklabel *lp); static __inline u_int16_t @@ -162,23 +85,6 @@ dkcksum(struct disklabel *lp) return (sum); } - -/* d_type values: */ -#define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ -#define DTYPE_MSCP 2 /* MSCP */ -#define DTYPE_DEC 3 /* other DEC (rk, rl) */ -#define DTYPE_SCSI 4 /* SCSI */ -#define DTYPE_ESDI 5 /* ESDI interface */ -#define DTYPE_ST506 6 /* ST506 etc. */ -#define DTYPE_HPIB 7 /* CS/80 on HP-IB */ -#define DTYPE_HPFL 8 /* HP Fiber-link */ -#define DTYPE_FLOPPY 10 /* floppy */ -#define DTYPE_CCD 11 /* concatenated disk */ -#define DTYPE_VINUM 12 /* vinum volume */ -#define DTYPE_DOC2K 13 /* Msys DiskOnChip */ -#define DTYPE_RAID 14 /* CMU RAIDFrame */ -#define DTYPE_JFS2 16 /* IBM JFS 2 */ - #ifdef DKTYPENAMES static const char *dktypenames[] = { "unknown", @@ -203,39 +109,6 @@ static const char *dktypenames[] = { #define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) #endif -/* - * Filesystem type and version. - * Used to interpret other filesystem-specific - * per-partition information. - */ -#define FS_UNUSED 0 /* unused */ -#define FS_SWAP 1 /* swap */ -#define FS_V6 2 /* Sixth Edition */ -#define FS_V7 3 /* Seventh Edition */ -#define FS_SYSV 4 /* System V */ -#define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */ -#define FS_V8 6 /* Eighth Edition, 4K blocks */ -#define FS_BSDFFS 7 /* 4.2BSD fast filesystem */ -#define FS_MSDOS 8 /* MSDOS filesystem */ -#define FS_BSDLFS 9 /* 4.4BSD log-structured filesystem */ -#define FS_OTHER 10 /* in use, but unknown/unsupported */ -#define FS_HPFS 11 /* OS/2 high-performance filesystem */ -#define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */ -#define FS_BOOT 13 /* partition contains bootstrap */ -#define FS_VINUM 14 /* Vinum drive */ -#define FS_RAID 15 /* RAIDFrame drive */ -#define FS_FILECORE 16 /* Acorn Filecore Filing System */ -#define FS_EXT2FS 17 /* ext2fs */ -#define FS_NTFS 18 /* Windows/NT file system */ -#define FS_CCD 20 /* concatenated disk component */ -#define FS_JFS2 21 /* IBM JFS2 */ -#define FS_HAMMER 22 /* DragonFlyBSD Hammer FS */ -#define FS_HAMMER2 23 /* DragonFlyBSD Hammer2 FS */ -#define FS_UDF 24 /* UDF */ -#define FS_EFS 26 /* SGI's Extent File system */ -#define FS_ZFS 27 /* Sun's ZFS */ -#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ - #ifdef FSTYPENAMES static const char *fstypenames[] = { "unused", @@ -275,15 +148,6 @@ static const char *fstypenames[] = { #endif /* - * flags shared by various drives: - */ -#define D_REMOVABLE 0x01 /* removable media */ -#define D_ECC 0x02 /* supports ECC */ -#define D_BADSECT 0x04 /* supports bad sector forw. */ -#define D_RAMDISK 0x08 /* disk emulator */ -#define D_CHAIN 0x10 /* can do back-back transfers */ - -/* * NB: defines ioctls from 'd'/128 and up. */ Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Sun Oct 16 02:05:22 2016 (r307385) +++ head/sys/sys/diskmbr.h Sun Oct 16 02:43:51 2016 (r307386) @@ -33,59 +33,12 @@ #ifndef _SYS_DISKMBR_H_ #define _SYS_DISKMBR_H_ +#include #include -#define DOSBBSECTOR 0 /* DOS boot block relative sector number */ -#define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ -#define DOSPARTOFF 446 -#define DOSPARTSIZE 16 -#define NDOSPART 4 -#define NEXTDOSPART 32 -#define DOSMAGICOFFSET 510 -#define DOSMAGIC 0xAA55 - -#define DOSPTYP_EXT 0x05 /* DOS extended partition */ -#define DOSPTYP_FAT16 0x06 /* FAT16 partition */ -#define DOSPTYP_NTFS 0x07 /* NTFS partition */ -#define DOSPTYP_FAT32 0x0b /* FAT32 partition */ -#define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ -#define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ -#define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ -#define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ -#define DOSPTYP_LINUX 0x83 /* Linux partition */ -#define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ -#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ -#define DOSPTYP_APPLE_UFS 0xa8 /* Apple Mac OS X boot */ -#define DOSPTYP_APPLE_BOOT 0xab /* Apple Mac OS X UFS */ -#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ -#define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ -#define DOSPTYP_EFI 0xef /* EFI FAT parition */ -#define DOSPTYP_VMFS 0xfb /* VMware VMFS partition */ -#define DOSPTYP_VMKDIAG 0xfc /* VMware vmkDiagnostic partition */ -#define DOSPTYP_LINRAID 0xfd /* Linux raid partition */ - -struct dos_partition { - unsigned char dp_flag; /* bootstrap flags */ - unsigned char dp_shd; /* starting head */ - unsigned char dp_ssect; /* starting sector */ - unsigned char dp_scyl; /* starting cylinder */ - unsigned char dp_typ; /* partition type */ - unsigned char dp_ehd; /* end head */ - unsigned char dp_esect; /* end sector */ - unsigned char dp_ecyl; /* end cylinder */ - u_int32_t dp_start; /* absolute starting sector number */ - u_int32_t dp_size; /* partition size in sectors */ -}; -#ifdef CTASSERT -CTASSERT(sizeof (struct dos_partition) == DOSPARTSIZE); -#endif - void dos_partition_dec(void const *pp, struct dos_partition *d); void dos_partition_enc(void *pp, struct dos_partition *d); -#define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ -#define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ - #define DIOCSMBR _IOW('M', 129, u_char[512]) #endif /* !_SYS_DISKMBR_H_ */ Modified: head/sys/sys/diskpc98.h ============================================================================== --- head/sys/sys/diskpc98.h Sun Oct 16 02:05:22 2016 (r307385) +++ head/sys/sys/diskpc98.h Sun Oct 16 02:43:51 2016 (r307386) @@ -33,46 +33,11 @@ #ifndef _SYS_DISKPC98_H_ #define _SYS_DISKPC98_H_ +#include #include -#define PC98_BBSECTOR 1 /* DOS boot block relative sector number */ -#define PC98_PARTOFF 0 -#define PC98_PARTSIZE 32 -#define PC98_NPARTS 16 -#define PC98_MAGICOFS 510 -#define PC98_MAGIC 0xAA55 - -#define PC98_MID_BOOTABLE 0x80 -#define PC98_MID_MASK 0x7f -#define PC98_MID_386BSD 0x14 - -#define PC98_SID_ACTIVE 0x80 -#define PC98_SID_MASK 0x7f -#define PC98_SID_386BSD 0x44 - -#define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) -#define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) -#define PC98_PTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) - -struct pc98_partition { - unsigned char dp_mid; - unsigned char dp_sid; - unsigned char dp_dum1; - unsigned char dp_dum2; - unsigned char dp_ipl_sct; - unsigned char dp_ipl_head; - unsigned short dp_ipl_cyl; - unsigned char dp_ssect; /* starting sector */ - unsigned char dp_shd; /* starting head */ - unsigned short dp_scyl; /* starting cylinder */ - unsigned char dp_esect; /* end sector */ - unsigned char dp_ehd; /* end head */ - unsigned short dp_ecyl; /* end cylinder */ - unsigned char dp_name[16]; -}; -#ifdef CTASSERT -CTASSERT(sizeof (struct pc98_partition) == PC98_PARTSIZE); -#endif +#define DOSMID_386BSD __DOSMID_386BSD +#define DOSSID_386BSD __DOSSID_386BSD void pc98_partition_dec(void const *pp, struct pc98_partition *d); void pc98_partition_enc(void *pp, struct pc98_partition *d); Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Sun Oct 16 02:05:22 2016 (r307385) +++ head/sys/sys/gpt.h Sun Oct 16 02:43:51 2016 (r307386) @@ -31,180 +31,7 @@ #include -struct gpt_hdr { - char hdr_sig[8]; -#define GPT_HDR_SIG "EFI PART" - uint32_t hdr_revision; -#define GPT_HDR_REVISION 0x00010000 - uint32_t hdr_size; - uint32_t hdr_crc_self; - uint32_t __reserved; - uint64_t hdr_lba_self; - uint64_t hdr_lba_alt; - uint64_t hdr_lba_start; - uint64_t hdr_lba_end; - struct uuid hdr_uuid; - uint64_t hdr_lba_table; - uint32_t hdr_entries; - uint32_t hdr_entsz; - uint32_t hdr_crc_table; - /* - * The header as defined in the EFI spec is not a multiple of 8 bytes - * and given that the alignment requirement is on an 8 byte boundary, - * padding will happen. We make the padding explicit so that we can - * correct the value returned by sizeof() when we put the size of the - * header in field hdr_size, or otherwise use offsetof(). - */ - uint32_t padding; -}; - -struct gpt_ent { - struct uuid ent_type; - struct uuid ent_uuid; - uint64_t ent_lba_start; - uint64_t ent_lba_end; - uint64_t ent_attr; -#define GPT_ENT_ATTR_PLATFORM (1ULL << 0) -#define GPT_ENT_ATTR_BOOTME (1ULL << 59) -#define GPT_ENT_ATTR_BOOTONCE (1ULL << 58) -#define GPT_ENT_ATTR_BOOTFAILED (1ULL << 57) - uint16_t ent_name[36]; /* UTF-16. */ -}; - -#define GPT_ENT_TYPE_UNUSED \ - {0x00000000,0x0000,0x0000,0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}} -#define GPT_ENT_TYPE_EFI \ - {0xc12a7328,0xf81f,0x11d2,0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}} -#define GPT_ENT_TYPE_MBR \ - {0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}} -#define GPT_ENT_TYPE_FREEBSD \ - {0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_BOOT \ - {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} -#define GPT_ENT_TYPE_FREEBSD_NANDFS \ - {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} -#define GPT_ENT_TYPE_FREEBSD_SWAP \ - {0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_UFS \ - {0x516e7cb6,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_VINUM \ - {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_ZFS \ - {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_PREP_BOOT \ - {0x9e1a2d38,0xc612,0x4316,0xaa,0x26,{0x8b,0x49,0x52,0x1e,0x5a,0x8b}} - -/* - * The following are unused but documented here to avoid reuse. - * - * GPT_ENT_TYPE_FREEBSD_UFS2 \ - * {0x516e7cb7,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} - */ - -/* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 16 02:55:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C50D6C11937; Sun, 16 Oct 2016 02:55:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 9F2E9C92; Sun, 16 Oct 2016 02:55:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9G2trKD054359; Sun, 16 Oct 2016 02:55:53 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9G2trba054350; Sun, 16 Oct 2016 02:55:53 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201610160255.u9G2trba054350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 16 Oct 2016 02:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307387 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 02:55:54 -0000 Author: marcel Date: Sun Oct 16 02:55:52 2016 New Revision: 307387 URL: https://svnweb.freebsd.org/changeset/base/307387 Log: Switch to using the portable partition scheme headers. Modified: head/usr.bin/mkimg/Makefile head/usr.bin/mkimg/apm.c head/usr.bin/mkimg/bsd.c head/usr.bin/mkimg/ebr.c head/usr.bin/mkimg/gpt.c head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/pc98.c head/usr.bin/mkimg/vtoc8.c Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/Makefile Sun Oct 16 02:55:52 2016 (r307387) @@ -11,6 +11,7 @@ mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE +CFLAGS+=-I${.CURDIR:H:H}/sys # List of formats to support SRCS+= \ Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/apm.c Sun Oct 16 02:55:52 2016 (r307387) @@ -33,20 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef APM_ENT_TYPE_APPLE_BOOT -#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" -#endif -#ifndef APM_ENT_TYPE_FREEBSD_NANDFS -#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" -#endif - static struct mkimg_alias apm_aliases[] = { { ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) }, { ALIAS_FREEBSD_BOOT, ALIAS_PTR2TYPE(APM_ENT_TYPE_APPLE_BOOT) }, Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/bsd.c Sun Oct 16 02:55:52 2016 (r307387) @@ -33,17 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef FS_NANDFS -#define FS_NANDFS 30 -#endif - static struct mkimg_alias bsd_aliases[] = { { ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(FS_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(FS_SWAP) }, @@ -58,7 +54,7 @@ bsd_metadata(u_int where, lba_t blk) { if (where == SCHEME_META_IMG_START) - blk += BBSIZE / secsz; + blk += BSD_BOOTBLOCK_SIZE / secsz; else if (where == SCHEME_META_IMG_END) blk = round_cylinder(blk); else @@ -76,21 +72,21 @@ bsd_write(lba_t imgsz, void *bootcode) int bsdparts, error, n; uint16_t checksum; - buf = malloc(BBSIZE); + buf = malloc(BSD_BOOTBLOCK_SIZE); if (buf == NULL) return (ENOMEM); if (bootcode != NULL) { - memcpy(buf, bootcode, BBSIZE); + memcpy(buf, bootcode, BSD_BOOTBLOCK_SIZE); memset(buf + secsz, 0, sizeof(struct disklabel)); } else - memset(buf, 0, BBSIZE); + memset(buf, 0, BSD_BOOTBLOCK_SIZE); bsdparts = nparts + 1; /* Account for c partition */ - if (bsdparts < MAXPARTITIONS) - bsdparts = MAXPARTITIONS; + if (bsdparts < BSD_NPARTS_MIN) + bsdparts = BSD_NPARTS_MIN; d = (void *)(buf + secsz); - le32enc(&d->d_magic, DISKMAGIC); + le32enc(&d->d_magic, BSD_MAGIC); le32enc(&d->d_secsize, secsz); le32enc(&d->d_nsectors, nsecs); le32enc(&d->d_ntracks, nheads); @@ -98,14 +94,14 @@ bsd_write(lba_t imgsz, void *bootcode) le32enc(&d->d_secpercyl, nsecs * nheads); le32enc(&d->d_secperunit, imgsz); le16enc(&d->d_rpm, 3600); - le32enc(&d->d_magic2, DISKMAGIC); + le32enc(&d->d_magic2, BSD_MAGIC); le16enc(&d->d_npartitions, bsdparts); - le32enc(&d->d_bbsize, BBSIZE); + le32enc(&d->d_bbsize, BSD_BOOTBLOCK_SIZE); - dp = &d->d_partitions[RAW_PART]; + dp = &d->d_partitions[BSD_PART_RAW]; le32enc(&dp->p_size, imgsz); TAILQ_FOREACH(part, &partlist, link) { - n = part->index + ((part->index >= RAW_PART) ? 1 : 0); + n = part->index + ((part->index >= BSD_PART_RAW) ? 1 : 0); dp = &d->d_partitions[n]; le32enc(&dp->p_size, part->size); le32enc(&dp->p_offset, part->block); @@ -121,7 +117,7 @@ bsd_write(lba_t imgsz, void *bootcode) checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); - error = image_write(0, buf, BBSIZE / secsz); + error = image_write(0, buf, BSD_BOOTBLOCK_SIZE / secsz); free(buf); return (error); } @@ -132,8 +128,8 @@ static struct mkimg_scheme bsd_scheme = .aliases = bsd_aliases, .metadata = bsd_metadata, .write = bsd_write, - .nparts = 19, - .bootcode = BBSIZE, + .nparts = BSD_NPARTS_MAX - 1, + .bootcode = BSD_BOOTBLOCK_SIZE, .maxsecsz = 512 }; Modified: head/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/ebr.c Sun Oct 16 02:55:52 2016 (r307387) @@ -33,22 +33,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef DOSPTYP_FAT16B -#define DOSPTYP_FAT16B 0x06 -#endif -#ifndef DOSPTYP_FAT32 -#define DOSPTYP_FAT32 0x0b -#endif - static struct mkimg_alias ebr_aliases[] = { - { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NONE, 0 } Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/gpt.c Sun Oct 16 02:55:52 2016 (r307387) @@ -35,19 +35,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef GPT_ENT_TYPE_FREEBSD_NANDFS -#define GPT_ENT_TYPE_FREEBSD_NANDFS \ - {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} -#endif - static uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; static uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/mbr.c Sun Oct 16 02:55:52 2016 (r307387) @@ -33,30 +33,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef DOSPTYP_FAT16B -#define DOSPTYP_FAT16B 0x06 -#endif -#ifndef DOSPTYP_FAT32 -#define DOSPTYP_FAT32 0x0b -#endif -#ifndef DOSPTYP_PPCBOOT -#define DOSPTYP_PPCBOOT 0x41 -#endif -#ifndef DOSPTYP_EFI -#define DOSPTYP_EFI 0xef -#endif - static struct mkimg_alias mbr_aliases[] = { { ALIAS_EBR, ALIAS_INT2TYPE(DOSPTYP_EXT) }, { ALIAS_EFI, ALIAS_INT2TYPE(DOSPTYP_EFI) }, - { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NTFS, ALIAS_INT2TYPE(DOSPTYP_NTFS) }, Modified: head/usr.bin/mkimg/pc98.c ============================================================================== --- head/usr.bin/mkimg/pc98.c Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/pc98.c Sun Oct 16 02:55:52 2016 (r307387) @@ -33,26 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef PC98_MAGIC -#define PC98_MAGIC 0xaa55 -#endif -#ifndef PC98_MAGICOFS -#define PC98_MAGICOFS 510 -#endif -#ifndef PC98_NPARTS -#define PC98_NPARTS 16 -#endif -#ifndef PC98_PTYP_386BSD -#define PC98_PTYP_386BSD 0xc494 -#endif - #define PC98_BOOTCODESZ 8192 static struct mkimg_alias pc98_aliases[] = { Modified: head/usr.bin/mkimg/vtoc8.c ============================================================================== --- head/usr.bin/mkimg/vtoc8.c Sun Oct 16 02:43:51 2016 (r307386) +++ head/usr.bin/mkimg/vtoc8.c Sun Oct 16 02:55:52 2016 (r307387) @@ -34,17 +34,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef VTOC_TAG_FREEBSD_NANDFS -#define VTOC_TAG_FREEBSD_NANDFS 0x0905 -#endif - static struct mkimg_alias vtoc8_aliases[] = { { ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(VTOC_TAG_FREEBSD_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(VTOC_TAG_FREEBSD_SWAP) }, From owner-svn-src-head@freebsd.org Sun Oct 16 04:22:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4181DC13048; Sun, 16 Oct 2016 04:22:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0DEEC942; Sun, 16 Oct 2016 04:22:05 +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 u9G4M5DX089539; Sun, 16 Oct 2016 04:22:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9G4M52R089538; Sun, 16 Oct 2016 04:22:05 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610160422.u9G4M52R089538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 16 Oct 2016 04:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307388 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 04:22:06 -0000 Author: jhibbits Date: Sun Oct 16 04:22:04 2016 New Revision: 307388 URL: https://svnweb.freebsd.org/changeset/base/307388 Log: Fix booting on systems that use loader(8) (most of them). r306065/r306067 introduced ofw_parse_bootargs(), setting environment variables from Open Firmware's /chosen/bootargs property. On systems booting with loader(8) (meaning, most systems), the initial static kenv is created with no extra space, causing kern_setenv() to panic. Since these already have the environment set directly, there is no need to parse bootargs anyway. Found by: swills Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sun Oct 16 02:55:52 2016 (r307387) +++ head/sys/powerpc/powerpc/machdep.c Sun Oct 16 04:22:04 2016 (r307388) @@ -238,6 +238,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ vm_offset_t startkernel, endkernel; void *kmdp; char *env; + bool ofw_bootargs = false; #ifdef DDB vm_offset_t ksym_start; vm_offset_t ksym_end; @@ -295,6 +296,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ bzero(__bss_start, _end - __bss_start); #endif init_static_kenv(init_kenv, sizeof(init_kenv)); + ofw_bootargs = true; } /* Store boot environment state */ OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); @@ -337,7 +339,8 @@ powerpc_init(vm_offset_t fdt, vm_offset_ OF_bootstrap(); - ofw_parse_bootargs(); + if (ofw_bootargs) + ofw_parse_bootargs(); /* * Initialize the console before printing anything. From owner-svn-src-head@freebsd.org Sun Oct 16 05:53:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA3FC13F99; Sun, 16 Oct 2016 05:53:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id E3F4D98F; Sun, 16 Oct 2016 05:53:19 +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 u9G5rJjx023327; Sun, 16 Oct 2016 05:53:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9G5rJRh023326; Sun, 16 Oct 2016 05:53:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610160553.u9G5rJRh023326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 16 Oct 2016 05:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307390 - head/usr.sbin/efivar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 05:53:20 -0000 Author: imp Date: Sun Oct 16 05:53:18 2016 New Revision: 307390 URL: https://svnweb.freebsd.org/changeset/base/307390 Log: style(9) nit: space after |. Modified: head/usr.sbin/efivar/efivar.c Modified: head/usr.sbin/efivar/efivar.c ============================================================================== --- head/usr.sbin/efivar/efivar.c Sun Oct 16 05:32:28 2016 (r307389) +++ head/usr.sbin/efivar/efivar.c Sun Oct 16 05:53:18 2016 (r307390) @@ -62,7 +62,7 @@ static struct option longopts[] = { static int aflag, Aflag, bflag, dflag, Dflag, Hflag, Nflag, lflag, Lflag, Rflag, wflag, pflag; static char *varname; -static u_long attrib = EFI_VARIABLE_NON_VOLATILE |EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; +static u_long attrib = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; static void usage(void) From owner-svn-src-head@freebsd.org Sun Oct 16 06:07:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD7B4C141A9; Sun, 16 Oct 2016 06:07:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 95142E48; Sun, 16 Oct 2016 06:07:44 +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 u9G67hiE027351; Sun, 16 Oct 2016 06:07:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9G67hkd027348; Sun, 16 Oct 2016 06:07:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610160607.u9G67hkd027348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Oct 2016 06:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307391 - in head/sys: amd64/amd64 dev/efidev sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 06:07:44 -0000 Author: kib Date: Sun Oct 16 06:07:43 2016 New Revision: 307391 URL: https://svnweb.freebsd.org/changeset/base/307391 Log: Do not try to create /dev/efi device node before devfs is initialized. Split efirt.ko initialization into early stage where runtime services KPI environment is created, to be used e.g. for RTC, and the later devfs node creation stage, per module. Switch the efi device to use make_dev_s(9) instead of make_dev(9). At least, this gracefully handles the duplicated device name issue. Remove ARGSUSED comment from efidev_ioctl(), all unused arguments are annotated with __unused attribute. Reported by: ambrisko, O. Hartmann Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/efirt.c head/sys/dev/efidev/efidev.c head/sys/sys/efi.h Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Sun Oct 16 05:53:18 2016 (r307390) +++ head/sys/amd64/amd64/efirt.c Sun Oct 16 06:07:43 2016 (r307391) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); static struct efi_systbl *efi_systbl; static struct efi_cfgtbl *efi_cfgtbl; static struct efi_rt *efi_runtime; -static struct cdev *efi_cdev; static int efi_status2err[25] = { 0, /* EFI_SUCCESS */ @@ -403,15 +402,13 @@ efi_init(void) return (ENXIO); } - return (efidev_init(&efi_cdev)); + return (0); } static void efi_uninit(void) { - efidev_uninit(efi_cdev); - efi_destroy_1t1_map(); efi_systbl = NULL; @@ -566,7 +563,6 @@ efirt_modevents(module_t m, int event, v switch (event) { case MOD_LOAD: return (efi_init()); - break; case MOD_UNLOAD: efi_uninit(); Modified: head/sys/dev/efidev/efidev.c ============================================================================== --- head/sys/dev/efidev/efidev.c Sun Oct 16 05:53:18 2016 (r307390) +++ head/sys/dev/efidev/efidev.c Sun Oct 16 06:07:43 2016 (r307391) @@ -47,7 +47,6 @@ static struct cdevsw efi_cdevsw = { .d_ioctl = efidev_ioctl, }; -/* ARGSUSED */ static int efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, int flags __unused, struct thread *td __unused) @@ -173,21 +172,45 @@ vs_out: return (error); } -int -efidev_init(struct cdev **cdev) +static struct cdev *efidev; + +static int +efidev_modevents(module_t m, int event, void *arg __unused) { - - *cdev = make_dev(&efi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0700, - "efi"); + struct make_dev_args mda; + int error; - return (0); -} + switch (event) { + case MOD_LOAD: + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME; + mda.mda_devsw = &efi_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0700; + error = make_dev_s(&mda, &efidev, "efi"); + return (error); + + case MOD_UNLOAD: + if (efidev != NULL) + destroy_dev(efidev); + efidev = NULL; + return (0); -int -efidev_uninit(struct cdev *cdev) -{ - - destroy_dev(cdev); + case MOD_SHUTDOWN: + return (0); - return (0); + default: + return (EOPNOTSUPP); + } } + +static moduledata_t efidev_moddata = { + .name = "efidev", + .evhand = efidev_modevents, + .priv = NULL, +}; + +DECLARE_MODULE(efidev, efidev_moddata, SI_SUB_DEVFS, SI_ORDER_ANY); +MODULE_VERSION(efidev, 1); +MODULE_DEPEND(efidev, efirt, 1, 1, 1); Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Sun Oct 16 05:53:18 2016 (r307390) +++ head/sys/sys/efi.h Sun Oct 16 06:07:43 2016 (r307391) @@ -165,9 +165,6 @@ struct efi_systbl { #ifdef _KERNEL extern vm_paddr_t efi_systbl_phys; -struct cdev; -int efidev_init(struct cdev **); -int efidev_uninit(struct cdev *); #endif /* _KERNEL */ #endif /* _SYS_EFI_H_ */ From owner-svn-src-head@freebsd.org Sun Oct 16 10:43:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D45BED2E8; Sun, 16 Oct 2016 10:43:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id C15AA1623; Sun, 16 Oct 2016 10:43:13 +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 u9GAhCi5033323; Sun, 16 Oct 2016 10:43:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GAhCiM033322; Sun, 16 Oct 2016 10:43:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610161043.u9GAhCiM033322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 16 Oct 2016 10:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307392 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 10:43:14 -0000 Author: mav Date: Sun Oct 16 10:43:12 2016 New Revision: 307392 URL: https://svnweb.freebsd.org/changeset/base/307392 Log: Optimize ZIL itx memory allocation on FreeBSD. These allocations can reach up to 128KB, while FreeBSD kernel allocator can cache allocations only up to 64KB. To avoid expensive allocations for each large ZIL write use caching zio_buf_alloc() allocator instead. To make it possible de-inline few instances of zil_itx_destroy(). Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 16 06:07:43 2016 (r307391) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 16 10:43:12 2016 (r307392) @@ -1142,6 +1142,11 @@ zil_itx_create(uint64_t txtype, size_t l lrsize = P2ROUNDUP_TYPED(lrsize, sizeof (uint64_t), size_t); +#ifdef __FreeBSD__ + if (offsetof(itx_t, itx_lr) + lrsize > PAGE_SIZE) + itx = zio_buf_alloc(offsetof(itx_t, itx_lr) + lrsize); + else +#endif itx = kmem_alloc(offsetof(itx_t, itx_lr) + lrsize, KM_SLEEP); itx->itx_lr.lrc_txtype = txtype; itx->itx_lr.lrc_reclen = lrsize; @@ -1155,6 +1160,11 @@ zil_itx_create(uint64_t txtype, size_t l void zil_itx_destroy(itx_t *itx) { +#ifdef __FreeBSD__ + if (offsetof(itx_t, itx_lr) + itx->itx_lr.lrc_reclen > PAGE_SIZE) + zio_buf_free(itx, offsetof(itx_t, itx_lr) + itx->itx_lr.lrc_reclen); + else +#endif kmem_free(itx, offsetof(itx_t, itx_lr) + itx->itx_lr.lrc_reclen); } @@ -1174,8 +1184,7 @@ zil_itxg_clean(itxs_t *itxs) list = &itxs->i_sync_list; while ((itx = list_head(list)) != NULL) { list_remove(list, itx); - kmem_free(itx, offsetof(itx_t, itx_lr) + - itx->itx_lr.lrc_reclen); + zil_itx_destroy(itx); } cookie = NULL; @@ -1184,8 +1193,7 @@ zil_itxg_clean(itxs_t *itxs) list = &ian->ia_list; while ((itx = list_head(list)) != NULL) { list_remove(list, itx); - kmem_free(itx, offsetof(itx_t, itx_lr) + - itx->itx_lr.lrc_reclen); + zil_itx_destroy(itx); } list_destroy(list); kmem_free(ian, sizeof (itx_async_node_t)); @@ -1250,8 +1258,7 @@ zil_remove_async(zilog_t *zilog, uint64_ } while ((itx = list_head(&clean_list)) != NULL) { list_remove(&clean_list, itx); - kmem_free(itx, offsetof(itx_t, itx_lr) + - itx->itx_lr.lrc_reclen); + zil_itx_destroy(itx); } list_destroy(&clean_list); } @@ -1501,8 +1508,7 @@ zil_commit_writer(zilog_t *zilog) if (txg > spa_last_synced_txg(spa) || txg > spa_freeze_txg(spa)) lwb = zil_lwb_commit(zilog, itx, lwb); list_remove(&zilog->zl_itx_commit_list, itx); - kmem_free(itx, offsetof(itx_t, itx_lr) - + itx->itx_lr.lrc_reclen); + zil_itx_destroy(itx); } DTRACE_PROBE1(zil__cw2, zilog_t *, zilog); From owner-svn-src-head@freebsd.org Sun Oct 16 12:55:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 490A8C11E1B; Sun, 16 Oct 2016 12:55:33 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 156EA1AE1; Sun, 16 Oct 2016 12:55:33 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9GCtWcc082676; Sun, 16 Oct 2016 12:55:32 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GCtWCZ082675; Sun, 16 Oct 2016 12:55:32 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201610161255.u9GCtWCZ082675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 16 Oct 2016 12:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307393 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 12:55:33 -0000 Author: jmcneill Date: Sun Oct 16 12:55:31 2016 New Revision: 307393 URL: https://svnweb.freebsd.org/changeset/base/307393 Log: aw_ccu on H3 needs access to PRCM space. The r_pio controller works now. Modified: head/sys/arm/allwinner/aw_ccu.c Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Sun Oct 16 10:43:12 2016 (r307392) +++ head/sys/arm/allwinner/aw_ccu.c Sun Oct 16 12:55:31 2016 (r307393) @@ -82,7 +82,7 @@ static struct ofw_compat_data compat_dat { "allwinner,sun6i-a31s", CLOCK_CCU }, { "allwinner,sun50i-a64", CLOCK_CCU }, { "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL }, - { "allwinner,sun8i-h3", CLOCK_CCU }, + { "allwinner,sun8i-h3", CLOCK_CCU|CLOCK_PRCM }, { NULL, 0 } }; From owner-svn-src-head@freebsd.org Sun Oct 16 14:13:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28475C12FD9; Sun, 16 Oct 2016 14:13:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BDAC0177D; Sun, 16 Oct 2016 14:13:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9GEDXll013529; Sun, 16 Oct 2016 14:13:33 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GEDW91013522; Sun, 16 Oct 2016 14:13:32 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610161413.u9GEDW91013522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 16 Oct 2016 14:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 14:13:34 -0000 Author: luigi Date: Sun Oct 16 14:13:32 2016 New Revision: 307394 URL: https://svnweb.freebsd.org/changeset/base/307394 Log: Import the current version of netmap, aligned with the one on github. This commit, long overdue, contains contributions in the last 2 years from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including: + fixes on monitor ports + the 'ptnet' virtual device driver, and ptnetmap backend, for high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit) + improved emulated netmap mode + more robust error handling + removal of stale code + various fixes to code and documentation (some mixup between RX and TX parameters, and private and public variables) We also include an additional tool, nmreplay, which is functionally equivalent to tcpreplay but operating on netmap ports. Added: head/tools/tools/netmap/ctrs.h (contents, props changed) head/tools/tools/netmap/nmreplay.8 (contents, props changed) head/tools/tools/netmap/nmreplay.c (contents, props changed) Modified: head/share/man/man4/netmap.4 head/sys/conf/files head/sys/dev/netmap/if_ixl_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mbq.c head/sys/dev/netmap/netmap_mbq.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_mem2.h head/sys/dev/netmap/netmap_monitor.c head/sys/dev/netmap/netmap_offloadings.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_vale.c head/sys/modules/netmap/Makefile head/sys/net/netmap.h head/sys/net/netmap_user.h head/tools/tools/netmap/Makefile head/tools/tools/netmap/bridge.c head/tools/tools/netmap/pkt-gen.c head/tools/tools/netmap/vale-ctl.c Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Sun Oct 16 12:55:31 2016 (r307393) +++ head/share/man/man4/netmap.4 Sun Oct 16 14:13:32 2016 (r307394) @@ -33,10 +33,10 @@ .Sh NAME .Nm netmap .Nd a framework for fast packet I/O -.Pp +.br .Nm VALE .Nd a fast VirtuAl Local Ethernet using the netmap API -.Pp +.br .Nm netmap pipes .Nd a shared memory packet transport channel .Sh SYNOPSIS @@ -44,28 +44,49 @@ .Sh DESCRIPTION .Nm is a framework for extremely fast and efficient packet I/O -for both userspace and kernel clients. +for userspace and kernel clients, and for Virtual Machines. It runs on .Fx -and Linux, and includes -.Nm VALE , -a very fast and modular in-kernel software switch/dataplane, -and -.Nm netmap pipes , -a shared memory packet transport channel. -All these are accessed interchangeably with the same API. +Linux and some versions of Windows, and supports a variety of +.Nm netmap ports , +including +.Bl -tag -width XXXX +.It Nm physical NIC ports +to access individual queues of network interfaces; +.It Nm host ports +to inject packets into the host stack; +.It Nm VALE ports +implementing a very fast and modular in-kernel software switch/dataplane; +.It Nm netmap pipes +a shared memory packet transport channel; +.It Nm netmap monitors +a mechanism similar to +.Xr bpf +to capture traffic +.El .Pp -.Nm , -.Nm VALE -and -.Nm netmap pipes -are at least one order of magnitude faster than +All these +.Nm netmap ports +are accessed interchangeably with the same API, +and are at least one order of magnitude faster than standard OS mechanisms -(sockets, bpf, tun/tap interfaces, native switches, pipes), -reaching 14.88 million packets per second (Mpps) -with much less than one core on a 10 Gbit NIC, -about 20 Mpps per core for VALE ports, -and over 100 Mpps for netmap pipes. +(sockets, bpf, tun/tap interfaces, native switches, pipes). +With suitably fast hardware (NICs, PCIe buses, CPUs), +packet I/O using +.Nm +on supported NICs +reaches 14.88 million packets per second (Mpps) +with much less than one core on 10 Gbit/s NICs; +35-40 Mpps on 40 Gbit/s NICs (limited by the hardware); +about 20 Mpps per core for VALE ports; +and over 100 Mpps for +.Nm netmap pipes. +NICs without native +.Nm +support can still use the API in emulated mode, +which uses unmodified device drivers and is 3-5 times faster than +.Xr bpf +or raw sockets. .Pp Userspace clients can dynamically switch NICs into .Nm @@ -73,8 +94,10 @@ mode and send and receive raw packets th memory mapped buffers. Similarly, .Nm VALE -switch instances and ports, and +switch instances and ports, .Nm netmap pipes +and +.Nm netmap monitors can be created dynamically, providing high speed packet I/O between processes, virtual machines, NICs and the host stack. @@ -89,17 +112,17 @@ and standard OS mechanisms such as .Xr epoll 2 , and .Xr kqueue 2 . -.Nm VALE -and -.Nm netmap pipes +All types of +.Nm netmap ports +and the +.Nm VALE switch are implemented by a single kernel module, which also emulates the .Nm -API over standard drivers for devices without native -.Nm -support. +API over standard drivers. For best performance, .Nm -requires explicit support in device drivers. +requires native support in device drivers. +A list of such devices is at the end of this document. .Pp In the rest of this (long) manual page we document various aspects of the @@ -116,7 +139,7 @@ which can be connected to a physical int to the host stack, or to a .Nm VALE -switch). +switch. Ports use preallocated circular queues of buffers .Em ( rings ) residing in an mmapped region. @@ -166,16 +189,18 @@ has multiple modes of operation controll .Vt struct nmreq argument. .Va arg.nr_name -specifies the port name, as follows: +specifies the netmap port name, as follows: .Bl -tag -width XXXX .It Dv OS network interface name (e.g. 'em0', 'eth1', ... ) the data path of the NIC is disconnected from the host stack, and the file descriptor is bound to the NIC (one or all queues), or to the host stack; -.It Dv valeXXX:YYY (arbitrary XXX and YYY) -the file descriptor is bound to port YYY of a VALE switch called XXX, -both dynamically created if necessary. -The string cannot exceed IFNAMSIZ characters, and YYY cannot +.It Dv valeSSS:PPP +the file descriptor is bound to port PPP of VALE switch SSS. +Switch instances and ports are dynamically created if necessary. +.br +Both SSS and PPP have the form [0-9a-zA-Z_]+ , the string +cannot exceed IFNAMSIZ characters, and PPP cannot be the name of any existing OS network interface. .El .Pp @@ -312,9 +337,6 @@ one slot is always kept empty. The ring size .Va ( num_slots ) should not be assumed to be a power of two. -.br -(NOTE: older versions of netmap used head/count format to indicate -the content of a ring). .Pp .Va head is the first slot available to userspace; @@ -585,6 +607,15 @@ it from the host stack. Multiple file descriptors can be bound to the same port, with proper synchronization left to the user. .Pp +The recommended way to bind a file descriptor to a port is +to use function +.Va nm_open(..) +(see +.Xr LIBRARIES ) +which parses names to access specific port types and +enable features. +In the following we document the main features. +.Pp .Dv NIOCREGIF can also bind a file descriptor to one endpoint of a .Em netmap pipe , consisting of two netmap ports with a crossover connection. @@ -734,7 +765,7 @@ similar to binds a file descriptor to a port. .Bl -tag -width XX .It Va ifname -is a port name, in the form "netmap:XXX" for a NIC and "valeXXX:YYY" for a +is a port name, in the form "netmap:PPP" for a NIC and "valeSSS:PPP" for a .Nm VALE port. .It Va req @@ -774,28 +805,39 @@ similar to pcap_next(), fetches the next natively supports the following devices: .Pp On FreeBSD: +.Xr cxgbe 4 , .Xr em 4 , .Xr igb 4 , .Xr ixgbe 4 , +.Xr ixl 4 , .Xr lem 4 , .Xr re 4 . .Pp On Linux .Xr e1000 4 , .Xr e1000e 4 , +.Xr i40e 4 , .Xr igb 4 , .Xr ixgbe 4 , -.Xr mlx4 4 , -.Xr forcedeth 4 , .Xr r8169 4 . .Pp NICs without native support can still be used in .Nm mode through emulation. Performance is inferior to native netmap -mode but still significantly higher than sockets, and approaching +mode but still significantly higher than various raw socket types +(bpf, PF_PACKET, etc.). +Note that for slow devices (such as 1 Gbit/s and slower NICs, +or several 10 Gbit/s NICs whose hardware is unable that of in-kernel solutions such as Linux's .Xr pktgen . +When emulation is in use, packet sniffer programs such as tcpdump +could see received packets before they are diverted by netmap. This behaviour +is not intentional, being just an artifact of the implementation of emulation. +Note that in case the netmap application subsequently moves packets received +from the emulated adapter onto the host RX ring, the sniffer will intercept +those packets again, since the packets are injected to the host stack as they +were received by the network interface. .Pp Emulation is also available for devices with native netmap support, which can be used for testing or performance comparison. @@ -812,8 +854,12 @@ and module parameters on Linux .Bl -tag -width indent .It Va dev.netmap.admode: 0 Controls the use of native or emulated adapter mode. -0 uses the best available option, 1 forces native and -fails if not available, 2 forces emulated hence never fails. +.br +0 uses the best available option; +.br +1 forces native mode and fails if not available; +.br +2 forces emulated hence never fails. .It Va dev.netmap.generic_ringsize: 1024 Ring size used for emulated netmap mode .It Va dev.netmap.generic_mit: 100000 @@ -861,9 +907,9 @@ performance. uses .Xr select 2 , .Xr poll 2 , -.Xr epoll +.Xr epoll 2 and -.Xr kqueue +.Xr kqueue 2 to wake up processes when significant events occur, and .Xr mmap 2 to map memory. @@ -1015,8 +1061,8 @@ e.g. running the following in two differ .Dl pkt-gen -i vale1:b -f tx # sender The same example can be used to test netmap pipes, by simply changing port names, e.g. -.Dl pkt-gen -i vale:x{3 -f rx # receiver on the master side -.Dl pkt-gen -i vale:x}3 -f tx # sender on the slave side +.Dl pkt-gen -i vale2:x{3 -f rx # receiver on the master side +.Dl pkt-gen -i vale2:x}3 -f tx # sender on the slave side .Pp The following command attaches an interface and the host stack to a switch: Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 16 12:55:31 2016 (r307393) +++ head/sys/conf/files Sun Oct 16 14:13:32 2016 (r307394) @@ -2187,6 +2187,7 @@ dev/nand/nfc_if.m optional nand dev/ncr/ncr.c optional ncr pci dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard +dev/netmap/if_ptnet.c optional netmap dev/netmap/netmap.c optional netmap dev/netmap/netmap_freebsd.c optional netmap dev/netmap/netmap_generic.c optional netmap @@ -2195,6 +2196,7 @@ dev/netmap/netmap_mem2.c optional netmap dev/netmap/netmap_monitor.c optional netmap dev/netmap/netmap_offloadings.c optional netmap dev/netmap/netmap_pipe.c optional netmap +dev/netmap/netmap_pt.c optional netmap dev/netmap/netmap_vale.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nfsmb/nfsmb.c optional nfsmb pci Modified: head/sys/dev/netmap/if_ixl_netmap.h ============================================================================== --- head/sys/dev/netmap/if_ixl_netmap.h Sun Oct 16 12:55:31 2016 (r307393) +++ head/sys/dev/netmap/if_ixl_netmap.h Sun Oct 16 14:13:32 2016 (r307394) @@ -59,7 +59,7 @@ extern int ixl_rx_miss, ixl_rx_miss_bufs /* * device-specific sysctl variables: * - * ixl_crcstrip: 0: keep CRC in rx frames (default), 1: strip it. + * ixl_crcstrip: 0: NIC keeps CRC in rx frames, 1: NIC strips it (default). * During regular operations the CRC is stripped, but on some * hardware reception of frames not multiple of 64 is slower, * so using crcstrip=0 helps in benchmarks. @@ -73,7 +73,7 @@ SYSCTL_DECL(_dev_netmap); */ #if 0 SYSCTL_INT(_dev_netmap, OID_AUTO, ixl_crcstrip, - CTLFLAG_RW, &ixl_crcstrip, 1, "strip CRC on rx frames"); + CTLFLAG_RW, &ixl_crcstrip, 1, "NIC strips CRC on rx frames"); #endif SYSCTL_INT(_dev_netmap, OID_AUTO, ixl_rx_miss, CTLFLAG_RW, &ixl_rx_miss, 0, "potentially missed rx intr"); Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Sun Oct 16 12:55:31 2016 (r307393) +++ head/sys/dev/netmap/if_lem_netmap.h Sun Oct 16 14:13:32 2016 (r307394) @@ -81,6 +81,22 @@ lem_netmap_reg(struct netmap_adapter *na } +static void +lem_netmap_intr(struct netmap_adapter *na, int onoff) +{ + struct ifnet *ifp = na->ifp; + struct adapter *adapter = ifp->if_softc; + + EM_CORE_LOCK(adapter); + if (onoff) { + lem_enable_intr(adapter); + } else { + lem_disable_intr(adapter); + } + EM_CORE_UNLOCK(adapter); +} + + /* * Reconcile kernel and user view of the transmit ring. */ @@ -99,10 +115,6 @@ lem_netmap_txsync(struct netmap_kring *k /* device-specific */ struct adapter *adapter = ifp->if_softc; -#ifdef NIC_PARAVIRT - struct paravirt_csb *csb = adapter->csb; - uint64_t *csbd = (uint64_t *)(csb + 1); -#endif /* NIC_PARAVIRT */ bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_POSTREAD); @@ -113,19 +125,6 @@ lem_netmap_txsync(struct netmap_kring *k nm_i = kring->nr_hwcur; if (nm_i != head) { /* we have new packets to send */ -#ifdef NIC_PARAVIRT - int do_kick = 0; - uint64_t t = 0; // timestamp - int n = head - nm_i; - if (n < 0) - n += lim + 1; - if (csb) { - t = rdtsc(); /* last timestamp */ - csbd[16] += t - csbd[0]; /* total Wg */ - csbd[17] += n; /* Wg count */ - csbd[0] = t; - } -#endif /* NIC_PARAVIRT */ nic_i = netmap_idx_k2n(kring, nm_i); while (nm_i != head) { struct netmap_slot *slot = &ring->slot[nm_i]; @@ -166,38 +165,8 @@ lem_netmap_txsync(struct netmap_kring *k bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); -#ifdef NIC_PARAVIRT - /* set unconditionally, then also kick if needed */ - if (csb) { - t = rdtsc(); - if (csb->host_need_txkick == 2) { - /* can compute an update of delta */ - int64_t delta = t - csbd[3]; - if (delta < 0) - delta = -delta; - if (csbd[8] == 0 || delta < csbd[8]) { - csbd[8] = delta; - csbd[9]++; - } - csbd[10]++; - } - csb->guest_tdt = nic_i; - csbd[18] += t - csbd[0]; // total wp - csbd[19] += n; - } - if (!csb || !csb->guest_csb_on || (csb->host_need_txkick & 1)) - do_kick = 1; - if (do_kick) -#endif /* NIC_PARAVIRT */ /* (re)start the tx unit up to slot nic_i (excluded) */ E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), nic_i); -#ifdef NIC_PARAVIRT - if (do_kick) { - uint64_t t1 = rdtsc(); - csbd[20] += t1 - t; // total Np - csbd[21]++; - } -#endif /* NIC_PARAVIRT */ } /* @@ -206,93 +175,6 @@ lem_netmap_txsync(struct netmap_kring *k if (ticks != kring->last_reclaim || flags & NAF_FORCE_RECLAIM || nm_kr_txempty(kring)) { kring->last_reclaim = ticks; /* record completed transmissions using TDH */ -#ifdef NIC_PARAVIRT - /* host updates tdh unconditionally, and we have - * no side effects on reads, so we can read from there - * instead of exiting. - */ - if (csb) { - static int drain = 0, nodrain=0, good = 0, bad = 0, fail = 0; - u_int x = adapter->next_tx_to_clean; - csbd[19]++; // XXX count reclaims - nic_i = csb->host_tdh; - if (csb->guest_csb_on) { - if (nic_i == x) { - bad++; - csbd[24]++; // failed reclaims - /* no progress, request kick and retry */ - csb->guest_need_txkick = 1; - mb(); // XXX barrier - nic_i = csb->host_tdh; - } else { - good++; - } - if (nic_i != x) { - csb->guest_need_txkick = 2; - if (nic_i == csb->guest_tdt) - drain++; - else - nodrain++; -#if 1 - if (netmap_adaptive_io) { - /* new mechanism: last half ring (or so) - * released one slot at a time. - * This effectively makes the system spin. - * - * Take next_to_clean + 1 as a reference. - * tdh must be ahead or equal - * On entry, the logical order is - * x < tdh = nic_i - * We first push tdh up to avoid wraps. - * The limit is tdh-ll (half ring). - * if tdh-256 < x we report x; - * else we report tdh-256 - */ - u_int tdh = nic_i; - u_int ll = csbd[15]; - u_int delta = lim/8; - if (netmap_adaptive_io == 2 || ll > delta) - csbd[15] = ll = delta; - else if (netmap_adaptive_io == 1 && ll > 1) { - csbd[15]--; - } - - if (nic_i >= kring->nkr_num_slots) { - RD(5, "bad nic_i %d on input", nic_i); - } - x = nm_next(x, lim); - if (tdh < x) - tdh += lim + 1; - if (tdh <= x + ll) { - nic_i = x; - csbd[25]++; //report n + 1; - } else { - tdh = nic_i; - if (tdh < ll) - tdh += lim + 1; - nic_i = tdh - ll; - csbd[26]++; // report tdh - ll - } - } -#endif - } else { - /* we stop, count whether we are idle or not */ - int bh_active = csb->host_need_txkick & 2 ? 4 : 0; - csbd[27+ csb->host_need_txkick]++; - if (netmap_adaptive_io == 1) { - if (bh_active && csbd[15] > 1) - csbd[15]--; - else if (!bh_active && csbd[15] < lim/2) - csbd[15]++; - } - bad--; - fail++; - } - } - RD(1, "drain %d nodrain %d good %d retry %d fail %d", - drain, nodrain, good, bad, fail); - } else -#endif /* !NIC_PARAVIRT */ nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(0)); if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ D("TDH wrap %d", nic_i); @@ -324,21 +206,10 @@ lem_netmap_rxsync(struct netmap_kring *k /* device-specific */ struct adapter *adapter = ifp->if_softc; -#ifdef NIC_PARAVIRT - struct paravirt_csb *csb = adapter->csb; - uint32_t csb_mode = csb && csb->guest_csb_on; - uint32_t do_host_rxkick = 0; -#endif /* NIC_PARAVIRT */ if (head > lim) return netmap_ring_reinit(kring); -#ifdef NIC_PARAVIRT - if (csb_mode) { - force_update = 1; - csb->guest_need_rxkick = 0; - } -#endif /* NIC_PARAVIRT */ /* XXX check sync modes */ bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -357,23 +228,6 @@ lem_netmap_rxsync(struct netmap_kring *k uint32_t staterr = le32toh(curr->status); int len; -#ifdef NIC_PARAVIRT - if (csb_mode) { - if ((staterr & E1000_RXD_STAT_DD) == 0) { - /* don't bother to retry if more than 1 pkt */ - if (n > 1) - break; - csb->guest_need_rxkick = 1; - wmb(); - staterr = le32toh(curr->status); - if ((staterr & E1000_RXD_STAT_DD) == 0) { - break; - } else { /* we are good */ - csb->guest_need_rxkick = 0; - } - } - } else -#endif /* NIC_PARAVIRT */ if ((staterr & E1000_RXD_STAT_DD) == 0) break; len = le16toh(curr->length) - 4; // CRC @@ -390,18 +244,6 @@ lem_netmap_rxsync(struct netmap_kring *k nic_i = nm_next(nic_i, lim); } if (n) { /* update the state variables */ -#ifdef NIC_PARAVIRT - if (csb_mode) { - if (n > 1) { - /* leave one spare buffer so we avoid rxkicks */ - nm_i = nm_prev(nm_i, lim); - nic_i = nm_prev(nic_i, lim); - n--; - } else { - csb->guest_need_rxkick = 1; - } - } -#endif /* NIC_PARAVIRT */ ND("%d new packets at nic %d nm %d tail %d", n, adapter->next_rx_desc_to_check, @@ -440,10 +282,6 @@ lem_netmap_rxsync(struct netmap_kring *k curr->status = 0; bus_dmamap_sync(adapter->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); -#ifdef NIC_PARAVIRT - if (csb_mode && csb->host_rxkick_at == nic_i) - do_host_rxkick = 1; -#endif /* NIC_PARAVIRT */ nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); } @@ -455,12 +293,6 @@ lem_netmap_rxsync(struct netmap_kring *k * so move nic_i back by one unit */ nic_i = nm_prev(nic_i, lim); -#ifdef NIC_PARAVIRT - /* set unconditionally, then also kick if needed */ - if (csb) - csb->guest_rdt = nic_i; - if (!csb_mode || do_host_rxkick) -#endif /* NIC_PARAVIRT */ E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), nic_i); } @@ -486,6 +318,7 @@ lem_netmap_attach(struct adapter *adapte na.nm_rxsync = lem_netmap_rxsync; na.nm_register = lem_netmap_reg; na.num_tx_rings = na.num_rx_rings = 1; + na.nm_intr = lem_netmap_intr; netmap_attach(&na); } Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Sun Oct 16 12:55:31 2016 (r307393) +++ head/sys/dev/netmap/ixgbe_netmap.h Sun Oct 16 14:13:32 2016 (r307394) @@ -53,7 +53,7 @@ void ixgbe_netmap_attach(struct adapter /* * device-specific sysctl variables: * - * ix_crcstrip: 0: keep CRC in rx frames (default), 1: strip it. + * ix_crcstrip: 0: NIC keeps CRC in rx frames (default), 1: NIC strips it. * During regular operations the CRC is stripped, but on some * hardware reception of frames not multiple of 64 is slower, * so using crcstrip=0 helps in benchmarks. @@ -65,7 +65,7 @@ SYSCTL_DECL(_dev_netmap); static int ix_rx_miss, ix_rx_miss_bufs; int ix_crcstrip; SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, - CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); + CTLFLAG_RW, &ix_crcstrip, 0, "NIC strips CRC on rx frames"); SYSCTL_INT(_dev_netmap, OID_AUTO, ix_rx_miss, CTLFLAG_RW, &ix_rx_miss, 0, "potentially missed rx intr"); SYSCTL_INT(_dev_netmap, OID_AUTO, ix_rx_miss_bufs, @@ -109,6 +109,20 @@ set_crcstrip(struct ixgbe_hw *hw, int on IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rxc); } +static void +ixgbe_netmap_intr(struct netmap_adapter *na, int onoff) +{ + struct ifnet *ifp = na->ifp; + struct adapter *adapter = ifp->if_softc; + + IXGBE_CORE_LOCK(adapter); + if (onoff) { + ixgbe_enable_intr(adapter); // XXX maybe ixgbe_stop ? + } else { + ixgbe_disable_intr(adapter); // XXX maybe ixgbe_stop ? + } + IXGBE_CORE_UNLOCK(adapter); +} /* * Register/unregister. We are already under netmap lock. @@ -311,7 +325,7 @@ ixgbe_netmap_txsync(struct netmap_kring * good way. */ nic_i = IXGBE_READ_REG(&adapter->hw, IXGBE_IS_VF(adapter) ? - IXGBE_VFTDH(kring->ring_id) : IXGBE_TDH(kring->ring_id)); + IXGBE_VFTDH(kring->ring_id) : IXGBE_TDH(kring->ring_id)); if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ D("TDH wrap %d", nic_i); nic_i -= kring->nkr_num_slots; @@ -486,6 +500,7 @@ ixgbe_netmap_attach(struct adapter *adap na.nm_rxsync = ixgbe_netmap_rxsync; na.nm_register = ixgbe_netmap_reg; na.num_tx_rings = na.num_rx_rings = adapter->num_queues; + na.nm_intr = ixgbe_netmap_intr; netmap_attach(&na); } Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sun Oct 16 12:55:31 2016 (r307393) +++ head/sys/dev/netmap/netmap.c Sun Oct 16 14:13:32 2016 (r307394) @@ -1,5 +1,9 @@ /* - * Copyright (C) 2011-2014 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2014 Matteo Landi + * Copyright (C) 2011-2016 Luigi Rizzo + * Copyright (C) 2011-2016 Giuseppe Lettieri + * Copyright (C) 2011-2016 Vincenzo Maffione + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -133,13 +137,12 @@ ports attached to the switch) * > select()able file descriptor on which events are reported. * * Internally, we allocate a netmap_priv_d structure, that will be - * initialized on ioctl(NIOCREGIF). + * initialized on ioctl(NIOCREGIF). There is one netmap_priv_d + * structure for each open(). * * os-specific: - * FreeBSD: netmap_open (netmap_freebsd.c). The priv is - * per-thread. - * linux: linux_netmap_open (netmap_linux.c). The priv is - * per-open. + * FreeBSD: see netmap_open() (netmap_freebsd.c) + * linux: see linux_netmap_open() (netmap_linux.c) * * > 2. on each descriptor, the process issues an ioctl() to identify * > the interface that should report events to the file descriptor. @@ -299,18 +302,17 @@ ports attached to the switch) * netmap_transmit() * na->nm_notify == netmap_notify() * 2) ioctl(NIOCRXSYNC)/netmap_poll() in process context - * kring->nm_sync() == netmap_rxsync_from_host_compat + * kring->nm_sync() == netmap_rxsync_from_host * netmap_rxsync_from_host(na, NULL, NULL) * - tx to host stack * ioctl(NIOCTXSYNC)/netmap_poll() in process context - * kring->nm_sync() == netmap_txsync_to_host_compat + * kring->nm_sync() == netmap_txsync_to_host * netmap_txsync_to_host(na) - * NM_SEND_UP() - * FreeBSD: na->if_input() == ?? XXX + * nm_os_send_up() + * FreeBSD: na->if_input() == ether_input() * linux: netif_rx() with NM_MAGIC_PRIORITY_RX * * - * * -= SYSTEM DEVICE WITH GENERIC SUPPORT =- * * na == NA(ifp) == generic_netmap_adapter created in generic_netmap_attach() @@ -319,10 +321,11 @@ ports attached to the switch) * concurrently: * 1) ioctl(NIOCTXSYNC)/netmap_poll() in process context * kring->nm_sync() == generic_netmap_txsync() - * linux: dev_queue_xmit() with NM_MAGIC_PRIORITY_TX - * generic_ndo_start_xmit() - * orig. dev. start_xmit - * FreeBSD: na->if_transmit() == orig. dev if_transmit + * nm_os_generic_xmit_frame() + * linux: dev_queue_xmit() with NM_MAGIC_PRIORITY_TX + * ifp->ndo_start_xmit == generic_ndo_start_xmit() + * gna->save_start_xmit == orig. dev. start_xmit + * FreeBSD: na->if_transmit() == orig. dev if_transmit * 2) generic_mbuf_destructor() * na->nm_notify() == netmap_notify() * - rx from netmap userspace: @@ -333,24 +336,15 @@ ports attached to the switch) * generic_rx_handler() * mbq_safe_enqueue() * na->nm_notify() == netmap_notify() - * - rx from host stack: - * concurrently: + * - rx from host stack + * FreeBSD: same as native + * Linux: same as native except: * 1) host stack - * linux: generic_ndo_start_xmit() - * netmap_transmit() - * FreeBSD: ifp->if_input() == netmap_transmit - * both: - * na->nm_notify() == netmap_notify() - * 2) ioctl(NIOCRXSYNC)/netmap_poll() in process context - * kring->nm_sync() == netmap_rxsync_from_host_compat - * netmap_rxsync_from_host(na, NULL, NULL) - * - tx to host stack: - * ioctl(NIOCTXSYNC)/netmap_poll() in process context - * kring->nm_sync() == netmap_txsync_to_host_compat - * netmap_txsync_to_host(na) - * NM_SEND_UP() - * FreeBSD: na->if_input() == ??? XXX - * linux: netif_rx() with NM_MAGIC_PRIORITY_RX + * dev_queue_xmit() without NM_MAGIC_PRIORITY_TX + * ifp->ndo_start_xmit == generic_ndo_start_xmit() + * netmap_transmit() + * na->nm_notify() == netmap_notify() + * - tx to host stack (same as native): * * * -= VALE =- @@ -371,7 +365,7 @@ ports attached to the switch) * from host stack: * netmap_transmit() * na->nm_notify() == netmap_bwrap_intr_notify(ring_nr == host ring) - * kring->nm_sync() == netmap_rxsync_from_host_compat() + * kring->nm_sync() == netmap_rxsync_from_host() * netmap_vp_txsync() * * - system device with generic support: @@ -384,7 +378,7 @@ ports attached to the switch) * from host stack: * netmap_transmit() * na->nm_notify() == netmap_bwrap_intr_notify(ring_nr == host ring) - * kring->nm_sync() == netmap_rxsync_from_host_compat() + * kring->nm_sync() == netmap_rxsync_from_host() * netmap_vp_txsync() * * (all cases) --> nm_bdg_flush() @@ -407,7 +401,7 @@ ports attached to the switch) * netmap_vp_rxsync() * to host stack: * netmap_vp_rxsync() - * kring->nm_sync() == netmap_txsync_to_host_compat + * kring->nm_sync() == netmap_txsync_to_host * netmap_vp_rxsync_locked() * * - system device with generic adapter: @@ -418,7 +412,7 @@ ports attached to the switch) * netmap_vp_rxsync() * to host stack: * netmap_vp_rxsync() - * kring->nm_sync() == netmap_txsync_to_host_compat + * kring->nm_sync() == netmap_txsync_to_host * netmap_vp_rxsync() * */ @@ -455,29 +449,19 @@ ports attached to the switch) #include -/* reduce conditional code */ -// linux API, use for the knlist in FreeBSD -/* use a private mutex for the knlist */ -#define init_waitqueue_head(x) do { \ - struct mtx *m = &(x)->m; \ - mtx_init(m, "nm_kn_lock", NULL, MTX_DEF); \ - knlist_init_mtx(&(x)->si.si_note, m); \ - } while (0) - -#define OS_selrecord(a, b) selrecord(a, &((b)->si)) -#define OS_selwakeup(a, b) freebsd_selwakeup(a, b) - #elif defined(linux) #include "bsd_glue.h" - - #elif defined(__APPLE__) #warning OSX support is only partial #include "osx_glue.h" +#elif defined (_WIN32) + +#include "win_glue.h" + #else #error Unsupported platform @@ -492,47 +476,72 @@ ports attached to the switch) #include -MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map"); - /* user-controlled variables */ int netmap_verbose; static int netmap_no_timestamp; /* don't timestamp on rxsync */ - -SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); -SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, - CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); -SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, - CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); int netmap_mitigate = 1; -SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); int netmap_no_pendintr = 1; -SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, - CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); int netmap_txsync_retry = 2; -SYSCTL_INT(_dev_netmap, OID_AUTO, txsync_retry, CTLFLAG_RW, - &netmap_txsync_retry, 0 , "Number of txsync loops in bridge's flush."); - int netmap_adaptive_io = 0; -SYSCTL_INT(_dev_netmap, OID_AUTO, adaptive_io, CTLFLAG_RW, - &netmap_adaptive_io, 0 , "Adaptive I/O on paravirt"); - int netmap_flags = 0; /* debug flags */ -int netmap_fwd = 0; /* force transparent mode */ +static int netmap_fwd = 0; /* force transparent mode */ /* * netmap_admode selects the netmap mode to use. * Invalid values are reset to NETMAP_ADMODE_BEST */ -enum { NETMAP_ADMODE_BEST = 0, /* use native, fallback to generic */ +enum { NETMAP_ADMODE_BEST = 0, /* use native, fallback to generic */ NETMAP_ADMODE_NATIVE, /* either native or none */ NETMAP_ADMODE_GENERIC, /* force generic */ NETMAP_ADMODE_LAST }; static int netmap_admode = NETMAP_ADMODE_BEST; -int netmap_generic_mit = 100*1000; /* Generic mitigation interval in nanoseconds. */ -int netmap_generic_ringsize = 1024; /* Generic ringsize. */ -int netmap_generic_rings = 1; /* number of queues in generic. */ +/* netmap_generic_mit controls mitigation of RX notifications for + * the generic netmap adapter. The value is a time interval in + * nanoseconds. */ +int netmap_generic_mit = 100*1000; + +/* We use by default netmap-aware qdiscs with generic netmap adapters, + * even if there can be a little performance hit with hardware NICs. + * However, using the qdisc is the safer approach, for two reasons: + * 1) it prevents non-fifo qdiscs to break the TX notification + * scheme, which is based on mbuf destructors when txqdisc is + * not used. + * 2) it makes it possible to transmit over software devices that + * change skb->dev, like bridge, veth, ... + * + * Anyway users looking for the best performance should + * use native adapters. + */ +int netmap_generic_txqdisc = 1; + +/* Default number of slots and queues for generic adapters. */ +int netmap_generic_ringsize = 1024; +int netmap_generic_rings = 1; + +/* Non-zero if ptnet devices are allowed to use virtio-net headers. */ +int ptnet_vnet_hdr = 1; + +/* + * SYSCTL calls are grouped between SYSBEGIN and SYSEND to be emulated + * in some other operating systems + */ +SYSBEGIN(main_init); + +SYSCTL_DECL(_dev_netmap); +SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); +SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, + CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); +SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, + CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); +SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, + CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); +SYSCTL_INT(_dev_netmap, OID_AUTO, txsync_retry, CTLFLAG_RW, + &netmap_txsync_retry, 0 , "Number of txsync loops in bridge's flush."); +SYSCTL_INT(_dev_netmap, OID_AUTO, adaptive_io, CTLFLAG_RW, + &netmap_adaptive_io, 0 , "Adaptive I/O on paravirt"); SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); @@ -540,19 +549,24 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, admode SYSCTL_INT(_dev_netmap, OID_AUTO, generic_mit, CTLFLAG_RW, &netmap_generic_mit, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CTLFLAG_RW, &netmap_generic_ringsize, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, &netmap_generic_rings, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, generic_txqdisc, CTLFLAG_RW, &netmap_generic_txqdisc, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, ptnet_vnet_hdr, CTLFLAG_RW, &ptnet_vnet_hdr, 0 , ""); + +SYSEND; NMG_LOCK_T netmap_global_lock; -int netmap_use_count = 0; /* number of active netmap instances */ /* * mark the ring as stopped, and run through the locks * to make sure other users get to see it. + * stopped must be either NR_KR_STOPPED (for unbounded stop) + * of NR_KR_LOCKED (brief stop for mutual exclusion purposes) */ static void -netmap_disable_ring(struct netmap_kring *kr) +netmap_disable_ring(struct netmap_kring *kr, int stopped) { - kr->nkr_stopped = 1; - nm_kr_get(kr); + nm_kr_stop(kr, stopped); + // XXX check if nm_kr_stop is sufficient mtx_lock(&kr->q_lock); mtx_unlock(&kr->q_lock); nm_kr_put(kr); @@ -563,7 +577,7 @@ void netmap_set_ring(struct netmap_adapter *na, u_int ring_id, enum txrx t, int stopped) { if (stopped) - netmap_disable_ring(NMR(na, t) + ring_id); + netmap_disable_ring(NMR(na, t) + ring_id, stopped); else NMR(na, t)[ring_id].nkr_stopped = 0; } @@ -590,13 +604,14 @@ netmap_set_all_rings(struct netmap_adapt * Convenience function used in drivers. Waits for current txsync()s/rxsync()s * to finish and prevents any new one from starting. Call this before turning * netmap mode off, or before removing the hardware rings (e.g., on module - * onload). As a rule of thumb for linux drivers, this should be placed near - * each napi_disable(). + * onload). */ void netmap_disable_all_rings(struct ifnet *ifp) { - netmap_set_all_rings(NA(ifp), 1 /* stopped */); + if (NM_NA_VALID(ifp)) { + netmap_set_all_rings(NA(ifp), NM_KR_STOPPED); + } } /* @@ -607,9 +622,34 @@ netmap_disable_all_rings(struct ifnet *i void netmap_enable_all_rings(struct ifnet *ifp) { - netmap_set_all_rings(NA(ifp), 0 /* enabled */); + if (NM_NA_VALID(ifp)) { + netmap_set_all_rings(NA(ifp), 0 /* enabled */); + } } +void +netmap_make_zombie(struct ifnet *ifp) +{ + if (NM_NA_VALID(ifp)) { + struct netmap_adapter *na = NA(ifp); + netmap_set_all_rings(na, NM_KR_LOCKED); + na->na_flags |= NAF_ZOMBIE; + netmap_set_all_rings(na, 0); + } +} + +void +netmap_undo_zombie(struct ifnet *ifp) +{ + if (NM_NA_VALID(ifp)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 16 15:22:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC96AC14C97; Sun, 16 Oct 2016 15:22:18 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BE0EC12DB; Sun, 16 Oct 2016 15:22:18 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9GFMIAa039710; Sun, 16 Oct 2016 15:22:18 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GFMIV6039708; Sun, 16 Oct 2016 15:22:18 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610161522.u9GFMIV6039708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 16 Oct 2016 15:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307395 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 15:22:19 -0000 Author: luigi Date: Sun Oct 16 15:22:17 2016 New Revision: 307395 URL: https://svnweb.freebsd.org/changeset/base/307395 Log: add two missing files for the netmap import Added: head/sys/dev/netmap/if_ptnet.c (contents, props changed) head/sys/dev/netmap/netmap_pt.c (contents, props changed) Added: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netmap/if_ptnet.c Sun Oct 16 15:22:17 2016 (r307395) @@ -0,0 +1,2277 @@ +/*- + * Copyright (c) 2016, Vincenzo Maffione + * 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 unmodified, 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$ + */ + +/* Driver for ptnet paravirtualized network device. */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include + +#ifndef PTNET_CSB_ALLOC +#error "No support for on-device CSB" +#endif + +#ifndef INET +#error "INET not defined, cannot support offloadings" +#endif + +#if __FreeBSD_version >= 1100000 +static uint64_t ptnet_get_counter(if_t, ift_counter); +#else +typedef struct ifnet *if_t; +#define if_getsoftc(_ifp) (_ifp)->if_softc +#endif + +//#define PTNETMAP_STATS +//#define DEBUG +#ifdef DEBUG +#define DBG(x) x +#else /* !DEBUG */ +#define DBG(x) +#endif /* !DEBUG */ + +extern int ptnet_vnet_hdr; /* Tunable parameter */ + +struct ptnet_softc; + +struct ptnet_queue_stats { + uint64_t packets; /* if_[io]packets */ + uint64_t bytes; /* if_[io]bytes */ + uint64_t errors; /* if_[io]errors */ + uint64_t iqdrops; /* if_iqdrops */ + uint64_t mcasts; /* if_[io]mcasts */ +#ifdef PTNETMAP_STATS + uint64_t intrs; + uint64_t kicks; +#endif /* PTNETMAP_STATS */ +}; + +struct ptnet_queue { + struct ptnet_softc *sc; + struct resource *irq; + void *cookie; + int kring_id; + struct ptnet_ring *ptring; + unsigned int kick; + struct mtx lock; + struct buf_ring *bufring; /* for TX queues */ + struct ptnet_queue_stats stats; +#ifdef PTNETMAP_STATS + struct ptnet_queue_stats last_stats; +#endif /* PTNETMAP_STATS */ + struct taskqueue *taskq; + struct task task; + char lock_name[16]; +}; + +#define PTNET_Q_LOCK(_pq) mtx_lock(&(_pq)->lock) +#define PTNET_Q_TRYLOCK(_pq) mtx_trylock(&(_pq)->lock) +#define PTNET_Q_UNLOCK(_pq) mtx_unlock(&(_pq)->lock) + +struct ptnet_softc { + device_t dev; + if_t ifp; + struct ifmedia media; + struct mtx lock; + char lock_name[16]; + char hwaddr[ETHER_ADDR_LEN]; + + /* Mirror of PTFEAT register. */ + uint32_t ptfeatures; + unsigned int vnet_hdr_len; + + /* PCI BARs support. */ + struct resource *iomem; + struct resource *msix_mem; + + unsigned int num_rings; + unsigned int num_tx_rings; + struct ptnet_queue *queues; + struct ptnet_queue *rxqueues; + struct ptnet_csb *csb; + + unsigned int min_tx_space; + + struct netmap_pt_guest_adapter *ptna; + + struct callout tick; +#ifdef PTNETMAP_STATS + struct timeval last_ts; +#endif /* PTNETMAP_STATS */ +}; + +#define PTNET_CORE_LOCK(_sc) mtx_lock(&(_sc)->lock) +#define PTNET_CORE_UNLOCK(_sc) mtx_unlock(&(_sc)->lock) + +static int ptnet_probe(device_t); +static int ptnet_attach(device_t); +static int ptnet_detach(device_t); +static int ptnet_suspend(device_t); +static int ptnet_resume(device_t); +static int ptnet_shutdown(device_t); + +static void ptnet_init(void *opaque); +static int ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data); +static int ptnet_init_locked(struct ptnet_softc *sc); +static int ptnet_stop(struct ptnet_softc *sc); +static int ptnet_transmit(if_t ifp, struct mbuf *m); +static int ptnet_drain_transmit_queue(struct ptnet_queue *pq, + unsigned int budget, + bool may_resched); +static void ptnet_qflush(if_t ifp); +static void ptnet_tx_task(void *context, int pending); + +static int ptnet_media_change(if_t ifp); +static void ptnet_media_status(if_t ifp, struct ifmediareq *ifmr); +#ifdef PTNETMAP_STATS +static void ptnet_tick(void *opaque); +#endif + +static int ptnet_irqs_init(struct ptnet_softc *sc); +static void ptnet_irqs_fini(struct ptnet_softc *sc); + +static uint32_t ptnet_nm_ptctl(if_t ifp, uint32_t cmd); +static int ptnet_nm_config(struct netmap_adapter *na, unsigned *txr, + unsigned *txd, unsigned *rxr, unsigned *rxd); +static void ptnet_update_vnet_hdr(struct ptnet_softc *sc); +static int ptnet_nm_register(struct netmap_adapter *na, int onoff); +static int ptnet_nm_txsync(struct netmap_kring *kring, int flags); +static int ptnet_nm_rxsync(struct netmap_kring *kring, int flags); + +static void ptnet_tx_intr(void *opaque); +static void ptnet_rx_intr(void *opaque); + +static unsigned ptnet_rx_discard(struct netmap_kring *kring, + unsigned int head); +static int ptnet_rx_eof(struct ptnet_queue *pq, unsigned int budget, + bool may_resched); +static void ptnet_rx_task(void *context, int pending); + +#ifdef DEVICE_POLLING +static poll_handler_t ptnet_poll; +#endif + +static device_method_t ptnet_methods[] = { + DEVMETHOD(device_probe, ptnet_probe), + DEVMETHOD(device_attach, ptnet_attach), + DEVMETHOD(device_detach, ptnet_detach), + DEVMETHOD(device_suspend, ptnet_suspend), + DEVMETHOD(device_resume, ptnet_resume), + DEVMETHOD(device_shutdown, ptnet_shutdown), + DEVMETHOD_END +}; + +static driver_t ptnet_driver = { + "ptnet", + ptnet_methods, + sizeof(struct ptnet_softc) +}; + +/* We use (SI_ORDER_MIDDLE+2) here, see DEV_MODULE_ORDERED() invocation. */ +static devclass_t ptnet_devclass; +DRIVER_MODULE_ORDERED(ptnet, pci, ptnet_driver, ptnet_devclass, + NULL, NULL, SI_ORDER_MIDDLE + 2); + +static int +ptnet_probe(device_t dev) +{ + if (pci_get_vendor(dev) != PTNETMAP_PCI_VENDOR_ID || + pci_get_device(dev) != PTNETMAP_PCI_NETIF_ID) { + return (ENXIO); + } + + device_set_desc(dev, "ptnet network adapter"); + + return (BUS_PROBE_DEFAULT); +} + +static inline void ptnet_kick(struct ptnet_queue *pq) +{ +#ifdef PTNETMAP_STATS + pq->stats.kicks ++; +#endif /* PTNETMAP_STATS */ + bus_write_4(pq->sc->iomem, pq->kick, 0); +} + +#define PTNET_BUF_RING_SIZE 4096 +#define PTNET_RX_BUDGET 512 +#define PTNET_RX_BATCH 1 +#define PTNET_TX_BUDGET 512 +#define PTNET_TX_BATCH 64 +#define PTNET_HDR_SIZE sizeof(struct virtio_net_hdr_mrg_rxbuf) +#define PTNET_MAX_PKT_SIZE 65536 + +#define PTNET_CSUM_OFFLOAD (CSUM_TCP | CSUM_UDP | CSUM_SCTP) +#define PTNET_CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 |\ + CSUM_SCTP_IPV6) +#define PTNET_ALL_OFFLOAD (CSUM_TSO | PTNET_CSUM_OFFLOAD |\ + PTNET_CSUM_OFFLOAD_IPV6) + +static int +ptnet_attach(device_t dev) +{ + uint32_t ptfeatures = PTNETMAP_F_BASE; + unsigned int num_rx_rings, num_tx_rings; + struct netmap_adapter na_arg; + unsigned int nifp_offset; + struct ptnet_softc *sc; + if_t ifp; + uint32_t macreg; + int err, rid; + int i; + + sc = device_get_softc(dev); + sc->dev = dev; + + /* Setup PCI resources. */ + pci_enable_busmaster(dev); + + rid = PCIR_BAR(PTNETMAP_IO_PCI_BAR); + sc->iomem = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); + if (sc->iomem == NULL) { + device_printf(dev, "Failed to map I/O BAR\n"); + return (ENXIO); + } + + /* Check if we are supported by the hypervisor. If not, + * bail out immediately. */ + if (ptnet_vnet_hdr) { + ptfeatures |= PTNETMAP_F_VNET_HDR; + } + bus_write_4(sc->iomem, PTNET_IO_PTFEAT, ptfeatures); /* wanted */ + ptfeatures = bus_read_4(sc->iomem, PTNET_IO_PTFEAT); /* acked */ + if (!(ptfeatures & PTNETMAP_F_BASE)) { + device_printf(dev, "Hypervisor does not support netmap " + "passthorugh\n"); + err = ENXIO; + goto err_path; + } + sc->ptfeatures = ptfeatures; + + /* Allocate CSB and carry out CSB allocation protocol (CSBBAH first, + * then CSBBAL). */ + sc->csb = malloc(sizeof(struct ptnet_csb), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (sc->csb == NULL) { + device_printf(dev, "Failed to allocate CSB\n"); + err = ENOMEM; + goto err_path; + } + + { + vm_paddr_t paddr = vtophys(sc->csb); + + bus_write_4(sc->iomem, PTNET_IO_CSBBAH, + (paddr >> 32) & 0xffffffff); + bus_write_4(sc->iomem, PTNET_IO_CSBBAL, paddr & 0xffffffff); + } + + num_tx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_RINGS); + num_rx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_RINGS); + sc->num_rings = num_tx_rings + num_rx_rings; + sc->num_tx_rings = num_tx_rings; + + /* Allocate and initialize per-queue data structures. */ + sc->queues = malloc(sizeof(struct ptnet_queue) * sc->num_rings, + M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->queues == NULL) { + err = ENOMEM; + goto err_path; + } + sc->rxqueues = sc->queues + num_tx_rings; + + for (i = 0; i < sc->num_rings; i++) { + struct ptnet_queue *pq = sc->queues + i; + + pq->sc = sc; + pq->kring_id = i; + pq->kick = PTNET_IO_KICK_BASE + 4 * i; + pq->ptring = sc->csb->rings + i; + snprintf(pq->lock_name, sizeof(pq->lock_name), "%s-%d", + device_get_nameunit(dev), i); + mtx_init(&pq->lock, pq->lock_name, NULL, MTX_DEF); + if (i >= num_tx_rings) { + /* RX queue: fix kring_id. */ + pq->kring_id -= num_tx_rings; + } else { + /* TX queue: allocate buf_ring. */ + pq->bufring = buf_ring_alloc(PTNET_BUF_RING_SIZE, + M_DEVBUF, M_NOWAIT, &pq->lock); + if (pq->bufring == NULL) { + err = ENOMEM; + goto err_path; + } + } + } + + sc->min_tx_space = 64; /* Safe initial value. */ + + err = ptnet_irqs_init(sc); + if (err) { + goto err_path; + } + + /* Setup Ethernet interface. */ + sc->ifp = ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "Failed to allocate ifnet\n"); + err = ENOMEM; + goto err_path; + } + + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_baudrate = IF_Gbps(10); + ifp->if_softc = sc; + ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX; + ifp->if_init = ptnet_init; + ifp->if_ioctl = ptnet_ioctl; +#if __FreeBSD_version >= 1100000 + ifp->if_get_counter = ptnet_get_counter; +#endif + ifp->if_transmit = ptnet_transmit; + ifp->if_qflush = ptnet_qflush; + + ifmedia_init(&sc->media, IFM_IMASK, ptnet_media_change, + ptnet_media_status); + ifmedia_add(&sc->media, IFM_ETHER | IFM_10G_T | IFM_FDX, 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_10G_T | IFM_FDX); + + macreg = bus_read_4(sc->iomem, PTNET_IO_MAC_HI); + sc->hwaddr[0] = (macreg >> 8) & 0xff; + sc->hwaddr[1] = macreg & 0xff; + macreg = bus_read_4(sc->iomem, PTNET_IO_MAC_LO); + sc->hwaddr[2] = (macreg >> 24) & 0xff; + sc->hwaddr[3] = (macreg >> 16) & 0xff; + sc->hwaddr[4] = (macreg >> 8) & 0xff; + sc->hwaddr[5] = macreg & 0xff; + + ether_ifattach(ifp, sc->hwaddr); + + ifp->if_hdrlen = sizeof(struct ether_vlan_header); + ifp->if_capabilities |= IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU; + + if (sc->ptfeatures & PTNETMAP_F_VNET_HDR) { + /* Similarly to what the vtnet driver does, we can emulate + * VLAN offloadings by inserting and removing the 802.1Q + * header during transmit and receive. We are then able + * to do checksum offloading of VLAN frames. */ + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 + | IFCAP_VLAN_HWCSUM + | IFCAP_TSO | IFCAP_LRO + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_HWTAGGING; + } + + ifp->if_capenable = ifp->if_capabilities; +#ifdef DEVICE_POLLING + /* Don't enable polling by default. */ + ifp->if_capabilities |= IFCAP_POLLING; +#endif + snprintf(sc->lock_name, sizeof(sc->lock_name), + "%s", device_get_nameunit(dev)); + mtx_init(&sc->lock, sc->lock_name, "ptnet core lock", MTX_DEF); + callout_init_mtx(&sc->tick, &sc->lock, 0); + + /* Prepare a netmap_adapter struct instance to do netmap_attach(). */ + nifp_offset = bus_read_4(sc->iomem, PTNET_IO_NIFP_OFS); + memset(&na_arg, 0, sizeof(na_arg)); + na_arg.ifp = ifp; + na_arg.num_tx_desc = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_SLOTS); + na_arg.num_rx_desc = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_SLOTS); + na_arg.num_tx_rings = num_tx_rings; + na_arg.num_rx_rings = num_rx_rings; + na_arg.nm_config = ptnet_nm_config; + na_arg.nm_krings_create = ptnet_nm_krings_create; + na_arg.nm_krings_delete = ptnet_nm_krings_delete; + na_arg.nm_dtor = ptnet_nm_dtor; + na_arg.nm_register = ptnet_nm_register; + na_arg.nm_txsync = ptnet_nm_txsync; + na_arg.nm_rxsync = ptnet_nm_rxsync; + + netmap_pt_guest_attach(&na_arg, sc->csb, nifp_offset, ptnet_nm_ptctl); + + /* Now a netmap adapter for this ifp has been allocated, and it + * can be accessed through NA(ifp). We also have to initialize the CSB + * pointer. */ + sc->ptna = (struct netmap_pt_guest_adapter *)NA(ifp); + + /* If virtio-net header was negotiated, set the virt_hdr_len field in + * the netmap adapter, to inform users that this netmap adapter requires + * the application to deal with the headers. */ + ptnet_update_vnet_hdr(sc); + + device_printf(dev, "%s() completed\n", __func__); + + return (0); + +err_path: + ptnet_detach(dev); + return err; +} + +static int +ptnet_detach(device_t dev) +{ + struct ptnet_softc *sc = device_get_softc(dev); + int i; + +#ifdef DEVICE_POLLING + if (sc->ifp->if_capenable & IFCAP_POLLING) { + ether_poll_deregister(sc->ifp); + } +#endif + callout_drain(&sc->tick); + + if (sc->queues) { + /* Drain taskqueues before calling if_detach. */ + for (i = 0; i < sc->num_rings; i++) { + struct ptnet_queue *pq = sc->queues + i; + + if (pq->taskq) { + taskqueue_drain(pq->taskq, &pq->task); + } + } + } + + if (sc->ifp) { + ether_ifdetach(sc->ifp); + + /* Uninitialize netmap adapters for this device. */ + netmap_detach(sc->ifp); + + ifmedia_removeall(&sc->media); + if_free(sc->ifp); + sc->ifp = NULL; + } + + ptnet_irqs_fini(sc); + + if (sc->csb) { + bus_write_4(sc->iomem, PTNET_IO_CSBBAH, 0); + bus_write_4(sc->iomem, PTNET_IO_CSBBAL, 0); + free(sc->csb, M_DEVBUF); + sc->csb = NULL; + } + + if (sc->queues) { + for (i = 0; i < sc->num_rings; i++) { + struct ptnet_queue *pq = sc->queues + i; + + if (mtx_initialized(&pq->lock)) { + mtx_destroy(&pq->lock); + } + if (pq->bufring != NULL) { + buf_ring_free(pq->bufring, M_DEVBUF); + } + } + free(sc->queues, M_DEVBUF); + sc->queues = NULL; + } + + if (sc->iomem) { + bus_release_resource(dev, SYS_RES_IOPORT, + PCIR_BAR(PTNETMAP_IO_PCI_BAR), sc->iomem); + sc->iomem = NULL; + } + + mtx_destroy(&sc->lock); + + device_printf(dev, "%s() completed\n", __func__); + + return (0); +} + +static int +ptnet_suspend(device_t dev) +{ + struct ptnet_softc *sc; + + sc = device_get_softc(dev); + (void)sc; + + return (0); +} + +static int +ptnet_resume(device_t dev) +{ + struct ptnet_softc *sc; + + sc = device_get_softc(dev); + (void)sc; + + return (0); +} + +static int +ptnet_shutdown(device_t dev) +{ + /* + * Suspend already does all of what we need to + * do here; we just never expect to be resumed. + */ + return (ptnet_suspend(dev)); +} + +static int +ptnet_irqs_init(struct ptnet_softc *sc) +{ + int rid = PCIR_BAR(PTNETMAP_MSIX_PCI_BAR); + int nvecs = sc->num_rings; + device_t dev = sc->dev; + int err = ENOSPC; + int cpu_cur; + int i; + + if (pci_find_cap(dev, PCIY_MSIX, NULL) != 0) { + device_printf(dev, "Could not find MSI-X capability\n"); + return (ENXIO); + } + + sc->msix_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->msix_mem == NULL) { + device_printf(dev, "Failed to allocate MSIX PCI BAR\n"); + return (ENXIO); + } + + if (pci_msix_count(dev) < nvecs) { + device_printf(dev, "Not enough MSI-X vectors\n"); + goto err_path; + } + + err = pci_alloc_msix(dev, &nvecs); + if (err) { + device_printf(dev, "Failed to allocate MSI-X vectors\n"); + goto err_path; + } + + for (i = 0; i < nvecs; i++) { + struct ptnet_queue *pq = sc->queues + i; + + rid = i + 1; + pq->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (pq->irq == NULL) { + device_printf(dev, "Failed to allocate interrupt " + "for queue #%d\n", i); + err = ENOSPC; + goto err_path; + } + } + + cpu_cur = CPU_FIRST(); + for (i = 0; i < nvecs; i++) { + struct ptnet_queue *pq = sc->queues + i; + void (*handler)(void *) = ptnet_tx_intr; + + if (i >= sc->num_tx_rings) { + handler = ptnet_rx_intr; + } + err = bus_setup_intr(dev, pq->irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL /* intr_filter */, handler, + pq, &pq->cookie); + if (err) { + device_printf(dev, "Failed to register intr handler " + "for queue #%d\n", i); + goto err_path; + } + + bus_describe_intr(dev, pq->irq, pq->cookie, "q%d", i); +#if 0 + bus_bind_intr(sc->dev, pq->irq, cpu_cur); +#endif + cpu_cur = CPU_NEXT(cpu_cur); + } + + device_printf(dev, "Allocated %d MSI-X vectors\n", nvecs); + + cpu_cur = CPU_FIRST(); + for (i = 0; i < nvecs; i++) { + struct ptnet_queue *pq = sc->queues + i; + static void (*handler)(void *context, int pending); + + handler = (i < sc->num_tx_rings) ? ptnet_tx_task : ptnet_rx_task; + + TASK_INIT(&pq->task, 0, handler, pq); + pq->taskq = taskqueue_create_fast("ptnet_queue", M_NOWAIT, + taskqueue_thread_enqueue, &pq->taskq); + taskqueue_start_threads(&pq->taskq, 1, PI_NET, "%s-pq-%d", + device_get_nameunit(sc->dev), cpu_cur); + cpu_cur = CPU_NEXT(cpu_cur); + } + + return 0; +err_path: + ptnet_irqs_fini(sc); + return err; +} + +static void +ptnet_irqs_fini(struct ptnet_softc *sc) +{ + device_t dev = sc->dev; + int i; + + for (i = 0; i < sc->num_rings; i++) { + struct ptnet_queue *pq = sc->queues + i; + + if (pq->taskq) { + taskqueue_free(pq->taskq); + pq->taskq = NULL; + } + + if (pq->cookie) { + bus_teardown_intr(dev, pq->irq, pq->cookie); + pq->cookie = NULL; + } + + if (pq->irq) { + bus_release_resource(dev, SYS_RES_IRQ, i + 1, pq->irq); + pq->irq = NULL; + } + } + + if (sc->msix_mem) { + pci_release_msi(dev); + + bus_release_resource(dev, SYS_RES_MEMORY, + PCIR_BAR(PTNETMAP_MSIX_PCI_BAR), + sc->msix_mem); + sc->msix_mem = NULL; + } +} + +static void +ptnet_init(void *opaque) +{ + struct ptnet_softc *sc = opaque; + + PTNET_CORE_LOCK(sc); + ptnet_init_locked(sc); + PTNET_CORE_UNLOCK(sc); +} + +static int +ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) +{ + struct ptnet_softc *sc = if_getsoftc(ifp); + device_t dev = sc->dev; + struct ifreq *ifr = (struct ifreq *)data; + int mask, err = 0; + + switch (cmd) { + case SIOCSIFFLAGS: + device_printf(dev, "SIOCSIFFLAGS %x\n", ifp->if_flags); + PTNET_CORE_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + /* Network stack wants the iff to be up. */ + err = ptnet_init_locked(sc); + } else { + /* Network stack wants the iff to be down. */ + err = ptnet_stop(sc); + } + /* We don't need to do nothing to support IFF_PROMISC, + * since that is managed by the backend port. */ + PTNET_CORE_UNLOCK(sc); + break; + + case SIOCSIFCAP: + device_printf(dev, "SIOCSIFCAP %x %x\n", + ifr->ifr_reqcap, ifp->if_capenable); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; +#ifdef DEVICE_POLLING + if (mask & IFCAP_POLLING) { + struct ptnet_queue *pq; + int i; + + if (ifr->ifr_reqcap & IFCAP_POLLING) { + err = ether_poll_register(ptnet_poll, ifp); + if (err) { + break; + } + /* Stop queues and sync with taskqueues. */ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + for (i = 0; i < sc->num_rings; i++) { + pq = sc-> queues + i; + /* Make sure the worker sees the + * IFF_DRV_RUNNING down. */ + PTNET_Q_LOCK(pq); + pq->ptring->guest_need_kick = 0; + PTNET_Q_UNLOCK(pq); + /* Wait for rescheduling to finish. */ + if (pq->taskq) { + taskqueue_drain(pq->taskq, + &pq->task); + } + } + ifp->if_drv_flags |= IFF_DRV_RUNNING; + } else { + err = ether_poll_deregister(ifp); + for (i = 0; i < sc->num_rings; i++) { + pq = sc-> queues + i; + PTNET_Q_LOCK(pq); + pq->ptring->guest_need_kick = 1; + PTNET_Q_UNLOCK(pq); + } + } + } +#endif /* DEVICE_POLLING */ + ifp->if_capenable = ifr->ifr_reqcap; + break; + + case SIOCSIFMTU: + /* We support any reasonable MTU. */ + if (ifr->ifr_mtu < ETHERMIN || + ifr->ifr_mtu > PTNET_MAX_PKT_SIZE) { + err = EINVAL; + } else { + PTNET_CORE_LOCK(sc); + ifp->if_mtu = ifr->ifr_mtu; + PTNET_CORE_UNLOCK(sc); + } + break; + + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + err = ifmedia_ioctl(ifp, ifr, &sc->media, cmd); + break; + + default: + err = ether_ioctl(ifp, cmd, data); + break; + } + + return err; +} + +static int +ptnet_init_locked(struct ptnet_softc *sc) +{ + if_t ifp = sc->ifp; + struct netmap_adapter *na_dr = &sc->ptna->dr.up; + struct netmap_adapter *na_nm = &sc->ptna->hwup.up; + unsigned int nm_buf_size; + int ret; + + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + return 0; /* nothing to do */ + } + + device_printf(sc->dev, "%s\n", __func__); + + /* Translate offload capabilities according to if_capenable. */ + ifp->if_hwassist = 0; + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist |= PTNET_CSUM_OFFLOAD; + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + ifp->if_hwassist |= PTNET_CSUM_OFFLOAD_IPV6; + if (ifp->if_capenable & IFCAP_TSO4) + ifp->if_hwassist |= CSUM_IP_TSO; + if (ifp->if_capenable & IFCAP_TSO6) + ifp->if_hwassist |= CSUM_IP6_TSO; + + /* + * Prepare the interface for netmap mode access. + */ + netmap_update_config(na_dr); + + ret = netmap_mem_finalize(na_dr->nm_mem, na_dr); + if (ret) { + device_printf(sc->dev, "netmap_mem_finalize() failed\n"); + return ret; + } + + if (sc->ptna->backend_regifs == 0) { + ret = ptnet_nm_krings_create(na_nm); + if (ret) { + device_printf(sc->dev, "ptnet_nm_krings_create() " + "failed\n"); + goto err_mem_finalize; + } + + ret = netmap_mem_rings_create(na_dr); + if (ret) { + device_printf(sc->dev, "netmap_mem_rings_create() " + "failed\n"); + goto err_rings_create; + } + + ret = netmap_mem_get_lut(na_dr->nm_mem, &na_dr->na_lut); + if (ret) { + device_printf(sc->dev, "netmap_mem_get_lut() " + "failed\n"); + goto err_get_lut; + } + } + + ret = ptnet_nm_register(na_dr, 1 /* on */); + if (ret) { + goto err_register; + } + + nm_buf_size = NETMAP_BUF_SIZE(na_dr); + + KASSERT(nm_buf_size > 0, ("Invalid netmap buffer size")); + sc->min_tx_space = PTNET_MAX_PKT_SIZE / nm_buf_size + 2; + device_printf(sc->dev, "%s: min_tx_space = %u\n", __func__, + sc->min_tx_space); +#ifdef PTNETMAP_STATS + callout_reset(&sc->tick, hz, ptnet_tick, sc); +#endif + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + return 0; + +err_register: + memset(&na_dr->na_lut, 0, sizeof(na_dr->na_lut)); +err_get_lut: + netmap_mem_rings_delete(na_dr); +err_rings_create: + ptnet_nm_krings_delete(na_nm); +err_mem_finalize: + netmap_mem_deref(na_dr->nm_mem, na_dr); + + return ret; +} + +/* To be called under core lock. */ +static int +ptnet_stop(struct ptnet_softc *sc) +{ + if_t ifp = sc->ifp; + struct netmap_adapter *na_dr = &sc->ptna->dr.up; + struct netmap_adapter *na_nm = &sc->ptna->hwup.up; + int i; + + device_printf(sc->dev, "%s\n", __func__); + + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + return 0; /* nothing to do */ + } + + /* Clear the driver-ready flag, and synchronize with all the queues, + * so that after this loop we are sure nobody is working anymore with + * the device. This scheme is taken from the vtnet driver. */ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + callout_stop(&sc->tick); + for (i = 0; i < sc->num_rings; i++) { + PTNET_Q_LOCK(sc->queues + i); + PTNET_Q_UNLOCK(sc->queues + i); + } + + ptnet_nm_register(na_dr, 0 /* off */); + + if (sc->ptna->backend_regifs == 0) { + netmap_mem_rings_delete(na_dr); + ptnet_nm_krings_delete(na_nm); + } + netmap_mem_deref(na_dr->nm_mem, na_dr); + + return 0; +} + +static void +ptnet_qflush(if_t ifp) +{ + struct ptnet_softc *sc = if_getsoftc(ifp); + int i; + + /* Flush all the bufrings and do the interface flush. */ + for (i = 0; i < sc->num_rings; i++) { + struct ptnet_queue *pq = sc->queues + i; + struct mbuf *m; + + PTNET_Q_LOCK(pq); + if (pq->bufring) { + while ((m = buf_ring_dequeue_sc(pq->bufring))) { + m_freem(m); + } + } + PTNET_Q_UNLOCK(pq); + } + + if_qflush(ifp); +} + +static int +ptnet_media_change(if_t ifp) +{ + struct ptnet_softc *sc = if_getsoftc(ifp); + struct ifmedia *ifm = &sc->media; + + if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) { + return EINVAL; + } + + return 0; +} + +#if __FreeBSD_version >= 1100000 +static uint64_t +ptnet_get_counter(if_t ifp, ift_counter cnt) +{ + struct ptnet_softc *sc = if_getsoftc(ifp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 16 18:27:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ADF0C14E01; Sun, 16 Oct 2016 18:27:42 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 47BF0173F; Sun, 16 Oct 2016 18:27:42 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9GIRfOY008591; Sun, 16 Oct 2016 18:27:41 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GIRfXG008590; Sun, 16 Oct 2016 18:27:41 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610161827.u9GIRfXG008590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 16 Oct 2016 18:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307396 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 18:27:42 -0000 Author: luigi Date: Sun Oct 16 18:27:41 2016 New Revision: 307396 URL: https://svnweb.freebsd.org/changeset/base/307396 Log: add a missing header. Added: head/sys/net/netmap_virt.h (contents, props changed) Added: head/sys/net/netmap_virt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/netmap_virt.h Sun Oct 16 18:27:41 2016 (r307396) @@ -0,0 +1,325 @@ +/* + * Copyright (C) 2013-2016 Luigi Rizzo + * Copyright (C) 2013-2016 Giuseppe Lettieri + * Copyright (C) 2013-2016 Vincenzo Maffione + * Copyright (C) 2015 Stefano Garzarella + * 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 NETMAP_VIRT_H +#define NETMAP_VIRT_H + +#define NETMAP_VIRT_CSB_SIZE 4096 + +/* ptnetmap features */ +#define PTNETMAP_F_BASE 1 +#define PTNETMAP_F_FULL 2 /* not used */ +#define PTNETMAP_F_VNET_HDR 4 + +/* + * ptnetmap_memdev: device used to expose memory into the guest VM + * + * These macros are used in the hypervisor frontend (QEMU, bhyve) and in the + * guest device driver. + */ + +/* PCI identifiers and PCI BARs for the ptnetmap memdev + * and ptnetmap network interface. */ +#define PTNETMAP_MEMDEV_NAME "ptnetmap-memdev" +#define PTNETMAP_PCI_VENDOR_ID 0x3333 /* TODO change vendor_id */ +#define PTNETMAP_PCI_DEVICE_ID 0x0001 /* memory device */ +#define PTNETMAP_PCI_NETIF_ID 0x0002 /* ptnet network interface */ +#define PTNETMAP_IO_PCI_BAR 0 +#define PTNETMAP_MEM_PCI_BAR 1 +#define PTNETMAP_MSIX_PCI_BAR 2 + +/* Registers for the ptnetmap memdev */ +/* 32 bit r/o */ +#define PTNETMAP_IO_PCI_FEATURES 0 /* XXX should be removed */ +/* 32 bit r/o */ +#define PTNETMAP_IO_PCI_MEMSIZE 4 /* size of the netmap memory shared + * between guest and host */ +/* 16 bit r/o */ +#define PTNETMAP_IO_PCI_HOSTID 8 /* memory allocator ID in netmap host */ +#define PTNETMAP_IO_SIZE 10 + +/* + * ptnetmap configuration + * + * The hypervisor (QEMU or bhyve) sends this struct to the host netmap + * module through an ioctl() command when it wants to start the ptnetmap + * kthreads. + */ +struct ptnetmap_cfg { +#define PTNETMAP_CFG_FEAT_CSB 0x0001 +#define PTNETMAP_CFG_FEAT_EVENTFD 0x0002 +#define PTNETMAP_CFG_FEAT_IOCTL 0x0004 + uint32_t features; + void *ptrings; /* ptrings inside CSB */ + uint32_t num_rings; /* number of entries */ + struct ptnet_ring_cfg entries[0]; /* per-ptring configuration */ +}; + +/* + * Functions used to write ptnetmap_cfg from/to the nmreq. + * The user-space application writes the pointer of ptnetmap_cfg + * (user-space buffer) starting from nr_arg1 field, so that the kernel + * can read it with copyin (copy_from_user). + */ +static inline void +ptnetmap_write_cfg(struct nmreq *nmr, struct ptnetmap_cfg *cfg) +{ + uintptr_t *nmr_ptncfg = (uintptr_t *)&nmr->nr_arg1; + *nmr_ptncfg = (uintptr_t)cfg; +} + +/* ptnetmap control commands */ +#define PTNETMAP_PTCTL_CONFIG 1 +#define PTNETMAP_PTCTL_FINALIZE 2 +#define PTNETMAP_PTCTL_IFNEW 3 +#define PTNETMAP_PTCTL_IFDELETE 4 +#define PTNETMAP_PTCTL_RINGSCREATE 5 +#define PTNETMAP_PTCTL_RINGSDELETE 6 +#define PTNETMAP_PTCTL_DEREF 7 +#define PTNETMAP_PTCTL_TXSYNC 8 +#define PTNETMAP_PTCTL_RXSYNC 9 +#define PTNETMAP_PTCTL_REGIF 10 +#define PTNETMAP_PTCTL_UNREGIF 11 +#define PTNETMAP_PTCTL_HOSTMEMID 12 + + +/* I/O registers for the ptnet device. */ +#define PTNET_IO_PTFEAT 0 +#define PTNET_IO_PTCTL 4 +#define PTNET_IO_PTSTS 8 +/* hole */ +#define PTNET_IO_MAC_LO 16 +#define PTNET_IO_MAC_HI 20 +#define PTNET_IO_CSBBAH 24 +#define PTNET_IO_CSBBAL 28 +#define PTNET_IO_NIFP_OFS 32 +#define PTNET_IO_NUM_TX_RINGS 36 +#define PTNET_IO_NUM_RX_RINGS 40 +#define PTNET_IO_NUM_TX_SLOTS 44 +#define PTNET_IO_NUM_RX_SLOTS 48 +#define PTNET_IO_VNET_HDR_LEN 52 +#define PTNET_IO_END 56 +#define PTNET_IO_KICK_BASE 128 +#define PTNET_IO_MASK 0xff + +/* If defined, CSB is allocated by the guest, not by the host. */ +#define PTNET_CSB_ALLOC + +/* ptnetmap ring fields shared between guest and host */ +struct ptnet_ring { + /* XXX revise the layout to minimize cache bounces. */ + uint32_t head; /* GW+ HR+ the head of the guest netmap_ring */ + uint32_t cur; /* GW+ HR+ the cur of the guest netmap_ring */ + uint32_t guest_need_kick; /* GW+ HR+ host-->guest notification enable */ + char pad[4]; + uint32_t hwcur; /* GR+ HW+ the hwcur of the host netmap_kring */ + uint32_t hwtail; /* GR+ HW+ the hwtail of the host netmap_kring */ + uint32_t host_need_kick; /* GR+ HW+ guest-->host notification enable */ + uint32_t sync_flags; /* GW+ HR+ the flags of the guest [tx|rx]sync() */ +}; + +/* CSB for the ptnet device. */ +struct ptnet_csb { + struct ptnet_ring rings[NETMAP_VIRT_CSB_SIZE/sizeof(struct ptnet_ring)]; +}; + +#if defined (WITH_PTNETMAP_HOST) || defined (WITH_PTNETMAP_GUEST) + +/* return l_elem - r_elem with wraparound */ +static inline uint32_t +ptn_sub(uint32_t l_elem, uint32_t r_elem, uint32_t num_slots) +{ + int64_t res; + + res = (int64_t)(l_elem) - r_elem; + + return (res < 0) ? res + num_slots : res; +} +#endif /* WITH_PTNETMAP_HOST || WITH_PTNETMAP_GUEST */ + +#ifdef WITH_PTNETMAP_HOST +/* + * ptnetmap kernel thread routines + * */ + +/* Functions to read and write CSB fields in the host */ +#if defined (linux) +#define CSB_READ(csb, field, r) (get_user(r, &csb->field)) +#define CSB_WRITE(csb, field, v) (put_user(v, &csb->field)) +#else /* ! linux */ +#define CSB_READ(csb, field, r) (r = fuword32(&csb->field)) +#define CSB_WRITE(csb, field, v) (suword32(&csb->field, v)) +#endif /* ! linux */ + +/* + * HOST read/write kring pointers from/in CSB + */ + +/* Host: Read kring pointers (head, cur, sync_flags) from CSB */ +static inline void +ptnetmap_host_read_kring_csb(struct ptnet_ring __user *ptr, + struct netmap_ring *g_ring, + uint32_t num_slots) +{ + uint32_t old_head = g_ring->head, old_cur = g_ring->cur; + uint32_t d, inc_h, inc_c; + + //mb(); /* Force memory complete before read CSB */ + + /* + * We must first read head and then cur with a barrier in the + * middle, because cur can exceed head, but not vice versa. + * The guest must first write cur and then head with a barrier. + * + * head <= cur + * + * guest host + * + * STORE(cur) LOAD(head) + * mb() ----------- mb() + * STORE(head) LOAD(cur) + * + * This approach ensures that every head that we read is + * associated with the correct cur. In this way head can not exceed cur. + */ + CSB_READ(ptr, head, g_ring->head); + mb(); + CSB_READ(ptr, cur, g_ring->cur); + CSB_READ(ptr, sync_flags, g_ring->flags); + + /* + * Even with the previous barrier, it is still possible that we read an + * updated cur and an old head. + * To detect this situation, we can check if the new cur overtakes + * the (apparently) new head. + */ + d = ptn_sub(old_cur, old_head, num_slots); /* previous distance */ + inc_c = ptn_sub(g_ring->cur, old_cur, num_slots); /* increase of cur */ + inc_h = ptn_sub(g_ring->head, old_head, num_slots); /* increase of head */ + + if (unlikely(inc_c > num_slots - d + inc_h)) { /* cur overtakes head */ + ND(1,"ERROR cur overtakes head - old_cur: %u cur: %u old_head: %u head: %u", + old_cur, g_ring->cur, old_head, g_ring->head); + g_ring->cur = nm_prev(g_ring->head, num_slots - 1); + //*g_cur = *g_head; + } +} + +/* Host: Write kring pointers (hwcur, hwtail) into the CSB */ +static inline void +ptnetmap_host_write_kring_csb(struct ptnet_ring __user *ptr, uint32_t hwcur, + uint32_t hwtail) +{ + /* We must write hwtail before hwcur (see below). */ + CSB_WRITE(ptr, hwtail, hwtail); + mb(); + CSB_WRITE(ptr, hwcur, hwcur); + + //mb(); /* Force memory complete before send notification */ +} + +#endif /* WITH_PTNETMAP_HOST */ + +#ifdef WITH_PTNETMAP_GUEST +/* + * GUEST read/write kring pointers from/in CSB. + * To use into device driver. + */ + +/* Guest: Write kring pointers (cur, head) into the CSB */ +static inline void +ptnetmap_guest_write_kring_csb(struct ptnet_ring *ptr, uint32_t cur, + uint32_t head) +{ + /* We must write cur before head for sync reason (see above) */ + ptr->cur = cur; + mb(); + ptr->head = head; + + //mb(); /* Force memory complete before send notification */ +} + +/* Guest: Read kring pointers (hwcur, hwtail) from CSB */ +static inline void +ptnetmap_guest_read_kring_csb(struct ptnet_ring *ptr, struct netmap_kring *kring) +{ + uint32_t old_hwcur = kring->nr_hwcur, old_hwtail = kring->nr_hwtail; + uint32_t num_slots = kring->nkr_num_slots; + uint32_t d, inc_hc, inc_ht; + + //mb(); /* Force memory complete before read CSB */ + + /* + * We must first read hwcur and then hwtail with a barrier in the + * middle, because hwtail can exceed hwcur, but not vice versa. + * The host must first write hwtail and then hwcur with a barrier. + * + * hwcur <= hwtail + * + * host guest + * + * STORE(hwtail) LOAD(hwcur) + * mb() --------- mb() + * STORE(hwcur) LOAD(hwtail) + * + * This approach ensures that every hwcur that the guest reads is + * associated with the correct hwtail. In this way hwcur can not exceed + * hwtail. + */ + kring->nr_hwcur = ptr->hwcur; + mb(); + kring->nr_hwtail = ptr->hwtail; + + /* + * Even with the previous barrier, it is still possible that we read an + * updated hwtail and an old hwcur. + * To detect this situation, we can check if the new hwtail overtakes + * the (apparently) new hwcur. + */ + d = ptn_sub(old_hwtail, old_hwcur, num_slots); /* previous distance */ + inc_ht = ptn_sub(kring->nr_hwtail, old_hwtail, num_slots); /* increase of hwtail */ + inc_hc = ptn_sub(kring->nr_hwcur, old_hwcur, num_slots); /* increase of hwcur */ + + if (unlikely(inc_ht > num_slots - d + inc_hc)) { + ND(1, "ERROR hwtail overtakes hwcur - old_hwtail: %u hwtail: %u old_hwcur: %u hwcur: %u", + old_hwtail, kring->nr_hwtail, old_hwcur, kring->nr_hwcur); + kring->nr_hwtail = nm_prev(kring->nr_hwcur, num_slots - 1); + //kring->nr_hwtail = kring->nr_hwcur; + } +} + +/* ptnetmap_memdev routines used to talk with ptnetmap_memdev device driver */ +struct ptnetmap_memdev; +int nm_os_pt_memdev_iomap(struct ptnetmap_memdev *, vm_paddr_t *, void **); +void nm_os_pt_memdev_iounmap(struct ptnetmap_memdev *); +#endif /* WITH_PTNETMAP_GUEST */ + +#endif /* NETMAP_VIRT_H */ From owner-svn-src-head@freebsd.org Sun Oct 16 18:49:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0573C1470C; Sun, 16 Oct 2016 18:49:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id A04CA184B; Sun, 16 Oct 2016 18:49:16 +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 u9GInFto016741; Sun, 16 Oct 2016 18:49:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GInFiY016740; Sun, 16 Oct 2016 18:49:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610161849.u9GInFiY016740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 16 Oct 2016 18:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307397 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 18:49:16 -0000 Author: mav Date: Sun Oct 16 18:49:15 2016 New Revision: 307397 URL: https://svnweb.freebsd.org/changeset/base/307397 Log: Add vfs.zfs.zil_log_limit sysctl. It is at least partially broken now, but that is another question. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 16 18:27:41 2016 (r307396) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 16 18:49:15 2016 (r307397) @@ -924,6 +924,8 @@ uint64_t zil_block_buckets[] = { * Limit checking is disabled by setting zil_slog_limit to UINT64_MAX. */ uint64_t zil_slog_limit = 1024 * 1024; +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, zil_slog_limit, CTLFLAG_RWTUN, + &zil_slog_limit, 0, "Maximal commit size to use SLOG"); #define USE_SLOG(zilog) (((zilog)->zl_logbias == ZFS_LOGBIAS_LATENCY) && \ (((zilog)->zl_cur_used < zil_slog_limit) || \ ((zilog)->zl_itx_list_sz < (zil_slog_limit << 1)))) From owner-svn-src-head@freebsd.org Sun Oct 16 19:12:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61C92C14CC4; Sun, 16 Oct 2016 19:12:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2E9951349; Sun, 16 Oct 2016 19:12:23 +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 u9GJCMYh027571; Sun, 16 Oct 2016 19:12:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GJCMug027570; Sun, 16 Oct 2016 19:12:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610161912.u9GJCMug027570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 16 Oct 2016 19:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307398 - head/libexec/ypxfr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 19:12:23 -0000 Author: markj Date: Sun Oct 16 19:12:22 2016 New Revision: 307398 URL: https://svnweb.freebsd.org/changeset/base/307398 Log: Reference the libc symbols ypresp_{allfn,data} instead of local symbols. This fixes a regression introduced in r285926. PR: 213506 MFC after: 3 days Modified: head/libexec/ypxfr/ypxfr_getmap.c Modified: head/libexec/ypxfr/ypxfr_getmap.c ============================================================================== --- head/libexec/ypxfr/ypxfr_getmap.c Sun Oct 16 18:49:15 2016 (r307397) +++ head/libexec/ypxfr/ypxfr_getmap.c Sun Oct 16 19:12:22 2016 (r307398) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); extern bool_t xdr_ypresp_all_seq(XDR *, unsigned long *); -static int (*ypresp_allfn)(); -static void *ypresp_data; +extern int (*ypresp_allfn)(); +extern void *ypresp_data; extern DB *specdbp; extern enum ypstat yp_errno; From owner-svn-src-head@freebsd.org Sun Oct 16 19:46:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D38CBC12595; Sun, 16 Oct 2016 19:46:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id A1C9210BE; Sun, 16 Oct 2016 19:46:56 +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 u9GJktKw038899; Sun, 16 Oct 2016 19:46:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GJkt5j038898; Sun, 16 Oct 2016 19:46:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610161946.u9GJkt5j038898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 16 Oct 2016 19:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307400 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 19:46:56 -0000 Author: markj Date: Sun Oct 16 19:46:55 2016 New Revision: 307400 URL: https://svnweb.freebsd.org/changeset/base/307400 Log: tst.kpriv.ksh fails because DTrace privilege levels are unimplemented. MFC after: 1 week Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Sun Oct 16 19:19:22 2016 (r307399) +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Sun Oct 16 19:46:55 2016 (r307400) @@ -72,6 +72,7 @@ exclude EXFAIL common/mib/tst.udp.ksh exclude SKIP common/privs/tst.fds.ksh exclude SKIP common/privs/tst.func_access.ksh exclude SKIP common/privs/tst.getf.ksh +exclude SKIP common/privs/tst.kpriv.ksh exclude SKIP common/privs/tst.op_access.ksh exclude SKIP common/privs/tst.procpriv.ksh exclude SKIP common/privs/tst.providers.ksh From owner-svn-src-head@freebsd.org Sun Oct 16 19:48:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76897C12608; Sun, 16 Oct 2016 19:48:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46D8D1227; Sun, 16 Oct 2016 19:48:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x244.google.com with SMTP id hh10so8424401pac.0; Sun, 16 Oct 2016 12:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=I0tuZTVa5R5k/mZFyQBdAZ3rb17COaZzdeeDZFnw+Uc=; b=XlS6lKFctu44/dsQMjTghBUr0/9p5sCfH6BkGRBpff+q/jQrzQ8yrWjzzsQT4mfsET 2LenqHmf4BK2tepxL+ihokv1S2ZUo8OWATFMR/348RYkYfidfMGNUsRvvJ6/jra7ZGW/ dS6+J6rvTN7sF7X400jhtQBlM8LXh9GAUkE5CnVE+KvZOGSQdeBXRJrOcNKr+p1r7BYx d3AZXHJoG6fMxkvUC5MFus+mSTIz85hRjZhnCW9Su+kK9ju9ceooom00bGNUYYqxUIvq h6SRctyXu4SCmT7aQGxgk9oo/aUsoCbpYSwNJftndMA71uYfTJ5lGZFqJ/MDnkOFOZ2i 742w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=I0tuZTVa5R5k/mZFyQBdAZ3rb17COaZzdeeDZFnw+Uc=; b=ZW1G7cXAtlRq//RsvDQV4gooA7yoxzKo+TEFfQSDDI7Wodt0IPaLhhTFyBCf5yi73X LUXwRES0/YRlGTO/kRUdYXVKQ48Oe3jfaas+HRiz6OhVGb0LTQBfwwTC3wlHtub09Xn9 jj1Mi1L7fmdpd9lV4Zv2jT5cksLROCv22mV4n7rK6dtUp9kfMcUDH9mBzJ0QoxHRkq8K ez/BLJuDkFV7x8twTWoYn2NCZ8H6XdW5jEu/kQYLybI1V2Xmsjae1AMlRCwP+IxBKPGi f0ySmEuENLa0dNOY+uODx67pJG/RTopO0OJLkQ9H9LU++vGhTTStmorRobtjEvR5Wfhq Pn7A== X-Gm-Message-State: AA6/9RmVXUg7OeGpQ83SGwWi6UG/8gUHRCb12QsWhkoudsHbUxQt/Y++uJV8M2JCdcYUcQ== X-Received: by 10.66.15.134 with SMTP id x6mr27595157pac.171.1476647298669; Sun, 16 Oct 2016 12:48:18 -0700 (PDT) Received: from [192.168.20.13] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k67sm42293124pfb.86.2016.10.16.12.48.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Oct 2016 12:48:18 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r307397 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Ngie Cooper X-Mailer: iPhone Mail (14A456) In-Reply-To: <201610161849.u9GInFiY016740@repo.freebsd.org> Date: Sun, 16 Oct 2016 12:48:17 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201610161849.u9GInFiY016740@repo.freebsd.org> To: Alexander Motin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 19:48:19 -0000 > On Oct 16, 2016, at 11:49, Alexander Motin wrote: >=20 > Author: mav > Date: Sun Oct 16 18:49:15 2016 > New Revision: 307397 > URL: https://svnweb.freebsd.org/changeset/base/307397 >=20 > Log: > Add vfs.zfs.zil_log_limit sysctl. >=20 > It is at least partially broken now, but that is another question. How is it broken? > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c > =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/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 1= 6 18:27:41 2016 (r307396) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 1= 6 18:49:15 2016 (r307397) > @@ -924,6 +924,8 @@ uint64_t zil_block_buckets[] =3D { > * Limit checking is disabled by setting zil_slog_limit to UINT64_MAX. > */ > uint64_t zil_slog_limit =3D 1024 * 1024; > +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, zil_slog_limit, CTLFLAG_RWTUN, > + &zil_slog_limit, 0, "Maximal commit size to use SLOG"); > #define USE_SLOG(zilog) (((zilog)->zl_logbias =3D=3D ZFS_LOGBIAS_LATENC= Y) && \ > (((zilog)->zl_cur_used < zil_slog_limit) || \ > ((zilog)->zl_itx_list_sz < (zil_slog_limit << 1)))) >=20 From owner-svn-src-head@freebsd.org Sun Oct 16 19:50:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C098AC126FE; Sun, 16 Oct 2016 19:50:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8AB3B14EB; Sun, 16 Oct 2016 19:50:11 +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 u9GJoA2c039063; Sun, 16 Oct 2016 19:50:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GJoATJ039062; Sun, 16 Oct 2016 19:50:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610161950.u9GJoATJ039062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 16 Oct 2016 19:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307401 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 19:50:11 -0000 Author: markj Date: Sun Oct 16 19:50:10 2016 New Revision: 307401 URL: https://svnweb.freebsd.org/changeset/base/307401 Log: Fix tst.args1.c on LP64 platforms. The untyped probe arguments have a width larger than int on such platforms, so printing their value without a cast can give unexpected results. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c Sun Oct 16 19:46:55 2016 (r307400) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c Sun Oct 16 19:50:10 2016 (r307401) @@ -31,8 +31,8 @@ #include int -go(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, - int arg7, int arg8, int arg9) +go(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, + long arg7, long arg8, long arg9) { return (arg1); } From owner-svn-src-head@freebsd.org Sun Oct 16 19:52:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48B34C128D3 for ; Sun, 16 Oct 2016 19:52:02 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAFAC1898 for ; Sun, 16 Oct 2016 19:52:01 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-lf0-x22e.google.com with SMTP id x79so254725156lff.0 for ; Sun, 16 Oct 2016 12:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=g8LsBiLoe3hsq/ImqTtX6wdZ7P8PwaXKA2c1VuBw+1s=; b=BqlYTeqtZFOZYnQS0fxq2hgR99Bt4hsJ06PPcK44Wbd3RZ3YtqnIRwB65IzfVX3qR4 5oGAaK/X4W/bUeY9rbMm8d8sBIAt/5LnQHPg2fHNjSg1a9jTgpF9jOWlbMHoGilAYBi8 ZyGRBGADpmqolnk9sgPKS6ORgRJ0P4tmIXpdQWk/ki9qCLLHz3UXNPAqwzNxEy8BFzqc 5fqkBfKdD2WPWkj4zY1pJjId+DuwO92krFiI9U8Fi/PMDvGjIyvJR5AMI2zBhBgwrTMA VHTwPQbxtDCrSB6DOADcs8FiSIIMh6tD7dBp3XnFXFTCJh94lkOhIwxi+/pJSmUlHUod KbOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g8LsBiLoe3hsq/ImqTtX6wdZ7P8PwaXKA2c1VuBw+1s=; b=PXZsIO0RvLzGbe3xftSP9ayafZsHYNX80tBjuTeQvwuDuivxpbP2i8f8RD3O3AlVvy yTrNEzosNp+ehcsPg4cfVYs9YUxLrM12H93QRvT+NJ1o1Oc2EdhHL8KtSX49f2AGyAOU yvS+C7FvOrLwZ3+UJ7zB5ss6pnzTa8BUyVjYQBkTYGcV/gzmBmEvj0lx3eTC+6+j31Eb pE7SB/03BlNwBxc4YpbsZWxaihvnGys/JoowHAtCmL7CwipxCks7NKnymQgTokUfmb+e OLzifWpYkZNZRSIjOHvAAXgZsXrf+4kJb5BNr3xImyda8JEN1WqDxYtHbcOD+3AuBsBk oEjg== X-Gm-Message-State: AA6/9RlVqexEx9IQ3Z0HB69vxb/Lo7C67nY+M0QgIt+KFvW++j8cKyQp9DfJnR7oZqpHIpVPjhKdRoS5hZEHw6Pl X-Received: by 10.28.149.209 with SMTP id x200mr6593177wmd.123.1476647519377; Sun, 16 Oct 2016 12:51:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.146.35 with HTTP; Sun, 16 Oct 2016 12:51:59 -0700 (PDT) In-Reply-To: <201610161827.u9GIRfXG008590@repo.freebsd.org> References: <201610161827.u9GIRfXG008590@repo.freebsd.org> From: Oliver Pinter Date: Sun, 16 Oct 2016 21:51:59 +0200 Message-ID: Subject: Re: svn commit: r307396 - head/sys/net To: Luigi Rizzo Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 19:52:02 -0000 On Sun, Oct 16, 2016 at 8:27 PM, Luigi Rizzo wrote: > Author: luigi > Date: Sun Oct 16 18:27:41 2016 > New Revision: 307396 > URL: https://svnweb.freebsd.org/changeset/base/307396 > > Log: > add a missing header. > > Added: > head/sys/net/netmap_virt.h (contents, props changed) > > Added: head/sys/net/netmap_virt.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/net/netmap_virt.h Sun Oct 16 18:27:41 2016 (r307396) > @@ -0,0 +1,325 @@ > +/* > + * Copyright (C) 2013-2016 Luigi Rizzo > + * Copyright (C) 2013-2016 Giuseppe Lettieri > + * Copyright (C) 2013-2016 Vincenzo Maffione > + * Copyright (C) 2015 Stefano Garzarella > + * 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 NETMAP_VIRT_H > +#define NETMAP_VIRT_H > + > +#define NETMAP_VIRT_CSB_SIZE 4096 > + > +/* ptnetmap features */ > +#define PTNETMAP_F_BASE 1 > +#define PTNETMAP_F_FULL 2 /* not used */ > +#define PTNETMAP_F_VNET_HDR 4 > + > +/* > + * ptnetmap_memdev: device used to expose memory into the guest VM > + * > + * These macros are used in the hypervisor frontend (QEMU, bhyve) and in the > + * guest device driver. > + */ > + > +/* PCI identifiers and PCI BARs for the ptnetmap memdev > + * and ptnetmap network interface. */ > +#define PTNETMAP_MEMDEV_NAME "ptnetmap-memdev" > +#define PTNETMAP_PCI_VENDOR_ID 0x3333 /* TODO change vendor_id */ This TODO is still valid? > +#define PTNETMAP_PCI_DEVICE_ID 0x0001 /* memory device */ > +#define PTNETMAP_PCI_NETIF_ID 0x0002 /* ptnet network interface */ > +#define PTNETMAP_IO_PCI_BAR 0 > +#define PTNETMAP_MEM_PCI_BAR 1 > +#define PTNETMAP_MSIX_PCI_BAR 2 > + > +/* Registers for the ptnetmap memdev */ > +/* 32 bit r/o */ > +#define PTNETMAP_IO_PCI_FEATURES 0 /* XXX should be removed */ And this? > +/* 32 bit r/o */ > +#define PTNETMAP_IO_PCI_MEMSIZE 4 /* size of the netmap memory shared > + * between guest and host */ > +/* 16 bit r/o */ > +#define PTNETMAP_IO_PCI_HOSTID 8 /* memory allocator ID in netmap host */ > +#define PTNETMAP_IO_SIZE 10 > + > +/* > + * ptnetmap configuration > + * > + * The hypervisor (QEMU or bhyve) sends this struct to the host netmap > + * module through an ioctl() command when it wants to start the ptnetmap > + * kthreads. > + */ > +struct ptnetmap_cfg { > +#define PTNETMAP_CFG_FEAT_CSB 0x0001 > +#define PTNETMAP_CFG_FEAT_EVENTFD 0x0002 > +#define PTNETMAP_CFG_FEAT_IOCTL 0x0004 > + uint32_t features; > + void *ptrings; /* ptrings inside CSB */ > + uint32_t num_rings; /* number of entries */ > + struct ptnet_ring_cfg entries[0]; /* per-ptring configuration */ > +}; > + > +/* > + * Functions used to write ptnetmap_cfg from/to the nmreq. > + * The user-space application writes the pointer of ptnetmap_cfg > + * (user-space buffer) starting from nr_arg1 field, so that the kernel > + * can read it with copyin (copy_from_user). > + */ > +static inline void > +ptnetmap_write_cfg(struct nmreq *nmr, struct ptnetmap_cfg *cfg) > +{ > + uintptr_t *nmr_ptncfg = (uintptr_t *)&nmr->nr_arg1; > + *nmr_ptncfg = (uintptr_t)cfg; > +} > + > +/* ptnetmap control commands */ > +#define PTNETMAP_PTCTL_CONFIG 1 > +#define PTNETMAP_PTCTL_FINALIZE 2 > +#define PTNETMAP_PTCTL_IFNEW 3 > +#define PTNETMAP_PTCTL_IFDELETE 4 > +#define PTNETMAP_PTCTL_RINGSCREATE 5 > +#define PTNETMAP_PTCTL_RINGSDELETE 6 > +#define PTNETMAP_PTCTL_DEREF 7 > +#define PTNETMAP_PTCTL_TXSYNC 8 > +#define PTNETMAP_PTCTL_RXSYNC 9 > +#define PTNETMAP_PTCTL_REGIF 10 > +#define PTNETMAP_PTCTL_UNREGIF 11 > +#define PTNETMAP_PTCTL_HOSTMEMID 12 > + > + > +/* I/O registers for the ptnet device. */ > +#define PTNET_IO_PTFEAT 0 > +#define PTNET_IO_PTCTL 4 > +#define PTNET_IO_PTSTS 8 > +/* hole */ Hole? > +#define PTNET_IO_MAC_LO 16 > +#define PTNET_IO_MAC_HI 20 > +#define PTNET_IO_CSBBAH 24 > +#define PTNET_IO_CSBBAL 28 > +#define PTNET_IO_NIFP_OFS 32 > +#define PTNET_IO_NUM_TX_RINGS 36 > +#define PTNET_IO_NUM_RX_RINGS 40 > +#define PTNET_IO_NUM_TX_SLOTS 44 > +#define PTNET_IO_NUM_RX_SLOTS 48 > +#define PTNET_IO_VNET_HDR_LEN 52 > +#define PTNET_IO_END 56 > +#define PTNET_IO_KICK_BASE 128 > +#define PTNET_IO_MASK 0xff > + > +/* If defined, CSB is allocated by the guest, not by the host. */ > +#define PTNET_CSB_ALLOC > + > +/* ptnetmap ring fields shared between guest and host */ > +struct ptnet_ring { > + /* XXX revise the layout to minimize cache bounces. */ > + uint32_t head; /* GW+ HR+ the head of the guest netmap_ring */ > + uint32_t cur; /* GW+ HR+ the cur of the guest netmap_ring */ > + uint32_t guest_need_kick; /* GW+ HR+ host-->guest notification enable */ > + char pad[4]; > + uint32_t hwcur; /* GR+ HW+ the hwcur of the host netmap_kring */ > + uint32_t hwtail; /* GR+ HW+ the hwtail of the host netmap_kring */ > + uint32_t host_need_kick; /* GR+ HW+ guest-->host notification enable */ > + uint32_t sync_flags; /* GW+ HR+ the flags of the guest [tx|rx]sync() */ > +}; > + > +/* CSB for the ptnet device. */ > +struct ptnet_csb { > + struct ptnet_ring rings[NETMAP_VIRT_CSB_SIZE/sizeof(struct ptnet_ring)]; > +}; > + > +#if defined (WITH_PTNETMAP_HOST) || defined (WITH_PTNETMAP_GUEST) > + > +/* return l_elem - r_elem with wraparound */ > +static inline uint32_t > +ptn_sub(uint32_t l_elem, uint32_t r_elem, uint32_t num_slots) > +{ > + int64_t res; > + > + res = (int64_t)(l_elem) - r_elem; > + > + return (res < 0) ? res + num_slots : res; > +} > +#endif /* WITH_PTNETMAP_HOST || WITH_PTNETMAP_GUEST */ > + > +#ifdef WITH_PTNETMAP_HOST > +/* > + * ptnetmap kernel thread routines > + * */ > + > +/* Functions to read and write CSB fields in the host */ > +#if defined (linux) > +#define CSB_READ(csb, field, r) (get_user(r, &csb->field)) > +#define CSB_WRITE(csb, field, v) (put_user(v, &csb->field)) > +#else /* ! linux */ > +#define CSB_READ(csb, field, r) (r = fuword32(&csb->field)) > +#define CSB_WRITE(csb, field, v) (suword32(&csb->field, v)) > +#endif /* ! linux */ > + > +/* > + * HOST read/write kring pointers from/in CSB > + */ > + > +/* Host: Read kring pointers (head, cur, sync_flags) from CSB */ > +static inline void > +ptnetmap_host_read_kring_csb(struct ptnet_ring __user *ptr, > + struct netmap_ring *g_ring, > + uint32_t num_slots) > +{ > + uint32_t old_head = g_ring->head, old_cur = g_ring->cur; > + uint32_t d, inc_h, inc_c; > + > + //mb(); /* Force memory complete before read CSB */ And all of these commented out mb() calls? > + > + /* > + * We must first read head and then cur with a barrier in the > + * middle, because cur can exceed head, but not vice versa. > + * The guest must first write cur and then head with a barrier. > + * > + * head <= cur > + * > + * guest host > + * > + * STORE(cur) LOAD(head) > + * mb() ----------- mb() > + * STORE(head) LOAD(cur) > + * > + * This approach ensures that every head that we read is > + * associated with the correct cur. In this way head can not exceed cur. > + */ > + CSB_READ(ptr, head, g_ring->head); > + mb(); > + CSB_READ(ptr, cur, g_ring->cur); > + CSB_READ(ptr, sync_flags, g_ring->flags); > + > + /* > + * Even with the previous barrier, it is still possible that we read an > + * updated cur and an old head. > + * To detect this situation, we can check if the new cur overtakes > + * the (apparently) new head. > + */ > + d = ptn_sub(old_cur, old_head, num_slots); /* previous distance */ > + inc_c = ptn_sub(g_ring->cur, old_cur, num_slots); /* increase of cur */ > + inc_h = ptn_sub(g_ring->head, old_head, num_slots); /* increase of head */ > + > + if (unlikely(inc_c > num_slots - d + inc_h)) { /* cur overtakes head */ > + ND(1,"ERROR cur overtakes head - old_cur: %u cur: %u old_head: %u head: %u", > + old_cur, g_ring->cur, old_head, g_ring->head); > + g_ring->cur = nm_prev(g_ring->head, num_slots - 1); > + //*g_cur = *g_head; Why is this commented out? And why not removed before the upstreaming? > + } > +} > + > +/* Host: Write kring pointers (hwcur, hwtail) into the CSB */ > +static inline void > +ptnetmap_host_write_kring_csb(struct ptnet_ring __user *ptr, uint32_t hwcur, > + uint32_t hwtail) > +{ > + /* We must write hwtail before hwcur (see below). */ > + CSB_WRITE(ptr, hwtail, hwtail); > + mb(); > + CSB_WRITE(ptr, hwcur, hwcur); > + > + //mb(); /* Force memory complete before send notification */ > +} > + > +#endif /* WITH_PTNETMAP_HOST */ > + > +#ifdef WITH_PTNETMAP_GUEST > +/* > + * GUEST read/write kring pointers from/in CSB. > + * To use into device driver. > + */ > + > +/* Guest: Write kring pointers (cur, head) into the CSB */ > +static inline void > +ptnetmap_guest_write_kring_csb(struct ptnet_ring *ptr, uint32_t cur, > + uint32_t head) > +{ > + /* We must write cur before head for sync reason (see above) */ > + ptr->cur = cur; > + mb(); > + ptr->head = head; > + > + //mb(); /* Force memory complete before send notification */ > +} > + > +/* Guest: Read kring pointers (hwcur, hwtail) from CSB */ > +static inline void > +ptnetmap_guest_read_kring_csb(struct ptnet_ring *ptr, struct netmap_kring *kring) > +{ > + uint32_t old_hwcur = kring->nr_hwcur, old_hwtail = kring->nr_hwtail; > + uint32_t num_slots = kring->nkr_num_slots; > + uint32_t d, inc_hc, inc_ht; > + > + //mb(); /* Force memory complete before read CSB */ > + > + /* > + * We must first read hwcur and then hwtail with a barrier in the > + * middle, because hwtail can exceed hwcur, but not vice versa. > + * The host must first write hwtail and then hwcur with a barrier. > + * > + * hwcur <= hwtail > + * > + * host guest > + * > + * STORE(hwtail) LOAD(hwcur) > + * mb() --------- mb() > + * STORE(hwcur) LOAD(hwtail) > + * > + * This approach ensures that every hwcur that the guest reads is > + * associated with the correct hwtail. In this way hwcur can not exceed > + * hwtail. > + */ > + kring->nr_hwcur = ptr->hwcur; > + mb(); > + kring->nr_hwtail = ptr->hwtail; > + > + /* > + * Even with the previous barrier, it is still possible that we read an > + * updated hwtail and an old hwcur. > + * To detect this situation, we can check if the new hwtail overtakes > + * the (apparently) new hwcur. > + */ > + d = ptn_sub(old_hwtail, old_hwcur, num_slots); /* previous distance */ > + inc_ht = ptn_sub(kring->nr_hwtail, old_hwtail, num_slots); /* increase of hwtail */ > + inc_hc = ptn_sub(kring->nr_hwcur, old_hwcur, num_slots); /* increase of hwcur */ > + > + if (unlikely(inc_ht > num_slots - d + inc_hc)) { > + ND(1, "ERROR hwtail overtakes hwcur - old_hwtail: %u hwtail: %u old_hwcur: %u hwcur: %u", > + old_hwtail, kring->nr_hwtail, old_hwcur, kring->nr_hwcur); > + kring->nr_hwtail = nm_prev(kring->nr_hwcur, num_slots - 1); > + //kring->nr_hwtail = kring->nr_hwcur; Uhm, which one is the good? And why exists the other one? > + } > +} > + > +/* ptnetmap_memdev routines used to talk with ptnetmap_memdev device driver */ > +struct ptnetmap_memdev; > +int nm_os_pt_memdev_iomap(struct ptnetmap_memdev *, vm_paddr_t *, void **); > +void nm_os_pt_memdev_iounmap(struct ptnetmap_memdev *); > +#endif /* WITH_PTNETMAP_GUEST */ > + > +#endif /* NETMAP_VIRT_H */ > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sun Oct 16 19:56:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 743D7C12A33; Sun, 16 Oct 2016 19:56:26 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9C991B08; Sun, 16 Oct 2016 19:56:25 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x229.google.com with SMTP id x79so254888899lff.0; Sun, 16 Oct 2016 12:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=jkEKD0J3w8l3K5pvhDljO680OUFcHe5cYx6HlXEwQwo=; b=toPEQkulWLRwf4Os4fe6MOhf57kZVmsseMnG7GGxDZ7ujDxu/2ocwchOaBkd9IJHD+ PQuLG7PV3b1nWVlWPPhL2scHpfl98wBn5jzGO5gf0Rtw0StnGTE6eLFXdKQ060Y8Zytd fsVRdbC+ytzkAcLPk35nk0+dOK9YrKtddqLDctVpq8k7JYqUrp8nsu17DJvGk7vOSwTV VF5+HRvUaKO55td+3l+QLicdtq4tlM2j+p7IHzjAv1Y5IK37/x7UZ5KMFH9IPRcLjopD G8oUrSXwxf3w8jOgvYETYp1Gyx6iBMXSkhtB4PDhSCcI2ZRDaQAx1KiiyGzdLFdfBSdl xzgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jkEKD0J3w8l3K5pvhDljO680OUFcHe5cYx6HlXEwQwo=; b=kbZSR2bdsmlglnqM2rBqkdkkyIqXtB9dvO8pSgbimS83X4WKaWadQUiQRTvKLZPTgo Jw7MoqLsiZVGdtwc4rlMpFT0+gOq93BX22QqZfd0U7hSkXnxxGNtBfE50MsfhLnWK+XM VM/fqShjjJ3p9tbQvIsJ2rGtpgUC2GMOUeAUbXYakVlAI/V5uJL157zniUvvJRY0t6fS ZZiiJAlBPmXjRWvkl+cUCU6lCMPCqd8Qan4L7+4a1CnrB1fL6kkNThLhVyFpuFIrPaTs Ob66czRjQ5NDtuTOXPmrAKvdpfzylC0rhawkTcXqEgwmCT5/dcB3K1eFb23FryxD/hJm bhrg== X-Gm-Message-State: AA6/9Rlpd8xUK8a2xKto+fyB4qvXOF9GMOugJy8i2m6O6qvd8ZZGTDZnQn7op31zsqlgEA== X-Received: by 10.25.200.199 with SMTP id y190mr9084614lff.40.1476647783932; Sun, 16 Oct 2016 12:56:23 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id g7sm6842432ljg.44.2016.10.16.12.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Oct 2016 12:56:23 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r307397 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Ngie Cooper References: <201610161849.u9GInFiY016740@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Alexander Motin Message-ID: <747353d9-06da-688c-2c4c-cc8ae5ade605@FreeBSD.org> Date: Sun, 16 Oct 2016 22:56:22 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 19:56:26 -0000 On 16.10.2016 22:48, Ngie Cooper wrote: > >> On Oct 16, 2016, at 11:49, Alexander Motin wrote: >> >> Author: mav >> Date: Sun Oct 16 18:49:15 2016 >> New Revision: 307397 >> URL: https://svnweb.freebsd.org/changeset/base/307397 >> >> Log: >> Add vfs.zfs.zil_log_limit sysctl. >> >> It is at least partially broken now, but that is another question. > > How is it broken? zl_itx_list_sz variable is not updated inside zil_async_to_sync(), that makes USE_SLOG() always return TRUE, ignoring value of zil_slog_limit. I am now trying to decide whether to fix that variable or rip it off. >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 16 18:27:41 2016 (r307396) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Oct 16 18:49:15 2016 (r307397) >> @@ -924,6 +924,8 @@ uint64_t zil_block_buckets[] = { >> * Limit checking is disabled by setting zil_slog_limit to UINT64_MAX. >> */ >> uint64_t zil_slog_limit = 1024 * 1024; >> +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, zil_slog_limit, CTLFLAG_RWTUN, >> + &zil_slog_limit, 0, "Maximal commit size to use SLOG"); >> #define USE_SLOG(zilog) (((zilog)->zl_logbias == ZFS_LOGBIAS_LATENCY) && \ >> (((zilog)->zl_cur_used < zil_slog_limit) || \ >> ((zilog)->zl_itx_list_sz < (zil_slog_limit << 1)))) >> -- Alexander Motin From owner-svn-src-head@freebsd.org Sun Oct 16 20:59:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9843C14AE0; Sun, 16 Oct 2016 20:59:29 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A8C5D13D1; Sun, 16 Oct 2016 20:59:29 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9GKxS8d065028; Sun, 16 Oct 2016 20:59:28 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9GKxSr2065027; Sun, 16 Oct 2016 20:59:28 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201610162059.u9GKxSr2065027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 16 Oct 2016 20:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307402 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2016 20:59:29 -0000 Author: dteske Date: Sun Oct 16 20:59:28 2016 New Revision: 307402 URL: https://svnweb.freebsd.org/changeset/base/307402 Log: Guard against bad service name argument(s) to load_rc_config() MFC after: 3 days X-MFC-to: stable/11 stable/10 Modified: head/usr.sbin/bsdconfig/share/sysrc.subr Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Sun Oct 16 19:50:10 2016 (r307401) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sun Oct 16 20:59:28 2016 (r307402) @@ -256,7 +256,9 @@ f_sysrc_service_configs() last_name= print_name() { local name="$1" - [ "$name" = "$last_name" ] && return + case "$name" in + ""|.|..|*/*|"$last_name") return ;; + esac echo "$name" >&9 last_name="$name" } From owner-svn-src-head@freebsd.org Mon Oct 17 04:07:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C814FC11C60; Mon, 17 Oct 2016 04:07:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8BAFD1C5D; Mon, 17 Oct 2016 04:07:13 +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 u9H47CLw032969; Mon, 17 Oct 2016 04:07:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H47CAv032968; Mon, 17 Oct 2016 04:07:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610170407.u9H47CAv032968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 17 Oct 2016 04:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307468 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 04:07:13 -0000 Author: imp Date: Mon Oct 17 04:07:12 2016 New Revision: 307468 URL: https://svnweb.freebsd.org/changeset/base/307468 Log: Assume all coreboot BIOSes have the need for these workarounds because coreboot implements the keyboard controller and it's common to all Chromebooks. The workaround won't hurt and may help. Modified: head/sys/dev/atkbdc/atkbdc.c Modified: head/sys/dev/atkbdc/atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc.c Mon Oct 17 03:51:56 2016 (r307467) +++ head/sys/dev/atkbdc/atkbdc.c Mon Oct 17 04:07:12 2016 (r307468) @@ -122,7 +122,7 @@ struct atkbdc_quirks { }; static struct atkbdc_quirks quirks[] = { - {"coreboot", "Acer", "Peppy", + {"coreboot", NULL, NULL, KBDC_QUIRK_KEEP_ACTIVATED | KBDC_QUIRK_IGNORE_PROBE_RESULT | KBDC_QUIRK_RESET_AFTER_PROBE | KBDC_QUIRK_SETLEDS_ON_INIT}, From owner-svn-src-head@freebsd.org Mon Oct 17 04:07:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 263B4C11C6B; Mon, 17 Oct 2016 04:07:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id E7A141C5E; Mon, 17 Oct 2016 04:07: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 u9H47D0O033012; Mon, 17 Oct 2016 04:07:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H47D5n033011; Mon, 17 Oct 2016 04:07:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610170407.u9H47D5n033011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 17 Oct 2016 04:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307469 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 04:07:15 -0000 Author: imp Date: Mon Oct 17 04:07:13 2016 New Revision: 307469 URL: https://svnweb.freebsd.org/changeset/base/307469 Log: Allow root_rw_mount to be both lower and upper case. Before, if it was upper case, you'd wind up with a read-only filesystem when you should sometimes. PR: 213549 Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Mon Oct 17 04:07:12 2016 (r307468) +++ head/etc/rc Mon Oct 17 04:07:13 2016 (r307469) @@ -135,16 +135,16 @@ done # Note: this assumes firstboot_sentinel is on / when we have # a read-only /, or that it is on media that's writable. if [ -e ${firstboot_sentinel} ]; then - [ ${root_rw_mount} = "yes" ] || mount -uw / + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw / chflags -R 0 ${firstboot_sentinel} rm -rf ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then chflags -R 0 ${firstboot_sentinel}-reboot rm -rf ${firstboot_sentinel}-reboot - [ ${root_rw_mount} = "yes" ] || mount -ur / + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / kill -INT 1 fi - [ ${root_rw_mount} = "yes" ] || mount -ur / + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / fi echo '' From owner-svn-src-head@freebsd.org Mon Oct 17 04:30:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 889D8C0D203; Mon, 17 Oct 2016 04:30:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 569C016C3; Mon, 17 Oct 2016 04:30:11 +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 u9H4UA6M040585; Mon, 17 Oct 2016 04:30:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H4UAhe040584; Mon, 17 Oct 2016 04:30:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201610170430.u9H4UAhe040584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 17 Oct 2016 04:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307470 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 04:30:11 -0000 Author: adrian Date: Mon Oct 17 04:30:10 2016 New Revision: 307470 URL: https://svnweb.freebsd.org/changeset/base/307470 Log: [net80211] add some more RX flags. Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Mon Oct 17 04:07:13 2016 (r307469) +++ head/sys/net80211/ieee80211_freebsd.h Mon Oct 17 04:30:10 2016 (r307470) @@ -652,6 +652,12 @@ int ieee80211_get_xmit_params(struct mbu #define IEEE80211_RX_F_AMSDU_MORE 0x00000008 /* This is another decap AMSDU frame in the batch */ #define IEEE80211_RX_F_AMPDU 0x00000010 /* This is the start of an decap AMPDU list */ #define IEEE80211_RX_F_AMPDU_MORE 0x00000020 /* This is another decap AMPDU frame in the batch */ +#define IEEE80211_RX_F_FAIL_FCSCRC 0x00000040 /* Failed CRC/FCS */ +#define IEEE80211_RX_F_FAIL_MIC 0x00000080 /* Failed MIC check */ +#define IEEE80211_RX_F_DECRYPTED 0x00000100 /* Hardware decrypted */ +#define IEEE80211_RX_F_IV_STRIP 0x00000200 /* Decrypted; IV stripped */ +#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; MMIC stripped */ +#define IEEE80211_RX_F_SHORTGI 0x00000800 /* This is a short-GI frame */ /* Channel width */ #define IEEE80211_RX_FW_20MHZ 1 From owner-svn-src-head@freebsd.org Mon Oct 17 08:14:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2420AC15CFB; Mon, 17 Oct 2016 08:14:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id EA6921621; Mon, 17 Oct 2016 08:14: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 u9H8EOL6029102; Mon, 17 Oct 2016 08:14:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H8ENn6029100; Mon, 17 Oct 2016 08:14:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610170814.u9H8ENn6029100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Oct 2016 08:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307499 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:14:25 -0000 Author: kib Date: Mon Oct 17 08:14:23 2016 New Revision: 307499 URL: https://svnweb.freebsd.org/changeset/base/307499 Log: Export vm_page_xunbusy_maybelocked(). Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D8197 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Oct 17 08:10:24 2016 (r307498) +++ head/sys/vm/vm_page.c Mon Oct 17 08:14:23 2016 (r307499) @@ -794,7 +794,7 @@ vm_page_xunbusy_locked(vm_page_t m) wakeup(m); } -static void +void vm_page_xunbusy_maybelocked(vm_page_t m) { bool lockacq; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Oct 17 08:10:24 2016 (r307498) +++ head/sys/vm/vm_page.h Mon Oct 17 08:14:23 2016 (r307499) @@ -495,6 +495,7 @@ boolean_t vm_page_unwire(vm_page_t m, ui void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_wire (vm_page_t); void vm_page_xunbusy_hard(vm_page_t m); +void vm_page_xunbusy_maybelocked(vm_page_t m); void vm_page_set_validclean (vm_page_t, int, int); void vm_page_clear_dirty (vm_page_t, int, int); void vm_page_set_invalid (vm_page_t, int, int); From owner-svn-src-head@freebsd.org Mon Oct 17 08:17:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A97C15DD7; Mon, 17 Oct 2016 08:17: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 mx1.freebsd.org (Postfix) with ESMTPS id 2731E192D; Mon, 17 Oct 2016 08:17: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 u9H8H650029305; Mon, 17 Oct 2016 08:17:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H8H6xe029304; Mon, 17 Oct 2016 08:17:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610170817.u9H8H6xe029304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Oct 2016 08:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307501 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:17:07 -0000 Author: kib Date: Mon Oct 17 08:17:06 2016 New Revision: 307501 URL: https://svnweb.freebsd.org/changeset/base/307501 Log: If vm_fault_hold(9) finds that fs.m is wired, do not free it after a pager error, leave the page to the wire owner. E.g. the page might be a part of the invalidated buffer. Reported and tested by: pho Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D8197 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Oct 17 08:16:26 2016 (r307500) +++ head/sys/vm/vm_fault.c Mon Oct 17 08:17:06 2016 (r307501) @@ -722,7 +722,10 @@ vnode_locked: */ if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { vm_page_lock(fs.m); - vm_page_free(fs.m); + if (fs.m->wire_count == 0) + vm_page_free(fs.m); + else + vm_page_xunbusy_maybelocked(fs.m); vm_page_unlock(fs.m); fs.m = NULL; unlock_and_deallocate(&fs); @@ -742,7 +745,10 @@ vnode_locked: */ if (fs.object != fs.first_object) { vm_page_lock(fs.m); - vm_page_free(fs.m); + if (fs.m->wire_count == 0) + vm_page_free(fs.m); + else + vm_page_xunbusy_maybelocked(fs.m); vm_page_unlock(fs.m); fs.m = NULL; } From owner-svn-src-head@freebsd.org Mon Oct 17 08:35:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55B56C14747; Mon, 17 Oct 2016 08:35:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1F8321B36; Mon, 17 Oct 2016 08:35:58 +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 u9H8ZvqR037191; Mon, 17 Oct 2016 08:35:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H8ZvQi037190; Mon, 17 Oct 2016 08:35:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610170835.u9H8ZvQi037190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 17 Oct 2016 08:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307507 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:35:58 -0000 Author: mav Date: Mon Oct 17 08:35:56 2016 New Revision: 307507 URL: https://svnweb.freebsd.org/changeset/base/307507 Log: Consider device as clean even if SYNCHRONIZE CACHE failed. If device reservation was preempted by other initiator, our sync request will always fail. Without this change CAM tried to sync cache on every following device close, including numerous GEOM tasting opens/closes, causing lots of useless noise in logs. While there, increase SYNCHRONIZE CACHE timeout to default value. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:29:16 2016 (r307506) +++ head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:35:56 2016 (r307507) @@ -1488,12 +1488,11 @@ daclose(struct disk *dp) scsi_synchronize_cache(&ccb->csio, /*retries*/1, /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE, - 5 * 60 * 1000); + da_default_timeout * 1000); error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); - if (error == 0) - softc->flags &= ~DA_FLAG_DIRTY; + softc->flags &= ~DA_FLAG_DIRTY; xpt_release_ccb(ccb); } From owner-svn-src-head@freebsd.org Mon Oct 17 08:38:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C3AC148EF; Mon, 17 Oct 2016 08:38:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id DB1F11F8B; Mon, 17 Oct 2016 08:38:25 +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 u9H8cPKA037519; Mon, 17 Oct 2016 08:38:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H8cPYl037518; Mon, 17 Oct 2016 08:38:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610170838.u9H8cPYl037518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 17 Oct 2016 08:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307509 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:38:26 -0000 Author: mav Date: Mon Oct 17 08:38:24 2016 New Revision: 307509 URL: https://svnweb.freebsd.org/changeset/base/307509 Log: Replicate r307507 for ATA disks. MFC after: 2 weeks Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Oct 17 08:37:19 2016 (r307508) +++ head/sys/cam/ata/ata_da.c Mon Oct 17 08:38:24 2016 (r307509) @@ -926,8 +926,7 @@ adaclose(struct disk *dp) if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); - else - softc->flags &= ~ADA_FLAG_DIRTY; + softc->flags &= ~ADA_FLAG_DIRTY; xpt_release_ccb(ccb); cam_periph_unhold(periph); } From owner-svn-src-head@freebsd.org Mon Oct 17 08:45:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C652C14C36 for ; Mon, 17 Oct 2016 08:45:12 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26433189C for ; Mon, 17 Oct 2016 08:45:11 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-lf0-x22e.google.com with SMTP id b75so276850751lfg.3 for ; Mon, 17 Oct 2016 01:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=kQplLbPaq5755lzPfLZ6aMELIpnag5XjePewTZGm39U=; b=fF1lkxbe2jMghlZn8NDYivABTMtiAiOsYnBPI1AaEYEHIM5y5zOtLQAKsZF+wbeiI8 hcQ+LqGlcYpYX9Kie81uFVwuejaQwdJGHN8D0ykQwQjGjGfy7jpjJOdj5EGjiuyAc49P 5r8gL+cI8flUdlL2/cKl6FSY5Bb53p00+ikETXicxO1P/LKCtP5UOeuV9oQHYPduURj2 rAVE59rJ7zFoQmFQe4kq8iK/kkHpGR/2Xd7xZysQrezhguZwcJTd71+XUlpujLpK3g/4 JDO3NOVH5xa60lDnTvrcTK0n3VvoWoy8ZMET433Xz2c/0xR0bM2IakAwV31+WWlBb6wk pQRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=kQplLbPaq5755lzPfLZ6aMELIpnag5XjePewTZGm39U=; b=AhYpnfdtXhi3ARWW845f0FtFx2kLhPkHVpmuc6iLUTVjq0yW0vVf+BiRsEx6CMeTa+ d5/oQ4aCtTxD/RIPBmG9EoPvbnuc2TgV/oftwFYeM1zTtBub8cVtrbAn4pW1sFCJimVt dqwHmP63doSCGDFSyr1mWNiulomiDXPgWakeX+y/7JKQirJeFSzrshnQt5w2PP16RKot T3ziGpb7iHXsZwmurGIMhZI8NTmCY8cNDiLjKWqiBCbyhdUe82XLBdzvvcx4lrXRcLMJ B8esYMh5MPxfcKQt6ZdVHB3DGMksSOpg2foPXPy6rmicnxBRxNMkVkeXJR+11HESStWF i25Q== X-Gm-Message-State: AA6/9RnSh5S2HZvJHesFsJj/gv+evylhNcey+b16ebZ9Ghv7dD/bYzBWxZ50YPc22s2WAZbR X-Received: by 10.25.41.205 with SMTP id p196mr12942237lfp.2.1476693909947; Mon, 17 Oct 2016 01:45:09 -0700 (PDT) Received: from [10.10.1.58] ([185.97.61.26]) by smtp.gmail.com with ESMTPSA id 13sm7366709ljb.22.2016.10.17.01.45.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 01:45:09 -0700 (PDT) Subject: Re: svn commit: r307507 - head/sys/cam/scsi To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201610170835.u9H8ZvQi037190@repo.freebsd.org> From: Steven Hartland Message-ID: <14e5b11b-d623-fe1b-2ad3-088961d1ffab@multiplay.co.uk> Date: Mon, 17 Oct 2016 09:45:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610170835.u9H8ZvQi037190@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:45:12 -0000 IIRC the timeout for this was intentionally lower than the default, might be worth just checking. On 17/10/2016 09:35, Alexander Motin wrote: > Author: mav > Date: Mon Oct 17 08:35:56 2016 > New Revision: 307507 > URL: https://svnweb.freebsd.org/changeset/base/307507 > > Log: > Consider device as clean even if SYNCHRONIZE CACHE failed. > > If device reservation was preempted by other initiator, our sync request > will always fail. Without this change CAM tried to sync cache on every > following device close, including numerous GEOM tasting opens/closes, > causing lots of useless noise in logs. > > While there, increase SYNCHRONIZE CACHE timeout to default value. > > MFC after: 2 weeks > > Modified: > head/sys/cam/scsi/scsi_da.c > > Modified: head/sys/cam/scsi/scsi_da.c > ============================================================================== > --- head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:29:16 2016 (r307506) > +++ head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:35:56 2016 (r307507) > @@ -1488,12 +1488,11 @@ daclose(struct disk *dp) > scsi_synchronize_cache(&ccb->csio, /*retries*/1, > /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, > /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE, > - 5 * 60 * 1000); > + da_default_timeout * 1000); > error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, > /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, > softc->disk->d_devstat); > - if (error == 0) > - softc->flags &= ~DA_FLAG_DIRTY; > + softc->flags &= ~DA_FLAG_DIRTY; > xpt_release_ccb(ccb); > } > > From owner-svn-src-head@freebsd.org Mon Oct 17 08:51:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CC87C14F48; Mon, 17 Oct 2016 08:51:55 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 185181D6A; Mon, 17 Oct 2016 08:51:55 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id x79so283272071lff.0; Mon, 17 Oct 2016 01:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=sgtewpdQlM+6tABNogYlH1+/0Xcata628LVIguchCPY=; b=ZGkfd2d3BTmksVvpWh/5VFmRuky8Ha3MZbQImJd3rRZHPQYz9JxEjr8ZLHFJP38qek +U7eiPNUZFH/pOovkrz+3iXskOfV1L8f23A3QiSsZuJ/2Hu4pO/3YZqNh5/UmXEYbrFt 4POJel6zKB5GcnJpnrG08ey6fUGtpqPfU/PmVbIB041YObpsj9ow4TvxpjpiI3Xmw1Sl y7MoRaO1Wb+y05hG9gGElzxDPmxBQWgLf7ISm9z7FyVaiQngsqP8YJ+sVgtZxlsraOwO mP/3Nq/3il69oofvPbaRzahufR8BurEm1n95wa2N9YX6xK38q9rtA3S5+siGN/9GMf8a ah3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=sgtewpdQlM+6tABNogYlH1+/0Xcata628LVIguchCPY=; b=WqtqGiEthMDPT202Ucff2VZkBwbRT4dlsTtaur39zJ0LiCRLgeLNVNyDmsMjIomsdi RZVH/Flxr2WDuK1yUTDpfxGIaVO30xtzzJir6FFFdH9/gPbhggTG0GrzoO8H9Roxrri9 rBvXramY7MHFCcFG2UkmzGbRuvqUUo2P+SzWccp5IZnKZxg4vGqIvY19JEBBJvAreaS1 RJxPVtGsfjnk6iSJ+Tn7xu1IFKKB8s0H4Exr6MOLmV0A1JQYpNuZYQ16KV6S2tFU/Uq7 kOkKkRPJSq+ZRbgq3XxEZ/e/l0N9b74U3NUUo0BYsgKjXogGNbUfmWchoElBw5pi9zmJ HLzA== X-Gm-Message-State: AA6/9RklFawvuA+fIlhLPyHyCE0F8GzAe7bnyJVv1vtuDSb4vROZG13S1UpIIItXxIfv3g== X-Received: by 10.25.215.34 with SMTP id o34mr12232073lfg.35.1476694313243; Mon, 17 Oct 2016 01:51:53 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id h36sm7364736ljh.41.2016.10.17.01.51.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 01:51:52 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r307507 - head/sys/cam/scsi To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201610170835.u9H8ZvQi037190@repo.freebsd.org> <14e5b11b-d623-fe1b-2ad3-088961d1ffab@multiplay.co.uk> From: Alexander Motin Message-ID: <9d9c7a6a-74cf-e3f5-4aba-02e4ed636fbe@FreeBSD.org> Date: Mon, 17 Oct 2016 11:51:51 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <14e5b11b-d623-fe1b-2ad3-088961d1ffab@multiplay.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:51:55 -0000 On 17.10.2016 11:45, Steven Hartland wrote: > IIRC the timeout for this was intentionally lower than the default, > might be worth just checking. I did traced back the commit history, and it was hardcoded to that value since the beginning 18 years ago. Theoretically SYNCHRONIZE CACHE may require even more time then WRITE, since nobody knows how big can be write caches and how many writes are sitting there. > On 17/10/2016 09:35, Alexander Motin wrote: >> Author: mav >> Date: Mon Oct 17 08:35:56 2016 >> New Revision: 307507 >> URL: https://svnweb.freebsd.org/changeset/base/307507 >> >> Log: >> Consider device as clean even if SYNCHRONIZE CACHE failed. >> >> If device reservation was preempted by other initiator, our sync request >> will always fail. Without this change CAM tried to sync cache on every >> following device close, including numerous GEOM tasting opens/closes, >> causing lots of useless noise in logs. >> >> While there, increase SYNCHRONIZE CACHE timeout to default value. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/cam/scsi/scsi_da.c >> >> Modified: head/sys/cam/scsi/scsi_da.c >> ============================================================================== >> --- head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:29:16 2016 (r307506) >> +++ head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:35:56 2016 (r307507) >> @@ -1488,12 +1488,11 @@ daclose(struct disk *dp) >> scsi_synchronize_cache(&ccb->csio, /*retries*/1, >> /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, >> /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE, >> - 5 * 60 * 1000); >> + da_default_timeout * 1000); >> error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, >> /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, >> softc->disk->d_devstat); >> - if (error == 0) >> - softc->flags &= ~DA_FLAG_DIRTY; >> + softc->flags &= ~DA_FLAG_DIRTY; >> xpt_release_ccb(ccb); >> } >> >> > -- Alexander Motin From owner-svn-src-head@freebsd.org Mon Oct 17 09:16:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEBCC157F6; Mon, 17 Oct 2016 09:16:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2EC041A30; Mon, 17 Oct 2016 09:16:45 +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 u9H9GiYe053061; Mon, 17 Oct 2016 09:16:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H9GijL053060; Mon, 17 Oct 2016 09:16:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610170916.u9H9GijL053060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 17 Oct 2016 09:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307515 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 09:16:45 -0000 Author: mav Date: Mon Oct 17 09:16:44 2016 New Revision: 307515 URL: https://svnweb.freebsd.org/changeset/base/307515 Log: Revert timeout part of r307507. I misread 5 minutes as 5 seconds. Timeout of 5 minutes may have sense. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:53:12 2016 (r307514) +++ head/sys/cam/scsi/scsi_da.c Mon Oct 17 09:16:44 2016 (r307515) @@ -1488,7 +1488,7 @@ daclose(struct disk *dp) scsi_synchronize_cache(&ccb->csio, /*retries*/1, /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE, - da_default_timeout * 1000); + 5 * 60 * 1000); error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); From owner-svn-src-head@freebsd.org Mon Oct 17 09:32:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD68CC15BE2 for ; Mon, 17 Oct 2016 09:32:12 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D1B61355 for ; Mon, 17 Oct 2016 09:32:12 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-lf0-x22c.google.com with SMTP id x79so284967105lff.0 for ; Mon, 17 Oct 2016 02:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=FXBof/bJq4K8A/ha7t06USXxBDSo39Id4ePe2r1exBs=; b=uOLTvLooihXihZyhSZcJx8trdCEGnAE76MjlRnoRHtgirtQJKRANr9Z/7h8JGM4N1r YeEFccRl5Q1lELXaq+sT9FKY8MLYC1vioavsLQ/kIP8Imt90OnDfiJH7srxFh0EA1C3C l62iSqcg+gKQTO2fIrXRJC45RfqbPdfkhcxb4YFN9Mcuohwaxx5DZzQY3mf0KrKnlzur LUEB5jx4cnTIHTYirDB6ysO50pbt/MDvqbxXnmvhNOb8FX9UigfT+MoRO1P6xUz5Rnos 0aIj1TZwN/iBYPyrZEhEaf+4QnsQx+EqskYm14TzHTpUCkXBACCsUwpx0s1Y2M830CMq Uxdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=FXBof/bJq4K8A/ha7t06USXxBDSo39Id4ePe2r1exBs=; b=ha0GENmiLYJIuRyPfT7V+vbessXRx3XDMLqJF1PMZQVgCCx7dnFFymHnbbvDieZcmN luWCeBaDsXW5oofM0W714adqoC113gdGLIIEJcRw6usRb5Z2+Yb3tNoPNLPsQjhYlHAY ccg1sCwn8MDmXejtHPagg4pmSFGqFa+VJfcEOxsxQzL92cYpWjPByPjNxELD1HYKCAvW iAEb0HFXsI1Ota3Q6Lzzv88NEcrOm0U8q5FfuKHkCEBKOd1zHhsO1MuccyOyZxHQYnQY yaEtTUI9R/soPMqEEZj7bIFkl3dfPLfowDRE/D4N1pI7La/6BA9OAuFhojd20OT876j3 1e2w== X-Gm-Message-State: AA6/9RmExnRw08Ls0BR3vBdej+yZj1Q9Z/E2g6yCJbTcFR7NwJmeIXAP06KPXi7P36cxgGnr X-Received: by 10.25.99.4 with SMTP id x4mr11801856lfb.128.1476696729739; Mon, 17 Oct 2016 02:32:09 -0700 (PDT) Received: from [10.10.1.58] ([185.97.61.26]) by smtp.gmail.com with ESMTPSA id b188sm7391465lfg.41.2016.10.17.02.32.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 02:32:08 -0700 (PDT) Subject: Re: svn commit: r307507 - head/sys/cam/scsi To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201610170835.u9H8ZvQi037190@repo.freebsd.org> <14e5b11b-d623-fe1b-2ad3-088961d1ffab@multiplay.co.uk> <9d9c7a6a-74cf-e3f5-4aba-02e4ed636fbe@FreeBSD.org> From: Steven Hartland Message-ID: <00584f8b-9e2d-0e69-98bd-2633136acdf3@multiplay.co.uk> Date: Mon, 17 Oct 2016 10:32:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <9d9c7a6a-74cf-e3f5-4aba-02e4ed636fbe@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 09:32:12 -0000 On 17/10/2016 09:51, Alexander Motin wrote: > On 17.10.2016 11:45, Steven Hartland wrote: >> IIRC the timeout for this was intentionally lower than the default, >> might be worth just checking. > I did traced back the commit history, and it was hardcoded to that value > since the beginning 18 years ago. Theoretically SYNCHRONIZE CACHE may > require even more time then WRITE, since nobody knows how big can be > write caches and how many writes are sitting there. Cool, must be thinking about something else that was added recently then, thanks for checking :) From owner-svn-src-head@freebsd.org Mon Oct 17 09:35:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E477CC15CCE; Mon, 17 Oct 2016 09:35:09 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6526D15C9; Mon, 17 Oct 2016 09:35:09 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x22f.google.com with SMTP id x79so285090311lff.0; Mon, 17 Oct 2016 02:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=jczcu4HlMndx1o6sIT0FysoqceGpoSxEoZSJDelC3RA=; b=Fl6Hrs+L4ynKrOI/mf+4Fffv9kJLqAie49s5OuUIDQk5+MQSmQTWXi2vwhtbzuZtjM 5gMRVg/LyNLEYe8VMQWUVrf9zNuD0lVXbHlhsuPyoQy2hDEfb5IUhZ03aa+Qx2e4Tru2 PyD9HF9aW6IxN3CdnOLkMJrznJecFxdHnrhaZBzxBiSo5BGYkttFDs0mV7iOVfgYnnef DMwjVKIsrO//dA8pXl0COcr2gyspMyiObcuaBUClvhoY9ScvebUdXK6mmfDUbVcwaEw3 MV7xQmy72//lsdPVdLcSKpcDhbtA2mW3xwjK0ZqHcE1BW5L1zcVFx71tCU7GAoS7ST8o /g5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jczcu4HlMndx1o6sIT0FysoqceGpoSxEoZSJDelC3RA=; b=iiOZcfFpmQFQuiy+01obzLPwj8P0ScBP0GyMyOl7Aqq9sM1ce9VD0D5Qm+jBm64v0m sliASku4qSJ+Ze0CwKg9zUV+Spz6/IoQMQAOV26TQNKu8Aqsd4Wb0AwWDGHke6+jP4ZX jL3hW+aCrrr5bVb9w6EKwcud2eRvy2epAQ1kmx5/B1+kh0ewlYE8/rnk3HW80UlTAqzT AYEO0uOkpQ3ZC3MINUIjtm3oLl6vta5wTl2HHLIDknqAjWL1EiQRL/0YGi7hJxNa3An3 YBry9EKA9/zfgp/CxNeV8s2sEFeGdP80eCK5ofQSzvhT9LrwA9JSUbUbYrxOeDSKUzDu xRiQ== X-Gm-Message-State: AA6/9RmTpOESWdqFlCVSqTXHslmeb/lIoOiiDENk+gjxKHEO3kuOacFOWAiOz3hkIW5ehg== X-Received: by 10.25.199.76 with SMTP id x73mr13502537lff.162.1476696907372; Mon, 17 Oct 2016 02:35:07 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id j4sm1531585lfg.23.2016.10.17.02.35.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 02:35:06 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r307507 - head/sys/cam/scsi To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201610170835.u9H8ZvQi037190@repo.freebsd.org> <14e5b11b-d623-fe1b-2ad3-088961d1ffab@multiplay.co.uk> <9d9c7a6a-74cf-e3f5-4aba-02e4ed636fbe@FreeBSD.org> <00584f8b-9e2d-0e69-98bd-2633136acdf3@multiplay.co.uk> From: Alexander Motin Message-ID: <9f72eb3f-40ff-6aca-0ec4-bfe9d1d4b15c@FreeBSD.org> Date: Mon, 17 Oct 2016 12:35:05 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <00584f8b-9e2d-0e69-98bd-2633136acdf3@multiplay.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 09:35:10 -0000 On 17.10.2016 12:32, Steven Hartland wrote: > On 17/10/2016 09:51, Alexander Motin wrote: >> On 17.10.2016 11:45, Steven Hartland wrote: >>> IIRC the timeout for this was intentionally lower than the default, >>> might be worth just checking. >> I did traced back the commit history, and it was hardcoded to that value >> since the beginning 18 years ago. Theoretically SYNCHRONIZE CACHE may >> require even more time then WRITE, since nobody knows how big can be >> write caches and how many writes are sitting there. > Cool, must be thinking about something else that was added recently > then, thanks for checking :) And still it was my mistake. Reverted. Sorry. -- Alexander Motin From owner-svn-src-head@freebsd.org Mon Oct 17 09:40:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F37C1511A; Mon, 17 Oct 2016 09:40:20 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 1608E1DAA; Mon, 17 Oct 2016 09:40:20 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9H9eJSs061912; Mon, 17 Oct 2016 09:40:19 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9H9eJkS061911; Mon, 17 Oct 2016 09:40:19 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201610170940.u9H9eJkS061911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Mon, 17 Oct 2016 09:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307517 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 09:40:20 -0000 Author: maxim Date: Mon Oct 17 09:40:18 2016 New Revision: 307517 URL: https://svnweb.freebsd.org/changeset/base/307517 Log: Typo fixed: arbitraty -> arbitrary. PR: 213559 Submitted by: olgeni Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon Oct 17 09:31:49 2016 (r307516) +++ head/usr.sbin/bhyve/bhyve.8 Mon Oct 17 09:40:18 2016 (r307517) @@ -172,7 +172,7 @@ Virtio block storage interface. .It Li virtio-rnd Virtio RNG interface. .It Li ahci -AHCI controller attached to arbitraty devices. +AHCI controller attached to arbitrary devices. .It Li ahci-cd AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd From owner-svn-src-head@freebsd.org Mon Oct 17 10:20:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15B1EC15A30; Mon, 17 Oct 2016 10:20:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id CFEED319; Mon, 17 Oct 2016 10:20:44 +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 u9HAKimG078781; Mon, 17 Oct 2016 10:20:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HAKdWO076718; Mon, 17 Oct 2016 10:20:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201610171020.u9HAKdWO076718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 17 Oct 2016 10:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307518 - in head/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/samsung/exynos arm/ti/am335x arm/ti/usb arm/xilinx boot/kshim dev/bhnd/cores/usb dev/puc dev/usb dev/usb/controller ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 10:20:45 -0000 Author: hselasky Date: Mon Oct 17 10:20:38 2016 New Revision: 307518 URL: https://svnweb.freebsd.org/changeset/base/307518 Log: Fix device delete child function. When detaching device trees parent devices must be detached prior to detaching its children. This is because parent devices can have pointers to the child devices in their softcs which are not invalidated by device_delete_child(). This can cause use after free issues and panic(). Device drivers implementing trees, must ensure its detach function detaches or deletes all its children before returning. While at it remove now redundant device_detach() calls before device_delete_child() and device_delete_children(), mostly in the USB controller drivers. Tested by: Jan Henrik Sylvester Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8070 MFC after: 2 weeks Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/at91/at91_ohci.c head/sys/arm/at91/at91_ohci_fdt.c head/sys/arm/cavium/cns11xx/ehci_ebus.c head/sys/arm/cavium/cns11xx/ohci_ec.c head/sys/arm/samsung/exynos/exynos5_xhci.c head/sys/arm/ti/am335x/am335x_musb.c head/sys/arm/ti/usb/omap_ehci.c head/sys/arm/xilinx/zy7_ehci.c head/sys/boot/kshim/bsd_kernel.c head/sys/dev/bhnd/cores/usb/bhnd_ehci.c head/sys/dev/bhnd/cores/usb/bhnd_ohci.c head/sys/dev/puc/puc.c head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/at91dci_fdt.c head/sys/dev/usb/controller/atmegadci_atmelarm.c head/sys/dev/usb/controller/dwc_otg_fdt.c head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mv.c head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/generic_ehci.c head/sys/dev/usb/controller/generic_ohci.c head/sys/dev/usb/controller/musb_otg_atmelarm.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/ohci_s3c24x0.c head/sys/dev/usb/controller/saf1761_otg_boot.c head/sys/dev/usb/controller/saf1761_otg_fdt.c head/sys/dev/usb/controller/uhci_pci.c head/sys/dev/usb/controller/uss820dci_atmelarm.c head/sys/dev/usb/controller/xhci_mv.c head/sys/dev/usb/controller/xhci_pci.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/video/udl.c head/sys/kern/subr_bus.c head/sys/mips/atheros/ar71xx_ehci.c head/sys/mips/atheros/ar71xx_ohci.c head/sys/mips/cavium/usb/octusb_octeon.c head/sys/mips/mediatek/mtk_dotg.c head/sys/mips/mediatek/mtk_ehci.c head/sys/mips/mediatek/mtk_ohci.c head/sys/mips/mediatek/mtk_xhci.c head/sys/mips/rmi/xls_ehci.c head/sys/mips/rt305x/rt305x_dotg.c head/sys/mips/rt305x/rt305x_ehci.c head/sys/mips/rt305x/rt305x_ohci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/allwinner/a10_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -275,17 +275,11 @@ a10_ehci_detach(device_t self) struct aw_ehci_softc *aw_sc = device_get_softc(self); ehci_softc_t *sc = &aw_sc->sc; const struct aw_ehci_conf *conf; - device_t bdev; int err; uint32_t reg_value = 0; conf = USB_CONF(self); - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/arm/at91/at91_ohci.c ============================================================================== --- head/sys/arm/at91/at91_ohci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/at91/at91_ohci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -165,14 +165,8 @@ static int ohci_atmelarm_detach(device_t dev) { struct at91_ohci_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_ohci.sc_bus.bdev) { - bdev = sc->sc_ohci.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/arm/at91/at91_ohci_fdt.c ============================================================================== --- head/sys/arm/at91/at91_ohci_fdt.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/at91/at91_ohci_fdt.c Mon Oct 17 10:20:38 2016 (r307518) @@ -171,14 +171,8 @@ static int ohci_at91_fdt_detach(device_t dev) { struct at91_ohci_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_ohci.sc_bus.bdev) { - bdev = sc->sc_ohci.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/arm/cavium/cns11xx/ehci_ebus.c ============================================================================== --- head/sys/arm/cavium/cns11xx/ehci_ebus.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/cavium/cns11xx/ehci_ebus.c Mon Oct 17 10:20:38 2016 (r307518) @@ -184,14 +184,8 @@ static int ehci_ebus_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/arm/cavium/cns11xx/ohci_ec.c ============================================================================== --- head/sys/arm/cavium/cns11xx/ohci_ec.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/cavium/cns11xx/ohci_ec.c Mon Oct 17 10:20:38 2016 (r307518) @@ -177,14 +177,8 @@ static int ohci_ec_detach(device_t dev) { struct ec_ohci_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_ohci.sc_bus.bdev) { - bdev = sc->sc_ohci.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/arm/samsung/exynos/exynos5_xhci.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_xhci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/samsung/exynos/exynos5_xhci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -288,14 +288,8 @@ static int exynos_xhci_detach(device_t dev) { struct exynos_xhci_softc *esc = device_get_softc(dev); - device_t bdev; int err; - if (esc->base.sc_bus.bdev != NULL) { - bdev = esc->base.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* During module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/arm/ti/am335x/am335x_musb.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_musb.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/ti/am335x/am335x_musb.c Mon Oct 17 10:20:38 2016 (r307518) @@ -366,14 +366,10 @@ static int musbotg_detach(device_t dev) { struct musbotg_super_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_otg.sc_bus.bdev) { - bdev = sc->sc_otg.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } + /* during module unload there are lots of children leftover */ + device_delete_children(dev); if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) { /* @@ -397,9 +393,6 @@ musbotg_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, sc->sc_otg.sc_irq_res); - /* during module unload there are lots of children leftover */ - device_delete_children(dev); - return (0); } Modified: head/sys/arm/ti/usb/omap_ehci.c ============================================================================== --- head/sys/arm/ti/usb/omap_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/ti/usb/omap_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -392,15 +392,8 @@ omap_ehci_detach(device_t dev) { struct omap_ehci_softc *isc = device_get_softc(dev); ehci_softc_t *sc = &isc->base; - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } - /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/arm/xilinx/zy7_ehci.c ============================================================================== --- head/sys/arm/xilinx/zy7_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/arm/xilinx/zy7_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -323,20 +323,17 @@ zy7_ehci_detach(device_t dev) { ehci_softc_t *sc = device_get_softc(dev); + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + sc->sc_flags &= ~EHCI_SCFLG_DONEINIT; - if (device_is_attached(dev)) - bus_generic_detach(dev); - if (sc->sc_irq_res && sc->sc_intr_hdl) /* call ehci_detach() after ehci_init() called after * successful bus_setup_intr(). */ ehci_detach(sc); - if (sc->sc_bus.bdev) { - device_detach(sc->sc_bus.bdev); - device_delete_child(dev, sc->sc_bus.bdev); - } + if (sc->sc_irq_res) { if (sc->sc_intr_hdl != NULL) bus_teardown_intr(dev, sc->sc_irq_res, Modified: head/sys/boot/kshim/bsd_kernel.c ============================================================================== --- head/sys/boot/kshim/bsd_kernel.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/boot/kshim/bsd_kernel.c Mon Oct 17 10:20:38 2016 (r307518) @@ -817,8 +817,12 @@ device_delete_child(device_t dev, device int error = 0; device_t grandchild; - /* remove children first */ + /* detach parent before deleting children, if any */ + error = device_detach(child); + if (error) + goto done; + /* remove children second */ while ((grandchild = TAILQ_FIRST(&child->dev_children))) { error = device_delete_child(child, grandchild); if (error) { @@ -827,11 +831,6 @@ device_delete_child(device_t dev, device } } - error = device_detach(child); - - if (error) - goto done; - devclass_delete_device(child->dev_module, child); if (dev != NULL) { Modified: head/sys/dev/bhnd/cores/usb/bhnd_ehci.c ============================================================================== --- head/sys/dev/bhnd/cores/usb/bhnd_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/bhnd/cores/usb/bhnd_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -191,16 +191,10 @@ static int bhnd_ehci_detach(device_t self) { ehci_softc_t *sc; - device_t bdev; int err; sc = device_get_softc(self); - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/bhnd/cores/usb/bhnd_ohci.c ============================================================================== --- head/sys/dev/bhnd/cores/usb/bhnd_ohci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/bhnd/cores/usb/bhnd_ohci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -163,15 +163,9 @@ static int bhnd_ohci_detach(device_t self) { ohci_softc_t *sc; - device_t bdev; sc = device_get_softc(self); - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/puc/puc.c ============================================================================== --- head/sys/dev/puc/puc.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/puc/puc.c Mon Oct 17 10:20:38 2016 (r307518) @@ -414,8 +414,7 @@ puc_bfe_detach(device_t dev) port = &sc->sc_port[idx]; if (port->p_dev == NULL) continue; - if (device_detach(port->p_dev) == 0) { - device_delete_child(dev, port->p_dev); + if (device_delete_child(dev, port->p_dev) == 0) { if (port->p_rres != NULL) rman_release_resource(port->p_rres); if (port->p_ires != NULL) Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Mon Oct 17 10:20:38 2016 (r307518) @@ -243,14 +243,8 @@ static int at91_udp_detach(device_t dev) { struct at91_udp_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_dci.sc_bus.bdev) { - bdev = sc->sc_dci.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/at91dci_fdt.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_fdt.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/at91dci_fdt.c Mon Oct 17 10:20:38 2016 (r307518) @@ -249,14 +249,8 @@ static int at91_udp_detach(device_t dev) { struct at91_udp_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_dci.sc_bus.bdev) { - bdev = sc->sc_dci.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/atmegadci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci_atmelarm.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/atmegadci_atmelarm.c Mon Oct 17 10:20:38 2016 (r307518) @@ -155,14 +155,8 @@ static int atmegadci_detach(device_t dev) { struct atmegadci_super_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_otg.sc_bus.bdev) { - bdev = sc->sc_otg.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Mon Oct 17 10:20:38 2016 (r307518) @@ -163,14 +163,8 @@ static int dwc_otg_detach(device_t dev) { struct dwc_otg_fdt_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_otg.sc_bus.bdev) { - bdev = sc->sc_otg.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_ixp4xx.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/ehci_ixp4xx.c Mon Oct 17 10:20:38 2016 (r307518) @@ -221,14 +221,8 @@ ehci_ixp_detach(device_t self) { struct ixp_ehci_softc *isc = device_get_softc(self); ehci_softc_t *sc = &isc->base; - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/usb/controller/ehci_mv.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mv.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/ehci_mv.c Mon Oct 17 10:20:38 2016 (r307518) @@ -264,14 +264,8 @@ static int mv_ehci_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -477,13 +477,7 @@ static int ehci_pci_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); - device_t bdev; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/usb/controller/generic_ehci.c ============================================================================== --- head/sys/dev/usb/controller/generic_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/generic_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -156,14 +156,8 @@ static int generic_ehci_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/usb/controller/generic_ohci.c ============================================================================== --- head/sys/dev/usb/controller/generic_ohci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/generic_ohci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -214,18 +214,11 @@ static int generic_ohci_detach(device_t dev) { struct generic_ohci_softc *sc = device_get_softc(dev); - device_t bdev; int err; #ifdef EXT_RESOURCES struct clk_list *clk, *clk_tmp; #endif - if (sc->ohci_sc.sc_bus.bdev) { - bdev = sc->ohci_sc.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } - /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/musb_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg_atmelarm.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/musb_otg_atmelarm.c Mon Oct 17 10:20:38 2016 (r307518) @@ -204,14 +204,8 @@ static int musbotg_detach(device_t dev) { struct musbotg_super_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_otg.sc_bus.bdev) { - bdev = sc->sc_otg.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ohci_pci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/ohci_pci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -335,13 +335,7 @@ static int ohci_pci_detach(device_t self) { ohci_softc_t *sc = device_get_softc(self); - device_t bdev; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/usb/controller/ohci_s3c24x0.c ============================================================================== --- head/sys/dev/usb/controller/ohci_s3c24x0.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/ohci_s3c24x0.c Mon Oct 17 10:20:38 2016 (r307518) @@ -148,14 +148,8 @@ static int ohci_s3c24x0_detach(device_t dev) { struct ohci_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/saf1761_otg_boot.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_boot.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/saf1761_otg_boot.c Mon Oct 17 10:20:38 2016 (r307518) @@ -124,13 +124,6 @@ static int saf1761_otg_fdt_detach(device_t dev) { struct saf1761_otg_softc *sc = device_get_softc(dev); - device_t bdev; - - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/saf1761_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_fdt.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/saf1761_otg_fdt.c Mon Oct 17 10:20:38 2016 (r307518) @@ -238,14 +238,8 @@ static int saf1761_otg_fdt_detach(device_t dev) { struct saf1761_otg_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/uhci_pci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -393,13 +393,7 @@ int uhci_pci_detach(device_t self) { uhci_softc_t *sc = device_get_softc(self); - device_t bdev; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci_atmelarm.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/uss820dci_atmelarm.c Mon Oct 17 10:20:38 2016 (r307518) @@ -164,14 +164,8 @@ static int uss820_atmelarm_detach(device_t dev) { struct uss820dci_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/xhci_mv.c ============================================================================== --- head/sys/dev/usb/controller/xhci_mv.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/xhci_mv.c Mon Oct 17 10:20:38 2016 (r307518) @@ -171,15 +171,8 @@ static int xhci_detach(device_t dev) { struct xhci_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_bus.bdev != NULL) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } - /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/controller/xhci_pci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -340,13 +340,7 @@ static int xhci_pci_detach(device_t self) { struct xhci_softc *sc = device_get_softc(self); - device_t bdev; - if (sc->sc_bus.bdev != NULL) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/usb_device.c Mon Oct 17 10:20:38 2016 (r307518) @@ -1103,10 +1103,8 @@ usb_detach_device_sub(struct usb_device device_printf(dev, "Resume failed\n"); } } - if (device_detach(dev)) { - goto error; - } } + /* detach and delete child */ if (device_delete_child(udev->parent_dev, dev)) { goto error; } Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/dev/usb/video/udl.c Mon Oct 17 10:20:38 2016 (r307518) @@ -443,14 +443,9 @@ udl_detach(device_t dev) { struct udl_softc *sc = device_get_softc(dev); - if (sc->sc_fbdev != NULL) { - device_t bdev; + /* delete all child devices */ + device_delete_children(dev); - bdev = sc->sc_fbdev; - sc->sc_fbdev = NULL; - device_detach(bdev); - device_delete_child(dev, bdev); - } UDL_LOCK(sc); sc->sc_gone = 1; callout_stop(&sc->sc_callout); Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/kern/subr_bus.c Mon Oct 17 10:20:38 2016 (r307518) @@ -1949,15 +1949,17 @@ device_delete_child(device_t dev, device PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev))); - /* remove children first */ + /* detach parent before deleting children, if any */ + if ((error = device_detach(child)) != 0) + return (error); + + /* remove children second */ while ((grandchild = TAILQ_FIRST(&child->children)) != NULL) { error = device_delete_child(child, grandchild); if (error) return (error); } - if ((error = device_detach(child)) != 0) - return (error); if (child->devclass) devclass_delete_device(child->devclass, child); if (child->parent) Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/atheros/ar71xx_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -231,14 +231,8 @@ ar71xx_ehci_detach(device_t self) { struct ar71xx_ehci_softc *isc = device_get_softc(self); ehci_softc_t *sc = &isc->base; - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/mips/atheros/ar71xx_ohci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ohci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/atheros/ar71xx_ohci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -156,13 +156,7 @@ static int ar71xx_ohci_detach(device_t dev) { struct ar71xx_ohci_softc *sc = device_get_softc(dev); - device_t bdev; - if (sc->sc_ohci.sc_bus.bdev) { - bdev = sc->sc_ohci.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/mips/cavium/usb/octusb_octeon.c ============================================================================== --- head/sys/mips/cavium/usb/octusb_octeon.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/cavium/usb/octusb_octeon.c Mon Oct 17 10:20:38 2016 (r307518) @@ -160,16 +160,10 @@ static int octusb_octeon_detach(device_t dev) { struct octusb_octeon_softc *sc = device_get_softc(dev); - device_t bdev; int err; int nports; int i; - if (sc->sc_dci.sc_bus.bdev) { - bdev = sc->sc_dci.sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/mips/mediatek/mtk_dotg.c ============================================================================== --- head/sys/mips/mediatek/mtk_dotg.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/mediatek/mtk_dotg.c Mon Oct 17 10:20:38 2016 (r307518) @@ -161,14 +161,8 @@ static int dotg_fdt_detach(device_t dev) { struct dwc_otg_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/mips/mediatek/mtk_ehci.c ============================================================================== --- head/sys/mips/mediatek/mtk_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/mediatek/mtk_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -162,14 +162,8 @@ static int ehci_fdt_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/mips/mediatek/mtk_ohci.c ============================================================================== --- head/sys/mips/mediatek/mtk_ohci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/mediatek/mtk_ohci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -162,14 +162,8 @@ static int ohci_fdt_detach(device_t self) { ohci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/mips/mediatek/mtk_xhci.c ============================================================================== --- head/sys/mips/mediatek/mtk_xhci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/mediatek/mtk_xhci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -161,14 +161,8 @@ static int mtk_xhci_fdt_detach(device_t self) { struct xhci_softc *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/mips/rmi/xls_ehci.c ============================================================================== --- head/sys/mips/rmi/xls_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/rmi/xls_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -164,14 +164,8 @@ static int ehci_xls_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/mips/rt305x/rt305x_dotg.c ============================================================================== --- head/sys/mips/rt305x/rt305x_dotg.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/rt305x/rt305x_dotg.c Mon Oct 17 10:20:38 2016 (r307518) @@ -173,14 +173,8 @@ static int dotg_obio_detach(device_t dev) { struct dwc_otg_softc *sc = device_get_softc(dev); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(dev); Modified: head/sys/mips/rt305x/rt305x_ehci.c ============================================================================== --- head/sys/mips/rt305x/rt305x_ehci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/rt305x/rt305x_ehci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -175,14 +175,8 @@ static int ehci_obio_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); Modified: head/sys/mips/rt305x/rt305x_ohci.c ============================================================================== --- head/sys/mips/rt305x/rt305x_ohci.c Mon Oct 17 09:40:18 2016 (r307517) +++ head/sys/mips/rt305x/rt305x_ohci.c Mon Oct 17 10:20:38 2016 (r307518) @@ -175,14 +175,8 @@ static int ohci_obio_detach(device_t self) { ohci_softc_t *sc = device_get_softc(self); - device_t bdev; int err; - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(self, bdev); - } /* during module unload there are lots of children leftover */ device_delete_children(self); From owner-svn-src-head@freebsd.org Mon Oct 17 10:21:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80539C15B6F; Mon, 17 Oct 2016 10:21:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 50CD97D2; Mon, 17 Oct 2016 10:21:54 +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 u9HALree079649; Mon, 17 Oct 2016 10:21:53 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HALr4T079648; Mon, 17 Oct 2016 10:21:53 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610171021.u9HALr4T079648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 17 Oct 2016 10:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307519 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 10:21:54 -0000 Author: br Date: Mon Oct 17 10:21:53 2016 New Revision: 307519 URL: https://svnweb.freebsd.org/changeset/base/307519 Log: Increase timeout so low-end platforms have a chance to complete test procedures. This fixes operation in QEMU/MIPS64. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/bin/pkill/tests/pgrep-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Mon Oct 17 10:20:38 2016 (r307518) +++ head/bin/pkill/tests/pgrep-j_test.sh Mon Oct 17 10:21:53 2016 (r307519) @@ -20,12 +20,13 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pgrep -j " -sleep_amount=5 +sleep_amount=15 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & +sleep 0.5 for i in `seq 1 10`; do jid1=$(jail_name_to_jid ${base}_1_1) From owner-svn-src-head@freebsd.org Mon Oct 17 13:36:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 518D0C12890; Mon, 17 Oct 2016 13:36:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 20D3E79E; Mon, 17 Oct 2016 13:36:51 +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 u9HDaokJ053344; Mon, 17 Oct 2016 13:36:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HDaora053343; Mon, 17 Oct 2016 13:36:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610171336.u9HDaora053343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Oct 2016 13:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307520 - head/usr.bin/elfdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 13:36:51 -0000 Author: emaste Date: Mon Oct 17 13:36:50 2016 New Revision: 307520 URL: https://svnweb.freebsd.org/changeset/base/307520 Log: elfdump: correct DT_AUXILIARY / DT_USED / DT_FILTER definitions r109332 introduced these three as DT_SUNW_*. Update to the correct names already used elsewhere in FreeBSD and the Sun "Linker and Libraries Guide" MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Mon Oct 17 10:21:53 2016 (r307519) +++ head/usr.bin/elfdump/elfdump.c Mon Oct 17 13:36:50 2016 (r307520) @@ -241,9 +241,9 @@ d_tags(u_int64_t tag) case 0x6ffffff0: return "DT_GNU_VERSYM"; /* 0x70000000 - 0x7fffffff processor-specific semantics */ case 0x70000000: return "DT_IA_64_PLT_RESERVE"; - case 0x7ffffffd: return "DT_SUNW_AUXILIARY"; - case 0x7ffffffe: return "DT_SUNW_USED"; - case 0x7fffffff: return "DT_SUNW_FILTER"; + case DT_AUXILIARY: return "DT_AUXILIARY"; + case DT_USED: return "DT_USED"; + case DT_FILTER: return "DT_FILTER"; } snprintf(unknown_tag, sizeof(unknown_tag), "ERROR: TAG NOT DEFINED -- tag 0x%jx", (uintmax_t)tag); From owner-svn-src-head@freebsd.org Mon Oct 17 13:47:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 877A9C12F01; Mon, 17 Oct 2016 13:47:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 580CC1CE; Mon, 17 Oct 2016 13:47:24 +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 u9HDlNqX057281; Mon, 17 Oct 2016 13:47:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HDlM3J057269; Mon, 17 Oct 2016 13:47:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610171347.u9HDlM3J057269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Oct 2016 13:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307521 - in head: lib/libmd sys/crypto/sha2 sys/crypto/skein sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 13:47:24 -0000 Author: emaste Date: Mon Oct 17 13:47:22 2016 New Revision: 307521 URL: https://svnweb.freebsd.org/changeset/base/307521 Log: libmd: introduce functions that operate on an fd instead of filename Reviewed by: allanjude, cem MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8264 Modified: head/lib/libmd/md4.h head/lib/libmd/md5.h head/lib/libmd/mdXhl.c head/lib/libmd/ripemd.h head/lib/libmd/sha.h head/sys/crypto/sha2/sha256.h head/sys/crypto/sha2/sha384.h head/sys/crypto/sha2/sha512.h head/sys/crypto/sha2/sha512t.h head/sys/crypto/skein/skein_freebsd.h head/sys/crypto/skein/skein_port.h head/sys/sys/md5.h Modified: head/lib/libmd/md4.h ============================================================================== --- head/lib/libmd/md4.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/lib/libmd/md4.h Mon Oct 17 13:47:22 2016 (r307521) @@ -53,6 +53,12 @@ __BEGIN_DECLS #ifndef MD4End #define MD4End _libmd_MD4End #endif +#ifndef MD4Fd +#define MD4Fd _libmd_MD4Fd +#endif +#ifndef MD4FdChunk +#define MD4FdChunk _libmd_MD4FdChunk +#endif #ifndef MD4File #define MD4File _libmd_MD4File #endif @@ -68,6 +74,8 @@ void MD4Update(MD4_CTX *, const void * void MD4Pad(MD4_CTX *); void MD4Final(unsigned char [16], MD4_CTX *); char * MD4End(MD4_CTX *, char *); +char * MD4Fd(int, char *); +char * MD4FdChunk(int, char *, off_t, off_t); char * MD4File(const char *, char *); char * MD4FileChunk(const char *, char *, off_t, off_t); char * MD4Data(const void *, unsigned int, char *); Modified: head/lib/libmd/md5.h ============================================================================== --- head/lib/libmd/md5.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/lib/libmd/md5.h Mon Oct 17 13:47:22 2016 (r307521) @@ -25,6 +25,12 @@ #ifndef MD5End #define MD5End _libmd_MD5End #endif +#ifndef MD5Fd +#define MD5Fd _libmd_MD5Fd +#endif +#ifndef MD5FdChunk +#define MD5FdChunk _libmd_MD5FdChunk +#endif #ifndef MD5File #define MD5File _libmd_MD5File #endif Modified: head/lib/libmd/mdXhl.c ============================================================================== --- head/lib/libmd/mdXhl.c Mon Oct 17 13:36:50 2016 (r307520) +++ head/lib/libmd/mdXhl.c Mon Oct 17 13:47:22 2016 (r307521) @@ -42,18 +42,18 @@ MDXEnd(MDX_CTX *ctx, char *buf) } char * -MDXFile(const char *filename, char *buf) +MDXFd(int fd, char *buf) { - return (MDXFileChunk(filename, buf, 0, 0)); + return MDXFdChunk(fd, buf, 0, 0); } char * -MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len) +MDXFdChunk(int fd, char *buf, off_t ofs, off_t len) { unsigned char buffer[16*1024]; MDX_CTX ctx; struct stat stbuf; - int fd, readrv, e; + int readrv, e; off_t remain; if (len < 0) { @@ -62,9 +62,6 @@ MDXFileChunk(const char *filename, char } MDXInit(&ctx); - fd = open(filename, O_RDONLY); - if (fd < 0) - return NULL; if (ofs != 0) { errno = 0; if (lseek(fd, ofs, SEEK_SET) != ofs || @@ -86,15 +83,34 @@ MDXFileChunk(const char *filename, char remain -= readrv; } error: - e = errno; - close(fd); - errno = e; if (readrv < 0) return NULL; return (MDXEnd(&ctx, buf)); } char * +MDXFile(const char *filename, char *buf) +{ + return (MDXFileChunk(filename, buf, 0, 0)); +} + +char * +MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len) +{ + char *ret; + int e, fd; + + fd = open(filename, O_RDONLY); + if (fd < 0) + return NULL; + ret = MDXFdChunk(fd, buf, ofs, len); + e = errno; + close (fd); + errno = e; + return ret; +} + +char * MDXData (const void *data, unsigned int len, char *buf) { MDX_CTX ctx; Modified: head/lib/libmd/ripemd.h ============================================================================== --- head/lib/libmd/ripemd.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/lib/libmd/ripemd.h Mon Oct 17 13:47:22 2016 (r307521) @@ -96,6 +96,12 @@ __BEGIN_DECLS #ifndef RIPEMD160_End #define RIPEMD160_End _libmd_RIPEMD160_End #endif +#ifndef RIPEMD160_Fd +#define RIPEMD160_Fd _libmd_RIPEMD160_Fd +#endif +#ifndef RIPEMD160_FdChunk +#define RIPEMD160_FdChunk _libmd_RIPEMD160_FdChunk +#endif #ifndef RIPEMD160_File #define RIPEMD160_File _libmd_RIPEMD160_File #endif @@ -121,6 +127,8 @@ void RIPEMD160_Update(RIPEMD160_CTX *c, size_t len); void RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); char *RIPEMD160_End(RIPEMD160_CTX *, char *); +char *RIPEMD160_Fd(int, char *); +char *RIPEMD160_FdChunk(int, char *, off_t, off_t); char *RIPEMD160_File(const char *, char *); char *RIPEMD160_FileChunk(const char *, char *, off_t, off_t); char *RIPEMD160_Data(const void *, unsigned int, char *); Modified: head/lib/libmd/sha.h ============================================================================== --- head/lib/libmd/sha.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/lib/libmd/sha.h Mon Oct 17 13:47:22 2016 (r307521) @@ -94,6 +94,12 @@ __BEGIN_DECLS #ifndef SHA_End #define SHA_End _libmd_SHA_End #endif +#ifndef SHA_Fd +#define SHA_Fd _libmd_SHA_Fd +#endif +#ifndef SHA_FdChunk +#define SHA_FdChunk _libmd_SHA_FdChunk +#endif #ifndef SHA_File #define SHA_File _libmd_SHA_File #endif @@ -126,6 +132,12 @@ __BEGIN_DECLS #ifndef SHA1_End #define SHA1_End _libmd_SHA1_End #endif +#ifndef SHA1_Fd +#define SHA1_Fd _libmd_SHA1_Fd +#endif +#ifndef SHA1_FdChunk +#define SHA1_FdChunk _libmd_SHA1_FdChunk +#endif #ifndef SHA1_File #define SHA1_File _libmd_SHA1_File #endif @@ -150,6 +162,8 @@ void SHA_Init(SHA_CTX *c); void SHA_Update(SHA_CTX *c, const void *data, size_t len); void SHA_Final(unsigned char *md, SHA_CTX *c); char *SHA_End(SHA_CTX *, char *); +char *SHA_Fd(int, char *); +char *SHA_FdChunk(int, char *, off_t, off_t); char *SHA_File(const char *, char *); char *SHA_FileChunk(const char *, char *, off_t, off_t); char *SHA_Data(const void *, unsigned int, char *); @@ -158,6 +172,8 @@ void SHA1_Init(SHA_CTX *c); void SHA1_Update(SHA_CTX *c, const void *data, size_t len); void SHA1_Final(unsigned char *md, SHA_CTX *c); char *SHA1_End(SHA_CTX *, char *); +char *SHA1_Fd(int, char *); +char *SHA1_FdChunk(int, char *, off_t, off_t); char *SHA1_File(const char *, char *); char *SHA1_FileChunk(const char *, char *, off_t, off_t); char *SHA1_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/sha2/sha256.h ============================================================================== --- head/sys/crypto/sha2/sha256.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/sys/crypto/sha2/sha256.h Mon Oct 17 13:47:22 2016 (r307521) @@ -59,6 +59,12 @@ __BEGIN_DECLS #ifndef SHA256_End #define SHA256_End _libmd_SHA256_End #endif +#ifndef SHA256_Fd +#define SHA256_Fd _libmd_SHA256_Fd +#endif +#ifndef SHA256_FdChunk +#define SHA256_FdChunk _libmd_SHA256_FdChunk +#endif #ifndef SHA256_File #define SHA256_File _libmd_SHA256_File #endif @@ -82,6 +88,8 @@ void SHA256_Final(unsigned char [static #ifndef _KERNEL char *SHA256_End(SHA256_CTX *, char *); char *SHA256_Data(const void *, unsigned int, char *); +char *SHA256_Fd(int, char *); +char *SHA256_FdChunk(int, char *, off_t, off_t); char *SHA256_File(const char *, char *); char *SHA256_FileChunk(const char *, char *, off_t, off_t); #endif Modified: head/sys/crypto/sha2/sha384.h ============================================================================== --- head/sys/crypto/sha2/sha384.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/sys/crypto/sha2/sha384.h Mon Oct 17 13:47:22 2016 (r307521) @@ -58,6 +58,12 @@ __BEGIN_DECLS #ifndef SHA384_End #define SHA384_End _libmd_SHA384_End #endif +#ifndef SHA384_Fd +#define SHA384_Fd _libmd_SHA384_Fd +#endif +#ifndef SHA384_FdChunk +#define SHA384_FdChunk _libmd_SHA384_FdChunk +#endif #ifndef SHA384_File #define SHA384_File _libmd_SHA384_File #endif @@ -78,6 +84,8 @@ void SHA384_Final(unsigned char [static #ifndef _KERNEL char *SHA384_End(SHA384_CTX *, char *); char *SHA384_Data(const void *, unsigned int, char *); +char *SHA384_Fd(int, char *); +char *SHA384_FdChunk(int, char *, off_t, off_t); char *SHA384_File(const char *, char *); char *SHA384_FileChunk(const char *, char *, off_t, off_t); #endif Modified: head/sys/crypto/sha2/sha512.h ============================================================================== --- head/sys/crypto/sha2/sha512.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/sys/crypto/sha2/sha512.h Mon Oct 17 13:47:22 2016 (r307521) @@ -58,6 +58,12 @@ __BEGIN_DECLS #ifndef SHA512_End #define SHA512_End _libmd_SHA512_End #endif +#ifndef SHA512_Fd +#define SHA512_Fd _libmd_SHA512_Fd +#endif +#ifndef SHA512_FdChunk +#define SHA512_FdChunk _libmd_SHA512_FdChunk +#endif #ifndef SHA512_File #define SHA512_File _libmd_SHA512_File #endif @@ -81,6 +87,8 @@ void SHA512_Final(unsigned char [static #ifndef _KERNEL char *SHA512_End(SHA512_CTX *, char *); char *SHA512_Data(const void *, unsigned int, char *); +char *SHA512_Fd(int, char *); +char *SHA512_FdChunk(int, char *, off_t, off_t); char *SHA512_File(const char *, char *); char *SHA512_FileChunk(const char *, char *, off_t, off_t); #endif Modified: head/sys/crypto/sha2/sha512t.h ============================================================================== --- head/sys/crypto/sha2/sha512t.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/sys/crypto/sha2/sha512t.h Mon Oct 17 13:47:22 2016 (r307521) @@ -55,6 +55,12 @@ __BEGIN_DECLS #ifndef SHA512_224_End #define SHA512_224_End _libmd_SHA512_224_End #endif +#ifndef SHA512_224_Fd +#define SHA512_224_Fd _libmd_SHA512_224_Fd +#endif +#ifndef SHA512_224_FdChunk +#define SHA512_224_FdChunk _libmd_SHA512_224_FdChunk +#endif #ifndef SHA512_224_File #define SHA512_224_File _libmd_SHA512_224_File #endif @@ -84,6 +90,12 @@ __BEGIN_DECLS #ifndef SHA512_256_End #define SHA512_256_End _libmd_SHA512_256_End #endif +#ifndef SHA512_256_Fd +#define SHA512_256_Fd _libmd_SHA512_256_Fd +#endif +#ifndef SHA512_256_FdChunk +#define SHA512_256_FdChunk _libmd_SHA512_256_FdChunk +#endif #ifndef SHA512_256_File #define SHA512_256_File _libmd_SHA512_256_File #endif @@ -107,6 +119,8 @@ void SHA512_224_Final(unsigned char [sta #ifndef _KERNEL char *SHA512_224_End(SHA512_CTX *, char *); char *SHA512_224_Data(const void *, unsigned int, char *); +char *SHA512_224_Fd(int, char *); +char *SHA512_224_FdChunk(int, char *, off_t, off_t); char *SHA512_224_File(const char *, char *); char *SHA512_224_FileChunk(const char *, char *, off_t, off_t); #endif @@ -116,6 +130,8 @@ void SHA512_256_Final(unsigned char [sta #ifndef _KERNEL char *SHA512_256_End(SHA512_CTX *, char *); char *SHA512_256_Data(const void *, unsigned int, char *); +char *SHA512_256_Fd(int, char *); +char *SHA512_256_FdChunk(int, char *, off_t, off_t); char *SHA512_256_File(const char *, char *); char *SHA512_256_FileChunk(const char *, char *, off_t, off_t); #endif Modified: head/sys/crypto/skein/skein_freebsd.h ============================================================================== --- head/sys/crypto/skein/skein_freebsd.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/sys/crypto/skein/skein_freebsd.h Mon Oct 17 13:47:22 2016 (r307521) @@ -68,6 +68,12 @@ char *SKEIN1024_End(SKEIN1024_CTX *, c char *SKEIN256_Data(const void *, unsigned int, char *); char *SKEIN512_Data(const void *, unsigned int, char *); char *SKEIN1024_Data(const void *, unsigned int, char *); +char *SKEIN256_Fd(int, char *); +char *SKEIN512_Fd(int, char *); +char *SKEIN1024_Fd(int, char *); +char *SKEIN256_FdChunk(int, char *, off_t, off_t); +char *SKEIN512_FdChunk(int, char *, off_t, off_t); +char *SKEIN1024_FdChunk(int, char *, off_t, off_t); char *SKEIN256_File(const char *, char *); char *SKEIN512_File(const char *, char *); char *SKEIN1024_File(const char *, char *); Modified: head/sys/crypto/skein/skein_port.h ============================================================================== --- head/sys/crypto/skein/skein_port.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/sys/crypto/skein/skein_port.h Mon Oct 17 13:47:22 2016 (r307521) @@ -137,6 +137,16 @@ void Skein_Get64_LSB_First(u64b_t *ds #define SKEIN512_End _libmd_SKEIN512_End #define SKEIN1024_End _libmd_SKEIN1024_End #endif +#ifndef SKEIN256_Fd +#define SKEIN256_Fd _libmd_SKEIN256_Fd +#define SKEIN512_Fd _libmd_SKEIN512_Fd +#define SKEIN1024_Fd _libmd_SKEIN1024_Fd +#endif +#ifndef SKEIN256_FdChunk +#define SKEIN256_FdChunk _libmd_SKEIN256_FdChunk +#define SKEIN512_FdChunk _libmd_SKEIN512_FdChunk +#define SKEIN1024_FdChunk _libmd_SKEIN1024_FdChunk +#endif #ifndef SKEIN256_File #define SKEIN256_File _libmd_SKEIN256_File #define SKEIN512_File _libmd_SKEIN512_File Modified: head/sys/sys/md5.h ============================================================================== --- head/sys/sys/md5.h Mon Oct 17 13:36:50 2016 (r307520) +++ head/sys/sys/md5.h Mon Oct 17 13:47:22 2016 (r307521) @@ -47,6 +47,8 @@ void MD5Update (MD5_CTX *, const void void MD5Final (unsigned char[static MD5_DIGEST_LENGTH], MD5_CTX *); #ifndef _KERNEL char * MD5End(MD5_CTX *, char *); +char * MD5Fd(int, char *); +char * MD5FdChunk(int, char *, off_t, off_t); char * MD5File(const char *, char *); char * MD5FileChunk(const char *, char *, off_t, off_t); char * MD5Data(const void *, unsigned int, char *); From owner-svn-src-head@freebsd.org Mon Oct 17 13:52:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55FFAC140C8; Mon, 17 Oct 2016 13:52:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2856B923; Mon, 17 Oct 2016 13:52:25 +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 u9HDqOs7060769; Mon, 17 Oct 2016 13:52:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HDqOw9060768; Mon, 17 Oct 2016 13:52:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610171352.u9HDqOw9060768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Oct 2016 13:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307522 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 13:52:25 -0000 Author: emaste Date: Mon Oct 17 13:52:24 2016 New Revision: 307522 URL: https://svnweb.freebsd.org/changeset/base/307522 Log: makesyscalls.sh: remove trailing space on the "created from" line In r10905 and r10906 makesyscalls was modified to avoid emitting a literal $Id$ string in the generated file, with: gsub("[$]Id: ", "", $0) gsub(" [$]", "", $0) Then r11294 added some functionality and also tried to address the $Id$ problem in a different way, by removing every $: sed -e 's/\$//g ... This rendered the gsub infeffective. The gsub was later updated to track the $Id$ -> $FreeBSD$ switch, even though it did not do anything. Revert the addition of the s/\$//g, and update the gsub to keep the resulting format the same. Discussed with: bde MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Oct 17 13:47:22 2016 (r307521) +++ head/sys/kern/makesyscalls.sh Mon Oct 17 13:52:24 2016 (r307522) @@ -65,7 +65,6 @@ if [ -n "$2" ]; then fi sed -e ' -s/\$//g :join /\\$/{a\ @@ -147,7 +146,7 @@ s/\$//g printf " * $%s$\n", "FreeBSD" > systrace } NR == 1 { - gsub("[$]FreeBSD: ", "", $0) + gsub("[$]FreeBSD: ", "FreeBSD: ", $0) gsub(" [$]", "", $0) printf " * created from%s\n */\n\n", $0 > syssw From owner-svn-src-head@freebsd.org Mon Oct 17 15:02:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 332FCC15A8A; Mon, 17 Oct 2016 15:02:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 053EDCA3; Mon, 17 Oct 2016 15:02:18 +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 u9HF2I68087800; Mon, 17 Oct 2016 15:02:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HF2I7L087799; Mon, 17 Oct 2016 15:02:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610171502.u9HF2I7L087799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 17 Oct 2016 15:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307523 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 15:02:19 -0000 Author: mav Date: Mon Oct 17 15:02:17 2016 New Revision: 307523 URL: https://svnweb.freebsd.org/changeset/base/307523 Log: Make pass driver better support CAM_CDB_POINTER flag. Previously pass driver just ignored the flag, making random kernel code access user-space pointer, sometime causing crashes even for correctly written applications if user-level context was switched or swapped out. This patch tries to copyin the CDB into kernel space to avoid it. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_pass.c Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Mon Oct 17 13:52:24 2016 (r307522) +++ head/sys/cam/scsi/scsi_pass.c Mon Oct 17 15:02:17 2016 (r307523) @@ -1876,6 +1876,18 @@ passdoioctl(struct cdev *dev, u_long cmd break; } + if (ccb->ccb_h.flags & CAM_CDB_POINTER) { + if (ccb->csio.cdb_len > IOCDBLEN) { + error = EINVAL; + break; + } + error = copyin(ccb->csio.cdb_io.cdb_ptr, + ccb->csio.cdb_io.cdb_bytes, ccb->csio.cdb_len); + if (error) + break; + ccb->ccb_h.flags &= ~CAM_CDB_POINTER; + } + /* * Some CCB types, like scan bus and scan lun can only go * through the transport layer device. @@ -2143,6 +2155,7 @@ passsendccb(struct cam_periph *periph, u { struct pass_softc *softc; struct cam_periph_map_info mapinfo; + uint8_t *cmd; xpt_opcode fc; int error; @@ -2154,6 +2167,14 @@ passsendccb(struct cam_periph *periph, u */ xpt_merge_ccb(ccb, inccb); + if (ccb->ccb_h.flags & CAM_CDB_POINTER) { + cmd = __builtin_alloca(ccb->csio.cdb_len); + error = copyin(ccb->csio.cdb_io.cdb_ptr, cmd, ccb->csio.cdb_len); + if (error) + return (error); + ccb->csio.cdb_io.cdb_ptr = cmd; + } + /* */ ccb->ccb_h.cbfcnp = passdone; From owner-svn-src-head@freebsd.org Mon Oct 17 18:20:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C731EC16059; Mon, 17 Oct 2016 18:20:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9146812EA; Mon, 17 Oct 2016 18:20:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8B0D610AF7E; Mon, 17 Oct 2016 14:20:03 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Doug Ambrisko , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Doug Ambrisko , Ravi Pokala Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader Date: Mon, 17 Oct 2016 10:40:53 -0700 Message-ID: <1950201.IjTl3rpdGP@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014175542.GB65545@ambrisko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 17 Oct 2016 14:20:03 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 18:20:05 -0000 On Friday, October 14, 2016 12:25:54 PM Warner Losh wrote: > On Oct 14, 2016 11:55 AM, "Doug Ambrisko" wrote: > > > > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: > > | -----Original Message----- > > | > From: on behalf of Doug Ambrisko < > ambrisko@ambrisko.com> > > | > Date: 2016-10-14, Friday at 10:27 > > | > To: Warner Losh > > | > Cc: Doug Ambrisko , src-committers < > src-committers@freebsd.org>, "svn-src-all@freebsd.org" < > svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" < > svn-src-head@freebsd.org> > > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader > > | > > > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: > > | > | Love the functionality, but don't like using the 'hint' namespace > for > > | > | this. Can we change it now before too many things depend on it? We > had > > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we move > > | > | this to the 'smbios' space please? > > | > | > > | > | The reason is that 'hint' is special and sometimes filtered out, so > it > > | > | is a poor choice to export data from the boot loader to the kernel. > > | > > > | > The reason I picked hint was it could be put /boot/device.hints > > | > to make it work as well and that it was a hint. Other standards in > the > > | > future might use other methods. Looking back over the email I had > > | > with John he had suggested hint.smbios.0.anchor to make this look > > | > different. This code had been hanging around for so long I forgot > > | > about that and we were using hint.smbios.0.mem in our shipping code > base. > > | > > > | > However, I hope that nothing would use this except for smbios(4) and > > | > for people to make smbios(4) useful for this info. > > | > > | Doug's looking at me when he says that. :-) > > | > > | We talked about this last night at BAFUG; right now, even if smbios(4) > > | is able to find the SMBIOS info -- it currently only looks at the > > | aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI -- > > | smbios(4) doesn't actually provide any interface for that information. > > | Doug and I have talked about making smbios(4) useful, by parsing the > > | data and providing KPIs and APIs, for years now; I think I'll *finally* > > | have the time and motivation to do so "soon". > > > > I've actually talked to a few people. However, your the first to > > step up. This needs to be designed and will take some time and > > review. I would hope that except for smbios(4), nothing else would > > use this kenv but there is nothing to prevent that :-( I could name > > it super_secret_dont_use. > > > > BTW, to get you started this patch prevents smbios(4) from blowing chunks > > when it gets a anchor in high memory and works on legacy machines. > > > > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.000000000 -0700 > > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 > > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -59,7 +60,7 @@ struct smbios_softc { > > }; > > > > #define RES2EPS(res) ((struct smbios_eps > *)rman_get_virtual(res)) > > -#define ADDR2EPS(addr) ((struct smbios_eps > *)BIOS_PADDRTOVADDR(addr)) > > +#define ADDR2EPS(addr) ((struct smbios_eps *)PHYS_TO_DMAP(addr)) > > > > static devclass_t smbios_devclass; > > > > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in > > > > static int smbios_cksum (struct smbios_eps *); > > > > +static unsigned long addr; > > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, > > + "SMBIOS driver parameters"); > > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, > > + &addr, 0, ""); > > + > > static void > > smbios_identify (driver_t *driver, device_t parent) > > { > > device_t child; > > - u_int32_t addr; > > int length; > > int rid; > > > > if (!device_is_alive(parent)) > > return; > > > > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, > > - SMBIOS_STEP, SMBIOS_OFF); > > + if (resource_long_value("smbios", 0, "mem", &addr) != 0 || > > + addr == 0) > > + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, > SMBIOS_LEN, > > + SMBIOS_STEP, SMBIOS_OFF); > > if (addr != 0) { > > rid = 0; > > length = ADDR2EPS(addr)->length; > > > > Note I don't plan to commit this since it doesn't really do much and we > > need a lot more. > > I was planning on exporting all smbios stuff via sysctl. I'm a bit hesitant to do all the type parsing in the kernel vs userland. However, I think having smbios(4) export a /dev/smbios that you can either read() or mmap() to access the table would be very convenient and let you keep the bits to parse the table in userland (and not require root if we allow read-only access to mortals on /dev/foo). -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 17 18:20:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E4E5C1605D; Mon, 17 Oct 2016 18:20:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E18412EC; Mon, 17 Oct 2016 18:20:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id E1D6810AF91; Mon, 17 Oct 2016 14:20:04 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307386 - in head: etc/mtree include sys/sys sys/sys/disk Date: Mon, 17 Oct 2016 10:28:44 -0700 Message-ID: <3498461.uNz0HOhrYy@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201610160243.u9G2hpJE050577@repo.freebsd.org> References: <201610160243.u9G2hpJE050577@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 17 Oct 2016 14:20:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 18:20:06 -0000 On Sunday, October 16, 2016 02:43:51 AM Marcel Moolenaar wrote: > Author: marcel > Date: Sun Oct 16 02:43:51 2016 > New Revision: 307386 > URL: https://svnweb.freebsd.org/changeset/base/307386 > > Log: > Re-apply change 306811 or alternatively, revert change 307385. Thanks! -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 17 18:20:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEDBAC1606E; Mon, 17 Oct 2016 18:20:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DAC812F6; Mon, 17 Oct 2016 18:20:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id A8F6C10AF92; Mon, 17 Oct 2016 14:20:06 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307518 - in head/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/samsung/exynos arm/ti/am335x arm/ti/usb arm/xilinx boot/kshim dev/bhnd/cores/usb dev/puc dev/usb dev/usb/controller ... Date: Mon, 17 Oct 2016 10:27:21 -0700 Message-ID: <1894111.JRI62yHUp5@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201610171020.u9HAKdWO076718@repo.freebsd.org> References: <201610171020.u9HAKdWO076718@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 17 Oct 2016 14:20:06 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 18:20:07 -0000 On Monday, October 17, 2016 10:20:39 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Oct 17 10:20:38 2016 > New Revision: 307518 > URL: https://svnweb.freebsd.org/changeset/base/307518 > > Log: > Fix device delete child function. > > When detaching device trees parent devices must be detached prior to > detaching its children. This is because parent devices can have > pointers to the child devices in their softcs which are not > invalidated by device_delete_child(). This can cause use after free > issues and panic(). > > Device drivers implementing trees, must ensure its detach function > detaches or deletes all its children before returning. > > While at it remove now redundant device_detach() calls before > device_delete_child() and device_delete_children(), mostly in > the USB controller drivers. > > Tested by: Jan Henrik Sylvester > Reviewed by: jhb > Differential Revision: https://reviews.freebsd.org/D8070 > MFC after: 2 weeks Thanks. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 17 20:23:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C94EEC15021; Mon, 17 Oct 2016 20:23:07 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.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 98E13901; Mon, 17 Oct 2016 20:23:07 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 408CD2083F; Mon, 17 Oct 2016 16:23:06 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 17 Oct 2016 16:23:06 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=e8UDR1Do4Tx6r06Qe59GbfGRVE8=; b=BPOz0A vBuMrzqbUTM+tsR7jzOFdMNXty9AKFH1LhXYH0SOyDdN+AseciWvPcy4I9cF21Ul M1ZBg57Z1/tC5n9ByQREopvgVzVXWypI1w1BS/VDN+tM3BTRYp3ye8o3F/Q37jIc b4JuSRkzpeMGtiEZGfIA2Hq4EtU3MsrtaAfj8= DKIM-Signature: v=1; a=rsa-sha1; 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-sasl-enc:x-sasl-enc; s=smtpout; bh=e8UDR1Do4Tx6r06 Qe59GbfGRVE8=; b=ryooaBYgEkV1OERD4zXOFy2yV4j4LE7QPHAHvurUM/q8619 b3mbD9IWNbsRoi7rtM7yCb4KWziegiOjDewHch0+cUgJTfSNgK+MLiEKg/1bgdrL HVvWq5Q+p3cH+pyrwItyg0VccS5YAwu6qXaBNTA0Q0aR9X94cBgrTIWZYDHc= X-Sasl-enc: 2MylpfjoJTjB9N0Nt2NClOAGc1deJ2D+s8ExK0/yYMk1 1476735785 Received: from [192.168.1.88] (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 24E85F29C9; Mon, 17 Oct 2016 16:23:05 -0400 (EDT) Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader To: John Baldwin , Warner Losh References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014175542.GB65545@ambrisko.com> <1950201.IjTl3rpdGP@ralph.baldwin.cx> Cc: Doug Ambrisko , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Doug Ambrisko , Ravi Pokala From: Bruce Simpson Message-ID: <2397b12d-ddd7-8fde-9575-44dd825d6f60@fastmail.net> Date: Mon, 17 Oct 2016 21:23:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1950201.IjTl3rpdGP@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 20:23:07 -0000 On 17/10/16 18:40, John Baldwin wrote: > I'm a bit hesitant to do all the type parsing in the kernel vs userland. > However, I think having smbios(4) export a /dev/smbios that you can either > read() or mmap() to access the table would be very convenient and let you > keep the bits to parse the table in userland (and not require root if we > allow read-only access to mortals on /dev/foo). This is probably a bit left-field, but I'm wondering if both methods (expose-to-loader-kenv and user-space-accessible devfs node) can be re-used for things like the Linux-oriented kernel environment page exported by SYSLINUX/PXELINUX memdisk, which I've used with some success to boot FreeBSD installers in heterogeneous private cloud/lab setups. It exports this information using an ACPI-like table in that BIOS HBA type area in x86 address space, but the table is not DSDT linked (it's not produced by the BIOS). Having a coherent means of dealing with it would be very useful, as such FreeBSD installers (which I've deployed as mfsBSD images) can then basically re-use what's been done for EFI variables for those legacy systems which don't support/can't use EFI network boot. As yet, I've not tried this with 64-bit EFI systems. From owner-svn-src-head@freebsd.org Mon Oct 17 20:26:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C8DCC152DB; Mon, 17 Oct 2016 20:26:57 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.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 5E9D2C37; Mon, 17 Oct 2016 20:26:57 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 3172420286; Mon, 17 Oct 2016 16:26:56 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 17 Oct 2016 16:26:56 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=5XwgTk9HpArVTCdbaMkjFOUer9s=; b=JGS1yc rol4jFCg1ZIEHgVGVKA0d696KeF9N4xeA6QcqS2jOOKzxpJXIGrzTYbHqAwbcfxa FeBQ37GOSENUDEPvgDBPA7VXZj8C+dvzAVjLTmAh41FzOKt1H8C2JSqYR9klmDtD 03C5dbvyw3TLo+H2Ju3bskuzuh647Dm6cOl1U= DKIM-Signature: v=1; a=rsa-sha1; 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-sasl-enc:x-sasl-enc; s=smtpout; bh=5XwgTk9HpArVTCd baMkjFOUer9s=; b=h2JmrQmlu0QwZNmgEYEytSDz72MJTxMHOU4MRGNAeUij9qV +wnF0u8R8CV6bfZbCjL0VWlRL3mP6nmFMmp2iNpZ7h3BUleWkts+wJMHcNkbhUUp 68Jc4ORrT1+vUmuId8MPeuGY6456VqhxRMCz8sPDqaL1k6Tas0TkndQEuCEA= X-Sasl-enc: JuuIK7u2wbkhVjNaRwxUe8EQdsuQdmuBHkuz8LXftdkW 1476736015 Received: from [192.168.1.88] (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D3E8F29C9; Mon, 17 Oct 2016 16:26:55 -0400 (EDT) Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader To: John Baldwin , Warner Losh References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014175542.GB65545@ambrisko.com> <1950201.IjTl3rpdGP@ralph.baldwin.cx> <2397b12d-ddd7-8fde-9575-44dd825d6f60@fastmail.net> Cc: Doug Ambrisko , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Doug Ambrisko , Ravi Pokala From: Bruce Simpson Message-ID: Date: Mon, 17 Oct 2016 21:26:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <2397b12d-ddd7-8fde-9575-44dd825d6f60@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 20:26:57 -0000 On 17/10/16 21:23, Bruce Simpson wrote: > On 17/10/16 18:40, John Baldwin wrote: >> I'm a bit hesitant to do all the type parsing in the kernel vs userland. >> However, I think having smbios(4) export a /dev/smbios that you can >> either >> read() or mmap() to access the table would be very convenient and let you >> keep the bits to parse the table in userland (and not require root if we >> allow read-only access to mortals on /dev/foo). > > This is probably a bit left-field, but I'm wondering if both methods > (expose-to-loader-kenv and user-space-accessible devfs node) can be > re-used for things like the Linux-oriented kernel environment page > exported by SYSLINUX/PXELINUX memdisk, which I've used with some success > to boot FreeBSD installers in heterogeneous private cloud/lab setups. PS Hit send too soon -- the main reason a FreeBSD installer, or image wrapper for a FreeBSD installer tool (akin to the Debian style of network driven installer), would need access to the memdisk's ACPI-style table (containing boot & textual 'environment' page, filled out by the TFTP boot server, perhaps by scripted means) is... ...where it can't intuit all system configuration settings by reference to its primary MAC address alone, or where it needs network bootstrap information to proceed with other provisioning methods (straight to Puppet/Ansible, and/or fetching a list of pkgng pkgs to grab from some trusted package server). The code required would just pretty much resemble what you guys are doing for EFI right now, but for BIOS-era systems (of which we've got a large installed base, and mass provisioning those would be great, for the sake of recycling.) From owner-svn-src-head@freebsd.org Mon Oct 17 20:38:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 556D5C15592; Mon, 17 Oct 2016 20:38:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0CEE320E; Mon, 17 Oct 2016 20:38:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9HKcPuk015455; Mon, 17 Oct 2016 20:38:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HKcOxs015446; Mon, 17 Oct 2016 20:38:24 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201610172038.u9HKcOxs015446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 17 Oct 2016 20:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307529 - in head: . etc etc/devd share/doc/legal/realtek share/man/man4 sys/conf sys/contrib/dev/rtwn sys/contrib/dev/urtwn sys/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8188e sys/dev/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 20:38:26 -0000 Author: avos Date: Mon Oct 17 20:38:24 2016 New Revision: 307529 URL: https://svnweb.freebsd.org/changeset/base/307529 Log: rtwn(4), urtwn(4): merge common code, add support for 11ac devices. All devices: - add support for rate adaptation via ieee80211_amrr(9); - use short preamble for transmitted frames when needed; - multi-bss support: * for RTL8821AU: 2 VAPs at the same time; * other: 1 any VAP + 1 sta VAP. RTL8188CE: - fix IQ calibration bug (reason of significant speed degradation); - add h/w crypto acceleration support. USB: - A-MPDU Tx support; - short GI support; Other: - add support for RTL8812AU / RTL8821AU chipsets (a/b/g/n only; no ac yet); - split merged code into subparts: * bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*) * common (if_rtwn*) * chip-specific (rtl*/*) - various other bugfixes. Due to code reorganization, module names / requirements were changed too: urtwn urtwnfw -> rtwn rtwn_usb rtwnfw rtwn rtwnfw -> rtwn rtwn_pci rtwnfw Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU. Tested by: kevlo, garga, Peter Garshtja , Kevin McAleavey , Ilias-Dimitrios Vrachnis , Relnotes: yes Added: head/share/man/man4/rtwn_pci.4 (contents, props changed) head/share/man/man4/rtwn_usb.4 (contents, props changed) head/sys/contrib/dev/rtwn/rtwn-rtl8188eufw.fw.uu - copied, changed from r307528, head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu head/sys/contrib/dev/rtwn/rtwn-rtl8192cfwE.fw.uu head/sys/contrib/dev/rtwn/rtwn-rtl8192cfwE_B.fw.uu - copied, changed from r307528, head/sys/contrib/dev/rtwn/rtwn-rtl8192cfwU_B.fw.uu head/sys/contrib/dev/rtwn/rtwn-rtl8192cfwT.fw.uu head/sys/contrib/dev/rtwn/rtwn-rtl8812aufw.fw.uu head/sys/contrib/dev/rtwn/rtwn-rtl8821aufw.fw.uu head/sys/dev/rtwn/if_rtwn_beacon.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_beacon.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_calib.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_calib.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_cam.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_cam.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_debug.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_efuse.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_efuse.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_fw.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_fw.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_nop.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_ridx.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_rx.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_rx.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_task.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_task.h (contents, props changed) head/sys/dev/rtwn/if_rtwn_tx.c (contents, props changed) head/sys/dev/rtwn/if_rtwn_tx.h (contents, props changed) head/sys/dev/rtwn/if_rtwnvar.h (contents, props changed) head/sys/dev/rtwn/pci/ head/sys/dev/rtwn/pci/rtwn_pci_attach.c (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_attach.h (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_reg.c (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_reg.h (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_rx.c (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_rx.h (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_tx.c (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_tx.h (contents, props changed) head/sys/dev/rtwn/pci/rtwn_pci_var.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/ head/sys/dev/rtwn/rtl8188e/r88e.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_beacon.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_calib.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_chan.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_fw.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_fw_cmd.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_init.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_led.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_priv.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_rf.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_rom.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_rom_defs.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_rom_image.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_rx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_tx.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/r88e_tx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/usb/ head/sys/dev/rtwn/rtl8188e/usb/r88eu.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/usb/r88eu_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/usb/r88eu_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/ head/sys/dev/rtwn/rtl8192c/pci/ head/sys/dev/rtwn/rtl8192c/pci/r92ce.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_init.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_led.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_priv.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_tx.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/pci/r92ce_tx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_beacon.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_calib.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_chan.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_fw.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_fw_cmd.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_init.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_priv.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_rf.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_rom.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_rom_defs.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_rom_image.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_tx.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/r92c_var.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/ head/sys/dev/rtwn/rtl8192c/usb/r92cu.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_led.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_priv.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_tx.c (contents, props changed) head/sys/dev/rtwn/rtl8192c/usb/r92cu_tx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/ head/sys/dev/rtwn/rtl8812a/r12a.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_beacon.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_calib.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_caps.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_chan.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_fw.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_fw_cmd.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_init.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_led.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_priv.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_rf.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_rom.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_rom_defs.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_rom_image.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_tx.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_tx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/r12a_var.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/usb/ head/sys/dev/rtwn/rtl8812a/usb/r12au.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/usb/r12au_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8812a/usb/r12au_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/usb/r12au_tx.c (contents, props changed) head/sys/dev/rtwn/rtl8812a/usb/r12au_tx_desc.h (contents, props changed) head/sys/dev/rtwn/rtl8821a/ head/sys/dev/rtwn/rtl8821a/r21a.h (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_beacon.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_calib.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_chan.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_fw.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_init.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_led.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_priv.h (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_rom.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/r21a_rx.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/usb/ head/sys/dev/rtwn/rtl8821a/usb/r21au.h (contents, props changed) head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/usb/r21au_init.c (contents, props changed) head/sys/dev/rtwn/rtl8821a/usb/r21au_reg.h (contents, props changed) head/sys/dev/rtwn/usb/ head/sys/dev/rtwn/usb/rtwn_usb_attach.c (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_attach.h (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_ep.c (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_ep.h (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_reg.c (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_reg.h (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_rx.c (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_rx.h (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_tx.c (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_tx.h (contents, props changed) head/sys/dev/rtwn/usb/rtwn_usb_var.h (contents, props changed) head/sys/modules/rtwn_pci/ head/sys/modules/rtwn_pci/Makefile (contents, props changed) head/sys/modules/rtwn_usb/ head/sys/modules/rtwn_usb/Makefile (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8188eu/ head/sys/modules/rtwnfw/rtwnrtl8188eu/Makefile (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8192cE/ head/sys/modules/rtwnfw/rtwnrtl8192cE/Makefile (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8192cEB/ head/sys/modules/rtwnfw/rtwnrtl8192cEB/Makefile (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8192cT/ head/sys/modules/rtwnfw/rtwnrtl8192cT/Makefile (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8812au/ head/sys/modules/rtwnfw/rtwnrtl8812au/Makefile (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8821au/ head/sys/modules/rtwnfw/rtwnrtl8821au/Makefile (contents, props changed) Deleted: head/share/man/man4/urtwn.4 head/share/man/man4/urtwnfw.4 head/sys/contrib/dev/rtwn/rtwn-rtl8192cfwU_B.fw.uu head/sys/contrib/dev/urtwn/ head/sys/dev/urtwn/ head/sys/modules/rtwnfw/rtwnrtl8192cUB/ head/sys/modules/urtwn/ head/sys/modules/urtwnfw/ Modified: head/ObsoleteFiles.inc head/etc/devd.conf head/etc/devd/usb.conf head/share/doc/legal/realtek/Makefile head/share/man/man4/Makefile head/share/man/man4/rtwn.4 head/share/man/man4/rtwnfw.4 head/share/man/man4/wlan.4 head/sys/conf/WITHOUT_SOURCELESS_UCODE head/sys/conf/files head/sys/conf/options head/sys/contrib/dev/rtwn/LICENSE head/sys/contrib/dev/rtwn/rtwn-rtl8192cfwU.fw.uu head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwnreg.h head/sys/mips/conf/std.AR933X head/sys/mips/conf/std.AR934X head/sys/mips/conf/std.QCA955X head/sys/modules/Makefile head/sys/modules/rtwn/Makefile head/sys/modules/rtwnfw/Makefile head/sys/modules/rtwnfw/Makefile.inc head/sys/riscv/conf/GENERIC head/sys/sys/param.h head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 17 19:51:00 2016 (r307528) +++ head/ObsoleteFiles.inc Mon Oct 17 20:38:24 2016 (r307529) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20161016: urtwn(4) was merged into rtwn(4) +OLD_FILES+=usr/share/man/man4/urtwn.4.gz +OLD_FILES+=usr/share/man/man4/urtwnfw.4.gz # 20161015: Remove GNU rcs OLD_FILES+=usr/bin/ci OLD_FILES+=usr/bin/co Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Mon Oct 17 19:51:00 2016 (r307528) +++ head/etc/devd.conf Mon Oct 17 20:38:24 2016 (r307529) @@ -24,7 +24,7 @@ options { [0-9]+"; set wifi-driver-regex "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|\ - upgt|ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; + upgt|ural|urtw|rtwn_usb|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Mon Oct 17 19:51:00 2016 (r307528) +++ head/etc/devd/usb.conf Mon Oct 17 20:38:24 2016 (r307529) @@ -185,6 +185,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0409"; + match "product" "0x0408"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; match "product" "(0x8024|0x8025)"; action "kldload -n uipaq"; }; @@ -304,6 +312,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0242|0x025d)"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0413"; match "product" "0x2101"; action "kldload -n uplcom"; @@ -553,6 +569,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04bb"; + match "product" "0x0952"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; match "product" "(0x0a03|0x0a0e)"; action "kldload -n uplcom"; }; @@ -682,7 +706,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x04f2"; match "product" "(0xaff7|0xaff8|0xaff9|0xaffa|0xaffa)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -754,7 +778,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "0x1102"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -778,7 +802,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x050d"; match "product" "(0x2102|0x2103)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -1050,7 +1074,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x056e"; match "product" "0x4008"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -1146,7 +1170,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0586"; match "product" "0x341f"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -1160,6 +1184,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0586"; + match "product" "0x3426"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x058f"; match "product" "0x9720"; action "kldload -n uplcom"; @@ -1442,7 +1474,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x06f8"; match "product" "0xe033"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -1658,7 +1690,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x07aa"; match "product" "0x0056"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -1722,7 +1754,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x07b8"; match "product" "(0x8178|0x8179|0x8188|0x8189)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2026,7 +2058,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0846"; match "product" "0x9021"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2041,8 +2073,8 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0846"; - match "product" "0x9041"; - action "kldload -n if_urtwn"; + match "product" "(0x9041|0x9052)"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2498,7 +2530,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0b05"; match "product" "0x17ab"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2522,7 +2554,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0b05"; match "product" "0x17ba"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2537,6 +2569,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b05"; + match "product" "0x17d2"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; match "product" "(0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; action "kldload -n uipaq"; }; @@ -2658,7 +2698,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0bda"; match "product" "(0x0179|0x018a|0x317f)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2682,7 +2722,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0bda"; match "product" "0x8170"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2698,7 +2738,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0bda"; match "product" "(0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2714,7 +2754,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0bda"; match "product" "(0x818a|0x8191)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -2738,7 +2778,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0bda"; match "product" "0x8754"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -3162,7 +3202,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0df6"; match "product" "0x0052"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -3178,7 +3218,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0df6"; match "product" "(0x005c|0x0061)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -3193,6 +3233,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0df6"; + match "product" "0x0074"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; match "product" "0x061c"; action "kldload -n if_axe"; }; @@ -3257,8 +3305,8 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0e66"; - match "product" "0x0019"; - action "kldload -n if_urtwn"; + match "product" "(0x0019|0x0023)"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -3330,7 +3378,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x0eb0"; match "product" "0x9071"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -3490,7 +3538,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x103c"; match "product" "0x1629"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -3976,6 +4024,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "0x003f"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x13d2"; match "product" "0x0400"; action "kldload -n if_kue"; @@ -4018,7 +4074,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x13d3"; match "product" "(0x3357|0x3358|0x3359)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -4569,6 +4625,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1740"; + match "product" "0x0100"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1740"; match "product" "(0x0605|0x0615)"; action "kldload -n if_run"; }; @@ -4961,8 +5025,8 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d|0x330f|0x3310)"; - action "kldload -n if_urtwn"; + match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d|0x330f|0x3310|0x3314|0x3315|0x3316|0x3318)"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5042,7 +5106,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x2019"; match "product" "(0x1201|0x4902)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5089,8 +5153,8 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2019"; - match "product" "(0xab2a|0xab2b|0xab2e)"; - action "kldload -n if_urtwn"; + match "product" "(0xab2a|0xab2b|0xab2e|0xab30)"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5130,7 +5194,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x2019"; match "product" "0xed17"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5170,7 +5234,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x20f4"; match "product" "0x624d"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5185,8 +5249,8 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x20f4"; - match "product" "0x648b"; - action "kldload -n if_urtwn"; + match "product" "(0x648b|0x805b)"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5232,6 +5296,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2357"; + match "product" "0x0101"; + action "kldload -n if_rtwn_usb"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2405"; match "product" "0x0003"; action "kldload -n uslcom"; @@ -5354,7 +5426,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x4855"; match "product" "(0x0090|0x0091)"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5465,8 +5537,8 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x7392"; - match "product" "(0x7811|0x7822)"; - action "kldload -n if_urtwn"; + match "product" "(0x7811|0x7822|0xa811|0xa812|0xa822)"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5522,7 +5594,7 @@ nomatch 32 { match "mode" "host"; match "vendor" "0x9846"; match "product" "0x9041"; - action "kldload -n if_urtwn"; + action "kldload -n if_rtwn_usb"; }; nomatch 32 { @@ -5817,5 +5889,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2722 USB entries processed +# 2743 USB entries processed Modified: head/share/doc/legal/realtek/Makefile ============================================================================== --- head/share/doc/legal/realtek/Makefile Mon Oct 17 19:51:00 2016 (r307528) +++ head/share/doc/legal/realtek/Makefile Mon Oct 17 20:38:24 2016 (r307529) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= ${.CURDIR}/../../../../sys/contrib/dev/urtwn/LICENSE +FILES= ${.CURDIR}/../../../../sys/contrib/dev/rtwn/LICENSE FILESDIR= ${SHAREDIR}/doc/legal FILESNAME= realtek.LICENSE Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 17 19:51:00 2016 (r307528) +++ head/share/man/man4/Makefile Mon Oct 17 20:38:24 2016 (r307529) @@ -433,6 +433,7 @@ MAN= aac.4 \ rp.4 \ rtwn.4 \ rtwnfw.4 \ + rtwn_pci.4 \ rue.4 \ rum.4 \ run.4 \ @@ -692,6 +693,8 @@ MLINKS+=pms.4 pmspcv.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 +MLINKS+=rtwn.4 if_rtwn.4 +MLINKS+=rtwn_pci.4 if_rtwn_pci.4 MLINKS+=rue.4 if_rue.4 MLINKS+=rum.4 if_rum.4 MLINKS+=run.4 if_run.4 @@ -886,6 +889,7 @@ MAN+= \ otusfw.4 \ rsu.4 \ rsufw.4 \ + rtwn_usb.4 \ u3g.4 \ uark.4 \ uart.4 \ @@ -928,8 +932,6 @@ MAN+= \ urio.4 \ urndis.4 \ ${_urtw.4} \ - urtwn.4 \ - urtwnfw.4 \ usb.4 \ usb_quirk.4 \ usb_template.4 \ @@ -941,6 +943,7 @@ MAN+= \ MLINKS+=otus.4 if_otus.4 MLINKS+=rsu.4 if_rsu.4 +MLINKS+=rtwn_usb.4 if_rtwn_usb.4 MLINKS+=u3g.4 u3gstub.4 MLINKS+=uath.4 if_uath.4 MLINKS+=udav.4 if_udav.4 @@ -948,7 +951,6 @@ MLINKS+=upgt.4 if_upgt.4 MLINKS+=ural.4 if_ural.4 MLINKS+=urndis.4 if_urndis.4 MLINKS+=${_urtw.4} ${_if_urtw.4} -MLINKS+=urtwn.4 if_urtwn.4 .endif .include Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Mon Oct 17 19:51:00 2016 (r307528) +++ head/share/man/man4/rtwn.4 Mon Oct 17 20:38:24 2016 (r307529) @@ -2,6 +2,7 @@ .\" .\" Copyright (c) 2010 Damien Bergamini .\" Copyright (c) 2015 Stefan Sperling +.\" Copyright (c) 2016 Andriy Voskoboinyk .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -17,89 +18,88 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2015 +.Dd September 19, 2016 .Dt RTWN 4 .Os .Sh NAME .Nm rtwn -.Nd Realtek RTL8188CE PCIe IEEE 802.11b/g/n wireless network device +.Nd Realtek IEEE 802.11 wireless network driver .Sh SYNOPSIS +.Cd "options RTWN_DEBUG" +.Cd "options RTWN_WITHOUT_UCODE" +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device rtwn" .Cd "device rtwnfw" +.Cd "device rtwn_usb" +.Cd "device rtwn_pci" .Cd "device wlan" .Cd "device firmware" .Ed .Pp Alternatively, to load the driver as a -module at boot time, place the following line in +module at boot time, place following lines in .Xr loader.conf 5 : .Bd -literal -offset indent if_rtwn_load="YES" -.Ed -.Pp -After you have read the license in -.Pa /usr/share/doc/legal/realtek.LICENSE -you will want to add the following lines to -.Xr loader.conf 5 : -.Bd -literal -offset indent -legal.realtek.license_ack=1 -rtwn-rtl8192cfwU_load="YES" -rtwn-rtl8192cfwU_B_load="YES" +if_rtwn_pci_load="YES" +if_rtwn_usb_load="YES" .Ed .Sh DESCRIPTION The .Nm -driver supports PCIe wireless network devices based on the Realtek -RTL8188CE chipset. +driver provides support for wireless network devices based on +the Realtek RTL8192C, RTL8188E, RTL8812A and RTL8821A programming APIs. +These APIs are used by a wide variety of chips; most chips with USB +and some with PCI interface are supported. +.Pp +To enable use for PCI/PCIe systems, see the rtwn_pci(4) driver; +for USB devices, use the rtwn_usb(4) driver. +.Pp +The driver supports +.Cm station , +.Cm adhoc , +.Cm hostap +and +.Cm monitor +mode operation. +There are no limitations for number of +.Cm monitor +mode +virtual interfaces; in addition to any other virtual interface +one +.Cm station +interface can be added (Note: RTL8821AU supports two non-monitor +mode interfaces at the same time). .Pp -The RTL8188CE is a highly integrated 802.11n adapter that combines a MAC, -a 1T1R capable baseband and an RF in a single chip. -It operates in the 2GHz spectrum only. -.Pp -These are the modes the -.Nm -driver can operate in: -.Bl -tag -width "IBSS-masterXX" -.It BSS mode -Also known as -.Em infrastructure -mode, this is used when associating with an access point, through -which all traffic passes. -This mode is the default. -.It monitor mode -In this mode the driver is able to receive packets without -associating with an access point. -This disables the internal receive filter and enables the card to -capture packets from networks which it wouldn't normally have access to, -or to scan for access points. -.El -.Pp -The -.Nm -driver can be configured to use -Wired Equivalent Privacy (WEP) or -Wi-Fi Protected Access (WPA-PSK and WPA2-PSK). -WPA is the current encryption standard for wireless networks. -It is strongly recommended that WEP -not be used as the sole mechanism -to secure wireless communication, -due to serious weaknesses in it. +All chips have hardware support for WEP, AES-CCM and TKIP encryption. .Pp The .Nm driver can be configured at runtime with .Xr ifconfig 8 . .Sh FILES -The driver needs at least version 1.0 of the following firmware files, -which are loaded when an interface is brought up: +.Bl -tag -width ".Pa /usr/share/doc/legal/realtek.LICENSE" -compact +.It Pa /usr/share/doc/legal/realtek.LICENSE +.Nm +firmware license +.El .Pp +The driver (if not compiled with +.Cd options RTWN_WITHOUT_UCODE +) may use following firmware files, which are loaded +when an interface is brought up: .Bl -tag -width Ds -offset indent -compact +.It Pa /boot/kernel/rtwn-rtl8188eufw.ko +.It Pa /boot/kernel/rtwn-rtl8192cfwE_B.ko +.It Pa /boot/kernel/rtwn-rtl8192cfwE.ko +.It Pa /boot/kernel/rtwn-rtl8192cfwT.ko .It Pa /boot/kernel/rtwn-rtl8192cfwU.ko -.It Pa /boot/kernel/rtwn-rtl8192cfwU_B.ko +.It Pa /boot/kernel/rtwn-rtl8812aufw.ko +.It Pa /boot/kernel/rtwn-rtl8821aufw.ko .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): @@ -118,48 +118,124 @@ Join a specific BSS network with 64-bit ifconfig wlan create wlandev rtwn0 ssid my_net \e wepmode on wepkey 0x1234567890 weptxkey 1 up .Ed +.Pp +Create an IBSS network with 128-bit WEP encryption on the channel 4: +.Bd -literal -offset indent +ifconfig wlan create wlandev rtwn0 wlanmode adhoc ssid my_net \e + wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 \e + channel 4 +.Ed +.Pp +Join/create an 802.11b IBSS network with network name +.Dq Li my_net : +.Bd -literal -offset indent +ifconfig wlan0 create wlandev rtwn0 wlanmode adhoc +ifconfig wlan0 inet 192.168.0.22 netmask 0xffffff00 ssid my_net \e + mode 11b +.Ed +.Pp +Create a host-based access point: +.Bd -literal -offset indent +ifconfig wlan0 create wlandev rtwn0 wlanmode hostap +ifconfig wlan0 inet 192.168.0.10 netmask 0xffffff00 ssid my_ap +.Ed +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va dev.rtwn.%d.hwcrypto +This tunable controls how key slots are assigned: +.br +0 - disable h/w crypto support. Features that require access +to frame contents (e.g., TCP/UDP/IP Rx checksum validation) +will not work; +.br +1 - use h/w crypto support for pairwise keys only; +.br +2 - use h/w crypto support for all keys; may not work for +multi-vap configurations. +.br +By default it is set to 1. +.It Va dev.rtwn.%d.ratectl +This tunable switches between rate control implementations: +.br +0 - no rate control; +.br +1 - driver sends 'tx complete' reports to net80211; algorithm +is controlled via net80211; +.br +2 - firmware-based rate control. +.br +By default it is set to 1; however driver may choose another +algorithm in case if it is not implemented +.br +Currently selected algorithm is reported via +.Em Va dev.rtwn.%d.ratectl_selected +read-only OID. +.El .Sh DIAGNOSTICS .Bl -diag -.It "could not read firmware %s" +.It "rtwn%d: could not read efuse byte at address 0x%x" +.It "rtwn%d: %s: cannot read rom, error %d" +There was an error while reading ROM; device attach will be aborted. +This should not happen. +.It "rtwn%d: failed loadfirmware of file %s" For some reason, the driver was unable to read the microcode file from the filesystem. The file might be missing or corrupted. -.It "device timeout" +The driver will disable firmware-dependent features. +.It "rtwn%d: wrong firmware size (%zu)" +.It "rtwn%d: %s: failed to upload firmware %s (error %d)" +.It "rtwn%d: timeout waiting for firmware readiness" +Firmware upload failed; the file might be corrupted. +The driver will disable firmware-dependent features. +This should not happen. +.It "rtwn%d: device timeout" A frame dispatched to the hardware for transmission did not complete in time. The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO -.Xr pci 4 , +.Xr intro 4 , +.Xr netintro 4 , +.Xr rtwn_pci 4 , +.Xr rtwn_usb 4 , .Xr rtwnfw 4 , .Xr wlan 4 , +.Xr wlan_amrr 4 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 , +.Xr wlan_xauth 4 , +.Xr hostapd 4 , .Xr ifconfig 8 , .Xr wpa_supplicant 8 .Sh HISTORY The +.Cm urtwn +driver first appeared in +.Ox 4.9 +and +.Fx 10.0 ; +the .Nm driver first appeared in .Ox 5.8 . .Sh AUTHORS The .Nm -driver was written by +driver was initially written by .An -nosplit .An Stefan Sperling Aq Mt stsp@openbsd.org and ported by .An Kevin Lo Aq Mt kevlo@freebsd.org . It was based on the -.Xr urtwn 4 +.Cm urtwn driver written by .An Damien Bergamini Aq Mt damien.bergamini@free.fr . -.Sh CAVEATS +.Sh BUGS The .Nm -driver does not support any of the 802.11n capabilities offered by the -adapters. -Additional work is required in -.Xr ieee80211 9 -before those features can be supported. +driver currently does not implement firmware-based rate control. Added: head/share/man/man4/rtwn_pci.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rtwn_pci.4 Mon Oct 17 20:38:24 2016 (r307529) @@ -0,0 +1,63 @@ +.\"- +.\" Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd +.\" Copyright (c) 2016 Andriy Voskoboinyk +.\" 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, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +.\" redistribution must be conditioned upon including a substantially +.\" similar Disclaimer requirement for further binary redistribution. +.\" +.\" NO WARRANTY +.\" 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 NONINFRINGEMENT, MERCHANTIBILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +.\" +.\" $FreeBSD$ +.\"/ +.Dd September 19, 2016 +.Dt RTWN_PCI 4 +.Os +.Sh NAME +.Nm rtwn_pci +.Nd "Realtek PCI device glue" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device rtwn_pci" +.Cd "device pci" +.Cd "device wlan" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports PCIe wireless network devices based on the Realtek +RTL8188CE chipset. +.Pp +The RTL8188CE is a highly integrated 802.11n adapter that combines a MAC, +a 1T1R capable baseband and an RF in a single chip. +It operates in the 2GHz spectrum only. +.Sh SEE ALSO +.Xr rtwn 4 , +.Xr rtwnfw 4 , +.Xr rtwn_usb 4 , +.Xr pci 4 +.Sh CAVEATS +Most 802.11 capabilities were turned off; some more testing +is required to re-enable them. Added: head/share/man/man4/rtwn_usb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rtwn_usb.4 Mon Oct 17 20:38:24 2016 (r307529) @@ -0,0 +1,111 @@ +.\"- +.\" Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd +.\" Copyright (c) 2016 Andriy Voskoboinyk +.\" 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, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +.\" redistribution must be conditioned upon including a substantially +.\" similar Disclaimer requirement for further binary redistribution. +.\" +.\" NO WARRANTY +.\" 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 NONINFRINGEMENT, MERCHANTIBILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +.\" +.\" $FreeBSD$ +.\"/ +.Dd September 19, 2016 +.Dt RTWN_USB 4 +.Os +.Sh NAME +.Nm rtwn_usb +.Nd "Realtek USB device glue" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device xhci" +.Cd "device ehci" +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device rtwn_usb" +.Cd "device wlan" +.Ed +.Sh DESCRIPTION +This module provides the USB bus glue needed for the devices supported +by the +.Xr rtwn 4 +driver. +.Sh HARDWARE +The +.Nm +driver supports Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU/RTL8812AU/RTL8821AU +based USB wireless network adapters, including: +.Pp +.Bl -column -compact "Belkin F7D1102 Surf Wireless Micro" "Bus" +.It Em Card Ta Em Bus +.It "Alfa AWUS036NHR v2" Ta USB 2.0 +.It "ASUS USB-AC56" Ta USB 3.0 +.It "ASUS USB-N10 NANO" Ta USB 2.0 +.It "Belkin F7D1102 Surf Wireless Micro" Ta USB 2.0 +.It "Buffalo WI-U2-433DM" Ta USB 2.0 +.It "Buffalo WI-U3-866D" Ta USB 3.0 +.It "D-Link DWA-123 rev D1" Ta USB 2.0 +.It "D-Link DWA-125 rev D1" Ta USB 2.0 +.It "D-Link DWA-131" Ta USB 2.0 +.It "D-Link DWA-171 rev A1" Ta USB 2.0 +.It "D-Link DWA-172 rev A1" Ta USB 2.0 +.It "D-Link DWA-180 rev A1" Ta USB 2.0 +.It "D-Link DWA-182 rev C1" Ta USB 3.0 +.It "Edimax EW-7811Un" Ta USB 2.0 +.It "Edimax EW-7811UTC" Ta USB 2.0 +.It "Edimax EW-7822UAC" Ta USB 3.0 +.It "Elecom WDC-150SU2M" Ta USB 2.0 +.It "EnGenius EUB1200AC" Ta USB 3.0 +.It "Hawking HD65U" Ta USB 2.0 +.It "Hercules Wireless N USB Pico" Ta USB 2.0 +.It "I-O Data WN-AC867U" Ta USB 3.0 +.It "Linksys WUSB6300" Ta USB 3.0 +.It "NEC AtermWL900U PA-WL900U" Ta USB 3.0 +.It "Netgear A6100" Ta USB 2.0 +.It "Netgear WNA1000M" Ta USB 2.0 +.It "Planex GW-900D" Ta USB 3.0 +.It "Realtek RTL8192CU" Ta USB 2.0 +.It "Realtek RTL8188CUS" Ta USB 2.0 +.It "Sitecom WLA-7100" Ta USB 3.0 +.It "TP-Link Archer T4U" Ta USB 3.0 +.It "TP-LINK TL-WN723N v3" Ta USB 2.0 +.It "TP-LINK TL-WN725N v2" Ta USB 2.0 +.It "TRENDnet TEW-805UB" Ta USB 3.0 +.It "ZyXEL NWD6605" Ta USB 3.0 +.El +.Sh SEE ALSO +.Xr rtwn 4 , +.Xr rtwnfw 4 , +.Xr rtwn_pci 4 , +.Xr usb 4 +.Sh BUGS +The +.Nm +driver does not support any of the 802.11ac capabilities offered by the +adapters. +Additional work is required in +.Xr ieee80211 9 +before those features can be supported. Modified: head/share/man/man4/rtwnfw.4 ============================================================================== --- head/share/man/man4/rtwnfw.4 Mon Oct 17 19:51:00 2016 (r307528) +++ head/share/man/man4/rtwnfw.4 Mon Oct 17 20:38:24 2016 (r307529) @@ -1,4 +1,5 @@ .\" Copyright (c) 2015 Kevin Lo +.\" Copyright (c) 2016 Andriy Voskoboinyk .\" All rights reserved. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 17 20:57:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD20C15AEE; Mon, 17 Oct 2016 20:57:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D373FEB1; Mon, 17 Oct 2016 20:57:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9HKvsnq023328; Mon, 17 Oct 2016 20:57:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HKvsOs023327; Mon, 17 Oct 2016 20:57:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201610172057.u9HKvsOs023327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 17 Oct 2016 20:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307531 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 20:57:56 -0000 Author: np Date: Mon Oct 17 20:57:54 2016 New Revision: 307531 URL: https://svnweb.freebsd.org/changeset/base/307531 Log: cxgbe(4): Adjust whitespace to line up the column titles in cim_qcfg with the values displayed. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Oct 17 20:41:12 2016 (r307530) +++ head/sys/dev/cxgbe/t4_main.c Mon Oct 17 20:57:54 2016 (r307531) @@ -6156,7 +6156,8 @@ sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - sbuf_printf(sb, "Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); + sbuf_printf(sb, + " Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); for (i = 0; i < CIM_NUM_IBQ; i++, p += 4) sbuf_printf(sb, "\n%7s %5x %5u %5u %6x %4x %4u %4u %5u", From owner-svn-src-head@freebsd.org Mon Oct 17 21:35:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944D4C16313; Mon, 17 Oct 2016 21:35:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3F6F028B; Mon, 17 Oct 2016 21:35:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9HLZEF0037963; Mon, 17 Oct 2016 21:35:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HLZD9a037958; Mon, 17 Oct 2016 21:35:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201610172135.u9HLZD9a037958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 17 Oct 2016 21:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307532 - in head: . share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 21:35:15 -0000 Author: avos Date: Mon Oct 17 21:35:13 2016 New Revision: 307532 URL: https://svnweb.freebsd.org/changeset/base/307532 Log: Fix dates + add an UPDATING entry. Modified: head/ObsoleteFiles.inc head/UPDATING head/share/man/man4/rtwn.4 head/share/man/man4/rtwn_pci.4 head/share/man/man4/rtwn_usb.4 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 17 20:57:54 2016 (r307531) +++ head/ObsoleteFiles.inc Mon Oct 17 21:35:13 2016 (r307532) @@ -38,7 +38,7 @@ # xargs -n1 | sort | uniq -d; # done -# 20161016: urtwn(4) was merged into rtwn(4) +# 20161017: urtwn(4) was merged into rtwn(4) OLD_FILES+=usr/share/man/man4/urtwn.4.gz OLD_FILES+=usr/share/man/man4/urtwnfw.4.gz # 20161015: Remove GNU rcs Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 17 20:57:54 2016 (r307531) +++ head/UPDATING Mon Oct 17 21:35:13 2016 (r307532) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20161017: + The urtwn(4) driver was merged into rtwn(4) and now consists of + rtwn(4) main module + rtwn_usb(4) and rtwn_pci(4) bus-specific + parts. + Also, firmware for RTL8188CE was renamed due to possible name + conflict (rtwnrtl8192cU(B) -> rtwnrtl8192cE(B)) + 20161015: GNU rcs has been removed from base. It is available as packages: - rcs: Latest GPLv3 GNU rcs version. Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Mon Oct 17 20:57:54 2016 (r307531) +++ head/share/man/man4/rtwn.4 Mon Oct 17 21:35:13 2016 (r307532) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2016 +.Dd October 17, 2016 .Dt RTWN 4 .Os .Sh NAME Modified: head/share/man/man4/rtwn_pci.4 ============================================================================== --- head/share/man/man4/rtwn_pci.4 Mon Oct 17 20:57:54 2016 (r307531) +++ head/share/man/man4/rtwn_pci.4 Mon Oct 17 21:35:13 2016 (r307532) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd September 19, 2016 +.Dd October 17, 2016 .Dt RTWN_PCI 4 .Os .Sh NAME Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Mon Oct 17 20:57:54 2016 (r307531) +++ head/share/man/man4/rtwn_usb.4 Mon Oct 17 21:35:13 2016 (r307532) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd September 19, 2016 +.Dd October 17, 2016 .Dt RTWN_USB 4 .Os .Sh NAME From owner-svn-src-head@freebsd.org Mon Oct 17 22:07:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C6F5C16B4E; Mon, 17 Oct 2016 22:07:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F619C0B; Mon, 17 Oct 2016 22:07:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id C3B1F10AF7E; Mon, 17 Oct 2016 18:07:48 -0400 (EDT) From: John Baldwin To: Luigi Rizzo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap Date: Mon, 17 Oct 2016 15:07:40 -0700 Message-ID: <2315348.5F9GHXx3dh@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201610161413.u9GEDW91013522@repo.freebsd.org> References: <201610161413.u9GEDW91013522@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 17 Oct 2016 18:07:48 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 22:07:50 -0000 On Sunday, October 16, 2016 02:13:32 PM Luigi Rizzo wrote: > Author: luigi > Date: Sun Oct 16 14:13:32 2016 > New Revision: 307394 > URL: https://svnweb.freebsd.org/changeset/base/307394 > > Log: > Import the current version of netmap, aligned with the one on github. > > This commit, long overdue, contains contributions in the last 2 years > from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including: > + fixes on monitor ports > + the 'ptnet' virtual device driver, and ptnetmap backend, for > high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit) > + improved emulated netmap mode > + more robust error handling > + removal of stale code > + various fixes to code and documentation (some mixup between RX and TX > parameters, and private and public variables) > > We also include an additional tool, nmreplay, which is functionally > equivalent to tcpreplay but operating on netmap ports. FYI, this broke the build of the following kernel configs from 'make tinderbox': sparc64 LINT kernel failed, check _.sparc64.LINT for details i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details i386 LINT kernel failed, check _.i386.LINT for details pc98 LINT kernel failed, check _.pc98.LINT for details i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details i386 LINT-NOIP kernel failed, check _.i386.LINT-NOIP for details i386 LINT-VIMAGE kernel failed, check _.i386.LINT-VIMAGE for details amd64 LINT kernel failed, check _.amd64.LINT for details amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details powerpc LINT kernel failed, check _.powerpc.LINT for details powerpc LINT64 kernel failed, check _.powerpc.LINT64 for details amd64 LINT-NOINET6 kernel failed, check _.amd64.LINT-NOINET6 for details amd64 LINT-NOIP kernel failed, check _.amd64.LINT-NOIP for details amd64 LINT-VIMAGE kernel failed, check _.amd64.LINT-VIMAGE for details arm LINT kernel failed, check _.arm.LINT for details Some of the errors: (1) In file included from /zoo/jhb/git/freebsd/sys/modules/em/../../dev/e1000/if_lem .c:343: /zoo/jhb/git/freebsd/sys/dev/netmap/if_lem_netmap.h:42: warning: redundant redec laration of 'netmap_adaptive_io' [-Wredundant-decls] /zoo/jhb/git/freebsd/sys/dev/netmap/netmap_kern.h:1529: warning: previous declar (2) /zoo/jhb/git/freebsd/sys/dev/netmap/if_ptnet.c:347:15: error: shift count >= wid th of type [-Werror,-Wshift-count-overflow] (paddr >> 32) & 0xffffffff); ^ ~~ /zoo/jhb/git/freebsd/sys/sys/bus.h:882:59: note: expanded from macro 'bus_write_4' bus_space_write_4((r)->r_bustag, (r)->r_bushandle, (o), (v)) ^ For this one I think 'paddr' should be 'uint64_t' instead of 'vm_paddr_t' which should fix the build on 32-bit platforms. (3) /zoo/jhb/git/freebsd/sys/dev/netmap/netmap_pt.c:72:9: error: 'DEBUG' macro redefined [-Werror,-Wmacro-redefined] #define DEBUG /* Enables communication debugging. */ ^ ./opt_global.h:40:9: note: previous definition is here #define DEBUG 1 ^ (4) /zoo/jhb/git/freebsd/sys/dev/netmap/netmap_freebsd.c:671:4: error: format specif ies type 'unsigned long' but the argument has type 'vm_paddr_t' (aka 'unsigned i nt') [-Werror,-Wformat] *nm_paddr, ^~~~~~~~~ /zoo/jhb/git/freebsd/sys/dev/netmap/netmap_kern.h:249:29: note: expanded from ma cro 'D' __LINE__, __FUNCTION__, ##__VA_ARGS__); \ ^~~~~~~~~~~ /zoo/jhb/git/freebsd/sys/dev/netmap/netmap_freebsd.c:672:4: error: format specif ies type 'unsigned long' but the argument has type 'rman_res_t' (aka 'unsigned l ong long') [-Werror,-Wformat] rman_get_size(ptn_dev->pci_mem), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /zoo/jhb/git/freebsd/sys/dev/netmap/netmap_kern.h:249:29: note: expanded from ma cro 'D' __LINE__, __FUNCTION__, ##__VA_ARGS__); \ ^~~~~~~~~~~ -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 17 22:07:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D274FC16B5D; Mon, 17 Oct 2016 22:07:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBEBC10; Mon, 17 Oct 2016 22:07:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x242.google.com with SMTP id k64so4336902itb.0; Mon, 17 Oct 2016 15:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=k2CbkxkY6hS8sugzASnJnmkPEzTwHi4dNlvFAYjqXzA=; b=amEe/i3nSOw5GqWrmaQNHxH5VK2Yy528D1LbBE726nlQp69ZOjHwsMdijUrb0vPMOX DIgKu+nfbBULcYfnKvuEMvXYWXVGBQIw57J1T88mcvD6sAPwEK5zoaVuuFv2cfAZ41ri HiV8ZnCS7Z+RkeIr8WIOBcg9s3iPv3xCPNXm+0O8PujnYJa4Sv24kAMdHz8EmC+komrc 194Rfc0ogaJslsPWNt/y3QExoh8gzvJVfnGL7JAUXjHrWk61r0mNoWzL9woecXErVH2E NtXvlswFi0H0lBxPAk4Ku/mIidgxzNeqpy5N1MNcyUU29yxDqo2+5Kjin8OExe1G9OAF DvGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=k2CbkxkY6hS8sugzASnJnmkPEzTwHi4dNlvFAYjqXzA=; b=KlIbHC/LDkQQZgf32ToqnrXI+cZzwP57dO0Z1jgo13unUKLBVIjKhIPQ5muXk+VpN8 bq1N10JZgoLBV+Xn5qipPYrz/TqrCAusKYOerdamSucODiwPI1KyNY/0OdXgohPr4n2R 0J6jUPatmGrQfGn4b8zCAKmCbPaN3K3FNgvBiEKEg9Y0xSl0w231GwoihjR5uygxekH/ xEmmoPQxu6uZNDAi3WKQ6Lu6Z2DsH6PRgPYM6q/19lyP1FG5IGXVWONJwwPAInukT7Ak /NcxdLNaQ5EpilEcpgODWUvs7CBohhxTUB3SJGyoNIZ3phxgVJwk2JHlTfCQrSdnpOkD holg== X-Gm-Message-State: AA6/9RnWZVDu9bCk8FXb5nGaZm92v+aJuxXHxMFyBdX8tVgw2FuuAfzFFfZyw0kuOqyHMELYNXCLlg8w+/+nkA== X-Received: by 10.36.142.196 with SMTP id h187mr10565247ite.108.1476742071821; Mon, 17 Oct 2016 15:07:51 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.180.211 with HTTP; Mon, 17 Oct 2016 15:07:31 -0700 (PDT) In-Reply-To: <201610161413.u9GEDW91013522@repo.freebsd.org> References: <201610161413.u9GEDW91013522@repo.freebsd.org> From: Ed Maste Date: Mon, 17 Oct 2016 18:07:31 -0400 X-Google-Sender-Auth: 6CzI_4hZpBavNFFuDPO4XBnAduA Message-ID: Subject: Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap To: Luigi Rizzo Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 22:07:52 -0000 On 16 October 2016 at 10:13, Luigi Rizzo wrote: > Author: luigi > Date: Sun Oct 16 14:13:32 2016 > New Revision: 307394 > URL: https://svnweb.freebsd.org/changeset/base/307394 > > Log: > Import the current version of netmap, aligned with the one on github. my tinderbox build failed with this, in sparc64 LINT: In file included from /scratch/tmp/emaste/freebsd/sys/modules/em/../../dev/e1000/if_lem.c:343: /scratch/tmp/emaste/freebsd/sys/dev/netmap/if_lem_netmap.h:42: warning: redundant redeclaration of 'netmap_adaptive_io' [-Wredundant-decls] /scratch/tmp/emaste/freebsd/sys/dev/netmap/netmap_kern.h:1529: warning: previous declaration of 'netmap_adaptive_io' was here *** [if_lem.o] Error code 1 From owner-svn-src-head@freebsd.org Mon Oct 17 22:36:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5480AC15924; Mon, 17 Oct 2016 22:36:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id 23FA4787; Mon, 17 Oct 2016 22:36:38 +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 u9HMabNV061284; Mon, 17 Oct 2016 22:36:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HMab1k061283; Mon, 17 Oct 2016 22:36:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610172236.u9HMab1k061283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Oct 2016 22:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307537 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 22:36:38 -0000 Author: jhb Date: Mon Oct 17 22:36:37 2016 New Revision: 307537 URL: https://svnweb.freebsd.org/changeset/base/307537 Log: Use 'cmd' rather than 'command' to match the function prototype. Modified: head/lib/libc/sys/kldsym.2 Modified: head/lib/libc/sys/kldsym.2 ============================================================================== --- head/lib/libc/sys/kldsym.2 Mon Oct 17 22:34:41 2016 (r307536) +++ head/lib/libc/sys/kldsym.2 Mon Oct 17 22:36:37 2016 (r307537) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2001 +.Dd October 17, 2016 .Dt KLDSYM 2 .Os .Sh NAME @@ -36,7 +36,7 @@ .In sys/param.h .In sys/linker.h .Ft int -.Fn kldsym "int fileid" "int command" "void *data" +.Fn kldsym "int fileid" "int cmd" "void *data" .Sh DESCRIPTION The .Fn kldsym @@ -48,7 +48,7 @@ If .Fa fileid is 0, all loaded modules are searched. Currently, the only -.Fa command +.Fa cmd implemented is .Dv KLDSYM_LOOKUP . .Pp @@ -96,7 +96,7 @@ system call will fail if: Invalid value in .Fa data->version or -.Fa command . +.Fa cmd . .It Bq Er ENOENT The .Fa fileid From owner-svn-src-head@freebsd.org Mon Oct 17 22:37:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAE0C15996; Mon, 17 Oct 2016 22:37:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3E6FD901; Mon, 17 Oct 2016 22:37:08 +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 u9HMb7Q1061354; Mon, 17 Oct 2016 22:37:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HMb77U061350; Mon, 17 Oct 2016 22:37:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610172237.u9HMb77U061350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Oct 2016 22:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307538 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 22:37:08 -0000 Author: jhb Date: Mon Oct 17 22:37:07 2016 New Revision: 307538 URL: https://svnweb.freebsd.org/changeset/base/307538 Log: Move mksubr from kdump into libsysdecode. Restructure this script so that it generates a header of tables instead of a source file. The tables are included in a flags.c source file which provides functions to decode various system call arguments. For functions that decode an enumeration, the function returns a pointer to a string for known values and NULL for unknown values. For functions that do more complex decoding (typically of a bitmask), the function accepts a pointer to a FILE object (open_memstream() can be used as a string builder) to which decoded values are written. If the function operates on a bitmask, the function returns true if any bits were decoded or false if the entire value was valid. Additionally, the third argument accepts a pointer to a value to which any undecoded bits are stored. This pointer can be NULL if the caller doesn't care about remaining bits. Convert kdump over to using decoder functions from libsysdecode instead of mksubr. truss also uses decoders from libsysdecode instead of private lookup tables, though lookup tables for objects not decoded by kdump remain in truss for now. Eventually most of these tables should move into libsysdecode as the automated table generation approach from mksubr is less stale than the static tables in truss. Some changes have been made to truss and kdump output: - The flags passed to open() are now properly decoded in that one of O_RDONLY, O_RDWR, O_WRONLY, or O_EXEC is always included in a decoded mask. - Optional arguments to open(), openat(), and fcntl() are only printed in kdump if they exist (e.g. the mode is only printed for open() if O_CREAT is set in the flags). - Print argument to F_GETLK/SETLK/SETLKW in kdump as a pointer, not int. - Include all procctl() commands. - Correctly decode pipe2() flags in truss by not assuming full open()-like flags with O_RDONLY, etc. - Decode file flags passed to *chflags() as file flags (UF_* and SF_*) rather than as a file mode. - Fix decoding of quotactl() commands by splitting out the two command components instead of assuming the raw command value matches the primary command component. In addition, truss and kdump now build without triggering any warnings. All of the sysdecode manpages now include the required headers in the synopsis. Reviewed by: kib (several older versions), wblock (manpages) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D7847 Added: head/lib/libsysdecode/flags.c - copied, changed from r307534, head/usr.bin/kdump/mksubr head/lib/libsysdecode/mktables - copied, changed from r307534, head/usr.bin/kdump/mksubr head/lib/libsysdecode/signal.c (contents, props changed) head/lib/libsysdecode/sysdecode_cap_rights.3 (contents, props changed) head/lib/libsysdecode/sysdecode_enum.3 (contents, props changed) head/lib/libsysdecode/sysdecode_fcntl_arg.3 (contents, props changed) head/lib/libsysdecode/sysdecode_mask.3 (contents, props changed) head/lib/libsysdecode/sysdecode_quotactl_cmd.3 (contents, props changed) head/lib/libsysdecode/sysdecode_sigcode.3 (contents, props changed) head/lib/libsysdecode/sysdecode_sockopt_name.3 (contents, props changed) Deleted: head/usr.bin/kdump/mksubr Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/errno.c head/lib/libsysdecode/mkioctls head/lib/libsysdecode/syscallnames.c head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 head/lib/libsysdecode/sysdecode_ioctlname.3 head/lib/libsysdecode/sysdecode_syscallnames.3 head/lib/libsysdecode/sysdecode_utrace.3 head/lib/libsysdecode/utrace.c head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c head/usr.bin/truss/Makefile head/usr.bin/truss/aarch64-cloudabi64.c head/usr.bin/truss/aarch64-freebsd.c head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/amd64-freebsd.c head/usr.bin/truss/amd64-freebsd32.c head/usr.bin/truss/amd64-linux.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-freebsd.c head/usr.bin/truss/extern.h head/usr.bin/truss/i386-freebsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/main.c head/usr.bin/truss/mips-freebsd.c head/usr.bin/truss/powerpc-freebsd.c head/usr.bin/truss/powerpc64-freebsd.c head/usr.bin/truss/powerpc64-freebsd32.c head/usr.bin/truss/setup.c head/usr.bin/truss/sparc64-freebsd.c head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Mon Oct 17 22:36:37 2016 (r307537) +++ head/lib/libsysdecode/Makefile Mon Oct 17 22:37:07 2016 (r307538) @@ -5,20 +5,94 @@ PACKAGE=lib${LIB} LIB= sysdecode -SRCS= errno.c ioctl.c syscallnames.c utrace.c +SRCS= errno.c flags.c ioctl.c signal.c syscallnames.c utrace.c INCS= sysdecode.h +CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${.CURDIR}/../../sys CFLAGS+= -I${.CURDIR}/../../libexec/rtld-elf -MAN+= sysdecode.3 \ +MAN= sysdecode.3 \ sysdecode_abi_to_freebsd_errno.3 \ + sysdecode_cap_rights.3 \ + sysdecode_enum.3 \ + sysdecode_fcntl_arg.3 \ sysdecode_ioctlname.3 \ + sysdecode_mask.3 \ + sysdecode_quotactl_cmd.3 \ + sysdecode_sigcode.3 \ + sysdecode_sockopt_name.3 \ sysdecode_syscallnames.3 \ sysdecode_utrace.3 -MLINKS+= sysdecode_abi_to_freebsd_errno.3 sysdecode_freebsd_to_abi_errno.3 +MLINKS= sysdecode_abi_to_freebsd_errno.3 sysdecode_freebsd_to_abi_errno.3 +MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ + sysdecode_enum.3 sysdecode_atfd.3 \ + sysdecode_enum.3 sysdecode_extattrnamespace.3 \ + sysdecode_enum.3 sysdecode_fadvice.3 \ + sysdecode_enum.3 sysdecode_fcntl_cmd.3 \ + sysdecode_enum.3 sysdecode_idtype.3 \ + sysdecode_enum.3 sysdecode_ipproto.3 \ + sysdecode_enum.3 sysdecode_kldsym_cmd.3 \ + sysdecode_enum.3 sysdecode_kldunload_flags.3 \ + sysdecode_enum.3 sysdecode_lio_listio_mode.3 \ + sysdecode_enum.3 sysdecode_madvice.3 \ + sysdecode_enum.3 sysdecode_minherit_flags.3 \ + sysdecode_enum.3 sysdecode_msgctl_cmd.3 \ + sysdecode_enum.3 sysdecode_nfssvc_flags.3 \ + sysdecode_enum.3 sysdecode_prio_which.3 \ + sysdecode_enum.3 sysdecode_procctl_cmd.3 \ + sysdecode_enum.3 sysdecode_ptrace_request.3 \ + sysdecode_enum.3 sysdecode_rlimit.3 \ + sysdecode_enum.3 sysdecode_rtprio_function.3 \ + sysdecode_enum.3 sysdecode_scheduler_policy.3 \ + sysdecode_enum.3 sysdecode_semctl_cmd.3 \ + sysdecode_enum.3 sysdecode_shmctl_cmd.3 \ + sysdecode_enum.3 sysdecode_shutdown_how.3 \ + sysdecode_enum.3 sysdecode_sigbus_code.3 \ + sysdecode_enum.3 sysdecode_sigchld_code.3 \ + sysdecode_enum.3 sysdecode_sigfpe_code.3 \ + sysdecode_enum.3 sysdecode_sigill_code.3 \ + sysdecode_enum.3 sysdecode_signal.3 \ + sysdecode_enum.3 sysdecode_sigprocmask_how.3 \ + sysdecode_enum.3 sysdecode_sigsegv_code.3 \ + sysdecode_enum.3 sysdecode_sigtrap_code.3 \ + sysdecode_enum.3 sysdecode_sockaddr_family.3 \ + sysdecode_enum.3 sysdecode_socketdomain.3 \ + sysdecode_enum.3 sysdecode_sockettype.3 \ + sysdecode_enum.3 sysdecode_sockopt_level.3 \ + sysdecode_enum.3 sysdecode_umtx_op.3 \ + sysdecode_enum.3 sysdecode_vmresult.3 \ + sysdecode_enum.3 sysdecode_whence.3 +MLINKS+=sysdecode_fcntl_arg.3 sysdecode_fcntl_arg_p.3 +MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ + sysdecode_mask.3 sysdecode_capfcntlrights.3 \ + sysdecode_mask.3 sysdecode_fcntl_fileflags.3 \ + sysdecode_mask.3 sysdecode_fileflags.3 \ + sysdecode_mask.3 sysdecode_filemode.3 \ + sysdecode_mask.3 sysdecode_flock_operation.3 \ + sysdecode_mask.3 sysdecode_getfsstat_flags.3 \ + sysdecode_mask.3 sysdecode_mlockall_flags.3 \ + sysdecode_mask.3 sysdecode_mmap_flags.3 \ + sysdecode_mask.3 sysdecode_mmap_prot.3 \ + sysdecode_mask.3 sysdecode_mount_flags.3 \ + sysdecode_mask.3 sysdecode_msg_flags.3 \ + sysdecode_mask.3 sysdecode_msync_flags.3 \ + sysdecode_mask.3 sysdecode_open_flags.3 \ + sysdecode_mask.3 sysdecode_pipe2_flags.3 \ + sysdecode_mask.3 sysdecode_reboot_howto.3 \ + sysdecode_mask.3 sysdecode_rfork_flags.3 \ + sysdecode_mask.3 sysdecode_semget_flags.3 \ + sysdecode_mask.3 sysdecode_sendfile_flags.3 \ + sysdecode_mask.3 sysdecode_shmat_flags.3 \ + sysdecode_mask.3 sysdecode_socket_type.3 \ + sysdecode_mask.3 sysdecode_thr_create_flags.3 \ + sysdecode_mask.3 sysdecode_umtx_cvwait_flags.3 \ + sysdecode_mask.3 sysdecode_umtx_rwlock_flags.3 \ + sysdecode_mask.3 sysdecode_vmprot.3 \ + sysdecode_mask.3 sysdecode_wait4_options.3 \ + sysdecode_mask.3 sysdecode_wait6_options.3 -CLEANFILES= ioctl.c +CLEANFILES= ioctl.c tables.h .if defined(COMPAT_32BIT) CPP+= -m32 @@ -36,10 +110,13 @@ CFLAGS.gcc.ioctl.c+= -Wno-unused CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} +tables.h: mktables + sh ${.CURDIR}/mktables ${DESTDIR}${INCLUDEDIR} > ${.TARGET} + ioctl.c: mkioctls env MACHINE=${MACHINE} CPP="${CPP}" \ /bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET} -beforedepend: ioctl.c +beforedepend: ioctl.c tables.h .include Modified: head/lib/libsysdecode/errno.c ============================================================================== --- head/lib/libsysdecode/errno.c Mon Oct 17 22:36:37 2016 (r307537) +++ head/lib/libsysdecode/errno.c Mon Oct 17 22:37:07 2016 (r307538) @@ -28,8 +28,11 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include +#include #include #include Copied and modified: head/lib/libsysdecode/flags.c (from r307534, head/usr.bin/kdump/mksubr) ============================================================================== --- head/usr.bin/kdump/mksubr Mon Oct 17 21:49:54 2016 (r307534, copy source) +++ head/lib/libsysdecode/flags.c Mon Oct 17 22:37:07 2016 (r307538) @@ -1,198 +1,92 @@ -#!/bin/sh -# -# Copyright (c) 2006 "David Kirchner" . 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$ -# -# Generates kdump_subr.c -# mkioctls is a special-purpose script, and works fine as it is -# now, so it remains independent. The idea behind how it generates -# its list was heavily borrowed here. -# -# Some functions here are automatically generated. This can mean -# the user will see unusual kdump output or errors while building -# if the underlying .h files are changed significantly. -# -# Key: -# AUTO: Completely auto-generated with either the "or" or the "switch" -# method. -# AUTO - Special: Generated automatically, but with some extra commands -# that the auto_*_type() functions are inappropriate for. -# MANUAL: Manually entered and must therefore be manually updated. - -set -e - -LC_ALL=C; export LC_ALL - -if [ -z "$1" ] -then - echo "usage: sh $0 include-dir" - exit 1 -fi -include_dir=$1 - -# -# Automatically generates a C function that will print out the -# numeric input as a pipe-delimited string of the appropriate -# #define keys. ex: -# S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH -# The XOR is necessary to prevent including the "0"-value in every -# line. -# -auto_or_type () { - local name grep file - name=$1 - grep=$2 - file=$3 - - cat <<_EOF_ -/* AUTO */ -void -$name(intmax_t arg) -{ - int or = 0; - printf("%#jx<", (uintmax_t)arg); -_EOF_ - egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ - $include_dir/$file | \ - awk '{ for (i = 1; i <= NF; i++) \ - if ($i ~ /define/) \ - break; \ - ++i; \ - printf "\tif (!((arg > 0) ^ ((%s) > 0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' -cat <<_EOF_ - printf(">"); - if (or == 0) - printf("%jd", arg); -} - -_EOF_ -} - -# -# Automatically generates a C function used when the argument -# maps to a single, specific #definition -# -auto_switch_type () { - local name grep file - name=$1 - grep=$2 - file=$3 - - cat <<_EOF_ -/* AUTO */ -void -$name(intmax_t arg) -{ - switch (arg) { -_EOF_ - egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ - $include_dir/$file | \ - awk '{ for (i = 1; i <= NF; i++) \ - if ($i ~ /define/) \ - break; \ - ++i; \ - printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }' -cat <<_EOF_ - default: /* Should not reach */ - printf("", arg); - } -} - -_EOF_ -} - -# -# Automatically generates a C function used when the argument -# maps to a #definition -# -auto_if_type () { - local name grep file - name=$1 - grep=$2 - file=$3 - - cat <<_EOF_ -/* AUTO */ -void -$name(intmax_t arg) -{ -_EOF_ - egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ - $include_dir/$file | \ - awk '{ printf "\t"; \ - if (NR > 1) \ - printf "else " ; \ - printf "if (arg == %s) \n\t\tprintf(\"%s\");\n", $2, $2 }' -cat <<_EOF_ - else /* Should not reach */ - printf("", arg); -} +/* + * Copyright (c) 2006 "David Kirchner" . 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. + */ -_EOF_ -} +#include +__FBSDID("$FreeBSD$"); -# C start +#define L2CAP_SOCKET_CHECKED -cat <<_EOF_ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#define _KERNEL -#include -#undef _KERNEL -#include -#include #include #include #include -#include #include -#include -#include -#define _KERNEL -#include -#undef _KERNEL -#include -#include -#include -#include -#include +#include #include +#include #include +#include +#include +#include #include +#include +#include +#include #include #include -#include -#include #include - -#include "kdump_subr.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * This is taken from the xlat tables originally in truss which were + * in turn taken from strace. + */ +struct name_table { + uintmax_t val; + const char *str; +}; + +#define X(a) { a, #a }, +#define XEND { 0, NULL } + +#define TABLE_START(n) static struct name_table n[] = { +#define TABLE_ENTRY X +#define TABLE_END XEND }; + +#include "tables.h" + +#undef TABLE_START +#undef TABLE_ENTRY +#undef TABLE_END /* * These are simple support macros. print_or utilizes a variable @@ -201,559 +95,888 @@ cat <<_EOF_ * simply handles the necessary "if" statement used in many lines * of this file. */ -#define print_or(str,orflag) do { \\ - if (orflag) putchar('|'); else orflag = 1; \\ - printf (str); } \\ +#define print_or(fp,str,orflag) do { \ + if (orflag) fputc(fp, '|'); else orflag = true; \ + fprintf(fp, str); } \ while (0) -#define if_print_or(i,flag,orflag) do { \\ - if ((i & flag) == flag) \\ - print_or(#flag,orflag); } \\ +#define if_print_or(fp,i,flag,orflag) do { \ + if ((i & flag) == flag) \ + print_or(fp,#flag,orflag); } \ while (0) -/* MANUAL */ -void -atfdname(int fd, int decimal) +static const char * +lookup_value(struct name_table *table, uintmax_t val) { - if (fd == AT_FDCWD) - printf("AT_FDCWD"); - else if (decimal) - printf("%d", fd); - else - printf("%#x", fd); + + for (; table->str != NULL; table++) + if (table->val == val) + return (table->str); + return (NULL); } -/* MANUAL */ -extern char *signames[]; /* from kdump.c */ -void -signame(int sig) +/* + * Used when the value maps to a bitmask of #definition values in the + * table. This is a helper routine which outputs a symbolic mask of + * matched masks. Multiple masks are separated by a pipe ('|'). + * The value is modified on return to only hold unmatched bits. + */ +static void +print_mask_part(FILE *fp, struct name_table *table, uintmax_t *valp, + bool *printed) +{ + uintmax_t rem; + + rem = *valp; + for (; table->str != NULL; table++) { + if ((table->val & rem) == table->val) { + /* + * Only print a zero mask if the raw value is + * zero. + */ + if (table->val == 0 && *valp != 0) + continue; + fprintf(fp, "%s%s", *printed ? "|" : "", table->str); + *printed = true; + rem &= ~table->val; + } + } + + *valp = rem; +} + +/* + * Used when the value maps to a bitmask of #definition values in the + * table. The return value is true if something was printed. If + * rem is not NULL, *rem holds any bits not decoded if something was + * printed. If nothing was printed and rem is not NULL, *rem holds + * the original value. + */ +static bool +print_mask_int(FILE *fp, struct name_table *table, int ival, int *rem) { - if (sig > 0 && sig < NSIG) - printf("SIG%s",signames[sig]); - else - printf("SIG %d", sig); + uintmax_t val; + bool printed; + + printed = false; + val = (unsigned)ival; + print_mask_part(fp, table, &val, &printed); + if (rem != NULL) + *rem = val; + return (printed); } -/* MANUAL */ -void -semctlname(int cmd) +/* + * Used for a mask of optional flags where a value of 0 is valid. + */ +static bool +print_mask_0(FILE *fp, struct name_table *table, int val, int *rem) { - switch (cmd) { - case GETNCNT: - printf("GETNCNT"); - break; - case GETPID: - printf("GETPID"); - break; - case GETVAL: - printf("GETVAL"); - break; - case GETALL: - printf("GETALL"); - break; - case GETZCNT: - printf("GETZCNT"); - break; - case SETVAL: - printf("SETVAL"); - break; - case SETALL: - printf("SETALL"); + + if (val == 0) { + fputs("0", fp); + if (rem != NULL) + *rem = 0; + return (true); + } + return (print_mask_int(fp, table, val, rem)); +} + +/* + * Like print_mask_0 but for a unsigned long instead of an int. + */ +static bool +print_mask_0ul(FILE *fp, struct name_table *table, u_long lval, u_long *rem) +{ + uintmax_t val; + bool printed; + + if (lval == 0) { + fputs("0", fp); + if (rem != NULL) + *rem = 0; + return (true); + } + + printed = false; + val = lval; + print_mask_part(fp, table, &val, &printed); + if (rem != NULL) + *rem = val; + return (printed); +} + +static void +print_integer(FILE *fp, int val, int base) +{ + + switch (base) { + case 8: + fprintf(fp, "0%o", val); break; - case IPC_RMID: - printf("IPC_RMID"); + case 10: + fprintf(fp, "%d", val); break; - case IPC_SET: - printf("IPC_SET"); + case 16: + fprintf(fp, "0x%x", val); break; - case IPC_STAT: - printf("IPC_STAT"); + default: + abort2("bad base", 0, NULL); break; - default: /* Should not reach */ - printf("", cmd); } } -/* MANUAL */ -void -shmctlname(int cmd) +static bool +print_value(FILE *fp, struct name_table *table, uintmax_t val) { - switch (cmd) { - case IPC_RMID: - printf("IPC_RMID"); - break; - case IPC_SET: - printf("IPC_SET"); - break; - case IPC_STAT: - printf("IPC_STAT"); - break; - default: /* Should not reach */ - printf("", cmd); + const char *str; + + str = lookup_value(table, val); + if (str != NULL) { + fputs(str, fp); + return (true); } + return (false); } -/* MANUAL */ -void -semgetname(int flag) +const char * +sysdecode_atfd(int fd) +{ + + if (fd == AT_FDCWD) + return ("AT_FDCWD"); + return (NULL); +} + +static struct name_table semctlops[] = { + X(GETNCNT) X(GETPID) X(GETVAL) X(GETALL) X(GETZCNT) X(SETVAL) X(SETALL) + X(IPC_RMID) X(IPC_SET) X(IPC_STAT) XEND +}; + +const char * +sysdecode_semctl_cmd(int cmd) +{ + + return (lookup_value(semctlops, cmd)); +} + +static struct name_table shmctlops[] = { + X(IPC_RMID) X(IPC_SET) X(IPC_STAT) XEND +}; + +const char * +sysdecode_shmctl_cmd(int cmd) +{ + + return (lookup_value(shmctlops, cmd)); +} + +const char * +sysdecode_msgctl_cmd(int cmd) +{ + + return (sysdecode_shmctl_cmd(cmd)); +} + +static struct name_table semgetflags[] = { + X(IPC_CREAT) X(IPC_EXCL) X(SEM_R) X(SEM_A) X((SEM_R>>3)) X((SEM_A>>3)) + X((SEM_R>>6)) X((SEM_A>>6)) XEND +}; + +bool +sysdecode_semget_flags(FILE *fp, int flag, int *rem) { - int or = 0; - if_print_or(flag, IPC_CREAT, or); - if_print_or(flag, IPC_EXCL, or); - if_print_or(flag, SEM_R, or); - if_print_or(flag, SEM_A, or); - if_print_or(flag, (SEM_R>>3), or); - if_print_or(flag, (SEM_A>>3), or); - if_print_or(flag, (SEM_R>>6), or); - if_print_or(flag, (SEM_A>>6), or); + + return (print_mask_int(fp, semgetflags, flag, rem)); +} + +static struct name_table idtypes[] = { + X(P_PID) X(P_PPID) X(P_PGID) X(P_SID) X(P_CID) X(P_UID) X(P_GID) + X(P_ALL) X(P_LWPID) X(P_TASKID) X(P_PROJID) X(P_POOLID) X(P_JAILID) + X(P_CTID) X(P_CPUID) X(P_PSETID) XEND +}; + +/* XXX: idtype is really an idtype_t */ +const char * +sysdecode_idtype(int idtype) +{ + + return (lookup_value(idtypes, idtype)); } /* - * MANUAL - * - * Only used by SYS_open. Unless O_CREAT is set in flags, the - * mode argument is unused (and often bogus and misleading). + * [g|s]etsockopt's level argument can either be SOL_SOCKET or a + * protocol-specific value. */ -void -flagsandmodename(int flags, int mode, int decimal) +const char * +sysdecode_sockopt_level(int level) +{ + const char *str; + + if (level == SOL_SOCKET) + return ("SOL_SOCKET"); + + /* SOL_* constants for Bluetooth sockets. */ + str = lookup_value(ngbtsolevel, level); + if (str != NULL) + return (str); + + /* + * IP and Infiniband sockets use IP protocols as levels. Not all + * protocols are valid but it is simpler to just allow all of them. + * + * XXX: IPPROTO_IP == 0, but UNIX domain sockets use a level of 0 + * for private options. + */ + str = sysdecode_ipproto(level); + if (str != NULL) + return (str); + + return (NULL); +} + +bool +sysdecode_vmprot(FILE *fp, int type, int *rem) +{ + + return (print_mask_int(fp, vmprot, type, rem)); +} + +static struct name_table sockflags[] = { + X(SOCK_CLOEXEC) X(SOCK_NONBLOCK) XEND +}; + +bool +sysdecode_socket_type(FILE *fp, int type, int *rem) { - flagsname(flags); - putchar(','); - if ((flags & O_CREAT) == O_CREAT) { - modename (mode); + const char *str; + uintmax_t val; + bool printed; + + str = lookup_value(socktype, type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK)); + if (str != NULL) { + fputs(str, fp); + *rem = 0; + printed = true; } else { - if (decimal) { - printf("%d", mode); - } else { - printf("%#x", (unsigned int)mode); - } + *rem = type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK); + printed = false; } + val = type & (SOCK_CLOEXEC | SOCK_NONBLOCK); + print_mask_part(fp, sockflags, &val, &printed); + return (printed); } -/* MANUAL */ -void -idtypename(idtype_t idtype, int decimal) +bool +sysdecode_access_mode(FILE *fp, int mode, int *rem) { - switch(idtype) { - case P_PID: - printf("P_PID"); - break; - case P_PPID: - printf("P_PPID"); - break; - case P_PGID: - printf("P_PGID"); - break; - case P_SID: - printf("P_SID"); - break; - case P_CID: - printf("P_CID"); - break; - case P_UID: - printf("P_UID"); - break; - case P_GID: - printf("P_GID"); - break; - case P_ALL: - printf("P_ALL"); - break; - case P_LWPID: - printf("P_LWPID"); - break; - case P_TASKID: - printf("P_TASKID"); - break; - case P_PROJID: - printf("P_PROJID"); - break; - case P_POOLID: - printf("P_POOLID"); - break; - case P_JAILID: - printf("P_JAILID"); - break; - case P_CTID: - printf("P_CTID"); + + return (print_mask_int(fp, accessmode, mode, rem)); +} + +/* XXX: 'type' is really an acl_type_t. */ +const char * +sysdecode_acltype(int type) +{ + + return (lookup_value(acltype, type)); +} + +bool +sysdecode_cap_fcntlrights(FILE *fp, uint32_t rights, uint32_t *rem) +{ + + return (print_mask_int(fp, capfcntl, rights, rem)); +} + +const char * +sysdecode_extattrnamespace(int namespace) +{ + + return (lookup_value(extattrns, namespace)); +} + +const char * +sysdecode_fadvice(int advice) +{ + + return (lookup_value(fadvisebehav, advice)); +} + +bool +sysdecode_open_flags(FILE *fp, int flags, int *rem) +{ + bool printed; + int mode; + uintmax_t val; + + mode = flags & O_ACCMODE; + flags &= ~O_ACCMODE; + switch (mode) { + case O_RDONLY: + if (flags & O_EXEC) { + flags &= ~O_EXEC; + fputs("O_EXEC", fp); + } else + fputs("O_RDONLY", fp); + printed = true; + mode = 0; break; - case P_CPUID: - printf("P_CPUID"); + case O_WRONLY: + fputs("O_WRONLY", fp); + printed = true; + mode = 0; break; - case P_PSETID: - printf("P_PSETID"); + case O_RDWR: + fputs("O_RDWR", fp); + printed = true; + mode = 0; break; default: - if (decimal) { - printf("%d", idtype); - } else { - printf("%#x", idtype); - } + printed = false; } + val = (unsigned)flags; + print_mask_part(fp, openflags, &val, &printed); + if (rem != NULL) + *rem = val | mode; + return (printed); } -/* - * MANUAL - * - * [g|s]etsockopt's level argument can either be SOL_SOCKET or a value - * referring to a line in /etc/protocols . It might be appropriate - * to use getprotoent(3) here. - */ -void -sockoptlevelname(int level, int decimal) +bool +sysdecode_fcntl_fileflags(FILE *fp, int flags, int *rem) { - if (level == SOL_SOCKET) { - printf("SOL_SOCKET"); - } else { - if (decimal) { - printf("%d", level); - } else { - printf("%#x", (unsigned int)level); - } + bool printed; + int oflags; + + /* + * The file flags used with F_GETFL/F_SETFL mostly match the + * flags passed to open(2). However, a few open-only flag + * bits have been repurposed for fcntl-only flags. + */ + oflags = flags & ~(O_NOFOLLOW | FRDAHEAD); + printed = sysdecode_open_flags(fp, oflags, rem); + if (flags & O_NOFOLLOW) { + fprintf(fp, "%sFPOIXSHM", printed ? "|" : ""); + printed = true; + } + if (flags & FRDAHEAD) { + fprintf(fp, "%sFRDAHEAD", printed ? "|" : ""); + printed = true; } + return (printed); } -/* - * MANUAL - * - * Used for page fault type. Cannot use auto_or_type since the macro - * values contain a cast. Also, VM_PROT_NONE has to be handled specially. - */ -void -vmprotname (int type) +bool +sysdecode_flock_operation(FILE *fp, int operation, int *rem) { - int or = 0; - if (type == VM_PROT_NONE) { - (void)printf("VM_PROT_NONE"); - return; - } - if_print_or(type, VM_PROT_READ, or); - if_print_or(type, VM_PROT_WRITE, or); - if_print_or(type, VM_PROT_EXECUTE, or); - if_print_or(type, VM_PROT_COPY, or); + return (print_mask_int(fp, flockops, operation, rem)); } -/* - * MANUAL - */ -void -socktypenamewithflags(int type) +bool +sysdecode_getfsstat_flags(FILE *fp, int flags, int *rem) { - if (type & SOCK_CLOEXEC) - printf("SOCK_CLOEXEC|"), type &= ~SOCK_CLOEXEC; - if (type & SOCK_NONBLOCK) - printf("SOCK_NONBLOCK|"), type &= ~SOCK_NONBLOCK; - socktypename(type); -} -_EOF_ - -auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" -auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" -auto_or_type "capfcntlname" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capsicum.h" -auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" -auto_switch_type "fadvisebehavname" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" -auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" -auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" -auto_or_type "getfsstatflagsname" "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*" "sys/mount.h" -auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" -auto_switch_type "kldunloadfflagsname" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" -auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h" -auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 17 22:48:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4011FC15C9B; Mon, 17 Oct 2016 22:48:30 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 11F6FF62; Mon, 17 Oct 2016 22:48:30 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9HMmT0r065181; Mon, 17 Oct 2016 22:48:29 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HMmT3n065180; Mon, 17 Oct 2016 22:48:29 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201610172248.u9HMmT3n065180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Mon, 17 Oct 2016 22:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307539 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 22:48:30 -0000 Author: bjk (doc committer) Date: Mon Oct 17 22:48:29 2016 New Revision: 307539 URL: https://svnweb.freebsd.org/changeset/base/307539 Log: Fix relnotes build of supported hardware list after r307529 urtwn is merged into rtwn, so there is not a separate hardware list to include anymore. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Oct 17 22:37:07 2016 (r307538) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Oct 17 22:48:29 2016 (r307539) @@ -1013,8 +1013,6 @@ &hwlist.urtw; - &hwlist.urtwn; - [&arch.amd64;, &arch.i386;, &arch.pc98;] Lucent Technologies WaveLAN/IEEE 802.11b wireless network adapters and workalikes using the Lucent Hermes, Intersil PRISM-II, From owner-svn-src-head@freebsd.org Mon Oct 17 22:57:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7EFAC15E21; Mon, 17 Oct 2016 22:57:42 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7EF1F5F9; Mon, 17 Oct 2016 22:57:42 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9HMvfpI068914; Mon, 17 Oct 2016 22:57:41 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HMvfdH068913; Mon, 17 Oct 2016 22:57:41 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201610172257.u9HMvfdH068913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Mon, 17 Oct 2016 22:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307540 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 22:57:42 -0000 Author: stevek Date: Mon Oct 17 22:57:41 2016 New Revision: 307540 URL: https://svnweb.freebsd.org/changeset/base/307540 Log: Add sysctl to make amd64 minidump retry count tunable at runtime. PR: 213462 Submitted by: RaviPrakash Darbha Reviewed by: cemi, markj Approved by: sjg (mentor) Obtained from: Juniper Networks Differential Revision: https://reviews.freebsd.org/D8254 Modified: head/sys/amd64/amd64/minidump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Mon Oct 17 22:48:29 2016 (r307539) +++ head/sys/amd64/amd64/minidump_machdep.c Mon Oct 17 22:57:41 2016 (r307540) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -68,6 +69,9 @@ static void *dump_va; static size_t counter, progress, dumpsize; CTASSERT(sizeof(*vm_page_dump) == 8); +static int dump_retry_count = 5; +SYSCTL_INT(_machdep, OID_AUTO, dump_retry_count, CTLFLAG_RWTUN, + &dump_retry_count, 0, "Number of times dump has to retry before bailing out"); static int is_dumpable(vm_paddr_t pa) @@ -447,7 +451,7 @@ minidumpsys(struct dumperinfo *di) printf("\n"); if (error == ENOSPC) { printf("Dump map grown while dumping. "); - if (retry_count < 5) { + if (retry_count < dump_retry_count) { printf("Retrying...\n"); goto retry; } From owner-svn-src-head@freebsd.org Mon Oct 17 23:25:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED9FCC164E5; Mon, 17 Oct 2016 23:25:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BFA4361C; Mon, 17 Oct 2016 23:25:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9HNPV1p080226; Mon, 17 Oct 2016 23:25:31 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9HNPV91080225; Mon, 17 Oct 2016 23:25:31 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201610172325.u9HNPV91080225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 17 Oct 2016 23:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307541 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 23:25:33 -0000 Author: gnn Date: Mon Oct 17 23:25:31 2016 New Revision: 307541 URL: https://svnweb.freebsd.org/changeset/base/307541 Log: Limit the number of mbufs that can be allocated for IPV6_2292PKTOPTIONS (and IPV6_PKTOPTIONS). PR: 100219 Submitted by: Joseph Kong MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D5157 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Oct 17 22:57:41 2016 (r307540) +++ head/sys/netinet6/ip6_output.c Mon Oct 17 23:25:31 2016 (r307541) @@ -1393,6 +1393,15 @@ ip6_ctloutput(struct socket *so, struct int retval; #endif +/* + * Don't use more than a quarter of mbuf clusters. N.B.: + * nmbclusters is an int, but nmbclusters * MCLBYTES may overflow + * on LP64 architectures, so cast to u_long to avoid undefined + * behavior. ILP32 architectures cannot have nmbclusters + * large enough to overflow for other reasons. + */ +#define IPV6_PKTOPTIONS_MBUF_LIMIT ((u_long)nmbclusters * MCLBYTES / 4) + level = sopt->sopt_level; op = sopt->sopt_dir; optname = sopt->sopt_name; @@ -1448,6 +1457,12 @@ ip6_ctloutput(struct socket *so, struct { struct mbuf *m; + if (optlen > IPV6_PKTOPTIONS_MBUF_LIMIT) { + printf("ip6_ctloutput: mbuf limit hit\n"); + error = ENOBUFS; + break; + } + error = soopt_getm(sopt, &m); /* XXX */ if (error != 0) break; From owner-svn-src-head@freebsd.org Tue Oct 18 00:55:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA98C15994; Tue, 18 Oct 2016 00:55:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8C21BE12; Tue, 18 Oct 2016 00:55:17 +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 u9I0tGNw014760; Tue, 18 Oct 2016 00:55:16 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I0tFCH014745; Tue, 18 Oct 2016 00:55:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610180055.u9I0tFCH014745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 18 Oct 2016 00:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307542 - in head/sys: contrib/ncsw/Peripherals/BM contrib/ncsw/Peripherals/QM contrib/ncsw/inc contrib/ncsw/inc/Peripherals contrib/ncsw/user/env dev/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 00:55:18 -0000 Author: jhibbits Date: Tue Oct 18 00:55:15 2016 New Revision: 307542 URL: https://svnweb.freebsd.org/changeset/base/307542 Log: Use proper integer-pointer type conversions. As part of an effort to extend Book-E to the 64-bit world, make the necessary changes to the DPAA/dTSEC driver set to be integer-pointer conversion clean. This means no more casts to int, and use uintptr_t where needed. Since the NCSW source is effectively obsolete, direct changes to the source tree are safe. Modified: head/sys/contrib/ncsw/Peripherals/BM/bman_low.c head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c head/sys/contrib/ncsw/Peripherals/QM/qman_low.h head/sys/contrib/ncsw/inc/Peripherals/bm_ext.h head/sys/contrib/ncsw/inc/Peripherals/fm_ext.h head/sys/contrib/ncsw/inc/Peripherals/qm_ext.h head/sys/contrib/ncsw/inc/error_ext.h head/sys/contrib/ncsw/inc/xx_ext.h head/sys/contrib/ncsw/user/env/xx.c head/sys/dev/dpaa/bman.c head/sys/dev/dpaa/bman_portals.c head/sys/dev/dpaa/fman.c head/sys/dev/dpaa/portals_common.c head/sys/dev/dpaa/qman.c head/sys/dev/dpaa/qman_portals.c Modified: head/sys/contrib/ncsw/Peripherals/BM/bman_low.c ============================================================================== --- head/sys/contrib/ncsw/Peripherals/BM/bman_low.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/Peripherals/BM/bman_low.c Tue Oct 18 00:55:15 2016 (r307542) @@ -51,45 +51,45 @@ /***************************/ /* Cache-inhibited register offsets */ -#define REG_RCR_PI_CINH (void *)0x0000 -#define REG_RCR_CI_CINH (void *)0x0004 -#define REG_RCR_ITR (void *)0x0008 -#define REG_CFG (void *)0x0100 -#define REG_SCN(n) ((void *)(0x0200 + ((n) << 2))) -#define REG_ISR (void *)0x0e00 -#define REG_IER (void *)0x0e04 -#define REG_ISDR (void *)0x0e08 -#define REG_IIR (void *)0x0e0c +#define REG_RCR_PI_CINH 0x0000 +#define REG_RCR_CI_CINH 0x0004 +#define REG_RCR_ITR 0x0008 +#define REG_CFG 0x0100 +#define REG_SCN(n) (0x0200 + ((n) << 2)) +#define REG_ISR 0x0e00 +#define REG_IER 0x0e04 +#define REG_ISDR 0x0e08 +#define REG_IIR 0x0e0c /* Cache-enabled register offsets */ -#define CL_CR (void *)0x0000 -#define CL_RR0 (void *)0x0100 -#define CL_RR1 (void *)0x0140 -#define CL_RCR (void *)0x1000 -#define CL_RCR_PI_CENA (void *)0x3000 -#define CL_RCR_CI_CENA (void *)0x3100 +#define CL_CR 0x0000 +#define CL_RR0 0x0100 +#define CL_RR1 0x0140 +#define CL_RCR 0x1000 +#define CL_RCR_PI_CENA 0x3000 +#define CL_RCR_CI_CENA 0x3100 /* The h/w design requires mappings to be size-aligned so that "add"s can be * reduced to "or"s. The primitives below do the same for s/w. */ -static __inline__ void *ptr_ADD(void *a, void *b) +static __inline__ void *ptr_ADD(void *a, uintptr_t b) { - return (void *)((uintptr_t)a + (uintptr_t)b); + return (void *)((uintptr_t)a + b); } /* Bitwise-OR two pointers */ -static __inline__ void *ptr_OR(void *a, void *b) +static __inline__ void *ptr_OR(void *a, uintptr_t b) { - return (void *)((uintptr_t)a | (uintptr_t)b); + return (void *)((uintptr_t)a | b); } /* Cache-inhibited register access */ -static __inline__ uint32_t __bm_in(struct bm_addr *bm, void *offset) +static __inline__ uint32_t __bm_in(struct bm_addr *bm, uintptr_t offset) { uint32_t *tmp = (uint32_t *)ptr_ADD(bm->addr_ci, offset); return GET_UINT32(*tmp); } -static __inline__ void __bm_out(struct bm_addr *bm, void *offset, uint32_t val) +static __inline__ void __bm_out(struct bm_addr *bm, uintptr_t offset, uint32_t val) { uint32_t *tmp = (uint32_t *)ptr_ADD(bm->addr_ci, offset); WRITE_UINT32(*tmp, val); @@ -101,26 +101,26 @@ static __inline__ void __bm_out(struct b #define bm_cl(n) (void *)((n) << 6) /* Cache-enabled (index) register access */ -static __inline__ void __bm_cl_touch_ro(struct bm_addr *bm, void *offset) +static __inline__ void __bm_cl_touch_ro(struct bm_addr *bm, uintptr_t offset) { dcbt_ro(ptr_ADD(bm->addr_ce, offset)); } -static __inline__ void __bm_cl_touch_rw(struct bm_addr *bm, void *offset) +static __inline__ void __bm_cl_touch_rw(struct bm_addr *bm, uintptr_t offset) { dcbt_rw(ptr_ADD(bm->addr_ce, offset)); } -static __inline__ uint32_t __bm_cl_in(struct bm_addr *bm, void *offset) +static __inline__ uint32_t __bm_cl_in(struct bm_addr *bm, uintptr_t offset) { uint32_t *tmp = (uint32_t *)ptr_ADD(bm->addr_ce, offset); return GET_UINT32(*tmp); } -static __inline__ void __bm_cl_out(struct bm_addr *bm, void *offset, uint32_t val) +static __inline__ void __bm_cl_out(struct bm_addr *bm, uintptr_t offset, uint32_t val) { uint32_t *tmp = (uint32_t *)ptr_ADD(bm->addr_ce, offset); WRITE_UINT32(*tmp, val); dcbf(tmp); } -static __inline__ void __bm_cl_invalidate(struct bm_addr *bm, void *offset) +static __inline__ void __bm_cl_invalidate(struct bm_addr *bm, uintptr_t offset) { dcbi(ptr_ADD(bm->addr_ce, offset)); } @@ -156,7 +156,7 @@ static __inline__ uint8_t cyc_diff(uint8 /* Bit-wise logic to convert a ring pointer to a ring index */ static __inline__ uint8_t RCR_PTR2IDX(struct bm_rcr_entry *e) { - return (uint8_t)(((uint32_t)e >> 6) & (BM_RCR_SIZE - 1)); + return (uint8_t)(((uintptr_t)e >> 6) & (BM_RCR_SIZE - 1)); } /* Increment the 'cursor' ring pointer, taking 'vbit' into account */ @@ -483,12 +483,12 @@ void bm_isr_bscn_mask(struct bm_portal * uint32_t __bm_isr_read(struct bm_portal *portal, enum bm_isr_reg n) { - return __bm_in(&portal->addr, PTR_MOVE(REG_ISR, (n << 2))); + return __bm_in(&portal->addr, REG_ISR + (n << 2)); } void __bm_isr_write(struct bm_portal *portal, enum bm_isr_reg n, uint32_t val) { - __bm_out(&portal->addr, PTR_MOVE(REG_ISR, (n << 2)), val); + __bm_out(&portal->addr, REG_ISR + (n << 2), val); } Modified: head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c ============================================================================== --- head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c Tue Oct 18 00:55:15 2016 (r307542) @@ -568,8 +568,8 @@ mr_loop: qmPortalMrPvbUpdate(p_QmPortal->p_LowQmPortal); p_Msg = qm_mr_current(p_QmPortal->p_LowQmPortal); if (p_Msg) { - struct qman_fq *p_FqFqs = (void *)p_Msg->fq.contextB; - struct qman_fq *p_FqErn = (void *)p_Msg->ern.tag; + struct qman_fq *p_FqFqs = UINT_TO_PTR(p_Msg->fq.contextB); + struct qman_fq *p_FqErn = UINT_TO_PTR(p_Msg->ern.tag); uint8_t verb =(uint8_t)(p_Msg->verb & QM_MR_VERB_TYPE_MASK); t_QmRejectedFrameInfo rejectedFrameInfo; @@ -646,7 +646,7 @@ static void LoopDequeueRing(t_Handle h_Q p_Dq = qm_dqrr_current(p_QmPortal->p_LowQmPortal); if (!p_Dq) break; - p_Fq = (void *)p_Dq->contextB; + p_Fq = UINT_TO_PTR(p_Dq->contextB); if (p_Dq->stat & QM_DQRR_STAT_UNSCHEDULED) { /* We only set QMAN_FQ_STATE_NE when retiring, so we only need * to check for clearing it when doing volatile dequeues. It's @@ -728,7 +728,7 @@ static void LoopDequeueRingDcaOptimized( p_Dq = qm_dqrr_current(p_QmPortal->p_LowQmPortal); if (!p_Dq) break; - p_Fq = (void *)p_Dq->contextB; + p_Fq = UINT_TO_PTR(p_Dq->contextB); if (p_Dq->stat & QM_DQRR_STAT_UNSCHEDULED) { /* We only set QMAN_FQ_STATE_NE when retiring, so we only need * to check for clearing it when doing volatile dequeues. It's @@ -802,7 +802,7 @@ static void LoopDequeueRingOptimized(t_H p_Dq = qm_dqrr_current(p_QmPortal->p_LowQmPortal); if (!p_Dq) break; - p_Fq = (void *)p_Dq->contextB; + p_Fq = UINT_TO_PTR(p_Dq->contextB); if (p_Dq->stat & QM_DQRR_STAT_UNSCHEDULED) { /* We only set QMAN_FQ_STATE_NE when retiring, so we only need * to check for clearing it when doing volatile dequeues. It's @@ -1483,7 +1483,7 @@ static t_Error QmPortalPullFrame(t_Handl p_Dq = qm_dqrr_current(p_QmPortal->p_LowQmPortal); if (!p_Dq) continue; - p_Fq = (void *)p_Dq->contextB; + p_Fq = UINT_TO_PTR(p_Dq->contextB); ASSERT_COND(p_Dq->fqid); p_Dst = (uint32_t *)p_Frame; p_Src = (uint32_t *)&p_Dq->fd; @@ -1811,7 +1811,7 @@ t_Error QM_PORTAL_PollFrame(t_Handle h_Q PUNLOCK(p_QmPortal); return ERROR_CODE(E_EMPTY); } - p_Fq = (void *)p_Dq->contextB; + p_Fq = UINT_TO_PTR(p_Dq->contextB); ASSERT_COND(p_Dq->fqid); if (p_Fq) { @@ -2141,7 +2141,7 @@ t_Error QM_FQR_Enqueue(t_Handle h_QmFqr, } p_Eq->fqid = p_Fq->fqid; - p_Eq->tag = (uint32_t)p_Fq; + p_Eq->tag = (uintptr_t)p_Fq; /* gcc does a dreadful job of the following; * eq->fd = *fd; * It causes the entire function to save/restore a wider range of Modified: head/sys/contrib/ncsw/Peripherals/QM/qman_low.h ============================================================================== --- head/sys/contrib/ncsw/Peripherals/QM/qman_low.h Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/Peripherals/QM/qman_low.h Tue Oct 18 00:55:15 2016 (r307542) @@ -51,61 +51,61 @@ /***************************/ /* Cache-inhibited register offsets */ -#define REG_EQCR_PI_CINH (void *)0x0000 -#define REG_EQCR_CI_CINH (void *)0x0004 -#define REG_EQCR_ITR (void *)0x0008 -#define REG_DQRR_PI_CINH (void *)0x0040 -#define REG_DQRR_CI_CINH (void *)0x0044 -#define REG_DQRR_ITR (void *)0x0048 -#define REG_DQRR_DCAP (void *)0x0050 -#define REG_DQRR_SDQCR (void *)0x0054 -#define REG_DQRR_VDQCR (void *)0x0058 -#define REG_DQRR_PDQCR (void *)0x005c -#define REG_MR_PI_CINH (void *)0x0080 -#define REG_MR_CI_CINH (void *)0x0084 -#define REG_MR_ITR (void *)0x0088 -#define REG_CFG (void *)0x0100 -#define REG_ISR (void *)0x0e00 -#define REG_IER (void *)0x0e04 -#define REG_ISDR (void *)0x0e08 -#define REG_IIR (void *)0x0e0c -#define REG_ITPR (void *)0x0e14 +#define REG_EQCR_PI_CINH 0x0000 +#define REG_EQCR_CI_CINH 0x0004 +#define REG_EQCR_ITR 0x0008 +#define REG_DQRR_PI_CINH 0x0040 +#define REG_DQRR_CI_CINH 0x0044 +#define REG_DQRR_ITR 0x0048 +#define REG_DQRR_DCAP 0x0050 +#define REG_DQRR_SDQCR 0x0054 +#define REG_DQRR_VDQCR 0x0058 +#define REG_DQRR_PDQCR 0x005c +#define REG_MR_PI_CINH 0x0080 +#define REG_MR_CI_CINH 0x0084 +#define REG_MR_ITR 0x0088 +#define REG_CFG 0x0100 +#define REG_ISR 0x0e00 +#define REG_IER 0x0e04 +#define REG_ISDR 0x0e08 +#define REG_IIR 0x0e0c +#define REG_ITPR 0x0e14 /* Cache-enabled register offsets */ -#define CL_EQCR (void *)0x0000 -#define CL_DQRR (void *)0x1000 -#define CL_MR (void *)0x2000 -#define CL_EQCR_PI_CENA (void *)0x3000 -#define CL_EQCR_CI_CENA (void *)0x3100 -#define CL_DQRR_PI_CENA (void *)0x3200 -#define CL_DQRR_CI_CENA (void *)0x3300 -#define CL_MR_PI_CENA (void *)0x3400 -#define CL_MR_CI_CENA (void *)0x3500 -#define CL_RORI_CENA (void *)0x3600 -#define CL_CR (void *)0x3800 -#define CL_RR0 (void *)0x3900 -#define CL_RR1 (void *)0x3940 +#define CL_EQCR 0x0000 +#define CL_DQRR 0x1000 +#define CL_MR 0x2000 +#define CL_EQCR_PI_CENA 0x3000 +#define CL_EQCR_CI_CENA 0x3100 +#define CL_DQRR_PI_CENA 0x3200 +#define CL_DQRR_CI_CENA 0x3300 +#define CL_MR_PI_CENA 0x3400 +#define CL_MR_CI_CENA 0x3500 +#define CL_RORI_CENA 0x3600 +#define CL_CR 0x3800 +#define CL_RR0 0x3900 +#define CL_RR1 0x3940 -static __inline__ void *ptr_ADD(void *a, void *b) +static __inline__ void *ptr_ADD(void *a, uintptr_t b) { - return (void *)((uintptr_t)a + (uintptr_t)b); + return (void *)((uintptr_t)a + b); } /* The h/w design requires mappings to be size-aligned so that "add"s can be * reduced to "or"s. The primitives below do the same for s/w. */ /* Bitwise-OR two pointers */ -static __inline__ void *ptr_OR(void *a, void *b) +static __inline__ void *ptr_OR(void *a, uintptr_t b) { - return (void *)((uintptr_t)a + (uintptr_t)b); + return (void *)((uintptr_t)a + b); } /* Cache-inhibited register access */ -static __inline__ uint32_t __qm_in(struct qm_addr *qm, void *offset) +static __inline__ uint32_t __qm_in(struct qm_addr *qm, uintptr_t offset) { uint32_t *tmp = (uint32_t *)ptr_ADD(qm->addr_ci, offset); return GET_UINT32(*tmp); } -static __inline__ void __qm_out(struct qm_addr *qm, void *offset, uint32_t val) +static __inline__ void __qm_out(struct qm_addr *qm, uintptr_t offset, uint32_t val) { uint32_t *tmp = (uint32_t *)ptr_ADD(qm->addr_ci, offset); WRITE_UINT32(*tmp, val); @@ -114,29 +114,29 @@ static __inline__ void __qm_out(struct q #define qm_out(reg, val) __qm_out(&portal->addr, REG_##reg, (uint32_t)val) /* Convert 'n' cachelines to a pointer value for bitwise OR */ -#define qm_cl(n) (void *)((n) << 6) +#define qm_cl(n) ((n) << 6) /* Cache-enabled (index) register access */ -static __inline__ void __qm_cl_touch_ro(struct qm_addr *qm, void *offset) +static __inline__ void __qm_cl_touch_ro(struct qm_addr *qm, uintptr_t offset) { dcbt_ro(ptr_ADD(qm->addr_ce, offset)); } -static __inline__ void __qm_cl_touch_rw(struct qm_addr *qm, void *offset) +static __inline__ void __qm_cl_touch_rw(struct qm_addr *qm, uintptr_t offset) { dcbt_rw(ptr_ADD(qm->addr_ce, offset)); } -static __inline__ uint32_t __qm_cl_in(struct qm_addr *qm, void *offset) +static __inline__ uint32_t __qm_cl_in(struct qm_addr *qm, uintptr_t offset) { uint32_t *tmp = (uint32_t *)ptr_ADD(qm->addr_ce, offset); return GET_UINT32(*tmp); } -static __inline__ void __qm_cl_out(struct qm_addr *qm, void *offset, uint32_t val) +static __inline__ void __qm_cl_out(struct qm_addr *qm, uintptr_t offset, uint32_t val) { uint32_t *tmp = (uint32_t *)ptr_ADD(qm->addr_ce, offset); WRITE_UINT32(*tmp, val); dcbf(tmp); } -static __inline__ void __qm_cl_invalidate(struct qm_addr *qm, void *offset) +static __inline__ void __qm_cl_invalidate(struct qm_addr *qm, uintptr_t offset) { dcbi(ptr_ADD(qm->addr_ce, offset)); } @@ -190,7 +190,7 @@ static __inline__ void __qm_portal_unbin /* Bit-wise logic to convert a ring pointer to a ring index */ static __inline__ uint8_t EQCR_PTR2IDX(struct qm_eqcr_entry *e) { - return (uint8_t)(((uint32_t)e >> 6) & (QM_EQCR_SIZE - 1)); + return (uint8_t)(((uintptr_t)e >> 6) & (QM_EQCR_SIZE - 1)); } /* Increment the 'cursor' ring pointer, taking 'vbit' into account */ @@ -459,7 +459,7 @@ static __inline__ uint8_t qm_eqcr_get_fi static __inline__ uint8_t DQRR_PTR2IDX(struct qm_dqrr_entry *e) { - return (uint8_t)(((uint32_t)e >> 6) & (QM_DQRR_SIZE - 1)); + return (uint8_t)(((uintptr_t)e >> 6) & (QM_DQRR_SIZE - 1)); } static __inline__ struct qm_dqrr_entry *DQRR_INC(struct qm_dqrr_entry *e) @@ -829,7 +829,7 @@ static __inline__ uint8_t qm_dqrr_get_ma static __inline__ uint8_t MR_PTR2IDX(struct qm_mr_entry *e) { - return (uint8_t)(((uint32_t)e >> 6) & (QM_MR_SIZE - 1)); + return (uint8_t)(((uintptr_t)e >> 6) & (QM_MR_SIZE - 1)); } static __inline__ struct qm_mr_entry *MR_INC(struct qm_mr_entry *e) @@ -1139,10 +1139,10 @@ static __inline__ void qm_isr_set_iperio static __inline__ uint32_t __qm_isr_read(struct qm_portal *portal, enum qm_isr_reg n) { - return __qm_in(&portal->addr, PTR_MOVE(REG_ISR, (n << 2))); + return __qm_in(&portal->addr, REG_ISR + (n << 2)); } static __inline__ void __qm_isr_write(struct qm_portal *portal, enum qm_isr_reg n, uint32_t val) { - __qm_out(&portal->addr, PTR_MOVE(REG_ISR, (n << 2)), val); + __qm_out(&portal->addr, REG_ISR + (n << 2), val); } Modified: head/sys/contrib/ncsw/inc/Peripherals/bm_ext.h ============================================================================== --- head/sys/contrib/ncsw/inc/Peripherals/bm_ext.h Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/inc/Peripherals/bm_ext.h Tue Oct 18 00:55:15 2016 (r307542) @@ -124,7 +124,7 @@ typedef struct { t_Handle h_App; /**< A handle to an application layer object; This handle will be passed by the driver upon calling the above callbacks. NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */ - int errIrq; /**< BM error interrupt line; NO_IRQ if interrupts not used. + uintptr_t errIrq; /**< BM error interrupt line; NO_IRQ if interrupts not used. NOTE: this parameter relevant only for BM in master mode ('guestId'=NCSW_MASTER_ID). */ uint8_t partBpidBase; /**< The first buffer-pool-id dedicated to this partition. Modified: head/sys/contrib/ncsw/inc/Peripherals/fm_ext.h ============================================================================== --- head/sys/contrib/ncsw/inc/Peripherals/fm_ext.h Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/inc/Peripherals/fm_ext.h Tue Oct 18 00:55:15 2016 (r307542) @@ -322,9 +322,9 @@ typedef struct t_FmParams { t_Handle h_App; /**< Relevant when guestId = NCSW_MASSTER_ID only. A handle to an application layer object; This handle will be passed by the driver upon calling the above callbacks */ - int irq; /**< Relevant when guestId = NCSW_MASSTER_ID only. + uintptr_t irq; /**< Relevant when guestId = NCSW_MASSTER_ID only. FM interrupt source for normal events */ - int errIrq; /**< Relevant when guestId = NCSW_MASSTER_ID only. + uintptr_t errIrq; /**< Relevant when guestId = NCSW_MASSTER_ID only. FM interrupt source for errors */ t_FmPcdFirmwareParams firmware; /**< Relevant when guestId = NCSW_MASSTER_ID only. Ucode */ Modified: head/sys/contrib/ncsw/inc/Peripherals/qm_ext.h ============================================================================== --- head/sys/contrib/ncsw/inc/Peripherals/qm_ext.h Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/inc/Peripherals/qm_ext.h Tue Oct 18 00:55:15 2016 (r307542) @@ -249,7 +249,7 @@ typedef struct { t_QmExceptionsCallback *f_Exception; /**< An application callback routine to handle exceptions.*/ t_Handle h_App; /**< A handle to an application layer object; This handle will be passed by the driver upon calling the above callbacks */ - int errIrq; /**< error interrupt line; NO_IRQ if interrupts not used */ + uintptr_t errIrq; /**< error interrupt line; NO_IRQ if interrupts not used */ uint32_t partFqidBase; /**< The first frame-queue-id dedicated to this partition. NOTE: this parameter relevant only when working with multiple partitions. */ uint32_t partNumOfFqids; /**< Number of frame-queue-ids dedicated to this partition. Modified: head/sys/contrib/ncsw/inc/error_ext.h ============================================================================== --- head/sys/contrib/ncsw/inc/error_ext.h Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/inc/error_ext.h Tue Oct 18 00:55:15 2016 (r307542) @@ -353,7 +353,8 @@ int ERROR_DYNAMIC_LEVEL = ERROR_GLOBAL_L #define PRINT_FORMAT "[CPU%02d, %s:%d %s]" #define PRINT_FMT_PARAMS CORE_GetId(), __FILE__, __LINE__, __FUNCTION__ -#define ERR_STRING(err) #err +#define _ERR_STRING(err) #err +#define ERR_STRING(err) _ERR_STRING(err) #if (!(defined(DEBUG_ERRORS)) || (DEBUG_ERRORS == 0)) /* No debug/error/event messages at all */ Modified: head/sys/contrib/ncsw/inc/xx_ext.h ============================================================================== --- head/sys/contrib/ncsw/inc/xx_ext.h Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/inc/xx_ext.h Tue Oct 18 00:55:15 2016 (r307542) @@ -197,7 +197,7 @@ char XX_GetChar(void); @Return E_OK on success; error code otherwise.. *//***************************************************************************/ -t_Error XX_PreallocAndBindIntr(int irq, unsigned int cpu); +t_Error XX_PreallocAndBindIntr(uintptr_t irq, unsigned int cpu); /**************************************************************************//** @Function XX_DeallocIntr @@ -208,7 +208,7 @@ t_Error XX_PreallocAndBindIntr(int irq, @Return E_OK on success; error code otherwise.. *//***************************************************************************/ -t_Error XX_DeallocIntr(int irq); +t_Error XX_DeallocIntr(uintptr_t irq); /**************************************************************************//** @Function XX_SetIntr @@ -221,7 +221,7 @@ t_Error XX_DeallocIntr(int irq); @Return E_OK on success; error code otherwise.. *//***************************************************************************/ -t_Error XX_SetIntr(int irq, t_Isr *f_Isr, t_Handle handle); +t_Error XX_SetIntr(uintptr_t irq, t_Isr *f_Isr, t_Handle handle); /**************************************************************************//** @Function XX_FreeIntr @@ -232,7 +232,7 @@ t_Error XX_SetIntr(int irq, t_Isr *f_Isr @Return E_OK on success; error code otherwise.. *//***************************************************************************/ -t_Error XX_FreeIntr(int irq); +t_Error XX_FreeIntr(uintptr_t irq); /**************************************************************************//** @Function XX_EnableIntr @@ -243,7 +243,7 @@ t_Error XX_FreeIntr(int irq); @Return E_OK on success; error code otherwise.. *//***************************************************************************/ -t_Error XX_EnableIntr(int irq); +t_Error XX_EnableIntr(uintptr_t irq); /**************************************************************************//** @Function XX_DisableIntr @@ -254,7 +254,7 @@ t_Error XX_EnableIntr(int irq); @Return E_OK on success; error code otherwise.. *//***************************************************************************/ -t_Error XX_DisableIntr(int irq); +t_Error XX_DisableIntr(uintptr_t irq); #if !(defined(__MWERKS__) && defined(OPTIMIZED_FOR_SPEED)) /**************************************************************************//** Modified: head/sys/contrib/ncsw/user/env/xx.c ============================================================================== --- head/sys/contrib/ncsw/user/env/xx.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/contrib/ncsw/user/env/xx.c Tue Oct 18 00:55:15 2016 (r307542) @@ -368,7 +368,7 @@ XX_Dispatch(void *arg) } t_Error -XX_PreallocAndBindIntr(int irq, unsigned int cpu) +XX_PreallocAndBindIntr(uintptr_t irq, unsigned int cpu) { struct resource *r; unsigned int inum; @@ -388,7 +388,7 @@ XX_PreallocAndBindIntr(int irq, unsigned } t_Error -XX_DeallocIntr(int irq) +XX_DeallocIntr(uintptr_t irq) { struct resource *r; unsigned int inum; @@ -404,7 +404,7 @@ XX_DeallocIntr(int irq) } t_Error -XX_SetIntr(int irq, t_Isr *f_Isr, t_Handle handle) +XX_SetIntr(uintptr_t irq, t_Isr *f_Isr, t_Handle handle) { device_t dev; struct resource *r; @@ -453,7 +453,7 @@ finish: } t_Error -XX_FreeIntr(int irq) +XX_FreeIntr(uintptr_t irq) { device_t dev; struct resource *r; @@ -477,7 +477,7 @@ XX_FreeIntr(int irq) } t_Error -XX_EnableIntr(int irq) +XX_EnableIntr(uintptr_t irq) { struct resource *r; @@ -490,7 +490,7 @@ XX_EnableIntr(int irq) } t_Error -XX_DisableIntr(int irq) +XX_DisableIntr(uintptr_t irq) { struct resource *r; Modified: head/sys/dev/dpaa/bman.c ============================================================================== --- head/sys/dev/dpaa/bman.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/dev/dpaa/bman.c Tue Oct 18 00:55:15 2016 (r307542) @@ -114,7 +114,7 @@ bman_attach(device_t dev) bp.totalNumOfBuffers = BMAN_MAX_BUFFERS; bp.f_Exception = bman_exception; bp.h_App = sc; - bp.errIrq = (int)sc->sc_ires; + bp.errIrq = (uintptr_t)sc->sc_ires; bp.partBpidBase = 0; bp.partNumOfPools = BM_MAX_NUM_OF_POOLS; printf("base address: %llx\n", (uint64_t)bp.baseAddress); Modified: head/sys/dev/dpaa/bman_portals.c ============================================================================== --- head/sys/dev/dpaa/bman_portals.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/dev/dpaa/bman_portals.c Tue Oct 18 00:55:15 2016 (r307542) @@ -95,7 +95,7 @@ bman_portals_detach(device_t dev) } if (sc->sc_dp[i].dp_ires != NULL) { - XX_DeallocIntr((int)sc->sc_dp[i].dp_ires); + XX_DeallocIntr((uintptr_t)sc->sc_dp[i].dp_ires); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_dp[i].dp_irid, sc->sc_dp[i].dp_ires); } @@ -116,7 +116,8 @@ bman_portal_setup(struct bman_softc *bsc struct dpaa_portals_softc *sc; t_BmPortalParam bpp; t_Handle portal; - unsigned int cpu, p; + unsigned int cpu; + uintptr_t p; /* Return NULL if we're not ready or while detach */ if (bp_sc == NULL) @@ -129,9 +130,9 @@ bman_portal_setup(struct bman_softc *bsc cpu = PCPU_GET(cpuid); /* Check if portal is ready */ - while (atomic_cmpset_acq_32((uint32_t *)&sc->sc_dp[cpu].dp_ph, + while (atomic_cmpset_acq_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph, 0, -1) == 0) { - p = atomic_load_acq_32((uint32_t *)&sc->sc_dp[cpu].dp_ph); + p = atomic_load_acq_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph); /* Return if portal is already initialized */ if (p != 0 && p != -1) { @@ -153,7 +154,7 @@ bman_portal_setup(struct bman_softc *bsc bpp.ciBaseAddress = rman_get_bushandle(sc->sc_rres[1]); bpp.h_Bm = bsc->sc_bh; bpp.swPortalId = cpu; - bpp.irq = (int)sc->sc_dp[cpu].dp_ires; + bpp.irq = (uintptr_t)sc->sc_dp[cpu].dp_ires; portal = BM_PORTAL_Config(&bpp); if (portal == NULL) @@ -162,8 +163,7 @@ bman_portal_setup(struct bman_softc *bsc if (BM_PORTAL_Init(portal) != E_OK) goto err; - atomic_store_rel_32((uint32_t *)&sc->sc_dp[cpu].dp_ph, - (uint32_t)portal); + atomic_store_rel_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph, (uintptr_t)portal); sched_unpin(); @@ -173,7 +173,7 @@ err: if (portal != NULL) BM_PORTAL_Free(portal); - atomic_store_rel_32((uint32_t *)&sc->sc_dp[cpu].dp_ph, 0); + atomic_store_rel_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph, 0); sched_unpin(); return (NULL); Modified: head/sys/dev/dpaa/fman.c ============================================================================== --- head/sys/dev/dpaa/fman.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/dev/dpaa/fman.c Tue Oct 18 00:55:15 2016 (r307542) @@ -66,8 +66,8 @@ enum fman_mu_ram_map { struct fman_config { device_t fman_device; uintptr_t mem_base_addr; - int irq_num; - int err_irq_num; + uintptr_t irq_num; + uintptr_t err_irq_num; uint8_t fm_id; t_FmExceptionsCallback *exception_callback; t_FmBusErrorCallback *bus_error_callback; @@ -282,8 +282,8 @@ fman_attach(device_t dev) cfg.fman_device = dev; cfg.fm_id = device_get_unit(dev); cfg.mem_base_addr = rman_get_bushandle(sc->mem_res); - cfg.irq_num = (int)sc->irq_res; - cfg.err_irq_num = (int)sc->err_irq_res; + cfg.irq_num = (uintptr_t)sc->irq_res; + cfg.err_irq_num = (uintptr_t)sc->err_irq_res; cfg.exception_callback = fman_exception_callback; cfg.bus_error_callback = fman_error_callback; Modified: head/sys/dev/dpaa/portals_common.c ============================================================================== --- head/sys/dev/dpaa/portals_common.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/dev/dpaa/portals_common.c Tue Oct 18 00:55:15 2016 (r307542) @@ -121,7 +121,7 @@ dpaa_portal_alloc_res(device_t dev, stru return (ENXIO); } - err = XX_PreallocAndBindIntr((int)sc->sc_dp[cpu].dp_ires, cpu); + err = XX_PreallocAndBindIntr((uintptr_t)sc->sc_dp[cpu].dp_ires, cpu); if (err != E_OK) { device_printf(dev, "Could not prealloc and bind interrupt\n"); Modified: head/sys/dev/dpaa/qman.c ============================================================================== --- head/sys/dev/dpaa/qman.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/dev/dpaa/qman.c Tue Oct 18 00:55:15 2016 (r307542) @@ -205,7 +205,7 @@ qman_attach(device_t dev) qp.pfdrMemPartitionId = NCSW_MASTER_ID; qp.f_Exception = qman_exception; qp.h_App = sc; - qp.errIrq = (int)sc->sc_ires; + qp.errIrq = (uintptr_t)sc->sc_ires; qp.partFqidBase = QMAN_FQID_BASE; qp.partNumOfFqids = QMAN_MAX_FQIDS; qp.partCgsBase = 0; @@ -255,7 +255,7 @@ qman_detach(device_t dev) QM_Free(sc->sc_qh); if (sc->sc_ires != NULL) - XX_DeallocIntr((int)sc->sc_ires); + XX_DeallocIntr((uintptr_t)sc->sc_ires); if (sc->sc_ires != NULL) bus_release_resource(dev, SYS_RES_IRQ, Modified: head/sys/dev/dpaa/qman_portals.c ============================================================================== --- head/sys/dev/dpaa/qman_portals.c Mon Oct 17 23:25:31 2016 (r307541) +++ head/sys/dev/dpaa/qman_portals.c Tue Oct 18 00:55:15 2016 (r307542) @@ -100,7 +100,7 @@ qman_portals_detach(device_t dev) } if (sc->sc_dp[i].dp_ires != NULL) { - XX_DeallocIntr((int)sc->sc_dp[i].dp_ires); + XX_DeallocIntr((uintptr_t)sc->sc_dp[i].dp_ires); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_dp[i].dp_irid, sc->sc_dp[i].dp_ires); } @@ -120,7 +120,8 @@ qman_portal_setup(struct qman_softc *qsc { struct dpaa_portals_softc *sc; t_QmPortalParam qpp; - unsigned int cpu, p; + unsigned int cpu; + uintptr_t p; t_Handle portal; /* Return NULL if we're not ready or while detach */ @@ -134,9 +135,9 @@ qman_portal_setup(struct qman_softc *qsc cpu = PCPU_GET(cpuid); /* Check if portal is ready */ - while (atomic_cmpset_acq_32((uint32_t *)&sc->sc_dp[cpu].dp_ph, + while (atomic_cmpset_acq_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph, 0, -1) == 0) { - p = atomic_load_acq_32((uint32_t *)&sc->sc_dp[cpu].dp_ph); + p = atomic_load_acq_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph); /* Return if portal is already initialized */ if (p != 0 && p != -1) { @@ -158,7 +159,7 @@ qman_portal_setup(struct qman_softc *qsc qpp.ciBaseAddress = rman_get_bushandle(sc->sc_rres[1]); qpp.h_Qm = qsc->sc_qh; qpp.swPortalId = cpu; - qpp.irq = (int)sc->sc_dp[cpu].dp_ires; + qpp.irq = (uintptr_t)sc->sc_dp[cpu].dp_ires; qpp.fdLiodnOffset = 0; qpp.f_DfltFrame = qman_received_frame_callback; qpp.f_RejectedFrame = qman_rejected_frame_callback; @@ -174,8 +175,8 @@ qman_portal_setup(struct qman_softc *qsc if (QM_PORTAL_AddPoolChannel(portal, QMAN_COMMON_POOL_CHANNEL) != E_OK) goto err; - atomic_store_rel_32((uint32_t *)&sc->sc_dp[cpu].dp_ph, - (uint32_t)portal); + atomic_store_rel_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph, + (uintptr_t)portal); sched_unpin(); return (portal); From owner-svn-src-head@freebsd.org Tue Oct 18 01:28:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0D94C15EFB; Tue, 18 Oct 2016 01:28:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EDCFB4F; Tue, 18 Oct 2016 01:28:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22d.google.com with SMTP id o68so312102664qkf.3; Mon, 17 Oct 2016 18:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iFsBrXEtyh+ZxOLQmTxC5bIW3J0KsifhjXjaDDURPyg=; b=yEu2pwcEZ8bfGKCEMGPAShtvaA/WXCZL8tf6nD5YKXlGind4gq5y1ftLV/EKVzfxnJ KeWlZ+CpmKfG5FOyxIc5jTXuBL9cbmm05T9FncWq4UXbl9fTiCTFIxJEXBCKbTXa5/Cp 9taefNTk3dRkvQJKT/q3ZSggc6DeTik/MrGhQlJFX5VuACaInbINyKbKAs77Us6b6x9U iec9wUeyNMtvrL/PZr4nuKx6lXHN1zy8zZgsKMwyQ4oyJLZamguc2cij+1WgX1c+reoV oVDmczqOgP66cAmjT7xAHvvNfrIF7YiR5lD+nQPnp7RjMvteU8egBXhBF64EehSFMecJ Afyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iFsBrXEtyh+ZxOLQmTxC5bIW3J0KsifhjXjaDDURPyg=; b=XObcrKwoe6E7O76PFKP5gmvCZQW33QQ4kL2lBLBB8TQv0N9HkIEs0huq6vrShjSWrQ 643zdrL3yiZm+RnvHne8gjro54W6HacagkuXxUes/n6Axvp8LVcoNh4qXcqku/pLHgKk c3nCqPRVrtxne3Ngaf3gXbkQLPDWf7dZ0+ENTgHgwztwncUcVEIRDywczOE623+ZcYe3 OgsfHmTGO9ioBXuqaTgq02zSt6vpycHykg+s8H6tMzF/+yoOOpEA6tyaKGLt8WtZoca6 tRPfpH2ChIPh4Cqu6LXWV0s1yvNetHWgrheUJUEwB4T95ZGoQ/jpTX5b3V5lGbnjxmo4 +qLw== X-Gm-Message-State: AA6/9RkLadomM8kw2v7+LCr25OOrcYWwA5ChPmRVBXXUBfUkC3W/akkLh7LTOPHWubGeqn4quoBPfD0Z5nTZrw== X-Received: by 10.55.215.93 with SMTP id m90mr321549qki.40.1476754089383; Mon, 17 Oct 2016 18:28:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.29.33 with HTTP; Mon, 17 Oct 2016 18:28:08 -0700 (PDT) In-Reply-To: <201610081857.u98IvB7l012374@repo.freebsd.org> References: <201610081857.u98IvB7l012374@repo.freebsd.org> From: Ngie Cooper Date: Mon, 17 Oct 2016 18:28:08 -0700 Message-ID: Subject: Re: svn commit: r306864 - head To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 01:28:10 -0000 On Sat, Oct 8, 2016 at 11:57 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Oct 8 18:57:11 2016 > New Revision: 306864 > URL: https://svnweb.freebsd.org/changeset/base/306864 > > Log: > groff is not needed in the bootstrap tools if the system is built > WITHOUT_SHAREDOCS > > MFC after: 2 weeks > > Modified: > head/Makefile.inc1 This breaks buildworld when WITHOUT_GROFF is set and WITHOUT_SHAREDOCS isn't set. Thanks, -Ngie From owner-svn-src-head@freebsd.org Tue Oct 18 01:42:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AE9EC1530A; Tue, 18 Oct 2016 01:42:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 F1F84388; Tue, 18 Oct 2016 01:42:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9I1ghgF033296; Tue, 18 Oct 2016 01:42:43 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I1ggaj033294; Tue, 18 Oct 2016 01:42:42 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201610180142.u9I1ggaj033294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 18 Oct 2016 01:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307543 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 01:42:44 -0000 Author: marcel Date: Tue Oct 18 01:42:42 2016 New Revision: 307543 URL: https://svnweb.freebsd.org/changeset/base/307543 Log: Add LORDER, TSORT and TSORTFLAGS variables and replace the hardcoded utility names and tsort flags. Modified: head/share/mk/bsd.lib.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Oct 18 00:55:15 2016 (r307542) +++ head/share/mk/bsd.lib.mk Tue Oct 18 01:42:42 2016 (r307543) @@ -178,7 +178,8 @@ _LIBS= lib${LIB_PRIVATE}${LIB}.a lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} - ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} + ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \ + ${LORDER} ${OBJS} ${STATICOBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD} ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif @@ -193,7 +194,8 @@ CLEANFILES+= ${POBJS} lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} - ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${POBJS} | tsort -q` ${ARADD} + ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \ + ${LORDER} ${POBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD} ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif @@ -241,7 +243,8 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .endif ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} \ - `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${SOBJS} | tsort -q` ${LDADD} + `NM='${NM}' NMFLAGS='${NMFLAGS}' ${LORDER} ${SOBJS} | \ + ${TSORT} ${TSORTFLAGS}` ${LDADD} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue Oct 18 00:55:15 2016 (r307542) +++ head/share/mk/sys.mk Tue Oct 18 01:42:42 2016 (r307543) @@ -229,6 +229,8 @@ LINTLIBFLAGS ?= -cghapbxu -C ${LIB} MAKE ?= make .if !defined(%POSIX) +LORDER ?= lorder + NM ?= nm NMFLAGS ?= @@ -242,6 +244,9 @@ PFLAGS ?= RC ?= f77 RFLAGS ?= + +TSORT ?= tsort +TSORTFLAGS ?= -q .endif SHELL ?= sh From owner-svn-src-head@freebsd.org Tue Oct 18 01:55:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CD6CC156EC; Tue, 18 Oct 2016 01:55:09 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 5AE0DBBE; Tue, 18 Oct 2016 01:55:09 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9I1t8O1037298; Tue, 18 Oct 2016 01:55:08 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I1t79S037286; Tue, 18 Oct 2016 01:55:07 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201610180155.u9I1t79S037286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 18 Oct 2016 01:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307544 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 01:55:09 -0000 Author: marcel Date: Tue Oct 18 01:55:07 2016 New Revision: 307544 URL: https://svnweb.freebsd.org/changeset/base/307544 Log: o Provide a private definition for UUIDs (mkimg_uuid_t) because UUIDs are not portable. o Move mkimg_uuid() to a new file and merge both gpt_uuid_enc() and vhd_uuid_enc() into a single mkimg_uuid_enc() that lives in the same file. o Move the OS-specific implementation of generating a UUID to osdep_uuidgen() and provide the implementations for FreeBSD, macOS and Linux. o Expect the partitioning scheme headers to be found by having a search to the directory in which the headers live. This avoids conflicts on non-FreeBSD machines. Added: head/usr.bin/mkimg/uuid.c (contents, props changed) Modified: head/usr.bin/mkimg/Makefile head/usr.bin/mkimg/apm.c head/usr.bin/mkimg/bsd.c head/usr.bin/mkimg/ebr.c head/usr.bin/mkimg/gpt.c head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/mkimg.c head/usr.bin/mkimg/mkimg.h head/usr.bin/mkimg/pc98.c head/usr.bin/mkimg/vhd.c head/usr.bin/mkimg/vtoc8.c Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/Makefile Tue Oct 18 01:55:07 2016 (r307544) @@ -3,15 +3,15 @@ .include PROG= mkimg -SRCS= format.c image.c mkimg.c scheme.c +SRCS= format.c image.c mkimg.c scheme.c uuid.c MAN= mkimg.1 -MKIMG_VERSION=20151211 +MKIMG_VERSION=20161016 mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE -CFLAGS+=-I${.CURDIR:H:H}/sys +CFLAGS+=-I${SRCTOP}/sys/sys/disk # List of formats to support SRCS+= \ Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/apm.c Tue Oct 18 01:55:07 2016 (r307544) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/bsd.c Tue Oct 18 01:55:07 2016 (r307544) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" Modified: head/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/ebr.c Tue Oct 18 01:55:07 2016 (r307544) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/gpt.c Tue Oct 18 01:55:07 2016 (r307544) @@ -33,26 +33,25 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include +#include +#include #include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -static uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; -static uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; -static uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; -static uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; -static uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; -static uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; -static uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; -static uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; -static uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR; -static uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static mkimg_uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; +static mkimg_uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; +static mkimg_uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static mkimg_uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; +static mkimg_uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; +static mkimg_uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; +static mkimg_uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; +static mkimg_uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; +static mkimg_uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR; +static mkimg_uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; static struct mkimg_alias gpt_aliases[] = { { ALIAS_EFI, ALIAS_PTR2TYPE(&gpt_uuid_efi) }, @@ -126,21 +125,6 @@ crc32(const void *buf, size_t sz) return (crc ^ ~0U); } -static void -gpt_uuid_enc(void *buf, const uuid_t *uuid) -{ - uint8_t *p = buf; - int i; - - le32enc(p, uuid->time_low); - le16enc(p + 4, uuid->time_mid); - le16enc(p + 6, uuid->time_hi_and_version); - p[8] = uuid->clock_seq_hi_and_reserved; - p[9] = uuid->clock_seq_low; - for (i = 0; i < _UUID_NODE_LEN; i++) - p[10 + i] = uuid->node[i]; -} - static u_int gpt_tblsz(void) { @@ -194,7 +178,7 @@ gpt_write_pmbr(lba_t blks, void *bootcod static struct gpt_ent * gpt_mktbl(u_int tblsz) { - uuid_t uuid; + mkimg_uuid_t uuid; struct gpt_ent *tbl, *ent; struct part *part; int c, idx; @@ -205,9 +189,9 @@ gpt_mktbl(u_int tblsz) TAILQ_FOREACH(part, &partlist, link) { ent = tbl + part->index; - gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); + mkimg_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); mkimg_uuid(&uuid); - gpt_uuid_enc(&ent->ent_uuid, &uuid); + mkimg_uuid_enc(&ent->ent_uuid, &uuid); le64enc(&ent->ent_lba_start, part->block); le64enc(&ent->ent_lba_end, part->block + part->size - 1); if (part->label != NULL) { @@ -238,7 +222,7 @@ gpt_write_hdr(struct gpt_hdr *hdr, uint6 static int gpt_write(lba_t imgsz, void *bootcode) { - uuid_t uuid; + mkimg_uuid_t uuid; struct gpt_ent *tbl; struct gpt_hdr *hdr; uint32_t crc; @@ -275,7 +259,7 @@ gpt_write(lba_t imgsz, void *bootcode) le64enc(&hdr->hdr_lba_start, 2 + tblsz); le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); mkimg_uuid(&uuid); - gpt_uuid_enc(&hdr->hdr_uuid, &uuid); + mkimg_uuid_enc(&hdr->hdr_uuid, &uuid); le32enc(&hdr->hdr_entries, nparts); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/mbr.c Tue Oct 18 01:55:07 2016 (r307544) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/mkimg.c Tue Oct 18 01:55:07 2016 (r307544) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -374,22 +373,6 @@ mkimg_chs(lba_t lba, u_int maxcyl, u_int *secp = sec; } -void -mkimg_uuid(struct uuid *uuid) -{ - static uint8_t gen[sizeof(struct uuid)]; - u_int i; - - if (!unit_testing) { - uuidgen(uuid, 1); - return; - } - - for (i = 0; i < sizeof(gen); i++) - gen[i]++; - memcpy(uuid, gen, sizeof(uuid_t)); -} - static int capacity_resize(lba_t end) { Modified: head/usr.bin/mkimg/mkimg.h ============================================================================== --- head/usr.bin/mkimg/mkimg.h Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/mkimg.h Tue Oct 18 01:55:07 2016 (r307544) @@ -30,6 +30,7 @@ #define _MKIMG_MKIMG_H_ #include +#include struct part { TAILQ_ENTRY(part) link; @@ -89,7 +90,17 @@ ssize_t sparse_write(int, const void *, void mkimg_chs(lba_t, u_int, u_int *, u_int *, u_int *); -struct uuid; -void mkimg_uuid(struct uuid *); +struct mkimg_uuid { + uint32_t time_low; + uint16_t time_mid; + uint16_t time_hi_and_version; + uint8_t clock_seq_hi_and_reserved; + uint8_t clock_seq_low; + uint8_t node[6]; +}; +typedef struct mkimg_uuid mkimg_uuid_t; + +void mkimg_uuid(mkimg_uuid_t *); +void mkimg_uuid_enc(void *, const mkimg_uuid_t *); #endif /* _MKIMG_MKIMG_H_ */ Modified: head/usr.bin/mkimg/pc98.c ============================================================================== --- head/usr.bin/mkimg/pc98.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/pc98.c Tue Oct 18 01:55:07 2016 (r307544) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" Added: head/usr.bin/mkimg/uuid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/uuid.c Tue Oct 18 01:55:07 2016 (r307544) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2016 Marcel Moolenaar + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "endian.h" +#include "image.h" +#include "mkimg.h" + +static void osdep_uuidgen(mkimg_uuid_t *); + +#ifdef __APPLE__ +#include + +static void +osdep_uuidgen(mkimg_uuid_t *uuid) +{ + + uuid_generate_time((void *)uuid); +} +#endif /* __APPLE__ */ + +#ifdef __FreeBSD__ +#include + +static void +osdep_uuidgen(mkimg_uuid_t *uuid) +{ + + uuidgen((void *)uuid, 1); +} +#endif /* __FreeBSD__ */ + +#ifdef __linux__ +#include +#include + +static void +osdep_uuidgen(mkimg_uuid_t *uuid) +{ + struct timespec tp; + uint64_t time = 0x01B21DD213814000LL; + u_int i; + uint16_t seq; + + if (clock_gettime(CLOCK_REALTIME, &tp) == -1) + abort(); + + time += (uint64_t)tp.tv_sec * 10000000LL; + time += tp.tv_nsec / 100; + + uuid->time_low = (uint32_t)time; + uuid->time_mid = (uint16_t)(time >> 32); + uuid->time_hi_and_version = (uint16_t)(time >> 48) & 0xfff; + uuid->time_hi_and_version |= 1 << 12; + + seq = random(); + + uuid->clock_seq_hi_and_reserved = (uint8_t)(seq >> 8) & 0x3f; + uuid->clock_seq_low = (uint8_t)seq; + + for (i = 0; i < 6; i++) + uuid->node[i] = (uint8_t)random(); + uuid->node[0] |= 0x01; +} +#endif /* __linux__ */ + +void +mkimg_uuid(mkimg_uuid_t *uuid) +{ + static uint8_t gen[sizeof(mkimg_uuid_t)]; + u_int i; + + if (!unit_testing) { + osdep_uuidgen(uuid); + return; + } + + for (i = 0; i < sizeof(gen); i++) + gen[i]++; + memcpy(uuid, gen, sizeof(*uuid)); +} + +void +mkimg_uuid_enc(void *buf, const mkimg_uuid_t *uuid) +{ + uint8_t *p = buf; + u_int i; + + le32enc(p, uuid->time_low); + le16enc(p + 4, uuid->time_mid); + le16enc(p + 6, uuid->time_hi_and_version); + p[8] = uuid->clock_seq_hi_and_reserved; + p[9] = uuid->clock_seq_low; + for (i = 0; i < 6; i++) + p[10 + i] = uuid->node[i]; +} Modified: head/usr.bin/mkimg/vhd.c ============================================================================== --- head/usr.bin/mkimg/vhd.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/vhd.c Tue Oct 18 01:55:07 2016 (r307544) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "endian.h" #include "image.h" @@ -92,7 +91,7 @@ struct vhd_footer { #define VHD_DISK_TYPE_DYNAMIC 3 #define VHD_DISK_TYPE_DIFF 4 uint32_t checksum; - uuid_t id; + mkimg_uuid_t id; uint8_t saved_state; uint8_t _reserved[427]; }; @@ -201,25 +200,10 @@ vhd_timestamp(void) } static void -vhd_uuid_enc(void *buf, const uuid_t *uuid) -{ - uint8_t *p = buf; - int i; - - be32enc(p, uuid->time_low); - be16enc(p + 4, uuid->time_mid); - be16enc(p + 6, uuid->time_hi_and_version); - p[8] = uuid->clock_seq_hi_and_reserved; - p[9] = uuid->clock_seq_low; - for (i = 0; i < _UUID_NODE_LEN; i++) - p[10 + i] = uuid->node[i]; -} - -static void vhd_make_footer(struct vhd_footer *footer, uint64_t image_size, uint32_t disk_type, uint64_t data_offset) { - uuid_t id; + mkimg_uuid_t id; memset(footer, 0, sizeof(*footer)); be64enc(&footer->cookie, VHD_FOOTER_COOKIE); @@ -236,7 +220,7 @@ vhd_make_footer(struct vhd_footer *foote be16enc(&footer->geometry.cylinders, footer->geometry.cylinders); be32enc(&footer->disk_type, disk_type); mkimg_uuid(&id); - vhd_uuid_enc(&footer->id, &id); + mkimg_uuid_enc(&footer->id, &id); be32enc(&footer->checksum, vhd_checksum(footer, sizeof(*footer))); } @@ -261,7 +245,7 @@ struct vhd_dyn_header { uint32_t max_entries; uint32_t block_size; uint32_t checksum; - uuid_t parent_id; + mkimg_uuid_t parent_id; uint32_t parent_timestamp; char _reserved1[4]; uint16_t parent_name[256]; /* UTF-16 */ Modified: head/usr.bin/mkimg/vtoc8.c ============================================================================== --- head/usr.bin/mkimg/vtoc8.c Tue Oct 18 01:42:42 2016 (r307543) +++ head/usr.bin/mkimg/vtoc8.c Tue Oct 18 01:55:07 2016 (r307544) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "endian.h" #include "image.h" From owner-svn-src-head@freebsd.org Tue Oct 18 02:40:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63AD2C16639; Tue, 18 Oct 2016 02:40:26 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 358C3FEB; Tue, 18 Oct 2016 02:40:26 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9I2eP0Z052448; Tue, 18 Oct 2016 02:40:25 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I2ePK9052447; Tue, 18 Oct 2016 02:40:25 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201610180240.u9I2ePK9052447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Tue, 18 Oct 2016 02:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307545 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 02:40:26 -0000 Author: hiren Date: Tue Oct 18 02:40:25 2016 New Revision: 307545 URL: https://svnweb.freebsd.org/changeset/base/307545 Log: Make sure tcp_mss() has the same check as tcp_mss_update() to have t_maxseg set to at least 64. This is still just a coverup to avoid kernel panic and not an actual fix. PR: 213232 Reviewed by: glebius MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D8272 Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Oct 18 01:55:07 2016 (r307544) +++ head/sys/netinet/tcp_input.c Tue Oct 18 02:40:25 2016 (r307545) @@ -3758,7 +3758,15 @@ tcp_mss(struct tcpcb *tp, int offer) (void)sbreserve_locked(&so->so_snd, bufsize, so, NULL); } SOCKBUF_UNLOCK(&so->so_snd); - tp->t_maxseg = mss; + /* + * Sanity check: make sure that maxseg will be large + * enough to allow some data on segments even if the + * all the option space is used (40bytes). Otherwise + * funny things may happen in tcp_output. + * + * XXXGL: shouldn't we reserve space for IP/IPv6 options? + */ + tp->t_maxseg = max(mss, 64); SOCKBUF_LOCK(&so->so_rcv); if ((so->so_rcv.sb_hiwat == V_tcp_recvspace) && metrics.rmx_recvpipe) From owner-svn-src-head@freebsd.org Tue Oct 18 03:34:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD5F0C15748; Tue, 18 Oct 2016 03:34:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E3AAEFB; Tue, 18 Oct 2016 03:34:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id 128so87406330pfz.0; Mon, 17 Oct 2016 20:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=K4VqSCuaFnafuc8YOXSBxZIzruEhgc0Zv1eW90u+AFU=; b=c0W6BpKOiqWnlyctZJOusp9FXgiBfePT6lN2DIEtxsjSCicAESGl1WA1Yh9OpNS7NU Q4oL0EUHRVdN7Fuaf8ban6OHCoe8qUdGu+GUS4DWsE3jYU3BVqB7hYxyDdR3UsC46o8s o4JDZzmaWmvGLJE99NuhlBJDNMchAdv5eZ38J0B1k/ekv0Puwt3sGmnM7ePTQXoYmztv spjmPPx3wvy0sihBryCiRanKOYVfa9grQsqMgxAxjlGEFPv55YGqgPXlM/ZQxzBiZh1j jngeyUrFwmJLVtJB7CdRaekMWgwtbnlRIxzLn1A3VKmmtia4H4HwRY1/gdQhzjtj6dNB 5tgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=K4VqSCuaFnafuc8YOXSBxZIzruEhgc0Zv1eW90u+AFU=; b=W/ZTG5HXkekxkGdx26Z+LybFawQmDMifiCBljFrK4bpA3RSsiMnXeHsBRWIsJEygRf qcVF+GOC0zGz7byPoeySuSQSl5pTT8pvg7E62BNTMwSaNVq8H7rfhYxPtrnzrjN0Pr7q LTU+D/cwZUWp5YFwCSDWfBOA1Fgzl9FpWQHWuqsLhMEjWMUqHop0KGWqKmLE+uRDchUA drObOoO+H2B7hdM8JUJjjuSauHiDIPifrj6Io+ONwXKTU3u1r79gt0CV80YyimNHixyl kfGT90Bb5aXT4SiOe9JX7LpfvZPGTVOHPMoCNlNd5VwxglJWIqHJ7Fd8Hv8EMdkA+pP1 +lXw== X-Gm-Message-State: AA6/9RnZP6Or6kjXWOK/eduyPN28jEvK5bY4SLj4vnNGs0OgmZNvz0Ha4qo4v5iLGuypFw== X-Received: by 10.98.35.220 with SMTP id q89mr1121317pfj.141.1476761648877; Mon, 17 Oct 2016 20:34:08 -0700 (PDT) Received: from ?IPv6:2607:fb90:80a0:ea79:64a1:846c:3aca:6fda? ([2607:fb90:80a0:ea79:64a1:846c:3aca:6fda]) by smtp.gmail.com with ESMTPSA id z87sm761877pfk.67.2016.10.17.20.34.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 20:34:08 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r307544 - head/usr.bin/mkimg From: Ngie Cooper X-Mailer: iPhone Mail (14A456) In-Reply-To: <201610180155.u9I1t79S037286@repo.freebsd.org> Date: Mon, 17 Oct 2016 20:34:06 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201610180155.u9I1t79S037286@repo.freebsd.org> To: Marcel Moolenaar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 03:34:09 -0000 > On Oct 17, 2016, at 18:55, Marcel Moolenaar wrote: >=20 > Author: marcel > Date: Tue Oct 18 01:55:07 2016 > New Revision: 307544 > URL: https://svnweb.freebsd.org/changeset/base/307544 >=20 > Log: > o Provide a private definition for UUIDs (mkimg_uuid_t) because > UUIDs are not portable. > o Move mkimg_uuid() to a new file and merge both gpt_uuid_enc() > and vhd_uuid_enc() into a single mkimg_uuid_enc() that lives > in the same file. > o Move the OS-specific implementation of generating a UUID to > osdep_uuidgen() and provide the implementations for FreeBSD, > macOS and Linux. > o Expect the partitioning scheme headers to be found by having > a search to the directory in which the headers live. This > avoids conflicts on non-FreeBSD machines. >=20 > Added: > head/usr.bin/mkimg/uuid.c (contents, props changed) > Modified: > head/usr.bin/mkimg/Makefile > head/usr.bin/mkimg/apm.c > head/usr.bin/mkimg/bsd.c > head/usr.bin/mkimg/ebr.c > head/usr.bin/mkimg/gpt.c > head/usr.bin/mkimg/mbr.c > head/usr.bin/mkimg/mkimg.c > head/usr.bin/mkimg/mkimg.h > head/usr.bin/mkimg/pc98.c > head/usr.bin/mkimg/vhd.c > head/usr.bin/mkimg/vtoc8.c >=20 > Modified: head/usr.bin/mkimg/Makefile > =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/mkimg/Makefile Tue Oct 18 01:42:42 2016 (r307543) > +++ head/usr.bin/mkimg/Makefile Tue Oct 18 01:55:07 2016 (r307544) > @@ -3,15 +3,15 @@ > .include >=20 > PROG=3D mkimg > -SRCS=3D format.c image.c mkimg.c scheme.c > +SRCS=3D format.c image.c mkimg.c scheme.c uuid.c > MAN=3D mkimg.1 >=20 > -MKIMG_VERSION=3D20151211 > +MKIMG_VERSION=3D20161016 > mkimg.o: Makefile >=20 > CFLAGS+=3D-DMKIMG_VERSION=3D${MKIMG_VERSION} > CFLAGS+=3D-DSPARSE_WRITE > -CFLAGS+=3D-I${.CURDIR:H:H}/sys > +CFLAGS+=3D-I${SRCTOP}/sys/sys/disk Isn't it a better app idea to maintain the disk/ namespace for includes?= Thanks! -Ngie= From owner-svn-src-head@freebsd.org Tue Oct 18 04:01:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF0F3C140E8; Tue, 18 Oct 2016 04:01:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 90EC3D8E; Tue, 18 Oct 2016 04:01:55 +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 u9I41sa8085765; Tue, 18 Oct 2016 04:01:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I41s94085764; Tue, 18 Oct 2016 04:01:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610180401.u9I41s94085764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Oct 2016 04:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307546 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 04:01:55 -0000 Author: imp Date: Tue Oct 18 04:01:54 2016 New Revision: 307546 URL: https://svnweb.freebsd.org/changeset/base/307546 Log: Skip the checks in mtools. They are false positive for errors. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Tue Oct 18 02:40:25 2016 (r307545) +++ head/tools/tools/nanobsd/embedded/common Tue Oct 18 04:01:54 2016 (r307546) @@ -207,6 +207,8 @@ create_diskimage_mbr ( ) ( ( local extra i sz fmt fmtarg bootmbr bootbsd skiparg set -o xtrace + # Tell mtools not to be too picky + export MTOOLS_SKIP_CHECK=1 [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}" [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" From owner-svn-src-head@freebsd.org Tue Oct 18 04:01:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20C4EC1410C; Tue, 18 Oct 2016 04:01:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id CC91DDA7; Tue, 18 Oct 2016 04:01:57 +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 u9I41u8D085810; Tue, 18 Oct 2016 04:01:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I41uxe085809; Tue, 18 Oct 2016 04:01:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610180401.u9I41uxe085809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Oct 2016 04:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307547 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 04:01:58 -0000 Author: imp Date: Tue Oct 18 04:01:56 2016 New Revision: 307547 URL: https://svnweb.freebsd.org/changeset/base/307547 Log: Add support for building pandaboard images with nanobsd. Added: head/tools/tools/nanobsd/embedded/pandaboard.cfg (contents, props changed) Added: head/tools/tools/nanobsd/embedded/pandaboard.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/embedded/pandaboard.cfg Tue Oct 18 04:01:56 2016 (r307547) @@ -0,0 +1,36 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2016 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. +# + +NANO_ARCH=armv6 +NANO_KERNEL=PANDABOARD +NANO_DRIVE=mmcsd0 +NANO_NAME=pandaboard +NANO_BOOT_PKG=u-boot-pandaboard +NANO_CPUTYPE=cortex-a9 + +. common # Pull in common definitions, keep last From owner-svn-src-head@freebsd.org Tue Oct 18 04:01:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D02BC14113; Tue, 18 Oct 2016 04:01:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 574F4DE2; Tue, 18 Oct 2016 04:01:59 +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 u9I41w4f085853; Tue, 18 Oct 2016 04:01:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I41wOb085852; Tue, 18 Oct 2016 04:01:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610180401.u9I41wOb085852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Oct 2016 04:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307548 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 04:01:59 -0000 Author: imp Date: Tue Oct 18 04:01:58 2016 New Revision: 307548 URL: https://svnweb.freebsd.org/changeset/base/307548 Log: Also include the DTBs in /boot/dtb for omap4 systems. Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Tue Oct 18 04:01:56 2016 (r307547) +++ head/sys/arm/conf/PANDABOARD Tue Oct 18 04:01:58 2016 (r307548) @@ -30,6 +30,8 @@ hints "PANDABOARD.hints" include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" +makeoptions MODULES_OVERRIDE=dtb/omap4 + options SCHED_ULE # ULE scheduler options PLATFORM options SMP # Enable multiple cores From owner-svn-src-head@freebsd.org Tue Oct 18 04:02:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1FF1C14135; Tue, 18 Oct 2016 04:02:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id A3190E7E; Tue, 18 Oct 2016 04:02:01 +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 u9I4206J085901; Tue, 18 Oct 2016 04:02:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I420q2085899; Tue, 18 Oct 2016 04:02:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610180402.u9I420q2085899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Oct 2016 04:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307549 - in head: sys/modules/dtb/omap4 tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 04:02:02 -0000 Author: imp Date: Tue Oct 18 04:02:00 2016 New Revision: 307549 URL: https://svnweb.freebsd.org/changeset/base/307549 Log: Add preliminary support for Raspberry PI3 images to nanobsd. Added: head/sys/modules/dtb/omap4/ head/sys/modules/dtb/omap4/Makefile (contents, props changed) head/tools/tools/nanobsd/embedded/rpi3.cfg - copied, changed from r307548, head/tools/tools/nanobsd/embedded/rpi2.cfg Added: head/sys/modules/dtb/omap4/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtb/omap4/Makefile Tue Oct 18 04:02:00 2016 (r307549) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# All the dts files for omap4 systems we support. +DTS= \ + omap4-duovero-parlor.dts \ + pandaboard.dts \ + pandaboard-es.dts + +.include Copied and modified: head/tools/tools/nanobsd/embedded/rpi3.cfg (from r307548, head/tools/tools/nanobsd/embedded/rpi2.cfg) ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi2.cfg Tue Oct 18 04:01:58 2016 (r307548, copy source) +++ head/tools/tools/nanobsd/embedded/rpi3.cfg Tue Oct 18 04:02:00 2016 (r307549) @@ -26,11 +26,10 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 -NANO_KERNEL=RPI2 +NANO_ARCH=aarch64 +NANO_KERNEL=RPI3 NANO_DRIVE=mmcsd0 -NANO_NAME=rpi2 -NANO_BOOT_PKG=u-boot-rpi2 -NANO_CPUTYPE=cortex-a7 +NANO_NAME=rpi3 +NANO_BOOT_PKG=u-boot-rpi3 . common # Pull in common definitions, keep last From owner-svn-src-head@freebsd.org Tue Oct 18 05:26:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5C0FC168DE; Tue, 18 Oct 2016 05:26:24 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (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 ADB6B199; Tue, 18 Oct 2016 05:26:24 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from Marcels-MacBook-Pro.local.mail (cerberus.brkt.com [208.185.168.138]) (authenticated bits=0) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPSA id u9I53ANZ068032 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Oct 2016 22:03:11 -0700 (PDT) (envelope-from marcel@xcllnt.net) Date: Mon, 17 Oct 2016 22:03:04 -0700 From: Marcel Moolenaar To: Ngie Cooper , Marcel Moolenaar Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Message-ID: In-Reply-To: References: <201610180155.u9I1t79S037286@repo.freebsd.org> Subject: Re: svn commit: r307544 - head/usr.bin/mkimg X-Mailer: Airmail (390) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="0376CE22-CEC3-4DF8-A583-3DD8D34EABCF"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.xcllnt.net [50.0.150.214]); Mon, 17 Oct 2016 22:03:11 -0700 (PDT) X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 05:26:25 -0000 --0376CE22-CEC3-4DF8-A583-3DD8D34EABCF Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On October 17, 2016 at 8:34:11 PM, Ngie Cooper (yaneurabeya=40gmail.com) = wrote: > On Oct 17, 2016, at 18:55, Marcel Moolenaar wr= ote:=C2=A0 > *snip* > +C=46LAGS+=3D-I=24=7BSRCTOP=7D/sys/sys/disk=C2=A0 Isn't it a better app idea to maintain the disk/ namespace for includes=3F= =C2=A0 Thanks=21=C2=A0 You mean, add -I=24=7BSRCTOP=7D//sys/sys on the compile line and change t= he code to use =23include =3F Unfortunately, that creates conflicts with header files that are included= as and match headers we have under sys/sys. --0376CE22-CEC3-4DF8-A583-3DD8D34EABCF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using AMPGpg -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYBa0IAAoJEIda8t8f0tjjl2AP/3NaWuvqH10XP/DrbOLimUP5 f9qbjU42j0KkyUHAg2lDSneufGD9HQXrDmdzaMbBU9McYJcLIJU2WICB7EoFP/gS /0C2fZAIDFZ1sw3oEKUVeyx8Vyv9hoJy+c0rk/ijhTVKlOCkT+hlVjeF8jo4y9KB z7X/ustX+gjM7OuPadPlzR84Isqw57mfd5kjbytJ/clxCGaZSJwbLbY0uhZbC8w1 /6aQQsLD5QEYj0minJEkCYhhl1WGXS76BJJYfMeS0FtnY2L6oc3RKgAgxWxkwmRB qJWLBmTZ4LnNElsejGXl8+t8X9+f1YNzL4mCWMhRdcD6SH4vQIPuqa6akQTTsbdj zHp7QpMn2/XYfmuuVrspzuQq1JNLkKb7VplcvSFO5aMhe3VvGL/w0TwS1hNJvMFM /g3JKwAkH/V+cdOGC1d4deVTdiG8HzDYPy5K5mFcylT62oV4B6UvurcNy4QQ0tN7 rLMCJJiTwlJbWxcBxePU6uuoA4LsuoEuI9FbYfg8lQteSuUBr6EN/flgjXKT5lTT 9pXoLso2L4n9YtN/5Ea1PDf1NaPZf9LtTweUczwU1MYI9srrmfH/0eDCrS4faLrp txoGllJPCXITMcrsmgZZb9z6lmcqZs26mriTyBK7aJ/RZZnksMcOwaN83dTsDVh2 ItSJjc+sN77mlCnXipED -----END PGP SIGNATURE----- --0376CE22-CEC3-4DF8-A583-3DD8D34EABCF-- From owner-svn-src-head@freebsd.org Tue Oct 18 05:43:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84694C16F6B; Tue, 18 Oct 2016 05:43: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 mx1.freebsd.org (Postfix) with ESMTPS id 5F742CB2; Tue, 18 Oct 2016 05:43: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 u9I5hD65023919; Tue, 18 Oct 2016 05:43:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I5hDHJ023915; Tue, 18 Oct 2016 05:43:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610180543.u9I5hDHJ023915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Oct 2016 05:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307550 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 05:43:14 -0000 Author: imp Date: Tue Oct 18 05:43:12 2016 New Revision: 307550 URL: https://svnweb.freebsd.org/changeset/base/307550 Log: Add a new flag to mkimg (-a num) to specify the active partition for those partitioning schemes that have this concept. Implement it as an override for mbr's setting 0x80 in the flags for the first partition when we have boot code. Differential Revision: https://reviews.freebsd.org/D4403 Modified: head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/mkimg.1 head/usr.bin/mkimg/mkimg.c head/usr.bin/mkimg/mkimg.h Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Tue Oct 18 04:02:00 2016 (r307549) +++ head/usr.bin/mkimg/mbr.c Tue Oct 18 05:43:12 2016 (r307550) @@ -92,7 +92,12 @@ mbr_write(lba_t imgsz __unused, void *bo TAILQ_FOREACH(part, &partlist, link) { size = round_track(part->size); dp = dpbase + part->index; - dp->dp_flag = (part->index == 0 && bootcode != NULL) ? 0x80 : 0; + if (active_partition != 0) + dp->dp_flag = + (part->index + 1 == active_partition) ? 0x80 : 0; + else + dp->dp_flag = + (part->index == 0 && bootcode != NULL) ? 0x80 : 0; mbr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, part->block); dp->dp_typ = ALIAS_TYPE2INT(part->type); Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Tue Oct 18 04:02:00 2016 (r307549) +++ head/usr.bin/mkimg/mkimg.1 Tue Oct 18 05:43:12 2016 (r307550) @@ -40,6 +40,7 @@ .Op Fl c Ar capacity .Op Fl f Ar format .Op Fl o Ar outfile +.Op Fl a Ar active .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -119,7 +120,7 @@ An empty partition table can be written partitioning scheme with the .Fl s option, but without specifying any partitions. -When the size required to for all the partitions is larger than the +When the size required for all the partitions is larger than the given capacity, then the disk image will be larger than the capacity given. .Pp @@ -139,6 +140,26 @@ utility will generate predictable values .Nm utility will create images that are identical. .Pp +The +.Ar active +option marks a partition as active, if the partitioning +scheme supports it. +Currently, only the +.Ar mbr +scheme supports this concept. +By default, +.Nm +will only mark the first partition as active when boot code is +specified. +Use the +.Ar active +option to override the active partition. +The number specified corresponds to the number after the 's' in the +partition's +.Xr geom 8 +name. +No partitions are marked active when the value is 0. +.Pp A set of long options exist to query about the .Nm utility itself. Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Tue Oct 18 04:02:00 2016 (r307549) +++ head/usr.bin/mkimg/mkimg.c Tue Oct 18 05:43:12 2016 (r307550) @@ -70,6 +70,7 @@ u_int nheads = 1; u_int nsecs = 1; u_int secsz = 512; u_int blksz = 0; +uint32_t active_partition = 0; static void print_formats(int usage) @@ -145,6 +146,7 @@ usage(const char *why) fprintf(stderr, "\t--schemes\t- list partition schemes\n"); fprintf(stderr, "\t--version\t- show version information\n"); fputc('\n', stderr); + fprintf(stderr, "\t-a \t- mark num'th partion as active\n"); fprintf(stderr, "\t-b \t- file containing boot code\n"); fprintf(stderr, "\t-c \t- capacity (in bytes) of the disk\n"); fprintf(stderr, "\t-f \n"); @@ -468,9 +470,14 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "b:c:f:o:p:s:vyH:P:S:T:", + while ((c = getopt_long(argc, argv, "a:b:c:f:o:p:s:vyH:P:S:T:", longopts, NULL)) != -1) { switch (c) { + case 'a': /* ACTIVE PARTITION, if supported */ + error = parse_uint32(&active_partition, 1, 100, optarg); + if (error) + errc(EX_DATAERR, error, "Partition ordinal"); + break; case 'b': /* BOOT CODE */ if (bcfd != -1) usage("multiple bootcode given"); Modified: head/usr.bin/mkimg/mkimg.h ============================================================================== --- head/usr.bin/mkimg/mkimg.h Tue Oct 18 04:02:00 2016 (r307549) +++ head/usr.bin/mkimg/mkimg.h Tue Oct 18 05:43:12 2016 (r307550) @@ -59,6 +59,7 @@ extern u_int nheads; extern u_int nsecs; extern u_int secsz; /* Logical block size. */ extern u_int blksz; /* Physical block size. */ +extern uint32_t active_partition; static inline lba_t round_block(lba_t n) From owner-svn-src-head@freebsd.org Tue Oct 18 06:17:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45993C16C4E; Tue, 18 Oct 2016 06:17:59 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B906AF31; Tue, 18 Oct 2016 06:17:58 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-lf0-x242.google.com with SMTP id x79so30687338lff.2; Mon, 17 Oct 2016 23:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=af/NE6DVbubFXlfawUUpF08VMeqTSTZadgI9P10DCww=; b=t+BGO2B6wfREWJsySZOhI09ZGuxDqvW+aLQVA2uzLjlCe7cI3w/gWo8nhHdRV8dfvJ w10mUG+fcTwigN1uhLyc8SGBimzjbP5W2GEEh1/nlR2OaX+5VNUR1l6paekcbuPM/XGq WR1kI8SFSDBDlG8tK+hkKiWKrX2ygwGJlSeQ5JcQVB0rwgEqau8nItUVjFiBrk92EsbR TO50WuEt1STYbs+oqlei2UpGA5KME+9nG2ykcKl4X+sCaIlTc5ffdKYT4kvHZenqO9m6 nRUmz8yp3L6en+/6sUfqqX7TAJ2f9IORQeJZLVZkf1k/j3jPRERN1nTdF6SoGeE4JQE5 BnOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=af/NE6DVbubFXlfawUUpF08VMeqTSTZadgI9P10DCww=; b=S0Ufs9AlwCsJu3EG7wMJ+uHdqdyhuKhgsKdF/4B8hihUEuQtVVLNshU6WWdur0WlT2 dKGx1QGWWb/TFES1Sxx/D0udA6NAt5BVFrCZ6GP/FuhJQvyjxl4K8EsQbacmuKV2F7oH DEr7/wiy28V9nH3dARY4zxm9J2XpqFoX9SKaxFaVoRvwnLnwl04yPDyWtDq1ynEVPSo7 FeqvX924oTHC0JCR7GGpf3B0mZAJv2/RHG4NEPviGZYbOAr8LpcBW+KFBqInw+OPci8b u1B+GkdAXIh6o9y0ymaKsVJl7zHylCD8a6dA75be890GyHMaKA9jT7xtOP9h2hYqThZ0 H0kQ== X-Gm-Message-State: AA6/9RmU8clGBFtFRlPBZ1cMSrFUQOqvciuiNSa7tBZtKafb2xm1RO+SLqt4pEFp/1A1QQ== X-Received: by 10.28.12.7 with SMTP id 7mr10864435wmm.125.1476771476814; Mon, 17 Oct 2016 23:17:56 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id qo8sm59922538wjc.46.2016.10.17.23.17.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 23:17:56 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 18 Oct 2016 08:17:55 +0200 From: Baptiste Daroussin To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r306864 - head Message-ID: <20161018061755.makbm4tvtb5i6rc4@ivaldir.etoilebsd.net> References: <201610081857.u98IvB7l012374@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rts6hrqscnh4jtq3" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20161014 (1.7.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 06:17:59 -0000 --rts6hrqscnh4jtq3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 17, 2016 at 06:28:08PM -0700, Ngie Cooper wrote: > On Sat, Oct 8, 2016 at 11:57 AM, Baptiste Daroussin wr= ote: > > Author: bapt > > Date: Sat Oct 8 18:57:11 2016 > > New Revision: 306864 > > URL: https://svnweb.freebsd.org/changeset/base/306864 > > > > Log: > > groff is not needed in the bootstrap tools if the system is built > > WITHOUT_SHAREDOCS > > > > MFC after: 2 weeks > > > > Modified: > > head/Makefile.inc1 >=20 > This breaks buildworld when WITHOUT_GROFF is set and > WITHOUT_SHAREDOCS isn't set. Really do you have logs of that? Best regards, Bapt --rts6hrqscnh4jtq3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYBb5TAAoJEGOJi9zxtz5akfcP/jxVxqxU7BpP3SCQCQKG8uxs NL8PFhAhycjNpHwKvOKPSDeT8Ggi/+DPEE+V7vg395F1+XTPfJK+PMbpgqKIt131 JT/DfoyvCtL0tGxr+d7e4NJuNl8rRtaGLOAByqPhr/ZCXS9NfmmyVc0VhqMySfcr RD9flduU+BBsrm33YZHt+PNiDWUx69NQCdVm9+jB+pqoNPxfnGrDNRmYJZekjyz6 xiqCdNCqhtWDRChje8KIIHOhSVHkX0qxiDmiR9r+YP3E7Qm4XR4ogniiWcKt/EeS pTcdeYfNano5tCA/FJphvMtzKjhLozr2YcIVSo23r5skBmYs1CtmXJDqArc8+acX ICL0Fpz+m6opAC8MtzVLdbzEgPoFAo67fWk5tMkOZX05vXq3Sp3wS2NDYMcPufVe otU5OnzkiXegAAIZzM9vHkH6ZmDCCuGbeo4DZLlHGg+I6cNu+tb9yFTMsuFAyXRh Sqg1P7vxlnk4bzi9LKD2oT/27Um26ZxRR0lIMWdY6Quj76jK1TkXSbhEi2USBVYx qwobx/mF+VfJZYV3uBF1zSDq54b1uYtbcg/UbCC630Sg829xoPfUwkGnHCFWGIAq E1ltz7mJRnSzhfDdzZUjo2trQmPT9wPPA3Um8IfGINh6NpI4PNd8helmk+TzrUMk f3SedublC754WNcfncgz =9AQJ -----END PGP SIGNATURE----- --rts6hrqscnh4jtq3-- From owner-svn-src-head@freebsd.org Tue Oct 18 07:16:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5991AC1614C; Tue, 18 Oct 2016 07:16:51 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 33DF829; Tue, 18 Oct 2016 07:16:51 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9I7GoYI057682; Tue, 18 Oct 2016 07:16:50 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9I7GoOU057679; Tue, 18 Oct 2016 07:16:50 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201610180716.u9I7GoOU057679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Tue, 18 Oct 2016 07:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307551 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 07:16:51 -0000 Author: jch Date: Tue Oct 18 07:16:49 2016 New Revision: 307551 URL: https://svnweb.freebsd.org/changeset/base/307551 Log: Fix a double-free when an inp transitions to INP_TIMEWAIT state after having been dropped. This fixes enforces in_pcbdrop() logic in tcp_input(): "in_pcbdrop() is used by TCP to mark an inpcb as unused and avoid future packet delivery or event notification when a socket remains open but TCP has closed." PR: 203175 Reported by: Palle Girgensohn, Slawa Olhovchenkov Tested by: Slawa Olhovchenkov Reviewed by: Slawa Olhovchenkov Approved by: gnn, Slawa Olhovchenkov Differential Revision: https://reviews.freebsd.org/D8211 MFC after: 1 week Sponsored by: Verisign, inc Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Oct 18 05:43:12 2016 (r307550) +++ head/sys/netinet/tcp_input.c Tue Oct 18 07:16:49 2016 (r307551) @@ -920,6 +920,16 @@ findpcb: goto dropwithreset; } INP_WLOCK_ASSERT(inp); + /* + * While waiting for inp lock during the lookup, another thread + * can have dropped the inpcb, in which case we need to loop back + * and try to find a new inpcb to deliver to. + */ + if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + inp = NULL; + goto findpcb; + } if ((inp->inp_flowtype == M_HASHTYPE_NONE) && (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) && ((inp->inp_socket == NULL) || @@ -980,6 +990,10 @@ relocked: if (in_pcbrele_wlocked(inp)) { inp = NULL; goto findpcb; + } else if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + inp = NULL; + goto findpcb; } } else ti_locked = TI_RLOCKED; @@ -1039,6 +1053,10 @@ relocked: if (in_pcbrele_wlocked(inp)) { inp = NULL; goto findpcb; + } else if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + inp = NULL; + goto findpcb; } goto relocked; } else Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Tue Oct 18 05:43:12 2016 (r307550) +++ head/sys/netinet/tcp_timewait.c Tue Oct 18 07:16:49 2016 (r307551) @@ -231,6 +231,10 @@ tcp_twstart(struct tcpcb *tp) INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); + /* A dropped inp should never transition to TIME_WAIT state. */ + KASSERT((inp->inp_flags & INP_DROPPED) == 0, ("tcp_twstart: " + "(inp->inp_flags & INP_DROPPED) != 0")); + if (V_nolocaltimewait) { int error = 0; #ifdef INET6 Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Oct 18 05:43:12 2016 (r307550) +++ head/sys/netinet/tcp_usrreq.c Tue Oct 18 07:16:49 2016 (r307551) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef DDB #include @@ -210,10 +211,26 @@ tcp_detach(struct socket *so, struct inp * In all three cases the tcptw should not be freed here. */ if (inp->inp_flags & INP_DROPPED) { - KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " - "INP_DROPPED && tp != NULL")); in_pcbdetach(inp); - in_pcbfree(inp); + if (__predict_true(tp == NULL)) { + in_pcbfree(inp); + } else { + /* + * This case should not happen as in TIMEWAIT + * state the inp should not be destroyed before + * its tcptw. If INVARIANTS is defined, panic. + */ +#ifdef INVARIANTS + panic("%s: Panic before an inp double-free: " + "INP_TIMEWAIT && INP_DROPPED && tp != NULL" + , __func__); +#else + log(LOG_ERR, "%s: Avoid an inp double-free: " + "INP_TIMEWAIT && INP_DROPPED && tp != NULL" + , __func__); +#endif + INP_WUNLOCK(inp); + } } else { in_pcbdetach(inp); INP_WUNLOCK(inp); From owner-svn-src-head@freebsd.org Tue Oct 18 10:13:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AFB3C17601; Tue, 18 Oct 2016 10:13:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4D043C4C; Tue, 18 Oct 2016 10:13:55 +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 u9IADsXH025158; Tue, 18 Oct 2016 10:13:54 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IADs1j025157; Tue, 18 Oct 2016 10:13:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610181013.u9IADs1j025157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 18 Oct 2016 10:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307553 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 10:13:55 -0000 Author: br Date: Tue Oct 18 10:13:54 2016 New Revision: 307553 URL: https://svnweb.freebsd.org/changeset/base/307553 Log: Skip test on MIPS as it modifies TLS pointer in set_mcontext(). Discussed with: kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 10:12:55 2016 (r307552) +++ head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 10:13:54 2016 (r307553) @@ -97,6 +97,15 @@ ATF_TC_BODY(swapcontext1, tc) { pthread_t thread; +#ifdef __mips__ + /* + * MIPS modifies TLS pointer in set_mcontext(), so + * swapping contexts obtained from different threads + * gives us different pthread_self() return value. + */ + atf_tc_skip("Platform is not supported."); +#endif + oself = (void *)&val1; nself = (void *)&val2; From owner-svn-src-head@freebsd.org Tue Oct 18 10:20:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 736CDC17809; Tue, 18 Oct 2016 10:20:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 45BF7EAB; Tue, 18 Oct 2016 10:20:59 +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 u9IAKwNA025486; Tue, 18 Oct 2016 10:20:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IAKwmi025485; Tue, 18 Oct 2016 10:20:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610181020.u9IAKwmi025485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 18 Oct 2016 10:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307554 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 10:20:59 -0000 Author: br Date: Tue Oct 18 10:20:58 2016 New Revision: 307554 URL: https://svnweb.freebsd.org/changeset/base/307554 Log: Fix comment. We have different VM layout on MIPS, so test is skipped. Requested by: kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/tests/sys/kern/kern_copyin.c Modified: head/tests/sys/kern/kern_copyin.c ============================================================================== --- head/tests/sys/kern/kern_copyin.c Tue Oct 18 10:13:54 2016 (r307553) +++ head/tests/sys/kern/kern_copyin.c Tue Oct 18 10:20:58 2016 (r307554) @@ -60,7 +60,12 @@ ATF_TC_BODY(kern_copyin, tc) char template[] = "copyin.XXXXXX"; #ifdef __mips__ - /* MIPS has no shared page implemented yet. */ + /* + * MIPS has different VM layout: the UVA map on mips ends the + * highest mapped entry at the VM_MAXUSER_ADDRESS - PAGE_SIZE, + * while all other arches map either stack or shared page up + * to the VM_MAXUSER_ADDRESS. + */ atf_tc_skip("Platform is not supported."); #endif From owner-svn-src-head@freebsd.org Tue Oct 18 12:21:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 159A7C14751; Tue, 18 Oct 2016 12:21:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id DBAEBA9D; Tue, 18 Oct 2016 12:21:46 +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 u9ICLkbH073738; Tue, 18 Oct 2016 12:21:46 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ICLkNc073737; Tue, 18 Oct 2016 12:21:46 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201610181221.u9ICLkNc073737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 18 Oct 2016 12:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307556 - head/sys/arm/nvidia/tegra124 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 12:21:47 -0000 Author: mmel Date: Tue Oct 18 12:21:45 2016 New Revision: 307556 URL: https://svnweb.freebsd.org/changeset/base/307556 Log: TEGRA: Really implement early printf. The original version was cut&pasted from another SoC. Pointy-hat to: mmel MFC after: 2 weeks Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Tue Oct 18 10:33:28 2016 (r307555) +++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Tue Oct 18 12:21:45 2016 (r307556) @@ -120,18 +120,18 @@ tegra124_cpu_reset(platform_t plat) /* * Early putc routine for EARLY_PRINTF support. To use, add to kernel config: - * option SOCDEV_PA=0x02000000 - * option SOCDEV_VA=0x02000000 + * option SOCDEV_PA=0x70000000 + * option SOCDEV_VA=0x70000000 * option EARLY_PRINTF */ -#if 0 +#ifdef EARLY_PRINTF static void tegra124_early_putc(int c) { - volatile uint32_t * UART_STAT_REG = (uint32_t *)0x02020098; - volatile uint32_t * UART_TX_REG = (uint32_t *)0x02020040; - const uint32_t UART_TXRDY = (1 << 3); + volatile uint32_t * UART_STAT_REG = (uint32_t *)(0x70006314); + volatile uint32_t * UART_TX_REG = (uint32_t *)(0x70006300); + const uint32_t UART_TXRDY = (1 << 6); while ((*UART_STAT_REG & UART_TXRDY) == 0) continue; *UART_TX_REG = c; From owner-svn-src-head@freebsd.org Tue Oct 18 12:26:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91F7FC14A2A; Tue, 18 Oct 2016 12:26:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 44907E4D; Tue, 18 Oct 2016 12:26:23 +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 u9ICQMXF074625; Tue, 18 Oct 2016 12:26:22 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ICQMug074623; Tue, 18 Oct 2016 12:26:22 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201610181226.u9ICQMug074623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 18 Oct 2016 12:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307557 - head/sys/arm/nvidia/tegra124 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 12:26:23 -0000 Author: mmel Date: Tue Oct 18 12:26:22 2016 New Revision: 307557 URL: https://svnweb.freebsd.org/changeset/base/307557 Log: TEGRA: Attach cpufreq and coretemp drivers only on tegra124 SoC. It's needed by GENERIC kernel. MFC after: 2 weeks Modified: head/sys/arm/nvidia/tegra124/tegra124_coretemp.c head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Modified: head/sys/arm/nvidia/tegra124/tegra124_coretemp.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_coretemp.c Tue Oct 18 12:21:45 2016 (r307556) +++ head/sys/arm/nvidia/tegra124/tegra124_coretemp.c Tue Oct 18 12:26:22 2016 (r307557) @@ -178,10 +178,14 @@ tegra124_coretemp_ofw_parse(struct tegra static void tegra124_coretemp_identify(driver_t *driver, device_t parent) { + phandle_t root; - if (device_find_child(parent, "coretemp", -1) != NULL) + root = OF_finddevice("/"); + if (!ofw_bus_node_is_compatible(root, "nvidia,tegra124")) return; - if (BUS_ADD_CHILD(parent, 0, "coretemp", -1) == NULL) + if (device_find_child(parent, "tegra124_coretemp", -1) != NULL) + return; + if (BUS_ADD_CHILD(parent, 0, "tegra124_coretemp", -1) == NULL) device_printf(parent, "add child failed\n"); } @@ -262,7 +266,7 @@ static device_method_t tegra124_coretemp }; static devclass_t tegra124_coretemp_devclass; -static DEFINE_CLASS_0(coretemp, tegra124_coretemp_driver, +static DEFINE_CLASS_0(tegra124_coretemp, tegra124_coretemp_driver, tegra124_coretemp_methods, sizeof(struct tegra124_coretemp_softc)); DRIVER_MODULE(tegra124_coretemp, cpu, tegra124_coretemp_driver, tegra124_coretemp_devclass, NULL, NULL); Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Tue Oct 18 12:21:45 2016 (r307556) +++ head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Tue Oct 18 12:26:22 2016 (r307557) @@ -475,6 +475,11 @@ get_fdt_resources(struct tegra124_cpufre static void tegra124_cpufreq_identify(driver_t *driver, device_t parent) { + phandle_t root; + + root = OF_finddevice("/"); + if (!ofw_bus_node_is_compatible(root, "nvidia,tegra124")) + return; if (device_get_unit(parent) != 0) return; From owner-svn-src-head@freebsd.org Tue Oct 18 12:27:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33775C14AB8; Tue, 18 Oct 2016 12:27:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0DD11FDE; Tue, 18 Oct 2016 12:27:47 +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 u9ICRlHG074715; Tue, 18 Oct 2016 12:27:47 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ICRkHV074711; Tue, 18 Oct 2016 12:27:46 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201610181227.u9ICRkHV074711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 18 Oct 2016 12:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307558 - in head/sys: arm/nvidia dev/extres/regulator X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 12:27:48 -0000 Author: mmel Date: Tue Oct 18 12:27:46 2016 New Revision: 307558 URL: https://svnweb.freebsd.org/changeset/base/307558 Log: REGULATOR: Move functions for handling with regulator ranges to common file. They can be useful for other PMICs. MFC after: 2 weeks Modified: head/sys/arm/nvidia/as3722_regulators.c head/sys/dev/extres/regulator/regulator.c head/sys/dev/extres/regulator/regulator.h Modified: head/sys/arm/nvidia/as3722_regulators.c ============================================================================== --- head/sys/arm/nvidia/as3722_regulators.c Tue Oct 18 12:26:22 2016 (r307557) +++ head/sys/arm/nvidia/as3722_regulators.c Tue Oct 18 12:27:46 2016 (r307558) @@ -71,13 +71,6 @@ enum as3722_reg_id { AS3722_REG_ID_LDO11, }; -struct regulator_range { - u_int min_uvolt; - u_int step_uvolt; - u_int min_sel; - u_int max_sel; -}; - /* Regulator HW definition. */ struct reg_def { @@ -107,40 +100,32 @@ struct as3722_reg_sc { int enable_usec; }; -#define RANGE_INIT(_min_sel, _max_sel, _min_uvolt, _step_uvolt) \ -{ \ - .min_sel = _min_sel, \ - .max_sel = _max_sel, \ - .min_uvolt = _min_uvolt, \ - .step_uvolt = _step_uvolt, \ -} - static struct regulator_range as3722_sd016_ranges[] = { - RANGE_INIT(0x00, 0x00, 0, 0), - RANGE_INIT(0x01, 0x5A, 610000, 10000), + REG_RANGE_INIT(0x00, 0x00, 0, 0), + REG_RANGE_INIT(0x01, 0x5A, 610000, 10000), }; static struct regulator_range as3722_sd0_lv_ranges[] = { - RANGE_INIT(0x00, 0x00, 0, 0), - RANGE_INIT(0x01, 0x6E, 410000, 10000), + REG_RANGE_INIT(0x00, 0x00, 0, 0), + REG_RANGE_INIT(0x01, 0x6E, 410000, 10000), }; static struct regulator_range as3722_sd_ranges[] = { - RANGE_INIT(0x00, 0x00, 0, 0), - RANGE_INIT(0x01, 0x40, 612500, 12500), - RANGE_INIT(0x41, 0x70, 1425000, 25000), - RANGE_INIT(0x71, 0x7F, 2650000, 50000), + REG_RANGE_INIT(0x00, 0x00, 0, 0), + REG_RANGE_INIT(0x01, 0x40, 612500, 12500), + REG_RANGE_INIT(0x41, 0x70, 1425000, 25000), + REG_RANGE_INIT(0x71, 0x7F, 2650000, 50000), }; static struct regulator_range as3722_ldo3_ranges[] = { - RANGE_INIT(0x00, 0x00, 0, 0), - RANGE_INIT(0x01, 0x2D, 620000, 20000), + REG_RANGE_INIT(0x00, 0x00, 0, 0), + REG_RANGE_INIT(0x01, 0x2D, 620000, 20000), }; static struct regulator_range as3722_ldo_ranges[] = { - RANGE_INIT(0x00, 0x00, 0, 0), - RANGE_INIT(0x01, 0x24, 825000, 25000), - RANGE_INIT(0x40, 0x7F, 1725000, 25000), + REG_RANGE_INIT(0x00, 0x00, 0, 0), + REG_RANGE_INIT(0x01, 0x24, 825000, 25000), + REG_RANGE_INIT(0x40, 0x7F, 1725000, 25000), }; static struct reg_def as3722s_def[] = { @@ -402,87 +387,6 @@ DEFINE_CLASS_1(as3722_regnode, as3722_re sizeof(struct as3722_reg_sc), regnode_class); static int -regulator_range_sel_to_volt(struct as3722_reg_sc *sc, uint8_t sel, int *volt) -{ - struct regulator_range *range; - struct reg_def *def; - int i; - - def = sc->def; - if (def->nranges == 0) - panic("Voltage regulator have zero ranges\n"); - - for (i = 0; i < def->nranges ; i++) { - range = def->ranges + i; - - if (!(sel >= range->min_sel && - sel <= range->max_sel)) - continue; - - sel -= range->min_sel; - - *volt = range->min_uvolt + sel * range->step_uvolt; - return (0); - } - - return (ERANGE); -} - -static int -regulator_range_volt_to_sel(struct as3722_reg_sc *sc, int min_uvolt, - int max_uvolt, uint8_t *out_sel) -{ - struct regulator_range *range; - struct reg_def *def; - uint8_t sel; - int uvolt; - int rv, i; - - def = sc->def; - if (def->nranges == 0) - panic("Voltage regulator have zero ranges\n"); - - for (i = 0; i < def->nranges; i++) { - range = def->ranges + i; - uvolt = range->min_uvolt + - (range->max_sel - range->min_sel) * range->step_uvolt; - - if ((min_uvolt > uvolt) || - (max_uvolt < range->min_uvolt)) - continue; - - if (min_uvolt <= range->min_uvolt) - min_uvolt = range->min_uvolt; - - /* If step is zero then range is fixed voltage range. */ - if (range->step_uvolt == 0) - sel = 0; - else - sel = DIV_ROUND_UP(min_uvolt - range->min_uvolt, - range->step_uvolt); - - - sel += range->min_sel; - - break; - } - - if (i >= def->nranges) - return (ERANGE); - - /* Verify new settings. */ - rv = regulator_range_sel_to_volt(sc, sel, &uvolt); - if (rv != 0) - return (rv); - if ((uvolt < min_uvolt) || (uvolt > max_uvolt)) - return (ERANGE); - - *out_sel = sel; - return (0); -} - - -static int as3722_read_sel(struct as3722_reg_sc *sc, uint8_t *sel) { int rv; @@ -783,7 +687,8 @@ as3722_regnode_set_volt(struct regnode * sc = regnode_get_softc(regnode); *udelay = 0; - rv = regulator_range_volt_to_sel(sc, min_uvolt, max_uvolt, &sel); + rv = regulator_range_volt_to_sel8(sc->def->ranges, sc->def->nranges, + min_uvolt, max_uvolt, &sel); if (rv != 0) return (rv); rv = as3722_write_sel(sc, sel); @@ -806,6 +711,7 @@ as3722_regnode_get_volt(struct regnode * /* LDO6 have bypass. */ if (sc->def->id == AS3722_REG_ID_LDO6 && sel == AS3722_LDO6_SEL_BYPASS) return (ENOENT); - rv = regulator_range_sel_to_volt(sc, sel, uvolt); + rv = regulator_range_sel8_to_volt(sc->def->ranges, sc->def->nranges, + sel, uvolt); return (rv); } Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Tue Oct 18 12:26:22 2016 (r307557) +++ head/sys/dev/extres/regulator/regulator.c Tue Oct 18 12:27:46 2016 (r307558) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_REGULATOR, "regulator", "Regulator framework"); +#define DIV_ROUND_UP(n,d) howmany(n, d) + /* Forward declarations. */ struct regulator; struct regnode; @@ -984,3 +986,87 @@ regulator_get_by_ofw_property(device_t c return (regulator_get_by_id(cdev, regdev, id, reg)); } #endif + +/* -------------------------------------------------------------------------- + * + * Regulator utility functions. + * + */ + +/* Convert raw selector value to real voltage */ +int +regulator_range_sel8_to_volt(struct regulator_range *ranges, int nranges, + uint8_t sel, int *volt) +{ + struct regulator_range *range; + int i; + + if (nranges == 0) + panic("Voltage regulator have zero ranges\n"); + + for (i = 0; i < nranges ; i++) { + range = ranges + i; + + if (!(sel >= range->min_sel && + sel <= range->max_sel)) + continue; + + sel -= range->min_sel; + + *volt = range->min_uvolt + sel * range->step_uvolt; + return (0); + } + + return (ERANGE); +} + +int +regulator_range_volt_to_sel8(struct regulator_range *ranges, int nranges, + int min_uvolt, int max_uvolt, uint8_t *out_sel) +{ + struct regulator_range *range; + uint8_t sel; + int uvolt; + int rv, i; + + if (nranges == 0) + panic("Voltage regulator have zero ranges\n"); + + for (i = 0; i < nranges; i++) { + range = ranges + i; + uvolt = range->min_uvolt + + (range->max_sel - range->min_sel) * range->step_uvolt; + + if ((min_uvolt > uvolt) || + (max_uvolt < range->min_uvolt)) + continue; + + if (min_uvolt <= range->min_uvolt) + min_uvolt = range->min_uvolt; + + /* if step == 0 -> fixed voltage range. */ + if (range->step_uvolt == 0) + sel = 0; + else + sel = DIV_ROUND_UP(min_uvolt - range->min_uvolt, + range->step_uvolt); + + + sel += range->min_sel; + + break; + } + + if (i >= nranges) + return (ERANGE); + + /* Verify new settings. */ + rv = regulator_range_sel8_to_volt(ranges, nranges, sel, &uvolt); + if (rv != 0) + return (rv); + if ((uvolt < min_uvolt) || (uvolt > max_uvolt)) + return (ERANGE); + + *out_sel = sel; + return (0); +} Modified: head/sys/dev/extres/regulator/regulator.h ============================================================================== --- head/sys/dev/extres/regulator/regulator.h Tue Oct 18 12:26:22 2016 (r307557) +++ head/sys/dev/extres/regulator/regulator.h Tue Oct 18 12:27:46 2016 (r307558) @@ -67,9 +67,22 @@ struct regnode_init_def { #ifdef FDT phandle_t ofw_node; /* OFW node of regulator */ #endif +}; +struct regulator_range { + int min_uvolt; + int step_uvolt; + uint8_t min_sel; + uint8_t max_sel; }; +#define REG_RANGE_INIT(_min_sel, _max_sel, _min_uvolt, _step_uvolt) { \ + .min_sel = _min_sel, \ + .max_sel = _max_sel, \ + .min_uvolt = _min_uvolt, \ + .step_uvolt = _step_uvolt, \ +} + /* * Shorthands for constructing method tables. */ @@ -125,4 +138,10 @@ int regulator_parse_ofw_stdparam(device_ struct regnode_init_def *def); #endif +/* Utility functions */ +int regulator_range_volt_to_sel8(struct regulator_range *ranges, int nranges, + int min_uvolt, int max_uvolt, uint8_t *out_sel); +int regulator_range_sel8_to_volt(struct regulator_range *ranges, int nranges, + uint8_t sel, int *volt); + #endif /* _DEV_EXTRES_REGULATOR_H_ */ From owner-svn-src-head@freebsd.org Tue Oct 18 12:58:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D41BC15744; Tue, 18 Oct 2016 12:58:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id F0F061E0; Tue, 18 Oct 2016 12:58:18 +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 u9ICwIfD086375; Tue, 18 Oct 2016 12:58:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ICwId0086374; Tue, 18 Oct 2016 12:58:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610181258.u9ICwId0086374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 18 Oct 2016 12:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307559 - head/usr.sbin/fstyp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 12:58:19 -0000 Author: br Date: Tue Oct 18 12:58:17 2016 New Revision: 307559 URL: https://svnweb.freebsd.org/changeset/base/307559 Log: fstyp tests comes with pre-created EL filesystems, but fstyp cannot detect EL filesystem on EB machine, so exclude test files from distribution and skip the test. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/usr.sbin/fstyp/Makefile Modified: head/usr.sbin/fstyp/Makefile ============================================================================== --- head/usr.sbin/fstyp/Makefile Tue Oct 18 12:27:46 2016 (r307558) +++ head/usr.sbin/fstyp/Makefile Tue Oct 18 12:58:17 2016 (r307559) @@ -14,8 +14,9 @@ MAN= fstyp.8 WARNS?= 2 .include +.include -.if ${MK_TESTS} != "no" +.if ${MK_TESTS} != "no" && ${TARGET_ENDIANNESS} == 1234 SUBDIR+= tests .endif From owner-svn-src-head@freebsd.org Tue Oct 18 13:12:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1C37C15BE7; Tue, 18 Oct 2016 13:12:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 820B0CA8; Tue, 18 Oct 2016 13:12:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IDCJTP093706; Tue, 18 Oct 2016 13:12:19 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IDCJxc093705; Tue, 18 Oct 2016 13:12:19 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181312.u9IDCJxc093705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 13:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307560 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 13:12:20 -0000 Author: sbruno Date: Tue Oct 18 13:12:19 2016 New Revision: 307560 URL: https://svnweb.freebsd.org/changeset/base/307560 Log: Fix misusage of CPU_FFS when binding queues to cpus ref: https://github.com/NextBSD/NextBSD/commit/922d0bdf2277f30954f143107d2a3eddb02abd2d Submitted by: mmacy@nextbsd.org Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Oct 18 12:58:17 2016 (r307559) +++ head/sys/net/iflib.c Tue Oct 18 13:12:19 2016 (r307560) @@ -4294,17 +4294,23 @@ iflib_irq_alloc(if_ctx_t ctx, if_irq_t i return (_iflib_irq_alloc(ctx, irq, rid, filter, handler, arg, name)); } -static void +static int find_nth(if_ctx_t ctx, cpuset_t *cpus, int qid) { - int i, cpuid; + int i, cpuid, eqid, count; CPU_COPY(&ctx->ifc_cpus, cpus); + count = CPU_COUNT(&ctx->ifc_cpus); + eqid = qid % count; /* clear up to the qid'th bit */ - for (i = 0; i < qid; i++) { + for (i = 0; i < eqid; i++) { cpuid = CPU_FFS(cpus); - CPU_CLR(cpuid, cpus); + MPASS(cpuid != 0); + CPU_CLR(cpuid-1, cpus); } + cpuid = CPU_FFS(cpus); + MPASS(cpuid != 0); + return (cpuid-1); } int @@ -4317,7 +4323,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if iflib_filter_info_t info; cpuset_t cpus; gtask_fn_t *fn; - int tqrid, err; + int tqrid, err, cpuid; void *q; info = &ctx->ifc_filter_info; @@ -4363,11 +4369,11 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if if (err != 0) return (err); if (tqrid != -1) { - find_nth(ctx, &cpus, qid); - taskqgroup_attach_cpu(tqg, gtask, q, CPU_FFS(&cpus), irq->ii_rid, name); - } else + cpuid = find_nth(ctx, &cpus, qid); + taskqgroup_attach_cpu(tqg, gtask, q, cpuid, irq->ii_rid, name); + } else { taskqgroup_attach(tqg, gtask, q, tqrid, name); - + } return (0); } From owner-svn-src-head@freebsd.org Tue Oct 18 13:16:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F101C15CDC; Tue, 18 Oct 2016 13:16:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 5E7F9FAC; Tue, 18 Oct 2016 13:16:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IDGRns094021; Tue, 18 Oct 2016 13:16:27 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IDGR0A094020; Tue, 18 Oct 2016 13:16:27 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181316.u9IDGR0A094020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 13:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307561 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 13:16:28 -0000 Author: sbruno Date: Tue Oct 18 13:16:27 2016 New Revision: 307561 URL: https://svnweb.freebsd.org/changeset/base/307561 Log: Tell gtask to what we've been bound. ref: https://github.com/NextBSD/NextBSD/commit/54414984cfebb920bbc40aadeb601bdce448d8d7 Submitted by: mmacy@nextbsd.org Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:12:19 2016 (r307560) +++ head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:16:27 2016 (r307561) @@ -633,6 +633,7 @@ taskqgroup_attach(struct taskqgroup *qgr qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu; if (irq != -1 && smp_started) { CPU_ZERO(&mask); CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); From owner-svn-src-head@freebsd.org Tue Oct 18 13:22:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66FB0C1604A; Tue, 18 Oct 2016 13:22:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 35F7A7FC; Tue, 18 Oct 2016 13:22:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IDMi1R097606; Tue, 18 Oct 2016 13:22:44 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IDMi1l097605; Tue, 18 Oct 2016 13:22:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181322.u9IDMi1l097605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 13:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307562 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 13:22:45 -0000 Author: sbruno Date: Tue Oct 18 13:22:44 2016 New Revision: 307562 URL: https://svnweb.freebsd.org/changeset/base/307562 Log: Toggle v4/v6 rxcsum together Only re-init if driver is running ref: https://github.com/NextBSD/NextBSD/commit/106518e874ec9a61daf4c09894170d24e2f4d60d Submitted by: mmacy@nextbsd.org Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Oct 18 13:16:27 2016 (r307561) +++ head/sys/net/iflib.c Tue Oct 18 13:22:44 2016 (r307562) @@ -3162,8 +3162,6 @@ iflib_if_qflush(if_t ifp) IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING | \ IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO) -#define IFCAP_REINIT IFCAP_FLAGS - static int iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) { @@ -3288,6 +3286,8 @@ iflib_if_ioctl(if_t ifp, u_long command, #endif setmask |= (mask & IFCAP_FLAGS); + if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) + setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); if ((mask & IFCAP_WOL) && (if_getcapabilities(ifp) & IFCAP_WOL) != 0) setmask |= (mask & (IFCAP_WOL_MCAST|IFCAP_WOL_MAGIC)); @@ -3298,10 +3298,10 @@ iflib_if_ioctl(if_t ifp, u_long command, if (setmask) { CTX_LOCK(ctx); bits = if_getdrvflags(ifp); - if (setmask & IFCAP_REINIT) + if (bits & IFF_DRV_RUNNING) iflib_stop(ctx); if_togglecapenable(ifp, setmask); - if (setmask & IFCAP_REINIT) + if (bits & IFF_DRV_RUNNING) iflib_init_locked(ctx); if_setdrvflags(ifp, bits); CTX_UNLOCK(ctx); From owner-svn-src-head@freebsd.org Tue Oct 18 13:29:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A605C16336; Tue, 18 Oct 2016 13:29:32 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 DA1D3C42; Tue, 18 Oct 2016 13:29:31 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IDTUeW098024; Tue, 18 Oct 2016 13:29:30 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IDTU8f098023; Tue, 18 Oct 2016 13:29:30 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181329.u9IDTU8f098023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 13:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307563 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 13:29:32 -0000 Author: sbruno Date: Tue Oct 18 13:29:30 2016 New Revision: 307563 URL: https://svnweb.freebsd.org/changeset/base/307563 Log: When deciding whether or not to call tqg_attach_cpu(), reference rid directly. ref: https://github.com/NextBSD/NextBSD/commit/c9b47b468b8a3350811acfd9e167a8b91dc8f0c6 Submitted by: mmacy@nextbsd.org Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Oct 18 13:22:44 2016 (r307562) +++ head/sys/net/iflib.c Tue Oct 18 13:29:30 2016 (r307563) @@ -4327,6 +4327,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if void *q; info = &ctx->ifc_filter_info; + tqrid = rid; switch (type) { /* XXX merge tx/rx for netmap? */ @@ -4335,7 +4336,6 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if info = &ctx->ifc_txqs[qid].ift_filter_info; gtask = &ctx->ifc_txqs[qid].ift_task; tqg = qgroup_if_io_tqg; - tqrid = irq->ii_rid; fn = _task_fn_tx; break; case IFLIB_INTR_RX: @@ -4343,7 +4343,6 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if info = &ctx->ifc_rxqs[qid].ifr_filter_info; gtask = &ctx->ifc_rxqs[qid].ifr_task; tqg = qgroup_if_io_tqg; - tqrid = irq->ii_rid; fn = _task_fn_rx; break; case IFLIB_INTR_ADMIN: @@ -4351,7 +4350,6 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if info = &ctx->ifc_filter_info; gtask = &ctx->ifc_admin_task; tqg = qgroup_if_config_tqg; - tqrid = -1; fn = _task_fn_admin; break; default: From owner-svn-src-head@freebsd.org Tue Oct 18 13:38:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 321B5C16792; Tue, 18 Oct 2016 13:38:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0411C25E; Tue, 18 Oct 2016 13:38:00 +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 u9IDc0EG001802; Tue, 18 Oct 2016 13:38:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IDc0e1001801; Tue, 18 Oct 2016 13:38:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610181338.u9IDc0e1001801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 18 Oct 2016 13:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307564 - head/contrib/mdocml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 13:38:01 -0000 Author: emaste Date: Tue Oct 18 13:37:59 2016 New Revision: 307564 URL: https://svnweb.freebsd.org/changeset/base/307564 Log: makewhatis: avoid skipping another page after one with no mlinks Submitted by: Ingo Schwarze MFC after: 3 weeks MFC with: r307003 Modified: head/contrib/mdocml/mandocdb.c Modified: head/contrib/mdocml/mandocdb.c ============================================================================== --- head/contrib/mdocml/mandocdb.c Tue Oct 18 13:29:30 2016 (r307563) +++ head/contrib/mdocml/mandocdb.c Tue Oct 18 13:37:59 2016 (r307564) @@ -1146,10 +1146,8 @@ mpages_merge(struct mparse *mp) for (mpage = mpage_head; mpage != NULL; mpage = mpage->next) { mlinks_undupe(mpage); - if ((mlink = mpage->mlinks) == NULL) { - mpage = mpage->next; + if ((mlink = mpage->mlinks) == NULL) continue; - } name_mask = NAME_MASK; mandoc_ohash_init(&names, 4, offsetof(struct str, key)); From owner-svn-src-head@freebsd.org Tue Oct 18 13:39:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85BDFC1685D; Tue, 18 Oct 2016 13:39:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3BD8569D; Tue, 18 Oct 2016 13:39:57 +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 u9IDduDw001900; Tue, 18 Oct 2016 13:39:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IDduRp001897; Tue, 18 Oct 2016 13:39:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610181339.u9IDduRp001897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 18 Oct 2016 13:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307565 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 13:39:57 -0000 Author: andrew Date: Tue Oct 18 13:39:55 2016 New Revision: 307565 URL: https://svnweb.freebsd.org/changeset/base/307565 Log: Add PCB_FP_USERMASK so we can mask off floating point flags that should not be sent to userspace, for example the future flag to tell when we are using floating point in the kernel. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/trap.c head/sys/arm64/include/pcb.h Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Tue Oct 18 13:37:59 2016 (r307564) +++ head/sys/arm64/arm64/machdep.c Tue Oct 18 13:39:55 2016 (r307565) @@ -341,6 +341,8 @@ get_fpcontext(struct thread *td, mcontex KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, ("Called get_fpcontext while the kernel is using the VFP")); + KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, + ("Non-userspace FPU flags set in get_fpcontext")); memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_fpustate.vfp_regs, sizeof(mcp->mc_fpregs)); mcp->mc_fpregs.fp_cr = curpcb->pcb_fpustate.vfp_fpcr; @@ -376,7 +378,7 @@ set_fpcontext(struct thread *td, mcontex sizeof(mcp->mc_fpregs)); curpcb->pcb_fpustate.vfp_fpcr = mcp->mc_fpregs.fp_cr; curpcb->pcb_fpustate.vfp_fpsr = mcp->mc_fpregs.fp_sr; - curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags; + curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; } critical_exit(); Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Oct 18 13:37:59 2016 (r307564) +++ head/sys/arm64/arm64/trap.c Tue Oct 18 13:39:55 2016 (r307565) @@ -409,6 +409,9 @@ do_el0_sync(struct trapframe *frame) userret(td, frame); break; } + + KASSERT((curthread->td_pcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, + ("Kernel VFP flags set while entering userspace")); } void Modified: head/sys/arm64/include/pcb.h ============================================================================== --- head/sys/arm64/include/pcb.h Tue Oct 18 13:37:59 2016 (r307564) +++ head/sys/arm64/include/pcb.h Tue Oct 18 13:39:55 2016 (r307565) @@ -54,6 +54,8 @@ struct pcb { struct vfpstate *pcb_fpusaved; int pcb_fpflags; #define PCB_FP_STARTED 0x01 +/* The bits passed to userspace in get_fpcontext */ +#define PCB_FP_USERMASK (PCB_FP_STARTED) u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */ /* From owner-svn-src-head@freebsd.org Tue Oct 18 13:55:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66755C1607C; Tue, 18 Oct 2016 13:55:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3DD52262; Tue, 18 Oct 2016 13:55:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IDtYDY009500; Tue, 18 Oct 2016 13:55:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IDtYNh009499; Tue, 18 Oct 2016 13:55:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181355.u9IDtYNh009499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 13:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307566 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 13:55:35 -0000 Author: sbruno Date: Tue Oct 18 13:55:34 2016 New Revision: 307566 URL: https://svnweb.freebsd.org/changeset/base/307566 Log: Ensure that tasks with a specific cpu set prior to smp starting get re-attached to a thread running on that cpu. ref: https://github.com/NextBSD/NextBSD/commit/fcc20e306bc93ebbbe51f3775d1afb527970a2e9 Submitted by: mmacy@nextbsd.org Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:39:55 2016 (r307565) +++ head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:55:34 2016 (r307566) @@ -554,7 +554,7 @@ struct taskq_bind_task { }; static void -taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx) +taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx, int cpu) { struct taskqgroup_cpu *qcpu; @@ -564,7 +564,7 @@ taskqgroup_cpu_create(struct taskqgroup taskqueue_thread_enqueue, &qcpu->tgc_taskq); gtaskqueue_start_threads(&qcpu->tgc_taskq, 1, PI_SOFT, "%s_%d", qgroup->tqg_name, idx); - qcpu->tgc_cpu = idx * qgroup->tqg_stride; + qcpu->tgc_cpu = cpu; } static void @@ -633,8 +633,8 @@ taskqgroup_attach(struct taskqgroup *qgr qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; - gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu; if (irq != -1 && smp_started) { + gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu; CPU_ZERO(&mask); CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); mtx_unlock(&qgroup->tqg_lock); @@ -643,6 +643,32 @@ taskqgroup_attach(struct taskqgroup *qgr mtx_unlock(&qgroup->tqg_lock); } +static void +taskqgroup_attach_deferred(struct taskqgroup *qgroup, struct grouptask *gtask) +{ + cpuset_t mask; + int qid, cpu; + + mtx_lock(&qgroup->tqg_lock); + qid = taskqgroup_find(qgroup, gtask->gt_uniq); + cpu = qgroup->tqg_queue[qid].tgc_cpu; + if (gtask->gt_irq != -1) { + mtx_unlock(&qgroup->tqg_lock); + + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + intr_setaffinity(gtask->gt_irq, &mask); + + mtx_lock(&qgroup->tqg_lock); + } + qgroup->tqg_queue[qid].tgc_cnt++; + + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, + gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + mtx_unlock(&qgroup->tqg_lock); +} + int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask, void *uniq, int cpu, int irq, char *name) @@ -671,13 +697,46 @@ taskqgroup_attach_cpu(struct taskqgroup qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; - if (irq != -1 && smp_started) { - CPU_ZERO(&mask); - CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); - mtx_unlock(&qgroup->tqg_lock); + cpu = qgroup->tqg_queue[qid].tgc_cpu; + mtx_unlock(&qgroup->tqg_lock); + + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + if (irq != -1 && smp_started) intr_setaffinity(irq, &mask); - } else + return (0); +} + +static int +taskqgroup_attach_cpu_deferred(struct taskqgroup *qgroup, struct grouptask *gtask) +{ + cpuset_t mask; + int i, qid, irq, cpu; + + qid = -1; + irq = gtask->gt_irq; + cpu = gtask->gt_cpu; + MPASS(smp_started); + mtx_lock(&qgroup->tqg_lock); + for (i = 0; i < qgroup->tqg_cnt; i++) + if (qgroup->tqg_queue[i].tgc_cpu == cpu) { + qid = i; + break; + } + if (qid == -1) { mtx_unlock(&qgroup->tqg_lock); + return (EINVAL); + } + qgroup->tqg_queue[qid].tgc_cnt++; + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + mtx_unlock(&qgroup->tqg_lock); + + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + + if (irq != -1) + intr_setaffinity(irq, &mask); return (0); } @@ -741,9 +800,8 @@ static int _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride) { LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); - cpuset_t mask; struct grouptask *gtask; - int i, k, old_cnt, qid, cpu; + int i, k, old_cnt, old_cpu, cpu; mtx_assert(&qgroup->tqg_lock, MA_OWNED); @@ -758,6 +816,9 @@ _taskqgroup_adjust(struct taskqgroup *qg } qgroup->tqg_adjusting = 1; old_cnt = qgroup->tqg_cnt; + old_cpu = 0; + if (old_cnt < cnt) + old_cpu = qgroup->tqg_queue[old_cnt].tgc_cpu; mtx_unlock(&qgroup->tqg_lock); /* * Set up queue for tasks added before boot. @@ -771,8 +832,13 @@ _taskqgroup_adjust(struct taskqgroup *qg /* * If new taskq threads have been added. */ - for (i = old_cnt; i < cnt; i++) - taskqgroup_cpu_create(qgroup, i); + cpu = old_cpu; + for (i = old_cnt; i < cnt; i++) { + for (k = 0; k < qgroup->tqg_stride; k++) + cpu = CPU_NEXT(cpu); + + taskqgroup_cpu_create(qgroup, i, cpu); + } mtx_lock(&qgroup->tqg_lock); qgroup->tqg_cnt = cnt; qgroup->tqg_stride = stride; @@ -788,39 +854,15 @@ _taskqgroup_adjust(struct taskqgroup *qg } } + mtx_unlock(&qgroup->tqg_lock); + while ((gtask = LIST_FIRST(>ask_head))) { LIST_REMOVE(gtask, gt_list); if (gtask->gt_cpu == -1) - qid = taskqgroup_find(qgroup, gtask->gt_uniq); - else { - for (i = 0; i < qgroup->tqg_cnt; i++) - if (qgroup->tqg_queue[i].tgc_cpu == gtask->gt_cpu) { - qid = i; - break; - } - } - qgroup->tqg_queue[qid].tgc_cnt++; - LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, - gt_list); - gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; - } - /* - * Set new CPU and IRQ affinity - */ - cpu = CPU_FIRST(); - for (i = 0; i < cnt; i++) { - qgroup->tqg_queue[i].tgc_cpu = cpu; - for (k = 0; k < qgroup->tqg_stride; k++) - cpu = CPU_NEXT(cpu); - CPU_ZERO(&mask); - CPU_SET(qgroup->tqg_queue[i].tgc_cpu, &mask); - LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) { - if (gtask->gt_irq == -1) - continue; - intr_setaffinity(gtask->gt_irq, &mask); - } + taskqgroup_attach_deferred(qgroup, gtask); + else if (taskqgroup_attach_cpu_deferred(qgroup, gtask)) + taskqgroup_attach_deferred(qgroup, gtask); } - mtx_unlock(&qgroup->tqg_lock); /* * If taskq thread count has been reduced. @@ -837,12 +879,12 @@ _taskqgroup_adjust(struct taskqgroup *qg } int -taskqgroup_adjust(struct taskqgroup *qgroup, int cpu, int stride) +taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride) { int error; mtx_lock(&qgroup->tqg_lock); - error = _taskqgroup_adjust(qgroup, cpu, stride); + error = _taskqgroup_adjust(qgroup, cnt, stride); mtx_unlock(&qgroup->tqg_lock); return (error); From owner-svn-src-head@freebsd.org Tue Oct 18 14:00:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1099AC162C3; Tue, 18 Oct 2016 14:00:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B6E637E4; Tue, 18 Oct 2016 14:00:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IE0QJw009740; Tue, 18 Oct 2016 14:00:26 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IE0QO1009739; Tue, 18 Oct 2016 14:00:26 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181400.u9IE0QO1009739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 14:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307567 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 14:00:28 -0000 Author: sbruno Date: Tue Oct 18 14:00:26 2016 New Revision: 307567 URL: https://svnweb.freebsd.org/changeset/base/307567 Log: Assert that we're assigning a non-null taskqueue. ref: https://github.com/NextBSD/NextBSD/commit/535865d02c162e415d7436899cd6db5000a0cc7b Fix cpu assignment by assuring stride is non-zero, assert that all tasks have a valid taskqueue. ref: https://github.com/NextBSD/NextBSD/commit/db398176234fe3ce9f8e8b671f56000f8276feba Start cpu assignment from zero. ref: https://github.com/NextBSD/NextBSD/commit/d99d39b6b6c5dfac1eb440c41e36ebf4c897198e Submitted by: mmacy@nextbsd.org Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:55:34 2016 (r307566) +++ head/sys/kern/subr_gtaskqueue.c Tue Oct 18 14:00:26 2016 (r307567) @@ -665,6 +665,7 @@ taskqgroup_attach_deferred(struct taskqg LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; mtx_unlock(&qgroup->tqg_lock); } @@ -729,6 +730,7 @@ taskqgroup_attach_cpu_deferred(struct ta } qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; mtx_unlock(&qgroup->tqg_lock); @@ -834,10 +836,10 @@ _taskqgroup_adjust(struct taskqgroup *qg */ cpu = old_cpu; for (i = old_cnt; i < cnt; i++) { - for (k = 0; k < qgroup->tqg_stride; k++) - cpu = CPU_NEXT(cpu); - taskqgroup_cpu_create(qgroup, i, cpu); + + for (k = 0; k < stride; k++) + cpu = CPU_NEXT(cpu); } mtx_lock(&qgroup->tqg_lock); qgroup->tqg_cnt = cnt; @@ -864,6 +866,15 @@ _taskqgroup_adjust(struct taskqgroup *qg taskqgroup_attach_deferred(qgroup, gtask); } +#ifdef INVARIANTS + mtx_lock(&qgroup->tqg_lock); + for (i = 0; i < qgroup->tqg_cnt; i++) { + MPASS(qgroup->tqg_queue[i].tgc_taskq != NULL); + LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) + MPASS(gtask->gt_taskqueue != NULL); + } + mtx_unlock(&qgroup->tqg_lock); +#endif /* * If taskq thread count has been reduced. */ From owner-svn-src-head@freebsd.org Tue Oct 18 14:02:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96D87C1644C; Tue, 18 Oct 2016 14:02:46 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 68D98BD3; Tue, 18 Oct 2016 14:02:46 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IE2jah013345; Tue, 18 Oct 2016 14:02:45 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IE2j5I013344; Tue, 18 Oct 2016 14:02:45 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181402.u9IE2j5I013344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 14:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307568 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 14:02:46 -0000 Author: sbruno Date: Tue Oct 18 14:02:45 2016 New Revision: 307568 URL: https://svnweb.freebsd.org/changeset/base/307568 Log: Set default capabilities at attach. ref: https://github.com/NextBSD/NextBSD/commit/6425f45e5fc89f64925995bbcfc09c7558d896ea Submitted by: mmacy@nextbsd.org Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Oct 18 14:00:26 2016 (r307567) +++ head/sys/net/iflib.c Tue Oct 18 14:02:45 2016 (r307568) @@ -3903,6 +3903,10 @@ _iflib_assert(if_shared_ctx_t sctx) MPASS(sctx->isc_ntxd_default[0]); } +#define DEFAULT_CAPS (IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ + IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO | IFCAP_HWSTATS) + static int iflib_register(if_ctx_t ctx) { @@ -3937,8 +3941,9 @@ iflib_register(if_ctx_t ctx) if_setqflushfn(ifp, iflib_if_qflush); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); - if_setcapabilities(ifp, 0); - if_setcapenable(ifp, 0); + /* XXX - move this in to the driver for non-default settings */ + if_setcapabilities(ifp, DEFAULT_CAPS); + if_setcapenable(ifp, DEFAULT_CAPS); ctx->ifc_vlan_attach_event = EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx, From owner-svn-src-head@freebsd.org Tue Oct 18 14:48:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8726BC1788B; Tue, 18 Oct 2016 14:48:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 555BCF68; Tue, 18 Oct 2016 14:48:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IEmfC1029194; Tue, 18 Oct 2016 14:48:41 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IEmfsi029193; Tue, 18 Oct 2016 14:48:41 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610181448.u9IEmfsi029193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 18 Oct 2016 14:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307569 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 14:48:42 -0000 Author: sbruno Date: Tue Oct 18 14:48:41 2016 New Revision: 307569 URL: https://svnweb.freebsd.org/changeset/base/307569 Log: Restore svn r306772 that was overwritten by netmap import at svn r307394 #include should be here as all drivers that support netmap need to use this file regardless. Modified: head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Tue Oct 18 14:02:45 2016 (r307568) +++ head/sys/dev/netmap/netmap_kern.h Tue Oct 18 14:48:41 2016 (r307569) @@ -73,6 +73,7 @@ #endif #if defined(__FreeBSD__) +#include #define likely(x) __builtin_expect((long)!!(x), 1L) #define unlikely(x) __builtin_expect((long)!!(x), 0L) From owner-svn-src-head@freebsd.org Tue Oct 18 15:14:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A36AFC172AF; Tue, 18 Oct 2016 15:14:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 79E7CAE4; Tue, 18 Oct 2016 15:14:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IFEk4f041120; Tue, 18 Oct 2016 15:14:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IFEk88041118; Tue, 18 Oct 2016 15:14:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201610181514.u9IFEk88041118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 18 Oct 2016 15:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307570 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 15:14:47 -0000 Author: ae Date: Tue Oct 18 15:14:46 2016 New Revision: 307570 URL: https://svnweb.freebsd.org/changeset/base/307570 Log: Add support for non-contiguous IPv6 masks in ipfw(8) rules. For example fe::640:0:0/ffff::ffff:ffff:0:0 will match addresses fe:*:*:*:0:640:*:* Submitted by: Eugene Mamchits Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipv6.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Oct 18 14:48:41 2016 (r307569) +++ head/sbin/ipfw/ipfw.8 Tue Oct 18 15:14:46 2016 (r307570) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2016 +.Dd October 18, 2016 .Dt IPFW 8 .Os .Sh NAME @@ -1357,6 +1357,24 @@ or a hostname) and mask width of .Cm masklen bits. +.It Ar addr Ns / Ns Ar mask +Matches all IPv6 addresses with base +.Ar addr +(specified as allowed by +.Xr inet_pton +or a hostname) +and the mask of +.Ar mask , +specified as allowed by +.Xr inet_pton. +As an example, fe::640:0:0/ffff::ffff:ffff:0:0 will match +fe:*:*:*:0:640:*:*. +This form is advised only for non-contiguous +masks. +It is better to resort to the +.Ar addr Ns / Ns Ar masklen +format for contiguous masks, which is more compact and less +error-prone. .El .Pp No support for sets of IPv6 addresses is provided because IPv6 addresses Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Tue Oct 18 14:48:41 2016 (r307569) +++ head/sbin/ipfw/ipv6.c Tue Oct 18 15:14:46 2016 (r307570) @@ -124,8 +124,8 @@ print_ip6(struct buf_pr *bp, ipfw_insn_i if (inet_ntop(AF_INET6, a, trad, sizeof( trad ) ) == NULL) bprintf(bp, "Error ntop in print_ip6\n"); bprintf(bp, "%s", trad ); - if (mb < 0) /* XXX not really legal... */ - bprintf(bp, ":%s", + if (mb < 0) /* mask not contiguous */ + bprintf(bp, "/%s", inet_ntop(AF_INET6, &a[1], trad, sizeof(trad))); else if (mb < 128) bprintf(bp, "/%d", mb); @@ -325,9 +325,10 @@ lookup_host6 (char *host, struct in6_add * any matches any IP6. Actually returns an empty instruction. * me returns O_IP6_*_ME * - * 03f1::234:123:0342 single IP6 address - * 03f1::234:123:0342/24 address/mask - * 03f1::234:123:0342/24,03f1::234:123:0343/ List of address + * 03f1::234:123:0342 single IP6 address + * 03f1::234:123:0342/24 address/masklen + * 03f1::234:123:0342/ffff::ffff:ffff address/mask + * 03f1::234:123:0342/24,03f1::234:123:0343/ List of address * * Set of address (as in ipv6) not supported because ipv6 address * are typically random past the initial prefix. @@ -382,13 +383,18 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, i * or ',' indicating another address follows. */ - char *p; + char *p, *q; int masklen; char md = '\0'; CHECK_LENGTH(cblen, 1 + len + 2 * F_INSN_SIZE(struct in6_addr)); - if ((p = strpbrk(av, "/,")) ) { + if ((q = strchr(av, ',')) ) { + *q = '\0'; + q++; + } + + if ((p = strchr(av, '/')) ) { md = *p; /* save the separator */ *p = '\0'; /* terminate address string */ p++; /* and skip past it */ @@ -401,22 +407,22 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, i errx(EX_DATAERR, "bad address \"%s\"", av); } /* next, look at the mask, if any */ - masklen = (md == '/') ? atoi(p) : 128; - if (masklen > 128 || masklen < 0) - errx(EX_DATAERR, "bad width \"%s\''", p); - else - n2mask(&d[1], masklen); + if (md == '/' && strchr(p, ':')) { + if (!inet_pton(AF_INET6, p, &d[1])) + errx(EX_DATAERR, "bad mask \"%s\"", p); + + masklen = contigmask((uint8_t *)&(d[1]), 128); + } else { + masklen = (md == '/') ? atoi(p) : 128; + if (masklen > 128 || masklen < 0) + errx(EX_DATAERR, "bad width \"%s\''", p); + else + n2mask(&d[1], masklen); + } APPLY_MASK(d, &d[1]) /* mask base address with mask */ - /* find next separator */ - - if (md == '/') { /* find separator past the mask */ - p = strpbrk(p, ","); - if (p != NULL) - p++; - } - av = p; + av = q; /* Check this entry */ if (masklen == 0) { From owner-svn-src-head@freebsd.org Tue Oct 18 15:24:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C088C175EC; Tue, 18 Oct 2016 15:24:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 1E082222; Tue, 18 Oct 2016 15:24:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IFOur2045063; Tue, 18 Oct 2016 15:24:56 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IFOutA045062; Tue, 18 Oct 2016 15:24:56 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610181524.u9IFOutA045062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 18 Oct 2016 15:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307571 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 15:24:57 -0000 Author: luigi Date: Tue Oct 18 15:24:56 2016 New Revision: 307571 URL: https://svnweb.freebsd.org/changeset/base/307571 Log: fix a stale sentence in the manpage Modified: head/share/man/man4/netmap.4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Tue Oct 18 15:14:46 2016 (r307570) +++ head/share/man/man4/netmap.4 Tue Oct 18 15:24:56 2016 (r307571) @@ -828,9 +828,9 @@ Performance is inferior to native netmap mode but still significantly higher than various raw socket types (bpf, PF_PACKET, etc.). Note that for slow devices (such as 1 Gbit/s and slower NICs, -or several 10 Gbit/s NICs whose hardware is unable -that of in-kernel solutions such as Linux's -.Xr pktgen . +or several 10 Gbit/s NICs whose hardware is unable to sustain line rate), +emulated and native mode will likely have similar or same throughput. +.br When emulation is in use, packet sniffer programs such as tcpdump could see received packets before they are diverted by netmap. This behaviour is not intentional, being just an artifact of the implementation of emulation. From owner-svn-src-head@freebsd.org Tue Oct 18 15:41:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7088C17ACB; Tue, 18 Oct 2016 15:41:59 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7B2C0F01; Tue, 18 Oct 2016 15:41:59 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IFfwmf052889; Tue, 18 Oct 2016 15:41:58 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IFfwtK052883; Tue, 18 Oct 2016 15:41:58 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610181541.u9IFfwtK052883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 18 Oct 2016 15:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307572 - in head/sys: dev/netmap net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 15:41:59 -0000 Author: luigi Date: Tue Oct 18 15:41:57 2016 New Revision: 307572 URL: https://svnweb.freebsd.org/changeset/base/307572 Log: remove trailing whitespace. No code changes. Modified: head/sys/dev/netmap/if_vtnet_netmap.h head/sys/dev/netmap/netmap_monitor.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_vale.c head/sys/net/netmap_user.h Modified: head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- head/sys/dev/netmap/if_vtnet_netmap.h Tue Oct 18 15:24:56 2016 (r307571) +++ head/sys/dev/netmap/if_vtnet_netmap.h Tue Oct 18 15:41:57 2016 (r307572) @@ -127,7 +127,7 @@ vtnet_netmap_txsync(struct netmap_kring * First part: process new packets to send. */ rmb(); - + nm_i = kring->nr_hwcur; if (nm_i != head) { /* we have new packets to send */ struct sglist *sg = txq->vtntx_sg; @@ -182,7 +182,7 @@ vtnet_netmap_txsync(struct netmap_kring virtqueue_enable_intr(vq); // like postpone with 0 } - + /* Free used slots. We only consider our own used buffers, recognized * by the token we passed to virtqueue_add_outbuf. */ Modified: head/sys/dev/netmap/netmap_monitor.c ============================================================================== --- head/sys/dev/netmap/netmap_monitor.c Tue Oct 18 15:24:56 2016 (r307571) +++ head/sys/dev/netmap/netmap_monitor.c Tue Oct 18 15:41:57 2016 (r307572) @@ -191,7 +191,7 @@ nm_monitor_alloc(struct netmap_kring *kr if (n <= kring->max_monitors) /* we already have more entries that requested */ return 0; - + len = sizeof(struct netmap_kring *) * n; #ifndef _WIN32 nm = realloc(kring->monitors, len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -301,7 +301,7 @@ netmap_monitor_del(struct netmap_kring * kring->nm_sync = kring->mon_sync; kring->mon_sync = NULL; if (kring->tx == NR_RX) { - ND("%s: restoring notify on %s: %p", + ND("%s: restoring notify on %s: %p", mkring->name, kring->name, kring->mon_notify); kring->nm_notify = kring->mon_notify; kring->mon_notify = NULL; @@ -406,7 +406,7 @@ netmap_monitor_reg_common(struct netmap_ /* **************************************************************** - * functions specific for zero-copy monitors + * functions specific for zero-copy monitors **************************************************************** */ @@ -554,7 +554,7 @@ netmap_zmon_dtor(struct netmap_adapter * /* **************************************************************** - * functions specific for copy monitors + * functions specific for copy monitors **************************************************************** */ @@ -729,7 +729,7 @@ netmap_get_monitor_na(struct nmreq *nmr, if ((nmr->nr_flags & (NR_MONITOR_TX | NR_MONITOR_RX)) == 0) { if (nmr->nr_flags & NR_ZCOPY_MON) { - /* the flag makes no sense unless you are + /* the flag makes no sense unless you are * creating a monitor */ return EINVAL; Modified: head/sys/dev/netmap/netmap_pipe.c ============================================================================== --- head/sys/dev/netmap/netmap_pipe.c Tue Oct 18 15:24:56 2016 (r307571) +++ head/sys/dev/netmap/netmap_pipe.c Tue Oct 18 15:41:57 2016 (r307572) @@ -92,7 +92,7 @@ nm_pipe_alloc(struct netmap_adapter *na, if (npipes <= na->na_max_pipes) /* we already have more entries that requested */ return 0; - + if (npipes < na->na_next_pipe || npipes > NM_MAXPIPES) return EINVAL; @@ -402,7 +402,7 @@ netmap_pipe_reg(struct netmap_adapter *n } } } - + /* create all missing needed rings on the other end */ error = netmap_mem_rings_create(ona); if (error) Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Tue Oct 18 15:24:56 2016 (r307571) +++ head/sys/dev/netmap/netmap_vale.c Tue Oct 18 15:41:57 2016 (r307572) @@ -906,7 +906,7 @@ nm_bdg_create_kthreads(struct nm_bdg_pol int affinity = bps->cpu_from + i; t->bps = bps; - t->qfirst = all ? bps->qfirst /* must be 0 */: affinity; + t->qfirst = all ? bps->qfirst /* must be 0 */: affinity; t->qlast = all ? bps->qlast : t->qfirst + 1; D("kthread %d a:%u qf:%u ql:%u", i, affinity, t->qfirst, t->qlast); @@ -2540,7 +2540,7 @@ netmap_bwrap_notify(struct netmap_kring struct netmap_kring *hw_kring; int error; - ND("%s: na %s hwna %s", + ND("%s: na %s hwna %s", (kring ? kring->name : "NULL!"), (na ? na->name : "NULL!"), (hwna ? hwna->name : "NULL!")); Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Tue Oct 18 15:24:56 2016 (r307571) +++ head/sys/net/netmap_user.h Tue Oct 18 15:41:57 2016 (r307572) @@ -391,8 +391,8 @@ struct win_netmap_fd_list { HANDLE win_netmap_handle; }; -/* - * list head containing all the netmap opened fd and their +/* + * list head containing all the netmap opened fd and their * windows HANDLE counterparts */ static struct win_netmap_fd_list *win_netmap_fd_list_head; @@ -453,7 +453,7 @@ win_get_netmap_handle(int fd) /* * use this function only from netmap_user.h internal functions - * same as ioctl, returns 0 on success and -1 on error + * same as ioctl, returns 0 on success and -1 on error */ static int win_nm_ioctl_internal(HANDLE h, int32_t ctlCode, void *arg) @@ -499,9 +499,9 @@ win_nm_ioctl_internal(HANDLE h, int32_t return ioctlReturnStatus ? 0 : -1; } -/* +/* * this function is what must be called from user-space programs - * same as ioctl, returns 0 on success and -1 on error + * same as ioctl, returns 0 on success and -1 on error */ static int win_nm_ioctl(int fd, int32_t ctlCode, void *arg) @@ -541,7 +541,7 @@ win32_mmap_emulated(void *addr, size_t l #include /* XXX needed to use the structure pollfd */ -static int +static int win_nm_poll(struct pollfd *fds, int nfds, int timeout) { HANDLE h; @@ -564,7 +564,7 @@ win_nm_poll(struct pollfd *fds, int nfds #define poll win_nm_poll -static int +static int win_nm_open(char* pathname, int flags) { @@ -583,7 +583,7 @@ win_nm_open(char* pathname, int flags) #define open win_nm_open -static int +static int win_nm_close(int fd) { if (fd != -1) { @@ -919,7 +919,7 @@ nm_close(struct nm_desc *d) if (d->fd != -1) { close(d->fd); } - + bzero(d, sizeof(*d)); free(d); return 0; From owner-svn-src-head@freebsd.org Tue Oct 18 15:50:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63875C17E1E; Tue, 18 Oct 2016 15:50:21 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3DFC7673; Tue, 18 Oct 2016 15:50:21 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IFoK3B053268; Tue, 18 Oct 2016 15:50:20 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IFoKAW053267; Tue, 18 Oct 2016 15:50:20 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610181550.u9IFoKAW053267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 18 Oct 2016 15:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307573 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 15:50:21 -0000 Author: luigi Date: Tue Oct 18 15:50:20 2016 New Revision: 307573 URL: https://svnweb.freebsd.org/changeset/base/307573 Log: remove conditional code for an obsolete feature. if_ptnet now does better. Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Tue Oct 18 15:41:57 2016 (r307572) +++ head/sys/dev/e1000/if_lem.c Tue Oct 18 15:50:20 2016 (r307573) @@ -39,7 +39,6 @@ */ // #define BATCH_DISPATCH // #define NIC_SEND_COMBINING -// #define NIC_PARAVIRT /* enable virtio-like synchronization */ #include "opt_inet.h" #include "opt_inet6.h" @@ -486,10 +485,6 @@ lem_attach(device_t dev) lem_add_rx_process_limit(adapter, "batch_enable", "driver rx batch", &adapter->batch_enable, 0); #endif /* BATCH_DISPATCH */ -#ifdef NIC_PARAVIRT - lem_add_rx_process_limit(adapter, "rx_retries", - "driver rx retries", &adapter->rx_retries, 0); -#endif /* NIC_PARAVIRT */ /* Sysctl for setting the interface flow control */ lem_set_flow_cntrl(adapter, "flow_control", @@ -548,49 +543,6 @@ lem_attach(device_t dev) */ adapter->hw.mac.report_tx_early = 1; -#ifdef NIC_PARAVIRT - device_printf(dev, "driver supports paravirt, subdev 0x%x\n", - adapter->hw.subsystem_device_id); - if (adapter->hw.subsystem_device_id == E1000_PARA_SUBDEV) { - uint64_t bus_addr; - - device_printf(dev, "paravirt support on dev %p\n", adapter); - tsize = 4096; // XXX one page for the csb - if (lem_dma_malloc(adapter, tsize, &adapter->csb_mem, BUS_DMA_NOWAIT)) { - device_printf(dev, "Unable to allocate csb memory\n"); - error = ENOMEM; - goto err_csb; - } - /* Setup the Base of the CSB */ - adapter->csb = (struct paravirt_csb *)adapter->csb_mem.dma_vaddr; - /* force the first kick */ - adapter->csb->host_need_txkick = 1; /* txring empty */ - adapter->csb->guest_need_rxkick = 1; /* no rx packets */ - bus_addr = adapter->csb_mem.dma_paddr; - lem_add_rx_process_limit(adapter, "csb_on", - "enable paravirt.", &adapter->csb->guest_csb_on, 0); - lem_add_rx_process_limit(adapter, "txc_lim", - "txc_lim", &adapter->csb->host_txcycles_lim, 1); - - /* some stats */ -#define PA_SC(name, var, val) \ - lem_add_rx_process_limit(adapter, name, name, var, val) - PA_SC("host_need_txkick",&adapter->csb->host_need_txkick, 1); - PA_SC("host_rxkick_at",&adapter->csb->host_rxkick_at, ~0); - PA_SC("guest_need_txkick",&adapter->csb->guest_need_txkick, 0); - PA_SC("guest_need_rxkick",&adapter->csb->guest_need_rxkick, 1); - PA_SC("tdt_reg_count",&adapter->tdt_reg_count, 0); - PA_SC("tdt_csb_count",&adapter->tdt_csb_count, 0); - PA_SC("tdt_int_count",&adapter->tdt_int_count, 0); - PA_SC("guest_need_kick_count",&adapter->guest_need_kick_count, 0); - /* tell the host where the block is */ - E1000_WRITE_REG(&adapter->hw, E1000_CSBAH, - (u32)(bus_addr >> 32)); - E1000_WRITE_REG(&adapter->hw, E1000_CSBAL, - (u32)bus_addr); - } -#endif /* NIC_PARAVIRT */ - tsize = roundup2(adapter->num_tx_desc * sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); @@ -749,11 +701,6 @@ err_hw_init: err_rx_desc: lem_dma_free(adapter, &adapter->txdma); err_tx_desc: -#ifdef NIC_PARAVIRT - lem_dma_free(adapter, &adapter->csb_mem); -err_csb: -#endif /* NIC_PARAVIRT */ - err_pci: if (adapter->ifp != (void *)NULL) if_free(adapter->ifp); @@ -841,12 +788,6 @@ lem_detach(device_t dev) adapter->rx_desc_base = NULL; } -#ifdef NIC_PARAVIRT - if (adapter->csb) { - lem_dma_free(adapter, &adapter->csb_mem); - adapter->csb = NULL; - } -#endif /* NIC_PARAVIRT */ lem_release_hw_control(adapter); free(adapter->mta, M_DEVBUF); EM_TX_LOCK_DESTROY(adapter); @@ -956,16 +897,6 @@ lem_start_locked(if_t ifp) } if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); -#ifdef NIC_PARAVIRT - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE && adapter->csb && - adapter->csb->guest_csb_on && - !(adapter->csb->guest_need_txkick & 1)) { - adapter->csb->guest_need_txkick = 1; - adapter->guest_need_kick_count++; - // XXX memory barrier - lem_txeof(adapter); // XXX possibly clear IFF_DRV_OACTIVE - } -#endif /* NIC_PARAVIRT */ return; } @@ -1813,24 +1744,6 @@ lem_xmit(struct adapter *adapter, struct bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); -#ifdef NIC_PARAVIRT - if (adapter->csb) { - adapter->csb->guest_tdt = i; - /* XXX memory barrier ? */ - if (adapter->csb->guest_csb_on && - !(adapter->csb->host_need_txkick & 1)) { - /* XXX maybe useless - * clean the ring. maybe do it before ? - * maybe a little bit of histeresys ? - */ - if (adapter->num_tx_desc_avail <= 64) {// XXX - lem_txeof(adapter); - } - return (0); - } - } -#endif /* NIC_PARAVIRT */ - #ifdef NIC_SEND_COMBINING if (adapter->sc_enable) { if (adapter->shadow_tdt & MIT_PENDING_INT) { @@ -2086,20 +1999,6 @@ lem_local_timer(void *arg) lem_smartspeed(adapter); -#ifdef NIC_PARAVIRT - /* recover space if needed */ - if (adapter->csb && adapter->csb->guest_csb_on && - (adapter->watchdog_check == TRUE) && - (ticks - adapter->watchdog_time > EM_WATCHDOG) && - (adapter->num_tx_desc_avail != adapter->num_tx_desc) ) { - lem_txeof(adapter); - /* - * lem_txeof() normally (except when space in the queue - * runs low XXX) cleans watchdog_check so that - * we do not hung. - */ - } -#endif /* NIC_PARAVIRT */ /* * We check the watchdog: the time since * the last TX descriptor was cleaned. @@ -3176,12 +3075,6 @@ lem_txeof(struct adapter *adapter) */ if (adapter->num_tx_desc_avail > EM_TX_CLEANUP_THRESHOLD) { if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); -#ifdef NIC_PARAVIRT - if (adapter->csb) { // XXX also csb_on ? - adapter->csb->guest_need_txkick = 2; /* acked */ - // XXX memory barrier - } -#endif /* NIC_PARAVIRT */ if (adapter->num_tx_desc_avail == adapter->num_tx_desc) { adapter->watchdog_check = FALSE; return; @@ -3570,15 +3463,6 @@ lem_rxeof(struct adapter *adapter, int c #ifdef BATCH_DISPATCH struct mbuf *mh = NULL, *mt = NULL; #endif /* BATCH_DISPATCH */ -#ifdef NIC_PARAVIRT - int retries = 0; - struct paravirt_csb* csb = adapter->csb; - int csb_mode = csb && csb->guest_csb_on; - - //ND("clear guest_rxkick at %d", adapter->next_rx_desc_to_check); - if (csb_mode && csb->guest_need_rxkick) - csb->guest_need_rxkick = 0; -#endif /* NIC_PARAVIRT */ EM_RX_LOCK(adapter); #ifdef BATCH_DISPATCH @@ -3596,45 +3480,20 @@ lem_rxeof(struct adapter *adapter, int c } #endif /* DEV_NETMAP */ -#if 1 // XXX optimization ? if (!((current_desc->status) & E1000_RXD_STAT_DD)) { if (done != NULL) *done = rx_sent; EM_RX_UNLOCK(adapter); return (FALSE); } -#endif /* 0 */ while (count != 0 && if_getdrvflags(ifp) & IFF_DRV_RUNNING) { struct mbuf *m = NULL; status = current_desc->status; if ((status & E1000_RXD_STAT_DD) == 0) { -#ifdef NIC_PARAVIRT - if (csb_mode) { - /* buffer not ready yet. Retry a few times before giving up */ - if (++retries <= adapter->rx_retries) { - continue; - } - if (csb->guest_need_rxkick == 0) { - // ND("set guest_rxkick at %d", adapter->next_rx_desc_to_check); - csb->guest_need_rxkick = 1; - // XXX memory barrier, status volatile ? - continue; /* double check */ - } - } - /* no buffer ready, give up */ -#endif /* NIC_PARAVIRT */ break; } -#ifdef NIC_PARAVIRT - if (csb_mode) { - if (csb->guest_need_rxkick) - // ND("clear again guest_rxkick at %d", adapter->next_rx_desc_to_check); - csb->guest_need_rxkick = 0; - retries = 0; - } -#endif /* NIC_PARAVIRT */ mp = adapter->rx_buffer_area[i].m_head; /* @@ -3759,18 +3618,6 @@ discard: bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); -#ifdef NIC_PARAVIRT - if (csb_mode) { - /* the buffer at i has been already replaced by lem_get_buf() - * so it is safe to set guest_rdt = i and possibly send a kick. - * XXX see if we can optimize it later. - */ - csb->guest_rdt = i; - // XXX memory barrier - if (i == csb->host_rxkick_at) - E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i); - } -#endif /* NIC_PARAVIRT */ /* Advance our pointers to the next descriptor. */ if (++i == adapter->num_rx_desc) i = 0; @@ -3817,9 +3664,6 @@ discard: /* Advance the E1000's Receive Queue #0 "Tail Pointer". */ if (--i < 0) i = adapter->num_rx_desc - 1; -#ifdef NIC_PARAVIRT - if (!csb_mode) /* filter out writes */ -#endif /* NIC_PARAVIRT */ E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i); if (done != NULL) *done = rx_sent; From owner-svn-src-head@freebsd.org Tue Oct 18 16:18:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DD6DC16871; Tue, 18 Oct 2016 16:18:27 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0C057CC7; Tue, 18 Oct 2016 16:18:26 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9IGIQsi064549; Tue, 18 Oct 2016 16:18:26 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IGIPbG064539; Tue, 18 Oct 2016 16:18:25 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610181618.u9IGIPbG064539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 18 Oct 2016 16:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307574 - in head/sys: dev/netmap net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 16:18:27 -0000 Author: luigi Date: Tue Oct 18 16:18:25 2016 New Revision: 307574 URL: https://svnweb.freebsd.org/changeset/base/307574 Log: remove stale and unused code from various files fix build on 32 bit platforms simplify logic in netmap_virt.h The commands (in net/netmap.h) to configure communication with the hypervisor may be revised soon. At the moment they are unused so this will not be a change of API. Modified: head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_ptnet.c head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_pt.c head/sys/net/netmap.h head/sys/net/netmap_virt.h Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/dev/netmap/if_lem_netmap.h Tue Oct 18 16:18:25 2016 (r307574) @@ -35,12 +35,8 @@ #include #include -#include -#include /* vtophys ? */ #include -extern int netmap_adaptive_io; - /* * Register/unregister. We are already under netmap lock. */ Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/dev/netmap/if_ptnet.c Tue Oct 18 16:18:25 2016 (r307574) @@ -341,7 +341,11 @@ ptnet_attach(device_t dev) } { - vm_paddr_t paddr = vtophys(sc->csb); + /* + * We use uint64_t rather than vm_paddr_t since we + * need 64 bit addresses even on 32 bit platforms. + */ + uint64_t paddr = vtophys(sc->csb); bus_write_4(sc->iomem, PTNET_IO_CSBBAH, (paddr >> 32) & 0xffffffff); @@ -1139,9 +1143,11 @@ ptnet_sync_from_csb(struct ptnet_softc * static void ptnet_update_vnet_hdr(struct ptnet_softc *sc) { - sc->vnet_hdr_len = ptnet_vnet_hdr ? PTNET_HDR_SIZE : 0; + unsigned int wanted_hdr_len = ptnet_vnet_hdr ? PTNET_HDR_SIZE : 0; + + bus_write_4(sc->iomem, PTNET_IO_VNET_HDR_LEN, wanted_hdr_len); + sc->vnet_hdr_len = bus_read_4(sc->iomem, PTNET_IO_VNET_HDR_LEN); sc->ptna->hwup.up.virt_hdr_len = sc->vnet_hdr_len; - bus_write_4(sc->iomem, PTNET_IO_VNET_HDR_LEN, sc->vnet_hdr_len); } static int Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/dev/netmap/netmap.c Tue Oct 18 16:18:25 2016 (r307574) @@ -483,7 +483,6 @@ static int netmap_no_timestamp; /* don't int netmap_mitigate = 1; int netmap_no_pendintr = 1; int netmap_txsync_retry = 2; -int netmap_adaptive_io = 0; int netmap_flags = 0; /* debug flags */ static int netmap_fwd = 0; /* force transparent mode */ @@ -540,8 +539,6 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); SYSCTL_INT(_dev_netmap, OID_AUTO, txsync_retry, CTLFLAG_RW, &netmap_txsync_retry, 0 , "Number of txsync loops in bridge's flush."); -SYSCTL_INT(_dev_netmap, OID_AUTO, adaptive_io, CTLFLAG_RW, - &netmap_adaptive_io, 0 , "Adaptive I/O on paravirt"); SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); @@ -1559,7 +1556,7 @@ nm_txsync_prologue(struct netmap_kring * } } if (ring->tail != kring->rtail) { - RD(5, "tail overwritten was %d need %d", + RD(5, "%s tail overwritten was %d need %d", kring->name, ring->tail, kring->rtail); ring->tail = kring->rtail; } Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/dev/netmap/netmap_freebsd.c Tue Oct 18 16:18:25 2016 (r307574) @@ -353,7 +353,7 @@ nm_os_generic_xmit_frame(struct nm_os_ge bcopy(a->addr, m->m_data, len); #else /* __FreeBSD_version >= 1100000 */ /* New FreeBSD versions. Link the external storage to - * the netmap buffer, so that no copy is necessary. */ + * the netmap buffer, so that no copy is necessary. */ m->m_ext.ext_buf = m->m_data = a->addr; m->m_ext.ext_size = len; #endif /* __FreeBSD_version >= 1100000 */ @@ -644,7 +644,8 @@ DRIVER_MODULE_ORDERED(ptn_memdev, pci, p * of the netmap memory mapped in the guest. */ int -nm_os_pt_memdev_iomap(struct ptnetmap_memdev *ptn_dev, vm_paddr_t *nm_paddr, void **nm_addr) +nm_os_pt_memdev_iomap(struct ptnetmap_memdev *ptn_dev, vm_paddr_t *nm_paddr, + void **nm_addr) { uint32_t mem_size; int rid; @@ -668,8 +669,8 @@ nm_os_pt_memdev_iomap(struct ptnetmap_me D("=== BAR %d start %lx len %lx mem_size %x ===", PTNETMAP_MEM_PCI_BAR, - *nm_paddr, - rman_get_size(ptn_dev->pci_mem), + (unsigned long)(*nm_paddr), + (unsigned long)rman_get_size(ptn_dev->pci_mem), mem_size); return (0); } Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/dev/netmap/netmap_generic.c Tue Oct 18 16:18:25 2016 (r307574) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); /* * For older versions of FreeBSD: - * + * * We allocate EXT_PACKET mbuf+clusters, but need to set M_NOFREE * so that the destructor, if invoked, will not free the packet. * In principle we should set the destructor only on demand, @@ -628,8 +628,6 @@ generic_mbuf_destructor(struct mbuf *m) #endif } -extern int netmap_adaptive_io; - /* Record completed transmissions and update hwtail. * * The oldest tx buffer not yet completed is at nr_hwtail + 1, @@ -690,23 +688,6 @@ generic_netmap_tx_clean(struct netmap_kr n++; nm_i = nm_next(nm_i, lim); -#if 0 /* rate adaptation */ - if (netmap_adaptive_io > 1) { - if (n >= netmap_adaptive_io) - break; - } else if (netmap_adaptive_io) { - /* if hwcur - nm_i < lim/8 do an early break - * so we prevent the sender from stalling. See CVT. - */ - if (hwcur >= nm_i) { - if (hwcur - nm_i < lim/2) - break; - } else { - if (hwcur + lim + 1 - nm_i < lim/2) - break; - } - } -#endif } kring->nr_hwtail = nm_prev(nm_i, lim); ND("tx completed [%d] -> hwtail %d", n, kring->nr_hwtail); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/dev/netmap/netmap_kern.h Tue Oct 18 16:18:25 2016 (r307574) @@ -1512,9 +1512,9 @@ int netmap_adapter_put(struct netmap_ada */ #define NETMAP_BUF_BASE(_na) ((_na)->na_lut.lut[0].vaddr) #define NETMAP_BUF_SIZE(_na) ((_na)->na_lut.objsize) -extern int netmap_mitigate; // XXX not really used extern int netmap_no_pendintr; -extern int netmap_verbose; // XXX debugging +extern int netmap_mitigate; +extern int netmap_verbose; /* for debugging */ enum { /* verbose flags */ NM_VERB_ON = 1, /* generic verbose */ NM_VERB_HOST = 0x2, /* verbose host stack */ @@ -1527,7 +1527,6 @@ enum { }; extern int netmap_txsync_retry; -extern int netmap_adaptive_io; extern int netmap_flags; extern int netmap_generic_mit; extern int netmap_generic_ringsize; Modified: head/sys/dev/netmap/netmap_pt.c ============================================================================== --- head/sys/dev/netmap/netmap_pt.c Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/dev/netmap/netmap_pt.c Tue Oct 18 16:18:25 2016 (r307574) @@ -64,13 +64,10 @@ * results in random drops in the VALE txsync. */ //#define PTN_TX_BATCH_LIM(_n) ((_n >> 1)) -/* XXX: avoid nm_*sync_prologue(). XXX-vin: this should go away, - * we should never trust the guest. */ -#define PTN_AVOID_NM_PROLOGUE //#define BUSY_WAIT -#define DEBUG /* Enables communication debugging. */ -#ifdef DEBUG +#define NETMAP_PT_DEBUG /* Enables communication debugging. */ +#ifdef NETMAP_PT_DEBUG #define DBG(x) x #else #define DBG(x) @@ -196,22 +193,6 @@ ptnetmap_kring_dump(const char *title, c kring->ring->head, kring->ring->cur, kring->ring->tail); } -#if 0 -static inline void -ptnetmap_ring_reinit(struct netmap_kring *kring, uint32_t g_head, uint32_t g_cur) -{ - struct netmap_ring *ring = kring->ring; - - //XXX: trust guest? - ring->head = g_head; - ring->cur = g_cur; - ring->tail = NM_ACCESS_ONCE(kring->nr_hwtail); - - netmap_ring_reinit(kring); - ptnetmap_kring_dump("kring reinit", kring); -} -#endif - /* * TX functions to set/get and to handle host/guest kick. */ @@ -251,7 +232,7 @@ ptnetmap_tx_handler(void *data) (struct netmap_pt_host_adapter *)kring->na->na_private; struct ptnetmap_state *ptns = pth_na->ptns; struct ptnet_ring __user *ptring; - struct netmap_ring g_ring; /* guest ring pointer, copied from CSB */ + struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */ bool more_txspace = false; struct nm_kthread *kth; uint32_t num_slots; @@ -281,18 +262,18 @@ ptnetmap_tx_handler(void *data) kth = ptns->kthreads[kring->ring_id]; num_slots = kring->nkr_num_slots; - g_ring.head = kring->rhead; - g_ring.cur = kring->rcur; + shadow_ring.head = kring->rhead; + shadow_ring.cur = kring->rcur; /* Disable guest --> host notifications. */ ptring_kick_enable(ptring, 0); /* Copy the guest kring pointers from the CSB */ - ptnetmap_host_read_kring_csb(ptring, &g_ring, num_slots); + ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); for (;;) { /* If guest moves ahead too fast, let's cut the move so * that we don't exceed our batch limit. */ - batch = g_ring.head - kring->nr_hwcur; + batch = shadow_ring.head - kring->nr_hwcur; if (batch < 0) batch += num_slots; @@ -302,37 +283,35 @@ ptnetmap_tx_handler(void *data) if (head_lim >= num_slots) head_lim -= num_slots; - ND(1, "batch: %d head: %d head_lim: %d", batch, g_ring.head, + ND(1, "batch: %d head: %d head_lim: %d", batch, shadow_ring.head, head_lim); - g_ring.head = head_lim; + shadow_ring.head = head_lim; batch = PTN_TX_BATCH_LIM(num_slots); } #endif /* PTN_TX_BATCH_LIM */ if (nm_kr_txspace(kring) <= (num_slots >> 1)) { - g_ring.flags |= NAF_FORCE_RECLAIM; + shadow_ring.flags |= NAF_FORCE_RECLAIM; } -#ifndef PTN_AVOID_NM_PROLOGUE + /* Netmap prologue */ - if (unlikely(nm_txsync_prologue(kring, &g_ring) >= num_slots)) { - ptnetmap_ring_reinit(kring, g_ring.head, g_ring.cur); - /* Reenable notifications. */ + shadow_ring.tail = kring->rtail; + if (unlikely(nm_txsync_prologue(kring, &shadow_ring) >= num_slots)) { + /* Reinit ring and enable notifications. */ + netmap_ring_reinit(kring); ptring_kick_enable(ptring, 1); break; } -#else /* PTN_AVOID_NM_PROLOGUE */ - kring->rhead = g_ring.head; - kring->rcur = g_ring.cur; -#endif /* !PTN_AVOID_NM_PROLOGUE */ + if (unlikely(netmap_verbose & NM_VERB_TXSYNC)) { ptnetmap_kring_dump("pre txsync", kring); } IFRATE(pre_tail = kring->rtail); - if (unlikely(kring->nm_sync(kring, g_ring.flags))) { + if (unlikely(kring->nm_sync(kring, shadow_ring.flags))) { /* Reenable notifications. */ ptring_kick_enable(ptring, 1); - D("ERROR txsync"); + D("ERROR txsync()"); break; } @@ -350,7 +329,7 @@ ptnetmap_tx_handler(void *data) } IFRATE(rate_batch_stats_update(&ptns->rate_ctx.new.txbs, pre_tail, - kring->rtail, num_slots)); + kring->rtail, num_slots)); if (unlikely(netmap_verbose & NM_VERB_TXSYNC)) { ptnetmap_kring_dump("post txsync", kring); @@ -367,9 +346,9 @@ ptnetmap_tx_handler(void *data) } #endif /* Read CSB to see if there is more work to do. */ - ptnetmap_host_read_kring_csb(ptring, &g_ring, num_slots); + ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); #ifndef BUSY_WAIT - if (g_ring.head == kring->rhead) { + if (shadow_ring.head == kring->rhead) { /* * No more packets to transmit. We enable notifications and * go to sleep, waiting for a kick from the guest when new @@ -379,8 +358,8 @@ ptnetmap_tx_handler(void *data) /* Reenable notifications. */ ptring_kick_enable(ptring, 1); /* Doublecheck. */ - ptnetmap_host_read_kring_csb(ptring, &g_ring, num_slots); - if (g_ring.head != kring->rhead) { + ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + if (shadow_ring.head != kring->rhead) { /* We won the race condition, there are more packets to * transmit. Disable notifications and do another cycle */ ptring_kick_enable(ptring, 0); @@ -433,7 +412,7 @@ ptnetmap_rx_handler(void *data) (struct netmap_pt_host_adapter *)kring->na->na_private; struct ptnetmap_state *ptns = pth_na->ptns; struct ptnet_ring __user *ptring; - struct netmap_ring g_ring; /* guest ring pointer, copied from CSB */ + struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */ struct nm_kthread *kth; uint32_t num_slots; int dry_cycles = 0; @@ -464,36 +443,32 @@ ptnetmap_rx_handler(void *data) kth = ptns->kthreads[pth_na->up.num_tx_rings + kring->ring_id]; num_slots = kring->nkr_num_slots; - g_ring.head = kring->rhead; - g_ring.cur = kring->rcur; + shadow_ring.head = kring->rhead; + shadow_ring.cur = kring->rcur; /* Disable notifications. */ ptring_kick_enable(ptring, 0); /* Copy the guest kring pointers from the CSB */ - ptnetmap_host_read_kring_csb(ptring, &g_ring, num_slots); + ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); for (;;) { uint32_t hwtail; -#ifndef PTN_AVOID_NM_PROLOGUE /* Netmap prologue */ - if (unlikely(nm_rxsync_prologue(kring, &g_ring) >= num_slots)) { - ptnetmap_ring_reinit(kring, g_ring.head, g_ring.cur); - /* Reenable notifications. */ + shadow_ring.tail = kring->rtail; + if (unlikely(nm_rxsync_prologue(kring, &shadow_ring) >= num_slots)) { + /* Reinit ring and enable notifications. */ + netmap_ring_reinit(kring); ptring_kick_enable(ptring, 1); break; } -#else /* PTN_AVOID_NM_PROLOGUE */ - kring->rhead = g_ring.head; - kring->rcur = g_ring.cur; -#endif /* !PTN_AVOID_NM_PROLOGUE */ - if (unlikely(netmap_verbose & NM_VERB_RXSYNC)) + if (unlikely(netmap_verbose & NM_VERB_RXSYNC)) { ptnetmap_kring_dump("pre rxsync", kring); + } IFRATE(pre_tail = kring->rtail); - - if (unlikely(kring->nm_sync(kring, g_ring.flags))) { + if (unlikely(kring->nm_sync(kring, shadow_ring.flags))) { /* Reenable notifications. */ ptring_kick_enable(ptring, 1); D("ERROR rxsync()"); @@ -516,8 +491,9 @@ ptnetmap_rx_handler(void *data) IFRATE(rate_batch_stats_update(&ptns->rate_ctx.new.rxbs, pre_tail, kring->rtail, num_slots)); - if (unlikely(netmap_verbose & NM_VERB_RXSYNC)) + if (unlikely(netmap_verbose & NM_VERB_RXSYNC)) { ptnetmap_kring_dump("post rxsync", kring); + } #ifndef BUSY_WAIT /* Interrupt the guest if needed. */ @@ -530,9 +506,9 @@ ptnetmap_rx_handler(void *data) } #endif /* Read CSB to see if there is more work to do. */ - ptnetmap_host_read_kring_csb(ptring, &g_ring, num_slots); + ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); #ifndef BUSY_WAIT - if (ptnetmap_norxslots(kring, g_ring.head)) { + if (ptnetmap_norxslots(kring, shadow_ring.head)) { /* * No more slots available for reception. We enable notification and * go to sleep, waiting for a kick from the guest when new receive @@ -542,8 +518,8 @@ ptnetmap_rx_handler(void *data) /* Reenable notifications. */ ptring_kick_enable(ptring, 1); /* Doublecheck. */ - ptnetmap_host_read_kring_csb(ptring, &g_ring, num_slots); - if (!ptnetmap_norxslots(kring, g_ring.head)) { + ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + if (!ptnetmap_norxslots(kring, shadow_ring.head)) { /* We won the race condition, more slots are available. Disable * notifications and do another cycle. */ ptring_kick_enable(ptring, 0); @@ -578,7 +554,7 @@ ptnetmap_rx_handler(void *data) } } -#ifdef DEBUG +#ifdef NETMAP_PT_DEBUG static void ptnetmap_print_configuration(struct ptnetmap_cfg *cfg) { @@ -594,7 +570,7 @@ ptnetmap_print_configuration(struct ptne } } -#endif +#endif /* NETMAP_PT_DEBUG */ /* Copy actual state of the host ring into the CSB for the guest init */ static int Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/net/netmap.h Tue Oct 18 16:18:25 2016 (r307574) @@ -655,8 +655,8 @@ struct ptn_vmm_ioctl_msix { /* IOCTL parameters */ struct nm_kth_ioctl { - u_long com; - /* TODO: use union */ + uint64_t com; + /* We use union to support more ioctl commands. */ union { struct ptn_vmm_ioctl_msix msix; } data; @@ -667,5 +667,6 @@ struct ptnet_ring_cfg { uint64_t ioeventfd; /* eventfd in linux, tsleep() parameter in FreeBSD */ uint64_t irqfd; /* eventfd in linux, ioctl fd in FreeBSD */ struct nm_kth_ioctl ioctl; /* ioctl parameter to send irq (only used in bhyve/FreeBSD) */ + uint64_t reserved[4]; /* reserved to support of more hypervisors */ }; #endif /* _NET_NETMAP_H_ */ Modified: head/sys/net/netmap_virt.h ============================================================================== --- head/sys/net/netmap_virt.h Tue Oct 18 15:50:20 2016 (r307573) +++ head/sys/net/netmap_virt.h Tue Oct 18 16:18:25 2016 (r307574) @@ -58,13 +58,11 @@ /* Registers for the ptnetmap memdev */ /* 32 bit r/o */ -#define PTNETMAP_IO_PCI_FEATURES 0 /* XXX should be removed */ -/* 32 bit r/o */ -#define PTNETMAP_IO_PCI_MEMSIZE 4 /* size of the netmap memory shared +#define PTNETMAP_IO_PCI_MEMSIZE 0 /* size of the netmap memory shared * between guest and host */ /* 16 bit r/o */ -#define PTNETMAP_IO_PCI_HOSTID 8 /* memory allocator ID in netmap host */ -#define PTNETMAP_IO_SIZE 10 +#define PTNETMAP_IO_PCI_HOSTID 4 /* memory allocator ID in netmap host */ +#define PTNETMAP_IO_SIZE 6 /* * ptnetmap configuration @@ -115,18 +113,17 @@ ptnetmap_write_cfg(struct nmreq *nmr, st #define PTNET_IO_PTFEAT 0 #define PTNET_IO_PTCTL 4 #define PTNET_IO_PTSTS 8 -/* hole */ -#define PTNET_IO_MAC_LO 16 -#define PTNET_IO_MAC_HI 20 -#define PTNET_IO_CSBBAH 24 -#define PTNET_IO_CSBBAL 28 -#define PTNET_IO_NIFP_OFS 32 -#define PTNET_IO_NUM_TX_RINGS 36 -#define PTNET_IO_NUM_RX_RINGS 40 -#define PTNET_IO_NUM_TX_SLOTS 44 -#define PTNET_IO_NUM_RX_SLOTS 48 -#define PTNET_IO_VNET_HDR_LEN 52 -#define PTNET_IO_END 56 +#define PTNET_IO_MAC_LO 12 +#define PTNET_IO_MAC_HI 16 +#define PTNET_IO_CSBBAH 20 +#define PTNET_IO_CSBBAL 24 +#define PTNET_IO_NIFP_OFS 28 +#define PTNET_IO_NUM_TX_RINGS 32 +#define PTNET_IO_NUM_RX_RINGS 36 +#define PTNET_IO_NUM_TX_SLOTS 40 +#define PTNET_IO_NUM_RX_SLOTS 44 +#define PTNET_IO_VNET_HDR_LEN 48 +#define PTNET_IO_END 52 #define PTNET_IO_KICK_BASE 128 #define PTNET_IO_MASK 0xff @@ -139,11 +136,11 @@ struct ptnet_ring { uint32_t head; /* GW+ HR+ the head of the guest netmap_ring */ uint32_t cur; /* GW+ HR+ the cur of the guest netmap_ring */ uint32_t guest_need_kick; /* GW+ HR+ host-->guest notification enable */ - char pad[4]; + uint32_t sync_flags; /* GW+ HR+ the flags of the guest [tx|rx]sync() */ uint32_t hwcur; /* GR+ HW+ the hwcur of the host netmap_kring */ uint32_t hwtail; /* GR+ HW+ the hwtail of the host netmap_kring */ uint32_t host_need_kick; /* GR+ HW+ guest-->host notification enable */ - uint32_t sync_flags; /* GW+ HR+ the flags of the guest [tx|rx]sync() */ + char pad[4]; }; /* CSB for the ptnet device. */ @@ -165,161 +162,119 @@ ptn_sub(uint32_t l_elem, uint32_t r_elem } #endif /* WITH_PTNETMAP_HOST || WITH_PTNETMAP_GUEST */ -#ifdef WITH_PTNETMAP_HOST -/* - * ptnetmap kernel thread routines - * */ - -/* Functions to read and write CSB fields in the host */ -#if defined (linux) -#define CSB_READ(csb, field, r) (get_user(r, &csb->field)) -#define CSB_WRITE(csb, field, v) (put_user(v, &csb->field)) -#else /* ! linux */ -#define CSB_READ(csb, field, r) (r = fuword32(&csb->field)) -#define CSB_WRITE(csb, field, v) (suword32(&csb->field, v)) -#endif /* ! linux */ +#ifdef WITH_PTNETMAP_GUEST -/* - * HOST read/write kring pointers from/in CSB - */ +/* ptnetmap_memdev routines used to talk with ptnetmap_memdev device driver */ +struct ptnetmap_memdev; +int nm_os_pt_memdev_iomap(struct ptnetmap_memdev *, vm_paddr_t *, void **); +void nm_os_pt_memdev_iounmap(struct ptnetmap_memdev *); -/* Host: Read kring pointers (head, cur, sync_flags) from CSB */ +/* Guest driver: Write kring pointers (cur, head) to the CSB. + * This routine is coupled with ptnetmap_host_read_kring_csb(). */ static inline void -ptnetmap_host_read_kring_csb(struct ptnet_ring __user *ptr, - struct netmap_ring *g_ring, - uint32_t num_slots) +ptnetmap_guest_write_kring_csb(struct ptnet_ring *ptr, uint32_t cur, + uint32_t head) { - uint32_t old_head = g_ring->head, old_cur = g_ring->cur; - uint32_t d, inc_h, inc_c; - - //mb(); /* Force memory complete before read CSB */ - /* - * We must first read head and then cur with a barrier in the - * middle, because cur can exceed head, but not vice versa. - * The guest must first write cur and then head with a barrier. - * - * head <= cur - * - * guest host - * - * STORE(cur) LOAD(head) - * mb() ----------- mb() - * STORE(head) LOAD(cur) - * - * This approach ensures that every head that we read is - * associated with the correct cur. In this way head can not exceed cur. + * We need to write cur and head to the CSB but we cannot do it atomically. + * There is no way we can prevent the host from reading the updated value + * of one of the two and the old value of the other. However, if we make + * sure that the host never reads a value of head more recent than the + * value of cur we are safe. We can allow the host to read a value of cur + * more recent than the value of head, since in the netmap ring cur can be + * ahead of head and cur cannot wrap around head because it must be behind + * tail. Inverting the order of writes below could instead result into the + * host to think head went ahead of cur, which would cause the sync + * prologue to fail. + * + * The following memory barrier scheme is used to make this happen: + * + * Guest Host + * + * STORE(cur) LOAD(head) + * mb() <-----------> mb() + * STORE(head) LOAD(cur) */ - CSB_READ(ptr, head, g_ring->head); + ptr->cur = cur; mb(); - CSB_READ(ptr, cur, g_ring->cur); - CSB_READ(ptr, sync_flags, g_ring->flags); - - /* - * Even with the previous barrier, it is still possible that we read an - * updated cur and an old head. - * To detect this situation, we can check if the new cur overtakes - * the (apparently) new head. - */ - d = ptn_sub(old_cur, old_head, num_slots); /* previous distance */ - inc_c = ptn_sub(g_ring->cur, old_cur, num_slots); /* increase of cur */ - inc_h = ptn_sub(g_ring->head, old_head, num_slots); /* increase of head */ - - if (unlikely(inc_c > num_slots - d + inc_h)) { /* cur overtakes head */ - ND(1,"ERROR cur overtakes head - old_cur: %u cur: %u old_head: %u head: %u", - old_cur, g_ring->cur, old_head, g_ring->head); - g_ring->cur = nm_prev(g_ring->head, num_slots - 1); - //*g_cur = *g_head; - } + ptr->head = head; } -/* Host: Write kring pointers (hwcur, hwtail) into the CSB */ +/* Guest driver: Read kring pointers (hwcur, hwtail) from the CSB. + * This routine is coupled with ptnetmap_host_write_kring_csb(). */ static inline void -ptnetmap_host_write_kring_csb(struct ptnet_ring __user *ptr, uint32_t hwcur, - uint32_t hwtail) +ptnetmap_guest_read_kring_csb(struct ptnet_ring *ptr, struct netmap_kring *kring) { - /* We must write hwtail before hwcur (see below). */ - CSB_WRITE(ptr, hwtail, hwtail); + /* + * We place a memory barrier to make sure that the update of hwtail never + * overtakes the update of hwcur. + * (see explanation in ptnetmap_host_write_kring_csb). + */ + kring->nr_hwtail = ptr->hwtail; mb(); - CSB_WRITE(ptr, hwcur, hwcur); - - //mb(); /* Force memory complete before send notification */ + kring->nr_hwcur = ptr->hwcur; } -#endif /* WITH_PTNETMAP_HOST */ +#endif /* WITH_PTNETMAP_GUEST */ -#ifdef WITH_PTNETMAP_GUEST +#ifdef WITH_PTNETMAP_HOST /* - * GUEST read/write kring pointers from/in CSB. - * To use into device driver. - */ + * ptnetmap kernel thread routines + * */ + +/* Functions to read and write CSB fields in the host */ +#if defined (linux) +#define CSB_READ(csb, field, r) (get_user(r, &csb->field)) +#define CSB_WRITE(csb, field, v) (put_user(v, &csb->field)) +#else /* ! linux */ +#define CSB_READ(csb, field, r) (r = fuword32(&csb->field)) +#define CSB_WRITE(csb, field, v) (suword32(&csb->field, v)) +#endif /* ! linux */ -/* Guest: Write kring pointers (cur, head) into the CSB */ +/* Host netmap: Write kring pointers (hwcur, hwtail) to the CSB. + * This routine is coupled with ptnetmap_guest_read_kring_csb(). */ static inline void -ptnetmap_guest_write_kring_csb(struct ptnet_ring *ptr, uint32_t cur, - uint32_t head) +ptnetmap_host_write_kring_csb(struct ptnet_ring __user *ptr, uint32_t hwcur, + uint32_t hwtail) { - /* We must write cur before head for sync reason (see above) */ - ptr->cur = cur; + /* + * The same scheme used in ptnetmap_guest_write_kring_csb() applies here. + * We allow the guest to read a value of hwcur more recent than the value + * of hwtail, since this would anyway result in a consistent view of the + * ring state (and hwcur can never wraparound hwtail, since hwcur must be + * behind head). + * + * The following memory barrier scheme is used to make this happen: + * + * Guest Host + * + * STORE(hwcur) LOAD(hwtail) + * mb() <-------------> mb() + * STORE(hwtail) LOAD(hwcur) + */ + CSB_WRITE(ptr, hwcur, hwcur); mb(); - ptr->head = head; - - //mb(); /* Force memory complete before send notification */ + CSB_WRITE(ptr, hwtail, hwtail); } -/* Guest: Read kring pointers (hwcur, hwtail) from CSB */ +/* Host netmap: Read kring pointers (head, cur, sync_flags) from the CSB. + * This routine is coupled with ptnetmap_guest_write_kring_csb(). */ static inline void -ptnetmap_guest_read_kring_csb(struct ptnet_ring *ptr, struct netmap_kring *kring) +ptnetmap_host_read_kring_csb(struct ptnet_ring __user *ptr, + struct netmap_ring *shadow_ring, + uint32_t num_slots) { - uint32_t old_hwcur = kring->nr_hwcur, old_hwtail = kring->nr_hwtail; - uint32_t num_slots = kring->nkr_num_slots; - uint32_t d, inc_hc, inc_ht; - - //mb(); /* Force memory complete before read CSB */ - /* - * We must first read hwcur and then hwtail with a barrier in the - * middle, because hwtail can exceed hwcur, but not vice versa. - * The host must first write hwtail and then hwcur with a barrier. - * - * hwcur <= hwtail - * - * host guest - * - * STORE(hwtail) LOAD(hwcur) - * mb() --------- mb() - * STORE(hwcur) LOAD(hwtail) - * - * This approach ensures that every hwcur that the guest reads is - * associated with the correct hwtail. In this way hwcur can not exceed - * hwtail. + * We place a memory barrier to make sure that the update of head never + * overtakes the update of cur. + * (see explanation in ptnetmap_guest_write_kring_csb). */ - kring->nr_hwcur = ptr->hwcur; + CSB_READ(ptr, head, shadow_ring->head); mb(); - kring->nr_hwtail = ptr->hwtail; - - /* - * Even with the previous barrier, it is still possible that we read an - * updated hwtail and an old hwcur. - * To detect this situation, we can check if the new hwtail overtakes - * the (apparently) new hwcur. - */ - d = ptn_sub(old_hwtail, old_hwcur, num_slots); /* previous distance */ - inc_ht = ptn_sub(kring->nr_hwtail, old_hwtail, num_slots); /* increase of hwtail */ - inc_hc = ptn_sub(kring->nr_hwcur, old_hwcur, num_slots); /* increase of hwcur */ - - if (unlikely(inc_ht > num_slots - d + inc_hc)) { - ND(1, "ERROR hwtail overtakes hwcur - old_hwtail: %u hwtail: %u old_hwcur: %u hwcur: %u", - old_hwtail, kring->nr_hwtail, old_hwcur, kring->nr_hwcur); - kring->nr_hwtail = nm_prev(kring->nr_hwcur, num_slots - 1); - //kring->nr_hwtail = kring->nr_hwcur; - } + CSB_READ(ptr, cur, shadow_ring->cur); + CSB_READ(ptr, sync_flags, shadow_ring->flags); } -/* ptnetmap_memdev routines used to talk with ptnetmap_memdev device driver */ -struct ptnetmap_memdev; -int nm_os_pt_memdev_iomap(struct ptnetmap_memdev *, vm_paddr_t *, void **); -void nm_os_pt_memdev_iounmap(struct ptnetmap_memdev *); -#endif /* WITH_PTNETMAP_GUEST */ +#endif /* WITH_PTNETMAP_HOST */ #endif /* NETMAP_VIRT_H */ From owner-svn-src-head@freebsd.org Tue Oct 18 17:22:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F22BC17339; Tue, 18 Oct 2016 17:22:36 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (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 465391B9; Tue, 18 Oct 2016 17:22:35 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sc1.bsdpad.com ([163.172.212.18]:43446) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1bwY5s-0009x7-e7 (Exim 4.86_36-e07b163) (return-path ); Tue, 18 Oct 2016 18:22:28 +0100 Date: Tue, 18 Oct 2016 17:22:07 +0000 From: Ruslan Bukin To: Baptiste Daroussin Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r306864 - head Message-ID: <20161018172207.GA59150@bsdpad.com> References: <201610081857.u98IvB7l012374@repo.freebsd.org> <20161018061755.makbm4tvtb5i6rc4@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161018061755.makbm4tvtb5i6rc4@ivaldir.etoilebsd.net> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 17:22:36 -0000 On Tue, Oct 18, 2016 at 08:17:55AM +0200, Baptiste Daroussin wrote: > On Mon, Oct 17, 2016 at 06:28:08PM -0700, Ngie Cooper wrote: > > On Sat, Oct 8, 2016 at 11:57 AM, Baptiste Daroussin wrote: > > > Author: bapt > > > Date: Sat Oct 8 18:57:11 2016 > > > New Revision: 306864 > > > URL: https://svnweb.freebsd.org/changeset/base/306864 > > > > > > Log: > > > groff is not needed in the bootstrap tools if the system is built > > > WITHOUT_SHAREDOCS > > > > > > MFC after: 2 weeks > > > > > > Modified: > > > head/Makefile.inc1 > > > > This breaks buildworld when WITHOUT_GROFF is set and > > WITHOUT_SHAREDOCS isn't set. > > Really do you have logs of that? > Hi this breaks RISC-V world (we use external GNU toolchain) Here is log: https://people.freebsd.org/~br/riscv_wlog.txt Ruslan From owner-svn-src-head@freebsd.org Tue Oct 18 21:17:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BAB2C17885; Tue, 18 Oct 2016 21:17:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6DB80B24; Tue, 18 Oct 2016 21:17:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9ILHVmL087006; Tue, 18 Oct 2016 21:17:31 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ILHVGS087004; Tue, 18 Oct 2016 21:17:31 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201610182117.u9ILHVGS087004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 18 Oct 2016 21:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307577 - head/sys/dev/rtwn/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 21:17:32 -0000 Author: avos Date: Tue Oct 18 21:17:31 2016 New Revision: 307577 URL: https://svnweb.freebsd.org/changeset/base/307577 Log: rtwn(4): fix build with 'options IEEE80211_SUPPORT_SUPERG' Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c head/sys/dev/rtwn/usb/rtwn_usb_tx.c Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Tue Oct 18 20:17:57 2016 (r307576) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Tue Oct 18 21:17:31 2016 (r307577) @@ -216,7 +216,7 @@ rtwn_report_intr(struct rtwn_usb_softc * * NB: this will executed only when 'report' bit is set. */ if (sc->sc_tx_n_active > 0 && --sc->sc_tx_n_active <= 1) - rtwn_cmd_sleepable(uc, NULL, 0, rtwn_ff_flush_all); + rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); #endif break; case RTWN_RX_OTHER: @@ -327,7 +327,7 @@ finish: */ #ifdef IEEE80211_SUPPORT_SUPERG if (!(sc->sc_flags & RTWN_FW_LOADED)) - rtwn_cmd_sleepable(uc, NULL, 0, rtwn_ff_flush_all); + rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); #endif /* Kick-start more transmit in case we stalled */ Modified: head/sys/dev/rtwn/usb/rtwn_usb_tx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_tx.c Tue Oct 18 20:17:57 2016 (r307576) +++ head/sys/dev/rtwn/usb/rtwn_usb_tx.c Tue Oct 18 21:17:31 2016 (r307577) @@ -207,7 +207,7 @@ finish: * XXX TODO: just make this a callout timer schedule so we can * flush the FF staging queue if we're approaching idle. */ - rtwn_cmd_sleepable(uc, NULL, 0, rtwn_ff_flush_all); + rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); } #endif /* Kick-start more transmit */ From owner-svn-src-head@freebsd.org Tue Oct 18 21:33:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8315CC17DA2; Tue, 18 Oct 2016 21:33:58 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 518749B4; Tue, 18 Oct 2016 21:33:58 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9ILXvbC094396; Tue, 18 Oct 2016 21:33:57 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ILXvJ8094393; Tue, 18 Oct 2016 21:33:57 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201610182133.u9ILXvJ8094393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 18 Oct 2016 21:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307578 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 21:33:58 -0000 Author: davidcs Date: Tue Oct 18 21:33:57 2016 New Revision: 307578 URL: https://svnweb.freebsd.org/changeset/base/307578 Log: 1. Use taskqueue_create() instead of taskqueue_create_fast() for both fastpath and slowpath taskqueues. 2. Service all transmits in taskqueue threads. 3. additional stats counters for keeping track of - bd availability - tx buf ring not emptied in the fp task queue. These are drained via timeout taskqueue. - tx attempts during link down. MFC after: 5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Oct 18 21:17:31 2016 (r307577) +++ head/sys/dev/bxe/bxe.c Tue Oct 18 21:33:57 2016 (r307578) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.81" +#define BXE_DRIVER_VERSION "1.78.89" #include "bxe.h" #include "ecore_sp.h" @@ -489,7 +489,14 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_tpa), 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, { STATS_OFFSET32(tx_queue_full_return), - 4, STATS_FLAGS_FUNC, "tx_queue_full_return"} + 4, STATS_FLAGS_FUNC, "tx_queue_full_return"}, + { STATS_OFFSET32(tx_request_link_down_failures), + 4, STATS_FLAGS_FUNC, "tx_request_link_down_failures"}, + { STATS_OFFSET32(bd_avail_too_less_failures), + 4, STATS_FLAGS_FUNC, "bd_avail_too_less_failures"}, + { STATS_OFFSET32(tx_mq_not_empty), + 4, STATS_FLAGS_FUNC, "tx_mq_not_empty"} + }; static const struct { @@ -602,7 +609,14 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_tpa), 4, "mbuf_alloc_tpa"}, { Q_STATS_OFFSET32(tx_queue_full_return), - 4, "tx_queue_full_return"} + 4, "tx_queue_full_return"}, + { Q_STATS_OFFSET32(tx_request_link_down_failures), + 4, "tx_request_link_down_failures"}, + { Q_STATS_OFFSET32(bd_avail_too_less_failures), + 4, "bd_avail_too_less_failures"}, + { Q_STATS_OFFSET32(tx_mq_not_empty), + 4, "tx_mq_not_empty"} + }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -5599,7 +5613,7 @@ bxe_tx_start(if_t ifp) BXE_FP_TX_UNLOCK(fp); } -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 static int bxe_tx_mq_start_locked(struct bxe_softc *sc, @@ -5621,11 +5635,16 @@ bxe_tx_mq_start_locked(struct bxe_softc return (EINVAL); } - if (!sc->link_vars.link_up || - (if_getdrvflags(ifp) & - (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - if (m != NULL) - rc = drbr_enqueue(ifp, tx_br, m); + if (m != NULL) { + rc = drbr_enqueue(ifp, tx_br, m); + if (rc != 0) { + fp->eth_q_stats.tx_soft_errors++; + goto bxe_tx_mq_start_locked_exit; + } + } + + if (!sc->link_vars.link_up || !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + fp->eth_q_stats.tx_request_link_down_failures++; goto bxe_tx_mq_start_locked_exit; } @@ -5635,24 +5654,22 @@ bxe_tx_mq_start_locked(struct bxe_softc fp->eth_q_stats.tx_max_drbr_queue_depth = depth; } - if (m == NULL) { - /* no new work, check for pending frames */ - next = drbr_dequeue_drv(ifp, tx_br); - } else if (drbr_needs_enqueue_drv(ifp, tx_br)) { - /* have both new and pending work, maintain packet order */ - rc = drbr_enqueue(ifp, tx_br, m); - if (rc != 0) { - fp->eth_q_stats.tx_soft_errors++; - goto bxe_tx_mq_start_locked_exit; - } - next = drbr_dequeue_drv(ifp, tx_br); - } else { - /* new work only and nothing pending */ - next = m; - } - /* keep adding entries while there are frames to send */ - while (next != NULL) { + while ((next = drbr_peek(ifp, tx_br)) != NULL) { + /* handle any completions if we're running low */ + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { + /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */ + bxe_txeof(sc, fp); + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail < (BXE_TSO_MAX_SEGMENTS + 1)) { + fp->eth_q_stats.bd_avail_too_less_failures++; + m_freem(next); + drbr_advance(ifp, tx_br); + rc = ENOBUFS; + break; + } + } /* the mbuf now belongs to us */ fp->eth_q_stats.mbuf_alloc_tx++; @@ -5668,11 +5685,11 @@ bxe_tx_mq_start_locked(struct bxe_softc if (next != NULL) { /* mark the TX queue as full and save the frame */ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); - /* XXX this may reorder the frame */ - rc = drbr_enqueue(ifp, tx_br, next); + drbr_putback(ifp, tx_br, next); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_frames_deferred++; - } + } else + drbr_advance(ifp, tx_br); /* stop looking for more work */ break; @@ -5684,18 +5701,7 @@ bxe_tx_mq_start_locked(struct bxe_softc /* send a copy of the frame to any BPF listeners */ if_etherbpfmtap(ifp, next); - tx_bd_avail = bxe_tx_avail(sc, fp); - - /* handle any completions if we're running low */ - if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { - /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */ - bxe_txeof(sc, fp); - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { - break; - } - } - - next = drbr_dequeue_drv(ifp, tx_br); + drbr_advance(ifp, tx_br); } /* all TX packets were dequeued and/or the tx ring is full */ @@ -5705,10 +5711,28 @@ bxe_tx_mq_start_locked(struct bxe_softc } bxe_tx_mq_start_locked_exit: + /* If we didn't drain the drbr, enqueue a task in the future to do it. */ + if (!drbr_empty(ifp, tx_br)) { + fp->eth_q_stats.tx_mq_not_empty++; + taskqueue_enqueue_timeout(fp->tq, &fp->tx_timeout_task, 1); + } return (rc); } +static void +bxe_tx_mq_start_deferred(void *arg, + int pending) +{ + struct bxe_fastpath *fp = (struct bxe_fastpath *)arg; + struct bxe_softc *sc = fp->sc; + if_t ifp = sc->ifp; + + BXE_FP_TX_LOCK(fp); + bxe_tx_mq_start_locked(sc, ifp, fp, NULL); + BXE_FP_TX_UNLOCK(fp); +} + /* Multiqueue (TSS) dispatch routine. */ static int bxe_tx_mq_start(struct ifnet *ifp, @@ -5730,8 +5754,10 @@ bxe_tx_mq_start(struct ifnet *ifp, if (BXE_FP_TX_TRYLOCK(fp)) { rc = bxe_tx_mq_start_locked(sc, ifp, fp, m); BXE_FP_TX_UNLOCK(fp); - } else + } else { rc = drbr_enqueue(ifp, fp->tx_br, m); + taskqueue_enqueue(fp->tq, &fp->tx_task); + } return (rc); } @@ -5766,7 +5792,7 @@ bxe_mq_flush(struct ifnet *ifp) if_qflush(ifp); } -#endif /* FreeBSD_version >= 800000 */ +#endif /* FreeBSD_version >= 901504 */ static uint16_t bxe_cid_ilt_lines(struct bxe_softc *sc) @@ -6126,7 +6152,7 @@ bxe_free_fp_buffers(struct bxe_softc *sc for (i = 0; i < sc->num_queues; i++) { fp = &sc->fp[i]; -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 if (fp->tx_br != NULL) { /* just in case bxe_mq_flush() wasn't called */ if (mtx_initialized(&fp->tx_mtx)) { @@ -6953,6 +6979,8 @@ bxe_link_attn(struct bxe_softc *sc) uint32_t pause_enabled = 0; struct host_port_stats *pstats; int cmng_fns; + struct bxe_fastpath *fp; + int i; /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); @@ -6984,6 +7012,12 @@ bxe_link_attn(struct bxe_softc *sc) if (sc->state == BXE_STATE_OPEN) { bxe_stats_handle(sc, STATS_EVENT_LINK_UP); } + + /* Restart tx when the link comes back. */ + FOR_EACH_ETH_QUEUE(sc, i) { + fp = &sc->fp[i]; + taskqueue_enqueue(fp->tq, &fp->tx_task); + } } if (sc->link_vars.link_up && sc->link_vars.line_speed) { @@ -9035,6 +9069,10 @@ bxe_interrupt_detach(struct bxe_softc *s fp = &sc->fp[i]; if (fp->tq) { taskqueue_drain(fp->tq, &fp->tq_task); + taskqueue_drain(fp->tq, &fp->tx_task); + while (taskqueue_cancel_timeout(fp->tq, &fp->tx_timeout_task, + NULL)) + taskqueue_drain_timeout(fp->tq, &fp->tx_timeout_task); taskqueue_free(fp->tq); fp->tq = NULL; } @@ -9067,9 +9105,9 @@ bxe_interrupt_attach(struct bxe_softc *s snprintf(sc->sp_tq_name, sizeof(sc->sp_tq_name), "bxe%d_sp_tq", sc->unit); TASK_INIT(&sc->sp_tq_task, 0, bxe_handle_sp_tq, sc); - sc->sp_tq = taskqueue_create_fast(sc->sp_tq_name, M_NOWAIT, - taskqueue_thread_enqueue, - &sc->sp_tq); + sc->sp_tq = taskqueue_create(sc->sp_tq_name, M_NOWAIT, + taskqueue_thread_enqueue, + &sc->sp_tq); taskqueue_start_threads(&sc->sp_tq, 1, PWAIT, /* lower priority */ "%s", sc->sp_tq_name); @@ -9079,9 +9117,12 @@ bxe_interrupt_attach(struct bxe_softc *s snprintf(fp->tq_name, sizeof(fp->tq_name), "bxe%d_fp%d_tq", sc->unit, i); TASK_INIT(&fp->tq_task, 0, bxe_handle_fp_tq, fp); - fp->tq = taskqueue_create_fast(fp->tq_name, M_NOWAIT, - taskqueue_thread_enqueue, - &fp->tq); + TASK_INIT(&fp->tx_task, 0, bxe_tx_mq_start_deferred, fp); + fp->tq = taskqueue_create(fp->tq_name, M_NOWAIT, + taskqueue_thread_enqueue, + &fp->tq); + TIMEOUT_TASK_INIT(fp->tq, &fp->tx_timeout_task, 0, + bxe_tx_mq_start_deferred, fp); taskqueue_start_threads(&fp->tq, 1, PI_NET, /* higher priority */ "%s", fp->tq_name); } @@ -12114,8 +12155,6 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; - struct bxe_fastpath *fp; - uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12136,49 +12175,8 @@ bxe_periodic_callout_func(void *xsc) BLOGW(sc, "periodic callout exit (state=0x%x)\n", sc->state); BXE_CORE_UNLOCK(sc); return; - } - -#if __FreeBSD_version >= 800000 - - FOR_EACH_QUEUE(sc, i) { - fp = &sc->fp[i]; - - if (BXE_FP_TX_TRYLOCK(fp)) { - if_t ifp = sc->ifp; - /* - * If interface was stopped due to unavailable - * bds, try to process some tx completions - */ - (void) bxe_txeof(sc, fp); - - tx_bd_avail = bxe_tx_avail(sc, fp); - if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { - bxe_tx_mq_start_locked(sc, ifp, fp, NULL); - } - BXE_FP_TX_UNLOCK(fp); - } - } - -#else - - fp = &sc->fp[0]; - if (BXE_FP_TX_TRYLOCK(fp)) { - struct ifnet *ifp = sc->ifnet; - /* - * If interface was stopped due to unavailable - * bds, try to process some tx completions - */ - (void) bxe_txeof(sc, fp); - - tx_bd_avail = bxe_tx_avail(sc, fp); - if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { - bxe_tx_start_locked(sc, ifp, fp); } - - BXE_FP_TX_UNLOCK(fp); - } -#endif /* #if __FreeBSD_version >= 800000 */ /* Check for TX timeouts on any fastpath. */ FOR_EACH_QUEUE(sc, i) { @@ -12656,7 +12654,7 @@ bxe_init_ifnet(struct bxe_softc *sc) if_setioctlfn(ifp, bxe_ioctl); if_setstartfn(ifp, bxe_tx_start); if_setgetcounterfn(ifp, bxe_get_counter); -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 if_settransmitfn(ifp, bxe_tx_mq_start); if_setqflushfn(ifp, bxe_mq_flush); #endif @@ -15699,7 +15697,7 @@ bxe_add_sysctls(struct bxe_softc *sc) static int bxe_alloc_buf_rings(struct bxe_softc *sc) { -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 int i; struct bxe_fastpath *fp; @@ -15720,7 +15718,7 @@ bxe_alloc_buf_rings(struct bxe_softc *sc static void bxe_free_buf_rings(struct bxe_softc *sc) { -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 int i; struct bxe_fastpath *fp; Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Tue Oct 18 21:17:31 2016 (r307577) +++ head/sys/dev/bxe/bxe.h Tue Oct 18 21:33:57 2016 (r307578) @@ -644,6 +644,9 @@ struct bxe_fastpath { struct taskqueue *tq; char tq_name[32]; + struct task tx_task; + struct timeout_task tx_timeout_task; + /* ethernet client ID (each fastpath set of RX/TX/CQE is a client) */ uint8_t cl_id; #define FP_CL_ID(fp) (fp->cl_id) @@ -2300,7 +2303,8 @@ void bxe_dump_mbuf_data(struct bxe_softc extern int bxe_grc_dump(struct bxe_softc *sc); #if __FreeBSD_version >= 800000 -#if __FreeBSD_version >= 1000000 +#if (__FreeBSD_version >= 1001513 && __FreeBSD_version < 1100000) ||\ + __FreeBSD_version >= 1100048 #define BXE_SET_FLOWID(m) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE) #define BXE_VALID_FLOWID(m) (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) #else Modified: head/sys/dev/bxe/bxe_stats.h ============================================================================== --- head/sys/dev/bxe/bxe_stats.h Tue Oct 18 21:17:31 2016 (r307577) +++ head/sys/dev/bxe/bxe_stats.h Tue Oct 18 21:33:57 2016 (r307578) @@ -266,6 +266,10 @@ struct bxe_eth_stats { /* num. of times tx queue full occurred */ uint32_t tx_queue_full_return; + /* debug stats */ + uint32_t tx_request_link_down_failures; + uint32_t bd_avail_too_less_failures; + uint32_t tx_mq_not_empty; }; @@ -372,6 +376,11 @@ struct bxe_eth_q_stats { /* num. of times tx queue full occurred */ uint32_t tx_queue_full_return; + + /* debug stats */ + uint32_t tx_request_link_down_failures; + uint32_t bd_avail_too_less_failures; + uint32_t tx_mq_not_empty; }; struct bxe_eth_stats_old { From owner-svn-src-head@freebsd.org Tue Oct 18 22:11:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87F61C1785D; Tue, 18 Oct 2016 22:11:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 437C5C16; Tue, 18 Oct 2016 22:11:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x230.google.com with SMTP id f128so10036834qkb.1; Tue, 18 Oct 2016 15:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TIvQ3qYsDAThKXLyZ6MGj4rHmAaq9jOd243fJ3ZJ5yo=; b=ScsmUHd32tLV5YAgqwDh2KsVDOqTFxJuWpURFKfooD74qNZZFoCEvPEQHCEdgI6rNI lfeNzBjQ/C1H3k+RGm3Lm1VvHntKbLXtVPKPNODAC4qGYQFtA0lh4TSUyUGGJGvx1u// cF25aqCq7OK/TX7psAh54n3fWs2XSU/7IPQiRLILtmnd/W8MY3HiltGONRDCylOFz5f6 WUZsy5OSerEUC5RHRK6lkTwO/AepeYg9z/DX4veCjua9yHtH8Bl7LLEKsRS+i1SJEzjv Drpn5/dzPH45oqd0Ux5isBpfkfQ++sGH6kjbOS5nDC3R6BBotHrQCF50dexh55EhsEYt iBbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TIvQ3qYsDAThKXLyZ6MGj4rHmAaq9jOd243fJ3ZJ5yo=; b=QEcd5i+2Fe772VvRU013lzwUG0AJpfVaD7WbBgmnpEJDoiRnUJkHFdUqJsWQ/H3v1+ ssLRVoVeh9hAYDmjd1RdSvPnIo7+KXeXELyl7zvuiwBkymfZuvOcXxbFBPqJFPVhQ6FB ZxM4JYkxLARjYbAO4OCRoXne8az7vIBmcdxx6runQC3itj+G+aV0BP6bTsvpsKwh3jLL IgYOAqE5SW2lj6FS3ZPkumYAPV/clczc1fGS3fNRUBlbty11UtdJ5Hts56oSXl4Qing7 DrxxUjZFp2t5HTVBfNR3TJYtn39C3yYfsuNWZWGz1SM3ck72f+Bl/D6nZAzX3WuQdUOV GiZg== X-Gm-Message-State: AA6/9RlgX6Xdgh8+CMZaOP64xdmVK8KXR5p9lmMjty5Yin0K+QA6XbutQxx9K/TCmhD+fhOIhKX19K0ZoOEMeg== X-Received: by 10.55.41.39 with SMTP id p39mr3212798qkh.98.1476828716204; Tue, 18 Oct 2016 15:11:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.29.33 with HTTP; Tue, 18 Oct 2016 15:11:55 -0700 (PDT) In-Reply-To: <201610181013.u9IADs1j025157@repo.freebsd.org> References: <201610181013.u9IADs1j025157@repo.freebsd.org> From: Ngie Cooper Date: Tue, 18 Oct 2016 15:11:55 -0700 Message-ID: Subject: Re: svn commit: r307553 - head/contrib/netbsd-tests/lib/libpthread To: Ruslan Bukin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 22:11:57 -0000 (Picking a "random commit") On Tue, Oct 18, 2016 at 3:13 AM, Ruslan Bukin wrote: > Author: br > Date: Tue Oct 18 10:13:54 2016 > New Revision: 307553 > URL: https://svnweb.freebsd.org/changeset/base/307553 > > Log: > Skip test on MIPS as it modifies TLS pointer in set_mcontext(). > > Discussed with: kib > Sponsored by: DARPA, AFRL > Sponsored by: HEIF5 > > Modified: > head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c > > Modified: head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c > ============================================================================== > --- head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 10:12:55 2016 (r307552) > +++ head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 10:13:54 2016 (r307553) > @@ -97,6 +97,15 @@ ATF_TC_BODY(swapcontext1, tc) > { > pthread_t thread; > > +#ifdef __mips__ > + /* > + * MIPS modifies TLS pointer in set_mcontext(), so > + * swapping contexts obtained from different threads > + * gives us different pthread_self() return value. > + */ > + atf_tc_skip("Platform is not supported."); > +#endif > + > oself = (void *)&val1; > nself = (void *)&val2; Please add appropriate conditionals to the code, i.e. - "#ifdef __FreeBSD__" / "#endif" around all blocks that are FreeBSD-specific, or need to be upstreamed to NetBSD. - "#ifdef __NetBSD__" / "#endif" around all blocks that are NetBSD-specific (i.e. test specific NetBSD requirements), do not need to be upstreamed. This helps mere mortals (like me) keep track of what's our's, what's their's, and what should be their's, so I can push back everything that should be in NetBSD to NetBSD. If it's not resolved by tonight, I'll work through the queue of items that need to be cleaned up. Thank you, -Ngie From owner-svn-src-head@freebsd.org Tue Oct 18 22:40:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FC10C17F05; Tue, 18 Oct 2016 22:40:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id D3706D50; Tue, 18 Oct 2016 22:40:15 +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 u9IMeEWv017959; Tue, 18 Oct 2016 22:40:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IMeEL1017958; Tue, 18 Oct 2016 22:40:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610182240.u9IMeEL1017958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Oct 2016 22:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307582 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 22:40:16 -0000 Author: imp Date: Tue Oct 18 22:40:14 2016 New Revision: 307582 URL: https://svnweb.freebsd.org/changeset/base/307582 Log: Announce where we've put the image too Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Tue Oct 18 22:40:12 2016 (r307581) +++ head/tools/tools/nanobsd/embedded/common Tue Oct 18 22:40:14 2016 (r307582) @@ -201,8 +201,13 @@ create_diskimage_gpt ( ) ( create_diskimage_mbr ( ) ( + local fmt + + [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" + pprint 2 "build diskimage ${NANO_NAME}" pprint 3 "log: ${NANO_LOG}/_.di" + pprint 3 "image in: ${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME}${fmt}" ( local extra i sz fmt fmtarg bootmbr bootbsd skiparg From owner-svn-src-head@freebsd.org Tue Oct 18 22:40:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 372B5C17EF7; Tue, 18 Oct 2016 22:40: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 mx1.freebsd.org (Postfix) with ESMTPS id 06C92D33; Tue, 18 Oct 2016 22:40:13 +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 u9IMeDgn017914; Tue, 18 Oct 2016 22:40:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IMeDh7017913; Tue, 18 Oct 2016 22:40:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610182240.u9IMeDh7017913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Oct 2016 22:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307581 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 22:40:14 -0000 Author: imp Date: Tue Oct 18 22:40:12 2016 New Revision: 307581 URL: https://svnweb.freebsd.org/changeset/base/307581 Log: Fix NANO_NAME Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/beaglebone.cfg Tue Oct 18 22:26:38 2016 (r307580) +++ head/tools/tools/nanobsd/embedded/beaglebone.cfg Tue Oct 18 22:40:12 2016 (r307581) @@ -29,7 +29,7 @@ NANO_ARCH=armv6 NANO_KERNEL=BEAGLEBONE NANO_DRIVE=mmcsd0 -NANO_NAME=rpi2 +NANO_NAME=beaglebone NANO_BOOT_PKG=u-boot-beaglebone NANO_CPUTYPE=cortex-a8 From owner-svn-src-head@freebsd.org Tue Oct 18 22:53:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C009C1749A; Tue, 18 Oct 2016 22:53:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 32CF6973; Tue, 18 Oct 2016 22:53:59 +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 u9IMrwCo025395; Tue, 18 Oct 2016 22:53:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9IMrwWU025394; Tue, 18 Oct 2016 22:53:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610182253.u9IMrwWU025394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 18 Oct 2016 22:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307583 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 22:53:59 -0000 Author: br Date: Tue Oct 18 22:53:58 2016 New Revision: 307583 URL: https://svnweb.freebsd.org/changeset/base/307583 Log: Skip test on FreeBSD only. So test can be upstreamed to NetBSD. Requested by: ngie Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 22:40:14 2016 (r307582) +++ head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 22:53:58 2016 (r307583) @@ -97,7 +97,7 @@ ATF_TC_BODY(swapcontext1, tc) { pthread_t thread; -#ifdef __mips__ +#if defined(__FreeBSD__) && defined(__mips__) /* * MIPS modifies TLS pointer in set_mcontext(), so * swapping contexts obtained from different threads From owner-svn-src-head@freebsd.org Tue Oct 18 22:57:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B24FC1751F; Tue, 18 Oct 2016 22:57:49 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (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 16234B12; Tue, 18 Oct 2016 22:57:48 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sc1.bsdpad.com ([163.172.212.18]:35242) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1bwdKL-000eNB-fE (Exim 4.86_36-e07b163) (return-path ); Tue, 18 Oct 2016 23:57:45 +0100 Date: Tue, 18 Oct 2016 22:57:24 +0000 From: Ruslan Bukin To: Ngie Cooper Cc: Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307553 - head/contrib/netbsd-tests/lib/libpthread Message-ID: <20161018225724.GA63157@bsdpad.com> References: <201610181013.u9IADs1j025157@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 22:57:49 -0000 On Tue, Oct 18, 2016 at 03:11:55PM -0700, Ngie Cooper wrote: > (Picking a "random commit") > > On Tue, Oct 18, 2016 at 3:13 AM, Ruslan Bukin wrote: > > Author: br > > Date: Tue Oct 18 10:13:54 2016 > > New Revision: 307553 > > URL: https://svnweb.freebsd.org/changeset/base/307553 > > > > Log: > > Skip test on MIPS as it modifies TLS pointer in set_mcontext(). > > > > Discussed with: kib > > Sponsored by: DARPA, AFRL > > Sponsored by: HEIF5 > > > > Modified: > > head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c > > > > Modified: head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c > > ============================================================================== > > --- head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 10:12:55 2016 (r307552) > > +++ head/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c Tue Oct 18 10:13:54 2016 (r307553) > > @@ -97,6 +97,15 @@ ATF_TC_BODY(swapcontext1, tc) > > { > > pthread_t thread; > > > > +#ifdef __mips__ > > + /* > > + * MIPS modifies TLS pointer in set_mcontext(), so > > + * swapping contexts obtained from different threads > > + * gives us different pthread_self() return value. > > + */ > > + atf_tc_skip("Platform is not supported."); > > +#endif > > + > > oself = (void *)&val1; > > nself = (void *)&val2; > > Please add appropriate conditionals to the code, i.e. > - "#ifdef __FreeBSD__" / "#endif" around all blocks that are > FreeBSD-specific, or need to be upstreamed to NetBSD. > - "#ifdef __NetBSD__" / "#endif" around all blocks that are > NetBSD-specific (i.e. test specific NetBSD requirements), do not need > to be upstreamed. > This helps mere mortals (like me) keep track of what's our's, > what's their's, and what should be their's, so I can push back > everything that should be in NetBSD to NetBSD. > If it's not resolved by tonight, I'll work through the queue of > items that need to be cleaned up. Thanks. Is this rule for ./contrib/netbsd-tests only, or ./tests/ as well ? Ruslan From owner-svn-src-head@freebsd.org Tue Oct 18 23:01:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F52C1778C; Tue, 18 Oct 2016 23:01:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EDB7EA9; Tue, 18 Oct 2016 23:01:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22c.google.com with SMTP id f128so11207482qkb.1; Tue, 18 Oct 2016 16:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QEoX847PuRMHMWp+VaaXnRvKV72ypOzKD0AQsmyqyP0=; b=nIg7B8N9IzIROluwu6pxJqYIJlF18zCoge8LCirlA+upf6/WEWW9nDB8++kt/45+h8 qvzUsRL9faGzYc02VPCsa6N186BZWq9nGw5QcagZ4Zwnz3EZYIsAE4lKbhhppYbAzcWb Y4XAOgnexkbb1K+0vZEJ+U0sENdvcGZKCIcSCFmbIiBlTHpVVO1YDjM8JEyMMJj09DQZ hV5UwQSIlrMK0T1VOd1uzR3qctTRkjDC8dpyzVJjgl6zL/bcMU/uvA/SvbeDp4FU+1vE ITzwx5VHVGPJXBrHQNX2JQheYTFg/LpuGH9oDgmRjifIh3iGOKJG64+oFM3DuNHAv8Ub Ztdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QEoX847PuRMHMWp+VaaXnRvKV72ypOzKD0AQsmyqyP0=; b=cM3yt8SkeYwZZDkM0dQqZe9iHIAzuiqveHneQd+lj/GYbVEghMSMjr/mqS4lgWm1nO tyqiIO0U/61C70kGgM6O72YV2vqzOdkAAg7qTOWvq4MZnN5YFxSx91E0pQdMNYlWDtob KVfTji4lE/2o0zHnL04G5yHUeWp9doUIlVqaH+ND6PqH1szYBg3aPWSxQUld76/+foLM wXE60KaUoa7v21vEz9M1n3BDZuikcMgyTd/p8vLTEfakTImHKc6tOgLpNap1mmplkokl 4/nvGwq68OFoVnCrt/w+xOxiwZvIWoW/9URLgFXsfecf3DWFotTQuplZmXrY0/lFfmYP kWNA== X-Gm-Message-State: AA6/9RmSSuv+Rwq/LpNbxG0m7YOydr4FkIAgi7ArUJ191dOK5nuEQljGvcoT2yhG7plkim3W0si+cp4brsHzyQ== X-Received: by 10.55.215.93 with SMTP id m90mr3153403qki.40.1476831707726; Tue, 18 Oct 2016 16:01:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.29.33 with HTTP; Tue, 18 Oct 2016 16:01:47 -0700 (PDT) In-Reply-To: <20161018225724.GA63157@bsdpad.com> References: <201610181013.u9IADs1j025157@repo.freebsd.org> <20161018225724.GA63157@bsdpad.com> From: Ngie Cooper Date: Tue, 18 Oct 2016 16:01:47 -0700 Message-ID: Subject: Re: svn commit: r307553 - head/contrib/netbsd-tests/lib/libpthread To: Ruslan Bukin Cc: Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 23:01:49 -0000 On Tue, Oct 18, 2016 at 3:57 PM, Ruslan Bukin wrote: ... > Thanks. Is this rule for ./contrib/netbsd-tests only, or ./tests/ as well ? Just contrib/netbsd-tests as their upstream is NetBSD (hence the name, netbsd-tests). Thanks! -Ngie From owner-svn-src-head@freebsd.org Tue Oct 18 23:20:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F99C17C13; Tue, 18 Oct 2016 23:20:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5D4D116BB; Tue, 18 Oct 2016 23:20:51 +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 u9INKobt036292; Tue, 18 Oct 2016 23:20:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9INKnT6034560; Tue, 18 Oct 2016 23:20:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201610182320.u9INKnT6034560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 18 Oct 2016 23:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307584 - in head: lib/libmd sys/crypto sys/crypto/aesni sys/crypto/sha2 sys/crypto/siphash sys/crypto/skein sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 23:20:51 -0000 Author: asomers Date: Tue Oct 18 23:20:49 2016 New Revision: 307584 URL: https://svnweb.freebsd.org/changeset/base/307584 Log: Fix C++ includability of crypto headers with static array sizes C99 allows array function parameters to use the static keyword for their sizes. This tells the compiler that the parameter will have at least the specified size, and calling code will fail to compile if that guarantee is not met. However, this syntax is not legal in C++. This commit reverts r300824, which worked around the problem for sys/sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can be used in headers as a static array size, but will still compile in C++ mode. Reviewed by: cem, ed MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8277 Modified: head/lib/libmd/md5.h head/sys/crypto/aesni/aesni.h head/sys/crypto/sha1.h head/sys/crypto/sha2/sha256.h head/sys/crypto/sha2/sha384.h head/sys/crypto/sha2/sha512.h head/sys/crypto/sha2/sha512t.h head/sys/crypto/siphash/siphash.h head/sys/crypto/skein/skein_freebsd.h head/sys/sys/cdefs.h head/sys/sys/md4.h head/sys/sys/md5.h Modified: head/lib/libmd/md5.h ============================================================================== --- head/lib/libmd/md5.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/lib/libmd/md5.h Tue Oct 18 23:20:49 2016 (r307584) @@ -43,13 +43,5 @@ #endif -#ifdef __cplusplus -#define static -#endif - #include - -#ifdef __cplusplus -#undef static -#endif #endif /* _MD5_H_ */ Modified: head/sys/crypto/aesni/aesni.h ============================================================================== --- head/sys/crypto/aesni/aesni.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/aesni/aesni.h Tue Oct 18 23:20:49 2016 (r307584) @@ -79,23 +79,25 @@ void aesni_set_deckey(const uint8_t *enc */ void aesni_encrypt_cbc(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to, - const uint8_t iv[static AES_BLOCK_LEN]); + const uint8_t iv[__min_size(AES_BLOCK_LEN)]); void aesni_decrypt_cbc(int rounds, const void *key_schedule /*__aligned(16)*/, - size_t len, uint8_t *buf, const uint8_t iv[static AES_BLOCK_LEN]); + size_t len, uint8_t *buf, const uint8_t iv[__min_size(AES_BLOCK_LEN)]); void aesni_encrypt_ecb(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to); void aesni_decrypt_ecb(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to); void aesni_encrypt_icm(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to, - const uint8_t iv[static AES_BLOCK_LEN]); + const uint8_t iv[__min_size(AES_BLOCK_LEN)]); void aesni_encrypt_xts(int rounds, const void *data_schedule /*__aligned(16)*/, const void *tweak_schedule /*__aligned(16)*/, size_t len, - const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]); + const uint8_t *from, uint8_t *to, + const uint8_t iv[__min_size(AES_BLOCK_LEN)]); void aesni_decrypt_xts(int rounds, const void *data_schedule /*__aligned(16)*/, const void *tweak_schedule /*__aligned(16)*/, size_t len, - const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]); + const uint8_t *from, uint8_t *to, + const uint8_t iv[__min_size(AES_BLOCK_LEN)]); /* GCM & GHASH functions */ void AES_GCM_encrypt(const unsigned char *in, unsigned char *out, Modified: head/sys/crypto/sha1.h ============================================================================== --- head/sys/crypto/sha1.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/sha1.h Tue Oct 18 23:20:49 2016 (r307584) @@ -61,7 +61,7 @@ typedef struct sha1_ctxt SHA1_CTX; extern void sha1_init(struct sha1_ctxt *); extern void sha1_pad(struct sha1_ctxt *); extern void sha1_loop(struct sha1_ctxt *, const u_int8_t *, size_t); -extern void sha1_result(struct sha1_ctxt *, char[static SHA1_RESULTLEN]); +extern void sha1_result(struct sha1_ctxt *, char[__min_size(SHA1_RESULTLEN)]); /* compatibilty with other SHA1 source codes */ #define SHA1Init(x) sha1_init((x)) Modified: head/sys/crypto/sha2/sha256.h ============================================================================== --- head/sys/crypto/sha2/sha256.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/sha2/sha256.h Tue Oct 18 23:20:49 2016 (r307584) @@ -84,7 +84,8 @@ __BEGIN_DECLS void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); -void SHA256_Final(unsigned char [static SHA256_DIGEST_LENGTH], SHA256_CTX *); +void SHA256_Final(unsigned char [__min_size(SHA256_DIGEST_LENGTH)], + SHA256_CTX *); #ifndef _KERNEL char *SHA256_End(SHA256_CTX *, char *); char *SHA256_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/sha2/sha384.h ============================================================================== --- head/sys/crypto/sha2/sha384.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/sha2/sha384.h Tue Oct 18 23:20:49 2016 (r307584) @@ -80,7 +80,8 @@ __BEGIN_DECLS void SHA384_Init(SHA384_CTX *); void SHA384_Update(SHA384_CTX *, const void *, size_t); -void SHA384_Final(unsigned char [static SHA384_DIGEST_LENGTH], SHA384_CTX *); +void SHA384_Final(unsigned char [__min_size(SHA384_DIGEST_LENGTH)], + SHA384_CTX *); #ifndef _KERNEL char *SHA384_End(SHA384_CTX *, char *); char *SHA384_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/sha2/sha512.h ============================================================================== --- head/sys/crypto/sha2/sha512.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/sha2/sha512.h Tue Oct 18 23:20:49 2016 (r307584) @@ -83,7 +83,8 @@ __BEGIN_DECLS void SHA512_Init(SHA512_CTX *); void SHA512_Update(SHA512_CTX *, const void *, size_t); -void SHA512_Final(unsigned char [static SHA512_DIGEST_LENGTH], SHA512_CTX *); +void SHA512_Final(unsigned char [__min_size(SHA512_DIGEST_LENGTH)], + SHA512_CTX *); #ifndef _KERNEL char *SHA512_End(SHA512_CTX *, char *); char *SHA512_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/sha2/sha512t.h ============================================================================== --- head/sys/crypto/sha2/sha512t.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/sha2/sha512t.h Tue Oct 18 23:20:49 2016 (r307584) @@ -115,7 +115,8 @@ __BEGIN_DECLS void SHA512_224_Init(SHA512_CTX *); void SHA512_224_Update(SHA512_CTX *, const void *, size_t); -void SHA512_224_Final(unsigned char [static SHA512_224_DIGEST_LENGTH], SHA512_CTX *); +void SHA512_224_Final(unsigned char [__min_size(SHA512_224_DIGEST_LENGTH)], + SHA512_CTX *); #ifndef _KERNEL char *SHA512_224_End(SHA512_CTX *, char *); char *SHA512_224_Data(const void *, unsigned int, char *); @@ -126,7 +127,8 @@ char *SHA512_224_FileChunk(const char #endif void SHA512_256_Init(SHA512_CTX *); void SHA512_256_Update(SHA512_CTX *, const void *, size_t); -void SHA512_256_Final(unsigned char [static SHA512_256_DIGEST_LENGTH], SHA512_CTX *); +void SHA512_256_Final(unsigned char [__min_size(SHA512_256_DIGEST_LENGTH)], + SHA512_CTX *); #ifndef _KERNEL char *SHA512_256_End(SHA512_CTX *, char *); char *SHA512_256_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/siphash/siphash.h ============================================================================== --- head/sys/crypto/siphash/siphash.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/siphash/siphash.h Tue Oct 18 23:20:49 2016 (r307584) @@ -68,15 +68,16 @@ typedef struct _SIPHASH_CTX { #define SipHash24_Init(x) SipHash_InitX((x), 2, 4) #define SipHash48_Init(x) SipHash_InitX((x), 4, 8) void SipHash_InitX(SIPHASH_CTX *, int, int); -void SipHash_SetKey(SIPHASH_CTX *, const uint8_t[static SIPHASH_KEY_LENGTH]); +void SipHash_SetKey(SIPHASH_CTX *, + const uint8_t[__min_size(SIPHASH_KEY_LENGTH)]); void SipHash_Update(SIPHASH_CTX *, const void *, size_t); -void SipHash_Final(uint8_t[static SIPHASH_DIGEST_LENGTH], SIPHASH_CTX *); +void SipHash_Final(uint8_t[__min_size(SIPHASH_DIGEST_LENGTH)], SIPHASH_CTX *); uint64_t SipHash_End(SIPHASH_CTX *); #define SipHash24(x, y, z, i) SipHashX((x), 2, 4, (y), (z), (i)); #define SipHash48(x, y, z, i) SipHashX((x), 4, 8, (y), (z), (i)); -uint64_t SipHashX(SIPHASH_CTX *, int, int, const uint8_t[static SIPHASH_KEY_LENGTH], const void *, - size_t); +uint64_t SipHashX(SIPHASH_CTX *, int, int, + const uint8_t[__min_size(SIPHASH_KEY_LENGTH)], const void *, size_t); int SipHash24_TestVectors(void); Modified: head/sys/crypto/skein/skein_freebsd.h ============================================================================== --- head/sys/crypto/skein/skein_freebsd.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/crypto/skein/skein_freebsd.h Tue Oct 18 23:20:49 2016 (r307584) @@ -57,9 +57,12 @@ void SKEIN256_Update(SKEIN256_CTX *ctx, void SKEIN512_Update(SKEIN512_CTX *ctx, const void *in, size_t len); void SKEIN1024_Update(SKEIN1024_CTX *ctx, const void *in, size_t len); -void SKEIN256_Final(unsigned char digest[static SKEIN256_DIGEST_LENGTH], SKEIN256_CTX *ctx); -void SKEIN512_Final(unsigned char digest[static SKEIN512_DIGEST_LENGTH], SKEIN512_CTX *ctx); -void SKEIN1024_Final(unsigned char digest[static SKEIN1024_DIGEST_LENGTH], SKEIN1024_CTX *ctx); +void SKEIN256_Final(unsigned char digest[__min_size(SKEIN256_DIGEST_LENGTH)], + SKEIN256_CTX *ctx); +void SKEIN512_Final(unsigned char digest[__min_size(SKEIN512_DIGEST_LENGTH)], + SKEIN512_CTX *ctx); +void SKEIN1024_Final(unsigned char digest[__min_size(SKEIN1024_DIGEST_LENGTH)], + SKEIN1024_CTX *ctx); #ifndef _KERNEL char *SKEIN256_End(SKEIN256_CTX *, char *); Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/sys/cdefs.h Tue Oct 18 23:20:49 2016 (r307584) @@ -341,6 +341,20 @@ __builtin_types_compatible_p(__typeof(expr), t), yes, no) #endif +/* + * C99 Static array indices in function parameter declarations. Syntax such as: + * void bar(int myArray[static 10]); + * is allowed in C99 but not in C++. Define __min_size appropriately so + * headers using it can be compiled in either language. Use like this: + * void bar(int myArray[__min_size(10)]); + */ +#if !defined(__cplusplus) && \ + (!defined(__STDC_VERSION) || (__STDC_VERSION__ >= 199901)) +#define __min_size(x) static (x) +#else +#define __min_size(x) (x) +#endif + #if __GNUC_PREREQ__(2, 96) #define __malloc_like __attribute__((__malloc__)) #define __pure __attribute__((__pure__)) Modified: head/sys/sys/md4.h ============================================================================== --- head/sys/sys/md4.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/sys/md4.h Tue Oct 18 23:20:49 2016 (r307584) @@ -39,7 +39,7 @@ __BEGIN_DECLS void MD4Init(MD4_CTX *); void MD4Update(MD4_CTX *, const unsigned char *, unsigned int); void MD4Pad(MD4_CTX *); -void MD4Final(unsigned char [static 16], MD4_CTX *); +void MD4Final(unsigned char [__min_size(16)], MD4_CTX *); #ifndef _KERNEL char * MD4End(MD4_CTX *, char *); char * MD4File(const char *, char *); Modified: head/sys/sys/md5.h ============================================================================== --- head/sys/sys/md5.h Tue Oct 18 22:53:58 2016 (r307583) +++ head/sys/sys/md5.h Tue Oct 18 23:20:49 2016 (r307584) @@ -44,7 +44,7 @@ typedef struct MD5Context { __BEGIN_DECLS void MD5Init (MD5_CTX *); void MD5Update (MD5_CTX *, const void *, unsigned int); -void MD5Final (unsigned char[static MD5_DIGEST_LENGTH], MD5_CTX *); +void MD5Final (unsigned char[__min_size(MD5_DIGEST_LENGTH)], MD5_CTX *); #ifndef _KERNEL char * MD5End(MD5_CTX *, char *); char * MD5Fd(int, char *); From owner-svn-src-head@freebsd.org Tue Oct 18 23:48:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68E24C12301; Tue, 18 Oct 2016 23:48:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 4248B238; Tue, 18 Oct 2016 23:48:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9INmlAG044832; Tue, 18 Oct 2016 23:48:47 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9INml34044830; Tue, 18 Oct 2016 23:48:47 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610182348.u9INml34044830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 18 Oct 2016 23:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307586 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 23:48:48 -0000 Author: gonzo Date: Tue Oct 18 23:48:47 2016 New Revision: 307586 URL: https://svnweb.freebsd.org/changeset/base/307586 Log: Retire RPI3 kernel config in favour of GENERIC-UP Policy for FreeBSD/arm64 kernel config is the same one as for x86 architectures: provide GENERIC kernel bootable on as many systems as possible. Since there is no SMP support for RPi 3 yet new kernel config was introduced: GENERIC-UP, which is effectively GENERIC with SMP option disabled Added: head/sys/arm64/conf/GENERIC-UP (contents, props changed) Deleted: head/sys/arm64/conf/RPI3 Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Oct 18 23:27:50 2016 (r307585) +++ head/sys/arm64/conf/GENERIC Tue Oct 18 23:48:47 2016 (r307586) @@ -90,6 +90,7 @@ options MALLOC_DEBUG_MAXZONES=8 # Separ options SOC_ALLWINNER_A64 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 +options SOC_BRCM_BCM2837 # Annapurna Alpine drivers device al_ccu # Alpine Cache Coherency Unit @@ -129,6 +130,7 @@ device da device pass # Passthrough device (direct ATA/SCSI access) # MMC/SD/SDIO Card slot support +device sdhci device aw_mmc # Allwinner SD/MMC controller device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards @@ -152,13 +154,19 @@ device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da +# USB ethernet support +device smcphy +device smsc + # GPIO device aw_gpio # Allwinner GPIO controller device gpio +device gpioled device fdt_pinctrl # I2C device aw_rsb # Allwinner Reduced Serial Bus +device bcm2835_bsc # Broadcom BCM283x I2C bus device iicbus # Clock and reset controllers @@ -182,6 +190,14 @@ device aw_sid # Allwinner Secure ID EF # Thermal sensors device aw_thermal # Allwinner Thermal Sensor Controller +# SPI +device spibus +device bcm2835_spi # Broadcom BCM283x SPI bus + +# Console +device vt +device kbdmux + # Pseudo devices. device loop # Network loopback device random # Entropy device Added: head/sys/arm64/conf/GENERIC-UP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/conf/GENERIC-UP Tue Oct 18 23:48:47 2016 (r307586) @@ -0,0 +1,23 @@ +# +# GENERIC -- Generic kernel configuration file for FreeBSD/arm64 with SMP disabled +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC +ident GENERIC-UP +nooptions SMP From owner-svn-src-head@freebsd.org Wed Oct 19 02:02:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563B8C17655; Wed, 19 Oct 2016 02:02:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2578E288; Wed, 19 Oct 2016 02:02:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9J22Lbq096195; Wed, 19 Oct 2016 02:02:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J22LpG096194; Wed, 19 Oct 2016 02:02:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610190202.u9J22LpG096194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 19 Oct 2016 02:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307592 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 02:02:22 -0000 Author: gonzo Date: Wed Oct 19 02:02:21 2016 New Revision: 307592 URL: https://svnweb.freebsd.org/changeset/base/307592 Log: bcm2835_bsc.c should be compiled only if SOC_BRCM_BCM2837 is enabled Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Oct 19 01:55:50 2016 (r307591) +++ head/sys/conf/files.arm64 Wed Oct 19 02:02:21 2016 (r307592) @@ -47,7 +47,7 @@ arm/arm/gic_fdt.c optional fdt arm/arm/pmu.c standard arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc +arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc soc_brcm_bcm2837 arm/broadcom/bcm2835/bcm2835_common.c optional fdt soc_brcm_bcm2837 arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 From owner-svn-src-head@freebsd.org Wed Oct 19 02:03:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C41A9C176D7; Wed, 19 Oct 2016 02:03:31 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 95F7666A; Wed, 19 Oct 2016 02:03:31 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9J23ULA096872; Wed, 19 Oct 2016 02:03:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J23UAp096871; Wed, 19 Oct 2016 02:03:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610190203.u9J23UAp096871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 19 Oct 2016 02:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307593 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 02:03:31 -0000 Author: gonzo Date: Wed Oct 19 02:03:30 2016 New Revision: 307593 URL: https://svnweb.freebsd.org/changeset/base/307593 Log: Move SOC_BRCM_BCM2837 to GENERIC-UP since does not support SMP Modified: head/sys/arm64/conf/GENERIC head/sys/arm64/conf/GENERIC-UP Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Oct 19 02:02:21 2016 (r307592) +++ head/sys/arm64/conf/GENERIC Wed Oct 19 02:03:30 2016 (r307593) @@ -90,7 +90,6 @@ options MALLOC_DEBUG_MAXZONES=8 # Separ options SOC_ALLWINNER_A64 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 -options SOC_BRCM_BCM2837 # Annapurna Alpine drivers device al_ccu # Alpine Cache Coherency Unit Modified: head/sys/arm64/conf/GENERIC-UP ============================================================================== --- head/sys/arm64/conf/GENERIC-UP Wed Oct 19 02:02:21 2016 (r307592) +++ head/sys/arm64/conf/GENERIC-UP Wed Oct 19 02:03:30 2016 (r307593) @@ -21,3 +21,5 @@ include GENERIC ident GENERIC-UP nooptions SMP + +options SOC_BRCM_BCM2837 From owner-svn-src-head@freebsd.org Wed Oct 19 02:23:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBF7DC17F39; Wed, 19 Oct 2016 02:23:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9853B6D6; Wed, 19 Oct 2016 02:23:30 +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 u9J2NT4n005011; Wed, 19 Oct 2016 02:23:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J2NTiS005010; Wed, 19 Oct 2016 02:23:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610190223.u9J2NTiS005010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 19 Oct 2016 02:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307598 - head/sys/powerpc/fpu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 02:23:30 -0000 Author: jhibbits Date: Wed Oct 19 02:23:29 2016 New Revision: 307598 URL: https://svnweb.freebsd.org/changeset/base/307598 Log: Un-static two local variables in the FPU emulator Static variables aren't MP-safe, and this was causing bizarre segfaults on a dual-core e500v2 system (P1022). Still left is one static variable, which should be moved into the pcb instead, but as illegal instructions haven't been hit yet, it's lower priority. MFC after: 1 week Modified: head/sys/powerpc/fpu/fpu_emu.c Modified: head/sys/powerpc/fpu/fpu_emu.c ============================================================================== --- head/sys/powerpc/fpu/fpu_emu.c Wed Oct 19 02:20:48 2016 (r307597) +++ head/sys/powerpc/fpu/fpu_emu.c Wed Oct 19 02:23:29 2016 (r307598) @@ -185,8 +185,8 @@ fpu_dumpfpn(struct fpn *fp) int fpu_emulate(struct trapframe *frame, struct fpu *fpf) { - static union instr insn; - static struct fpemu fe; + union instr insn; + struct fpemu fe; static int lastill = 0; int sig; From owner-svn-src-head@freebsd.org Wed Oct 19 02:24:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB94C17FFC; Wed, 19 Oct 2016 02:24:58 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8C1CFA0A; Wed, 19 Oct 2016 02:24:58 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9J2Ovf4005155; Wed, 19 Oct 2016 02:24:57 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J2OvSD005154; Wed, 19 Oct 2016 02:24:57 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201610190224.u9J2OvSD005154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 19 Oct 2016 02:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307600 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 02:24:58 -0000 Author: kevlo Date: Wed Oct 19 02:24:57 2016 New Revision: 307600 URL: https://svnweb.freebsd.org/changeset/base/307600 Log: Fix typo in comment. Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Oct 19 02:24:17 2016 (r307599) +++ head/sys/net/if_var.h Wed Oct 19 02:24:57 2016 (r307600) @@ -496,7 +496,7 @@ extern struct sx ifnet_sxlock; /* * Look up an ifnet given its index; the _ref variant also acquires a * reference that must be freed using if_rele(). It is almost always a bug - * to call ifnet_byindex() instead if ifnet_byindex_ref(). + * to call ifnet_byindex() instead of ifnet_byindex_ref(). */ struct ifnet *ifnet_byindex(u_short idx); struct ifnet *ifnet_byindex_locked(u_short idx); From owner-svn-src-head@freebsd.org Wed Oct 19 05:03:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 823A0C170CC; Wed, 19 Oct 2016 05:03:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4EF821350; Wed, 19 Oct 2016 05:03:47 +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 u9J53kdB066162; Wed, 19 Oct 2016 05:03:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J53kIV066160; Wed, 19 Oct 2016 05:03:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201610190503.u9J53kIV066160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 19 Oct 2016 05:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307602 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 05:03:47 -0000 Author: adrian Date: Wed Oct 19 05:03:46 2016 New Revision: 307602 URL: https://svnweb.freebsd.org/changeset/base/307602 Log: [net80211] Initial full-offload scan support. This is a very simple addition to the net80211 scan support. It doesn't implement a replacement scan interface - it just disables the pieces that we should disable to make this lifecycle a bit more managable. There's more work to come before full scan offload support is available but it should be good enough for driver work. * add a flag to say "full offload" * don't do probe requests when scanning full-offload - firmware can do that * don't do powersave transitions and buffering - firmware can do that tested: * iwm(4) - STA mode * ath10k port (local, not in freebsd-head yet) Reviewed by: avos Differential Revision: https://reviews.freebsd.org/D8262 Modified: head/sys/net80211/ieee80211_scan_sw.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Wed Oct 19 02:39:24 2016 (r307601) +++ head/sys/net80211/ieee80211_scan_sw.c Wed Oct 19 05:03:46 2016 (r307602) @@ -412,6 +412,12 @@ ieee80211_swscan_bg_scan(const struct ie return (ic->ic_flags & IEEE80211_F_SCAN); } +/* + * Taskqueue work to cancel a scan. + * + * Note: for offload scan devices, we may want to call into the + * driver to try and cancel scanning, however it may not be cancelable. + */ static void cancel_scan(struct ieee80211vap *vap, int any, const char *func) { @@ -512,6 +518,12 @@ ieee80211_swscan_probe_curchan(struct ie int i; /* + * Full-offload scan devices don't require this. + */ + if (vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) + return; + + /* * Send directed probe requests followed by any * broadcast probe request. * XXX remove dependence on ic/vap->iv_bss @@ -617,7 +629,14 @@ scan_start(void *arg, int pending) return; } - if (vap->iv_opmode == IEEE80211_M_STA && + /* + * Put the station into power save mode. + * + * This is only required if we're not a full-offload devices; + * those devices manage scan/traffic differently. + */ + if (((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) && + vap->iv_opmode == IEEE80211_M_STA && vap->iv_state == IEEE80211_S_RUN) { if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) { /* Enable station power save mode */ @@ -870,7 +889,12 @@ scan_done(struct ieee80211_scan_state *s * waiting for us. */ if (scandone) { - vap->iv_sta_ps(vap, 0); + /* + * If we're not a scan offload device, come back out of + * station powersave. Offload devices handle this themselves. + */ + if ((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) + vap->iv_sta_ps(vap, 0); if (ss->ss_next >= ss->ss_last) ic->ic_flags_ext &= ~IEEE80211_FEXT_BGSCAN; Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Wed Oct 19 02:39:24 2016 (r307601) +++ head/sys/net80211/ieee80211_var.h Wed Oct 19 05:03:46 2016 (r307602) @@ -601,11 +601,12 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FEXT_WDSLEGACY 0x00010000 /* CONF: legacy WDS operation */ #define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/ #define IEEE80211_FEXT_UNIQMAC 0x00040000 /* CONF: user or computed mac */ +#define IEEE80211_FEXT_SCAN_OFFLOAD 0x00080000 /* CONF: scan is fully offloaded */ #define IEEE80211_FEXT_BITS \ "\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ "\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \ - "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC" + "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC\24SCAN_OFFLOAD" /* ic_flags_ht/iv_flags_ht */ #define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */ From owner-svn-src-head@freebsd.org Wed Oct 19 05:44:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D0AC17B53 for ; Wed, 19 Oct 2016 05:44:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8913E9D for ; Wed, 19 Oct 2016 05:44:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id r30so21081902ioi.1 for ; Tue, 18 Oct 2016 22:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=KasjADQBHzug7wO6PMCJmyPL32KzppgyXdtHkkBRKdk=; b=EGUJ537E2uq2qBAZsZAleW03wkFzoP7DR/7Z1mAP3/Xf068IleszgFiqB1AtDBWaHi tmqR/qfZUlgEevwiZIZhvMj83W8Xfk5G3dAhZ4Iocuy3IJF4Wh8lH1oOhrIuvxLnUcc7 das9z+BPtGfMw6eqnN8IbbFNjIAR005tWqivCWEHDvGdhf5Y4SXEySQCafPhv472GUWi fVy/7RDYia725ppJ4GU/28rBpVkTbIig5u1BGG27Z9veWGpbzEtZtHH+AB5o9NNHSWIq usvFrhUKxSjT0ddkGFXca8JqIJ5VhDXtjzBicNeGVbaPZqmJyDEjWS6eLIYRu6sAptFC +0rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=KasjADQBHzug7wO6PMCJmyPL32KzppgyXdtHkkBRKdk=; b=fMRAy8XCnTiaAGzZJNLFVCQ/4Y1JDhFXGwOr+FMnP7SdXRGfZqNeTu41Ighb+OlaqZ sq2C2KepHPtynkPtpe1pRzEptuum+tR248fhVWLrC0X97WUM3+140gujf7j9NTIU09xf qZRtrHgfioErW5hQ7Dou6DSUmWBYq6M2N4p6z8I8eYEdB+0ttY4tfDIi6lyAMtVUd3fD 65ffy6uCGW1tbE09iwu2J2Eid+nejowwESGLtRXb4R7E+Hpi57FPRlpu91kDFS31+3g5 ME1xCKo6Hu8//bXipx7zXCSq1+3zd1HZAeOBHepzcHn1ts3N2bpwMytXtRLWY7DwGIj7 omsg== X-Gm-Message-State: AA6/9Rm9Kqzg1UwlfUZFB1nkvvcwRzjdfx5h0tCRECwltYyN5GnC6ZLhCXLlby+5lNwgMRpQBAXLKDJrc1UOMg== X-Received: by 10.107.15.222 with SMTP id 91mr4989356iop.19.1476855893059; Tue, 18 Oct 2016 22:44:53 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Tue, 18 Oct 2016 22:44:52 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <1950201.IjTl3rpdGP@ralph.baldwin.cx> References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014175542.GB65545@ambrisko.com> <1950201.IjTl3rpdGP@ralph.baldwin.cx> From: Warner Losh Date: Tue, 18 Oct 2016 23:44:52 -0600 X-Google-Sender-Auth: 6WfqHbXHkzeIBclg_wH3Vl9c_No Message-ID: Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader To: John Baldwin Cc: Doug Ambrisko , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Doug Ambrisko , Ravi Pokala Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 05:44:54 -0000 On Mon, Oct 17, 2016 at 11:40 AM, John Baldwin wrote: > On Friday, October 14, 2016 12:25:54 PM Warner Losh wrote: >> On Oct 14, 2016 11:55 AM, "Doug Ambrisko" wrote: >> > >> > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: >> > | -----Original Message----- >> > | > From: on behalf of Doug Ambrisko < >> ambrisko@ambrisko.com> >> > | > Date: 2016-10-14, Friday at 10:27 >> > | > To: Warner Losh >> > | > Cc: Doug Ambrisko , src-committers < >> src-committers@freebsd.org>, "svn-src-all@freebsd.org" < >> svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" < >> svn-src-head@freebsd.org> >> > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader >> > | > >> > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: >> > | > | Love the functionality, but don't like using the 'hint' namespace >> for >> > | > | this. Can we change it now before too many things depend on it? We >> had >> > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we move >> > | > | this to the 'smbios' space please? >> > | > | >> > | > | The reason is that 'hint' is special and sometimes filtered out, so >> it >> > | > | is a poor choice to export data from the boot loader to the kernel. >> > | > >> > | > The reason I picked hint was it could be put /boot/device.hints >> > | > to make it work as well and that it was a hint. Other standards in >> the >> > | > future might use other methods. Looking back over the email I had >> > | > with John he had suggested hint.smbios.0.anchor to make this look >> > | > different. This code had been hanging around for so long I forgot >> > | > about that and we were using hint.smbios.0.mem in our shipping code >> base. >> > | > >> > | > However, I hope that nothing would use this except for smbios(4) and >> > | > for people to make smbios(4) useful for this info. >> > | >> > | Doug's looking at me when he says that. :-) >> > | >> > | We talked about this last night at BAFUG; right now, even if smbios(4) >> > | is able to find the SMBIOS info -- it currently only looks at the >> > | aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI -- >> > | smbios(4) doesn't actually provide any interface for that information. >> > | Doug and I have talked about making smbios(4) useful, by parsing the >> > | data and providing KPIs and APIs, for years now; I think I'll *finally* >> > | have the time and motivation to do so "soon". >> > >> > I've actually talked to a few people. However, your the first to >> > step up. This needs to be designed and will take some time and >> > review. I would hope that except for smbios(4), nothing else would >> > use this kenv but there is nothing to prevent that :-( I could name >> > it super_secret_dont_use. >> > >> > BTW, to get you started this patch prevents smbios(4) from blowing chunks >> > when it gets a anchor in high memory and works on legacy machines. >> > >> > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.000000000 -0700 >> > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 >> > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 >> > #include >> > #include >> > #include >> > +#include >> > >> > #include >> > #include >> > @@ -59,7 +60,7 @@ struct smbios_softc { >> > }; >> > >> > #define RES2EPS(res) ((struct smbios_eps >> *)rman_get_virtual(res)) >> > -#define ADDR2EPS(addr) ((struct smbios_eps >> *)BIOS_PADDRTOVADDR(addr)) >> > +#define ADDR2EPS(addr) ((struct smbios_eps *)PHYS_TO_DMAP(addr)) >> > >> > static devclass_t smbios_devclass; >> > >> > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in >> > >> > static int smbios_cksum (struct smbios_eps *); >> > >> > +static unsigned long addr; >> > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, >> > + "SMBIOS driver parameters"); >> > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, >> > + &addr, 0, ""); >> > + >> > static void >> > smbios_identify (driver_t *driver, device_t parent) >> > { >> > device_t child; >> > - u_int32_t addr; >> > int length; >> > int rid; >> > >> > if (!device_is_alive(parent)) >> > return; >> > >> > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, >> > - SMBIOS_STEP, SMBIOS_OFF); >> > + if (resource_long_value("smbios", 0, "mem", &addr) != 0 || >> > + addr == 0) >> > + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, >> SMBIOS_LEN, >> > + SMBIOS_STEP, SMBIOS_OFF); >> > if (addr != 0) { >> > rid = 0; >> > length = ADDR2EPS(addr)->length; >> > >> > Note I don't plan to commit this since it doesn't really do much and we >> > need a lot more. >> >> I was planning on exporting all smbios stuff via sysctl. > > I'm a bit hesitant to do all the type parsing in the kernel vs userland. > However, I think having smbios(4) export a /dev/smbios that you can either > read() or mmap() to access the table would be very convenient and let you > keep the bits to parse the table in userland (and not require root if we > allow read-only access to mortals on /dev/foo). I'd support allowing this also, but we have them hidden in kenv how. Moving them to sysctl is trivial and adds no additional risk to the kernel. Having a /dev/smbios that also exports them and having userland tools to parse nodes that the loader doesn't export is also a good idea, but I don't think that would replace what I have in mind. sysctl is super easy to get data from in shell and other scripts. /dev/smbios would require another program to parse the blob that's exported. I think it would be cool to have that as well and wouldn't interfere with what I was planning on doing. Warner From owner-svn-src-head@freebsd.org Wed Oct 19 05:53:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B925C17D5D; Wed, 19 Oct 2016 05:53:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3006731D; Wed, 19 Oct 2016 05:53: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 u9J5rhqS085414; Wed, 19 Oct 2016 05:53:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J5rhe3085413; Wed, 19 Oct 2016 05:53:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610190553.u9J5rhe3085413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Oct 2016 05:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307605 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 05:53:44 -0000 Author: imp Date: Wed Oct 19 05:53:43 2016 New Revision: 307605 URL: https://svnweb.freebsd.org/changeset/base/307605 Log: Use MODULES_EXTRA rather than MODULES_OVERRIDE for dtb. Submitted by: Oleksandr Tymoshenko Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Wed Oct 19 05:38:50 2016 (r307604) +++ head/sys/arm/conf/PANDABOARD Wed Oct 19 05:53:43 2016 (r307605) @@ -30,7 +30,7 @@ hints "PANDABOARD.hints" include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" -makeoptions MODULES_OVERRIDE=dtb/omap4 +makeoptions MODULES_EXTRA=dtb/omap4 options SCHED_ULE # ULE scheduler options PLATFORM From owner-svn-src-head@freebsd.org Wed Oct 19 06:35:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCE6DC18B07; Wed, 19 Oct 2016 06:35:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8C2E9B; Wed, 19 Oct 2016 06:35:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 4FE6B10AF8F; Wed, 19 Oct 2016 02:35:29 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Doug Ambrisko , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Doug Ambrisko , Ravi Pokala Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader Date: Tue, 18 Oct 2016 23:20:14 -0700 Message-ID: <3841347.BNPZXPm7N3@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201610141710.u9EHArlL089412@repo.freebsd.org> <1950201.IjTl3rpdGP@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 19 Oct 2016 02:35:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 06:35:30 -0000 On Tuesday, October 18, 2016 11:44:52 PM Warner Losh wrote: > On Mon, Oct 17, 2016 at 11:40 AM, John Baldwin wrote: > > On Friday, October 14, 2016 12:25:54 PM Warner Losh wrote: > >> On Oct 14, 2016 11:55 AM, "Doug Ambrisko" wrote: > >> > > >> > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: > >> > | -----Original Message----- > >> > | > From: on behalf of Doug Ambrisko < > >> ambrisko@ambrisko.com> > >> > | > Date: 2016-10-14, Friday at 10:27 > >> > | > To: Warner Losh > >> > | > Cc: Doug Ambrisko , src-committers < > >> src-committers@freebsd.org>, "svn-src-all@freebsd.org" < > >> svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" < > >> svn-src-head@freebsd.org> > >> > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader > >> > | > > >> > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: > >> > | > | Love the functionality, but don't like using the 'hint' namespace > >> for > >> > | > | this. Can we change it now before too many things depend on it? We > >> had > >> > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we move > >> > | > | this to the 'smbios' space please? > >> > | > | > >> > | > | The reason is that 'hint' is special and sometimes filtered out, so > >> it > >> > | > | is a poor choice to export data from the boot loader to the kernel. > >> > | > > >> > | > The reason I picked hint was it could be put /boot/device.hints > >> > | > to make it work as well and that it was a hint. Other standards in > >> the > >> > | > future might use other methods. Looking back over the email I had > >> > | > with John he had suggested hint.smbios.0.anchor to make this look > >> > | > different. This code had been hanging around for so long I forgot > >> > | > about that and we were using hint.smbios.0.mem in our shipping code > >> base. > >> > | > > >> > | > However, I hope that nothing would use this except for smbios(4) and > >> > | > for people to make smbios(4) useful for this info. > >> > | > >> > | Doug's looking at me when he says that. :-) > >> > | > >> > | We talked about this last night at BAFUG; right now, even if smbios(4) > >> > | is able to find the SMBIOS info -- it currently only looks at the > >> > | aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI -- > >> > | smbios(4) doesn't actually provide any interface for that information. > >> > | Doug and I have talked about making smbios(4) useful, by parsing the > >> > | data and providing KPIs and APIs, for years now; I think I'll *finally* > >> > | have the time and motivation to do so "soon". > >> > > >> > I've actually talked to a few people. However, your the first to > >> > step up. This needs to be designed and will take some time and > >> > review. I would hope that except for smbios(4), nothing else would > >> > use this kenv but there is nothing to prevent that :-( I could name > >> > it super_secret_dont_use. > >> > > >> > BTW, to get you started this patch prevents smbios(4) from blowing chunks > >> > when it gets a anchor in high memory and works on legacy machines. > >> > > >> > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.000000000 -0700 > >> > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 > >> > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 > >> > #include > >> > #include > >> > #include > >> > +#include > >> > > >> > #include > >> > #include > >> > @@ -59,7 +60,7 @@ struct smbios_softc { > >> > }; > >> > > >> > #define RES2EPS(res) ((struct smbios_eps > >> *)rman_get_virtual(res)) > >> > -#define ADDR2EPS(addr) ((struct smbios_eps > >> *)BIOS_PADDRTOVADDR(addr)) > >> > +#define ADDR2EPS(addr) ((struct smbios_eps *)PHYS_TO_DMAP(addr)) > >> > > >> > static devclass_t smbios_devclass; > >> > > >> > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in > >> > > >> > static int smbios_cksum (struct smbios_eps *); > >> > > >> > +static unsigned long addr; > >> > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, > >> > + "SMBIOS driver parameters"); > >> > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, > >> > + &addr, 0, ""); > >> > + > >> > static void > >> > smbios_identify (driver_t *driver, device_t parent) > >> > { > >> > device_t child; > >> > - u_int32_t addr; > >> > int length; > >> > int rid; > >> > > >> > if (!device_is_alive(parent)) > >> > return; > >> > > >> > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, > >> > - SMBIOS_STEP, SMBIOS_OFF); > >> > + if (resource_long_value("smbios", 0, "mem", &addr) != 0 || > >> > + addr == 0) > >> > + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, > >> SMBIOS_LEN, > >> > + SMBIOS_STEP, SMBIOS_OFF); > >> > if (addr != 0) { > >> > rid = 0; > >> > length = ADDR2EPS(addr)->length; > >> > > >> > Note I don't plan to commit this since it doesn't really do much and we > >> > need a lot more. > >> > >> I was planning on exporting all smbios stuff via sysctl. > > > > I'm a bit hesitant to do all the type parsing in the kernel vs userland. > > However, I think having smbios(4) export a /dev/smbios that you can either > > read() or mmap() to access the table would be very convenient and let you > > keep the bits to parse the table in userland (and not require root if we > > allow read-only access to mortals on /dev/foo). > > I'd support allowing this also, but we have them hidden in kenv how. > Moving them to sysctl is trivial and adds no additional risk to the > kernel. Having a /dev/smbios that also exports them and having > userland tools to parse nodes that the loader doesn't export is also a > good idea, but I don't think that would replace what I have in mind. > sysctl is super easy to get data from in shell and other scripts. > /dev/smbios would require another program to parse the blob that's > exported. I think it would be cool to have that as well and wouldn't > interfere with what I was planning on doing. Not everything is as sensible to export via sysctl, though a subset of things might be. I have patches to pciconf to let it parse the smbios table for describing physical slots and which new-bus devices are associated with physical slots (unfortunately the tables themselves aren't very reliable in my experience to date), and that sort of thing probably belongs in userland. dmidecode could be patched to use /dev/smbios rather than grovelling around in /dev/mem rather easily. Having a tool to parse the table isn't the end of the world. We do this with other tables (e.g. the SMAP and EFI memory maps are exported as "raw" sysctl nodes that the sysctl binary knows how to format, but that is still done in userland). acpidump -t, mptable, pirtool, etc. are all done in userland as well. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Oct 19 07:40:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34755C17755; Wed, 19 Oct 2016 07:40:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 031CB869; Wed, 19 Oct 2016 07:40:52 +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 u9J7eqGl025439; Wed, 19 Oct 2016 07:40:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J7eqO1025438; Wed, 19 Oct 2016 07:40:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610190740.u9J7eqO1025438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Oct 2016 07:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307616 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 07:40:53 -0000 Author: imp Date: Wed Oct 19 07:40:51 2016 New Revision: 307616 URL: https://svnweb.freebsd.org/changeset/base/307616 Log: RPI3 is retired in preference to GENERIC-UP. Use that instead. Modified: head/tools/tools/nanobsd/embedded/rpi3.cfg Modified: head/tools/tools/nanobsd/embedded/rpi3.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi3.cfg Wed Oct 19 07:33:43 2016 (r307615) +++ head/tools/tools/nanobsd/embedded/rpi3.cfg Wed Oct 19 07:40:51 2016 (r307616) @@ -27,7 +27,7 @@ # NANO_ARCH=aarch64 -NANO_KERNEL=RPI3 +NANO_KERNEL=GENERIC-UP NANO_DRIVE=mmcsd0 NANO_NAME=rpi3 NANO_BOOT_PKG=u-boot-rpi3 From owner-svn-src-head@freebsd.org Wed Oct 19 08:01:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7EDAC180A0 for ; Wed, 19 Oct 2016 08:01:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E0E58C5 for ; Wed, 19 Oct 2016 08:01:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id k64so25842168itb.0 for ; Wed, 19 Oct 2016 01:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=DCcYOFqQiRSNqQNrHqlaI9tDvk6zXs4G6H/zz9Tlu+0=; b=KJ9fp8QiWKke4rNs/+dB/IQV6p/FPFoVa7DvcmgsCj3GRn4arKBb/pg7xQC4f3rz0N pMTFpjcN1dipOpHuJR440Na3sU9duMor6ibbEwbfJL4DhJpb0SivNuqhHLHQ/IBHnErd p1Zc4LUQ5UScuYXhBmlfcoE619AUWX+GqDYMudtK1y3RqxgPpOBM2CRZ/UEK7f+z6GuS 4NIu8vI5S47Ye8m1rJ+rjCo0JjUCfMSW8WjBbsOSE9kRbVTIv1dUewkuF/H3EaQSFleO eX9R6fmjFsOn90gMM9ws/xt98SDHklNXqqAxXkWqq9eUo8f53ksZfiB7VTlzMY8bHvMX yVHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=DCcYOFqQiRSNqQNrHqlaI9tDvk6zXs4G6H/zz9Tlu+0=; b=mqJKNzJFtj+4gOwPYe4OjNzFfudrqgr+vPfm7mus0t4Gl4HhK6egFW6indsnyVPOmP S9qj/YcXi9nrLMdZHYbVtGqmT4Gk5ZHxIcO3YbdzerEZw/qV/6LPxNRuRcpllyyqxMxb lebfkYzF97RijSx5isgRoP2UMvkGAuQHQQYzM3i+l6LzIp3YkYXsY6Hn+amIsilH2wIr bt3wX74bycREQGqzQ3EjugPaRj+z+hBUlQvi/oW60WXr5rDbFBxXz4tbmVEbBz9wTrPV ke8XCatraXjvrtlwJJSy+yXKIbgONDkNLzUXfgo0/mSiCIj8oe5PESAhEU2XB6FqWTbE FBlA== X-Gm-Message-State: AA6/9RnwSY9EVdsrKE4OtvCXRVTOKItrWXfNRVaJ5GhMqTQgDua6KAqBqz70rHezcUhSMC3421ZXh+8MvkL+7Q== X-Received: by 10.36.19.147 with SMTP id 141mr1563835itz.85.1476864078889; Wed, 19 Oct 2016 01:01:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Wed, 19 Oct 2016 01:01:18 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <3841347.BNPZXPm7N3@ralph.baldwin.cx> References: <201610141710.u9EHArlL089412@repo.freebsd.org> <1950201.IjTl3rpdGP@ralph.baldwin.cx> <3841347.BNPZXPm7N3@ralph.baldwin.cx> From: Warner Losh Date: Wed, 19 Oct 2016 02:01:18 -0600 X-Google-Sender-Auth: FCc-kRIVpB84iYnBqjufMtj9TLs Message-ID: Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader To: John Baldwin Cc: Doug Ambrisko , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Doug Ambrisko , Ravi Pokala Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 08:01:19 -0000 On Wed, Oct 19, 2016 at 12:20 AM, John Baldwin wrote: > On Tuesday, October 18, 2016 11:44:52 PM Warner Losh wrote: >> On Mon, Oct 17, 2016 at 11:40 AM, John Baldwin wrote: >> > On Friday, October 14, 2016 12:25:54 PM Warner Losh wrote: >> >> On Oct 14, 2016 11:55 AM, "Doug Ambrisko" wrote: >> >> > >> >> > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: >> >> > | -----Original Message----- >> >> > | > From: on behalf of Doug Ambrisko < >> >> ambrisko@ambrisko.com> >> >> > | > Date: 2016-10-14, Friday at 10:27 >> >> > | > To: Warner Losh >> >> > | > Cc: Doug Ambrisko , src-committers < >> >> src-committers@freebsd.org>, "svn-src-all@freebsd.org" < >> >> svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" < >> >> svn-src-head@freebsd.org> >> >> > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader >> >> > | > >> >> > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: >> >> > | > | Love the functionality, but don't like using the 'hint' namespace >> >> for >> >> > | > | this. Can we change it now before too many things depend on it? We >> >> had >> >> > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we move >> >> > | > | this to the 'smbios' space please? >> >> > | > | >> >> > | > | The reason is that 'hint' is special and sometimes filtered out, so >> >> it >> >> > | > | is a poor choice to export data from the boot loader to the kernel. >> >> > | > >> >> > | > The reason I picked hint was it could be put /boot/device.hints >> >> > | > to make it work as well and that it was a hint. Other standards in >> >> the >> >> > | > future might use other methods. Looking back over the email I had >> >> > | > with John he had suggested hint.smbios.0.anchor to make this look >> >> > | > different. This code had been hanging around for so long I forgot >> >> > | > about that and we were using hint.smbios.0.mem in our shipping code >> >> base. >> >> > | > >> >> > | > However, I hope that nothing would use this except for smbios(4) and >> >> > | > for people to make smbios(4) useful for this info. >> >> > | >> >> > | Doug's looking at me when he says that. :-) >> >> > | >> >> > | We talked about this last night at BAFUG; right now, even if smbios(4) >> >> > | is able to find the SMBIOS info -- it currently only looks at the >> >> > | aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI -- >> >> > | smbios(4) doesn't actually provide any interface for that information. >> >> > | Doug and I have talked about making smbios(4) useful, by parsing the >> >> > | data and providing KPIs and APIs, for years now; I think I'll *finally* >> >> > | have the time and motivation to do so "soon". >> >> > >> >> > I've actually talked to a few people. However, your the first to >> >> > step up. This needs to be designed and will take some time and >> >> > review. I would hope that except for smbios(4), nothing else would >> >> > use this kenv but there is nothing to prevent that :-( I could name >> >> > it super_secret_dont_use. >> >> > >> >> > BTW, to get you started this patch prevents smbios(4) from blowing chunks >> >> > when it gets a anchor in high memory and works on legacy machines. >> >> > >> >> > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.000000000 -0700 >> >> > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 >> >> > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 >> >> > #include >> >> > #include >> >> > #include >> >> > +#include >> >> > >> >> > #include >> >> > #include >> >> > @@ -59,7 +60,7 @@ struct smbios_softc { >> >> > }; >> >> > >> >> > #define RES2EPS(res) ((struct smbios_eps >> >> *)rman_get_virtual(res)) >> >> > -#define ADDR2EPS(addr) ((struct smbios_eps >> >> *)BIOS_PADDRTOVADDR(addr)) >> >> > +#define ADDR2EPS(addr) ((struct smbios_eps *)PHYS_TO_DMAP(addr)) >> >> > >> >> > static devclass_t smbios_devclass; >> >> > >> >> > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in >> >> > >> >> > static int smbios_cksum (struct smbios_eps *); >> >> > >> >> > +static unsigned long addr; >> >> > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, >> >> > + "SMBIOS driver parameters"); >> >> > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, >> >> > + &addr, 0, ""); >> >> > + >> >> > static void >> >> > smbios_identify (driver_t *driver, device_t parent) >> >> > { >> >> > device_t child; >> >> > - u_int32_t addr; >> >> > int length; >> >> > int rid; >> >> > >> >> > if (!device_is_alive(parent)) >> >> > return; >> >> > >> >> > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, >> >> > - SMBIOS_STEP, SMBIOS_OFF); >> >> > + if (resource_long_value("smbios", 0, "mem", &addr) != 0 || >> >> > + addr == 0) >> >> > + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, >> >> SMBIOS_LEN, >> >> > + SMBIOS_STEP, SMBIOS_OFF); >> >> > if (addr != 0) { >> >> > rid = 0; >> >> > length = ADDR2EPS(addr)->length; >> >> > >> >> > Note I don't plan to commit this since it doesn't really do much and we >> >> > need a lot more. >> >> >> >> I was planning on exporting all smbios stuff via sysctl. >> > >> > I'm a bit hesitant to do all the type parsing in the kernel vs userland. >> > However, I think having smbios(4) export a /dev/smbios that you can either >> > read() or mmap() to access the table would be very convenient and let you >> > keep the bits to parse the table in userland (and not require root if we >> > allow read-only access to mortals on /dev/foo). >> >> I'd support allowing this also, but we have them hidden in kenv how. >> Moving them to sysctl is trivial and adds no additional risk to the >> kernel. Having a /dev/smbios that also exports them and having >> userland tools to parse nodes that the loader doesn't export is also a >> good idea, but I don't think that would replace what I have in mind. >> sysctl is super easy to get data from in shell and other scripts. >> /dev/smbios would require another program to parse the blob that's >> exported. I think it would be cool to have that as well and wouldn't >> interfere with what I was planning on doing. > > Not everything is as sensible to export via sysctl, though a subset of > things might be. I have patches to pciconf to let it parse the smbios > table for describing physical slots and which new-bus devices are > associated with physical slots (unfortunately the tables themselves aren't > very reliable in my experience to date), and that sort of thing probably > belongs in userland. Agreed. That sort of thing isn't exported via a kenv today anyway. > dmidecode could be patched to use /dev/smbios > rather than grovelling around in /dev/mem rather easily. Having a tool > to parse the table isn't the end of the world. We do this with other > tables (e.g. the SMAP and EFI memory maps are exported as "raw" sysctl > nodes that the sysctl binary knows how to format, but that is still > done in userland). acpidump -t, mptable, pirtool, etc. are all done in > userland as well. Understood. And I aagree. I think there's useful info that we should put in sysctl as well. It's also useful to have it in the sysctl -a output. The sysctl info I'm planning is about the system, and not any of these tables. One of my systems would export these as sysctls: smbios.bios.reldate="07/05/2013" smbios.bios.vendor="American Megatrends Inc." smbios.bios.version="3.00" smbios.chassis.maker="Supermicro" smbios.chassis.serial="0123456789" smbios.chassis.tag="To Be Filled By O.E.M." smbios.chassis.version="0123456789" smbios.memory.enabled="268435456" smbios.planar.location="To be filled by O.E.M." smbios.planar.maker="Supermicro" smbios.planar.product="X9SRH-7F/7TF" smbios.planar.serial="VM13CS028237" smbios.planar.tag="To be filled by O.E.M." smbios.planar.version="0123456789" smbios.socket.enabled="1" smbios.socket.populated="1" smbios.system.family="To be filled by O.E.M." smbios.system.maker="Supermicro" smbios.system.product="X9SRH-7F/7TF" smbios.system.serial="0123456789" smbios.system.sku="To be filled by O.E.M." smbios.system.uuid="00000000-0000-0000-0000-002590e4d0ec" smbios.system.version="0123456789" smbios.version="2.7" though some of them are silly due to the BIOS writer being silly... Warner From owner-svn-src-head@freebsd.org Wed Oct 19 09:12:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D73F6C18C1A; Wed, 19 Oct 2016 09:12:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A90E0DB; Wed, 19 Oct 2016 09:12:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9J9CEqh060305; Wed, 19 Oct 2016 09:12:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9J9CEGS060303; Wed, 19 Oct 2016 09:12:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610190912.u9J9CEGS060303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 19 Oct 2016 09:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307624 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 09:12:15 -0000 Author: sephe Date: Wed Oct 19 09:12:14 2016 New Revision: 307624 URL: https://svnweb.freebsd.org/changeset/base/307624 Log: hyperv/vmbus: Expose channel management taskqueue for driver to use. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Wed Oct 19 08:45:19 2016 (r307623) +++ head/sys/dev/hyperv/include/vmbus.h Wed Oct 19 09:12:14 2016 (r307624) @@ -118,6 +118,7 @@ struct vmbus_chan_br { struct vmbus_channel; struct hyperv_guid; struct task; +struct taskqueue; typedef void (*vmbus_chan_callback_t)(struct vmbus_channel *, void *); @@ -179,5 +180,7 @@ int vmbus_chan_prplist_nelem(int br_siz int dlen_max); bool vmbus_chan_rx_empty(const struct vmbus_channel *chan); bool vmbus_chan_tx_empty(const struct vmbus_channel *chan); +struct taskqueue * + vmbus_chan_mgmt_tq(const struct vmbus_channel *chan); #endif /* !_VMBUS_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Oct 19 08:45:19 2016 (r307623) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Oct 19 09:12:14 2016 (r307624) @@ -1721,3 +1721,10 @@ vmbus_chan_run_task(struct vmbus_channel taskqueue_enqueue(chan->ch_tq, task); taskqueue_drain(chan->ch_tq, task); } + +struct taskqueue * +vmbus_chan_mgmt_tq(const struct vmbus_channel *chan) +{ + + return (chan->ch_mgmt_tq); +} From owner-svn-src-head@freebsd.org Wed Oct 19 10:01:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29980C15EAA; Wed, 19 Oct 2016 10:01:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id EB35615A; Wed, 19 Oct 2016 10:01:05 +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 u9JA15YY078366; Wed, 19 Oct 2016 10:01:05 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JA14uU078362; Wed, 19 Oct 2016 10:01:04 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610191001.u9JA14uU078362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 19 Oct 2016 10:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307625 - head/tests/sys/geom/class/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 10:01:06 -0000 Author: br Date: Wed Oct 19 10:01:04 2016 New Revision: 307625 URL: https://svnweb.freebsd.org/changeset/base/307625 Log: Add big-endian uzip file system and choose right file system to proceed tests with. Reviewed by: jmmv, ngie Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8073 Added: head/tests/sys/geom/class/uzip/1_endian_big.img.uzip.uue (contents, props changed) head/tests/sys/geom/class/uzip/1_endian_little.img.uzip.uue (contents, props changed) Deleted: head/tests/sys/geom/class/uzip/test-1.img.uzip.uue Modified: head/tests/sys/geom/class/uzip/1_test.sh head/tests/sys/geom/class/uzip/Makefile Added: head/tests/sys/geom/class/uzip/1_endian_big.img.uzip.uue ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/uzip/1_endian_big.img.uzip.uue Wed Oct 19 10:01:04 2016 (r307625) @@ -0,0 +1,87 @@ +# +# $FreeBSD$ +# + +begin 644 1_endian_big.img.uzip +M(R$O8FEN+W-H"B-6,BXP($9OFEP?'QK +M;&1L;V%D(&=E;VU?=7II<"D^)BTF)FUO=6YT7V-D.38V,"`O9&5V+V!M9&-O +M;F9I9R`M868@)#!@+G5Z:7`@)#$*97AI="`D/PH``````````````$`````` +M0`````````*0`````````I`````````"D`````````*0`````````I`````` +M```#;P````````-O````````!#$````````$,0````````2H````````!*@` +M```````&T@````````B4````````",4````````(Q0````````NZ```````` +M"[H````````,@0````````R!````````#($````````,@0````````R!```` +M````#($````````,@0````````R!````````#($````````,@0````````R! +M````````#($````````,@0````````R!````````#($````````,@0`````` +M``R!````````#($````````,@0````````R!````````#($````````,@0`` +M``````R!````````#($````````,@0````````R!````````#($````````, +M@0````````R!````````#($````````,@0````````R!````````#($````` +M```,@0````````R!````````#($````````,@0````````R!````````#($` +M```````,@0````````R!````````#($````````,@0````````R!```````` +M#($````````,@0````````R!````````#*UXVNW4/0Z",!3`\3:B,FA@A,W1 +MN,C@`3R$":?0R<'!Q.H)3+R0DZOQ(L3%N1:H:``3'=#E_TM>WX.TI7P4(0J! +MB8&)H8E(U)-"*)/\M'9M9+16)JYIZ9GHF7!LOU8>_LLT6:WJ+A`GVU/G,IH\ +M^_EOEI*.EW4K5./Y8BF`!AW3YK!W\JP>Q]5/M+Q]F.SI^L&A3,9LE,````` +M``````````````````````#PC3L712#(>-KMU#T*PD`0AN$)_FTA)*7I+,4J +MA0?P$()7L=+UKTEQMTT]]JD'K,_[P_`T7]SF%4^.$M=GJ1-Z +M`?Z"[[9/P_WD.-UV*:UNK8Y>V2;VZ,.&1ZO59U]@V5Z^3/]ELK$OY]T@A.;V +MSFH>4HO*55;2`P```````````````````````````'C'%6?Y%ZQXVNW.L0W" +M,!"&40A?'7CLTVGM*Z+?5J6>=WXN>K3-3W2+=W3+IUKC?:&UN;G]/T:9DSNFLX` +M``````````````````#@;WP`XC\HZGC:Y=MY*`11'`?PL>[<-AN28\D5Y:I= +M(6W:+<+F_H-"RLZ?8TV;&?F%;IF_Q*5\TJ;\4<,[[E=_91Y!XUZWRJ*L +M<$K35O_P<,OY"]L)!?G+E`S?C/_B1Y%*ICI1/<]L'Z-X7X$MCOE"'NZ_Y%?\ +MZ0[OY[GW0C^\?6)YG(_K:2/%-DO\V4S2"R +MO\/\7!_9?U1<3V6VEVG2#[!;OQ5&1_(N9#^;EXS,)Z+NI'7(_HMID039K[RW,(_L]Y+< +M'R+[&Q.VKI#]Z3-NT.L?NI1>"SW_N7[5R'[.,C\$V<\=K[%#]AM'%A@@^V-3 +M3M.1_;D<6SKT^F\V"WK_V\+1-1S9+^S7O$7VVY.COLC^B#D&]/^/`=D;P\C^ +MX++F*F1_4\8Z]/-KEVETK@V$8 +M!_!E88@LG]"&FQ"]K.>-")D_X+/58OL%Z<.C2#[OYY)`MF_&]+F(ON9L3W0]]^H +M?HE']MN,!CJRGU]^487L3UP[IB'[3Z/9M\A^1_*;'=E?[XUV(OMK.`-"9'^: +M2O&*[%^G;EY"Y_^5&GK^HW]86Y#]#7WN'62_/Y!Q@NR_OF'HD/WV$I*![-_8 +M]YC^_][H\2#[+"[O_DMP5Z_U7ML[F1_33=L`#9S\YI +M2T+V?W8'>,C^>\%D,[*_B`P_(/MMH?PPLM\M<\XC^\<.%,A\"FM+/([L=R0P +MOS7!#@6 +M9+_><`C]_F-4RJ'K'Z&_@_[_W-M^#KW_JSO3SB+[4\3T?F1_ZVK,"K(_(E$Z +MH><_JBL$7?]DI5/(_J/':>C^/Q/A%B/[V:I1_G\Z[R\+%8'F>-KMPS$-`"`0 +M`+%#`#MB$<^K8&J35JLZ\\X=````````````````````\-T#NY8`HWC:[91+ +M;]0P$,=WRR(J"PFNE3C,TDJ`M%T!%Q`E%2"$Q/,P/VGC9.P9C_\SWL%@L#0X/QI.!XFEP:71TK3[ +M.#.X.#H[]14_Z.9&PX_+3`2N;34-AV%`$,0/>?O5]_#X9?F?I#/\QK+2CZ_[ +M\=S/A-G]].[]5P$_]./U/WN`^U\>?YD1_@[[RKU=/GMTU)G?]..%H^\YK[.YM/7S"V+1KE89,[ +M9[5F5PMG# +MB3ML0VLPRO@6&HR=)C+K;!F])VRCCVFL$>!XD!YL'4J'KE/&+L]$PWNG)SS+ +MA&OL8G\"I@5OJS'#=&&/-QX7X$$R%3#WN':AOQ@7/"SDF)T.5&=[=8:K7=Z= +MRWT\+A7#KR1 +MZEC+Y(]ZX"RF[*.Q+@KEY?%NE%TD?O*>$NI% +MRS3/<6-1!?"56NP+MXXB+_;'46$MBA"WR`7O"Y-25\'CZ7@>ER3/DNO:',B8 +M>(:^L4V2+I+[)`?V)^\[\$2'>VPS%B38V#O<&9^:*!/<1!4SVX[9#M:?9WNQ +M_CEOQWB1M+96=B]HN!(S6$CK0I0C5AZ[8<^VT]]R4>[^RD6A?T:"(`B"(`B" +M(`B"(`B"(`B"(`B"(`B"(`B"(`B"(`B"^/_X#/X6=T5XVNW7+0H"01B`X=EQ +M004Q>@3!,B`8A$V#;#$+1@4/(=C4H,VD[@FT>`9ABPB;-GD$,6@0L_B#)L$@ +MIOW>)\Q/?&>FC%(JI7*N8]23=BZN-J\-DL\>[_?_0;\7FZOE5G+_ +M-:^'DOO]TF@FN7]=LT7)_8U@UY'-KMT#$!```,`B"C&]T*>_9!!!(```````````````````!X405W +M`]:``($````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +=```````````````````````````````````````` +` +end Added: head/tests/sys/geom/class/uzip/1_endian_little.img.uzip.uue ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/uzip/1_endian_little.img.uzip.uue Wed Oct 19 10:01:04 2016 (r307625) @@ -0,0 +1,110 @@ +# +# $FreeBSD$ +# + +begin 644 1_endian_little.img.uzip +M(R$O8FEN+W-H"B-6,BXP($9OFEP?'QK +M;&1L;V%D(&=E;VU?=7II<"D^)BTF)FUO=6YT7V-D.38V,"`O9&5V+V!M9&-O +M;F9I9R`M868@)#!@+G5Z:7`@)#$*97AI="`D/PH``````````````$`````` +M0`````````*0`````````W<````````$G@````````>&````````!ZT````` +M```'U`````````?[````````""(````````(20````````AP````````")<` +M```````(O@````````CE````````"0P````````),P````````E:```````` +M"8$````````)J`````````G/````````"?8````````*'0````````I$```` +M````"FL````````*D@````````JY````````"N`````````+!P````````LN +M````````"U4````````+?`````````NC````````"\H````````+\0`````` +M``P8````````##\````````,9@````````R-````````#+0````````,VP`` +M``````T"````````#2D````````-4`````````UW````````#9X````````- +MQ0````````WL````````#A,````````..@````````YA````````#H@````` +M```.KP````````[6````````#OT````````/)`````````]+````````#W(` +M```````/F0````````_`````````#^<````````0#@```````!`U```````` +M$%P````````0@P```````!"J````````$-9XVNW4L0K",!"`X8LM$@1!!T$G +M.[JZ.W3Q#1Q\`P??H(LZ^T@^B*L/(L1+>L6L#E:0_X-KKTU"C[8Y$0`````` +M````````\"\F&G.-2F-E]X*ZK8=[*47NA8@3FZ#77MJ(-O'P"$&>(8PU'75C +M>M!E[3J?/4SS6D^#[-I9&I]WV%Z/J8;2HEMO\V+4-A[SQFI(4YV<^9KHS?3B +MTJ\]LW.NRO+RQW5:+=T^:_*]^T%YJ1]D"V)?D*QG?%5M^[YGWMY3[%?AY)S7 +M(L+2>F3QGN>R]QOM%H[]`0``````````@%Z]`'B8&[EXVNW9,4H#013&\?>2 +M1=:`J(6@E2G3"I86VW@#A=Q`P1ND,:ESD13!TB9-;F'K$3R`,+ZW^U8'42$$ +M-\W_!]_N;':&?0R9:4:D<60YM0PMH_@MF=7%WE@*D9>^B$ITL.=2FK@KO[RF +M).\I'5AST+ZSBPUKQK6=HUW9K9<]:S3]>W?7\X>ZAB+2CH]^GBK>>WL2-=1= +M5:8"=.5XIO5?^R3NN6'6+G9<9]32KK-)OG8W**_>#[(!OB](MF?\JRK6?-KMFL]/%#$4QQ3'Q3_"UL[`<](07X7V2V7;:OA_]OLY< +M9GN]V\W/T9VN,VV^;]Q[%]M?W[X<76U7KQ-DX=)];^U!=UWP^=-<:A?GN_NO +MBW^.OW;-^/-_B4\0!$$0!$$0!$$0!$$0!$$0!$$0!$'<#.+7YX]X/>_-OA$3 +M!'$[B/]+N=^;GQO.^G>&>',7^S_F%I@(7-MJ&,X#:440-XUEM@PK.TZ(\<'V +M"EMF;'[2_]>8]8WNB41ZVN'-6:_:H<-;`H72V+B4$*6#/VA-5E>NO +M-/<>>)7#D>0!1EI-!.S8&@<.I7!B`!M/GSQ>9>S#8<,]9$YIK%^!&,A4P +M][AVHB\')SQ,9)]==51GQW6&JUW>[7DQEZ)$LT': +MR%6M&BP6B%:@L`44FAN,LH6_@/Z+0JN8]Y5#$FI="JQ5\A6SR6J'-P\\5D_)305+=,\Q\"B"N`K-3D1;AU%GISTH\):%"&& +MR`6?%B:EKH+'W?$\+DF6)=>U.94Q\0QMXS%)NDCNDQQX/OGT!,YT>,&V8D&" +MC6>'.^/3(-KMP3$!```` +MPJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT, +M'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````` +M``````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````` +M``````"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"` +MMP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````! +M>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$! +M````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U +M3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`` +M``````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````` +M``````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````````` +M``"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%` +M```!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KM +MP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!```` +MPJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT, +M'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````` +M``````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````` +M``````"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"` +MMP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````! +M>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$! +M````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U +M3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`` +M``````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````` +M``````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````````` +M``"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%` +M```!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KM +MP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!```` +MPJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT, +M'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````` +M``````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````` +M``````"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"` +MMP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````! +M>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$! +M````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U +M3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`` +M``````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````` +M``````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````````` +M``"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%` +M```!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KM +MP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!```` +MPJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT, +M'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````` +M``````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````` +M``````"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"` +MMP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````! +M>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$! +M````PJ#U3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U +M3VT,'Z````````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`` +M``````````````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````` +M``````````"`MP%````!>-KMP3$!````PJ#U3VT,'Z`````````````````` +M``"`MP%````!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%` +M```!>-KMP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KM +MP3$!````PJ#U3VT,'Z````````````````````"`MP%````!>-KMT#$!```, +M`B"C&]T*>_9!!!(```````````````````!X405W`]:``($````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +2```````````````````````` +` +end Modified: head/tests/sys/geom/class/uzip/1_test.sh ============================================================================== --- head/tests/sys/geom/class/uzip/1_test.sh Wed Oct 19 09:12:14 2016 (r307624) +++ head/tests/sys/geom/class/uzip/1_test.sh Wed Oct 19 10:01:04 2016 (r307625) @@ -4,9 +4,21 @@ testsdir=$(dirname $0) . $testsdir/conf.sh +# Check host endianness +ret=$(echo I | tr -d "[:space:]" | od -to2 | head -n1 | awk '{print $2}' | cut -c6) +if [ "$ret" = "1" ]; then + # Little endian + UUE=$testsdir/1_endian_little.img.uzip.uue +elif [ "$ret" = "0" ]; then + # Big endian + UUE=$testsdir/1_endian_big.img.uzip.uue +else + echo "Couldn't detect host endianness" + exit 2 +fi + echo "1..1" -UUE=$testsdir/1.img.uzip.uue uudecode $UUE us0=$(attach_md -f $(basename $UUE .uue)) || exit 1 sleep 1 Modified: head/tests/sys/geom/class/uzip/Makefile ============================================================================== --- head/tests/sys/geom/class/uzip/Makefile Wed Oct 19 09:12:14 2016 (r307624) +++ head/tests/sys/geom/class/uzip/Makefile Wed Oct 19 10:01:04 2016 (r307625) @@ -8,7 +8,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} -IMAGE= 1.img +IMAGE= 1_endian_little.img ZIMAGE= ${IMAGE}.uzip UZIMAGE= ${ZIMAGE}.uue @@ -25,7 +25,7 @@ ${UZIMAGE}: ${IMAGE} ${ZIMAGE} printf "FreeBSD$$\n#\n\n" >> ${.TARGET} uuencode ${ZIMAGE} ${ZIMAGE} >>${.TARGET} -${PACKAGE}FILES+= conf.sh \ +${PACKAGE}FILES+= conf.sh 1_endian_big.img.uzip.uue \ ${UZIMAGE} FILESGROUPS+= etalon From owner-svn-src-head@freebsd.org Wed Oct 19 11:09:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11E8AC18457; Wed, 19 Oct 2016 11:09:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id C82C2BF2; Wed, 19 Oct 2016 11:09: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 u9JB9Tmi002728; Wed, 19 Oct 2016 11:09:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JB9TTC002727; Wed, 19 Oct 2016 11:09:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610191109.u9JB9TTC002727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Oct 2016 11:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307626 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 11:09:31 -0000 Author: kib Date: Wed Oct 19 11:09:29 2016 New Revision: 307626 URL: https://svnweb.freebsd.org/changeset/base/307626 Log: Add FFS pager, which uses buffer cache read operation to validate pages. See the comments for more detailed description of the algorithm. The pager is used unconditionally when the block size of the underlying device is larger than the machine page size, since local vnode pager cannot handle the configuration [1]. Otherwise, the vfs.ffs.use_buf_pager sysctl allows to switch to the local pager. Measurements demonstrated no regression in the ever-important buildworld benchmark, and small (~5%) throughput improvements in the special microbenchmark configuration for dbench over swap-backed md(4). Code can be generalized and reused for other filesystems which use buffer cache. Reported by: Anton Yuzhaninov [1] Tested by: pho Benchmarked by: mjg, pho Reviewed by: alc, markj, mckusick (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D8198 Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Wed Oct 19 10:01:04 2016 (r307625) +++ head/sys/ufs/ffs/ffs_vnops.c Wed Oct 19 11:09:29 2016 (r307626) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -86,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -102,8 +104,9 @@ __FBSDID("$FreeBSD$"); #ifdef DIRECTIO extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); #endif -static vop_fsync_t ffs_fsync; static vop_fdatasync_t ffs_fdatasync; +static vop_fsync_t ffs_fsync; +static vop_getpages_t ffs_getpages; static vop_lock1_t ffs_lock; static vop_read_t ffs_read; static vop_write_t ffs_write; @@ -119,13 +122,12 @@ static vop_openextattr_t ffs_openextattr static vop_setextattr_t ffs_setextattr; static vop_vptofh_t ffs_vptofh; - /* Global vfs data structures for ufs. */ struct vop_vector ffs_vnodeops1 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, - .vop_getpages = vnode_pager_local_getpages, + .vop_getpages = ffs_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, .vop_read = ffs_read, @@ -147,7 +149,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, - .vop_getpages = vnode_pager_local_getpages, + .vop_getpages = ffs_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, .vop_read = ffs_read, @@ -1784,3 +1786,165 @@ vop_vptofh { ufhp->ufid_gen = ip->i_gen; return (0); } + +SYSCTL_DECL(_vfs_ffs); +static int use_buf_pager = 1; +SYSCTL_INT(_vfs_ffs, OID_AUTO, use_buf_pager, CTLFLAG_RWTUN, &use_buf_pager, 0, + "Always use buffer pager instead of bmap"); +static int buf_pager_relbuf; +SYSCTL_INT(_vfs_ffs, OID_AUTO, buf_pager_relbuf, CTLFLAG_RWTUN, + &buf_pager_relbuf, 0, + "Make buffer pager release buffers after reading"); + +/* + * The FFS pager. It uses buffer reads to validate pages. + * + * In contrast to the generic local pager from vm/vnode_pager.c, this + * pager correctly and easily handles volumes where the underlying + * device block size is greater than the machine page size. The + * buffer cache transparently extends the requested page run to be + * aligned at the block boundary, and does the necessary bogus page + * replacements in the addends to avoid obliterating already valid + * pages. + * + * The only non-trivial issue is that the exclusive busy state for + * pages, which is assumed by the vm_pager_getpages() interface, is + * incompatible with the VMIO buffer cache's desire to share-busy the + * pages. This function performs a trivial downgrade of the pages' + * state before reading buffers, and a less trivial upgrade from the + * shared-busy to excl-busy state after the read. + */ +static int +ffs_getpages(struct vop_getpages_args *ap) +{ + struct vnode *vp; + vm_page_t *ma, m; + vm_object_t object; + struct buf *bp; + struct ufsmount *um; + ufs_lbn_t lbn, lbnp; + vm_ooffset_t la, lb; + long bsize; + int bo_bs, count, error, i; + bool redo, lpart; + + vp = ap->a_vp; + ma = ap->a_m; + count = ap->a_count; + + um = VFSTOUFS(ap->a_vp->v_mount); + bo_bs = um->um_devvp->v_bufobj.bo_bsize; + if (!use_buf_pager && bo_bs <= PAGE_SIZE) + return (vnode_pager_generic_getpages(vp, ma, count, + ap->a_rbehind, ap->a_rahead, NULL, NULL)); + + object = vp->v_object; + la = IDX_TO_OFF(ma[count - 1]->pindex); + if (la >= object->un_pager.vnp.vnp_size) + return (VM_PAGER_BAD); + lpart = la + PAGE_SIZE > object->un_pager.vnp.vnp_size; + if (ap->a_rbehind != NULL) { + lb = IDX_TO_OFF(ma[0]->pindex); + *ap->a_rbehind = OFF_TO_IDX(lb - rounddown2(lb, bo_bs)); + } + if (ap->a_rahead != NULL) { + *ap->a_rahead = OFF_TO_IDX(roundup2(la, bo_bs) - la); + if (la + IDX_TO_OFF(*ap->a_rahead) >= + object->un_pager.vnp.vnp_size) { + *ap->a_rahead = OFF_TO_IDX(roundup2(object->un_pager. + vnp.vnp_size, PAGE_SIZE) - la); + } + } + VM_OBJECT_WLOCK(object); +again: + for (i = 0; i < count; i++) + vm_page_busy_downgrade(ma[i]); + VM_OBJECT_WUNLOCK(object); + + lbnp = -1; + for (i = 0; i < count; i++) { + m = ma[i]; + + /* + * Pages are shared busy and the object lock is not + * owned, which together allow for the pages' + * invalidation. The racy test for validity avoids + * useless creation of the buffer for the most typical + * case when invalidation is not used in redo or for + * parallel read. The shared->excl upgrade loop at + * the end of the function catches the race in a + * reliable way (protected by the object lock). + */ + if (m->valid == VM_PAGE_BITS_ALL) + continue; + + lbn = lblkno(um->um_fs, IDX_TO_OFF(m->pindex)); + if (lbn != lbnp) { + bsize = blksize(um->um_fs, VTOI(vp), lbn); + error = bread_gb(vp, lbn, bsize, NOCRED, GB_UNMAPPED, + &bp); + if (error != 0) + break; + KASSERT(1 /* racy, enable for debugging */ || + m->valid == VM_PAGE_BITS_ALL || i == count - 1, + ("buf %d %p invalid", i, m)); + if (i == count - 1 && lpart) { + VM_OBJECT_WLOCK(object); + if (m->valid != 0 && + m->valid != VM_PAGE_BITS_ALL) + vm_page_zero_invalid(m, TRUE); + VM_OBJECT_WUNLOCK(object); + } + if (LIST_EMPTY(&bp->b_dep)) { + /* + * Invalidation clears m->valid, but + * may leave B_CACHE flag if the + * buffer existed at the invalidation + * time. In this case, recycle the + * buffer to do real read on next + * bread() after redo. + * + * Otherwise B_RELBUF is not strictly + * necessary, enable to reduce buf + * cache pressure. + */ + if (buf_pager_relbuf || + m->valid != VM_PAGE_BITS_ALL) + bp->b_flags |= B_RELBUF; + + bp->b_flags &= ~B_NOCACHE; + brelse(bp); + } else { + bqrelse(bp); + } + lbnp = lbn; + } + } + + VM_OBJECT_WLOCK(object); + redo = false; + for (i = 0; i < count; i++) { + vm_page_sunbusy(ma[i]); + ma[i] = vm_page_grab(object, ma[i]->pindex, VM_ALLOC_NORMAL); + + /* + * Since the pages were only sbusy while neither the + * buffer nor the object lock was held by us, or + * reallocated while vm_page_grab() slept for busy + * relinguish, they could have been invalidated. + * Recheck the valid bits and re-read as needed. + * + * Note that the last page is made fully valid in the + * read loop, and partial validity for the page at + * index count - 1 could mean that the page was + * invalidated or removed, so we must restart for + * safety as well. + */ + if (ma[i]->valid != VM_PAGE_BITS_ALL) + redo = true; + } + if (redo && error == 0) + goto again; + VM_OBJECT_WUNLOCK(object); + return (error != 0 ? VM_PAGER_ERROR : VM_PAGER_OK); +} From owner-svn-src-head@freebsd.org Wed Oct 19 11:51:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C64DC18173; Wed, 19 Oct 2016 11:51:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 15B589E3; Wed, 19 Oct 2016 11:51:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JBpINM020521; Wed, 19 Oct 2016 11:51:18 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JBpIr2020520; Wed, 19 Oct 2016 11:51:18 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201610191151.u9JBpIr2020520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 19 Oct 2016 11:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307628 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 11:51:19 -0000 Author: ae Date: Wed Oct 19 11:51:17 2016 New Revision: 307628 URL: https://svnweb.freebsd.org/changeset/base/307628 Log: Fix `ipfw table lookup` handler to return entry value, but not its index. Submitted by: loos MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Wed Oct 19 11:21:23 2016 (r307627) +++ head/sys/netpfil/ipfw/ip_fw_table.c Wed Oct 19 11:51:17 2016 (r307628) @@ -1087,6 +1087,7 @@ find_table_entry(struct ip_fw_chain *ch, struct table_config *tc; struct table_algo *ta; struct table_info *kti; + struct table_value *pval; struct namedobj_instance *ni; int error; size_t sz; @@ -1132,7 +1133,10 @@ find_table_entry(struct ip_fw_chain *ch, return (ENOTSUP); error = ta->find_tentry(tc->astate, kti, tent); - + if (error == 0) { + pval = get_table_value(ch, tc, tent->v.kidx); + ipfw_export_table_value_v1(pval, &tent->v.value); + } IPFW_UH_RUNLOCK(ch); return (error); From owner-svn-src-head@freebsd.org Wed Oct 19 12:23:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92C4AC1733F; Wed, 19 Oct 2016 12:23:03 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4A839E13; Wed, 19 Oct 2016 12:23:03 +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 u9JCN216033128; Wed, 19 Oct 2016 12:23:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JCN27P033126; Wed, 19 Oct 2016 12:23:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610191223.u9JCN27P033126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 19 Oct 2016 12:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307629 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 12:23:03 -0000 Author: br Date: Wed Oct 19 12:23:02 2016 New Revision: 307629 URL: https://svnweb.freebsd.org/changeset/base/307629 Log: Increase timeouts so tests have more chances to succeed on MIPS64EB in QEMU. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/bin/pkill/tests/pgrep-j_test.sh head/bin/pkill/tests/pkill-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Wed Oct 19 11:51:17 2016 (r307628) +++ head/bin/pkill/tests/pgrep-j_test.sh Wed Oct 19 12:23:02 2016 (r307629) @@ -54,7 +54,7 @@ fi wait name="pgrep -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -75,7 +75,7 @@ fi wait name="pgrep -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -92,7 +92,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pgrep -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & Modified: head/bin/pkill/tests/pkill-j_test.sh ============================================================================== --- head/bin/pkill/tests/pkill-j_test.sh Wed Oct 19 11:51:17 2016 (r307628) +++ head/bin/pkill/tests/pkill-j_test.sh Wed Oct 19 12:23:02 2016 (r307629) @@ -20,7 +20,7 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pkill -j " -sleep_amount=5 +sleep_amount=15 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & @@ -54,7 +54,7 @@ fi 2>/dev/null wait name="pkill -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -76,7 +76,7 @@ fi 2>/dev/null wait name="pkill -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -94,7 +94,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pkill -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & From owner-svn-src-head@freebsd.org Wed Oct 19 13:45:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1198DC18927; Wed, 19 Oct 2016 13:45:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id E0FD4267; Wed, 19 Oct 2016 13:45:52 +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 u9JDjqkg063634; Wed, 19 Oct 2016 13:45:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JDjqsl063633; Wed, 19 Oct 2016 13:45:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610191345.u9JDjqsl063633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Oct 2016 13:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307636 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 13:45:53 -0000 Author: imp Date: Wed Oct 19 13:45:51 2016 New Revision: 307636 URL: https://svnweb.freebsd.org/changeset/base/307636 Log: Document the unique requirements for upgrading more prominently. Unlike in the past (dating back to the 4.x branch point), you cannot upgrade from any point on the past couple of stable branches to -current. Due to a bug in clang that existed before r286035 in stable/9 or r286033 in stable/10, we cannot compile llvm that's in 11.x or -current. Unfortunately, these revisions are after 9.3R and 10.3R on their respective branches. stable/11 and 11.0R are not affected. This also affects the upgrade path to 11 (including 11.0R) from stable/9 and stable/10 (which would otherwise work, were it not for this bug). We also need to amend the 11.0R release notes. MFC After: 3 days Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 19 13:42:40 2016 (r307635) +++ head/UPDATING Wed Oct 19 13:45:51 2016 (r307636) @@ -29,7 +29,23 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 machines to maximize performance. (To completely disable malloc debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely disable the most expensive debugging functionality run - "ln -s 'abort:false,junk:false' /etc/malloc.conf".) + "ln -s 'abort:false,junk:false' /etc/malloc. + + +****************************** SPECIAL WARNING: ****************************** + + Due to a bug in some versions of clang that's very hard to workaround in + the upgrade process, to upgrade to -current you must first upgrade + either stable/9 after r286035 or stable/10 after r286033 or current + after r286007 (including stable/11 and 11.0-RELEASE). These revisions + post-date 10.3-RELEASE and 9.3-RELEASE, so you'll need to take the + unusual step of upgrading to the tip of the stable branch before moving + to 11 or -current via a source upgrade. stable/11 and 11.0-RELEASE + post-date the fix so you can move from them to -current. This differs + from the historical situation where one coule upgrade from anywhere on + the last couple of stable branches, so be careful. + +****************************** SPECIAL WARNING: ****************************** 20161017: The urtwn(4) driver was merged into rtwn(4) and now consists of @@ -1467,11 +1483,15 @@ COMMON ITEMS: your build attempts in an "environmental clean room", prefix all make commands with 'env -i '. See the env(1) manual page for more details. - When upgrading from one major version to another it is generally best - to upgrade to the latest code in the currently installed branch first, - then do an upgrade to the new branch. This is the best-tested upgrade - path, and has the highest probability of being successful. Please try - this approach before reporting problems with a major version upgrade. + When upgrading from one major version to another it is generally best to + upgrade to the latest code in the currently installed branch first, then + do an upgrade to the new branch. This is the best-tested upgrade path, + and has the highest probability of being successful. Please try this + approach if you encounter problems with a major version upgrade. Since + the stable 4.x branch point, one has generally been able to upgade from + anywhere in the most recent stable branch to head / current (or even the + last couple of stable branches). See the top of this file when there's + an exception. When upgrading a live system, having a root shell around before installing anything can help undo problems. Not having a root shell From owner-svn-src-head@freebsd.org Wed Oct 19 14:28:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 173D6C1867C; Wed, 19 Oct 2016 14:28:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id D0DB49D2; Wed, 19 Oct 2016 14:28:52 +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 u9JESpRO080244; Wed, 19 Oct 2016 14:28:51 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JESpoK080243; Wed, 19 Oct 2016 14:28:51 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201610191428.u9JESpoK080243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 19 Oct 2016 14:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307637 - head/sys/arm/nvidia/tegra124 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 14:28:53 -0000 Author: mmel Date: Wed Oct 19 14:28:51 2016 New Revision: 307637 URL: https://svnweb.freebsd.org/changeset/base/307637 Log: TEGRA: Raise minimum voltage for CPU, original 0.9 V was too optimistic. While I'm in, remove duplicated line from CPU frequency table. MFC after: 2 weeks Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Wed Oct 19 13:45:51 2016 (r307636) +++ head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Wed Oct 19 14:28:51 2016 (r307637) @@ -141,7 +141,7 @@ static struct speedo_entry tegra124_spee static struct cpu_volt_def tegra124_cpu_volt_pllx_def = { - .min_uvolt = 900000, /* 0.9 V */ + .min_uvolt = 1000000, /* XXX 0.9 V doesn't work on all boards */ .max_uvolt = 1260000, /* 1.26 */ .step_uvolt = 10000, /* 10 mV */ .speedo_scale = 100, @@ -172,7 +172,6 @@ static uint64_t cpu_freq_tbl[] = { 2116000000ULL, 2218000000ULL, 2320000000ULL, - 2320000000ULL, 2422000000ULL, 2524000000ULL, }; From owner-svn-src-head@freebsd.org Wed Oct 19 14:51:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46D7FC18D18; Wed, 19 Oct 2016 14:51:26 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 18F99C2A; Wed, 19 Oct 2016 14:51:26 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JEpPKW097479; Wed, 19 Oct 2016 14:51:25 GMT (envelope-from gahr@FreeBSD.org) Received: (from gahr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JEpP3v097478; Wed, 19 Oct 2016 14:51:25 GMT (envelope-from gahr@FreeBSD.org) Message-Id: <201610191451.u9JEpP3v097478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gahr set sender to gahr@FreeBSD.org using -f From: Pietro Cerutti Date: Wed, 19 Oct 2016 14:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307638 - head/usr.bin/printenv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 14:51:26 -0000 Author: gahr (ports committer) Date: Wed Oct 19 14:51:25 2016 New Revision: 307638 URL: https://svnweb.freebsd.org/changeset/base/307638 Log: Chase a cornercase in printenv and sync its behaviour with builtin's The cornercase is when printenv is passed a parameter in the form VAR=val, where VAR=val exists in the environment. In this case, printenv would print a spurious newline and returns 0. Approved by: cognet MFC after: 1 week Modified: head/usr.bin/printenv/printenv.c Modified: head/usr.bin/printenv/printenv.c ============================================================================== --- head/usr.bin/printenv/printenv.c Wed Oct 19 14:28:51 2016 (r307637) +++ head/usr.bin/printenv/printenv.c Wed Oct 19 14:51:25 2016 (r307638) @@ -83,8 +83,8 @@ main(int argc, char *argv[]) for (ep = environ; *ep; ep++) if (!memcmp(*ep, *argv, len)) { cp = *ep + len; - if (!*cp || *cp == '=') { - (void)printf("%s\n", *cp ? cp + 1 : cp); + if (*cp == '=') { + (void)printf("%s\n", cp + 1); exit(0); } } From owner-svn-src-head@freebsd.org Wed Oct 19 15:13:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87C36C183BC; Wed, 19 Oct 2016 15:13:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3FB37E44; Wed, 19 Oct 2016 15:13:09 +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 u9JFD8GQ006477; Wed, 19 Oct 2016 15:13:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JFD853006476; Wed, 19 Oct 2016 15:13:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610191513.u9JFD853006476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Oct 2016 15:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307639 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 15:13:09 -0000 Author: imp Date: Wed Oct 19 15:13:08 2016 New Revision: 307639 URL: https://svnweb.freebsd.org/changeset/base/307639 Log: After deeper software archaeology, reports that 10.3R was affected turned out to be mistaken. Adjust the entry and fix a few typos. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 19 14:51:25 2016 (r307638) +++ head/UPDATING Wed Oct 19 15:13:08 2016 (r307639) @@ -29,21 +29,22 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 machines to maximize performance. (To completely disable malloc debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely disable the most expensive debugging functionality run - "ln -s 'abort:false,junk:false' /etc/malloc. + "ln -s 'abort:false,junk:false' /etc/malloc.conf".) ****************************** SPECIAL WARNING: ****************************** Due to a bug in some versions of clang that's very hard to workaround in the upgrade process, to upgrade to -current you must first upgrade - either stable/9 after r286035 or stable/10 after r286033 or current - after r286007 (including stable/11 and 11.0-RELEASE). These revisions - post-date 10.3-RELEASE and 9.3-RELEASE, so you'll need to take the - unusual step of upgrading to the tip of the stable branch before moving - to 11 or -current via a source upgrade. stable/11 and 11.0-RELEASE - post-date the fix so you can move from them to -current. This differs - from the historical situation where one coule upgrade from anywhere on - the last couple of stable branches, so be careful. + either stable/9 after r286035 or stable/10 after r286033 (including + 10.3-RELEASE) or current after r286007 (including stable/11 and + 11.0-RELEASE). These revisions post-date the 10.2 and 9.3 releases, so + you'll need to take the unusual step of upgrading to the tip of the + stable branch before moving to 11 or -current via a source upgrade. + stable/11 and 11.0-RELEASE post-date the fix so you can move from them + to -current. This differs from the historical situation where one could + upgrade from anywhere on the last couple of stable branches, so be + careful. ****************************** SPECIAL WARNING: ****************************** From owner-svn-src-head@freebsd.org Wed Oct 19 16:23:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D0E7C1830E for ; Wed, 19 Oct 2016 16:23:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D55CDFEA for ; Wed, 19 Oct 2016 16:23:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x22b.google.com with SMTP id z190so44492610qkc.2 for ; Wed, 19 Oct 2016 09:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=opn8KNIMBVPC/fkcW2TQ4CSux44wGRjk5Iba5RX/kZs=; b=FzhG1Eq74kU7Mxb7r6KK9oxf+vtrWUqiqA5bhASXIxk7ThNZGCtWiTul30WqSswNk8 +9QQINC3CyvAp/B/GjFRgEQZlRpph6rmSQeYEx6LmqBBW8ITR+vw7fRHUriKBuLjQVYg sFG0/vYx+MKK3nPdL8w/GLsO8hrdcJhTQORAw/azIvSkjtWVFeaOsMmZo0fwd+f63Hs6 rhp8D4H7XgJnkZXWP9C0U165XypXsI2sMItEX8B+Yo3wwUsbiBNZbpxAE8uGYN2TueQ8 luTpeNsz3MHe2ClHy6tra2VIkM8Uwys/r+03iSw0NmMFl1O8+U3idBB8rfYm/tyVsf4J 0PIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=opn8KNIMBVPC/fkcW2TQ4CSux44wGRjk5Iba5RX/kZs=; b=lmfcSiqTWDeTT1rIsy2oyWo0Ez+/ug0yO7mkxZzfLh0EMQZca9nqqKosThe37fkCpR ZHHDBhWecGu/SHulTD5mlAWpbR/PVikNIGQEsMP3WYFqhX9XvPTyybuL6dZj3dWR1XR9 b8O1xrBloRvia37YRIdC/tds0lNfOZIybJiaR1F36mh4sATWnY1EhxFXCWCwuF0F2iKI eNclMg77OjwRVxX1ActR4bLAs8UPOmMW3trkq3VMsltZP4ZfNuGvmw39vzqC0uaHOAIP HoTGwVRNlMXZBIO6YsmU7itz3x/uf521dmTu80KDZCQATrAeAgjbNVF7+KIIJu23h3Fy 0VLA== X-Gm-Message-State: ABUngveKlM/CRJa8OmmEhMhOuql9wuLstI5rZig6GQnEmTY5o6GNz7GJAwlKd+UYf31Xn8HF X-Received: by 10.55.212.85 with SMTP id l82mr6983360qki.214.1476894207878; Wed, 19 Oct 2016 09:23:27 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id x35sm21137769qte.40.2016.10.19.09.23.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Oct 2016 09:23:26 -0700 (PDT) Date: Wed, 19 Oct 2016 12:23:24 -0400 From: Shawn Webb To: Luigi Rizzo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap Message-ID: <20161019162324.GA94803@mutt-hardenedbsd> References: <201610161413.u9GEDW91013522@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZPt4rx8FFjLCG7dd" Content-Disposition: inline In-Reply-To: <201610161413.u9GEDW91013522@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 16:23:29 -0000 --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 16, 2016 at 02:13:32PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Sun Oct 16 14:13:32 2016 > New Revision: 307394 > URL: https://svnweb.freebsd.org/changeset/base/307394 >=20 > Log: > Import the current version of netmap, aligned with the one on github. > =20 > This commit, long overdue, contains contributions in the last 2 years > from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, includin= g: > + fixes on monitor ports > + the 'ptnet' virtual device driver, and ptnetmap backend, for > high speed virtual passthrough on VMs (bhyve fixes in an upcoming com= mit) > + improved emulated netmap mode > + more robust error handling > + removal of stale code > + various fixes to code and documentation (some mixup between RX and TX > parameters, and private and public variables) > =20 > We also include an additional tool, nmreplay, which is functionally > equivalent to tcpreplay but operating on netmap ports. >=20 > Added: > head/tools/tools/netmap/ctrs.h (contents, props changed) > head/tools/tools/netmap/nmreplay.8 (contents, props changed) > head/tools/tools/netmap/nmreplay.c (contents, props changed) > Modified: > head/share/man/man4/netmap.4 > head/sys/conf/files > head/sys/dev/netmap/if_ixl_netmap.h > head/sys/dev/netmap/if_lem_netmap.h > head/sys/dev/netmap/ixgbe_netmap.h > head/sys/dev/netmap/netmap.c > head/sys/dev/netmap/netmap_freebsd.c > head/sys/dev/netmap/netmap_generic.c > head/sys/dev/netmap/netmap_kern.h > head/sys/dev/netmap/netmap_mbq.c > head/sys/dev/netmap/netmap_mbq.h > head/sys/dev/netmap/netmap_mem2.c > head/sys/dev/netmap/netmap_mem2.h > head/sys/dev/netmap/netmap_monitor.c > head/sys/dev/netmap/netmap_offloadings.c > head/sys/dev/netmap/netmap_pipe.c > head/sys/dev/netmap/netmap_vale.c > head/sys/modules/netmap/Makefile > head/sys/net/netmap.h > head/sys/net/netmap_user.h > head/tools/tools/netmap/Makefile > head/tools/tools/netmap/bridge.c > head/tools/tools/netmap/pkt-gen.c > head/tools/tools/netmap/vale-ctl.c Looks like this broke VIMAGE builds: /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared = identifier 'rd' CURVNET_SET(TD_TO_VNET(rd)); ^ /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared = identifier 'rd' /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared = identifier 'rd' /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared = identifier 'rd' 4 errors generated. --- netmap_freebsd.o --- *** [netmap_freebsd.o] Error code 1 Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --ZPt4rx8FFjLCG7dd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYB536AAoJEGqEZY9SRW7u5lIP/3wxJ1MjsM+GbBUYTQMv2pAW RHY8f+hqAq1B9KEenx8HomCmwrgmfId24/QFFr62LL6McG5Q3//d63W2gMIyGqj8 a7gOn+ZK79lCedsiYckPARY8CpkJ3q4X+qtDKJYWTvWzBkJsYnhRmNVm7yRP+c3W phE0DQQg+PIQMZyGxoWN+A0+Hir8u0RH4Xl1FfW2BnpaZvMLFQ2HnYh7xMaS3emS PR4II140aOn2SLvGhy04NY01HetMc4dZ8PdLspaeJYAQrH5qF/RB+KB8PUISJQPf RD21Bws1rAsahddQNv49iGtw7rit+CbP3992EYAM8xOkc0WLGFKOe5OmyBElW2Z7 r0l6Vml+JtYoLB++2TbnStJD76mk0PTMxvxwXPqK74N5uRDEB13ju7LNRlnuL8YG +3Pzv9jNG4g6ribIPF7Xz3D4tbB459Gl3UBqr4Ji4jtlVQKpDQqXzTR3JpFtukes AM0GiirOWd4q1kIBPqoc5bXk3OK1AnMwb3sdFHabtTLEBQD8Cxjys41DeZsq4Drg yWXXF3y/R7msDF8giiVFxzv9CL3cO6pY7OuSh8xgkkMuI/sCiBEwwLEaDu4bj794 5xAoJ7Ii/E671b5mAVskCiPHFn2qXR6tZFbzfP8aDwB01PVqvrcByGkNkpkX2R6l pphGFf4D9pq05ZvBYE/e =9Qvk -----END PGP SIGNATURE----- --ZPt4rx8FFjLCG7dd-- From owner-svn-src-head@freebsd.org Wed Oct 19 17:42:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6984AC1908F; Wed, 19 Oct 2016 17:42:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3904565C; Wed, 19 Oct 2016 17:42:46 +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 u9JHgjKp065111; Wed, 19 Oct 2016 17:42:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JHgj65065110; Wed, 19 Oct 2016 17:42:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610191742.u9JHgj65065110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Oct 2016 17:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307648 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 17:42:46 -0000 Author: emaste Date: Wed Oct 19 17:42:45 2016 New Revision: 307648 URL: https://svnweb.freebsd.org/changeset/base/307648 Log: Fix MK_SHAREDOCS test from r306864 Groff is needed only if MK_GROFF and MK_SHAREDOCS are both true. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 19 17:32:38 2016 (r307647) +++ head/Makefile.inc1 Wed Oct 19 17:42:45 2016 (r307648) @@ -1586,7 +1586,7 @@ _strfile= usr.bin/fortune/strfile _gperf= gnu/usr.bin/gperf .endif -.if ${MK_SHAREDOCS} != "no" || ${MK_GROFF} != "no" +.if ${MK_SHAREDOCS} != "no" && ${MK_GROFF} != "no" _groff= gnu/usr.bin/groff \ usr.bin/soelim .endif From owner-svn-src-head@freebsd.org Wed Oct 19 17:59:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EC9FC19510; Wed, 19 Oct 2016 17:59:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F6FAB3; Wed, 19 Oct 2016 17:59:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id 128so19917435pfz.0; Wed, 19 Oct 2016 10:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FeTqV8ws/n9oBArWy8lkxTiA9+qWcjIWPFo7Xr7sYns=; b=nhXV/d7wcAOeaJ2bFZ70NAtkfQKMuN6BIb8QzEplW3qgLgcc8Fao3Hc55V57L85Ikp WcjE8kE2tL/S8Tr9+eyqHvnKFHRxlaPaeEOz+F8YBXqsnL8eplZS+4KFQBUeA8pTvpmn V12/J7MdYNx+G884swIIDnPjKY/X/PenuGzBPzboOWk2xdTtXjTmE+ZFqsCuEqspDuS9 bejHx+nLA5vAKwHurn0tu/KRqITNk/GZ9FF8y+1LD5369CWuuMYRKAneG6qAmBqdqF7v 8X/nw6bDaaqxtLmkiAaTIqDWPcitHnlFdPWlrgse3gao1zZCUKEIAxvViJbysfXCb3Qy ChnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FeTqV8ws/n9oBArWy8lkxTiA9+qWcjIWPFo7Xr7sYns=; b=EKZo0gcWEnJJiJgcsjnSPZF7TUiw8cv3qM9odJLLzpBflRaBJm+yKGGfCJUqXS//O+ nVaE0dUTUCtZ8luIoZ2KvGr4eJ2dJMZtGRhNTbR8WbG6e7Nvnz/YJX9cURsMUR5eRqQX fDm+esJz+vdQmQVTUWuMFTPRTyj/iGR05bxP2q0uoxUZKAWJaw4GdnX6eel0jNlOzA9z iGwOPEHCAkAFLr8+816i6qiFxbJuE/vBNgqGv1V/T9OYvcTBuZZNIk+5r1CZzHRwpDvg opZMhq7fTwqGeXky0ns6AomMVZXZ8v6UtBGPrXJ8eZbge5Y3lIqG5+0OV80mTqk8Drf7 mKsQ== X-Gm-Message-State: AA6/9RkaJat9Xmq5ZS1wyOjtm1Nbwy5d4MLeOkOIcQy5pczm+dls8NF+BHmKzgdhxa+9PA== X-Received: by 10.99.121.133 with SMTP id u127mr11165052pgc.4.1476899942564; Wed, 19 Oct 2016 10:59:02 -0700 (PDT) Received: from ?IPv6:2607:fb90:80bb:5bf8:8135:9c53:abb9:3522? ([2607:fb90:80bb:5bf8:8135:9c53:abb9:3522]) by smtp.gmail.com with ESMTPSA id x190sm65461216pfd.20.2016.10.19.10.59.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Oct 2016 10:59:01 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r307648 - head From: Ngie Cooper X-Mailer: iPhone Mail (14A456) In-Reply-To: <201610191742.u9JHgj65065110@repo.freebsd.org> Date: Wed, 19 Oct 2016 10:59:00 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5CC7C8B0-8D03-41C8-ACBD-37DCDCD7335B@gmail.com> References: <201610191742.u9JHgj65065110@repo.freebsd.org> To: Ed Maste X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 17:59:03 -0000 > On Oct 19, 2016, at 10:42, Ed Maste wrote: >=20 > Author: emaste > Date: Wed Oct 19 17:42:45 2016 > New Revision: 307648 > URL: https://svnweb.freebsd.org/changeset/base/307648 >=20 > Log: > Fix MK_SHAREDOCS test from r306864 >=20 > Groff is needed only if MK_GROFF and MK_SHAREDOCS are both true. Thank you!! -Ngie > Modified: > head/Makefile.inc1 >=20 > Modified: head/Makefile.inc1 > =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/Makefile.inc1 Wed Oct 19 17:32:38 2016 (r307647) > +++ head/Makefile.inc1 Wed Oct 19 17:42:45 2016 (r307648) > @@ -1586,7 +1586,7 @@ _strfile=3D usr.bin/fortune/strfile > _gperf=3D gnu/usr.bin/gperf > .endif >=20 > -.if ${MK_SHAREDOCS} !=3D "no" || ${MK_GROFF} !=3D "no" > +.if ${MK_SHAREDOCS} !=3D "no" && ${MK_GROFF} !=3D "no" > _groff=3D gnu/usr.bin/groff \ > usr.bin/soelim > .endif >=20 From owner-svn-src-head@freebsd.org Wed Oct 19 18:05:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86910C197AB; Wed, 19 Oct 2016 18:05:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 632A1CB2; Wed, 19 Oct 2016 18:05:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8B37110AF92; Wed, 19 Oct 2016 14:05:39 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Doug Ambrisko , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Doug Ambrisko , Ravi Pokala Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader Date: Wed, 19 Oct 2016 10:34:49 -0700 Message-ID: <1660864.e2huCtGy6v@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201610141710.u9EHArlL089412@repo.freebsd.org> <3841347.BNPZXPm7N3@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 19 Oct 2016 14:05:39 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 18:05:47 -0000 On Wednesday, October 19, 2016 02:01:18 AM Warner Losh wrote: > One of my systems would export these as sysctls: > > smbios.bios.reldate="07/05/2013" > smbios.bios.vendor="American Megatrends Inc." > smbios.bios.version="3.00" > smbios.chassis.maker="Supermicro" > smbios.chassis.serial="0123456789" > smbios.chassis.tag="To Be Filled By O.E.M." > smbios.chassis.version="0123456789" > smbios.memory.enabled="268435456" > smbios.planar.location="To be filled by O.E.M." > smbios.planar.maker="Supermicro" > smbios.planar.product="X9SRH-7F/7TF" > smbios.planar.serial="VM13CS028237" > smbios.planar.tag="To be filled by O.E.M." > smbios.planar.version="0123456789" > smbios.socket.enabled="1" > smbios.socket.populated="1" > smbios.system.family="To be filled by O.E.M." > smbios.system.maker="Supermicro" > smbios.system.product="X9SRH-7F/7TF" > smbios.system.serial="0123456789" > smbios.system.sku="To be filled by O.E.M." > smbios.system.uuid="00000000-0000-0000-0000-002590e4d0ec" > smbios.system.version="0123456789" > smbios.version="2.7" > > though some of them are silly due to the BIOS writer being silly... So are you planning to just duplicate the existing kenv vars as sysctl nodes? Can't you parse the output of kenv instead? -- John Baldwin From owner-svn-src-head@freebsd.org Wed Oct 19 18:15:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD269C19C1D; Wed, 19 Oct 2016 18:15:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6C623924; Wed, 19 Oct 2016 18:15:45 +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 u9JIFiHt077438; Wed, 19 Oct 2016 18:15:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JIFi1d077437; Wed, 19 Oct 2016 18:15:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610191815.u9JIFi1d077437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Oct 2016 18:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307649 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 18:15:45 -0000 Author: kib Date: Wed Oct 19 18:15:44 2016 New Revision: 307649 URL: https://svnweb.freebsd.org/changeset/base/307649 Log: Partial workaround for Intel PCI adapters reading past the end of the host-programmed DMA regions. This change seemingly fixes the descriptor fetches, but the packet memory accesses are left problematic. Reviewed by: emaste, erj, sbruno Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D8282 Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Oct 19 17:42:45 2016 (r307648) +++ head/sys/dev/e1000/if_lem.c Wed Oct 19 18:15:44 2016 (r307649) @@ -543,8 +543,16 @@ lem_attach(device_t dev) */ adapter->hw.mac.report_tx_early = 1; - tsize = roundup2(adapter->num_tx_desc * sizeof(struct e1000_tx_desc), - EM_DBA_ALIGN); + /* + * It seems that the descriptor DMA engine on some PCI cards + * fetches memory past the end of the last descriptor in the + * ring. These reads are problematic when VT-d (DMAR) busdma + * is used. Allocate the scratch space to avoid getting + * faults from DMAR, by requesting scratch memory for one more + * descriptor. + */ + tsize = roundup2((adapter->num_tx_desc + 1) * + sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); /* Allocate Transmit Descriptor ring */ if (lem_dma_malloc(adapter, tsize, &adapter->txdma, BUS_DMA_NOWAIT)) { @@ -555,8 +563,11 @@ lem_attach(device_t dev) adapter->tx_desc_base = (struct e1000_tx_desc *)adapter->txdma.dma_vaddr; - rsize = roundup2(adapter->num_rx_desc * sizeof(struct e1000_rx_desc), - EM_DBA_ALIGN); + /* + * See comment above txdma allocation for rationale behind +1. + */ + rsize = roundup2((adapter->num_rx_desc + 1) * + sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); /* Allocate Receive Descriptor ring */ if (lem_dma_malloc(adapter, rsize, &adapter->rxdma, BUS_DMA_NOWAIT)) { From owner-svn-src-head@freebsd.org Wed Oct 19 18:29:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A246C18135; Wed, 19 Oct 2016 18:29:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 204DF2D8; Wed, 19 Oct 2016 18:29:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JITqrt081247; Wed, 19 Oct 2016 18:29:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JITqhm081246; Wed, 19 Oct 2016 18:29:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201610191829.u9JITqhm081246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Oct 2016 18:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307650 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 18:29:53 -0000 Author: mjg Date: Wed Oct 19 18:29:52 2016 New Revision: 307650 URL: https://svnweb.freebsd.org/changeset/base/307650 Log: cache: split negative entry LRU into multiple lists This splits the ncneg_mtx lock while preserving the hit ratio at least during buildworld. Create N dedicated lists for new negative entries. Entries with at least one hit get promoted to the hot list, where they get requeued every M hits. Shrinking demotes one hot entry and performs a round-robin shrinking of regular lists. Reviewed by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Oct 19 18:15:44 2016 (r307649) +++ head/sys/kern/vfs_cache.c Wed Oct 19 18:29:52 2016 (r307650) @@ -84,8 +84,10 @@ SDT_PROBE_DEFINE1(vfs, namecache, purge_ SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", - "char *"); +SDT_PROBE_DEFINE3(vfs, namecache, zap_negative, done, "struct vnode *", + "char *", "int"); +SDT_PROBE_DEFINE3(vfs, namecache, shrink_negative, done, "struct vnode *", + "char *", "int"); /* * This structure describes the elements in the cache of recent @@ -97,7 +99,10 @@ struct namecache { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ - struct vnode *nc_vp; /* vnode the name refers to */ + union { + struct vnode *nu_vp; /* vnode the name refers to */ + u_int nu_neghits; /* negative entry hits */ + } n_un; u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ char nc_name[0]; /* segment name + nul */ @@ -116,7 +121,10 @@ struct namecache_ts { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ - struct vnode *nc_vp; /* vnode the name refers to */ + union { + struct vnode *nu_vp; /* vnode the name refers to */ + u_int nu_neghits; /* negative entry hits */ + } n_un; u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ struct timespec nc_time; /* timespec provided by fs */ @@ -125,6 +133,9 @@ struct namecache_ts { char nc_name[0]; /* segment name + nul */ }; +#define nc_vp n_un.nu_vp +#define nc_neghits n_un.nu_neghits + /* * Flags in namecache.nc_flag */ @@ -133,6 +144,8 @@ struct namecache_ts { #define NCF_TS 0x04 #define NCF_DTS 0x08 #define NCF_DVDROP 0x10 +#define NCF_NEGATIVE 0x20 +#define NCF_HOTNEGATIVE 0x40 /* * Name caching works as follows: @@ -154,7 +167,7 @@ struct namecache_ts { * NAME TYPE ROLE * vnodelock mtx vnode lists and v_cache_dd field protection * bucketlock rwlock for access to given set of hash buckets - * ncneg_mtx mtx negative entry LRU management + * neglist mtx negative entry LRU management * * Additionally, ncneg_shrink_lock mtx is used to have at most one thread * shrinking the LRU list. @@ -188,7 +201,6 @@ struct namecache_ts { #define NCHHASH(hash) \ (&nchashtbl[(hash) & nchash]) static LIST_HEAD(nchashhead, namecache) *nchashtbl; /* Hash Table */ -static TAILQ_HEAD(, namecache) ncneg; /* Hash Table */ static u_long nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "Size of namecache hash table"); @@ -210,6 +222,9 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor static u_int ncpurgeminvnodes; SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_RW, &ncpurgeminvnodes, 0, "Number of vnodes below which purgevfs ignores the request"); +static u_int ncneghitsrequeue = 8; +SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_RW, &ncneghitsrequeue, 0, + "Number of hits to requeue a negative entry in the LRU list"); struct nchstats nchstats; /* cache effectiveness statistics */ @@ -217,8 +232,23 @@ static struct mtx ncneg_shrink_loc MTX_SYSINIT(vfscache_shrink_neg, &ncneg_shrink_lock, "Name Cache shrink neg", MTX_DEF); -static struct mtx_padalign ncneg_mtx; -MTX_SYSINIT(vfscache_neg, &ncneg_mtx, "ncneg", MTX_DEF); +struct neglist { + struct mtx nl_lock; + TAILQ_HEAD(, namecache) nl_list; +} __aligned(CACHE_LINE_SIZE); + +static struct neglist *neglists; +static struct neglist ncneg_hot; + +static int shrink_list_turn; + +static u_int numneglists; +static inline struct neglist * +NCP2NEGLIST(struct namecache *ncp) +{ + + return (&neglists[(((uintptr_t)(ncp) >> 8) % numneglists)]); +} static u_int numbucketlocks; static struct rwlock_padalign *bucketlocks; @@ -623,78 +653,187 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, n /* * Negative entries management + * + * A variation of LRU scheme is used. New entries are hashed into one of + * numneglists cold lists. Entries get promoted to the hot list on first hit. + * Partial LRU for the hot list is maintained by requeueing them every + * ncneghitsrequeue hits. + * + * The shrinker will demote hot list head and evict from the cold list in a + * round-robin manner. */ static void cache_negative_hit(struct namecache *ncp) { + struct neglist *neglist; + u_int hits; - MPASS(ncp->nc_vp == NULL); - mtx_lock(&ncneg_mtx); - TAILQ_REMOVE(&ncneg, ncp, nc_dst); - TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); - mtx_unlock(&ncneg_mtx); + MPASS(ncp->nc_flag & NCF_NEGATIVE); + hits = atomic_fetchadd_int(&ncp->nc_neghits, 1); + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + if ((hits % ncneghitsrequeue) != 0) + return; + mtx_lock(&ncneg_hot.nl_lock); + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); + mtx_unlock(&ncneg_hot.nl_lock); + return; + } + /* + * The shrinker cleared the flag and removed the entry from + * the hot list. Put it back. + */ + } else { + mtx_lock(&ncneg_hot.nl_lock); + } + neglist = NCP2NEGLIST(ncp); + mtx_lock(&neglist->nl_lock); + if (!(ncp->nc_flag & NCF_HOTNEGATIVE)) { + TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); + ncp->nc_flag |= NCF_HOTNEGATIVE; + } + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); } static void -cache_negative_insert(struct namecache *ncp) +cache_negative_insert(struct namecache *ncp, bool neg_locked) { + struct neglist *neglist; - MPASS(ncp->nc_vp == NULL); + MPASS(ncp->nc_flag & NCF_NEGATIVE); cache_assert_bucket_locked(ncp, RA_WLOCKED); - mtx_lock(&ncneg_mtx); - TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); - numneg++; - mtx_unlock(&ncneg_mtx); + neglist = NCP2NEGLIST(ncp); + if (!neg_locked) { + mtx_lock(&neglist->nl_lock); + } else { + mtx_assert(&neglist->nl_lock, MA_OWNED); + } + TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); + if (!neg_locked) + mtx_unlock(&neglist->nl_lock); + atomic_add_rel_long(&numneg, 1); } static void cache_negative_remove(struct namecache *ncp, bool neg_locked) { + struct neglist *neglist; + bool hot_locked = false; + bool list_locked = false; - MPASS(ncp->nc_vp == NULL); + MPASS(ncp->nc_flag & NCF_NEGATIVE); cache_assert_bucket_locked(ncp, RA_WLOCKED); - if (!neg_locked) - mtx_lock(&ncneg_mtx); - else - mtx_assert(&ncneg_mtx, MA_OWNED); - TAILQ_REMOVE(&ncneg, ncp, nc_dst); - numneg--; - if (!neg_locked) - mtx_unlock(&ncneg_mtx); + neglist = NCP2NEGLIST(ncp); + if (!neg_locked) { + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + hot_locked = true; + mtx_lock(&ncneg_hot.nl_lock); + if (!(ncp->nc_flag & NCF_HOTNEGATIVE)) { + list_locked = true; + mtx_lock(&neglist->nl_lock); + } + } else { + list_locked = true; + mtx_lock(&neglist->nl_lock); + } + } else { + mtx_assert(&neglist->nl_lock, MA_OWNED); + mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); + } + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + } else { + TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); + } + if (list_locked) + mtx_unlock(&neglist->nl_lock); + if (hot_locked) + mtx_unlock(&ncneg_hot.nl_lock); + atomic_subtract_rel_long(&numneg, 1); +} + +static void +cache_negative_shrink_select(int start, struct namecache **ncpp, + struct neglist **neglistpp) +{ + struct neglist *neglist; + struct namecache *ncp; + int i; + + for (i = start; i < numneglists; i++) { + neglist = &neglists[i]; + if (TAILQ_FIRST(&neglist->nl_list) == NULL) + continue; + mtx_lock(&neglist->nl_lock); + ncp = TAILQ_FIRST(&neglist->nl_list); + if (ncp != NULL) + break; + mtx_unlock(&neglist->nl_lock); + } + + *neglistpp = neglist; + *ncpp = ncp; } static void cache_negative_zap_one(void) { - struct namecache *ncp, *ncp2; + struct namecache *ncp, *ncp2, *ncpc; + struct neglist *neglist; struct mtx *dvlp; struct rwlock *blp; if (!mtx_trylock(&ncneg_shrink_lock)) return; - mtx_lock(&ncneg_mtx); - ncp = TAILQ_FIRST(&ncneg); + ncpc = NULL; + mtx_lock(&ncneg_hot.nl_lock); + ncp = TAILQ_FIRST(&ncneg_hot.nl_list); + if (ncp != NULL) { + neglist = NCP2NEGLIST(ncp); + mtx_lock(&neglist->nl_lock); + TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); + ncp->nc_flag &= ~NCF_HOTNEGATIVE; + mtx_unlock(&neglist->nl_lock); + } + + cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); + shrink_list_turn++; + if (shrink_list_turn == numneglists) + shrink_list_turn = 0; + if (ncp == NULL && shrink_list_turn == 0) + cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); if (ncp == NULL) { - mtx_unlock(&ncneg_mtx); + mtx_unlock(&ncneg_hot.nl_lock); goto out; } - MPASS(ncp->nc_vp == NULL); + + MPASS(ncp->nc_flag & NCF_NEGATIVE); dvlp = VP2VNODELOCK(ncp->nc_dvp); blp = NCP2BUCKETLOCK(ncp); - mtx_unlock(&ncneg_mtx); + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); mtx_lock(dvlp); rw_wlock(blp); - mtx_lock(&ncneg_mtx); - ncp2 = TAILQ_FIRST(&ncneg); + mtx_lock(&ncneg_hot.nl_lock); + mtx_lock(&neglist->nl_lock); + ncp2 = TAILQ_FIRST(&neglist->nl_list); if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || - blp != NCP2BUCKETLOCK(ncp2) || ncp2->nc_vp != NULL) { + blp != NCP2BUCKETLOCK(ncp2) || !(ncp2->nc_flag & NCF_NEGATIVE)) { ncp = NULL; goto out_unlock_all; } + SDT_PROBE3(vfs, namecache, shrink_negative, done, ncp->nc_dvp, + nc_get_name(ncp), ncp->nc_neghits); + cache_zap_locked(ncp, true); out_unlock_all: - mtx_unlock(&ncneg_mtx); + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); rw_wunlock(blp); mtx_unlock(dvlp); out: @@ -712,17 +851,19 @@ static void cache_zap_locked(struct namecache *ncp, bool neg_locked) { - cache_assert_vnode_locked(ncp->nc_vp); + if (!(ncp->nc_flag & NCF_NEGATIVE)) + cache_assert_vnode_locked(ncp->nc_vp); cache_assert_vnode_locked(ncp->nc_dvp); cache_assert_bucket_locked(ncp, RA_WLOCKED); - CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); - if (ncp->nc_vp != NULL) { + CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, + (ncp->nc_flag & NCF_NEGATIVE) ? NULL : ncp->nc_vp); + if (!(ncp->nc_flag & NCF_NEGATIVE)) { SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, nc_get_name(ncp), ncp->nc_vp); } else { - SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, - nc_get_name(ncp)); + SDT_PROBE3(vfs, namecache, zap_negative, done, ncp->nc_dvp, + nc_get_name(ncp), ncp->nc_neghits); } LIST_REMOVE(ncp, nc_hash); if (ncp->nc_flag & NCF_ISDOTDOT) { @@ -735,7 +876,7 @@ cache_zap_locked(struct namecache *ncp, atomic_subtract_rel_long(&numcachehv, 1); } } - if (ncp->nc_vp) { + if (!(ncp->nc_flag & NCF_NEGATIVE)) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); if (ncp == ncp->nc_vp->v_cache_dd) ncp->nc_vp->v_cache_dd = NULL; @@ -751,7 +892,7 @@ cache_zap_negative_locked_vnode_kl(struc struct rwlock *blp; MPASS(ncp->nc_dvp == vp); - MPASS(ncp->nc_vp == NULL); + MPASS(ncp->nc_flag & NCF_NEGATIVE); cache_assert_vnode_locked(vp); blp = NCP2BUCKETLOCK(ncp); @@ -770,7 +911,7 @@ cache_zap_locked_vnode_kl2(struct nameca MPASS(vp == ncp->nc_dvp || vp == ncp->nc_vp); cache_assert_vnode_locked(vp); - if (ncp->nc_vp == NULL) { + if (ncp->nc_flag & NCF_NEGATIVE) { if (*vlpp != NULL) { mtx_unlock(*vlpp); *vlpp = NULL; @@ -829,7 +970,7 @@ cache_zap_locked_vnode(struct namecache cache_assert_vnode_locked(vp); pvlp = VP2VNODELOCK(vp); - if (ncp->nc_vp == NULL) { + if (ncp->nc_flag & NCF_NEGATIVE) { cache_zap_negative_locked_vnode_kl(ncp, vp); goto out; } @@ -865,7 +1006,9 @@ cache_zap_rlocked_bucket(struct namecach cache_assert_bucket_locked(ncp, RA_RLOCKED); dvlp = VP2VNODELOCK(ncp->nc_dvp); - vlp = VP2VNODELOCK(ncp->nc_vp); + vlp = NULL; + if (!(ncp->nc_flag & NCF_NEGATIVE)) + vlp = VP2VNODELOCK(ncp->nc_vp); if (cache_trylock_vnodes(dvlp, vlp) == 0) { rw_runlock(blp); rw_wlock(blp); @@ -888,7 +1031,9 @@ cache_zap_wlocked_bucket_kl(struct namec cache_assert_bucket_locked(ncp, RA_WLOCKED); dvlp = VP2VNODELOCK(ncp->nc_dvp); - vlp = VP2VNODELOCK(ncp->nc_vp); + vlp = NULL; + if (!(ncp->nc_flag & NCF_NEGATIVE)) + vlp = VP2VNODELOCK(ncp->nc_vp); cache_sort(&dvlp, &vlp); if (*vlpp1 == dvlp && *vlpp2 == vlp) { @@ -1034,9 +1179,12 @@ retry_dotdot: } return (0); } - if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) - *vpp = ncp->nc_vp; - else + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { + if (ncp->nc_flag & NCF_NEGATIVE) + *vpp = NULL; + else + *vpp = ncp->nc_vp; + } else *vpp = ncp->nc_dvp; /* Return failure if negative entry was found. */ if (*vpp == NULL) @@ -1084,7 +1232,7 @@ retry_dotdot: } /* We found a "positive" match, return the vnode */ - if (ncp->nc_vp) { + if (!(ncp->nc_flag & NCF_NEGATIVE)) { counter_u64_add(numposhits, 1); *vpp = ncp->nc_vp; CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", @@ -1226,8 +1374,7 @@ cache_lock_vnodes_cel_3(struct celocksta MPASS(cel->vlp[2] == NULL); vlp = VP2VNODELOCK(vp); - if (vlp == NULL) - return (true); + MPASS(vlp != NULL); ret = true; if (vlp >= cel->vlp[1]) { @@ -1312,6 +1459,8 @@ cache_enter_lock(struct celockstate *cel break; MPASS(ncp->nc_dvp == vp); blps[1] = NCP2BUCKETLOCK(ncp); + if (ncp->nc_flag & NCF_NEGATIVE) + break; if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp)) break; /* @@ -1349,6 +1498,8 @@ cache_enter_lock_dd(struct celockstate * break; MPASS(ncp->nc_dvp == dvp); blps[1] = NCP2BUCKETLOCK(ncp); + if (ncp->nc_flag & NCF_NEGATIVE) + break; if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp)) break; if (ncp == dvp->v_cache_dd && @@ -1383,9 +1534,11 @@ cache_enter_time(struct vnode *dvp, stru struct namecache *ncp, *n2, *ndd; struct namecache_ts *n3; struct nchashhead *ncpp; + struct neglist *neglist; uint32_t hash; int flag; int len; + bool neg_locked; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, @@ -1421,17 +1574,31 @@ cache_enter_time(struct vnode *dvp, stru ncp->nc_flag & NCF_ISDOTDOT) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); - if (ncp->nc_vp != NULL) { + neg_locked = false; + if (ncp->nc_flag & NCF_NEGATIVE || vp == NULL) { + neglist = NCP2NEGLIST(ncp); + mtx_lock(&ncneg_hot.nl_lock); + mtx_lock(&neglist->nl_lock); + neg_locked = true; + } + if (!(ncp->nc_flag & NCF_NEGATIVE)) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); } else { - cache_negative_remove(ncp, false); + cache_negative_remove(ncp, true); } if (vp != NULL) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); + ncp->nc_flag &= ~(NCF_NEGATIVE|NCF_HOTNEGATIVE); } else { - cache_negative_insert(ncp); + ncp->nc_flag &= ~(NCF_HOTNEGATIVE); + ncp->nc_flag |= NCF_NEGATIVE; + cache_negative_insert(ncp, true); + } + if (neg_locked) { + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); } ncp->nc_vp = vp; cache_enter_unlock(&cel); @@ -1450,9 +1617,11 @@ cache_enter_time(struct vnode *dvp, stru * namecache entry as possible before acquiring the lock. */ ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); + ncp->nc_flag = flag; ncp->nc_vp = vp; + if (vp == NULL) + ncp->nc_flag |= NCF_NEGATIVE; ncp->nc_dvp = dvp; - ncp->nc_flag = flag; if (tsp != NULL) { n3 = (struct namecache_ts *)ncp; n3->nc_time = *tsp; @@ -1490,7 +1659,11 @@ cache_enter_time(struct vnode *dvp, stru n3->nc_dotdottime = ((struct namecache_ts *)ncp)-> nc_dotdottime; + if (ncp->nc_flag & NCF_NEGATIVE) + mtx_lock(&ncneg_hot.nl_lock); n3->nc_flag |= NCF_DTS; + if (ncp->nc_flag & NCF_NEGATIVE) + mtx_unlock(&ncneg_hot.nl_lock); } } goto out_unlock_free; @@ -1557,7 +1730,7 @@ cache_enter_time(struct vnode *dvp, stru } else { if (cnp->cn_flags & ISWHITEOUT) ncp->nc_flag |= NCF_WHITE; - cache_negative_insert(ncp); + cache_negative_insert(ncp, false); SDT_PROBE2(vfs, namecache, enter_negative, done, dvp, nc_get_name(ncp)); } @@ -1591,8 +1764,6 @@ nchinit(void *dummy __unused) { u_int i; - TAILQ_INIT(&ncneg); - cache_zone_small = uma_zcreate("S VFS Cache", sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); @@ -1619,6 +1790,16 @@ nchinit(void *dummy __unused) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); ncpurgeminvnodes = numbucketlocks; + numneglists = 4; + neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, + M_WAITOK | M_ZERO); + for (i = 0; i < numneglists; i++) { + mtx_init(&neglists[i].nl_lock, "ncnegl", NULL, MTX_DEF); + TAILQ_INIT(&neglists[i].nl_list); + } + mtx_init(&ncneg_hot.nl_lock, "ncneglh", NULL, MTX_DEF); + TAILQ_INIT(&ncneg_hot.nl_list); + numcalls = counter_u64_alloc(M_WAITOK); dothits = counter_u64_alloc(M_WAITOK); dotdothits = counter_u64_alloc(M_WAITOK); @@ -1741,7 +1922,7 @@ cache_purge_negative(struct vnode *vp) vlp = VP2VNODELOCK(vp); mtx_lock(vlp); LIST_FOREACH_SAFE(ncp, &vp->v_cache_src, nc_src, nnp) { - if (ncp->nc_vp != NULL) + if (!(ncp->nc_flag & NCF_NEGATIVE)) continue; cache_zap_negative_locked_vnode_kl(ncp, vp); TAILQ_INSERT_TAIL(&ncps, ncp, nc_dst); From owner-svn-src-head@freebsd.org Wed Oct 19 18:45:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2F3C1876F; Wed, 19 Oct 2016 18:45: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 mx1.freebsd.org (Postfix) with ESMTPS id 8688FFFE; Wed, 19 Oct 2016 18:45:07 +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 u9JIj6Cr088748; Wed, 19 Oct 2016 18:45:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JIj6p3088747; Wed, 19 Oct 2016 18:45:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201610191845.u9JIj6p3088747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Oct 2016 18:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307651 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 18:45:07 -0000 Author: hselasky Date: Wed Oct 19 18:45:06 2016 New Revision: 307651 URL: https://svnweb.freebsd.org/changeset/base/307651 Log: Add support for adjusting the hardware buffering delay for USB audio. Requested by: Goran Mekic MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Oct 19 18:29:52 2016 (r307650) +++ head/sys/dev/sound/usb/uaudio.c Wed Oct 19 18:45:06 2016 (r307651) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); static int uaudio_default_rate = 0; /* use rate list */ static int uaudio_default_bits = 32; static int uaudio_default_channels = 0; /* use default */ +static int uaudio_buffer_ms = 8; #ifdef USB_DEBUG static int uaudio_debug = 0; @@ -109,9 +110,32 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def &uaudio_default_bits, 0, "uaudio default sample bits"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RWTUN, &uaudio_default_channels, 0, "uaudio default sample channels"); + +static int +uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS) +{ + int err, val; + + val = uaudio_buffer_ms; + err = sysctl_handle_int(oidp, &val, 0, req); + + if (err != 0 || req->newptr == NULL || val == uaudio_buffer_ms) + return (err); + + if (val > 8) + val = 8; + else if (val < 2) + val = 2; + + uaudio_buffer_ms = val; + + return (0); +} +SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN, + 0, sizeof(int), uaudio_buffer_ms_sysctl, "I", + "uaudio buffering delay from 2ms to 8ms"); #endif -#define UAUDIO_IRQS (8000 / UAUDIO_NFRAMES) /* interrupts per second */ #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 255 /* rounds */ @@ -1278,10 +1302,10 @@ uaudio_configure_msg_sub(struct uaudio_s if (fps < 8000) { /* FULL speed USB */ - frames = 8; + frames = uaudio_buffer_ms; } else { /* HIGH speed USB */ - frames = UAUDIO_NFRAMES; + frames = uaudio_buffer_ms * 8; } fps_shift = usbd_xfer_get_fps_shift(chan->xfer[0]); @@ -2158,8 +2182,9 @@ tr_setup: } /* start the SYNC transfer one time per second, if any */ - if (++(ch->intr_counter) >= UAUDIO_IRQS) { - ch->intr_counter = 0; + ch->intr_counter += ch->intr_frames; + if (ch->intr_counter >= ch->frames_per_second) { + ch->intr_counter -= ch->frames_per_second; usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); } From owner-svn-src-head@freebsd.org Wed Oct 19 19:32:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F409C175E4; Wed, 19 Oct 2016 19:32:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id E2E13FB5; Wed, 19 Oct 2016 19:32:07 +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 u9JJW7pM005034; Wed, 19 Oct 2016 19:32:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JJW7C4005033; Wed, 19 Oct 2016 19:32:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610191932.u9JJW7C4005033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Oct 2016 19:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307652 - head/gnu/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 19:32:08 -0000 Author: emaste Date: Wed Oct 19 19:32:06 2016 New Revision: 307652 URL: https://svnweb.freebsd.org/changeset/base/307652 Log: Switch gnu/lib/Makefile to SUBDIR.${MK_*} optional subdir style Compound conditions are left unchanged Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Wed Oct 19 18:45:06 2016 (r307651) +++ head/gnu/lib/Makefile Wed Oct 19 19:32:06 2016 (r307652) @@ -5,18 +5,9 @@ SUBDIR= csu libgcc libregex SUBDIR.${MK_DIALOG}+= libdialog - -.if ${MK_GCC} != "no" -SUBDIR+= libgcov libgomp -.endif - -.if ${MK_SSP} != "no" -SUBDIR+= libssp -.endif - -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_GCC}+= libgcov libgomp +SUBDIR.${MK_SSP}+= libssp +SUBDIR.${MK_TESTS}+= tests .if ${MK_BINUTILS} != "no" && ${MK_GDB} != "no" SUBDIR+= libreadline From owner-svn-src-head@freebsd.org Wed Oct 19 19:42:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1B1FC177B9; Wed, 19 Oct 2016 19:42:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A3ED5817; Wed, 19 Oct 2016 19:42:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JJg11K011584; Wed, 19 Oct 2016 19:42:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JJg1e9011581; Wed, 19 Oct 2016 19:42:01 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201610191942.u9JJg1e9011581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Oct 2016 19:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307653 - in head/sys: kern x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 19:42:02 -0000 Author: mjg Date: Wed Oct 19 19:42:01 2016 New Revision: 307653 URL: https://svnweb.freebsd.org/changeset/base/307653 Log: Mark a bunch of mpsafe sysctls as such. This gives me a sysctl Giant-free buildworld. Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_mib.c head/sys/x86/x86/identcpu.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Oct 19 19:32:06 2016 (r307652) +++ head/sys/kern/kern_exec.c Wed Oct 19 19:42:01 2016 (r307653) @@ -118,14 +118,14 @@ static int do_execve(struct thread *td, struct mac *mac_p); /* XXX This should be vm_size_t. */ -SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD, - NULL, 0, sysctl_kern_ps_strings, "LU", ""); +SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD| + CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU", ""); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD| - CTLFLAG_CAPRD, NULL, 0, sysctl_kern_usrstack, "LU", ""); + CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU", ""); -SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD, +SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_stackprot, "I", ""); u_long ps_arg_cache_limit = PAGE_SIZE / 16; Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Wed Oct 19 19:32:06 2016 (r307652) +++ head/sys/kern/kern_mib.c Wed Oct 19 19:42:01 2016 (r307653) @@ -135,7 +135,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE, kernelname, sizeof kernelname, "Name of kernel file booted"); SYSCTL_INT(_kern, KERN_MAXPHYS, maxphys, CTLFLAG_RD | CTLFLAG_CAPRD, @@ -257,8 +257,9 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR return (error); } -SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine_arch, "A", + "System architecture"); SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, #ifdef COMPAT_FREEBSD32 @@ -386,8 +387,8 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, secur /* Actual kernel configuration options. */ extern char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0, - "Kernel configuration file"); +SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD | CTLFLAG_MPSAFE, + kernconfstring, 0, "Kernel configuration file"); #endif static int Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Wed Oct 19 19:32:06 2016 (r307652) +++ head/sys/x86/x86/identcpu.c Wed Oct 19 19:42:01 2016 (r307653) @@ -148,15 +148,15 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_hw_machine, "A", "Machine class"); +SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); #else SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); #endif static char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE, cpu_model, 0, "Machine model"); static int hw_clockrate; @@ -165,8 +165,8 @@ SYSCTL_INT(_hw, OID_AUTO, clockrate, CTL u_int hv_high; char hv_vendor[16]; -SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0, - "Hypervisor vendor"); +SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD | CTLFLAG_MPSAFE, hv_vendor, + 0, "Hypervisor vendor"); static eventhandler_tag tsc_post_tag; From owner-svn-src-head@freebsd.org Wed Oct 19 19:50:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD8E4C17A7D; Wed, 19 Oct 2016 19:50:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7A57AC31; Wed, 19 Oct 2016 19:50:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JJo9OC011927; Wed, 19 Oct 2016 19:50:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JJo9WN011926; Wed, 19 Oct 2016 19:50:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201610191950.u9JJo9WN011926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 19 Oct 2016 19:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307654 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 19:50:10 -0000 Author: glebius Date: Wed Oct 19 19:50:09 2016 New Revision: 307654 URL: https://svnweb.freebsd.org/changeset/base/307654 Log: Fix incorrect assertion that could miss overflows. Reviewed by: kib Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed Oct 19 19:42:01 2016 (r307653) +++ head/sys/vm/vnode_pager.c Wed Oct 19 19:50:09 2016 (r307654) @@ -953,7 +953,7 @@ vnode_pager_generic_getpages(struct vnod if (a_rahead) *a_rahead = bp->b_pgafter; - KASSERT(bp->b_npages <= sizeof(bp->b_pages), + KASSERT(bp->b_npages <= nitems(bp->b_pages), ("%s: buf %p overflowed", __func__, bp)); /* From owner-svn-src-head@freebsd.org Wed Oct 19 19:57:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68C45C17D09; Wed, 19 Oct 2016 19:57:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3813F10DB; Wed, 19 Oct 2016 19:57:37 +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 u9JJvakL015708; Wed, 19 Oct 2016 19:57:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JJvaA2015707; Wed, 19 Oct 2016 19:57:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610191957.u9JJvaA2015707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Oct 2016 19:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307655 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 19:57:37 -0000 Author: emaste Date: Wed Oct 19 19:57:36 2016 New Revision: 307655 URL: https://svnweb.freebsd.org/changeset/base/307655 Log: Force MK_GDB to no if MK_BINUTILS == no This is currently encoded in conditional blocks in gnu/lib/Makefile and gnu/usr.bin/Makefile. Set it via src.opts.mk to make GDB's dependency on binutils more clear. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Oct 19 19:50:09 2016 (r307654) +++ head/share/mk/src.opts.mk Wed Oct 19 19:57:36 2016 (r307655) @@ -300,6 +300,10 @@ MK_${var}:= no MK_LLVM_LIBUNWIND:= no .endif +.if ${MK_BINUTILS} == "no" +MK_GDB:= no +.endif + .if ${MK_LIBPTHREAD} == "no" MK_LIBTHR:= no .endif From owner-svn-src-head@freebsd.org Wed Oct 19 20:26:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9831CC18495; Wed, 19 Oct 2016 20:26:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5925C1FB2; Wed, 19 Oct 2016 20:26:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id EB9BC35; Wed, 19 Oct 2016 22:26:56 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id DA93428494; Wed, 19 Oct 2016 22:26:56 +0200 (CEST) Date: Wed, 19 Oct 2016 22:26:56 +0200 From: Jilles Tjoelker To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307469 - head/etc Message-ID: <20161019202656.GA58917@stack.nl> References: <201610170407.u9H47D5n033011@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201610170407.u9H47D5n033011@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 20:26:59 -0000 On Mon, Oct 17, 2016 at 04:07:13AM +0000, Warner Losh wrote: > Author: imp > Date: Mon Oct 17 04:07:13 2016 > New Revision: 307469 > URL: https://svnweb.freebsd.org/changeset/base/307469 > Log: > Allow root_rw_mount to be both lower and upper case. Before, if it was > upper case, you'd wind up with a read-only filesystem when you should > sometimes. > PR: 213549 > Modified: > head/etc/rc > Modified: head/etc/rc > ============================================================================== > --- head/etc/rc Mon Oct 17 04:07:12 2016 (r307468) > +++ head/etc/rc Mon Oct 17 04:07:13 2016 (r307469) > @@ -135,16 +135,16 @@ done > # Note: this assumes firstboot_sentinel is on / when we have > # a read-only /, or that it is on media that's writable. > if [ -e ${firstboot_sentinel} ]; then > - [ ${root_rw_mount} = "yes" ] || mount -uw / > + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw / > chflags -R 0 ${firstboot_sentinel} > rm -rf ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > chflags -R 0 ${firstboot_sentinel}-reboot > rm -rf ${firstboot_sentinel}-reboot > - [ ${root_rw_mount} = "yes" ] || mount -ur / > + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / > kill -INT 1 > fi > - [ ${root_rw_mount} = "yes" ] || mount -ur / > + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / > fi > > echo '' Although I have not tested this, it looks like this will always do the remounts since the condition is either false or invalid due to missing quotes. Perhaps we can use the checkyesno function from rc.subr or use the same check that rc.d/root uses (case statement where [Nn][Oo] and the empty string are no and the rest is yes). -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Wed Oct 19 20:36:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F0AC18A1E for ; Wed, 19 Oct 2016 20:36:45 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-f171.google.com (mail-qt0-f171.google.com [209.85.216.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 250C6BC0 for ; Wed, 19 Oct 2016 20:36:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-f171.google.com with SMTP id m5so34849749qtb.3 for ; Wed, 19 Oct 2016 13:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QIUePhRm8peZQ9kGZAv6AvA8nr0FLHN9R/QMOpNY/6Q=; b=u2FTgh4piVMhevBMe+q464oKAz6Xlr0vZdjd8yJoRbYX6oiydN1vJva4AnpJYNyXGM B4/LbYRk0EYlh+vBzIyS0xXMri37QQqnC5OYZojh6DXHsT/RephHlCw2lY04CVr/Abnj Zgyh0T/GdR3jbfs34Rrp+q3YHiptb2KOrAZ6oy2nhR+sepjrlmR7FJrpu02li+XN3HUp VZnzMJ0SC55tGF8V18SWwEBWVUgq/GFPrgZhmV9JI+lt7j7DOluqz6tdCFD5P2yIhbyg UPKyQ52Re65RzLp0jXLosZZjgr+MMMygxigoAnC5Vwj+YD/Ij9GzMxJvuqxqUavU29n5 0T0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QIUePhRm8peZQ9kGZAv6AvA8nr0FLHN9R/QMOpNY/6Q=; b=FCguet3zK66q9Jzz8nxH/WPMpWIU5pPy1DYV4TLXkCYs7qawtzR2LlwgDYdoBktQfP teejqtQ6gcVaQDqopVknVnuo7yydvKe6BeYgz+KH1PRaIKngiO+Oc/CuZDEypLn3+xyo N8V/qgXdOOelb7DmHajCtm/wgIrBGlZdXPi2oUrxekYPJx7IkFSh/Z+g0dKZ+ue9BmLd sbXt/m9kmJP/WJ0UASnGRZy1JPHRF122qcQJmUlWWq6QthmS5Dv1wX1WGMgit5FR1Nq/ dEGLB8AY7cz+Eb4wksW3iYE0jfmCWARA6xN0LWZZNQIDFvuVXgmb3VYsE2Lwd9VhNmu0 0zeA== X-Gm-Message-State: AA6/9RniEaffyu14bNYLMFNSfMz1pxRguWhV6ngQOlTtr9jxl+qSaIvm+iELFpv0aQZI0TJI X-Received: by 10.237.39.71 with SMTP id n65mr8330100qtd.9.1476909343587; Wed, 19 Oct 2016 13:35:43 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id f16sm10712207qta.9.2016.10.19.13.35.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Oct 2016 13:35:42 -0700 (PDT) Date: Wed, 19 Oct 2016 16:35:40 -0400 From: Shawn Webb To: Luigi Rizzo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap Message-ID: <20161019203540.GC94803@mutt-hardenedbsd> References: <201610161413.u9GEDW91013522@repo.freebsd.org> <20161019162324.GA94803@mutt-hardenedbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GyRA7555PLgSTuth" Content-Disposition: inline In-Reply-To: <20161019162324.GA94803@mutt-hardenedbsd> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 20:36:45 -0000 --GyRA7555PLgSTuth Content-Type: multipart/mixed; boundary="mvpLiMfbWzRoNl4x" Content-Disposition: inline --mvpLiMfbWzRoNl4x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 19, 2016 at 12:23:24PM -0400, Shawn Webb wrote: > On Sun, Oct 16, 2016 at 02:13:32PM +0000, Luigi Rizzo wrote: > > Author: luigi > > Date: Sun Oct 16 14:13:32 2016 > > New Revision: 307394 > > URL: https://svnweb.freebsd.org/changeset/base/307394 > >=20 > > Log: > > Import the current version of netmap, aligned with the one on github. > > =20 > > This commit, long overdue, contains contributions in the last 2 years > > from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, includ= ing: > > + fixes on monitor ports > > + the 'ptnet' virtual device driver, and ptnetmap backend, for > > high speed virtual passthrough on VMs (bhyve fixes in an upcoming c= ommit) > > + improved emulated netmap mode > > + more robust error handling > > + removal of stale code > > + various fixes to code and documentation (some mixup between RX and = TX > > parameters, and private and public variables) > > =20 > > We also include an additional tool, nmreplay, which is functionally > > equivalent to tcpreplay but operating on netmap ports. > >=20 > > Added: > > head/tools/tools/netmap/ctrs.h (contents, props changed) > > head/tools/tools/netmap/nmreplay.8 (contents, props changed) > > head/tools/tools/netmap/nmreplay.c (contents, props changed) > > Modified: > > head/share/man/man4/netmap.4 > > head/sys/conf/files > > head/sys/dev/netmap/if_ixl_netmap.h > > head/sys/dev/netmap/if_lem_netmap.h > > head/sys/dev/netmap/ixgbe_netmap.h > > head/sys/dev/netmap/netmap.c > > head/sys/dev/netmap/netmap_freebsd.c > > head/sys/dev/netmap/netmap_generic.c > > head/sys/dev/netmap/netmap_kern.h > > head/sys/dev/netmap/netmap_mbq.c > > head/sys/dev/netmap/netmap_mbq.h > > head/sys/dev/netmap/netmap_mem2.c > > head/sys/dev/netmap/netmap_mem2.h > > head/sys/dev/netmap/netmap_monitor.c > > head/sys/dev/netmap/netmap_offloadings.c > > head/sys/dev/netmap/netmap_pipe.c > > head/sys/dev/netmap/netmap_vale.c > > head/sys/modules/netmap/Makefile > > head/sys/net/netmap.h > > head/sys/net/netmap_user.h > > head/tools/tools/netmap/Makefile > > head/tools/tools/netmap/bridge.c > > head/tools/tools/netmap/pkt-gen.c > > head/tools/tools/netmap/vale-ctl.c >=20 > Looks like this broke VIMAGE builds: >=20 > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclare= d identifier 'rd' > CURVNET_SET(TD_TO_VNET(rd)); > ^ > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclare= d identifier 'rd' > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclare= d identifier 'rd' > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclare= d identifier 'rd' > 4 errors generated. > --- netmap_freebsd.o --- > *** [netmap_freebsd.o] Error code 1 The attached patch fixes the build. In case it doesn't make it to the list, it's also posted here: http://ix.io/1xFU Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --mvpLiMfbWzRoNl4x Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="2016-10-19_netmap.patch.txt" Content-Transfer-Encoding: quoted-printable diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebs= d.c index 50e2d0f..a3ad322 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -48,6 +48,7 @@ #include =20 =20 +#include #include #include /* sockaddrs */ #include @@ -1407,7 +1408,7 @@ freebsd_netmap_ioctl(struct cdev *dev __unused, u_lon= g cmd, caddr_t data, int error; struct netmap_priv_d *priv; =20 - CURVNET_SET(TD_TO_VNET(rd)); + CURVNET_SET(TD_TO_VNET(td)); error =3D devfs_get_cdevpriv((void **)&priv); if (error) { /* XXX ENOENT should be impossible, since the priv --mvpLiMfbWzRoNl4x-- --GyRA7555PLgSTuth Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYB9kaAAoJEGqEZY9SRW7uHL8P/i/c1AXw028FgoqFA+bWut9f 70q5EPIY2J426CVyMjZ3WYAN9tEmueTg4ImCWMMtu0xr344jUo7JEGehWcOEZiii jZb12H3QKA61Y7+8GyJO9N0FpGTbmNzq/qilZhq2JaG+mu8SFYfYJ36EAMAiIKzu HwVgbRcvlYrj6I1uWPgof24uBoyJSf/3rJ2QX+z8T9pBBETGm1ul070Eq9st/kAB gxzygZJyIu5pAh3GRgnyh3u9QlBpiNYiBcDOSSGM6dFuyGQH4SWIY7VF+D3pfEQl RI23MglT2baSjSVcTKnms3w7ZoHCxrxUZ11ww+yf+6WHtbthDUKXExIEWL6scIYu dxiNjO5yHa6jrDiW/iPyAYoumLmuet8tkXasWgTn6oYLcW3fDh2QGuJnCjvhFPkW K3LdMiWkSZJto9YHuSoKFrJUGFNW4BVtF/4IINWgYxFW3BtcJPvXJJpwmOeMCN35 aXG8xuASFJB4pgkHcawQOYwSYi+nyH2qVwBeMYEeXjOIQl0vQtodGOYMNR3ZlTD1 jVlqVn//Im8f4kDJtjU+wW3h7p8ZLAH1VtgoKJScyN6S2zF3cnAoNaowW/2CB357 ISHV1xSYX4cMG0u61DbiqmlHMx3HeSSMedPjfgmyteGwapmA5Y32QZ9zrobaKMkC eI9VWMvyDRo9MGamnY4B =49f7 -----END PGP SIGNATURE----- --GyRA7555PLgSTuth-- From owner-svn-src-head@freebsd.org Wed Oct 19 20:56:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E0ACC18E07; Wed, 19 Oct 2016 20:56:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id 317F56CC; Wed, 19 Oct 2016 20:56:22 +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 u9JKuLTx039150; Wed, 19 Oct 2016 20:56:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JKuLjj039149; Wed, 19 Oct 2016 20:56:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610192056.u9JKuLjj039149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Oct 2016 20:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307656 - head/gnu/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 20:56:22 -0000 Author: emaste Date: Wed Oct 19 20:56:21 2016 New Revision: 307656 URL: https://svnweb.freebsd.org/changeset/base/307656 Log: Put each SUBDIR on a separate line for ease of maintenance Additional patches to this file are in progress, and having each SUBDIR entry on a separate line makes it easier to change the order in which the patches are reviewed, tested, and applied. Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Wed Oct 19 19:57:36 2016 (r307655) +++ head/gnu/lib/Makefile Wed Oct 19 20:56:21 2016 (r307656) @@ -2,7 +2,9 @@ .include -SUBDIR= csu libgcc libregex +SUBDIR= csu +SUBDIR+= libgcc +SUBDIR+= libregex SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp From owner-svn-src-head@freebsd.org Wed Oct 19 21:01:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A840C19061; Wed, 19 Oct 2016 21:01:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 1C965CE0; Wed, 19 Oct 2016 21:01:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JL1PFU042115; Wed, 19 Oct 2016 21:01:25 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JL1PW4042114; Wed, 19 Oct 2016 21:01:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610192101.u9JL1PW4042114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 19 Oct 2016 21:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307657 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 21:01:26 -0000 Author: sbruno Date: Wed Oct 19 21:01:24 2016 New Revision: 307657 URL: https://svnweb.freebsd.org/changeset/base/307657 Log: Resolve whitespace diff to NextBSD. Check to see that the taskqueue thread count requires us to acutally iterate over the thread count to bind to cpus. Submitted by: mmacy@nextbsd.org Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Wed Oct 19 20:56:21 2016 (r307656) +++ head/sys/kern/subr_gtaskqueue.c Wed Oct 19 21:01:24 2016 (r307657) @@ -52,7 +52,6 @@ static MALLOC_DEFINE(M_GTASKQUEUE, "task static void gtaskqueue_thread_enqueue(void *); static void gtaskqueue_thread_loop(void *arg); - struct gtaskqueue_busy { struct gtask *tb_running; TAILQ_ENTRY(gtaskqueue_busy) tb_link; @@ -655,11 +654,11 @@ taskqgroup_attach_deferred(struct taskqg if (gtask->gt_irq != -1) { mtx_unlock(&qgroup->tqg_lock); - CPU_ZERO(&mask); - CPU_SET(cpu, &mask); - intr_setaffinity(gtask->gt_irq, &mask); + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + intr_setaffinity(gtask->gt_irq, &mask); - mtx_lock(&qgroup->tqg_lock); + mtx_lock(&qgroup->tqg_lock); } qgroup->tqg_queue[qid].tgc_cnt++; @@ -789,6 +788,9 @@ taskqgroup_bind(struct taskqgroup *qgrou * Bind taskqueue threads to specific CPUs, if they have been assigned * one. */ + if (qgroup->tqg_cnt == 1) + return; + for (i = 0; i < qgroup->tqg_cnt; i++) { gtask = malloc(sizeof (*gtask), M_DEVBUF, M_WAITOK); GTASK_INIT(>ask->bt_task, 0, 0, taskqgroup_binder, gtask); @@ -855,7 +857,6 @@ _taskqgroup_adjust(struct taskqgroup *qg LIST_INSERT_HEAD(>ask_head, gtask, gt_list); } } - mtx_unlock(&qgroup->tqg_lock); while ((gtask = LIST_FIRST(>ask_head))) { From owner-svn-src-head@freebsd.org Wed Oct 19 21:07:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD08C1914E; Wed, 19 Oct 2016 21:07:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2B43BD7; Wed, 19 Oct 2016 21:07:18 +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 u9JL7H60043014; Wed, 19 Oct 2016 21:07:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JL7HOx043013; Wed, 19 Oct 2016 21:07:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610192107.u9JL7HOx043013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Oct 2016 21:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307658 - head/sbin/md5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 21:07:18 -0000 Author: emaste Date: Wed Oct 19 21:07:17 2016 New Revision: 307658 URL: https://svnweb.freebsd.org/changeset/base/307658 Log: md5: enter capability on last fd or when acting as a filter Reviewed by: allanjude, cem MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8271 Modified: head/sbin/md5/md5.c Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Wed Oct 19 21:01:24 2016 (r307657) +++ head/sbin/md5/md5.c Wed Oct 19 21:07:17 2016 (r307658) @@ -21,8 +21,10 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include #include @@ -74,7 +76,7 @@ typedef struct Algorithm_t { DIGEST_Update *Update; DIGEST_End *End; char *(*Data)(const void *, unsigned int, char *); - char *(*File)(const char *, char *); + char *(*Fd)(int, char *); } Algorithm_t; static void MD5_Update(MD5_CTX *, const unsigned char *, size_t); @@ -106,34 +108,34 @@ typedef union { static const struct Algorithm_t Algorithm[] = { { "md5", "MD5", &MD5TestOutput, (DIGEST_Init*)&MD5Init, (DIGEST_Update*)&MD5_Update, (DIGEST_End*)&MD5End, - &MD5Data, &MD5File }, + &MD5Data, &MD5Fd }, { "sha1", "SHA1", &SHA1_TestOutput, (DIGEST_Init*)&SHA1_Init, (DIGEST_Update*)&SHA1_Update, (DIGEST_End*)&SHA1_End, - &SHA1_Data, &SHA1_File }, + &SHA1_Data, &SHA1_Fd }, { "sha256", "SHA256", &SHA256_TestOutput, (DIGEST_Init*)&SHA256_Init, (DIGEST_Update*)&SHA256_Update, (DIGEST_End*)&SHA256_End, - &SHA256_Data, &SHA256_File }, + &SHA256_Data, &SHA256_Fd }, { "sha384", "SHA384", &SHA384_TestOutput, (DIGEST_Init*)&SHA384_Init, (DIGEST_Update*)&SHA384_Update, (DIGEST_End*)&SHA384_End, - &SHA384_Data, &SHA384_File }, + &SHA384_Data, &SHA384_Fd }, { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, - &SHA512_Data, &SHA512_File }, + &SHA512_Data, &SHA512_Fd }, { "sha512t256", "SHA512t256", &SHA512t256_TestOutput, (DIGEST_Init*)&SHA512_256_Init, (DIGEST_Update*)&SHA512_256_Update, (DIGEST_End*)&SHA512_256_End, - &SHA512_256_Data, &SHA512_256_File }, + &SHA512_256_Data, &SHA512_256_Fd }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, - (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File }, + (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_Fd }, { "skein256", "Skein256", &SKEIN256_TestOutput, (DIGEST_Init*)&SKEIN256_Init, (DIGEST_Update*)&SKEIN256_Update, - (DIGEST_End*)&SKEIN256_End, &SKEIN256_Data, &SKEIN256_File }, + (DIGEST_End*)&SKEIN256_End, &SKEIN256_Data, &SKEIN256_Fd }, { "skein512", "Skein512", &SKEIN512_TestOutput, (DIGEST_Init*)&SKEIN512_Init, (DIGEST_Update*)&SKEIN512_Update, - (DIGEST_End*)&SKEIN512_End, &SKEIN512_Data, &SKEIN512_File }, + (DIGEST_End*)&SKEIN512_End, &SKEIN512_Data, &SKEIN512_Fd }, { "skein1024", "Skein1024", &SKEIN1024_TestOutput, (DIGEST_Init*)&SKEIN1024_Init, (DIGEST_Update*)&SKEIN1024_Update, - (DIGEST_End*)&SKEIN1024_End, &SKEIN1024_Data, &SKEIN1024_File } + (DIGEST_End*)&SKEIN1024_End, &SKEIN1024_Data, &SKEIN1024_Fd } }; static void @@ -154,7 +156,8 @@ Arguments (may be any combination): int main(int argc, char *argv[]) { - int ch; + cap_rights_t rights; + int ch, fd; char *p; char buf[HEX_DIGEST_LENGTH]; int failed; @@ -206,10 +209,30 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (caph_limit_stdout() < 0 || caph_limit_stderr() < 0) + err(1, "unable to limit rights for stdio"); + if (*argv) { do { - p = Algorithm[digest].File(*argv, buf); - if (!p) { + if ((fd = open(*argv, O_RDONLY)) < 0) { + warn("%s", *argv); + failed++; + continue; + } + /* + * XXX Enter capability mode on the last argv file. + * When a casper file service or other approach is + * available, switch to that and enter capability mode + * earlier. + */ + if (*(argv + 1) == NULL) { + cap_rights_init(&rights, CAP_READ); + if ((cap_rights_limit(fd, &rights) < 0 && + errno != ENOSYS) || + (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + } + if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) { warn("%s", *argv); failed++; } else { @@ -229,8 +252,12 @@ main(int argc, char *argv[]) printf("\n"); } } while (*++argv); - } else if (!sflag && (optind == 1 || qflag || rflag)) + } else if (!sflag && (optind == 1 || qflag || rflag)) { + if (caph_limit_stdin() < 0 || + (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); MDFilter(&Algorithm[digest], 0); + } if (failed != 0) return (1); From owner-svn-src-head@freebsd.org Wed Oct 19 21:26:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0988C1948F; Wed, 19 Oct 2016 21:26:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9223FBA3; Wed, 19 Oct 2016 21:26:00 +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 u9JLPxPJ050908; Wed, 19 Oct 2016 21:25:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JLPxcX050907; Wed, 19 Oct 2016 21:25:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610192125.u9JLPxcX050907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Oct 2016 21:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307659 - head/gnu/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 21:26:00 -0000 Author: emaste Date: Wed Oct 19 21:25:59 2016 New Revision: 307659 URL: https://svnweb.freebsd.org/changeset/base/307659 Log: Switch gnu/usr.bin/Makefile to SUBDIR.${MK_*} optional subdir style Modified: head/gnu/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Wed Oct 19 21:07:17 2016 (r307658) +++ head/gnu/usr.bin/Makefile Wed Oct 19 21:25:59 2016 (r307659) @@ -2,48 +2,27 @@ .include -SUBDIR= ${_binutils} \ - ${_cc} \ - diff \ +SUBDIR= diff \ diff3 \ - ${_dtc} \ - ${_gdb} \ - ${_gperf} \ - grep \ - ${_groff} \ - ${_tests} + grep SUBDIR_DEPEND_gdb= ${_binutils} .if ${MK_CXX} != "no" -.if ${MK_GCC} != "no" -_gperf= gperf -.endif -.if ${MK_GROFF} != "no" -_groff= groff -.endif +SUBDIR.${MK_GCC}+= gperf +SUBDIR.${MK_GROFF}+= groff .endif -.if ${MK_GPL_DTC} != "no" -_dtc= dtc -.endif - -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_BINUTILS}+= binutils +SUBDIR.${MK_DIALOG}+= dialog .if ${MK_BINUTILS} != "no" -_binutils= binutils -.if ${MK_GDB} != "no" -_gdb= gdb -.endif +SUBDIR.${MK_GDB}+= gdb .endif -.if ${MK_GCC} != "no" -_cc= cc -.endif - -SUBDIR.${MK_DIALOG}+= dialog +SUBDIR.${MK_GCC}+= cc +SUBDIR.${MK_GPL_DTC}+= dtc +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= From owner-svn-src-head@freebsd.org Wed Oct 19 21:44:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44793C1996B; Wed, 19 Oct 2016 21:44:02 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qk0-x229.google.com (mail-qk0-x229.google.com [IPv6:2607:f8b0:400d:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1908998; Wed, 19 Oct 2016 21:44:01 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by mail-qk0-x229.google.com with SMTP id z190so61694374qkc.2; Wed, 19 Oct 2016 14:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=u//Do35n1OwIHyaZX+vYxd96fsSMbtAKOGjhZHsZljc=; b=aNamfU0WZkrDeWN3QD/5pznywSjy9D0qK5195wyH+97qZWnN34OiEuqISNePCJiMTC 3GGW9UoURAeC5y7quTtCyH3lWp5RiBXrJBRp7TMje6whQqCUT0/ccqpMaRNECH8VqOlv if2eWd7BJ7t7NT/4/vNCaKE23K9jr2A9Haj0VPBFRzbRHLVKAmNfgD+/LxpZf+cpq8TG fR7EZ65wpM8HgQ7bkHnHSh1dF7cXo62QwVK/4Yg0tqKiLYyvM50VWT40imVPFUFup3v7 FjsprhLoL0BoVUUrI3EhHW47Pito+P0au8Y6bXi3585tr7K1v3+UqOfWbi7OeH0VFBhx 38RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; bh=u//Do35n1OwIHyaZX+vYxd96fsSMbtAKOGjhZHsZljc=; b=XWEDcG8G77pfx9G7iNiWnu+OApEa6+VOVWRKRhhdEGLhB9XoAhMMRwlXJVxxm0itfF vhwZzMK0u4IardDkj2FAUJXqBKO2bgbLdAEwo5p9Kx7hv/18VCthfwsUQfU1KlSW2+9m kr7Hxpgmf715gz4amnjwEYzDpT4HWj2KlbUMCK0KynmACKmzY+L+RSBdRj7vZv+vvHKp vcB+wKivBzgxnmXMshYWc7hEurAmvnESL5mNe3y7X0Lt27vpz9PQyk+7FrkdNWX2OLPQ skGeZaF5jC8i7nKlOdzAp4j7mzF6oEMn3oK6rqroJ1qTJ8GuE38V1H9vtainSW1RjXt5 EF6w== X-Gm-Message-State: ABUngvc4vkDxAmzxGzBy83+2+0ONXMD3IsUUAHB48HQHcFHn1n83A51C9BX7+14hkmR3Xg== X-Received: by 10.55.200.75 with SMTP id c72mr7752941qkj.85.1476913440916; Wed, 19 Oct 2016 14:44:00 -0700 (PDT) Received: from [172.31.26.254] (gzac12-mdf2-1.aoa.twosigma.com. [208.77.215.155]) by smtp.gmail.com with ESMTPSA id v10sm21914573qkg.20.2016.10.19.14.43.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 14:43:59 -0700 (PDT) Sender: Matteo Riondato Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: svn commit: r307659 - head/gnu/usr.bin From: Matteo Riondato In-Reply-To: <201610192125.u9JLPxcX050907@repo.freebsd.org> Date: Wed, 19 Oct 2016 17:43:58 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <69B71206-9305-4A8D-9589-3E9B22914D71@FreeBSD.org> References: <201610192125.u9JLPxcX050907@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3226) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 21:44:02 -0000 > On Oct 19, 2016, at 5:25 PM, Ed Maste wrote: > > Author: emaste > Date: Wed Oct 19 21:25:59 2016 > New Revision: 307659 > URL: https://svnweb.freebsd.org/changeset/base/307659 > > Log: > Switch gnu/usr.bin/Makefile to SUBDIR.${MK_*} optional subdir style This seems to have broken buildworld with WITHOUT_GPL_DTC=y in src.conf . Matteo From owner-svn-src-head@freebsd.org Wed Oct 19 21:50:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6EF9C19B2E; Wed, 19 Oct 2016 21:50:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id A3388DDA; Wed, 19 Oct 2016 21:50:58 +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 u9JLovRn059252; Wed, 19 Oct 2016 21:50:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9JLovcT059251; Wed, 19 Oct 2016 21:50:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201610192150.u9JLovcT059251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 19 Oct 2016 21:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307660 - head/usr.bin/jot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 21:50:58 -0000 Author: cem Date: Wed Oct 19 21:50:57 2016 New Revision: 307660 URL: https://svnweb.freebsd.org/changeset/base/307660 Log: Capsicum support for jot(1) Limit descriptors and enter capability mode in jot(1). Submitted by: brueffer (earlier version) Reviewed by: emaste, jonathan (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D1345 Modified: head/usr.bin/jot/jot.c Modified: head/usr.bin/jot/jot.c ============================================================================== --- head/usr.bin/jot/jot.c Wed Oct 19 21:25:59 2016 (r307659) +++ head/usr.bin/jot/jot.c Wed Oct 19 21:50:57 2016 (r307660) @@ -47,8 +47,11 @@ __FBSDID("$FreeBSD$"); * Author: John Kunze, Office of Comp. Affairs, UCB */ +#include +#include #include #include +#include #include #include #include @@ -89,6 +92,7 @@ static void usage(void); int main(int argc, char **argv) { + cap_rights_t rights; bool have_format = false; bool infinity = false; bool nofinalnl = false; @@ -105,6 +109,21 @@ main(int argc, char **argv) long i; long reps = REPS_DEF; + if (caph_limit_stdio() < 0) + err(1, "unable to limit rights for stdio"); + cap_rights_init(&rights); + if (cap_rights_limit(STDIN_FILENO, &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for stdin"); + + /* + * Cache NLS data, for strerror, for err(3), before entering capability + * mode. + */ + caph_cache_catpages(); + + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + while ((ch = getopt(argc, argv, "b:cnp:rs:w:")) != -1) switch (ch) { case 'b': From owner-svn-src-head@freebsd.org Wed Oct 19 22:09:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E3C7C19DB8; Wed, 19 Oct 2016 22:09:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AAA2881; Wed, 19 Oct 2016 22:09:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u9JM9gYa031141 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 19 Oct 2016 15:09:42 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u9JM9g6A031140; Wed, 19 Oct 2016 15:09:42 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 19 Oct 2016 15:09:42 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307650 - head/sys/kern Message-ID: <20161019220942.GM27748@FreeBSD.org> References: <201610191829.u9JITqhm081246@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201610191829.u9JITqhm081246@repo.freebsd.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 22:09:44 -0000 On Wed, Oct 19, 2016 at 06:29:52PM +0000, Mateusz Guzik wrote: M> Author: mjg M> Date: Wed Oct 19 18:29:52 2016 M> New Revision: 307650 M> URL: https://svnweb.freebsd.org/changeset/base/307650 M> M> Log: M> cache: split negative entry LRU into multiple lists M> M> This splits the ncneg_mtx lock while preserving the hit ratio at least M> during buildworld. M> M> Create N dedicated lists for new negative entries. M> M> Entries with at least one hit get promoted to the hot list, where they M> get requeued every M hits. M> M> Shrinking demotes one hot entry and performs a round-robin shrinking of M> regular lists. M> M> Reviewed by: kib This instapanics: panic: Assertion ncp->nc_flag & NCF_NEGATIVE failed at /usr/src/head/sys/kern/vfs_cache.c:815 -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Oct 19 22:33:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42BDDC19226 for ; Wed, 19 Oct 2016 22:33:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09DF8846 for ; Wed, 19 Oct 2016 22:33:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id 4so132737003itv.0 for ; Wed, 19 Oct 2016 15:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=bWJIeAVd9mLYwQYm4sth4APhKnVNOBvI1SPKLk1TTrE=; b=iAl2G/Dif+P3BQiF05GwjM7nramli+Ql+ApminHW36ywozwFRoJ/6mOlIt/MC4i4+u JumYk7fhQWM/LjfuLeZTTSDQS9KHjNKd6wMFIiv+pOGC3INILEPD5X0aWufw5p8uZJuA x0btfvGboGIQaliLBwP9EYkNz5mNhIeXa1dy/9oue9C/YFmJpmPJ2veM5V2C2SeTraYh LPPV13qywXylCBv5WFmjyerj1M9ZmUfAW/ihVl1AQjSce7RwHDvFXxF4kTNeGbCTe619 5Vw7aPi3CPdTIg3eOofPJXWvo7JC0OWfD0Bb0XkKWvvxYF59Uk80TA4iDHHc9mdODWzd WQbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=bWJIeAVd9mLYwQYm4sth4APhKnVNOBvI1SPKLk1TTrE=; b=EHEhGpKnGkfZrh6qkxAAgqFR7aiNwGmS8T1P1VmB7lnH/4lCbvK1aZoUzvsS9+Ev7P IUwhWJ5srKYs/1PY4uowLBLKt0yeMwNEdso5S7GgqSRzBuuUpgfOk9/hcb5re7LiznZh oulCINslCb3kCP9NrUZPnHgmLEdOSz5zOhNyOfbjfyn1tJGtEdZU+3a5Lqpv6L1C9I/e +ZnL0Isj9vMN8getnk6Qp3XfxOpX2IIYuu3mkR1eilCuio6lLuYn2gfMXAYevqWma/cs Xvn2BWj8SR90QJVvBrDmcnkaqZjrpAtCGacND4DFVe1HaojE3bwnYQ5756nWFd5Ayv5z b+5A== X-Gm-Message-State: AA6/9RnyXeQgq5YrnZqbdtrZJZIj7DIadWtfU43cbi9I6u9niC/xkeTU5tQaIxXMEwBMq1H9xZPZ+zSestEzaQ== X-Received: by 10.36.112.199 with SMTP id f190mr5931993itc.60.1476916420386; Wed, 19 Oct 2016 15:33:40 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Wed, 19 Oct 2016 15:33:39 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <1660864.e2huCtGy6v@ralph.baldwin.cx> References: <201610141710.u9EHArlL089412@repo.freebsd.org> <3841347.BNPZXPm7N3@ralph.baldwin.cx> <1660864.e2huCtGy6v@ralph.baldwin.cx> From: Warner Losh Date: Wed, 19 Oct 2016 16:33:39 -0600 X-Google-Sender-Auth: 1lyl0rJpDc1j4n6gdLvlXeQbM50 Message-ID: Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader To: John Baldwin Cc: Doug Ambrisko , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Doug Ambrisko , Ravi Pokala Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 22:33:42 -0000 On Wed, Oct 19, 2016 at 11:34 AM, John Baldwin wrote: > On Wednesday, October 19, 2016 02:01:18 AM Warner Losh wrote: >> One of my systems would export these as sysctls: >> >> smbios.bios.reldate="07/05/2013" >> smbios.bios.vendor="American Megatrends Inc." >> smbios.bios.version="3.00" >> smbios.chassis.maker="Supermicro" >> smbios.chassis.serial="0123456789" >> smbios.chassis.tag="To Be Filled By O.E.M." >> smbios.chassis.version="0123456789" >> smbios.memory.enabled="268435456" >> smbios.planar.location="To be filled by O.E.M." >> smbios.planar.maker="Supermicro" >> smbios.planar.product="X9SRH-7F/7TF" >> smbios.planar.serial="VM13CS028237" >> smbios.planar.tag="To be filled by O.E.M." >> smbios.planar.version="0123456789" >> smbios.socket.enabled="1" >> smbios.socket.populated="1" >> smbios.system.family="To be filled by O.E.M." >> smbios.system.maker="Supermicro" >> smbios.system.product="X9SRH-7F/7TF" >> smbios.system.serial="0123456789" >> smbios.system.sku="To be filled by O.E.M." >> smbios.system.uuid="00000000-0000-0000-0000-002590e4d0ec" >> smbios.system.version="0123456789" >> smbios.version="2.7" >> >> though some of them are silly due to the BIOS writer being silly... > > So are you planning to just duplicate the existing kenv vars as sysctl > nodes? Can't you parse the output of kenv instead? I often get sysctl -a from ailing systems. I never or rarely get kenv. This adds to the information available when I'm looking into problems since it gives me more data about the system where the problem occurs. Warner From owner-svn-src-head@freebsd.org Wed Oct 19 22:45:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B28BC194A1 for ; Wed, 19 Oct 2016 22:45:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33C64E27 for ; Wed, 19 Oct 2016 22:45:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id 139so124592600itm.1 for ; Wed, 19 Oct 2016 15:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Md3F7Z850xxv3DPYHfxf0ZxGnUmyZhpqHdo7hAHn59s=; b=aOW4MlZgRa0QUMEVzqWfo7Bb6wFFfteP+OVXVoYCw5agANfp11Vx6Y6G3r/2dBOC1M RUvIal2P48WJVrDDRJGPnv/5JNAqdSZQoL+RPzjQw6yHcY3Ltl3kwZxtLecxWL4y23B6 Xzjrzh214QdYySmV21dvgB6tIgbgeF2+jipcWsq1ob/RwLUY3toNdD+7GX1u+w0kFiX5 hH+qZs5b65++AdQBqm3CBr9NCDiS8lqXltbQwgc/XTiheQEyErP2fEWHrv+qTAzscPnN xkLXJQS8pIgsQRivzE68RslBGFO2UkYZp9270ipOay5a1PECEl4KVpg2qbkH5C3CHfEd I2ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Md3F7Z850xxv3DPYHfxf0ZxGnUmyZhpqHdo7hAHn59s=; b=BUxoEHP6nUdkezxJUXfXuUM2XNSx5qt+cau50B02hc3vSE7VZQZGPSdxcDoQDDUCRS FNdzrWc3+BhusrY2IiqguuFPj2IYRpOZmnlIeXECtQg9mvRlulIZleN2MMUj9NsrK7PZ 1Zoa/j48easRbOH5D7M+r9eF0QXGuhQOmTCzr5brAERzHwamvNBLRBpMCMeWB8ito2Ff Jo3VdqlcYpKyTrGfWQ5OQKNsXBCnuWdV0+VMKacW8VqiX8rPBM5NbibXxl+HPJ8gocP1 45YT0g8CAttTgcFYHvkrYUsdHMXsSXIqtqZlj4lsweurIHu8Ua0Pl2xPmWqrGUIPJouQ BVew== X-Gm-Message-State: AA6/9Rkq4F+BHlzCUydwJYVcrzWsnJ7MNlwRJTyvRfe4ive1lpbUcHx6EAWj1kzFfgxRG1ZoBdBnq/f2UV0x8A== X-Received: by 10.36.112.199 with SMTP id f190mr5971283itc.60.1476917121650; Wed, 19 Oct 2016 15:45:21 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Wed, 19 Oct 2016 15:45:21 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20161019202656.GA58917@stack.nl> References: <201610170407.u9H47D5n033011@repo.freebsd.org> <20161019202656.GA58917@stack.nl> From: Warner Losh Date: Wed, 19 Oct 2016 16:45:21 -0600 X-Google-Sender-Auth: JWxJQXXBXdCbYe6P48I7jpn64hU Message-ID: Subject: Re: svn commit: r307469 - head/etc To: Jilles Tjoelker Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 22:45:22 -0000 What missing quotes? It seemed to work find on the system I brought up... I didn't do the case statement because it would be three extra big useless syntactical boogers in the code :) I do like the idea of using checkyesno. Warner On Wed, Oct 19, 2016 at 2:26 PM, Jilles Tjoelker wrote: > On Mon, Oct 17, 2016 at 04:07:13AM +0000, Warner Losh wrote: >> Author: imp >> Date: Mon Oct 17 04:07:13 2016 >> New Revision: 307469 >> URL: https://svnweb.freebsd.org/changeset/base/307469 > >> Log: >> Allow root_rw_mount to be both lower and upper case. Before, if it was >> upper case, you'd wind up with a read-only filesystem when you should >> sometimes. > >> PR: 213549 > >> Modified: >> head/etc/rc > >> Modified: head/etc/rc >> ============================================================================== >> --- head/etc/rc Mon Oct 17 04:07:12 2016 (r307468) >> +++ head/etc/rc Mon Oct 17 04:07:13 2016 (r307469) >> @@ -135,16 +135,16 @@ done >> # Note: this assumes firstboot_sentinel is on / when we have >> # a read-only /, or that it is on media that's writable. >> if [ -e ${firstboot_sentinel} ]; then >> - [ ${root_rw_mount} = "yes" ] || mount -uw / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw / >> chflags -R 0 ${firstboot_sentinel} >> rm -rf ${firstboot_sentinel} >> if [ -e ${firstboot_sentinel}-reboot ]; then >> chflags -R 0 ${firstboot_sentinel}-reboot >> rm -rf ${firstboot_sentinel}-reboot >> - [ ${root_rw_mount} = "yes" ] || mount -ur / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / >> kill -INT 1 >> fi >> - [ ${root_rw_mount} = "yes" ] || mount -ur / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / >> fi >> >> echo '' > > Although I have not tested this, it looks like this will always do the > remounts since the condition is either false or invalid due to missing > quotes. > > Perhaps we can use the checkyesno function from rc.subr or use the same > check that rc.d/root uses (case statement where [Nn][Oo] and the empty > string are no and the rest is yes). > > -- > Jilles Tjoelker From owner-svn-src-head@freebsd.org Wed Oct 19 22:56:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65506C19768; Wed, 19 Oct 2016 22:56:06 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 383473D6; Wed, 19 Oct 2016 22:56:06 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id e203so3112293itc.1; Wed, 19 Oct 2016 15:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6pN3f8upsBLK6iCoKdALwHSU/9SqSkh7dct+RQjLLhs=; b=vnJGqy6GkExUGHAxCZIMgE/o/lUFCXA2ISpV6WjlgIqsUFwFXTHHpooKixCoHSdlPP wCEYTTr9zTJx9GdIEdJKTVvNMjAgsIEsQCwl/FNSVj+ogZP62JZhCwDuJCn58KIRcpJU tlfhJFCHMea/sP3zFAIyl3s1e/IGJilEEh4L4Td39QRWX0lvzrlSyhy2VMHnSpHVJAtq +mulMt/AcQlDgqgA07pH+l01ORVLkcXKy0xC/6qvBvfafXSTjpoLihUYkJ0m4SaUh1cE pFxpgURZ6Is09Qb9t7kAaMvA8Ag/VLqDxiWlDMGKKyrlu1ehvfSGuVnULU2eHPlPWZAk oUpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=6pN3f8upsBLK6iCoKdALwHSU/9SqSkh7dct+RQjLLhs=; b=apk9uSaXBeNx/imzcBIP3uGqD812dO9zowXGq+TlE5CDsVkoEWloEEIux0z7T/Mq5t uJi6SxWus5Tb166qVQaZNaIr8b/Tr8PuwfSfKkNDj/lTHjY4cQbjJW4tXoeXpEVndmyy 6AE7J1rxlDIly3zDb/9I/VM5R+9LF4ipfK1j6rzyqGjdGkTgL/QO4YPsSmO3KqAREaoK KbpSPgdhczE5yAIsT4LSjsbc5N/XcygYZPARCo2Q5nUq+BTnuJbuhSJpi/dpTK6rQrf5 icfmZpwPvZX2j5vpGpRJX46+psk39ol0IzEpcrqmpAFdL6Axh+ngPz64joYU1+L7Z5B9 pWRQ== X-Gm-Message-State: AA6/9RlBgQtgKBumcWrWV1E1CL/mpqzi0EX6vrbb2l4Wn5TogwxRPFSk6GHjp9tj5mKlmYIScFN3JNVeYQ/RBQ== X-Received: by 10.36.10.135 with SMTP id 129mr5412175itw.108.1476917765304; Wed, 19 Oct 2016 15:56:05 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.180.211 with HTTP; Wed, 19 Oct 2016 15:55:44 -0700 (PDT) In-Reply-To: <69B71206-9305-4A8D-9589-3E9B22914D71@FreeBSD.org> References: <201610192125.u9JLPxcX050907@repo.freebsd.org> <69B71206-9305-4A8D-9589-3E9B22914D71@FreeBSD.org> From: Ed Maste Date: Wed, 19 Oct 2016 22:55:44 +0000 X-Google-Sender-Auth: ZHfS4MGpgxKfySTpQmauHSSjv1A Message-ID: Subject: Re: svn commit: r307659 - head/gnu/usr.bin To: Matteo Riondato Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 22:56:06 -0000 On 19 October 2016 at 21:43, Matteo Riondato wrote: > > This seems to have broken buildworld with WITHOUT_GPL_DTC=y in src.conf . What error do you get? From owner-svn-src-head@freebsd.org Wed Oct 19 23:27:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E44AC19133; Wed, 19 Oct 2016 23:27:58 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4D8C97C; Wed, 19 Oct 2016 23:27:57 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id s49so37390458qta.0; Wed, 19 Oct 2016 16:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OpIgJifS+OCNaztcEJzBLLR9p1+24qNMwt3hLWLBhdw=; b=zx8XYwep7gO41qjEGdh1Fo4zlbpcTArmj2tS/wj6NOVkZN0SG+dgxJydFcqRjv9QWd dsyWyZ+cVQz8DuusLH93Wnn7dxKAftfybiLBvtcLC+pRVBWjQvJ7EtURNyuDfzkq0Xbo GITCl8Nbou5He8xl3TrOPn4FsQ2+6DXRb+Peaoqh9KGVTPfHQUxgegFmyMWDAJZlUOjQ RkyXDW5SwQ2VzfNheLShCh/43E/n5WNVEpiLeF4F9fVSrHNWwtZrS7pk6sqPTwRK1UIo ZJzgOo1Iaa3bw8uEdE0G9MOxHFj++P/LjWRzDLQmJwEv2NsRm4rWrYaUkZ99jOMOdQCR F93w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OpIgJifS+OCNaztcEJzBLLR9p1+24qNMwt3hLWLBhdw=; b=LvOkyehoDYhn/aRXsuk9qe8nD5O2Mmy9RKaBXK4UcSE2PtmVXhPdd9yfIXqRXY/AN4 IqQa/sYuQYHBurhGDFev9DXuCADzXGMNUG3uSBi0p7TGqFfoU8jt4rBq4PBqOASmSUSU PvOVxSF3Xg9T8ztkpJiHUeLXCPWBBaJ4kVOJrtRtCJd9L3Q7PdsemPcsvYE7V0ka58uH Zw24lx+XOkgY07k+7aS5KS7Y1OeSoceHFa1SqEtF7Z6+JUwd3oD8rPU8+8KQPEWtJZmU fHdgezp7t9Qs9P3hHsJdtpqfy7/W/PkgcdTe5YYhLny2l96dBsHxmwPGMYwpBR2ASetd lLvQ== X-Gm-Message-State: AA6/9Rk2m4Pm0XdWaJ0f9qY78vecpx0oIZDoMGzM+3s6thBl8nM5TUauXTrB75RYZubLBSyBCE6o0k5SKEJtyg== X-Received: by 10.200.33.201 with SMTP id 9mr9072954qtz.141.1476919676842; Wed, 19 Oct 2016 16:27:56 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.12.138.251 with HTTP; Wed, 19 Oct 2016 16:27:56 -0700 (PDT) In-Reply-To: <201409271357.s8RDvmTC072149@svn.freebsd.org> References: <201409271357.s8RDvmTC072149@svn.freebsd.org> From: Alan Somers Date: Wed, 19 Oct 2016 17:27:56 -0600 X-Google-Sender-Auth: 2BCkVO6Kxe5tax2jkGxKxUeyZuU Message-ID: Subject: Re: svn commit: r272211 - head/sys/net To: "Alexander V. Chernikov" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 23:27:58 -0000 On Sat, Sep 27, 2014 at 7:57 AM, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sat Sep 27 13:57:48 2014 > New Revision: 272211 > URL: http://svnweb.freebsd.org/changeset/base/272211 > > Log: > Use underlying ports counters to get lagg statistics instead of > per-packet accounting. > This introduce user-visible changes like aggregating error counters. > > Reviewed by: asomers (prev.version), glebius > CR: D781 > MFC after: 2 weeks > Sponsored by: Yandex LLC > > Modified: > head/sys/net/if_lagg.c > head/sys/net/if_lagg.h > head/sys/net/if_var.h > I think this change is causing a LOR and deadlock. It happens if I create a lagg and then quickly destroy it. The deadlocked threads have these stack traces: Tracing command ifconfig pid 7334 tid 100823 td 0xfffff8014ff34000 sched_switch() at sched_switch+0x48a/frame 0xfffffe20b3771470 mi_switch() at mi_switch+0x167/frame 0xfffffe20b37714a0 turnstile_wait() at turnstile_wait+0x3be/frame 0xfffffe20b37714f0 __mtx_lock_sleep() at __mtx_lock_sleep+0x196/frame 0xfffffe20b3771570 __mtx_lock_flags() at __mtx_lock_flags+0x10d/frame 0xfffffe20b37715c0 _rm_rlock() at _rm_rlock+0x28b/frame 0xfffffe20b3771600 _rm_rlock_debug() at _rm_rlock_debug+0x11f/frame 0xfffffe20b3771640 lagg_get_counter() at lagg_get_counter+0x4c/frame 0xfffffe20b37716c0 if_data_copy() at if_data_copy+0xa1/frame 0xfffffe20b37716e0 sysctl_rtsock() at sysctl_rtsock+0x56c/frame 0xfffffe20b3771860 sysctl_root_handler_locked() at sysctl_root_handler_locked+0x8a/frame 0xfffffe20b37718a0 sysctl_root() at sysctl_root+0x188/frame 0xfffffe20b3771920 userland_sysctl() at userland_sysctl+0x16e/frame 0xfffffe20b37719c0 sys___sysctl() at sys___sysctl+0x74/frame 0xfffffe20b3771a70 amd64_syscall() at amd64_syscall+0x314/frame 0xfffffe20b3771bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe20b3771bf0 --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x800fceeea, rsp = 0x7fffffffe408, rbp = 0x7fffffffe440 --- Tracing command ifconfig pid 7331 tid 100796 td 0xfffff80066df5a00 sched_switch() at sched_switch+0x48a/frame 0xfffffe20b36ea630 mi_switch() at mi_switch+0x167/frame 0xfffffe20b36ea660 turnstile_wait() at turnstile_wait+0x3be/frame 0xfffffe20b36ea6b0 __rw_wlock_hard() at __rw_wlock_hard+0xb5/frame 0xfffffe20b36ea740 _rw_wlock_cookie() at _rw_wlock_cookie+0xbc/frame 0xfffffe20b36ea780 lagg_ether_cmdmulti() at lagg_ether_cmdmulti+0x5c/frame 0xfffffe20b36ea7c0 lagg_ioctl() at lagg_ioctl+0x115a/frame 0xfffffe20b36ea8a0 ifioctl() at ifioctl+0xdc1/frame 0xfffffe20b36ea930 kern_ioctl() at kern_ioctl+0x246/frame 0xfffffe20b36ea990 sys_ioctl() at sys_ioctl+0x171/frame 0xfffffe20b36eaa70 amd64_syscall() at amd64_syscall+0x314/frame 0xfffffe20b36eabf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe20b36eabf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fd417a, rsp = 0x7fffffffe228, rbp = 0x7fffffffe2a0 --- The problem is that lagg_get_counter calls LAGG_RLOCK after calling IF_ADDR_RLOCK at rtsock.c:1717. Meanwhile, another thread called IF_ADDR_WLOCK at if_lagg.c:1581 after having already called LAGG_WLOCK at f_lagg.c:1530. I think this revision introduced the problem because reading the lagg's counters did not previously require the LAGG_RLOCK. Do you have any ideas on how to fix it? -Alan From owner-svn-src-head@freebsd.org Thu Oct 20 00:05:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99613C19D18; Thu, 20 Oct 2016 00:05:09 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 55954F74; Thu, 20 Oct 2016 00:05:09 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bx0r1-000JnU-Ju; Thu, 20 Oct 2016 03:05:03 +0300 Date: Thu, 20 Oct 2016 03:05:03 +0300 From: Slawa Olhovchenkov To: Warner Losh Cc: John Baldwin , Doug Ambrisko , src-committers , Doug Ambrisko , "svn-src-all@freebsd.org" , Ravi Pokala , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader Message-ID: <20161020000503.GG57876@zxy.spb.ru> References: <201610141710.u9EHArlL089412@repo.freebsd.org> <3841347.BNPZXPm7N3@ralph.baldwin.cx> <1660864.e2huCtGy6v@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 00:05:09 -0000 On Wed, Oct 19, 2016 at 04:33:39PM -0600, Warner Losh wrote: > On Wed, Oct 19, 2016 at 11:34 AM, John Baldwin wrote: > > On Wednesday, October 19, 2016 02:01:18 AM Warner Losh wrote: > >> One of my systems would export these as sysctls: > >> > >> smbios.bios.reldate="07/05/2013" > >> smbios.bios.vendor="American Megatrends Inc." > >> smbios.bios.version="3.00" > >> smbios.chassis.maker="Supermicro" > >> smbios.chassis.serial="0123456789" > >> smbios.chassis.tag="To Be Filled By O.E.M." > >> smbios.chassis.version="0123456789" > >> smbios.memory.enabled="268435456" > >> smbios.planar.location="To be filled by O.E.M." > >> smbios.planar.maker="Supermicro" > >> smbios.planar.product="X9SRH-7F/7TF" > >> smbios.planar.serial="VM13CS028237" > >> smbios.planar.tag="To be filled by O.E.M." > >> smbios.planar.version="0123456789" > >> smbios.socket.enabled="1" > >> smbios.socket.populated="1" > >> smbios.system.family="To be filled by O.E.M." > >> smbios.system.maker="Supermicro" > >> smbios.system.product="X9SRH-7F/7TF" > >> smbios.system.serial="0123456789" > >> smbios.system.sku="To be filled by O.E.M." > >> smbios.system.uuid="00000000-0000-0000-0000-002590e4d0ec" > >> smbios.system.version="0123456789" > >> smbios.version="2.7" > >> > >> though some of them are silly due to the BIOS writer being silly... > > > > So are you planning to just duplicate the existing kenv vars as sysctl > > nodes? Can't you parse the output of kenv instead? > > I often get sysctl -a from ailing systems. I never or rarely get kenv. > This adds to the information available when I'm looking into problems > since it gives me more data about the system where the problem occurs. Look like we need show-tech in base system :) From owner-svn-src-head@freebsd.org Thu Oct 20 01:19:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E84E1C18010; Thu, 20 Oct 2016 01:19:38 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 9C82D222; Thu, 20 Oct 2016 01:19:38 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9K1JbeM037672; Thu, 20 Oct 2016 01:19:37 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9K1JbFb037671; Thu, 20 Oct 2016 01:19:37 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201610200119.u9K1JbFb037671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 20 Oct 2016 01:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307662 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 01:19:39 -0000 Author: kevlo Date: Thu Oct 20 01:19:37 2016 New Revision: 307662 URL: https://svnweb.freebsd.org/changeset/base/307662 Log: Remove a sentence about putting initialization in init_proc.c or kern_proc.c and useless comment. Reviewed by: kib Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Oct 19 22:19:38 2016 (r307661) +++ head/sys/kern/init_main.c Thu Oct 20 01:19:37 2016 (r307662) @@ -316,15 +316,6 @@ restart: /* NOTREACHED*/ } - -/* - *************************************************************************** - **** - **** The following SYSINIT's belong elsewhere, but have not yet - **** been moved. - **** - *************************************************************************** - */ static void print_caddr_t(void *data) { @@ -418,17 +409,10 @@ struct sysentvec null_sysvec = { }; /* - *************************************************************************** - **** - **** The two following SYSINIT's are proc0 specific glue code. I am not - **** convinced that they can not be safely combined, but their order of - **** operation has been maintained as the same as the original init_main.c - **** for right now. - **** - **** These probably belong in init_proc.c or kern_proc.c, since they - **** deal with proc0 (the fork template process). - **** - *************************************************************************** + * The two following SYSINIT's are proc0 specific glue code. I am not + * convinced that they can not be safely combined, but their order of + * operation has been maintained as the same as the original init_main.c + * for right now. */ /* ARGSUSED*/ static void @@ -662,16 +646,6 @@ SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_ *************************************************************************** */ - -/* - *************************************************************************** - **** - **** The following code probably belongs in another file, like - **** kern/init_init.c. - **** - *************************************************************************** - */ - /* * List of paths to try when searching for "init". */ From owner-svn-src-head@freebsd.org Thu Oct 20 01:21:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B129C180D5; Thu, 20 Oct 2016 01:21:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6D394666; Thu, 20 Oct 2016 01:21:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9K1LAch040588; Thu, 20 Oct 2016 01:21:10 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9K1LAuZ040587; Thu, 20 Oct 2016 01:21:10 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201610200121.u9K1LAuZ040587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 20 Oct 2016 01:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307663 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 01:21:11 -0000 Author: kevlo Date: Thu Oct 20 01:21:10 2016 New Revision: 307663 URL: https://svnweb.freebsd.org/changeset/base/307663 Log: Remove register keyword. Reviewed by: kib Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Oct 20 01:19:37 2016 (r307662) +++ head/sys/kern/init_main.c Thu Oct 20 01:21:10 2016 (r307663) @@ -204,9 +204,9 @@ void mi_startup(void) { - register struct sysinit **sipp; /* system initialization*/ - register struct sysinit **xipp; /* interior loop of sort*/ - register struct sysinit *save; /* bubble*/ + struct sysinit **sipp; /* system initialization*/ + struct sysinit **xipp; /* interior loop of sort*/ + struct sysinit *save; /* bubble*/ #if defined(VERBOSE_SYSINIT) int last; From owner-svn-src-head@freebsd.org Thu Oct 20 08:37:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0AFFC1AD2C for ; Thu, 20 Oct 2016 08:37:59 +0000 (UTC) (envelope-from mamie@digitalsolutionleader.com) Received: from smtp102.biz.mail.sg3.yahoo.com (smtp102.biz.mail.sg3.yahoo.com [106.10.167.245]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30ECDC82 for ; Thu, 20 Oct 2016 08:37:58 +0000 (UTC) (envelope-from mamie@digitalsolutionleader.com) Received: (qmail 93165 invoked from network); 20 Oct 2016 08:31:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1476952274; bh=7GNNBi/7Kv9RO+AOGoHR47Ox9TwshK+i17XIIuwRxec=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=oJtTt7jkz6kCGAotvKDWD6BKFxQhbSljVcYGy2d2Ya5ytsYoUQc3OTezeKlayEcRTpxLCstXJAGfjzsUJxfYdQdWm05lK/dkbrNyR8Gt1iAxboxWH0yxaFxwOx0QjNg87T4jr3nxuveuo+f+6goqnoqFSCUvmdMITVV4K9D71dw= X-Yahoo-Newman-Property: ymail-4 X-YMail-OSG: EhC8hDAVM1mQs03njkOni40PrGvZ7QI.QQkJXJvpI955MjU ZoSExG3alPqrOU0o3.qV_UsjRVALt_S6IHHUEoQa_afLlBdYb4rSkJhbSDcF 8CBijFc359wYUvTLTK15FprvMV0ceIGnQamMw67DOzmDMPWQwObU1bKp_8a_ SB47lJzSSOF.moktde9egTuWbT8ZcsZ_fcwiDRFf1kewmIW.nIVk6T7vB.oT jV1DmzXGdp28kI_0LNh2u_hPUdlKpKK.6exRnchWDV5KUhkbZQ2PzOrBGCyO FuHNeqma1.NfYGdUTUck_koiQ230zGNhsLNdZLxmJ_XP3Yt5xAMnAH5O0HN9 ORlkvNTrkpEIPIYgXac2i5AnKuHNSEvRcSgeqaDt_5t.gDBvp4InvDSIIyOz vTpZyL8tyeymBdfEsL3_rajps6gQ2RWd8ZSeDUeMtNS6D732QZEyuzr8wot1 D6xSBk8BmP17LvdJxBaIzNnrHSevKU1RwdC2pndcIKzGUrxRFS3iM.J0QB2U 97iBwCcvqLzDjPelrEo3aqqdFm24scKozzELqD4T1gRRcTny1BsDCi13rAq1 daAwNnH9vNJjRYLCVtTmnwtI9zmOQzv_af_cZ X-Yahoo-SMTP: 6gBP7SOswBDcY00Y8kIcOPLl4VjmkA_iZ3f8V8t0PV9YSy32uObSv.rFs9Qb From: "Mamie Joseph" To: Subject: Promote Your Website!! Date: Thu, 20 Oct 2016 13:58:41 +0530 Message-ID: <1b1201d22aac$4d9cf840$e8d6e8c0$@digitalsolutionleader.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdIqppyNtGkn8wO9QbKEv+CfvebhIQ== Content-Language: en-us Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 08:37:59 -0000 Hi Greetings of the day! We can help you to bring you website in top-ranking placements of Google, Yahoo, Bing and other popular search engines.We will promote you website effectively and within few month durations you'll see huge traffic to your website automatically. Grab this wonderful opportunity at affordable prices. Please give us a call or email us for more information and pricing details. Thanks for your time Regards, Mamie Joseph | Website Consultant Website - www.digitalsolutionleader.com Phone: +1 (424) 625-4981 From owner-svn-src-head@freebsd.org Thu Oct 20 09:22:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0778C19EC3; Thu, 20 Oct 2016 09:22:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id BD4081818; Thu, 20 Oct 2016 09:22:11 +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 u9K9MAmv023166; Thu, 20 Oct 2016 09:22:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9K9MACE023160; Thu, 20 Oct 2016 09:22:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610200922.u9K9MACE023160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Oct 2016 09:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307667 - in head: share/man/man9 sys/arm64/arm64 sys/arm64/include sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 09:22:12 -0000 Author: andrew Date: Thu Oct 20 09:22:10 2016 New Revision: 307667 URL: https://svnweb.freebsd.org/changeset/base/307667 Log: Add support for the fpu_kern(9) KPI on arm64. It hooks into the existing VFP code to store the old context, with lazy loading of the new context when needed. FPU_KERN_NOCTX is missing as this is unused in the crypto code this has been tested with, and I am unsure on the requirements of the UEFI Runtime Services. Reviewed by: kib Obtained from: ABT Systeems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8276 Modified: head/share/man/man9/fpu_kern.9 head/sys/arm64/arm64/trap.c head/sys/arm64/arm64/vfp.c head/sys/arm64/include/pcb.h head/sys/arm64/include/vfp.h head/sys/opencrypto/crypto.c Modified: head/share/man/man9/fpu_kern.9 ============================================================================== --- head/share/man/man9/fpu_kern.9 Thu Oct 20 09:06:39 2016 (r307666) +++ head/share/man/man9/fpu_kern.9 Thu Oct 20 09:22:10 2016 (r307667) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2014 +.Dd October 20, 2016 .Dt FPU_KERN 9 .Os .Sh NAME @@ -134,11 +134,11 @@ of increased system latency. .El .Pp The function does not sleep or block. -It could cause the +It could cause an FPU trap during execution, and on the first FPU access +after the function returns, as well as after each context switch. +On i386 and amd64 this will be the .Nm Device Not Available -exception during execution, and on the first FPU access after the -function returns, as well as after each context switch -(see Intel Software Developer Manual for the reference). +exception (see Intel Software Developer Manual for the reference). Currently, no errors are defined which can be returned by .Fn fpu_kern_enter to the caller. @@ -190,7 +190,7 @@ and false otherwise. .Sh NOTES The .Nm -is currently implemented only for the i386 and amd64 architectures. +is currently implemented only for the i386, amd64, and arm64 architectures. .Pp There is no way to handle floating point exceptions raised from kernel mode. @@ -208,3 +208,5 @@ The .Nm facitily and this manual page were written by .An Konstantin Belousov Aq Mt kib@FreeBSD.org . +The arm64 support was added by +.An Andrew Turner Aq Mt andrew@FreeBSD.org . Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Oct 20 09:06:39 2016 (r307666) +++ head/sys/arm64/arm64/trap.c Thu Oct 20 09:22:10 2016 (r307667) @@ -282,9 +282,17 @@ do_el1h_sync(struct trapframe *frame) switch(exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: - print_registers(frame); - printf(" esr: %.8lx\n", esr); - panic("VFP exception in the kernel"); +#ifdef VFP + if ((curthread->td_pcb->pcb_fpflags & PCB_FP_KERN) != 0) { + vfp_restore_state(); + } else +#endif + { + print_registers(frame); + printf(" esr: %.8lx\n", esr); + panic("VFP exception in the kernel"); + } + break; case EXCP_INSN_ABORT: case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1); @@ -412,6 +420,9 @@ do_el0_sync(struct trapframe *frame) KASSERT((curthread->td_pcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, ("Kernel VFP flags set while entering userspace")); + KASSERT( + curthread->td_pcb->pcb_fpusaved == &curthread->td_pcb->pcb_fpustate, + ("Kernel VFP state in use when entering userspace")); } void Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Thu Oct 20 09:06:39 2016 (r307666) +++ head/sys/arm64/arm64/vfp.c Thu Oct 20 09:22:10 2016 (r307667) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 The FreeBSD Foundation + * Copyright (c) 2015-2016 The FreeBSD Foundation * All rights reserved. * * This software was developed by Andrew Turner under @@ -48,6 +48,14 @@ CTASSERT(sizeof(((struct pcb *)0)->pcb_f static MALLOC_DEFINE(M_FPUKERN_CTX, "fpukern_ctx", "Kernel contexts for VFP state"); +struct fpu_kern_ctx { + struct vfpstate *prev; +#define FPU_KERN_CTX_DUMMY 0x01 /* avoided save for the kern thread */ +#define FPU_KERN_CTX_INUSE 0x02 + uint32_t flags; + struct vfpstate state; +}; + static void vfp_enable(void) { @@ -71,9 +79,10 @@ vfp_disable(void) } /* - * Called when the thread is dying. If the thread was the last to use the - * VFP unit mark it as unused to tell the kernel the fp state is unowned. - * Ensure the VFP unit is off so we get an exception on the next access. + * Called when the thread is dying or when discarding the kernel VFP state. + * If the thread was the last to use the VFP unit mark it as unused to tell + * the kernel the fp state is unowned. Ensure the VFP unit is off so we get + * an exception on the next access. */ void vfp_discard(struct thread *td) @@ -226,4 +235,111 @@ vfp_init(void) SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, vfp_init, NULL); +struct fpu_kern_ctx * +fpu_kern_alloc_ctx(u_int flags) +{ + struct fpu_kern_ctx *res; + size_t sz; + + sz = sizeof(struct fpu_kern_ctx); + res = malloc(sz, M_FPUKERN_CTX, ((flags & FPU_KERN_NOWAIT) ? + M_NOWAIT : M_WAITOK) | M_ZERO); + return (res); +} + +void +fpu_kern_free_ctx(struct fpu_kern_ctx *ctx) +{ + + KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) == 0, ("free'ing inuse ctx")); + /* XXXAndrew clear the memory ? */ + free(ctx, M_FPUKERN_CTX); +} + +int +fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, u_int flags) +{ + struct pcb *pcb; + + pcb = td->td_pcb; + KASSERT(ctx == NULL || (ctx->flags & FPU_KERN_CTX_INUSE) == 0, + ("using inuse ctx")); + + if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) { + ctx->flags = FPU_KERN_CTX_DUMMY | FPU_KERN_CTX_INUSE; + return (0); + } + /* + * Check either we are already using the VFP in the kernel, or + * the the saved state points to the default user space. + */ + KASSERT((pcb->pcb_fpflags & PCB_FP_KERN) != 0 || + pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("Mangled pcb_fpusaved %x %p %p", pcb->pcb_fpflags, pcb->pcb_fpusaved, &pcb->pcb_fpustate)); + ctx->flags = FPU_KERN_CTX_INUSE; + vfp_save_state(curthread, pcb); + ctx->prev = pcb->pcb_fpusaved; + pcb->pcb_fpusaved = &ctx->state; + pcb->pcb_fpflags |= PCB_FP_KERN; + pcb->pcb_fpflags &= ~PCB_FP_STARTED; + + return (0); +} + +int +fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx) +{ + struct pcb *pcb; + + pcb = td->td_pcb; + + KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, + ("FPU context not inuse")); + ctx->flags &= ~FPU_KERN_CTX_INUSE; + + if (is_fpu_kern_thread(0) && + (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) + return (0); + KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, ("dummy ctx")); + critical_enter(); + vfp_discard(td); + critical_exit(); + pcb->pcb_fpflags &= ~PCB_FP_STARTED; + pcb->pcb_fpusaved = ctx->prev; + + if (pcb->pcb_fpusaved == &pcb->pcb_fpustate) { + pcb->pcb_fpflags &= ~PCB_FP_KERN; + } else { + KASSERT((pcb->pcb_fpflags & PCB_FP_KERN) != 0, + ("unpaired fpu_kern_leave")); + } + + return (0); +} + +int +fpu_kern_thread(u_int flags) +{ + struct pcb *pcb = curthread->td_pcb; + + KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, + ("Only kthread may use fpu_kern_thread")); + KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("Mangled pcb_fpusaved")); + KASSERT((pcb->pcb_fpflags & PCB_FP_KERN) == 0, + ("Thread already setup for the VFP")); + pcb->pcb_fpflags |= PCB_FP_KERN; + return (0); +} + +int +is_fpu_kern_thread(u_int flags) +{ + struct pcb *curpcb; + + if ((curthread->td_pflags & TDP_KTHREAD) == 0) + return (0); + curpcb = curthread->td_pcb; + return ((curpcb->pcb_fpflags & PCB_FP_KERN) != 0); +} #endif Modified: head/sys/arm64/include/pcb.h ============================================================================== --- head/sys/arm64/include/pcb.h Thu Oct 20 09:06:39 2016 (r307666) +++ head/sys/arm64/include/pcb.h Thu Oct 20 09:22:10 2016 (r307667) @@ -54,6 +54,7 @@ struct pcb { struct vfpstate *pcb_fpusaved; int pcb_fpflags; #define PCB_FP_STARTED 0x01 +#define PCB_FP_KERN 0x02 /* The bits passed to userspace in get_fpcontext */ #define PCB_FP_USERMASK (PCB_FP_STARTED) u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */ Modified: head/sys/arm64/include/vfp.h ============================================================================== --- head/sys/arm64/include/vfp.h Thu Oct 20 09:06:39 2016 (r307666) +++ head/sys/arm64/include/vfp.h Thu Oct 20 09:22:10 2016 (r307667) @@ -45,6 +45,23 @@ void vfp_init(void); void vfp_discard(struct thread *); void vfp_restore_state(void); void vfp_save_state(struct thread *, struct pcb *); + +struct fpu_kern_ctx; + +/* + * Flags for fpu_kern_alloc_ctx(), fpu_kern_enter() and fpu_kern_thread(). + */ +#define FPU_KERN_NORMAL 0x0000 +#define FPU_KERN_NOWAIT 0x0001 +#define FPU_KERN_KTHR 0x0002 + +struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int); +void fpu_kern_free_ctx(struct fpu_kern_ctx *); +int fpu_kern_enter(struct thread *, struct fpu_kern_ctx *, u_int); +int fpu_kern_leave(struct thread *, struct fpu_kern_ctx *); +int fpu_kern_thread(u_int); +int is_fpu_kern_thread(u_int); + #endif #endif Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Thu Oct 20 09:06:39 2016 (r307666) +++ head/sys/opencrypto/crypto.c Thu Oct 20 09:22:10 2016 (r307667) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include "cryptodev_if.h" -#if defined(__i386__) || defined(__amd64__) +#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) #include #endif @@ -1246,7 +1246,7 @@ crypto_proc(void) u_int32_t hid; int result, hint; -#if defined(__i386__) || defined(__amd64__) +#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) fpu_kern_thread(FPU_KERN_NORMAL); #endif From owner-svn-src-head@freebsd.org Thu Oct 20 11:24:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE47DC1A9C5; Thu, 20 Oct 2016 11:24:00 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 9DAF7C36; Thu, 20 Oct 2016 11:24:00 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KBNxjx069076; Thu, 20 Oct 2016 11:23:59 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KBNxGU069072; Thu, 20 Oct 2016 11:23:59 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201610201123.u9KBNxGU069072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 20 Oct 2016 11:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307668 - in head/sys: arm/annapurna/alpine boot/fdt/dts/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 11:24:00 -0000 Author: wma Date: Thu Oct 20 11:23:59 2016 New Revision: 307668 URL: https://svnweb.freebsd.org/changeset/base/307668 Log: Support for MSI-X on Annapurna Alpine This patch adds support for MSI-X interrupts on Annapurna Alpine platform. MSI-X on Alpine work similarly to GICv2m, i.e. some range of SPI interrupts is reserved in GIC and individual SPIs can be triggered by MSI-X messages. This SPI range is defined in FDT. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Reviewed by: nwhitehorn, wma Differential Revision: https://reviews.freebsd.org/D7579 Added: head/sys/arm/annapurna/alpine/alpine_pci_msix.c (contents, props changed) Modified: head/sys/boot/fdt/dts/arm/annapurna-alpine.dts head/sys/conf/files.arm head/sys/conf/files.arm64 Added: head/sys/arm/annapurna/alpine/alpine_pci_msix.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/annapurna/alpine/alpine_pci_msix.c Thu Oct 20 11:23:59 2016 (r307668) @@ -0,0 +1,394 @@ +/*- + * Copyright (c) 2015,2016 Annapurna Labs Ltd. and affiliates + * All rights reserved. + * + * Developed by Semihalf. + * + * 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 "msi_if.h" +#include "pic_if.h" + +#define AL_SPI_INTR 0 +#define AL_EDGE_HIGH 1 +#define ERR_NOT_IN_MAP -1 +#define IRQ_OFFSET 1 +#define GIC_INTR_CELL_CNT 3 +#define INTR_RANGE_COUNT 2 +#define MAX_MSIX_COUNT 160 + +static int al_msix_attach(device_t); +static int al_msix_probe(device_t); + +static msi_alloc_msi_t al_msix_alloc_msi; +static msi_release_msi_t al_msix_release_msi; +static msi_alloc_msix_t al_msix_alloc_msix; +static msi_release_msix_t al_msix_release_msix; +static msi_map_msi_t al_msix_map_msi; + +static int al_find_intr_pos_in_map(device_t, struct intr_irqsrc *); + +static struct ofw_compat_data compat_data[] = { + {"annapurna-labs,al-msix", true}, + {"annapurna-labs,alpine-msix", true}, + {NULL, false} +}; + +/* + * Bus interface definitions. + */ +static device_method_t al_msix_methods[] = { + DEVMETHOD(device_probe, al_msix_probe), + DEVMETHOD(device_attach, al_msix_attach), + + /* Interrupt controller interface */ + DEVMETHOD(msi_alloc_msi, al_msix_alloc_msi), + DEVMETHOD(msi_release_msi, al_msix_release_msi), + DEVMETHOD(msi_alloc_msix, al_msix_alloc_msix), + DEVMETHOD(msi_release_msix, al_msix_release_msix), + DEVMETHOD(msi_map_msi, al_msix_map_msi), + + DEVMETHOD_END +}; + +struct al_msix_softc { + bus_addr_t base_addr; + struct resource *res; + uint32_t irq_min; + uint32_t irq_max; + uint32_t irq_count; + struct mtx msi_mtx; + vmem_t *irq_alloc; + device_t gic_dev; + /* Table of isrcs maps isrc pointer to vmem_alloc'd irq number */ + struct intr_irqsrc *isrcs[MAX_MSIX_COUNT]; +}; + +static driver_t al_msix_driver = { + "al_msix", + al_msix_methods, + sizeof(struct al_msix_softc), +}; + +devclass_t al_msix_devclass; + +DRIVER_MODULE(al_msix, ofwbus, al_msix_driver, al_msix_devclass, 0, 0); +DRIVER_MODULE(al_msix, simplebus, al_msix_driver, al_msix_devclass, 0, 0); + +MALLOC_DECLARE(M_AL_MSIX); +MALLOC_DEFINE(M_AL_MSIX, "al_msix", "Alpine MSIX"); + +static int +al_msix_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "Annapurna-Labs MSI-X Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +al_msix_attach(device_t dev) +{ + struct al_msix_softc *sc; + device_t gic_dev; + phandle_t iparent; + phandle_t node; + intptr_t xref; + int interrupts[INTR_RANGE_COUNT]; + int nintr, i, rid; + uint32_t icells, *intr; + + sc = device_get_softc(dev); + + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, dev); + + rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "Failed to allocate resource\n"); + return (ENXIO); + } + + sc->base_addr = (bus_addr_t)rman_get_start(sc->res); + + /* Register this device to handle MSI interrupts */ + if (intr_msi_register(dev, xref) != 0) { + device_printf(dev, "could not register MSI-X controller\n"); + return (ENXIO); + } + else + device_printf(dev, "MSI-X controller registered\n"); + + /* Find root interrupt controller */ + iparent = ofw_bus_find_iparent(node); + if (iparent == 0) { + device_printf(dev, "No interrupt-parrent found. " + "Error in DTB\n"); + return (ENXIO); + } else { + /* While at parent - store interrupt cells prop */ + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "DTB: Missing #interrupt-cells " + "property in GIC node\n"); + return (ENXIO); + } + } + + gic_dev = OF_device_from_xref(iparent); + if (gic_dev == NULL) { + device_printf(dev, "Cannot find GIC device\n"); + return (ENXIO); + } + sc->gic_dev = gic_dev; + + /* Manually read range of interrupts from DTB */ + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr == 0) { + device_printf(dev, "Cannot read interrupts prop from DTB\n"); + return (ENXIO); + } else if ((nintr / icells) != INTR_RANGE_COUNT) { + /* Supposed to have min and max value only */ + device_printf(dev, "Unexpected count of interrupts " + "in DTB node\n"); + return (EINVAL); + } + + /* Read interrupt range values */ + for (i = 0; i < INTR_RANGE_COUNT; i++) + interrupts[i] = intr[(i * icells) + IRQ_OFFSET]; + + sc->irq_min = interrupts[0]; + sc->irq_max = interrupts[1]; + sc->irq_count = (sc->irq_max - sc->irq_min + 1); + + if (sc->irq_count > MAX_MSIX_COUNT) { + device_printf(dev, "Available MSI-X count exceeds buffer size." + " Capping to %d\n", MAX_MSIX_COUNT); + sc->irq_count = MAX_MSIX_COUNT; + } + + mtx_init(&sc->msi_mtx, "msi_mtx", NULL, MTX_DEF); + + sc->irq_alloc = vmem_create("Alpine MSI-X IRQs", 0, sc->irq_count, + 1, 0, M_FIRSTFIT | M_WAITOK); + + device_printf(dev, "MSI-X SPI IRQ %d-%d\n", sc->irq_min, sc->irq_max); + + return (bus_generic_attach(dev)); +} + +static int +al_find_intr_pos_in_map(device_t dev, struct intr_irqsrc *isrc) +{ + struct al_msix_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < MAX_MSIX_COUNT; i++) + if (sc->isrcs[i] == isrc) + return (i); + return (ERR_NOT_IN_MAP); +} + +static int +al_msix_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct al_msix_softc *sc; + int i, spi; + + sc = device_get_softc(dev); + + i = al_find_intr_pos_in_map(dev, isrc); + if (i == ERR_NOT_IN_MAP) + return (EINVAL); + + spi = sc->irq_min + i; + + /* + * MSIX message address format: + * [63:20] - MSIx TBAR + * Same value as the MSIx Translation Base Address Register + * [19] - WFE_EXIT + * Once set by MSIx message, an EVENTI is signal to the CPUs + * cluster specified by ‘Local GIC Target List’ + * [18:17] - Target GIC ID + * Specifies which IO-GIC (external shared GIC) is targeted + * 0: Local GIC, as specified by the Local GIC Target List + * 1: IO-GIC 0 + * 2: Reserved + * 3: Reserved + * [16:13] - Local GIC Target List + * Specifies the Local GICs list targeted by this MSIx + * message. + * [16] If set, SPIn is set in Cluster 0 local GIC + * [15:13] Reserved + * [15] If set, SPIn is set in Cluster 1 local GIC + * [14] If set, SPIn is set in Cluster 2 local GIC + * [13] If set, SPIn is set in Cluster 3 local GIC + * [12:3] - SPIn + * Specifies the SPI (Shared Peripheral Interrupt) index to + * be set in target GICs + * Notes: + * If targeting any local GIC than only SPI[249:0] are valid + * [2] - Function vector + * MSI Data vector extension hint + * [1:0] - Reserved + * Must be set to zero + */ + *addr = (uint64_t)sc->base_addr + (uint64_t)((1 << 16) + (spi << 3)); + *data = 0; + + if (bootverbose) + device_printf(dev, "MSI mapping: SPI: %d addr: %jx data: %x\n", + spi, (uintmax_t)*addr, *data); + return (0); +} + +static int +al_msix_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct intr_map_data_fdt *fdt_data; + struct al_msix_softc *sc; + vmem_addr_t irq_base; + int error; + u_int i, j; + + sc = device_get_softc(dev); + + if ((powerof2(count) == 0) || (count > 8)) + return (EINVAL); + + if (vmem_alloc(sc->irq_alloc, count, M_FIRSTFIT | M_NOWAIT, + &irq_base) != 0) + return (ENOMEM); + + /* Fabricate OFW data to get ISRC from GIC and return it */ + fdt_data = malloc(sizeof(*fdt_data) + + GIC_INTR_CELL_CNT * sizeof(pcell_t), M_AL_MSIX, M_WAITOK); + fdt_data->hdr.type = INTR_MAP_DATA_FDT; + fdt_data->iparent = 0; + fdt_data->ncells = GIC_INTR_CELL_CNT; + fdt_data->cells[0] = AL_SPI_INTR; /* code for SPI interrupt */ + fdt_data->cells[1] = 0; /* SPI number (uninitialized) */ + fdt_data->cells[2] = AL_EDGE_HIGH; /* trig = edge, pol = high */ + + mtx_lock(&sc->msi_mtx); + + for (i = irq_base; i < irq_base + count; i++) { + fdt_data->cells[1] = sc->irq_min + i; + error = PIC_MAP_INTR(sc->gic_dev, + (struct intr_map_data *)fdt_data, srcs); + if (error) { + for (j = irq_base; j < i; j++) + sc->isrcs[j] = NULL; + mtx_unlock(&sc->msi_mtx); + vmem_free(sc->irq_alloc, irq_base, count); + free(fdt_data, M_AL_MSIX); + return (error); + } + + sc->isrcs[i] = *srcs; + srcs++; + } + + mtx_unlock(&sc->msi_mtx); + free(fdt_data, M_AL_MSIX); + + if (bootverbose) + device_printf(dev, + "MSI-X allocation: start SPI %d, count %d\n", + (int)irq_base + sc->irq_min, count); + + *pic = sc->gic_dev; + + return (0); +} + +static int +al_msix_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **srcs) +{ + struct al_msix_softc *sc; + int i, pos; + + sc = device_get_softc(dev); + + mtx_lock(&sc->msi_mtx); + + pos = al_find_intr_pos_in_map(dev, *srcs); + vmem_free(sc->irq_alloc, pos, count); + for (i = 0; i < count; i++) { + pos = al_find_intr_pos_in_map(dev, *srcs); + if (pos != ERR_NOT_IN_MAP) + sc->isrcs[pos] = NULL; + srcs++; + } + + mtx_unlock(&sc->msi_mtx); + + return (0); +} + +static int +al_msix_alloc_msix(device_t dev, device_t child, device_t *pic, + struct intr_irqsrc **isrcp) +{ + + return (al_msix_alloc_msi(dev, child, 1, 1, pic, isrcp)); +} + +static int +al_msix_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +{ + + return (al_msix_release_msi(dev, child, 1, &isrc)); +} Modified: head/sys/boot/fdt/dts/arm/annapurna-alpine.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/annapurna-alpine.dts Thu Oct 20 09:22:10 2016 (r307667) +++ head/sys/boot/fdt/dts/arm/annapurna-alpine.dts Thu Oct 20 11:23:59 2016 (r307668) @@ -170,6 +170,16 @@ }; }; + /* MSIX Configuration */ + msix: msix { + compatible = "annapurna-labs,al-msix"; + #address-cells = <2>; + #size-cells = <1>; + reg = <0xfbe00000 0x100000>; + interrupts = <0 96 1 0 159 1>; + interrupt-parent = <&MPIC>; + }; + pcie-internal { compatible = "annapurna-labs,al-internal-pcie"; device_type = "pci"; @@ -182,6 +192,7 @@ <0x3800 0 0 1 &MPIC 0 36 4>, <0x4000 0 0 1 &MPIC 0 43 4>, // SATA 0 (PCIe expander) <0x4800 0 0 1 &MPIC 0 44 1>; // SATA 1 (onboard) + msi-parent = <&msix>; // ranges: // - ECAM - non prefetchable config space Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Oct 20 09:22:10 2016 (r307667) +++ head/sys/conf/files.arm Thu Oct 20 11:23:59 2016 (r307668) @@ -14,6 +14,7 @@ cloudabi32_vdso_blob.o optional compat_ arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt arm/annapurna/alpine/alpine_pci.c optional al_pci fdt +arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt arm/arm/autoconf.c standard arm/arm/bcopy_page.S standard arm/arm/bcopyinout.S standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Oct 20 09:22:10 2016 (r307667) +++ head/sys/conf/files.arm64 Thu Oct 20 11:23:59 2016 (r307668) @@ -41,6 +41,7 @@ arm/allwinner/if_awg.c optional awg arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt arm/annapurna/alpine/alpine_pci.c optional al_pci fdt +arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_fdt.c optional fdt From owner-svn-src-head@freebsd.org Thu Oct 20 11:26:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0527DC1AA94; Thu, 20 Oct 2016 11:26:53 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B9D67E5F; Thu, 20 Oct 2016 11:26:52 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KBQp3x069216; Thu, 20 Oct 2016 11:26:51 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KBQpX7069210; Thu, 20 Oct 2016 11:26:51 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201610201126.u9KBQpX7069210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 20 Oct 2016 11:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307669 - in head/sys: arm/annapurna/alpine boot/fdt/dts/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 11:26:53 -0000 Author: wma Date: Thu Oct 20 11:26:51 2016 New Revision: 307669 URL: https://svnweb.freebsd.org/changeset/base/307669 Log: Support for Alpine Serializer/Deserializer. The exported functions will be used by Alpine Ethernet driver. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Reviewed by: wma Differential Revision: https://reviews.freebsd.org/D7763 Added: head/sys/arm/annapurna/alpine/alpine_serdes.c (contents, props changed) head/sys/arm/annapurna/alpine/alpine_serdes.h (contents, props changed) Modified: head/sys/boot/fdt/dts/arm/annapurna-alpine.dts head/sys/conf/files.arm head/sys/conf/files.arm64 Added: head/sys/arm/annapurna/alpine/alpine_serdes.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/annapurna/alpine/alpine_serdes.c Thu Oct 20 11:26:51 2016 (r307669) @@ -0,0 +1,225 @@ +/*- + * Copyright (c) 2015,2016 Annapurna Labs Ltd. and affiliates + * All rights reserved. + * + * Developed by Semihalf. + * + * 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 "al_serdes.h" +#include "alpine_serdes.h" + +#define SERDES_NUM_GROUPS 5 + +static void *serdes_base; +static uint32_t serdes_grp_offset[] = {0, 0x400, 0x800, 0xc00, 0x2000}; + +static struct alpine_serdes_eth_group_mode { + struct mtx lock; + enum alpine_serdes_eth_mode mode; + bool mode_set; +} alpine_serdes_eth_group_mode[SERDES_NUM_GROUPS]; + +static int al_serdes_probe(device_t dev); +static int al_serdes_attach(device_t dev); +static int al_serdes_detach(device_t dev); + +static struct resource_spec al_serdes_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +struct al_serdes_softc { + struct resource *res; +}; + +static device_method_t al_serdes_methods[] = { + DEVMETHOD(device_probe, al_serdes_probe), + DEVMETHOD(device_attach, al_serdes_attach), + DEVMETHOD(device_detach, al_serdes_detach), + + DEVMETHOD_END +}; + +static driver_t al_serdes_driver = { + "serdes", + al_serdes_methods, + sizeof(struct al_serdes_softc) +}; + +static devclass_t al_serdes_devclass; + +DRIVER_MODULE(al_serdes, simplebus, al_serdes_driver, + al_serdes_devclass, 0, 0); +DRIVER_MODULE(al_serdes, ofwbus, al_serdes_driver, + al_serdes_devclass, 0, 0); + +static int +al_serdes_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "annapurna-labs,al-serdes")) + return (ENXIO); + + device_set_desc(dev, "Alpine Serdes"); + + return (BUS_PROBE_DEFAULT); +} + +static int +al_serdes_attach(device_t dev) +{ + struct al_serdes_softc *sc; + int err; + + sc = device_get_softc(dev); + + err = bus_alloc_resources(dev, al_serdes_spec, &sc->res); + if (err != 0) { + device_printf(dev, "could not allocate resources\n"); + return (err); + } + + /* Initialize Serdes group locks and mode */ + for (int i = 0; i < nitems(alpine_serdes_eth_group_mode); i++) { + mtx_init(&alpine_serdes_eth_group_mode[i].lock, "AlSerdesMtx", + NULL, MTX_DEF); + alpine_serdes_eth_group_mode[i].mode_set = false; + } + + serdes_base = (void *)rman_get_bushandle(sc->res); + + return (0); +} + +static int +al_serdes_detach(device_t dev) +{ + struct al_serdes_softc *sc; + + sc = device_get_softc(dev); + + bus_release_resources(dev, al_serdes_spec, &sc->res); + + for (int i = 0; i < nitems(alpine_serdes_eth_group_mode); i++) { + mtx_destroy(&alpine_serdes_eth_group_mode[i].lock); + alpine_serdes_eth_group_mode[i].mode_set = false; + } + + return (0); +} + +void * +alpine_serdes_resource_get(uint32_t group) +{ + void *base; + + base = NULL; + if (group >= SERDES_NUM_GROUPS) + return (NULL); + + if (serdes_base != NULL) + base = (void *)((uintptr_t)serdes_base + + serdes_grp_offset[group]); + + return (base); +} + +int +alpine_serdes_eth_mode_set(uint32_t group, enum alpine_serdes_eth_mode mode) +{ + struct alpine_serdes_eth_group_mode *group_mode; + + group_mode = &alpine_serdes_eth_group_mode[group]; + + if (serdes_base == NULL) + return (EINVAL); + + if (group >= SERDES_NUM_GROUPS) + return (EINVAL); + + mtx_lock(&group_mode->lock); + + if (!group_mode->mode_set || (group_mode->mode != mode)) { + struct al_serdes_grp_obj obj; + + al_serdes_handle_grp_init(alpine_serdes_resource_get(group), + group, &obj); + + if (mode == ALPINE_SERDES_ETH_MODE_SGMII) + obj.mode_set_sgmii(&obj); + else + obj.mode_set_kr(&obj); + + group_mode->mode = mode; + group_mode->mode_set = true; + } + + mtx_unlock(&group_mode->lock); + + return (0); +} + +void +alpine_serdes_eth_group_lock(uint32_t group) +{ + struct alpine_serdes_eth_group_mode *group_mode; + + group_mode = &alpine_serdes_eth_group_mode[group]; + + if (mtx_initialized(&group_mode->lock) == 0) + return; + + mtx_lock(&group_mode->lock); +} + +void +alpine_serdes_eth_group_unlock(uint32_t group) +{ + struct alpine_serdes_eth_group_mode *group_mode; + + group_mode = &alpine_serdes_eth_group_mode[group]; + + if (mtx_initialized(&group_mode->lock) == 0) + return; + + mtx_unlock(&group_mode->lock); +} Added: head/sys/arm/annapurna/alpine/alpine_serdes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/annapurna/alpine/alpine_serdes.h Thu Oct 20 11:26:51 2016 (r307669) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2015,2016 Annapurna Labs Ltd. and affiliates + * All rights reserved. + * + * Developed by Semihalf. + * + * 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 __ALPINE_SERDES_H__ +#define __ALPINE_SERDES_H__ + +/* SerDes ETH mode */ +enum alpine_serdes_eth_mode { + ALPINE_SERDES_ETH_MODE_SGMII, + ALPINE_SERDES_ETH_MODE_KR, +}; + +/* + * Get SerDes group regs base, to be used in relevant Alpine drivers. + * Valid group is 0..3. + * Returns virtual base address of the group regs base. + */ +void *alpine_serdes_resource_get(uint32_t group); + +/* + * Set SerDes ETH mode for an entire group, unless already set + * Valid group is 0..3. + * Returns 0 upon success. + */ +int alpine_serdes_eth_mode_set(uint32_t group, + enum alpine_serdes_eth_mode mode); + +/* Lock the all serdes group for using common registers */ +void alpine_serdes_eth_group_lock(uint32_t group); + +/* Unlock the all serdes group for using common registers */ +void alpine_serdes_eth_group_unlock(uint32_t group); + +#endif /* __ALPINE_SERDES_H__ */ Modified: head/sys/boot/fdt/dts/arm/annapurna-alpine.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/annapurna-alpine.dts Thu Oct 20 11:23:59 2016 (r307668) +++ head/sys/boot/fdt/dts/arm/annapurna-alpine.dts Thu Oct 20 11:26:51 2016 (r307669) @@ -159,6 +159,12 @@ interrupt-parent = <&MPIC>; }; + /* SerDes */ + serdes { + compatible = "annapurna-labs,al-serdes"; + reg = <0x28c0000 0x1000>; + }; + serial0: serial@2883000 { compatible = "ns16550"; reg = <0x2883000 0x20>; Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Oct 20 11:23:59 2016 (r307668) +++ head/sys/conf/files.arm Thu Oct 20 11:26:51 2016 (r307669) @@ -15,6 +15,9 @@ arm/annapurna/alpine/alpine_ccu.c optio arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt arm/annapurna/alpine/alpine_pci.c optional al_pci fdt arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt +arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" arm/arm/autoconf.c standard arm/arm/bcopy_page.S standard arm/arm/bcopyinout.S standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Oct 20 11:23:59 2016 (r307668) +++ head/sys/conf/files.arm64 Thu Oct 20 11:26:51 2016 (r307669) @@ -42,6 +42,9 @@ arm/annapurna/alpine/alpine_ccu.c optio arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt arm/annapurna/alpine/alpine_pci.c optional al_pci fdt arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt +arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_fdt.c optional fdt From owner-svn-src-head@freebsd.org Thu Oct 20 11:31:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2B31C1ADAD; Thu, 20 Oct 2016 11:31:12 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8EFF22CC; Thu, 20 Oct 2016 11:31:12 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KBVB15070093; Thu, 20 Oct 2016 11:31:11 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KBVBDk070088; Thu, 20 Oct 2016 11:31:11 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201610201131.u9KBVBDk070088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 20 Oct 2016 11:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307670 - in head/sys: arm/conf arm64/conf conf dev/al_eth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 11:31:12 -0000 Author: wma Date: Thu Oct 20 11:31:11 2016 New Revision: 307670 URL: https://svnweb.freebsd.org/changeset/base/307670 Log: Driver for PCI Ethernet NIC on Alpine V1 and V2. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Reviewed by: wma Differential Revision: https://reviews.freebsd.org/D7814 Added: head/sys/dev/al_eth/ head/sys/dev/al_eth/al_eth.c (contents, props changed) head/sys/dev/al_eth/al_eth.h (contents, props changed) head/sys/dev/al_eth/al_init_eth_kr.c (contents, props changed) head/sys/dev/al_eth/al_init_eth_kr.h (contents, props changed) head/sys/dev/al_eth/al_init_eth_lm.c (contents, props changed) head/sys/dev/al_eth/al_init_eth_lm.h (contents, props changed) Modified: head/sys/arm/conf/ALPINE head/sys/arm64/conf/GENERIC head/sys/conf/files Modified: head/sys/arm/conf/ALPINE ============================================================================== --- head/sys/arm/conf/ALPINE Thu Oct 20 11:26:51 2016 (r307669) +++ head/sys/arm/conf/ALPINE Thu Oct 20 11:31:11 2016 (r307670) @@ -35,6 +35,9 @@ options INTRNG # Annapurna Alpine drivers device al_ccu # Alpine Cache Coherency Unit device al_nb_service # Alpine North Bridge Service +device al_iofic # I/O Fabric Interrupt Controller +device al_serdes # Serializer/Deserializer +device al_udma # Universal DMA # Pseudo devices device loop @@ -69,6 +72,7 @@ device al_pci # Annapurna Alpine PCI-E device ether device mii device bpf +device al_eth # Annapurna Alpine Ethernet NIC options DEVICE_POLLING # USB ethernet support, requires miibus Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu Oct 20 11:26:51 2016 (r307669) +++ head/sys/arm64/conf/GENERIC Thu Oct 20 11:31:11 2016 (r307670) @@ -94,6 +94,9 @@ options SOC_HISI_HI6220 # Annapurna Alpine drivers device al_ccu # Alpine Cache Coherency Unit device al_nb_service # Alpine North Bridge Service +device al_iofic # I/O Fabric Interrupt Controller +device al_serdes # Serializer/Deserializer +device al_udma # Universal DMA # VirtIO support device virtio @@ -119,6 +122,7 @@ device igb # Intel PRO/1000 PCIE Serve device ix # Intel 10Gb Ethernet Family device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device vnic # Cavium ThunderX NIC +device al_eth # Annapurna Alpine Ethernet NIC # Block devices device ahci Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 20 11:26:51 2016 (r307669) +++ head/sys/conf/files Thu Oct 20 11:31:11 2016 (r307670) @@ -709,6 +709,45 @@ dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/aic7xxx/aic7xxx_reg_print.c optional ahc ahc_reg_pretty_print +dev/al_eth/al_eth.c optional al_eth \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +dev/al_eth/al_init_eth_lm.c optional al_eth \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +dev/al_eth/al_init_eth_kr.c optional al_eth \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_hal_iofic.c optional al_iofic \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_hal_serdes_25g.c optional al_serdes \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_hal_serdes_hssp.c optional al_serdes \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_config.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_debug.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_iofic.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_main.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/al_serdes.c optional al_serdes \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/eth/al_hal_eth_kr.c optional al_eth \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" +contrib/alpine-hal/eth/al_hal_eth_main.c optional al_eth \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/alpm/alpm.c optional alpm pci Added: head/sys/dev/al_eth/al_eth.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/al_eth/al_eth.c Thu Oct 20 11:31:11 2016 (r307670) @@ -0,0 +1,3584 @@ +/*- + * Copyright (c) 2015,2016 Annapurna Labs Ltd. and affiliates + * All rights reserved. + * + * Developed by Semihalf. + * + * 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 +#include + +#include + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef INET +#include +#include +#include +#include +#endif + +#ifdef INET6 +#include +#endif + +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "al_eth.h" +#include "al_init_eth_lm.h" +#include "arm/annapurna/alpine/alpine_serdes.h" + +#include "miibus_if.h" + +#define device_printf_dbg(fmt, ...) do { \ + if (AL_DBG_LEVEL >= AL_DBG_LEVEL_DBG) { AL_DBG_LOCK(); \ + device_printf(fmt, __VA_ARGS__); AL_DBG_UNLOCK();} \ + } while (0) + +MALLOC_DEFINE(M_IFAL, "if_al_malloc", "All allocated data for AL ETH driver"); + +/* move out to some pci header file */ +#define PCI_VENDOR_ID_ANNAPURNA_LABS 0x1c36 +#define PCI_DEVICE_ID_AL_ETH 0x0001 +#define PCI_DEVICE_ID_AL_ETH_ADVANCED 0x0002 +#define PCI_DEVICE_ID_AL_ETH_NIC 0x0003 +#define PCI_DEVICE_ID_AL_ETH_FPGA_NIC 0x0030 +#define PCI_DEVICE_ID_AL_CRYPTO 0x0011 +#define PCI_DEVICE_ID_AL_CRYPTO_VF 0x8011 +#define PCI_DEVICE_ID_AL_RAID_DMA 0x0021 +#define PCI_DEVICE_ID_AL_RAID_DMA_VF 0x8021 +#define PCI_DEVICE_ID_AL_USB 0x0041 + +#define MAC_ADDR_STR "%02x:%02x:%02x:%02x:%02x:%02x" +#define MAC_ADDR(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5] + +#define AL_ETH_MAC_TABLE_UNICAST_IDX_BASE 0 +#define AL_ETH_MAC_TABLE_UNICAST_MAX_COUNT 4 +#define AL_ETH_MAC_TABLE_ALL_MULTICAST_IDX (AL_ETH_MAC_TABLE_UNICAST_IDX_BASE + \ + AL_ETH_MAC_TABLE_UNICAST_MAX_COUNT) + +#define AL_ETH_MAC_TABLE_DROP_IDX (AL_ETH_FWD_MAC_NUM - 1) +#define AL_ETH_MAC_TABLE_BROADCAST_IDX (AL_ETH_MAC_TABLE_DROP_IDX - 1) + +#define AL_ETH_THASH_UDMA_SHIFT 0 +#define AL_ETH_THASH_UDMA_MASK (0xF << AL_ETH_THASH_UDMA_SHIFT) + +#define AL_ETH_THASH_Q_SHIFT 4 +#define AL_ETH_THASH_Q_MASK (0x3 << AL_ETH_THASH_Q_SHIFT) + +/* the following defines should be moved to hal */ +#define AL_ETH_FSM_ENTRY_IPV4_TCP 0 +#define AL_ETH_FSM_ENTRY_IPV4_UDP 1 +#define AL_ETH_FSM_ENTRY_IPV6_TCP 2 +#define AL_ETH_FSM_ENTRY_IPV6_UDP 3 +#define AL_ETH_FSM_ENTRY_IPV6_NO_UDP_TCP 4 +#define AL_ETH_FSM_ENTRY_IPV4_NO_UDP_TCP 5 + +/* FSM DATA format */ +#define AL_ETH_FSM_DATA_OUTER_2_TUPLE 0 +#define AL_ETH_FSM_DATA_OUTER_4_TUPLE 1 +#define AL_ETH_FSM_DATA_INNER_2_TUPLE 2 +#define AL_ETH_FSM_DATA_INNER_4_TUPLE 3 + +#define AL_ETH_FSM_DATA_HASH_SEL (1 << 2) + +#define AL_ETH_FSM_DATA_DEFAULT_Q 0 +#define AL_ETH_FSM_DATA_DEFAULT_UDMA 0 + +#define AL_BR_SIZE 512 +#define AL_TSO_SIZE 65500 +#define AL_DEFAULT_MTU 1500 + +#define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) + +#define AL_IP_ALIGNMENT_OFFSET 2 + +#define SFP_I2C_ADDR 0x50 + +#define AL_MASK_GROUP_A_INT 0x7 +#define AL_MASK_GROUP_B_INT 0xF +#define AL_MASK_GROUP_C_INT 0xF +#define AL_MASK_GROUP_D_INT 0xFFFFFFFF + +#define AL_REG_OFFSET_FORWARD_INTR (0x1800000 + 0x1210) +#define AL_EN_FORWARD_INTR 0x1FFFF +#define AL_DIS_FORWARD_INTR 0 + +#define AL_M2S_MASK_INIT 0x480 +#define AL_S2M_MASK_INIT 0x1E0 +#define AL_M2S_S2M_MASK_NOT_INT (0x3f << 25) + +#define AL_10BASE_T_SPEED 10 +#define AL_100BASE_TX_SPEED 100 +#define AL_1000BASE_T_SPEED 1000 + +static devclass_t al_devclass; + +#define AL_RX_LOCK_INIT(_sc) mtx_init(&((_sc)->if_rx_lock), "ALRXL", "ALRXL", MTX_DEF) +#define AL_RX_LOCK(_sc) mtx_lock(&((_sc)->if_rx_lock)) +#define AL_RX_UNLOCK(_sc) mtx_unlock(&((_sc)->if_rx_lock)) + +/* helper functions */ +static int al_is_device_supported(device_t); + +static void al_eth_init_rings(struct al_eth_adapter *); +static void al_eth_flow_ctrl_disable(struct al_eth_adapter *); +int al_eth_fpga_read_pci_config(void *, int, uint32_t *); +int al_eth_fpga_write_pci_config(void *, int, uint32_t); +int al_eth_read_pci_config(void *, int, uint32_t *); +int al_eth_write_pci_config(void *, int, uint32_t); +void al_eth_irq_config(uint32_t *, uint32_t); +void al_eth_forward_int_config(uint32_t *, uint32_t); +static void al_eth_start_xmit(void *, int); +static void al_eth_rx_recv_work(void *, int); +static int al_eth_up(struct al_eth_adapter *); +static void al_eth_down(struct al_eth_adapter *); +static void al_eth_interrupts_unmask(struct al_eth_adapter *); +static void al_eth_interrupts_mask(struct al_eth_adapter *); +static int al_eth_check_mtu(struct al_eth_adapter *, int); +static uint64_t al_get_counter(struct ifnet *, ift_counter); +static void al_eth_req_rx_buff_size(struct al_eth_adapter *, int); +static int al_eth_board_params_init(struct al_eth_adapter *); +static int al_media_update(struct ifnet *); +static void al_media_status(struct ifnet *, struct ifmediareq *); +static int al_eth_function_reset(struct al_eth_adapter *); +static int al_eth_hw_init_adapter(struct al_eth_adapter *); +static void al_eth_serdes_init(struct al_eth_adapter *); +static void al_eth_lm_config(struct al_eth_adapter *); +static int al_eth_hw_init(struct al_eth_adapter *); + +static void al_tick_stats(void *); + +/* ifnet entry points */ +static void al_init(void *); +static int al_mq_start(struct ifnet *, struct mbuf *); +static void al_qflush(struct ifnet *); +static int al_ioctl(struct ifnet * ifp, u_long, caddr_t); + +/* bus entry points */ +static int al_probe(device_t); +static int al_attach(device_t); +static int al_detach(device_t); +static int al_shutdown(device_t); + +/* mii bus support routines */ +static int al_miibus_readreg(device_t, int, int); +static int al_miibus_writereg(device_t, int, int, int); +static void al_miibus_statchg(device_t); +static void al_miibus_linkchg(device_t); + +struct al_eth_adapter* g_adapters[16]; +uint32_t g_adapters_count; + +/* flag for napi-like mbuf processing, controlled from sysctl */ +static int napi = 0; + +static device_method_t al_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, al_probe), + DEVMETHOD(device_attach, al_attach), + DEVMETHOD(device_detach, al_detach), + DEVMETHOD(device_shutdown, al_shutdown), + + DEVMETHOD(miibus_readreg, al_miibus_readreg), + DEVMETHOD(miibus_writereg, al_miibus_writereg), + DEVMETHOD(miibus_statchg, al_miibus_statchg), + DEVMETHOD(miibus_linkchg, al_miibus_linkchg), + { 0, 0 } +}; + +static driver_t al_driver = { + "al", + al_methods, + sizeof(struct al_eth_adapter), +}; + +DRIVER_MODULE(al, pci, al_driver, al_devclass, 0, 0); +DRIVER_MODULE(miibus, al, miibus_driver, miibus_devclass, 0, 0); + +static int +al_probe(device_t dev) +{ + if ((al_is_device_supported(dev)) != 0) { + device_set_desc(dev, "al"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +al_attach(device_t dev) +{ + struct al_eth_lm_context *lm_context; + struct al_eth_adapter *adapter; + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct ifnet *ifp; + uint32_t dev_id; + uint32_t rev_id; + int bar_udma; + int bar_mac; + int bar_ec; + int err; + + err = 0; + ifp = NULL; + dev_id = rev_id = 0; + ctx = device_get_sysctl_ctx(dev); + tree = SYSCTL_PARENT(device_get_sysctl_tree(dev)); + child = SYSCTL_CHILDREN(tree); + + if (g_adapters_count == 0) { + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "napi", + CTLFLAG_RW, &napi, 0, "Use pseudo-napi mechanism"); + } + adapter = device_get_softc(dev); + adapter->dev = dev; + adapter->board_type = ALPINE_INTEGRATED; + snprintf(adapter->name, AL_ETH_NAME_MAX_LEN, "%s", + device_get_nameunit(dev)); + AL_RX_LOCK_INIT(adapter); + + g_adapters[g_adapters_count] = adapter; + + lm_context = &adapter->lm_context; + + bar_udma = PCIR_BAR(AL_ETH_UDMA_BAR); + adapter->udma_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &bar_udma, RF_ACTIVE); + if (adapter->udma_res == NULL) { + device_printf(adapter->dev, + "could not allocate memory resources for DMA.\n"); + err = ENOMEM; + goto err_res_dma; + } + adapter->udma_base = al_bus_dma_to_va(rman_get_bustag(adapter->udma_res), + rman_get_bushandle(adapter->udma_res)); + bar_mac = PCIR_BAR(AL_ETH_MAC_BAR); + adapter->mac_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &bar_mac, RF_ACTIVE); + if (adapter->mac_res == NULL) { + device_printf(adapter->dev, + "could not allocate memory resources for MAC.\n"); + err = ENOMEM; + goto err_res_mac; + } + adapter->mac_base = al_bus_dma_to_va(rman_get_bustag(adapter->mac_res), + rman_get_bushandle(adapter->mac_res)); + + bar_ec = PCIR_BAR(AL_ETH_EC_BAR); + adapter->ec_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &bar_ec, + RF_ACTIVE); + if (adapter->ec_res == NULL) { + device_printf(adapter->dev, + "could not allocate memory resources for EC.\n"); + err = ENOMEM; + goto err_res_ec; + } + adapter->ec_base = al_bus_dma_to_va(rman_get_bustag(adapter->ec_res), + rman_get_bushandle(adapter->ec_res)); + + adapter->netdev = ifp = if_alloc(IFT_ETHER); + + adapter->netdev->if_link_state = LINK_STATE_DOWN; + + ifp->if_softc = adapter; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_flags = ifp->if_drv_flags; + ifp->if_flags |= IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | IFF_ALLMULTI; + ifp->if_transmit = al_mq_start; + ifp->if_qflush = al_qflush; + ifp->if_ioctl = al_ioctl; + ifp->if_init = al_init; + ifp->if_get_counter = al_get_counter; + ifp->if_mtu = AL_DEFAULT_MTU; + + adapter->if_flags = ifp->if_flags; + + ifp->if_capabilities = ifp->if_capenable = 0; + + ifp->if_capabilities |= IFCAP_HWCSUM | + IFCAP_HWCSUM_IPV6 | IFCAP_TSO | + IFCAP_LRO | IFCAP_JUMBO_MTU; + + ifp->if_capenable = ifp->if_capabilities; + + adapter->id_number = g_adapters_count; + + if (adapter->board_type == ALPINE_INTEGRATED) { + dev_id = pci_get_device(adapter->dev); + rev_id = pci_get_revid(adapter->dev); + } else { + al_eth_fpga_read_pci_config(adapter->internal_pcie_base, + PCIR_DEVICE, &dev_id); + al_eth_fpga_read_pci_config(adapter->internal_pcie_base, + PCIR_REVID, &rev_id); + } + + adapter->dev_id = dev_id; + adapter->rev_id = rev_id; + + /* set default ring sizes */ + adapter->tx_ring_count = AL_ETH_DEFAULT_TX_SW_DESCS; + adapter->tx_descs_count = AL_ETH_DEFAULT_TX_HW_DESCS; + adapter->rx_ring_count = AL_ETH_DEFAULT_RX_DESCS; + adapter->rx_descs_count = AL_ETH_DEFAULT_RX_DESCS; + + adapter->num_tx_queues = AL_ETH_NUM_QUEUES; + adapter->num_rx_queues = AL_ETH_NUM_QUEUES; + + adapter->small_copy_len = AL_ETH_DEFAULT_SMALL_PACKET_LEN; + adapter->link_poll_interval = AL_ETH_DEFAULT_LINK_POLL_INTERVAL; + adapter->max_rx_buff_alloc_size = AL_ETH_DEFAULT_MAX_RX_BUFF_ALLOC_SIZE; + + al_eth_req_rx_buff_size(adapter, adapter->netdev->if_mtu); + + adapter->link_config.force_1000_base_x = AL_ETH_DEFAULT_FORCE_1000_BASEX; + + err = al_eth_board_params_init(adapter); + if (err != 0) + goto err; + + if (adapter->mac_mode == AL_ETH_MAC_MODE_10GbE_Serial) { + ifmedia_init(&adapter->media, IFM_IMASK, + al_media_update, al_media_status); + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_LX, 0, NULL); + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_LR, 0, NULL); + ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); + } + + al_eth_function_reset(adapter); + + err = al_eth_hw_init_adapter(adapter); + if (err != 0) + goto err; + + al_eth_init_rings(adapter); + g_adapters_count++; + + al_eth_lm_config(adapter); + mtx_init(&adapter->stats_mtx, "AlStatsMtx", NULL, MTX_DEF); + mtx_init(&adapter->wd_mtx, "AlWdMtx", NULL, MTX_DEF); + callout_init_mtx(&adapter->stats_callout, &adapter->stats_mtx, 0); + callout_init_mtx(&adapter->wd_callout, &adapter->wd_mtx, 0); + + ether_ifattach(ifp, adapter->mac_addr); + ifp->if_mtu = AL_DEFAULT_MTU; + + if (adapter->mac_mode == AL_ETH_MAC_MODE_RGMII) { + al_eth_hw_init(adapter); + + /* Attach PHY(s) */ + err = mii_attach(adapter->dev, &adapter->miibus, adapter->netdev, + al_media_update, al_media_status, BMSR_DEFCAPMASK, 0, + MII_OFFSET_ANY, 0); + if (err != 0) { + device_printf(adapter->dev, "attaching PHYs failed\n"); + return (err); + } + + adapter->mii = device_get_softc(adapter->miibus); + } + + return (err); + +err: + bus_release_resource(dev, SYS_RES_MEMORY, bar_ec, adapter->ec_res); +err_res_ec: + bus_release_resource(dev, SYS_RES_MEMORY, bar_mac, adapter->mac_res); +err_res_mac: + bus_release_resource(dev, SYS_RES_MEMORY, bar_udma, adapter->udma_res); +err_res_dma: + return (err); +} + +static int +al_detach(device_t dev) +{ + struct al_eth_adapter *adapter; + + adapter = device_get_softc(dev); + ether_ifdetach(adapter->netdev); + + mtx_destroy(&adapter->stats_mtx); + mtx_destroy(&adapter->wd_mtx); + + al_eth_down(adapter); + + bus_release_resource(dev, SYS_RES_IRQ, 0, adapter->irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, adapter->ec_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, adapter->mac_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, adapter->udma_res); + + return (0); +} + +int +al_eth_fpga_read_pci_config(void *handle, int where, uint32_t *val) +{ + + /* handle is the base address of the adapter */ + *val = al_reg_read32((void*)((u_long)handle + where)); + + return (0); +} + +int +al_eth_fpga_write_pci_config(void *handle, int where, uint32_t val) +{ + + /* handle is the base address of the adapter */ + al_reg_write32((void*)((u_long)handle + where), val); + return (0); +} + +int +al_eth_read_pci_config(void *handle, int where, uint32_t *val) +{ + + /* handle is a pci_dev */ + *val = pci_read_config((device_t)handle, where, sizeof(*val)); + return (0); +} + +int +al_eth_write_pci_config(void *handle, int where, uint32_t val) +{ + + /* handle is a pci_dev */ + pci_write_config((device_t)handle, where, val, sizeof(val)); + return (0); +} + +void +al_eth_irq_config(uint32_t *offset, uint32_t value) +{ + + al_reg_write32_relaxed(offset, value); +} + +void +al_eth_forward_int_config(uint32_t *offset, uint32_t value) +{ + + al_reg_write32(offset, value); +} + +static void +al_eth_serdes_init(struct al_eth_adapter *adapter) +{ + void __iomem *serdes_base; + + adapter->serdes_init = false; + + serdes_base = alpine_serdes_resource_get(adapter->serdes_grp); + if (serdes_base == NULL) { + device_printf(adapter->dev, "serdes_base get failed!\n"); + return; + } + + serdes_base = al_bus_dma_to_va(serdes_tag, serdes_base); + + al_serdes_handle_grp_init(serdes_base, adapter->serdes_grp, + &adapter->serdes_obj); + + adapter->serdes_init = true; +} + +static void +al_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + bus_addr_t *paddr; + + paddr = arg; + *paddr = segs->ds_addr; +} + +static int +al_dma_alloc_coherent(struct device *dev, bus_dma_tag_t *tag, bus_dmamap_t *map, + bus_addr_t *baddr, void **vaddr, uint32_t size) +{ + int ret; + uint32_t maxsize = ((size - 1)/PAGE_SIZE + 1) * PAGE_SIZE; + + ret = bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + maxsize, 1, maxsize, BUS_DMA_COHERENT, NULL, NULL, tag); + if (ret != 0) { + device_printf(dev, + "failed to create bus tag, ret = %d\n", ret); + return (ret); + } + + ret = bus_dmamem_alloc(*tag, vaddr, + BUS_DMA_COHERENT | BUS_DMA_ZERO, map); + if (ret != 0) { + device_printf(dev, + "failed to allocate dmamem, ret = %d\n", ret); + return (ret); + } + + ret = bus_dmamap_load(*tag, *map, *vaddr, + size, al_dma_map_addr, baddr, 0); + if (ret != 0) { + device_printf(dev, + "failed to allocate bus_dmamap_load, ret = %d\n", ret); + return (ret); + } + + return (0); +} + +static void +al_dma_free_coherent(bus_dma_tag_t tag, bus_dmamap_t map, void *vaddr) +{ + + bus_dmamap_unload(tag, map); + bus_dmamem_free(tag, vaddr, map); + bus_dma_tag_destroy(tag); +} + +static void +al_eth_mac_table_unicast_add(struct al_eth_adapter *adapter, + uint8_t idx, uint8_t *addr, uint8_t udma_mask) +{ + struct al_eth_fwd_mac_table_entry entry = { { 0 } }; + + memcpy(entry.addr, adapter->mac_addr, sizeof(adapter->mac_addr)); + + memset(entry.mask, 0xff, sizeof(entry.mask)); + entry.rx_valid = true; + entry.tx_valid = false; + entry.udma_mask = udma_mask; + entry.filter = false; + + device_printf_dbg(adapter->dev, + "%s: [%d]: addr "MAC_ADDR_STR" mask "MAC_ADDR_STR"\n", + __func__, idx, MAC_ADDR(entry.addr), MAC_ADDR(entry.mask)); + + al_eth_fwd_mac_table_set(&adapter->hal_adapter, idx, &entry); +} + +static void +al_eth_mac_table_all_multicast_add(struct al_eth_adapter *adapter, uint8_t idx, + uint8_t udma_mask) +{ + struct al_eth_fwd_mac_table_entry entry = { { 0 } }; + + memset(entry.addr, 0x00, sizeof(entry.addr)); + memset(entry.mask, 0x00, sizeof(entry.mask)); + entry.mask[0] |= 1; + entry.addr[0] |= 1; + + entry.rx_valid = true; + entry.tx_valid = false; + entry.udma_mask = udma_mask; + entry.filter = false; + + device_printf_dbg(adapter->dev, + "%s: [%d]: addr "MAC_ADDR_STR" mask "MAC_ADDR_STR"\n", + __func__, idx, MAC_ADDR(entry.addr), MAC_ADDR(entry.mask)); + + al_eth_fwd_mac_table_set(&adapter->hal_adapter, idx, &entry); +} + +static void +al_eth_mac_table_broadcast_add(struct al_eth_adapter *adapter, + uint8_t idx, uint8_t udma_mask) +{ + struct al_eth_fwd_mac_table_entry entry = { { 0 } }; + + memset(entry.addr, 0xff, sizeof(entry.addr)); + memset(entry.mask, 0xff, sizeof(entry.mask)); + + entry.rx_valid = true; + entry.tx_valid = false; + entry.udma_mask = udma_mask; + entry.filter = false; + + device_printf_dbg(adapter->dev, + "%s: [%d]: addr "MAC_ADDR_STR" mask "MAC_ADDR_STR"\n", + __func__, idx, MAC_ADDR(entry.addr), MAC_ADDR(entry.mask)); + + al_eth_fwd_mac_table_set(&adapter->hal_adapter, idx, &entry); +} + +static void +al_eth_mac_table_promiscuous_set(struct al_eth_adapter *adapter, + boolean_t promiscuous) +{ + struct al_eth_fwd_mac_table_entry entry = { { 0 } }; + + memset(entry.addr, 0x00, sizeof(entry.addr)); + memset(entry.mask, 0x00, sizeof(entry.mask)); + + entry.rx_valid = true; + entry.tx_valid = false; + entry.udma_mask = (promiscuous) ? 1 : 0; + entry.filter = (promiscuous) ? false : true; + + device_printf_dbg(adapter->dev, "%s: %s promiscuous mode\n", + __func__, (promiscuous) ? "enter" : "exit"); + + al_eth_fwd_mac_table_set(&adapter->hal_adapter, + AL_ETH_MAC_TABLE_DROP_IDX, &entry); +} + +static void +al_eth_set_thash_table_entry(struct al_eth_adapter *adapter, uint8_t idx, + uint8_t udma, uint32_t queue) +{ + + if (udma != 0) + panic("only UDMA0 is supporter"); + + if (queue >= AL_ETH_NUM_QUEUES) + panic("invalid queue number"); + + al_eth_thash_table_set(&adapter->hal_adapter, idx, udma, queue); +} + +/* init FSM, no tunneling supported yet, if packet is tcp/udp over ipv4/ipv6, use 4 tuple hash */ +static void +al_eth_fsm_table_init(struct al_eth_adapter *adapter) +{ + uint32_t val; + int i; + + for (i = 0; i < AL_ETH_RX_FSM_TABLE_SIZE; i++) { + uint8_t outer_type = AL_ETH_FSM_ENTRY_OUTER(i); + switch (outer_type) { + case AL_ETH_FSM_ENTRY_IPV4_TCP: + case AL_ETH_FSM_ENTRY_IPV4_UDP: + case AL_ETH_FSM_ENTRY_IPV6_TCP: + case AL_ETH_FSM_ENTRY_IPV6_UDP: + val = AL_ETH_FSM_DATA_OUTER_4_TUPLE | + AL_ETH_FSM_DATA_HASH_SEL; + break; + case AL_ETH_FSM_ENTRY_IPV6_NO_UDP_TCP: + case AL_ETH_FSM_ENTRY_IPV4_NO_UDP_TCP: + val = AL_ETH_FSM_DATA_OUTER_2_TUPLE | + AL_ETH_FSM_DATA_HASH_SEL; + break; + default: + val = AL_ETH_FSM_DATA_DEFAULT_Q | + AL_ETH_FSM_DATA_DEFAULT_UDMA; + } + al_eth_fsm_table_set(&adapter->hal_adapter, i, val); + } +} + +static void +al_eth_mac_table_entry_clear(struct al_eth_adapter *adapter, + uint8_t idx) +{ + struct al_eth_fwd_mac_table_entry entry = { { 0 } }; + + device_printf_dbg(adapter->dev, "%s: clear entry %d\n", __func__, idx); + + al_eth_fwd_mac_table_set(&adapter->hal_adapter, idx, &entry); +} + +static int +al_eth_hw_init_adapter(struct al_eth_adapter *adapter) +{ + struct al_eth_adapter_params *params = &adapter->eth_hal_params; + int rc; + + /* params->dev_id = adapter->dev_id; */ + params->rev_id = adapter->rev_id; + params->udma_id = 0; + params->enable_rx_parser = 1; /* enable rx epe parser*/ + params->udma_regs_base = adapter->udma_base; /* UDMA register base address */ + params->ec_regs_base = adapter->ec_base; /* Ethernet controller registers base address */ + params->mac_regs_base = adapter->mac_base; /* Ethernet MAC registers base address */ + params->name = adapter->name; + params->serdes_lane = adapter->serdes_lane; + + rc = al_eth_adapter_init(&adapter->hal_adapter, params); + if (rc != 0) + device_printf(adapter->dev, "%s failed at hal init!\n", + __func__); + + if ((adapter->board_type == ALPINE_NIC) || + (adapter->board_type == ALPINE_FPGA_NIC)) { + /* in pcie NIC mode, force eth UDMA to access PCIE0 using the vmid */ + struct al_udma_gen_tgtid_conf conf; + int i; + for (i = 0; i < DMA_MAX_Q; i++) { + conf.tx_q_conf[i].queue_en = AL_TRUE; + conf.tx_q_conf[i].desc_en = AL_FALSE; + conf.tx_q_conf[i].tgtid = 0x100; /* for access from PCIE0 */ + conf.rx_q_conf[i].queue_en = AL_TRUE; + conf.rx_q_conf[i].desc_en = AL_FALSE; + conf.rx_q_conf[i].tgtid = 0x100; /* for access from PCIE0 */ + } + al_udma_gen_tgtid_conf_set(adapter->udma_base, &conf); + } + + return (rc); +} + +static void +al_eth_lm_config(struct al_eth_adapter *adapter) +{ + struct al_eth_lm_init_params params = {0}; + + params.adapter = &adapter->hal_adapter; + params.serdes_obj = &adapter->serdes_obj; + params.lane = adapter->serdes_lane; + params.sfp_detection = adapter->sfp_detection_needed; + if (adapter->sfp_detection_needed == true) { + params.sfp_bus_id = adapter->i2c_adapter_id; + params.sfp_i2c_addr = SFP_I2C_ADDR; + } + + if (adapter->sfp_detection_needed == false) { + switch (adapter->mac_mode) { + case AL_ETH_MAC_MODE_10GbE_Serial: + if ((adapter->lt_en != 0) && (adapter->an_en != 0)) + params.default_mode = AL_ETH_LM_MODE_10G_DA; + else + params.default_mode = AL_ETH_LM_MODE_10G_OPTIC; + break; + case AL_ETH_MAC_MODE_SGMII: + params.default_mode = AL_ETH_LM_MODE_1G; + break; + default: + params.default_mode = AL_ETH_LM_MODE_10G_DA; + } + } else + params.default_mode = AL_ETH_LM_MODE_10G_DA; + + params.link_training = adapter->lt_en; + params.rx_equal = true; + params.static_values = !adapter->dont_override_serdes; + params.i2c_context = adapter; + params.kr_fec_enable = false; + + params.retimer_exist = adapter->retimer.exist; + params.retimer_bus_id = adapter->retimer.bus_id; + params.retimer_i2c_addr = adapter->retimer.i2c_addr; + params.retimer_channel = adapter->retimer.channel; + + al_eth_lm_init(&adapter->lm_context, ¶ms); +} + +static int +al_eth_board_params_init(struct al_eth_adapter *adapter) +{ + + if (adapter->board_type == ALPINE_NIC) { + adapter->mac_mode = AL_ETH_MAC_MODE_10GbE_Serial; + adapter->sfp_detection_needed = false; + adapter->phy_exist = false; + adapter->an_en = false; + adapter->lt_en = false; + adapter->ref_clk_freq = AL_ETH_REF_FREQ_375_MHZ; + adapter->mdio_freq = AL_ETH_DEFAULT_MDIO_FREQ_KHZ; + } else if (adapter->board_type == ALPINE_FPGA_NIC) { + adapter->mac_mode = AL_ETH_MAC_MODE_SGMII; + adapter->sfp_detection_needed = false; + adapter->phy_exist = false; + adapter->an_en = false; + adapter->lt_en = false; + adapter->ref_clk_freq = AL_ETH_REF_FREQ_375_MHZ; + adapter->mdio_freq = AL_ETH_DEFAULT_MDIO_FREQ_KHZ; + } else { + struct al_eth_board_params params; + int rc; + + adapter->auto_speed = false; + + rc = al_eth_board_params_get(adapter->mac_base, ¶ms); + if (rc != 0) { + device_printf(adapter->dev, + "board info not available\n"); + return (-1); + } + + adapter->phy_exist = params.phy_exist == TRUE; + adapter->phy_addr = params.phy_mdio_addr; + adapter->an_en = params.autoneg_enable; + adapter->lt_en = params.kr_lt_enable; + adapter->serdes_grp = params.serdes_grp; + adapter->serdes_lane = params.serdes_lane; + adapter->sfp_detection_needed = params.sfp_plus_module_exist; + adapter->i2c_adapter_id = params.i2c_adapter_id; + adapter->ref_clk_freq = params.ref_clk_freq; + adapter->dont_override_serdes = params.dont_override_serdes; + adapter->link_config.active_duplex = !params.half_duplex; + adapter->link_config.autoneg = !params.an_disable; + adapter->link_config.force_1000_base_x = params.force_1000_base_x; + adapter->retimer.exist = params.retimer_exist; + adapter->retimer.bus_id = params.retimer_bus_id; + adapter->retimer.i2c_addr = params.retimer_i2c_addr; + adapter->retimer.channel = params.retimer_channel; + + switch (params.speed) { + default: + device_printf(adapter->dev, + "%s: invalid speed (%d)\n", __func__, params.speed); + case AL_ETH_BOARD_1G_SPEED_1000M: + adapter->link_config.active_speed = 1000; + break; + case AL_ETH_BOARD_1G_SPEED_100M: + adapter->link_config.active_speed = 100; + break; + case AL_ETH_BOARD_1G_SPEED_10M: + adapter->link_config.active_speed = 10; + break; + } + + switch (params.mdio_freq) { + default: + device_printf(adapter->dev, + "%s: invalid mdio freq (%d)\n", __func__, + params.mdio_freq); + case AL_ETH_BOARD_MDIO_FREQ_2_5_MHZ: + adapter->mdio_freq = AL_ETH_DEFAULT_MDIO_FREQ_KHZ; + break; + case AL_ETH_BOARD_MDIO_FREQ_1_MHZ: + adapter->mdio_freq = AL_ETH_MDIO_FREQ_1000_KHZ; + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Oct 20 11:50:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8901AC1A398; Thu, 20 Oct 2016 11:50:41 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BDDCE6C; Thu, 20 Oct 2016 11:50:41 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf0-x242.google.com with SMTP id l131so487917lfl.0; Thu, 20 Oct 2016 04:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lDQWTFm3Y5Tom+5BuBtr+hxNda8klMYSN6WiSpzz1JQ=; b=TCZ2IlqzvwomzL4rAWB1EWZtmbX+GNYEW52c5nQRoHUXcYwESgOKvN9l77CpjW1uId 8iAoHpnx2389uXt+bWgAchx2XoUF9B2Jngt804km8KLHxTOsXyCQ2beGHsX9hFWxspaf bT+s16YhvQNvFdoguGLfGcvhdN+/Mv/N/lh8gyIP/IQs3vHx8X1aw+mqBL1V6KOduPYN HcsEDPjQfbmme3vyamXDVSt0AvtPVbuoT1zJF2YD9nbxHspXqqrZFkz3GQAVD2nx6c3h Jr7GVffBmH/XjTosYZKKIzOKxyRKyJq26rdPz7mLlHPg4SIJA5y/TWPzcCzVxBC4K2BX mC0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lDQWTFm3Y5Tom+5BuBtr+hxNda8klMYSN6WiSpzz1JQ=; b=jmY4MSSpF4t9SUVQJBZO57I0hjrzEbYiB3HROjklTVqjsRYLba2nOXsuPC53j8TzcY m70X+JsRmS2NNnCJweNqEFh1mqXUW9OUfcZGZ6aIrTvlqvmF31KPM+8BVQczSWnw/xdf 55oRWTUB5SfbTaWwvzENT9NeI4/SAI549ig5Ukxkx2yK/9UCGZIQ8OYIGt7148zXCR83 D/oh27qTJBGFfeVQwOT+MYkQaQ1jZrlywIIIW4b+JVUFIe1R7/ojHQ8Yr9JjEjBfDFqJ 80JEZSB3kjCba2j71Sja56Q9uPw2mrXwayl+V7wHAj6aJwbURdN4WqTbeN0gDS06SXxp z0ug== X-Gm-Message-State: AA6/9RlwWx9zrHTe5I2KhBlJ5q8wfLq0/YOoQlaKKpBzd13tBjn68ru2RSKu/+9rgn+w3w== X-Received: by 10.28.64.213 with SMTP id n204mr193277wma.64.1476964238952; Thu, 20 Oct 2016 04:50:38 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id wh3sm78172765wjb.49.2016.10.20.04.50.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 20 Oct 2016 04:50:38 -0700 (PDT) Date: Thu, 20 Oct 2016 13:50:35 +0200 From: Mateusz Guzik To: Gleb Smirnoff Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307650 - head/sys/kern Message-ID: <20161020115035.GA26990@dft-labs.eu> References: <201610191829.u9JITqhm081246@repo.freebsd.org> <20161019220942.GM27748@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161019220942.GM27748@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 11:50:41 -0000 On Wed, Oct 19, 2016 at 03:09:42PM -0700, Gleb Smirnoff wrote: > On Wed, Oct 19, 2016 at 06:29:52PM +0000, Mateusz Guzik wrote: > M> Author: mjg > M> Date: Wed Oct 19 18:29:52 2016 > M> New Revision: 307650 > M> URL: https://svnweb.freebsd.org/changeset/base/307650 > M> > M> Log: > M> cache: split negative entry LRU into multiple lists > M> > M> This splits the ncneg_mtx lock while preserving the hit ratio at least > M> during buildworld. > M> > M> Create N dedicated lists for new negative entries. > M> > M> Entries with at least one hit get promoted to the hot list, where they > M> get requeued every M hits. > M> > M> Shrinking demotes one hot entry and performs a round-robin shrinking of > M> regular lists. > M> > M> Reviewed by: kib > > This instapanics: > > panic: Assertion ncp->nc_flag & NCF_NEGATIVE failed at /usr/src/head/sys/kern/vfs_cache.c:815 > It definitely works for me and I don't see how the condition can fail. Given the 'instapanic' note, I assume you can easily reproduce. Is this a stock head kernel? Can you reproduce with; diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index a112808..a8bd5eb 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -812,6 +812,11 @@ cache_negative_zap_one(void) goto out; } + if (!(ncp->nc_flag & NCF_NEGATIVE)) { + panic("%s: ncp %p flag %x dvp %p vp %p\n", __func__, ncp, + ncp->nc_flag, ncp->nc_dvp, ncp->nc_vp); + } + MPASS(ncp->nc_flag & NCF_NEGATIVE); dvlp = VP2VNODELOCK(ncp->nc_dvp); blp = NCP2BUCKETLOCK(ncp); -- Mateusz Guzik From owner-svn-src-head@freebsd.org Thu Oct 20 13:48:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64073C19C91; Thu, 20 Oct 2016 13:48:30 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3401C5F9; Thu, 20 Oct 2016 13:48:30 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KDmTKJ022297; Thu, 20 Oct 2016 13:48:29 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KDmTpE022296; Thu, 20 Oct 2016 13:48:29 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201610201348.u9KDmTpE022296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Thu, 20 Oct 2016 13:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307673 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 13:48:30 -0000 Author: gallatin Date: Thu Oct 20 13:48:29 2016 New Revision: 307673 URL: https://svnweb.freebsd.org/changeset/base/307673 Log: Clear mbuf hashtype on loopback when RSS is enabled. The hashtype on an outgoing mbuf reflects the correct hash on the transmit side of the connection. If this hash persists on loopback, the receiving RSS/PCBGROUP code will use it to look up the pcbgroup for the transmit side, which will often not match the pcbgroup for the receive side of the connection. This leads to TCP connections hanging, and dropping the SYN/ACK packet. This is essentially the same as having a hardware network card generate mbufs with an incorrect RSS hash. There are a number of places which can set the hash on transmit, so the simplest fix is to simply clear the hash at loopback time. Clearing the hash allows a new, correct hash to be calculated in software on the receive side. Reviewed by: jtl Discussed with: adrian Sponsored by: Netflix Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Thu Oct 20 13:12:19 2016 (r307672) +++ head/sys/net/if_loop.c Thu Oct 20 13:48:29 2016 (r307673) @@ -36,6 +36,7 @@ #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_rss.h" #include #include @@ -224,6 +225,10 @@ looutput(struct ifnet *ifp, struct mbuf if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); +#ifdef RSS + M_HASHTYPE_CLEAR(m); +#endif + /* BPF writes need to be handled specially. */ if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af)); From owner-svn-src-head@freebsd.org Thu Oct 20 14:48:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4271BC19843; Thu, 20 Oct 2016 14:48:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1F6DE228; Thu, 20 Oct 2016 14:48:59 +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 u9KEmwEr045167; Thu, 20 Oct 2016 14:48:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KEmvO8045162; Thu, 20 Oct 2016 14:48:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610201448.u9KEmvO8045162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Oct 2016 14:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307674 - in head: gnu/usr.bin share/mk tools/build/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 14:48:59 -0000 Author: emaste Date: Thu Oct 20 14:48:57 2016 New Revision: 307674 URL: https://svnweb.freebsd.org/changeset/base/307674 Log: Add knobs to make GNU diff and GNU grep optional This is added to facilitate experiments building FreeBSD without copyleft software. If WITHOUT_GNU_DIFF is set no /usr/bin/diff or /usr/bin/diff3 will be built. If WITHOUT_GNU_GREP is set then BSD grep will be installed as /usr/bin/bsdgrep or /usr/bin/grep, depending on the WITH_BSD_GREP knob. Reviewed by: brooks (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: Differential Revision: https://reviews.freebsd.org/D8288 Added: head/tools/build/options/WITHOUT_GNU_DIFF (contents, props changed) head/tools/build/options/WITHOUT_GNU_GREP (contents, props changed) Modified: head/gnu/usr.bin/Makefile head/share/mk/src.opts.mk head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Thu Oct 20 13:48:29 2016 (r307673) +++ head/gnu/usr.bin/Makefile Thu Oct 20 14:48:57 2016 (r307674) @@ -2,10 +2,6 @@ .include -SUBDIR= diff \ - diff3 \ - grep - SUBDIR_DEPEND_gdb= ${_binutils} .if ${MK_CXX} != "no" @@ -21,6 +17,8 @@ SUBDIR.${MK_GDB}+= gdb .endif SUBDIR.${MK_GCC}+= cc +SUBDIR.${MK_GNU_DIFF}+= diff diff3 +SUBDIR.${MK_GNU_GREP}+= grep SUBDIR.${MK_GPL_DTC}+= dtc SUBDIR.${MK_TESTS}+= tests Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Oct 20 13:48:29 2016 (r307673) +++ head/share/mk/src.opts.mk Thu Oct 20 14:48:57 2016 (r307674) @@ -98,6 +98,8 @@ __DEFAULT_YES_OPTIONS = \ GCOV \ GDB \ GNU \ + GNU_DIFF \ + GNU_GREP \ GNU_GREP_COMPAT \ GPIO \ GPL_DTC \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Oct 20 13:48:29 2016 (r307673) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Oct 20 14:48:57 2016 (r307674) @@ -2173,6 +2173,39 @@ OLD_FILES+=usr/share/man/man3/gpio_pin_t OLD_FILES+=usr/share/man/man8/gpioctl.8.gz .endif +.if ${MK_GNU_DIFF} == no +OLD_FILES+=usr/bin/diff +OLD_FILES+=usr/bin/diff3 +OLD_FILES+=usr/share/man/man1/diff.1.gz +OLD_FILES+=usr/share/man/man1/diff3.1.gz +OLD_FILES+=usr/share/man/man7/diff.7.gz +.endif + +.if ${MK_GNU_GREP} == no +OLD_FILES+=usr/bin/gnugrep +OLD_FILES+=usr/share/man/man1/gnugrep.1.gz +.if ${MK_BSD_GREP} == no +OLD_FILES+=usr/bin/bzgrep +OLD_FILES+=usr/bin/bzegrep +OLD_FILES+=usr/bin/bzfgrep +OLD_FILES+=usr/bin/egrep +OLD_FILES+=usr/bin/fgrep +OLD_FILES+=usr/bin/grep +OLD_FILES+=usr/bin/zegrep +OLD_FILES+=usr/bin/zfgrep +OLD_FILES+=usr/bin/zgrep +OLD_FILES+=usr/share/man/man1/bzegrep.1.gz +OLD_FILES+=usr/share/man/man1/bzfgrep.1.gz +OLD_FILES+=usr/share/man/man1/bzgrep.1.gz +OLD_FILES+=usr/share/man/man1/egrep.1.gz +OLD_FILES+=usr/share/man/man1/fgrep.1.gz +OLD_FILES+=usr/share/man/man1/grep.1.gz +OLD_FILES+=usr/share/man/man1/zegrep.1.gz +OLD_FILES+=usr/share/man/man1/zfgrep.1.gz +OLD_FILES+=usr/share/man/man1/zgrep.1.gz +.endif +.endif + # Also includes vgrind(1) .if ${MK_GROFF} == no OLD_FILES+=usr/bin/addftinfo Added: head/tools/build/options/WITHOUT_GNU_DIFF ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_GNU_DIFF Thu Oct 20 14:48:57 2016 (r307674) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build GNU +.Xr diff 1 +and +.Xr diff3 1 . Added: head/tools/build/options/WITHOUT_GNU_GREP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_GNU_GREP Thu Oct 20 14:48:57 2016 (r307674) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build GNU +.Xr grep 1 . From owner-svn-src-head@freebsd.org Thu Oct 20 15:12:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7942BC1A1DE; Thu, 20 Oct 2016 15:12:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4B2A5938; Thu, 20 Oct 2016 15:12:07 +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 u9KFC6Zh053717; Thu, 20 Oct 2016 15:12:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KFC6YK053716; Thu, 20 Oct 2016 15:12:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610201512.u9KFC6YK053716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Oct 2016 15:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307675 - head/gnu/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 15:12:07 -0000 Author: emaste Date: Thu Oct 20 15:12:06 2016 New Revision: 307675 URL: https://svnweb.freebsd.org/changeset/base/307675 Log: Remove trailing whitespace from r307674 Modified: head/gnu/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Thu Oct 20 14:48:57 2016 (r307674) +++ head/gnu/usr.bin/Makefile Thu Oct 20 15:12:06 2016 (r307675) @@ -17,8 +17,8 @@ SUBDIR.${MK_GDB}+= gdb .endif SUBDIR.${MK_GCC}+= cc -SUBDIR.${MK_GNU_DIFF}+= diff diff3 -SUBDIR.${MK_GNU_GREP}+= grep +SUBDIR.${MK_GNU_DIFF}+= diff diff3 +SUBDIR.${MK_GNU_GREP}+= grep SUBDIR.${MK_GPL_DTC}+= dtc SUBDIR.${MK_TESTS}+= tests From owner-svn-src-head@freebsd.org Thu Oct 20 15:14:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD216C1A33F; Thu, 20 Oct 2016 15:14:22 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8048DC16; Thu, 20 Oct 2016 15:14:22 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KFELs8056436; Thu, 20 Oct 2016 15:14:21 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KFELev056434; Thu, 20 Oct 2016 15:14:21 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201610201514.u9KFELev056434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Thu, 20 Oct 2016 15:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307676 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 15:14:22 -0000 Author: jonathan Date: Thu Oct 20 15:14:21 2016 New Revision: 307676 URL: https://svnweb.freebsd.org/changeset/base/307676 Log: Add make rules to build LLVM IR from C/C++ sources. As a foundation for future work with LLVM's Intermediate Representation (IR), add new suffix rules that can be used to build .llo (text) or .bco (bitcode) files from C or C++ sources. This compilation step uses the same CFLAGS, etc., as are used for building .o files, with the exception of optimization flags. Many of the things we would like to do with IR (e.g., instrumentation) work better with unoptimized code, so our approach is to build .c->.bco without optimization and then apply the optimization in post-analysis, post-instrumentation linking. The overall result of these changes is: * one can "make foo.llo" or "make foo.bco" wherever "make foo.o" was supported * new make variables IR_CFLAGS and IR_CXXFLAGS are available to inspect the flags that are used by Clang to generate the IR These new rules are added unconditionally to our non-POSIX suffix rule set, since we cannot inspect COMPILER_TYPE in sys.mk. Future changes that depend on these rules (e.g., building IR versions of binaries from bsd.prog.mk) should use COMPILER_TYPE to determine when we can expect IR rules to succeed. Reviewed by: emaste, imp Approved by: rwatson (mentor) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D4339 Modified: head/share/mk/bsd.suffixes.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.suffixes.mk ============================================================================== --- head/share/mk/bsd.suffixes.mk Thu Oct 20 15:12:06 2016 (r307675) +++ head/share/mk/bsd.suffixes.mk Thu Oct 20 15:14:21 2016 (r307676) @@ -20,12 +20,24 @@ ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} +.c.bco: + ${CC} -emit-llvm ${IR_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +.c.llo: + ${CC} -emit-llvm ${IR_CFLAGS} -S ${.IMPSRC} -o ${.TARGET} + .cc .cpp .cxx .C: ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} .cc.o .cpp.o .cxx.o .C.o: ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} +.cc.bco .cpp.bco .cxx.bco .C.bco: + ${CXX} -emit-llvm ${IR_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +.cc.llo .cpp.llo .cxx.llo .C.llo: + ${CXX} -emit-llvm ${IR_CXXFLAGS} -S ${.IMPSRC} -o ${.TARGET} + .m.o: ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Oct 20 15:12:06 2016 (r307675) +++ head/share/mk/sys.mk Thu Oct 20 15:14:21 2016 (r307676) @@ -153,6 +153,7 @@ CFLAGS ?= -O2 -pipe CFLAGS += -fno-strict-aliasing .endif .endif +IR_CFLAGS ?= ${STATIC_CFLAGS:N-O*} ${CFLAGS:N-O*} PO_CFLAGS ?= ${CFLAGS} # cp(1) is used to copy source files to ${.OBJDIR}, make sure it can handle @@ -173,6 +174,7 @@ CTFFLAGS += -g CXX ?= c++ CXXFLAGS ?= ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition} +IR_CXXFLAGS ?= ${STATIC_CXXFLAGS:N-O*} ${CXXFLAGS:N-O*} PO_CXXFLAGS ?= ${CXXFLAGS} DTRACE ?= dtrace From owner-svn-src-head@freebsd.org Thu Oct 20 17:10:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 501A2C1AF64; Thu, 20 Oct 2016 17:10:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id 20721A9; Thu, 20 Oct 2016 17:10:27 +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 u9KHAQEJ000884; Thu, 20 Oct 2016 17:10:26 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KHAQqg000883; Thu, 20 Oct 2016 17:10:26 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610201710.u9KHAQqg000883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 20 Oct 2016 17:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307677 - head/sys/modules/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 17:10:27 -0000 Author: br Date: Thu Oct 20 17:10:26 2016 New Revision: 307677 URL: https://svnweb.freebsd.org/changeset/base/307677 Log: Disable geom_eli module build on MIPS64 as it has alignment issues and causes kernel panic. ELI metadata is also not aligned properly for MIPS64 case. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/modules/geom/Makefile Modified: head/sys/modules/geom/Makefile ============================================================================== --- head/sys/modules/geom/Makefile Thu Oct 20 15:14:21 2016 (r307676) +++ head/sys/modules/geom/Makefile Thu Oct 20 17:10:26 2016 (r307677) @@ -6,7 +6,6 @@ SYSDIR?=${.CURDIR}/../.. SUBDIR= geom_bde \ geom_cache \ geom_concat \ - geom_eli \ geom_gate \ geom_journal \ geom_label \ @@ -30,4 +29,9 @@ SUBDIR= geom_bde \ SUBDIR+= geom_ccd .endif +# Alignment issues in g_eli_auth_run() on MIPS64 causes kernel panic +.if ${MACHINE_ARCH} != "mips64" && ${MACHINE_ARCH} != "mips64el" +SUBDIR+= geom_eli +.endif + .include From owner-svn-src-head@freebsd.org Thu Oct 20 17:28:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF0ECC1A5D6; Thu, 20 Oct 2016 17:28:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8DEC719E; Thu, 20 Oct 2016 17:28:53 +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 u9KHSqgH009399; Thu, 20 Oct 2016 17:28:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KHSq2X009398; Thu, 20 Oct 2016 17:28:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610201728.u9KHSq2X009398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Oct 2016 17:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307679 - head/gnu/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 17:28:53 -0000 Author: emaste Date: Thu Oct 20 17:28:52 2016 New Revision: 307679 URL: https://svnweb.freebsd.org/changeset/base/307679 Log: Build libgnuregex only if necessary for other components Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D8298 Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Thu Oct 20 17:16:09 2016 (r307678) +++ head/gnu/lib/Makefile Thu Oct 20 17:28:52 2016 (r307679) @@ -4,7 +4,6 @@ SUBDIR= csu SUBDIR+= libgcc -SUBDIR+= libregex SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp @@ -15,6 +14,11 @@ SUBDIR.${MK_TESTS}+= tests SUBDIR+= libreadline .endif +.if ${MK_GNU_DIFF} != "no" || ${MK_GNU_GREP} != "no" || \ + ${GNU_GREP_COMPAT} != "no" || ${MK_GDB} != "no" +SUBDIR+= libregex +.endif + # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. .if ${MK_GNUCXX} != "no" From owner-svn-src-head@freebsd.org Thu Oct 20 18:18:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C19AC1954D; Thu, 20 Oct 2016 18:18:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F7EDF61; Thu, 20 Oct 2016 18:18:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u9KIIR0L038343 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 20 Oct 2016 11:18:27 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u9KIIRcI038342; Thu, 20 Oct 2016 11:18:27 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 20 Oct 2016 11:18:27 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307650 - head/sys/kern Message-ID: <20161020181827.GU27748@FreeBSD.org> References: <201610191829.u9JITqhm081246@repo.freebsd.org> <20161019220942.GM27748@FreeBSD.org> <20161020115035.GA26990@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161020115035.GA26990@dft-labs.eu> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 18:18:29 -0000 On Thu, Oct 20, 2016 at 01:50:35PM +0200, Mateusz Guzik wrote: M> On Wed, Oct 19, 2016 at 03:09:42PM -0700, Gleb Smirnoff wrote: M> > On Wed, Oct 19, 2016 at 06:29:52PM +0000, Mateusz Guzik wrote: M> > M> Author: mjg M> > M> Date: Wed Oct 19 18:29:52 2016 M> > M> New Revision: 307650 M> > M> URL: https://svnweb.freebsd.org/changeset/base/307650 M> > M> M> > M> Log: M> > M> cache: split negative entry LRU into multiple lists M> > M> M> > M> This splits the ncneg_mtx lock while preserving the hit ratio at least M> > M> during buildworld. M> > M> M> > M> Create N dedicated lists for new negative entries. M> > M> M> > M> Entries with at least one hit get promoted to the hot list, where they M> > M> get requeued every M hits. M> > M> M> > M> Shrinking demotes one hot entry and performs a round-robin shrinking of M> > M> regular lists. M> > M> M> > M> Reviewed by: kib M> > M> > This instapanics: M> > M> > panic: Assertion ncp->nc_flag & NCF_NEGATIVE failed at /usr/src/head/sys/kern/vfs_cache.c:815 M> > M> M> It definitely works for me and I don't see how the condition can fail. M> M> Given the 'instapanic' note, I assume you can easily reproduce. Is this M> a stock head kernel? M> M> Can you reproduce with; Trying to mount root from ufs:/dev/vtbd0p3 [rw]... panic: cache_negative_zap_one: ncp 0xffffffff81012500 flag 0 dvp 0 vp 0 cpuid = 11 KDB: enter: panic [ thread pid 21 tid 100097 ] Stopped at breakpoint+0x5: popq %rbp db> bt Tracing pid 21 tid 100097 td 0xfffff8000342ca00 breakpoint() at breakpoint+0x5/frame 0xfffffe00f7e8da90 kdb_enter() at kdb_enter+0x67/frame 0xfffffe00f7e8dac0 vpanic() at vpanic+0x26b/frame 0xfffffe00f7e8db90 kproc_shutdown() at kproc_shutdown/frame 0xfffffe00f7e8dbf0 cache_negative_zap_one() at cache_negative_zap_one+0x313/frame 0xfffffe00f7e8dcb0 cache_enter_time() at cache_enter_time+0xe5a/frame 0xfffffe00f7e8de10 ufs_lookup_ino() at ufs_lookup_ino+0xaf1/frame 0xfffffe00f7e8e030 ufs_lookup() at ufs_lookup+0x39/frame 0xfffffe00f7e8e050 VOP_CACHEDLOOKUP_APV() at VOP_CACHEDLOOKUP_APV+0x20a/frame 0xfffffe00f7e8e0d0 VOP_CACHEDLOOKUP() at VOP_CACHEDLOOKUP+0x4d/frame 0xfffffe00f7e8e120 vfs_cache_lookup() at vfs_cache_lookup+0x148/frame 0xfffffe00f7e8e190 VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x20a/frame 0xfffffe00f7e8e210 VOP_LOOKUP() at VOP_LOOKUP+0x4d/frame 0xfffffe00f7e8e260 lookup() at lookup+0xa02/frame 0xfffffe00f7e8e3a0 namei() at namei+0x9c6/frame 0xfffffe00f7e8e550 kern_statat() at kern_statat+0x16d/frame 0xfffffe00f7e8e7c0 sys_stat() at sys_stat+0x89/frame 0xfffffe00f7e8e8b0 syscallenter() at syscallenter+0x54f/frame 0xfffffe00f7e8e980 amd64_syscall() at amd64_syscall+0x2a/frame 0xfffffe00f7e8eab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00f7e8eab0 --- syscall (188, FreeBSD ELF64, sys_stat), rip = 0x800bd391a, rsp = 0x7fffffffe9a8, rbp = 0x7fffffffea90 --- db> -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Oct 20 18:23:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF3B8C1981D; Thu, 20 Oct 2016 18:23:45 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 873606AC; Thu, 20 Oct 2016 18:23:45 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KINiqT031768; Thu, 20 Oct 2016 18:23:44 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KINiwr031764; Thu, 20 Oct 2016 18:23:44 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201610201823.u9KINiwr031764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 20 Oct 2016 18:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307680 - in head/tools/tools: . git X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 18:23:45 -0000 Author: rstone Date: Thu Oct 20 18:23:44 2016 New Revision: 307680 URL: https://svnweb.freebsd.org/changeset/base/307680 Log: Add some tools to simplify the use of git Add some scripts that wraps some FreeBSD Project infrastructure and simplifies using them with git. The scripts are: - arcgit, which creates a series of reviews in Differential - importgit, which applies a series of git commits to svn Differential Revision: https://reviews.freebsd.org/D2071 Added: head/tools/tools/git/ head/tools/tools/git/HOWTO (contents, props changed) head/tools/tools/git/arcgit (contents, props changed) head/tools/tools/git/importgit (contents, props changed) Modified: head/tools/tools/README Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Thu Oct 20 17:28:52 2016 (r307679) +++ head/tools/tools/README Thu Oct 20 18:23:44 2016 (r307680) @@ -29,6 +29,7 @@ gdb_regofs A simple tool that prints out platforms only. genericize Turn a kernel config into something that can more easily be diffed against the appropriate GENERIC. +git Tools to simplify the use of git by committers. hcomp Compress header files by removing comments and whitespace. html-mv Rename HTML generated filenames to human readable filenames. ifinfo Uses the interface MIB to print out all the information Added: head/tools/tools/git/HOWTO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/git/HOWTO Thu Oct 20 18:23:44 2016 (r307680) @@ -0,0 +1,144 @@ +# $FreeBSD$ + +This directory contains tools intended to help committers use git when +interacting with standard FreeBSD project resources like Differential or svn. + +I. arcgit + +arcgit is a wrapper script around the arc command line tool that simplifies the +automatic creation of a series of Differential reviews from a series of git +commits. The intended workflow is: + +1. Create a series of commits in git. Each commit will be a separate review, so + try to make each commit as self-contained as possible. The series of commits + should demonstrate a logical progression towards your end goal. For example, + one commit might refactor existing code to expose a new API without changing + any current functionality. A subsequent commit could then introduce your new + code that uses the new API. + + It usually will not be helpful to present your code in the order in which it + was actually written and can actually be harmful. For example, if you + introduced a bug early in your development process that you fixed in a + subsequent commit, it is a waste of your reviewer's time to have them review + old code with known bugs. Instead, it would probably be best to squash the + bug fix into the commit that introduced it, so that the bug is never + presented to your reviewers in any review. + + The commit headline and commit message will be imported verbatim into + Differential, so try to give each commit a meaningful commit message that + gives your reviewers the necessary context to understand your change. + +2. Create your reviews bu running this command in your git repo: + $ arcgit -r C1~..C2 -R reviewer -T testplan + + C1 should be the first commit that you want reviewed, and C2 should be the + last commit that you want reviewed. You may add multiple reviewers by + specifying the -R option multiple times. You can CC (AKA subscribe) people + to a review with the -C option. Note that if you subscribe a mailing list + to a review, the mailing list will be emailed for every comment or change + made to each review. Please be judicious when subscibing mailing lists to + reviews. It may be better to instead send a single email to the appropriate + list announcing all of the reviews and giving a short summary of the change + as a whole, along with a link to the individual reviews. + +3. When you need to make a change and upload it to a review, use the following + process. First, check out the branch corresponding to the review (arcgit + automatically creates this branch for every review that it creates): + + $ git checkout review_D1234 + + Next, make your change and perform whatever testing is necessary. Commit it + to your repository with this command: + + $ git commit --fixup HEAD + + You can upload the change to the code review by running this command in your + repository while (ensure that you are still on the review_D1234 branch): + + $ arc diff --update D1234 review_D1234_base + + When you run arc, it will pull up your editor and give you a chance to + change the message that will be shown in Differential for this upload. It's + recommended that you change it from the default "fixup! ...." as that does + not give your reviewers an indication of what changes were made. It's not + recommended that you give the code review fixes meaningful commit messages + directly because we will be using git's autosquash feature in the next step, + which depends on the fixup! tag being present. + + Do not merge in other branches, or rebase your review branches at this point. + Any changes that are made will show up in your reviews, and that will create + extra noise that your reviewers will have to ignore. If a reviewer requests + a change that requires your commit to be based off of a later version of + head, I would suggest deferring the change from the review and creating a + new review with the change once you hit step 5. + +4. Once the reviews have been approved, you need to prepare your patch series + to be committed. This involves squashing the fixes made in code review + back into the original commit that they applied to. This gives you a clean + series of commits that are ready to be commited back to svn. + + First, merge each of your review branches back into your main development + branch. For example: + + $ git checkout myfeature_dev + $ for branch in review_D1234 review_D1235 review_D1236; do \ + git merge $branch || git mergetool -y || break; done + + Next, do an interactive rebase to squash your code review fixes back into the + main commit: + + $ git rebase -i -k review_D1234_base + + review_D1234 should be the name of the *first* review that was created for + you in step 2. For every commit, your editor will be pulled up and you will + be given one last chance to edit your commit message. Make sure that you fill + in the "Reviewed by:" tag indicating who accepted the review. This would + be a good point to add other tags like MFC after:, Sponsored by:, etc. + + The rebase will not introduce any actual changes to your code if done + properly. You can use this command to double-check that no changes were + inadvertently made here: + + $ git diff myfeature_dev@{1} + +5. Finally, you should get up to date with the latest changes from head: + + $ git pull --rebase origin master + + It is not recommended that you combine this step with the rebase done in the + previous step. The reason for this is that if you perform an interactive + rebase that changes the commit that you branch from, it becomes much more + difficult to use the reflog to confirm that the interactive rebase did not + introduce unwanted changes. + + At this point, you are ready to commit your changes to head. The importgit + script can be used to import your commits directly into git. + +II. importgit + +importgit is a script that can take a series of commits from git and commit them +to a svn repository. The script uses the git commit messages for the svn commit +message, which allows importgit to be fully automated. This does mean that once +you start importgit, it will start commit things to svn without giving any +further chance to sanity check what it's doing. + +importgit only supports importing commits that add or modify files. It does not +support importing commits that rename or delete files, to ensure that git's +rename detection heuristics do not introduce an error in the import process. +importgit also does not support importing merge commits. Only linear history +can be imported into svn. + +importgit must be run from a clean subversion checkout. You should ensure that +the working tree is up-to-date with "svn up" before running importgit. +importgit will run svn directly, so make sure that your ssh-agent is running +and has your ssh key loaded already. Run importgit as follows: + + $ importgit -r D1~..D2 -g /path/to/git/repo + +This will import every commit between D1 and D2, including both D1 and D2. The +invocation is very similar to the invocation given to arcgit but there is an +important point to note. When you rebased your commits as you followed steps 4 +and 5, the commit hashes of all of your commits changed, including C1 and C2. +You must go back and find the new commit hashes of your commits to pass to +importgit. Passing -r C1~..C2 would import your commits as they were *before* +your code review fixes were applied. Added: head/tools/tools/git/arcgit ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/git/arcgit Thu Oct 20 18:23:44 2016 (r307680) @@ -0,0 +1,214 @@ +#!/bin/sh +# +# Copyright (c) 2015 Ryan Stone. 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$ + +# This script is used to submit a series of git commits to Differential. Each +# commit is submitted as a separate review. For each review, this script will +# create a branch called review_DXXXX (e.g. review_D2185 for Differential +# revision D2185). When you need to make a change to a review, checkout the +# review_D2185 branch, commit your change with "git commit --fixup HEAD". To\ +# upload the change to Differential, use the command: +# $ arc diff --update D2185 review_D2185_base +# +# When your reviews are complete, merge all of the review_DXXXX branches +# together, and then do a git rebase -ik to meld the code review fixes into the +# commit that they fixed. Now you have a clean series of patches to commit to +# svn. + +usage() +{ + echo "Usage: arcgit <-c commit | -r commit1~..commit2> [-R reviewer] " >&2 + echo " [-C subscriber] [-T testplan] [-n]" >&2 +} + +error() +{ + echo "$@" >&2 + usage + rm -f $phab_before $phab_after $arc_msg + exit 1 +} + +create_review() +{ + local commit phab_id arc_dir + unset phab_before phab_after arc_msg + commit=$1 + + phab_before=`mktemp -t arcoutput` + phab_after=`mktemp -t arcoutput` + echo "Create review for '`git show $commit -s --oneline`'" + + if [ -n "$dry_run" ] + then + return + fi + + git checkout $commit > /dev/null || error "Could not checkout $commit" + + arc_dir="$(git rev-parse --show-toplevel)/.git/arc" + arc_msg="$arc_dir/create-message" + mkdir -p $arc_dir + git show -s --format='%B' HEAD > $arc_msg + echo >> $arc_msg + echo "Test Plan:" >> $arc_msg + cat $test_plan >> $arc_msg + echo >> $arc_msg + echo "Reviewers:" >> $arc_msg + echo "$reviewers" >> $arc_msg + echo >> $arc_msg + echo "Subscribers:" >> $arc_msg + echo "$cc_list" >> $arc_msg + echo >> $arc_msg + + arc list > $phab_before + yes | env EDITOR=true arc diff --create --allow-untracked HEAD~ + arc list > $phab_after + + headline="$(git show $commit -s --format=%s)" + phab_id=`comm -13 "$phab_before" "$phab_after" | fgrep "$headline" \ + | egrep -o 'D[0-9]+:' | tr -d ':'` + + if [ -z "$phab_id" ] + then + error "Could not get review ID" + fi + + git branch review_${phab_id}_base HEAD~ + + git checkout -b review_$phab_id + cat - < /dev/null 2> /dev/null +then + error "Install devel/git first" +fi + +if ! type arc > /dev/null 2> /dev/null +then + error "Install devel/arcanist first" +fi + +git update-index -q --refresh +if ! git diff-index --quiet --cached HEAD +then + error "index is unclean" +fi + +if ! git diff-files --quiet +then + error "Working directory is unclean" +fi + +if git ls-files --other --error-unmatch . > /dev/null 2> /dev/null +then + error "Working directory contains untracked files" +fi + +# We have to do a git checkout in order to run arc, so save the original branch +# so that we can check it out again once we're done. +if ! orig_branch=$(git symbolic-ref --short -q HEAD) +then + orig_branch=$(git show -s --pretty='%H' HEAD) +fi + +git log --format=%H $range | tail -r | while read -r commit +do + create_review $commit < /dev/null +done + +# Note that due to the use of the pipeline above, the body of the while loop +# above runs in a subshell. If it exits with an error, execution resumes +# here rather than exiting the script, so we have to cache the right exit code +# and return it when we're done cleaning up. +code=$? + +git checkout $orig_branch + +exit $code + Added: head/tools/tools/git/importgit ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/git/importgit Thu Oct 20 18:23:44 2016 (r307680) @@ -0,0 +1,182 @@ +#!/bin/sh +# +# Copyright (c) 2015 Ryan Stone. 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$ + +usage() +{ + echo "Usage: importgit <-c commit | -r c1..c2> -g /path/to/git/repo [-n]" >&2 +} + +error() +{ + local print_usage + + if [ "$1" = "-u" ] + then + shift + print_usage=1 + else + print_usage= + fi + + echo "$@" >&2 + if [ -n "$print_usage" ] + then + usage + fi + exit 1 +} + +unset git range commit dry_run + +while getopts ":c:g:nr:" o +do + case "$o" in + c) + range="${OPTARG}~..${OPTARG}" + ;; + g) + git_repo=$OPTARG + ;; + n) + dry_run=1 + ;; + r) + range=$OPTARG + ;; + *) + error -u "Unrecognized argument '-$OPTARG'" + esac +done + +shift $((OPTIND - 1)) +OPTIND=1 + +if [ -n "$1" ] +then + error -u "Unrecognized argument $1" +fi + +if [ -z "$range" ] +then + error -u "-c or -r argument is mandatory" +fi + +if ! echo "$range" | egrep -qs '^[^.]+\.\.[^.]*$' +then + error -u "$range is not a range of commits. Did you mean '-c $range'?" +fi + +if [ -z "$git_repo" ] +then + error -u "-g argument is mandatory" +fi + +git="$git_repo/.git" + +if [ ! -d "$git" ] +then + error "$git_repo does not seem to be a git repo" +fi + +if ! type git > /dev/null 2> /dev/null +then + error "Install devel/git first" +fi + +if ! type svn > /dev/null 2> /dev/null +then + error "Install devel/subversion first" +fi + +if [ -n "$(svn status)" ] +then + error "Working tree is not clean" +fi + +if ! svn --non-interactive ls > /dev/null +then + error "Could not communicate with svn server. Is your ssh key loaded?" +fi + +git --git-dir=$git log --format=%H $range | tail -r | while read -r commit +do + echo "Applying `git --git-dir=$git show -s --oneline $commit`" + + if [ -n "$(git --git-dir=$git show --diff-filter=CDRTUXB $commit)" ] + then + error "Commit performed unsupported change (e.g. delete/rename)" + fi + + if [ "$(git --git-dir=$git show -s --format=%P $commit | wc -w)" -ne 1 ] + then + error "Cannot import merge commits" + fi + + git --git-dir=$git diff --diff-filter=A --name-only \ + ${commit}~..$commit | while read -r newfile + do + if [ -f "$newfile" ] + then + error "New file $newfile already exists in tree" + fi + done + + # The previous while loop ran in a subshell, so we have to check if it + # exited with an error and bail out if so. + ret=$? + if [ "$ret" -ne 0 ] + then + exit $ret + fi + + if [ -n "$dry_run" ] + then + continue + fi + + git --git-dir=$git show $commit | patch -p 1 -s || \ + error "Failed to apply patch" + + git --git-dir=$git diff --diff-filter=A --name-only \ + ${commit}~..$commit | while read -r newfile + do + svn add --parents --depth=infinity $newfile || \ + error "Failed to add new file" + done + + # The previous while loop ran in a subshell, so we have to check if it + # exited with an error and bail out if so. + ret=$? + if [ "$ret" -ne 0 ] + then + exit $ret + fi + + git --git-dir=$git show -s --format='%B' $commit | svn commit -F - || \ + error "Failed to commit" +done + From owner-svn-src-head@freebsd.org Thu Oct 20 18:28:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEB54C19924; Thu, 20 Oct 2016 18:28:06 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A59CBA12; Thu, 20 Oct 2016 18:28:06 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KIS5XU032068; Thu, 20 Oct 2016 18:28:05 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KIS5Ak032067; Thu, 20 Oct 2016 18:28:05 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201610201828.u9KIS5Ak032067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 20 Oct 2016 18:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307681 - head/tools/tools/git X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 18:28:07 -0000 Author: rstone Date: Thu Oct 20 18:28:05 2016 New Revision: 307681 URL: https://svnweb.freebsd.org/changeset/base/307681 Log: Set the executable bit on arcgit and importgit Make it possible to run these scripts directly out of svn by setting the executable property on them. Modified: Directory Properties: head/tools/tools/git/arcgit (props changed) head/tools/tools/git/importgit (props changed) From owner-svn-src-head@freebsd.org Thu Oct 20 18:43:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0770C19DE9; Thu, 20 Oct 2016 18:43:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id AFC86131A; Thu, 20 Oct 2016 18:43:13 +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 u9KIhCbP039300; Thu, 20 Oct 2016 18:43:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KIhCft039299; Thu, 20 Oct 2016 18:43:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610201843.u9KIhCft039299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Oct 2016 18:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307683 - head/gnu/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 18:43:14 -0000 Author: emaste Date: Thu Oct 20 18:43:12 2016 New Revision: 307683 URL: https://svnweb.freebsd.org/changeset/base/307683 Log: Correct typo in r307679: the variable is MK_GNU_GREP_COMPAT Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Thu Oct 20 18:38:37 2016 (r307682) +++ head/gnu/lib/Makefile Thu Oct 20 18:43:12 2016 (r307683) @@ -15,7 +15,7 @@ SUBDIR+= libreadline .endif .if ${MK_GNU_DIFF} != "no" || ${MK_GNU_GREP} != "no" || \ - ${GNU_GREP_COMPAT} != "no" || ${MK_GDB} != "no" + ${MK_GNU_GREP_COMPAT} != "no" || ${MK_GDB} != "no" SUBDIR+= libregex .endif From owner-svn-src-head@freebsd.org Thu Oct 20 19:42:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 657ABC1A118; Thu, 20 Oct 2016 19:42:27 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 34A26D99; Thu, 20 Oct 2016 19:42:27 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KJgQPh062773; Thu, 20 Oct 2016 19:42:26 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KJgQOR062772; Thu, 20 Oct 2016 19:42:26 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201610201942.u9KJgQOR062772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 20 Oct 2016 19:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307684 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 19:42:27 -0000 Author: ken Date: Thu Oct 20 19:42:26 2016 New Revision: 307684 URL: https://svnweb.freebsd.org/changeset/base/307684 Log: For CCBs allocated on the stack, we need to clear the entire CCB, not just the header. Otherwise stack garbage can lead to random flags getting set. This showed up as 'camcontrol rescan all' failing with EINVAL because the address type wasn't CAM_DATA_VADDR. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), bzero the stack-allocated CCBs before use instead of clearing the body. MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Oct 20 18:43:12 2016 (r307683) +++ head/sbin/camcontrol/camcontrol.c Thu Oct 20 19:42:26 2016 (r307684) @@ -3139,6 +3139,8 @@ rescan_or_reset_bus(path_id_t bus, int r return(1); } + bzero(&ccb, sizeof(ccb)); + if (bus != CAM_BUS_WILDCARD) { ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; ccb.ccb_h.path_id = bus; @@ -3181,7 +3183,7 @@ rescan_or_reset_bus(path_id_t bus, int r * no-op, sending a rescan to the xpt bus would result in a status of * CAM_REQ_INVALID. */ - CCB_CLEAR_ALL_EXCEPT_HDR(&matchccb.cdm); + bzero(&matchccb, sizeof(matchccb)); matchccb.ccb_h.func_code = XPT_DEV_MATCH; matchccb.ccb_h.path_id = CAM_BUS_WILDCARD; bufsize = sizeof(struct dev_match_result) * 20; From owner-svn-src-head@freebsd.org Thu Oct 20 19:55:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCA9C1A474; Thu, 20 Oct 2016 19:55:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 31EA931B; Thu, 20 Oct 2016 19:55:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KJtonp067051; Thu, 20 Oct 2016 19:55:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KJtoGf067050; Thu, 20 Oct 2016 19:55:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201610201955.u9KJtoGf067050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 20 Oct 2016 19:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307685 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 19:55:51 -0000 Author: mjg Date: Thu Oct 20 19:55:50 2016 New Revision: 307685 URL: https://svnweb.freebsd.org/changeset/base/307685 Log: cache: fix up a corner case in r307650 If no negative entry is found on the last list, the ncp pointer will be left uninitialized and a non-null value will make the function assume an entry was found. Fix the problem by initializing to NULL on entry. Reported by: glebius Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 20 19:42:26 2016 (r307684) +++ head/sys/kern/vfs_cache.c Thu Oct 20 19:55:50 2016 (r307685) @@ -763,6 +763,8 @@ cache_negative_shrink_select(int start, struct namecache *ncp; int i; + *ncpp = ncp = NULL; + for (i = start; i < numneglists; i++) { neglist = &neglists[i]; if (TAILQ_FIRST(&neglist->nl_list) == NULL) From owner-svn-src-head@freebsd.org Thu Oct 20 19:56:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82C10C1A4C7; Thu, 20 Oct 2016 19:56:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2706BE; Thu, 20 Oct 2016 19:56:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf0-x22c.google.com with SMTP id b75so99252392lfg.3; Thu, 20 Oct 2016 12:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rLfXp7+1AR2yXPyD7bpk5H/sp/IfJC/VKBy1K+VNmBM=; b=qMI2c/rTPBd6AQL6nIyZDFJjEIUrHyXpr35BohhuXYOczWEvmu/Ti8LAqVtti7CDh6 ovsvqwp1fcWxZ4LQfI1fA8HKp1TR0edafcs+chmVVIZVOiCdfsmvwKjaPVX8c/EXRBXn oYGUodrx2hFqLUFsxaRm1sfvvGv1BMcoLiq6QUPgmbmK4ueeGiqTVit34iIlyfRisLZO bD8WKuiTSeHo/sCqL8Ik+hTa86q1myvlOYS9CXKjPjCzfkSXgVQrzcjplnBvM0i9xa+M JfW5wH7uSlqIACm8wN6DLSCLNW86T/LBIl784iVMcjl/WZP448u0iHY6uQOoKW9Zg4fV XsBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rLfXp7+1AR2yXPyD7bpk5H/sp/IfJC/VKBy1K+VNmBM=; b=k1Kh/tv9ctC9kT/TRR0yc5L7BRfvojRhU6RwtHYuRwLbdBh87CZmvcovDFG+T0axg2 hSVrdYwKFPR7f/Q4wQD8JYo/r1dFofaG9GVj3SVc4X/HliD9JxuBTR1lZ4zTjhsSG7t+ bBZYzYLdUBR3iuG4kvIe0sRzll8rCLDu9jPdZhpsVUZMQgOq7BRD3sWZjUzd4oDmJzWI RnQBZYL/Mlsocl1yAggedgwHgzZkWShOhhnoWPaL6bNQHNZuKiQQzT/wAbDp6EIBUYax O+g50ZvdZoUBIoBiLW0t2iDJhPoCZ9mC3tfUb/gs8NiAJW2fK2Akb0cQDXJt5XwxL8LE 4LKw== X-Gm-Message-State: AA6/9RnljGRJeqAj+fWqjfjkwxL2RonrZydkn5ofommNrBsZD6vv6f6TjherZh1b+Pa9gw== X-Received: by 10.28.232.148 with SMTP id f20mr37322wmi.30.1476993377707; Thu, 20 Oct 2016 12:56:17 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id p3sm81173900wjr.31.2016.10.20.12.56.16 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 20 Oct 2016 12:56:17 -0700 (PDT) Date: Thu, 20 Oct 2016 21:56:15 +0200 From: Mateusz Guzik To: Gleb Smirnoff Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307650 - head/sys/kern Message-ID: <20161020195614.GA31016@dft-labs.eu> References: <201610191829.u9JITqhm081246@repo.freebsd.org> <20161019220942.GM27748@FreeBSD.org> <20161020115035.GA26990@dft-labs.eu> <20161020181827.GU27748@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161020181827.GU27748@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 19:56:20 -0000 On Thu, Oct 20, 2016 at 11:18:27AM -0700, Gleb Smirnoff wrote: > On Thu, Oct 20, 2016 at 01:50:35PM +0200, Mateusz Guzik wrote: > M> On Wed, Oct 19, 2016 at 03:09:42PM -0700, Gleb Smirnoff wrote: > M> > On Wed, Oct 19, 2016 at 06:29:52PM +0000, Mateusz Guzik wrote: > M> > M> Author: mjg > M> > M> Date: Wed Oct 19 18:29:52 2016 > M> > M> New Revision: 307650 > M> > M> URL: https://svnweb.freebsd.org/changeset/base/307650 > M> > M> > M> > M> Log: > M> > M> cache: split negative entry LRU into multiple lists > M> > M> > M> > M> This splits the ncneg_mtx lock while preserving the hit ratio at least > M> > M> during buildworld. > M> > M> > M> > M> Create N dedicated lists for new negative entries. > M> > M> > M> > M> Entries with at least one hit get promoted to the hot list, where they > M> > M> get requeued every M hits. > M> > M> > M> > M> Shrinking demotes one hot entry and performs a round-robin shrinking of > M> > M> regular lists. > M> > M> > M> > M> Reviewed by: kib > M> > > M> > This instapanics: > M> > > M> > panic: Assertion ncp->nc_flag & NCF_NEGATIVE failed at /usr/src/head/sys/kern/vfs_cache.c:815 > M> > > M> > M> It definitely works for me and I don't see how the condition can fail. > M> > M> Given the 'instapanic' note, I assume you can easily reproduce. Is this > M> a stock head kernel? > M> > M> Can you reproduce with; > > Trying to mount root from ufs:/dev/vtbd0p3 [rw]... > panic: cache_negative_zap_one: ncp 0xffffffff81012500 flag 0 dvp 0 vp 0 > Fixed in r307685. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Thu Oct 20 20:12:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D01EC1ADC9; Thu, 20 Oct 2016 20:12:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3C8328AE; Thu, 20 Oct 2016 20:12:35 +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 u9KKCYfv074981; Thu, 20 Oct 2016 20:12:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KKCYJp074980; Thu, 20 Oct 2016 20:12:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610202012.u9KKCYJp074980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Oct 2016 20:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307686 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 20:12:35 -0000 Author: imp Date: Thu Oct 20 20:12:34 2016 New Revision: 307686 URL: https://svnweb.freebsd.org/changeset/base/307686 Log: Use MACHINE_ARCH rather than TARGET_ARCH which has no meaning outside of Makefile.inc1 Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Thu Oct 20 19:55:50 2016 (r307685) +++ head/sys/conf/Makefile.arm Thu Oct 20 20:12:34 2016 (r307686) @@ -74,7 +74,7 @@ FILES_CPU_FUNC = \ $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv6.S \ $S/$M/$M/cpufunc_asm_armv7.S -.if ${TARGET_ARCH} != "armv6" && defined(KERNPHYSADDR) +.if ${MACHINE_ARCH} != "armv6" && defined(KERNPHYSADDR) KERNEL_EXTRA=trampoline KERNEL_EXTRA_INSTALL=kernel.gz.tramp trampoline: ${KERNEL_KO}.tramp From owner-svn-src-head@freebsd.org Thu Oct 20 20:16:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5FF0C1AE95; Thu, 20 Oct 2016 20:16:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 76218A6E; Thu, 20 Oct 2016 20:16:11 +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 u9KKGAoi075158; Thu, 20 Oct 2016 20:16:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KKGAbE075157; Thu, 20 Oct 2016 20:16:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610202016.u9KKGAbE075157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Oct 2016 20:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307687 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 20:16:11 -0000 Author: emaste Date: Thu Oct 20 20:16:10 2016 New Revision: 307687 URL: https://svnweb.freebsd.org/changeset/base/307687 Log: arch.7: correct typo in predefined macro example The example incorrectly used -Dm, which defines macro m with value 1. It is supposed to be -dM, which lists macros. Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Thu Oct 20 20:12:34 2016 (r307686) +++ head/share/man/man7/arch.7 Thu Oct 20 20:16:10 2016 (r307687) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2016 +.Dd October 20, 2016 .Dt ARCH 7 .Os .Sh NAME @@ -130,7 +130,7 @@ included here. .Pp The full set of predefined macros can be obtained with this command: .Bd -literal -offset indent -cc -x c -Dm -E /dev/null +cc -x c -dM -E /dev/null .Ed .Pp Common type size and endianness macros: From owner-svn-src-head@freebsd.org Thu Oct 20 20:29:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FE9CC1B416; Thu, 20 Oct 2016 20:29:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id E5D53370; Thu, 20 Oct 2016 20:29:55 +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 u9KKTtDT079125; Thu, 20 Oct 2016 20:29:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KKTtCm079124; Thu, 20 Oct 2016 20:29:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610202029.u9KKTtCm079124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Oct 2016 20:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307688 - head/sys/compat/ia32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 20:29:56 -0000 Author: emaste Date: Thu Oct 20 20:29:54 2016 New Revision: 307688 URL: https://svnweb.freebsd.org/changeset/base/307688 Log: Tidy up ia32_sysvec sv_flags setting Use the same approach as sys/arm/arm/elf_machdep.c to avoid an odd- looking , on a separate line. Modified: head/sys/compat/ia32/ia32_sysvec.c Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Thu Oct 20 20:16:10 2016 (r307687) +++ head/sys/compat/ia32/ia32_sysvec.c Thu Oct 20 20:29:54 2016 (r307688) @@ -120,13 +120,11 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_setregs = ia32_setregs, .sv_fixlimit = ia32_fixlimit, .sv_maxssiz = &ia32_maxssiz, - .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32 | + .sv_flags = #ifdef __amd64__ - SV_SHP | SV_TIMEKEEP -#else - 0 + SV_SHP | SV_TIMEKEEP | #endif - , + SV_ABI_FREEBSD | SV_IA32 | SV_ILP32, .sv_set_syscall_retval = ia32_set_syscall_retval, .sv_fetch_syscall_args = ia32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, From owner-svn-src-head@freebsd.org Thu Oct 20 21:12:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E590AC1A1B6; Thu, 20 Oct 2016 21:12:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id B3F06997; Thu, 20 Oct 2016 21:12:51 +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 u9KLCovq098604; Thu, 20 Oct 2016 21:12:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KLCoYR098603; Thu, 20 Oct 2016 21:12:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610202112.u9KLCoYR098603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Oct 2016 21:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307689 - head/gnu/lib/libgcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 21:12:52 -0000 Author: bapt Date: Thu Oct 20 21:12:50 2016 New Revision: 307689 URL: https://svnweb.freebsd.org/changeset/base/307689 Log: Fix building of llvm's unwind if gcc has been also built when building gcc an unwind.h header is generate in the cc_tool directory which is included in the CFLAGS before the path where the llvm's unwind.h file lives Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7357 Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Thu Oct 20 20:29:54 2016 (r307688) +++ head/gnu/lib/libgcc/Makefile Thu Oct 20 21:12:50 2016 (r307689) @@ -30,8 +30,7 @@ CFLAGS+= -DTARGET_ARM_EABI CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ -DHAVE_GTHR_DEFAULT \ -I${GCCLIB}/include \ - -I${GCCDIR}/config -I${GCCDIR} -I. \ - -I${CCDIR}/cc_tools + -I${GCCDIR}/config -I${GCCDIR} -I. LDFLAGS+= -nodefaultlibs LIBADD+= c @@ -102,6 +101,12 @@ CFLAGS+= -I${SRCTOP}/contrib/libc++/incl .else # MK_LLVM_LIBUNWIND +# +# Prevent the potential unwind.h from gcc (generated) +# to be in the include path before the one from llvm unwind +# +CFLAGS+= -I${CCDIR}/cc_tools + .if ${TARGET_CPUARCH} == "arm" LIB2ADDEH = unwind-arm.c libunwind-arm.S pr-support.c unwind-c.c .else From owner-svn-src-head@freebsd.org Thu Oct 20 21:30:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83D66C1A899; Thu, 20 Oct 2016 21:30:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id 51DE576C; Thu, 20 Oct 2016 21:30:00 +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 u9KLTx91002807; Thu, 20 Oct 2016 21:29:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KLTxcu002806; Thu, 20 Oct 2016 21:29:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610202129.u9KLTxcu002806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Oct 2016 21:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307690 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 21:30:00 -0000 Author: emaste Date: Thu Oct 20 21:29:59 2016 New Revision: 307690 URL: https://svnweb.freebsd.org/changeset/base/307690 Log: Don't build libssp as a prereq lib if WITHOUT_SSP is set Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D8301 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 20 21:12:50 2016 (r307689) +++ head/Makefile.inc1 Thu Oct 20 21:29:59 2016 (r307690) @@ -1983,7 +1983,10 @@ libraries: .MAKE .PHONY # # static libgcc.a prerequisite for shared libc # -_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt +_prereq_libs= gnu/lib/libgcc lib/libcompiler_rt +.if ${MK_SSP} != "no" +_prereq_libs+= gnu/lib/libssp/libssp_nonshared +.endif # These dependencies are not automatically generated: # From owner-svn-src-head@freebsd.org Thu Oct 20 22:00:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B7B1C1B0A5; Thu, 20 Oct 2016 22:00:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 29BB4A26; Thu, 20 Oct 2016 22:00:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id A5C35272C; Fri, 21 Oct 2016 00:00:47 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 9A59028494; Fri, 21 Oct 2016 00:00:47 +0200 (CEST) Date: Fri, 21 Oct 2016 00:00:47 +0200 From: Jilles Tjoelker To: Warner Losh Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307469 - head/etc Message-ID: <20161020220047.GA68806@stack.nl> References: <201610170407.u9H47D5n033011@repo.freebsd.org> <20161019202656.GA58917@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 22:00:59 -0000 On Wed, Oct 19, 2016 at 04:45:21PM -0600, Warner Losh wrote: > What missing quotes? It seemed to work find on the system I brought up... In ${root_rw_mount#[Yy][Ee][Ss]} with root_rw_mount=YES, the substring operation results in an empty string, which is removed because there are no quotes. This makes the test expression invalid. The result, with /firstboot existing, is two messages "[: =: unexpected operator" and an attempt to mount / read-only. > I didn't do the case statement because it would be three extra big > useless syntactical boogers in the code :) Fair enough. > I do like the idea of using checkyesno. It probably makes sense to change etc/rc.d/root to use checkyesno. This ensures behaviour with invalid values is exactly the same. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Thu Oct 20 23:02:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C38C1BD56; Thu, 20 Oct 2016 23:02:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id 41FDF97B; Thu, 20 Oct 2016 23:02:31 +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 u9KN2URT040505; Thu, 20 Oct 2016 23:02:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KN2UIF040504; Thu, 20 Oct 2016 23:02:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610202302.u9KN2UIF040504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 20 Oct 2016 23:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307691 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 23:02:31 -0000 Author: markj Date: Thu Oct 20 23:02:30 2016 New Revision: 307691 URL: https://svnweb.freebsd.org/changeset/base/307691 Log: gmirror: Release pending regular requests when synchronization stops. Normally gmirror allows colliding requests to proceed whenever a synchronization request completes and advances to the next offset. However if an I/O request collides with one of the final g_mirror_syncreqs, nothing releases it once synchronization completes, resulting in an apparent I/O hang. The same problem can occur if synchronization is aborted by an I/O error. Therefore, be sure to requeue pending requests when mirror synchronization is stopped for any reason. While here, remove some dead code from g_mirror_regular_release(). MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Thu Oct 20 21:29:59 2016 (r307690) +++ head/sys/geom/mirror/g_mirror.c Thu Oct 20 23:02:30 2016 (r307691) @@ -1252,13 +1252,6 @@ g_mirror_regular_release(struct g_mirror G_MIRROR_LOGREQ(2, bp, "Releasing delayed request (%p).", bp); mtx_lock(&sc->sc_queue_mtx); bioq_insert_head(&sc->sc_queue, bp); -#if 0 - /* - * wakeup() is not needed, because this function is called from - * the worker thread. - */ - wakeup(&sc->sc_queue); -#endif mtx_unlock(&sc->sc_queue_mtx); } } @@ -2065,6 +2058,7 @@ g_mirror_sync_stop(struct g_mirror_disk G_MIRROR_DEBUG(0, "Device %s: rebuilding provider %s stopped.", sc->sc_name, g_mirror_get_diskname(disk)); } + g_mirror_regular_release(sc); free(disk->d_sync.ds_bios, M_MIRROR); disk->d_sync.ds_bios = NULL; cp = disk->d_sync.ds_consumer; From owner-svn-src-head@freebsd.org Thu Oct 20 23:08:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC639C1BE12; Thu, 20 Oct 2016 23:08:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 82653B54; Thu, 20 Oct 2016 23:08:41 +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 u9KN8efr040747; Thu, 20 Oct 2016 23:08:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KN8esF040746; Thu, 20 Oct 2016 23:08:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610202308.u9KN8esF040746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 20 Oct 2016 23:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307692 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 23:08:41 -0000 Author: markj Date: Thu Oct 20 23:08:40 2016 New Revision: 307692 URL: https://svnweb.freebsd.org/changeset/base/307692 Log: gmirror: Add a subroutine to free synchronization BIOs. This addresses a memory leak that occurs upon an I/O error during a mirror synchronization. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Thu Oct 20 23:02:30 2016 (r307691) +++ head/sys/geom/mirror/g_mirror.c Thu Oct 20 23:08:40 2016 (r307692) @@ -1276,6 +1276,22 @@ g_mirror_sync_release(struct g_mirror_so } /* + * Free a synchronization request and clear its slot in the array. + */ +static void +g_mirror_sync_request_free(struct g_mirror_disk *disk, struct bio *bp) +{ + int i; + + if (disk != NULL && disk->d_sync.ds_bios != NULL) { + i = (int)(uintptr_t)bp->bio_caller1; + disk->d_sync.ds_bios[i] = NULL; + } + free(bp->bio_data, M_MIRROR); + g_destroy_bio(bp); +} + +/* * Handle synchronization requests. * Every synchronization request is two-steps process: first, READ request is * send to active provider and then WRITE request (with read data) to the provider @@ -1287,6 +1303,7 @@ g_mirror_sync_request(struct bio *bp) { struct g_mirror_softc *sc; struct g_mirror_disk *disk; + struct g_mirror_disk_sync *sync; bp->bio_from->index--; sc = bp->bio_from->geom->softc; @@ -1296,8 +1313,7 @@ g_mirror_sync_request(struct bio *bp) g_topology_lock(); g_mirror_kill_consumer(sc, bp->bio_from); g_topology_unlock(); - free(bp->bio_data, M_MIRROR); - g_destroy_bio(bp); + g_mirror_sync_request_free(NULL, bp); sx_xlock(&sc->sc_lock); return; } @@ -1317,7 +1333,7 @@ g_mirror_sync_request(struct bio *bp) G_MIRROR_LOGREQ(0, bp, "Synchronization request failed (error=%d).", bp->bio_error); - g_destroy_bio(bp); + g_mirror_sync_request_free(disk, bp); return; } G_MIRROR_LOGREQ(3, bp, @@ -1334,7 +1350,6 @@ g_mirror_sync_request(struct bio *bp) } case BIO_WRITE: { - struct g_mirror_disk_sync *sync; off_t offset; void *data; int i; @@ -1346,7 +1361,7 @@ g_mirror_sync_request(struct bio *bp) G_MIRROR_LOGREQ(0, bp, "Synchronization request failed (error=%d).", bp->bio_error); - g_destroy_bio(bp); + g_mirror_sync_request_free(disk, bp); sc->sc_bump_id |= G_MIRROR_BUMP_GENID; g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DISCONNECTED, @@ -1360,12 +1375,7 @@ g_mirror_sync_request(struct bio *bp) (sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { /* Don't send more synchronization requests. */ sync->ds_inflight--; - if (sync->ds_bios != NULL) { - i = (int)(uintptr_t)bp->bio_caller1; - sync->ds_bios[i] = NULL; - } - free(bp->bio_data, M_MIRROR); - g_destroy_bio(bp); + g_mirror_sync_request_free(disk, bp); if (sync->ds_inflight > 0) return; if (sync->ds_consumer == NULL || From owner-svn-src-head@freebsd.org Thu Oct 20 23:10:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7752C1BE7E; Thu, 20 Oct 2016 23:10:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id 87370CDC; Thu, 20 Oct 2016 23:10:28 +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 u9KNAR0h040865; Thu, 20 Oct 2016 23:10:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KNAR1c040864; Thu, 20 Oct 2016 23:10:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610202310.u9KNAR1c040864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 20 Oct 2016 23:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307693 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 23:10:28 -0000 Author: markj Date: Thu Oct 20 23:10:27 2016 New Revision: 307693 URL: https://svnweb.freebsd.org/changeset/base/307693 Log: Simplify keg_drain() a bit by using LIST_FOREACH_SAFE. MFC after: 1 week Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Oct 20 23:08:40 2016 (r307692) +++ head/sys/vm/uma_core.c Thu Oct 20 23:10:27 2016 (r307693) @@ -845,8 +845,7 @@ static void keg_drain(uma_keg_t keg) { struct slabhead freeslabs = { 0 }; - uma_slab_t slab; - uma_slab_t n; + uma_slab_t slab, tmp; /* * We don't want to take pages from statically allocated kegs at this @@ -862,15 +861,10 @@ keg_drain(uma_keg_t keg) if (keg->uk_free == 0) goto finished; - slab = LIST_FIRST(&keg->uk_free_slab); - while (slab) { - n = LIST_NEXT(slab, us_link); - - /* We have no where to free these to */ - if (slab->us_flags & UMA_SLAB_BOOT) { - slab = n; + LIST_FOREACH_SAFE(slab, &keg->uk_free_slab, us_link, tmp) { + /* We have nowhere to free these to. */ + if (slab->us_flags & UMA_SLAB_BOOT) continue; - } LIST_REMOVE(slab, us_link); keg->uk_pages -= keg->uk_ppera; @@ -880,8 +874,6 @@ keg_drain(uma_keg_t keg) UMA_HASH_REMOVE(&keg->uk_hash, slab, slab->us_data); SLIST_INSERT_HEAD(&freeslabs, slab, us_hlink); - - slab = n; } finished: KEG_UNLOCK(keg); From owner-svn-src-head@freebsd.org Thu Oct 20 23:39:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B074C164C8; Thu, 20 Oct 2016 23:39:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BC0BD8B; Thu, 20 Oct 2016 23:39:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id BE55010AF88; Thu, 20 Oct 2016 19:39:16 -0400 (EDT) From: John Baldwin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307688 - head/sys/compat/ia32 Date: Thu, 20 Oct 2016 15:10:43 -0700 Message-ID: <7756932.Sd4ZDxVN79@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201610202029.u9KKTtCm079124@repo.freebsd.org> References: <201610202029.u9KKTtCm079124@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 20 Oct 2016 19:39:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 23:39:18 -0000 On Thursday, October 20, 2016 08:29:55 PM Ed Maste wrote: > Author: emaste > Date: Thu Oct 20 20:29:54 2016 > New Revision: 307688 > URL: https://svnweb.freebsd.org/changeset/base/307688 > > Log: > Tidy up ia32_sysvec sv_flags setting > > Use the same approach as sys/arm/arm/elf_machdep.c to avoid an odd- > looking , on a separate line. This #ifdef is dubious as compat/ia32 is amd64-only at this point now that ia64 is gone. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Oct 20 23:53:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E53DAC16923; Thu, 20 Oct 2016 23:53:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9D129691; Thu, 20 Oct 2016 23:53:17 +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 u9KNrGY7059895; Thu, 20 Oct 2016 23:53:16 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KNrGJ5059894; Thu, 20 Oct 2016 23:53:16 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201610202353.u9KNrGJ5059894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 20 Oct 2016 23:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307694 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 23:53:18 -0000 Author: rmacklem Date: Thu Oct 20 23:53:16 2016 New Revision: 307694 URL: https://svnweb.freebsd.org/changeset/base/307694 Log: A problem w.r.t. interoperation between the FreeBSD NFSv4.1 server with delegations enabled and the Linux NFSv4.1 client was reported in reviews.freebsd.org/D7891. I believe that the FreeBSD server behaviour conforms to the RFC and that the Linux client has a bug. Therefore, I do not think the proposed patch is appropriate. When nfsrv_writedelegifpos is non-zero, the FreeBSD server will issue a write delegation for a read open if possible. The Linux client then erroneously assumes that the credentials used for the read open can write the file. This patch reverses the default value for nfsrv_writedelegifpos to 0 so that the default behaviour is Linux compatible and adds a sysctl that can be used to set nfsrv_writedelegifpos. This change should only affect users that are mounting a FreeBSD server with delegations enabled (they are not enabled by default) with a Linux NFSv4.1 client mount. Reported by: fatih.acar@gandi.net Tested by: fatih.acar@gandi.net MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D7891 Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Oct 20 23:10:27 2016 (r307693) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Oct 20 23:53:16 2016 (r307694) @@ -70,6 +70,11 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, v4statel &nfsrv_v4statelimit, 0, "High water limit for NFSv4 opens+locks+delegations"); +static int nfsrv_writedelegifpos = 0; +SYSCTL_INT(_vfs_nfsd, OID_AUTO, writedelegifpos, CTLFLAG_RW, + &nfsrv_writedelegifpos, 0, + "Issue a write delegation for read opens if possible"); + /* * Hash lists for nfs V4. */ @@ -80,7 +85,6 @@ struct nfssessionhash *nfssessionhash; static u_int32_t nfsrv_openpluslock = 0, nfsrv_delegatecnt = 0; static time_t nfsrvboottime; -static int nfsrv_writedelegifpos = 1; static int nfsrv_returnoldstateid = 0, nfsrv_clients = 0; static int nfsrv_clienthighwater = NFSRV_CLIENTHIGHWATER; static int nfsrv_nogsscallback = 0; From owner-svn-src-head@freebsd.org Fri Oct 21 02:07:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17C76C112ED; Fri, 21 Oct 2016 02:07:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id DDA36C04; Fri, 21 Oct 2016 02:07:04 +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 u9L274L3009448; Fri, 21 Oct 2016 02:07:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L274Fl009447; Fri, 21 Oct 2016 02:07:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610210207.u9L274Fl009447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 21 Oct 2016 02:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307695 - head/sys/dev/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 02:07:05 -0000 Author: jhibbits Date: Fri Oct 21 02:07:03 2016 New Revision: 307695 URL: https://svnweb.freebsd.org/changeset/base/307695 Log: Remove an unnecessary debug printf. Modified: head/sys/dev/dpaa/bman.c Modified: head/sys/dev/dpaa/bman.c ============================================================================== --- head/sys/dev/dpaa/bman.c Thu Oct 20 23:53:16 2016 (r307694) +++ head/sys/dev/dpaa/bman.c Fri Oct 21 02:07:03 2016 (r307695) @@ -117,7 +117,6 @@ bman_attach(device_t dev) bp.errIrq = (uintptr_t)sc->sc_ires; bp.partBpidBase = 0; bp.partNumOfPools = BM_MAX_NUM_OF_POOLS; - printf("base address: %llx\n", (uint64_t)bp.baseAddress); sc->sc_bh = BM_Config(&bp); if (sc->sc_bh == NULL) From owner-svn-src-head@freebsd.org Fri Oct 21 02:16:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F3EC11691; Fri, 21 Oct 2016 02:16:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id ADD301D2; Fri, 21 Oct 2016 02:16:13 +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 u9L2GCJ5013224; Fri, 21 Oct 2016 02:16:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L2GCGt013216; Fri, 21 Oct 2016 02:16:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610210216.u9L2GCGt013216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 21 Oct 2016 02:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307696 - in head/sys: dev/dpaa powerpc/conf/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 02:16:14 -0000 Author: jhibbits Date: Fri Oct 21 02:16:11 2016 New Revision: 307696 URL: https://svnweb.freebsd.org/changeset/base/307696 Log: Remove a hack requiring dtsec0 to always be enabled for mdio. Instead replace it with a different hack, that turns fman into a simplebus subclass, and maps its children within its address space. Since all PHY communication is done through dtsec0's mdio space, the FDT contains a reference to the dtsec0 mdio handle in all nodes that need it. Instead of using Freescale's implementation for MII access, use our own (copied loosely from the eTSEC driver, and could possibly be merged eventually). This lets us access the registers directly rather than needing a full dtsec interface just to access the registers. Future directions will include turning fman into more of a simplebus, and not mapping the region and playing games. This will require changes to the dtsec driver to make it a child of fman, and possibly other drivers as well. Added: head/sys/dev/dpaa/fman_mdio.c (contents, props changed) Modified: head/sys/dev/dpaa/fman.c head/sys/dev/dpaa/fman.h head/sys/dev/dpaa/fman_fdt.c head/sys/dev/dpaa/if_dtsec.c head/sys/dev/dpaa/if_dtsec.h head/sys/dev/dpaa/if_dtsec_fdt.c head/sys/powerpc/conf/dpaa/files.dpaa Modified: head/sys/dev/dpaa/fman.c ============================================================================== --- head/sys/dev/dpaa/fman.c Fri Oct 21 02:07:03 2016 (r307695) +++ head/sys/dev/dpaa/fman.c Fri Oct 21 02:16:11 2016 (r307696) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -88,6 +89,8 @@ static struct fman_softc *fm_sc = NULL; static t_Handle fman_init(struct fman_softc *sc, struct fman_config *cfg) { + struct ofw_bus_devinfo obd; + phandle_t node; t_FmParams fm_params; t_Handle muram_handle, fm_handle; t_Error error; @@ -158,6 +161,16 @@ fman_init(struct fman_softc *sc, struct device_printf(cfg->fman_device, "Hardware version: %d.%d.\n", revision_info.majorRev, revision_info.minorRev); + /* Initialize the simplebus part of things */ + simplebus_init(sc->sc_base.dev, 0); + + node = ofw_bus_get_node(sc->sc_base.dev); + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if (ofw_bus_gen_setup_devinfo(&obd, node) != 0) + continue; + simplebus_add_device(sc->sc_base.dev, node, 0, NULL, -1, NULL); + } + return (fm_handle); err2: @@ -173,7 +186,7 @@ fman_exception_callback(t_Handle app_han struct fman_softc *sc; sc = app_handle; - device_printf(sc->dev, "FMan exception occurred.\n"); + device_printf(sc->sc_base.dev, "FMan exception occurred.\n"); } static void @@ -183,7 +196,7 @@ fman_error_callback(t_Handle app_handle, struct fman_softc *sc; sc = app_handle; - device_printf(sc->dev, "FMan error occurred.\n"); + device_printf(sc->sc_base.dev, "FMan error occurred.\n"); } /** @} */ @@ -230,13 +243,25 @@ fman_get_bushandle(vm_offset_t *fm_base) } int +fman_get_dev(device_t *fm_dev) +{ + + if (fm_sc == NULL) + return (ENOMEM); + + *fm_dev = fm_sc->sc_base.dev; + + return (0); +} + +int fman_attach(device_t dev) { struct fman_softc *sc; struct fman_config cfg; sc = device_get_softc(dev); - sc->dev = dev; + sc->sc_base.dev = dev; fm_sc = sc; /* Check if MallocSmart allocator is ready */ @@ -249,7 +274,7 @@ fman_attach(device_t dev) sc->mem_rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE); if (!sc->mem_res) { device_printf(dev, "could not allocate memory.\n"); return (ENXIO); Modified: head/sys/dev/dpaa/fman.h ============================================================================== --- head/sys/dev/dpaa/fman.h Fri Oct 21 02:07:03 2016 (r307695) +++ head/sys/dev/dpaa/fman.h Fri Oct 21 02:16:11 2016 (r307696) @@ -29,11 +29,13 @@ #ifndef FMAN_H_ #define FMAN_H_ +#include + /** * FMan driver instance data. */ struct fman_softc { - device_t dev; + struct simplebus_softc sc_base; struct resource *mem_res; struct resource *irq_res; struct resource *err_irq_res; @@ -63,5 +65,6 @@ uint32_t fman_get_clock(struct fman_soft int fman_get_handle(t_Handle *fmh); int fman_get_muram_handle(t_Handle *muramh); int fman_get_bushandle(vm_offset_t *fm_base); +int fman_get_dev(device_t *fmd); #endif /* FMAN_H_ */ Modified: head/sys/dev/dpaa/fman_fdt.c ============================================================================== --- head/sys/dev/dpaa/fman_fdt.c Fri Oct 21 02:07:03 2016 (r307695) +++ head/sys/dev/dpaa/fman_fdt.c Fri Oct 21 02:16:11 2016 (r307696) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -58,12 +59,8 @@ static device_method_t fman_methods[] = { 0, 0 } }; -static driver_t fman_driver = { - "fman", - fman_methods, - sizeof(struct fman_softc), -}; - +DEFINE_CLASS_1(fman, fman_driver, fman_methods, + sizeof(struct fman_softc), simplebus_driver); static devclass_t fman_devclass; EARLY_DRIVER_MODULE(fman, simplebus, fman_driver, fman_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); @@ -88,7 +85,7 @@ fman_get_clock(struct fman_softc *sc) phandle_t node; pcell_t fman_clock; - dev = sc->dev; + dev = sc->sc_base.dev; node = ofw_bus_get_node(dev); if ((OF_getprop(node, "clock-frequency", &fman_clock, Added: head/sys/dev/dpaa/fman_mdio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/dpaa/fman_mdio.c Fri Oct 21 02:16:11 2016 (r307696) @@ -0,0 +1,211 @@ +/*- + * Copyright (c) 2016 Justin Hibbits + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "fman.h" +#include "miibus_if.h" + +#define MDIO_LOCK() mtx_lock(&sc->sc_lock) +#define MDIO_UNLOCK() mtx_unlock(&sc->sc_lock) +#define MDIO_WRITE4(sc,r,v) \ + bus_space_write_4(&bs_be_tag, sc->sc_handle, sc->sc_offset + r, v) +#define MDIO_READ4(sc, r) \ + bus_space_read_4(&bs_be_tag, sc->sc_handle, sc->sc_offset + r) + +#define MDIO_MIIMCFG 0x0 +#define MDIO_MIIMCOM 0x4 +#define MIIMCOM_SCAN_CYCLE 0x00000002 +#define MIIMCOM_READ_CYCLE 0x00000001 +#define MDIO_MIIMADD 0x8 +#define MDIO_MIIMCON 0xc +#define MDIO_MIIMSTAT 0x10 +#define MDIO_MIIMIND 0x14 +#define MIIMIND_BUSY 0x1 + +static int pqmdio_fdt_probe(device_t dev); +static int pqmdio_fdt_attach(device_t dev); +static int pqmdio_detach(device_t dev); +static int pqmdio_miibus_readreg(device_t dev, int phy, int reg); +static int pqmdio_miibus_writereg(device_t dev, int phy, int reg, int value); + +struct pqmdio_softc { + struct mtx sc_lock; + bus_space_handle_t sc_handle; + int sc_offset; +}; + +static device_method_t pqmdio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, pqmdio_fdt_probe), + DEVMETHOD(device_attach, pqmdio_fdt_attach), + DEVMETHOD(device_detach, pqmdio_detach), + + /* MII interface */ + DEVMETHOD(miibus_readreg, pqmdio_miibus_readreg), + DEVMETHOD(miibus_writereg, pqmdio_miibus_writereg), + + { 0, 0 } +}; + +static struct ofw_compat_data mdio_compat_data[] = { + {"fsl,fman-mdio", 0}, + {NULL, 0} +}; + +static driver_t pqmdio_driver = { + "pq_mdio", + pqmdio_methods, + sizeof(struct pqmdio_softc), +}; + +static int +pqmdio_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, mdio_compat_data)->ocd_str) + return (ENXIO); + + device_set_desc(dev, "Freescale QorIQ MDIO"); + + return (BUS_PROBE_DEFAULT); +} + +static int +pqmdio_fdt_attach(device_t dev) +{ + struct pqmdio_softc *sc; + rman_res_t start, count; + + sc = device_get_softc(dev); + + fman_get_bushandle(&sc->sc_handle); + bus_get_resource(dev, SYS_RES_MEMORY, 0, &start, &count); + sc->sc_offset = start; + + mtx_init(&sc->sc_lock, device_get_nameunit(dev), "QorIQ MDIO lock", + MTX_DEF); + + return (0); +} + +static int +pqmdio_detach(device_t dev) +{ + struct pqmdio_softc *sc; + + sc = device_get_softc(dev); + + mtx_destroy(&sc->sc_lock); + + return (0); +} + +int +pqmdio_miibus_readreg(device_t dev, int phy, int reg) +{ + struct pqmdio_softc *sc; + int rv; + + sc = device_get_softc(dev); + + MDIO_LOCK(); + + MDIO_WRITE4(sc, MDIO_MIIMADD, (phy << 8) | reg); + MDIO_WRITE4(sc, MDIO_MIIMCOM, MIIMCOM_READ_CYCLE); + + MDIO_READ4(sc, MDIO_MIIMCOM); + + while ((MDIO_READ4(sc, MDIO_MIIMIND)) & MIIMIND_BUSY) + ; + + rv = MDIO_READ4(sc, MDIO_MIIMSTAT); + + MDIO_WRITE4(sc, MDIO_MIIMCOM, 0); + MDIO_READ4(sc, MDIO_MIIMCOM); + MDIO_UNLOCK(); + + return (rv); +} + +int +pqmdio_miibus_writereg(device_t dev, int phy, int reg, int value) +{ + struct pqmdio_softc *sc; + + sc = device_get_softc(dev); + + MDIO_LOCK(); + /* Stop the MII management read cycle */ + MDIO_WRITE4(sc, MDIO_MIIMCOM, 0); + MDIO_READ4(sc, MDIO_MIIMCOM); + + MDIO_WRITE4(sc, MDIO_MIIMADD, (phy << 8) | reg); + + MDIO_WRITE4(sc, MDIO_MIIMCON, value); + MDIO_READ4(sc, MDIO_MIIMCON); + + /* Wait till MII management write is complete */ + while ((MDIO_READ4(sc, MDIO_MIIMIND)) & MIIMIND_BUSY) + ; + MDIO_UNLOCK(); + + return (0); +} + +static devclass_t pqmdio_devclass; +DRIVER_MODULE(pqmdio, fman, pqmdio_driver, pqmdio_devclass, 0, 0); +DRIVER_MODULE(miibus, pqmdio, miibus_driver, miibus_devclass, 0, 0); +MODULE_DEPEND(pqmdio, miibus, 1, 1, 1); + Modified: head/sys/dev/dpaa/if_dtsec.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec.c Fri Oct 21 02:07:03 2016 (r307695) +++ head/sys/dev/dpaa/if_dtsec.c Fri Oct 21 02:16:11 2016 (r307696) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -79,13 +80,6 @@ struct dtsec_fm_mac_ex_str { const int num; const char *str; }; - -/* XXX: Handle to FM_MAC instance of dTSEC0 */ -/* From QorIQ Data Path Acceleration Architecture Reference Manual, Rev 2, page - * 3-37, "The MII management hardware is shared by all dTSECs... only through - * the MIIM registers of dTSEC1 can external PHY's be accessed and configured." - */ -static t_Handle dtsec_mdio_mac_handle; /** @} */ @@ -205,8 +199,6 @@ dtsec_fm_mac_init(struct dtsec_softc *sc params.h_Fm = sc->sc_fmh; sc->sc_mach = FM_MAC_Config(¶ms); - if (sc->sc_hidden) - return (0); if (sc->sc_mach == NULL) { device_printf(sc->sc_dev, "couldn't configure FM_MAC module.\n" ); @@ -647,20 +639,6 @@ dtsec_attach(device_t dev) return (ENXIO); } - /* - * XXX: All phys are connected to MDIO interface of the first dTSEC - * device (dTSEC0). We have to save handle to the FM_MAC instance of - * dTSEC0, which is used later during phy's registers accesses. Another - * option would be adding new property to DTS pointing to correct dTSEC - * instance, of which FM_MAC handle has to be used for phy's registers - * accesses. We did not want to add new properties to DTS, thus this - * quite ugly hack. - */ - if (sc->sc_eth_id == 0) - dtsec_mdio_mac_handle = sc->sc_mach; - if (sc->sc_hidden) - return (0); - /* Init FMan TX port */ error = sc->sc_port_tx_init(sc, device_get_unit(sc->sc_dev)); if (error != 0) { @@ -797,47 +775,21 @@ int dtsec_miibus_readreg(device_t dev, int phy, int reg) { struct dtsec_softc *sc; - uint16_t data; - t_Error error; sc = device_get_softc(dev); - if (phy != sc->sc_phy_addr) - return (0xFFFF); - - DTSEC_MII_LOCK(sc); - error = FM_MAC_MII_ReadPhyReg(dtsec_mdio_mac_handle, phy, reg, &data); - DTSEC_MII_UNLOCK(sc); - if (error != E_OK) { - device_printf(dev, "Error while reading from PHY (NetCommSw " - "error: %d)\n", error); - return (0xFFFF); - } - - return ((int)data); + return (MIIBUS_READREG(sc->sc_mdio, phy, reg)); } int dtsec_miibus_writereg(device_t dev, int phy, int reg, int value) { + struct dtsec_softc *sc; - t_Error error; sc = device_get_softc(dev); - if (phy != sc->sc_phy_addr) - return (EINVAL); - - DTSEC_MII_LOCK(sc); - error = FM_MAC_MII_WritePhyReg(dtsec_mdio_mac_handle, phy, reg, value); - DTSEC_MII_UNLOCK(sc); - if (error != E_OK) { - device_printf(dev, "Error while writing to PHY (NetCommSw " - "error: %d).\n", error); - return (EIO); - } - - return (0); + return (MIIBUS_WRITEREG(sc->sc_mdio, phy, reg, value)); } void Modified: head/sys/dev/dpaa/if_dtsec.h ============================================================================== --- head/sys/dev/dpaa/if_dtsec.h Fri Oct 21 02:07:03 2016 (r307695) +++ head/sys/dev/dpaa/if_dtsec.h Fri Oct 21 02:16:11 2016 (r307696) @@ -75,6 +75,7 @@ struct dtsec_softc { uint32_t sc_port_tx_qman_chan; int sc_phy_addr; bool sc_hidden; + device_t sc_mdio; /* Params from fman_bus driver */ vm_offset_t sc_fm_base; Modified: head/sys/dev/dpaa/if_dtsec_fdt.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_fdt.c Fri Oct 21 02:07:03 2016 (r307695) +++ head/sys/dev/dpaa/if_dtsec_fdt.c Fri Oct 21 02:16:11 2016 (r307696) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include "if_dtsec.h" +#include "fman.h" static int dtsec_fdt_probe(device_t dev); @@ -106,6 +107,28 @@ dtsec_fdt_probe(device_t dev) } static int +find_mdio(phandle_t phy_node, device_t mac, device_t *mdio_dev) +{ + device_t bus; + + while (phy_node > 0) { + if (ofw_bus_node_is_compatible(phy_node, "fsl,fman-mdio")) + break; + phy_node = OF_parent(phy_node); + } + + if (phy_node <= 0) + return (ENOENT); + + if (fman_get_dev(&bus) < 0) + return (ENOENT); + + *mdio_dev = ofw_bus_find_child_device_by_phandle(bus, phy_node); + + return (0); +} + +static int dtsec_fdt_attach(device_t dev) { struct dtsec_softc *sc; @@ -127,13 +150,9 @@ dtsec_fdt_attach(device_t dev) if (OF_getprop(enet_node, "local-mac-address", (void *)sc->sc_mac_addr, 6) == -1) { - if (device_get_unit(dev) != 0) { - device_printf(dev, - "Could not load local-mac-addr property " - "from DTS\n"); - return (ENXIO); - } - sc->sc_hidden = true; + device_printf(dev, + "Could not load local-mac-addr property from DTS\n"); + return (ENXIO); } /* Get link speed */ @@ -160,6 +179,9 @@ dtsec_fdt_attach(device_t dev) sizeof(sc->sc_phy_addr)) <= 0) return (ENXIO); + if (find_mdio(phy_node, dev, &sc->sc_mdio) != 0) + return (ENXIO); + /* Get PHY connection type */ if (OF_getprop(enet_node, "phy-connection-type", (void *)phy_type, sizeof(phy_type)) <= 0) Modified: head/sys/powerpc/conf/dpaa/files.dpaa ============================================================================== --- head/sys/powerpc/conf/dpaa/files.dpaa Fri Oct 21 02:07:03 2016 (r307695) +++ head/sys/powerpc/conf/dpaa/files.dpaa Fri Oct 21 02:16:11 2016 (r307696) @@ -87,6 +87,8 @@ dev/dpaa/qman_fdt.c optional dpaa fdt no-depend compile-with "${DPAA_COMPILE_CMD}" dev/dpaa/fman.c optional dpaa fdt \ no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/fman_mdio.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" dev/dpaa/fman_fdt.c optional dpaa fdt \ no-depend compile-with "${DPAA_COMPILE_CMD}" dev/dpaa/if_dtsec.c optional dpaa \ From owner-svn-src-head@freebsd.org Fri Oct 21 03:23:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A680BC198E0; Fri, 21 Oct 2016 03:23:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7635D1AF6; Fri, 21 Oct 2016 03:23:18 +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 u9L3NHxA041229; Fri, 21 Oct 2016 03:23:17 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L3NHO7041228; Fri, 21 Oct 2016 03:23:17 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201610210323.u9L3NHO7041228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 21 Oct 2016 03:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307698 - head/sys/modules/gpio/gpiospi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 03:23:18 -0000 Author: lwhsu (ports committer) Date: Fri Oct 21 03:23:17 2016 New Revision: 307698 URL: https://svnweb.freebsd.org/changeset/base/307698 Log: - Add required header for fixing `make` in sys/modules/gpio Reviewed by: imp, loos Differential Revision: https://reviews.freebsd.org/D7815 Modified: head/sys/modules/gpio/gpiospi/Makefile Modified: head/sys/modules/gpio/gpiospi/Makefile ============================================================================== --- head/sys/modules/gpio/gpiospi/Makefile Fri Oct 21 03:10:05 2016 (r307697) +++ head/sys/modules/gpio/gpiospi/Makefile Fri Oct 21 03:23:17 2016 (r307698) @@ -34,7 +34,7 @@ KMOD= gpiospi SRCS= gpiospi.c SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h spibus_if.h -SRCS+= ofw_bus_if.h opt_gpio.h +SRCS+= ofw_bus_if.h opt_gpio.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ From owner-svn-src-head@freebsd.org Fri Oct 21 04:49:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66843C1AED6; Fri, 21 Oct 2016 04:49:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2CC7E21E; Fri, 21 Oct 2016 04:49:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L4ndbW071298; Fri, 21 Oct 2016 04:49:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L4ndCA071297; Fri, 21 Oct 2016 04:49:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610210449.u9L4ndCA071297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 21 Oct 2016 04:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307699 - head/gnu/lib/libgcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 04:49:40 -0000 Author: ngie Date: Fri Oct 21 04:49:39 2016 New Revision: 307699 URL: https://svnweb.freebsd.org/changeset/base/307699 Log: Revert r307689 The proposed change ("Fix building of llvm's unwind if gcc has been also built") breaks the build with clang/llvm. Tested with... ( export SRCCONF=/dev/null WITH_CLANG= cd gnu/lib/libgcc; make obj; make depend; make all ) MFC after: 3 days X-MFC with: r307689 Pointyhat to: bapt Reported by: Jenkins, O. Hartmann Sponsored by: Dell EMC Isilon Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Fri Oct 21 03:23:17 2016 (r307698) +++ head/gnu/lib/libgcc/Makefile Fri Oct 21 04:49:39 2016 (r307699) @@ -30,7 +30,8 @@ CFLAGS+= -DTARGET_ARM_EABI CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ -DHAVE_GTHR_DEFAULT \ -I${GCCLIB}/include \ - -I${GCCDIR}/config -I${GCCDIR} -I. + -I${GCCDIR}/config -I${GCCDIR} -I. \ + -I${CCDIR}/cc_tools LDFLAGS+= -nodefaultlibs LIBADD+= c @@ -101,12 +102,6 @@ CFLAGS+= -I${SRCTOP}/contrib/libc++/incl .else # MK_LLVM_LIBUNWIND -# -# Prevent the potential unwind.h from gcc (generated) -# to be in the include path before the one from llvm unwind -# -CFLAGS+= -I${CCDIR}/cc_tools - .if ${TARGET_CPUARCH} == "arm" LIB2ADDEH = unwind-arm.c libunwind-arm.S pr-support.c unwind-c.c .else From owner-svn-src-head@freebsd.org Fri Oct 21 04:50:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C71E4C1AF49; Fri, 21 Oct 2016 04:50:12 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9382D3CC; Fri, 21 Oct 2016 04:50:12 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id r16so7441461pfg.3; Thu, 20 Oct 2016 21:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=1+5OXldtC/A8H5y0gGYiToAk+UPcQ4TcAY/gbuoXhgg=; b=YGVyBSa+ZHJ1PEaICMubqTpXIaOYKy//hdWS8ng8D+BEdW6AqpmoKDSft3AqNA2n09 C8yRymuoCNC4LTsW1KdaKM76ObW3p9n12czzpLNEa+Wvt+w8UnZ6/xbJchcMN8W335Vc V7axUs0fYXDh39iyd3w6C1aCySpXzDi605rxp4k0dL3HXwW5uKrav2F+30GOOTM2uYRd QHFYEFxS9Jl/P12DFX7UP6kVtXCXxuzkr9nGQh9paDPdqbXiRVmoHEHWuhtP/N7z8F5c WGwSqYdBW7Ziv1K8ZxU5oD+ZqWaIs0iUuFMGxHkqAfp17ymtkc6Pbw45OxTAOTvyOM9W 4PeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=1+5OXldtC/A8H5y0gGYiToAk+UPcQ4TcAY/gbuoXhgg=; b=RCf0MHu/EbTghujXIEjVpgcEPHsCvxbGVgZ8hvitJ0L8m0fVOGFc8UGBK+5a03zs54 S94+4P0d2Ft1ELUa5gJ4fR5tGJ54mmqsUB8o8CO5/SodyDawm5FtpQXCWbQYUms0p6vH FQU2f5KQJWDp5ApxRdXqr//C6SwacCe8uscNg+q+0lVwOOcq51qXlWfLSb63/vWuskUB hmFIJak6CbQ0p3KQGQz6FrhUXK7uEI7RbFX1Ah39fu8SdlKxOtNHGg3+xwfcS/qiz3J+ lnEja8OVOtmykpk44e56I9uI6CkBLRovpLSt5ZsGFYuaa+bb+1otG8ZO2oMp/ZQ0Jw51 I4IQ== X-Gm-Message-State: AA6/9RnO+FSXFQ7ytTo2eCQmJugsF/A4qhVkanqxzNnoRS1bxGSu/MOpTvJZj2esS7GV1g== X-Received: by 10.99.119.68 with SMTP id s65mr6577065pgc.160.1477025411861; Thu, 20 Oct 2016 21:50:11 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a23sm938340pfc.59.2016.10.20.21.50.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Oct 2016 21:50:11 -0700 (PDT) Subject: Re: svn commit: r307689 - head/gnu/lib/libgcc Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7807D56A-DA4A-42F4-A2B1-A4ACA871D4A4"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201610202112.u9KLCoYR098603@repo.freebsd.org> Date: Thu, 20 Oct 2016 21:50:13 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <045B2295-607B-483F-9A43-FC2663AC789A@gmail.com> References: <201610202112.u9KLCoYR098603@repo.freebsd.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 04:50:12 -0000 --Apple-Mail=_7807D56A-DA4A-42F4-A2B1-A4ACA871D4A4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 20, 2016, at 14:12, Baptiste Daroussin = wrote: >=20 > Author: bapt > Date: Thu Oct 20 21:12:50 2016 > New Revision: 307689 > URL: https://svnweb.freebsd.org/changeset/base/307689 >=20 > Log: > Fix building of llvm's unwind if gcc has been also built >=20 > when building gcc an unwind.h header is generate in the cc_tool = directory > which is included in the CFLAGS before the path where the llvm's = unwind.h file > lives >=20 > Reviewed by: emaste > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D7357 This broke the build with clang and was reverted via r307699. Thanks, -Ngie --Apple-Mail=_7807D56A-DA4A-42F4-A2B1-A4ACA871D4A4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYCZ6FAAoJEPWDqSZpMIYVWpQQAKrWjgY95+D7NNSD53CBN/Lp 0rAE2Sf5dS+ybejcPRD8etpyKqx7PvT7mPMfyH6Dctvu+r0m74XpLDwmmtJcEa+X iMQoAhHE8LL2n2nTKZn2VeualJUokOao6k6ZaD2cAga1DyF4OQJRc3WSRRDTYHeh r10TtsSu/1B32qEX0JJOBSgJJq5zEcE2nQNa7ykorUlbJTxFULCJnhnsiK//b+Mg vsvl1+0/o0zMKIMKM7029SgsKV+SsRD6Syw+W1/7Z2byE0uKmTBaA1p9bH8i4nWs OfTooGacKh8qQnqxQwhYEax3pwJ7np8z5ehjZVKl63AMeydr78fcT1lWGjp9uGZ/ O933HMk9YmFIYmVChT0cq9WavzQgMd8/Wo/YosYgbW5lLcnl+NBARp8/bhQLTxRP APE+r+Ha9xrsGIpRwGK70oK7E02HNiNHWU7lypcj5IV+u0XOIDvByYMNLjlCCIQN hKfubkAkawazdE34LDghpYOwi+Whv4cVLYuRtZwx5iAltjMH+C2HcOSBuUr5ORYs 4SBsDzcXSgemvDyG3goE4D32n61xYsPgwjYAeyDa9j/HdgBqo/XgkAc7VQv4ywpG iojQFfw21dIhUYWBOKEkuvS92bu/Cv+l94LaW4TdFT+0EWFV8npv8CO528TXmiG6 VD+MPOdbWmSg55OBiVm9 =v6Fr -----END PGP SIGNATURE----- --Apple-Mail=_7807D56A-DA4A-42F4-A2B1-A4ACA871D4A4-- From owner-svn-src-head@freebsd.org Fri Oct 21 04:54:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C99EC1B14E; Fri, 21 Oct 2016 04:54:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 CCFD5B4E; Fri, 21 Oct 2016 04:54:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L4shKg074924; Fri, 21 Oct 2016 04:54:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L4sh0S074923; Fri, 21 Oct 2016 04:54:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610210454.u9L4sh0S074923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 21 Oct 2016 04:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307700 - head/lib/libc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 04:54:45 -0000 Author: ngie Date: Fri Oct 21 04:54:43 2016 New Revision: 307700 URL: https://svnweb.freebsd.org/changeset/base/307700 Log: Only build lib/libc/tests/iconv if MK_ICONV != no MFC after: 1 week Reported by: damian@damianek.be Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/Makefile Modified: head/lib/libc/tests/Makefile ============================================================================== --- head/lib/libc/tests/Makefile Fri Oct 21 04:49:39 2016 (r307699) +++ head/lib/libc/tests/Makefile Fri Oct 21 04:54:43 2016 (r307700) @@ -8,7 +8,6 @@ TESTS_SUBDIRS= c063 TESTS_SUBDIRS+= db TESTS_SUBDIRS+= gen TESTS_SUBDIRS+= hash -TESTS_SUBDIRS+= iconv TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net TESTS_SUBDIRS+= nss @@ -26,6 +25,10 @@ TESTS_SUBDIRS+= ttyio SUBDIR_DEPEND_tls= tls_dso +.if ${MK_ICONV} != "no" +TESTS_SUBDIRS+= iconv +.endif + .if ${MK_LOCALES} != "no" TESTS_SUBDIRS+= locale .endif From owner-svn-src-head@freebsd.org Fri Oct 21 05:21:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E117BC1B535; Fri, 21 Oct 2016 05:21:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B088B759; Fri, 21 Oct 2016 05:21:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L5LKCb082582; Fri, 21 Oct 2016 05:21:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L5LKKD082581; Fri, 21 Oct 2016 05:21:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610210521.u9L5LKKD082581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 21 Oct 2016 05:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307701 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 05:21:22 -0000 Author: ngie Date: Fri Oct 21 05:21:20 2016 New Revision: 307701 URL: https://svnweb.freebsd.org/changeset/base/307701 Log: Expect tests/sys/fs/tmpfs/link_test:kqueue to fail It fails with: "dir/b did not receive NOTE_LINK" Also, add needed cleanup logic to cleanup the mountpoint after the fact MFC after: 2 weeks PR: 213662 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/fs/tmpfs/t_link.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_link.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_link.sh Fri Oct 21 04:54:43 2016 (r307700) +++ head/contrib/netbsd-tests/fs/tmpfs/t_link.sh Fri Oct 21 05:21:20 2016 (r307701) @@ -93,7 +93,18 @@ subdirs_body() { test_unmount } +# Begin FreeBSD +if true; then +atf_test_case kqueue cleanup +kqueue_cleanup() { + Mount_Point=$(pwd)/mntpt test_unmount || : +} +else +# End FreeBSD atf_test_case kqueue +# Begin FreeBSD +fi +# End FreeBSD kqueue_head() { atf_set "descr" "Verifies that creating a link raises the correct" \ "kqueue events" @@ -102,6 +113,10 @@ kqueue_head() { kqueue_body() { test_mount + # Begin FreeBSD + atf_expect_fail "fails with: dir/b did not receive NOTE_LINK - bug 213662" + # End FreeBSD + atf_check -s eq:0 -o empty -e empty mkdir dir atf_check -s eq:0 -o empty -e empty touch dir/a echo 'ln dir/a dir/b' | kqueue_monitor 2 dir dir/a From owner-svn-src-head@freebsd.org Fri Oct 21 05:24:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A32C1B6B7; Fri, 21 Oct 2016 05:24:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 EAABDC25; Fri, 21 Oct 2016 05:24:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L5O9xp086264; Fri, 21 Oct 2016 05:24:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L5O8Ua086260; Fri, 21 Oct 2016 05:24:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610210524.u9L5O8Ua086260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 21 Oct 2016 05:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307702 - in head: etc/mtree tests/sys tests/sys/fs tests/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 05:24:10 -0000 Author: ngie Date: Fri Oct 21 05:24:08 2016 New Revision: 307702 URL: https://svnweb.freebsd.org/changeset/base/307702 Log: Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite as tests/sys/fs These testcases exercise tmpfs support MFC after: 2 weeks Sponsored by: Dell EMC Isilon Added: head/tests/sys/fs/ head/tests/sys/fs/Makefile (contents, props changed) head/tests/sys/fs/tmpfs/ head/tests/sys/fs/tmpfs/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Oct 21 05:21:20 2016 (r307701) +++ head/etc/mtree/BSD.tests.dist Fri Oct 21 05:24:08 2016 (r307702) @@ -396,6 +396,10 @@ .. file .. + fs + tmpfs + .. + .. geom class concat Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Fri Oct 21 05:21:20 2016 (r307701) +++ head/tests/sys/Makefile Fri Oct 21 05:24:08 2016 (r307702) @@ -6,6 +6,7 @@ TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file +TESTS_SUBDIRS+= fs TESTS_SUBDIRS+= geom TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue Added: head/tests/sys/fs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/fs/Makefile Fri Oct 21 05:24:08 2016 (r307702) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/fs + +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs + +#TESTS_SUBDIRS+= nullfs # XXX: needs rump +TESTS_SUBDIRS+= tmpfs + +${PACKAGE}FILES+= h_funcs.subr +${PACKAGE}FILESDIR= ${TESTSDIR} + +CLEANFILES+= h_funcs.subr +CLEANFILES+= h_funcs.subr.tmp + +h_funcs.subr: ${TESTSRC}/h_funcs.subr + cat ${.ALLSRC} | \ + sed -e '/atf_require_prog mount_$${name}/d' >>${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} + +.include Added: head/tests/sys/fs/tmpfs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/fs/tmpfs/Makefile Fri Oct 21 05:24:08 2016 (r307702) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +PACKAGE= tests + +FILESYSTEM?= ${.CURDIR:T} + +TESTSDIR= ${TESTSBASE}/sys/fs/${FILESYSTEM} + +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs/${FILESYSTEM} + +# XXX: uses /dev/MAKEDEV to create pseudo /dev/{null,zero} character devices +#NETBSD_ATF_TESTS_SH+= devices_test +NETBSD_ATF_TESTS_SH+= create_test +NETBSD_ATF_TESTS_SH+= read_write_test +NETBSD_ATF_TESTS_SH+= dots_test +NETBSD_ATF_TESTS_SH+= exec_test +NETBSD_ATF_TESTS_SH+= link_test +NETBSD_ATF_TESTS_SH+= mkdir_test +NETBSD_ATF_TESTS_SH+= mknod_test +NETBSD_ATF_TESTS_SH+= mount_test +# XXX: need to replace `mknod ... p` with something more sensible +#NETBSD_ATF_TESTS_SH+= pipes_test +NETBSD_ATF_TESTS_SH+= trail_slash_test +NETBSD_ATF_TESTS_SH+= readdir_test +NETBSD_ATF_TESTS_SH+= remove_test +NETBSD_ATF_TESTS_SH+= rename_test +NETBSD_ATF_TESTS_SH+= rmdir_test +NETBSD_ATF_TESTS_SH+= setattr_test +NETBSD_ATF_TESTS_SH+= sizes_test +NETBSD_ATF_TESTS_SH+= sockets_test +NETBSD_ATF_TESTS_SH+= statvfs_test +NETBSD_ATF_TESTS_SH+= symlink_test +NETBSD_ATF_TESTS_SH+= times_test +NETBSD_ATF_TESTS_SH+= truncate_test +NETBSD_ATF_TESTS_SH+= vnd_test +NETBSD_ATF_TESTS_SH+= vnode_leak_test + +${PACKAGE}FILES+= h_funcs.subr +${PACKAGE}FILESDIR= ${TESTSDIR} + +PROGS+= h_tools +BINDIR.h_tools= ${TESTSDIR} + +ATF_TESTS_SH_SED_mount_test= \ + -e 's,-o -g,-o gid=,g' \ + -e 's,-o -m,-o mode=,g' \ + -e 's,-o -s,-o size=,g' \ + -e 's,-o -u,-o uid=,g' \ + -e 's,mount_${FILESYSTEM},mount -t ${FILESYSTEM},g' +ATF_TESTS_SH_SED_sizes_test= -e 's,-o -s,-o size=,g' +ATF_TESTS_SH_SED_statvfs_test= -e 's,-o -s,-o size=,g' +ATF_TESTS_SH_SED_vnode_leak_test= -e 's,-o -s,-o size=,g' + +.include + +.include From owner-svn-src-head@freebsd.org Fri Oct 21 06:05:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AAC9C1BCB7; Fri, 21 Oct 2016 06:05:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 4AC8EDC7; Fri, 21 Oct 2016 06:05:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L65GEI001663; Fri, 21 Oct 2016 06:05:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L65GE6001662; Fri, 21 Oct 2016 06:05:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610210605.u9L65GE6001662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 21 Oct 2016 06:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307703 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 06:05:17 -0000 Author: sephe Date: Fri Oct 21 06:05:16 2016 New Revision: 307703 URL: https://svnweb.freebsd.org/changeset/base/307703 Log: netmap: Unbreak i386 LINT building Sponsored by: Microsoft Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Fri Oct 21 05:24:08 2016 (r307702) +++ head/sys/dev/netmap/netmap_freebsd.c Fri Oct 21 06:05:16 2016 (r307703) @@ -1049,8 +1049,8 @@ nm_os_kthread_send_irq(struct nm_kthread if (ctx->user_td && ctx->irq_fd > 0) { err = kern_ioctl(ctx->user_td, ctx->irq_fd, ctx->irq_ioctl.com, (caddr_t)&ctx->irq_ioctl.data.msix); if (err) { - D("kern_ioctl error: %d ioctl parameters: fd %d com %lu data %p", - err, ctx->irq_fd, ctx->irq_ioctl.com, &ctx->irq_ioctl.data); + D("kern_ioctl error: %d ioctl parameters: fd %d com %ju data %p", + err, ctx->irq_fd, (uintmax_t)ctx->irq_ioctl.com, &ctx->irq_ioctl.data); } } } From owner-svn-src-head@freebsd.org Fri Oct 21 06:06:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9453C1BD12; Fri, 21 Oct 2016 06:06:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8E312F27; Fri, 21 Oct 2016 06:06:55 +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 u9L66sqX001766; Fri, 21 Oct 2016 06:06:54 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L66sjo001764; Fri, 21 Oct 2016 06:06:54 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201610210606.u9L66sjo001764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 21 Oct 2016 06:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307704 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 06:06:55 -0000 Author: jkim Date: Fri Oct 21 06:06:54 2016 New Revision: 307704 URL: https://svnweb.freebsd.org/changeset/base/307704 Log: Fix compiler warnings for user land. Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.c Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Fri Oct 21 06:05:16 2016 (r307703) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Fri Oct 21 06:06:54 2016 (r307704) @@ -83,12 +83,13 @@ emit_code(bpf_bin_stream *stream, u_int break; case 2: - *((u_short *)(stream->ibuf + stream->cur_ip)) = (u_short)value; + *((u_short *)(void *)(stream->ibuf + stream->cur_ip)) = + (u_short)value; stream->cur_ip += 2; break; case 4: - *((u_int *)(stream->ibuf + stream->cur_ip)) = value; + *((u_int *)(void *)(stream->ibuf + stream->cur_ip)) = value; stream->cur_ip += 4; break; } @@ -650,5 +651,5 @@ bpf_jit_compile(struct bpf_insn *prog, u } #endif - return ((bpf_filter_func)stream.ibuf); + return ((bpf_filter_func)(void *)stream.ibuf); } Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Fri Oct 21 06:05:16 2016 (r307703) +++ head/sys/i386/i386/bpf_jit_machdep.c Fri Oct 21 06:06:54 2016 (r307704) @@ -83,12 +83,13 @@ emit_code(bpf_bin_stream *stream, u_int break; case 2: - *((u_short *)(stream->ibuf + stream->cur_ip)) = (u_short)value; + *((u_short *)(void *)(stream->ibuf + stream->cur_ip)) = + (u_short)value; stream->cur_ip += 2; break; case 4: - *((u_int *)(stream->ibuf + stream->cur_ip)) = value; + *((u_int *)(void *)(stream->ibuf + stream->cur_ip)) = value; stream->cur_ip += 4; break; } @@ -679,5 +680,5 @@ bpf_jit_compile(struct bpf_insn *prog, u } #endif - return ((bpf_filter_func)stream.ibuf); + return ((bpf_filter_func)(void *)stream.ibuf); } From owner-svn-src-head@freebsd.org Fri Oct 21 06:09:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CFDCC1BD78; Fri, 21 Oct 2016 06:09:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2FAB3FF; Fri, 21 Oct 2016 06:09:31 +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 u9L69UwD001899; Fri, 21 Oct 2016 06:09:30 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L69UV4001897; Fri, 21 Oct 2016 06:09:30 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201610210609.u9L69UV4001897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 21 Oct 2016 06:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307705 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 06:09:31 -0000 Author: jkim Date: Fri Oct 21 06:09:30 2016 New Revision: 307705 URL: https://svnweb.freebsd.org/changeset/base/307705 Log: Redude code for conditional jumps. Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.c Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Fri Oct 21 06:06:54 2016 (r307704) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Fri Oct 21 06:09:30 2016 (r307705) @@ -425,75 +425,58 @@ bpf_jit_compile(struct bpf_insn *prog, u break; case BPF_JMP|BPF_JGT|BPF_K: + case BPF_JMP|BPF_JGE|BPF_K: + case BPF_JMP|BPF_JEQ|BPF_K: + case BPF_JMP|BPF_JSET|BPF_K: + case BPF_JMP|BPF_JGT|BPF_X: + case BPF_JMP|BPF_JGE|BPF_X: + case BPF_JMP|BPF_JEQ|BPF_X: + case BPF_JMP|BPF_JSET|BPF_X: if (ins->jt == ins->jf) { JUMP(ins->jt); break; } - CMPid(ins->k, EAX); - JCC(JA, JBE); - break; + switch (ins->code) { + case BPF_JMP|BPF_JGT|BPF_K: + CMPid(ins->k, EAX); + JCC(JA, JBE); + break; - case BPF_JMP|BPF_JGE|BPF_K: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JGE|BPF_K: + CMPid(ins->k, EAX); + JCC(JAE, JB); break; - } - CMPid(ins->k, EAX); - JCC(JAE, JB); - break; - case BPF_JMP|BPF_JEQ|BPF_K: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JEQ|BPF_K: + CMPid(ins->k, EAX); + JCC(JE, JNE); break; - } - CMPid(ins->k, EAX); - JCC(JE, JNE); - break; - case BPF_JMP|BPF_JSET|BPF_K: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JSET|BPF_K: + TESTid(ins->k, EAX); + JCC(JNE, JE); break; - } - TESTid(ins->k, EAX); - JCC(JNE, JE); - break; - case BPF_JMP|BPF_JGT|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JGT|BPF_X: + CMPrd(EDX, EAX); + JCC(JA, JBE); break; - } - CMPrd(EDX, EAX); - JCC(JA, JBE); - break; - case BPF_JMP|BPF_JGE|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JGE|BPF_X: + CMPrd(EDX, EAX); + JCC(JAE, JB); break; - } - CMPrd(EDX, EAX); - JCC(JAE, JB); - break; - case BPF_JMP|BPF_JEQ|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JEQ|BPF_X: + CMPrd(EDX, EAX); + JCC(JE, JNE); break; - } - CMPrd(EDX, EAX); - JCC(JE, JNE); - break; - case BPF_JMP|BPF_JSET|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JSET|BPF_X: + TESTrd(EDX, EAX); + JCC(JNE, JE); break; } - TESTrd(EDX, EAX); - JCC(JNE, JE); break; case BPF_ALU|BPF_ADD|BPF_X: Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Fri Oct 21 06:06:54 2016 (r307704) +++ head/sys/i386/i386/bpf_jit_machdep.c Fri Oct 21 06:09:30 2016 (r307705) @@ -446,75 +446,58 @@ bpf_jit_compile(struct bpf_insn *prog, u break; case BPF_JMP|BPF_JGT|BPF_K: + case BPF_JMP|BPF_JGE|BPF_K: + case BPF_JMP|BPF_JEQ|BPF_K: + case BPF_JMP|BPF_JSET|BPF_K: + case BPF_JMP|BPF_JGT|BPF_X: + case BPF_JMP|BPF_JGE|BPF_X: + case BPF_JMP|BPF_JEQ|BPF_X: + case BPF_JMP|BPF_JSET|BPF_X: if (ins->jt == ins->jf) { JUMP(ins->jt); break; } - CMPid(ins->k, EAX); - JCC(JA, JBE); - break; + switch (ins->code) { + case BPF_JMP|BPF_JGT|BPF_K: + CMPid(ins->k, EAX); + JCC(JA, JBE); + break; - case BPF_JMP|BPF_JGE|BPF_K: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JGE|BPF_K: + CMPid(ins->k, EAX); + JCC(JAE, JB); break; - } - CMPid(ins->k, EAX); - JCC(JAE, JB); - break; - case BPF_JMP|BPF_JEQ|BPF_K: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JEQ|BPF_K: + CMPid(ins->k, EAX); + JCC(JE, JNE); break; - } - CMPid(ins->k, EAX); - JCC(JE, JNE); - break; - case BPF_JMP|BPF_JSET|BPF_K: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JSET|BPF_K: + TESTid(ins->k, EAX); + JCC(JNE, JE); break; - } - TESTid(ins->k, EAX); - JCC(JNE, JE); - break; - case BPF_JMP|BPF_JGT|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JGT|BPF_X: + CMPrd(EDX, EAX); + JCC(JA, JBE); break; - } - CMPrd(EDX, EAX); - JCC(JA, JBE); - break; - case BPF_JMP|BPF_JGE|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JGE|BPF_X: + CMPrd(EDX, EAX); + JCC(JAE, JB); break; - } - CMPrd(EDX, EAX); - JCC(JAE, JB); - break; - case BPF_JMP|BPF_JEQ|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JEQ|BPF_X: + CMPrd(EDX, EAX); + JCC(JE, JNE); break; - } - CMPrd(EDX, EAX); - JCC(JE, JNE); - break; - case BPF_JMP|BPF_JSET|BPF_X: - if (ins->jt == ins->jf) { - JUMP(ins->jt); + case BPF_JMP|BPF_JSET|BPF_X: + TESTrd(EDX, EAX); + JCC(JNE, JE); break; } - TESTrd(EDX, EAX); - JCC(JNE, JE); break; case BPF_ALU|BPF_ADD|BPF_X: From owner-svn-src-head@freebsd.org Fri Oct 21 06:32:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E1ADC1B553; Fri, 21 Oct 2016 06:32:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D40A214A; Fri, 21 Oct 2016 06:32:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L6WkDU012841; Fri, 21 Oct 2016 06:32:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L6WkIw012840; Fri, 21 Oct 2016 06:32:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610210632.u9L6WkIw012840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 21 Oct 2016 06:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307706 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 06:32:47 -0000 Author: sephe Date: Fri Oct 21 06:32:45 2016 New Revision: 307706 URL: https://svnweb.freebsd.org/changeset/base/307706 Log: netmap: Unbreak LINT-VIMAGE building Sponsored by: Microsoft Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Fri Oct 21 06:09:30 2016 (r307705) +++ head/sys/dev/netmap/netmap_freebsd.c Fri Oct 21 06:32:45 2016 (r307706) @@ -27,10 +27,10 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include +#include #include #include -#include /* defines used in kernel.h */ +#include #include /* POLLIN, POLLOUT */ #include /* types used in module initialization */ #include /* DEV_MODULE_ORDERED */ @@ -1407,7 +1407,7 @@ freebsd_netmap_ioctl(struct cdev *dev __ int error; struct netmap_priv_d *priv; - CURVNET_SET(TD_TO_VNET(rd)); + CURVNET_SET(TD_TO_VNET(td)); error = devfs_get_cdevpriv((void **)&priv); if (error) { /* XXX ENOENT should be impossible, since the priv From owner-svn-src-head@freebsd.org Fri Oct 21 06:55:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A5CEC1B8D0; Fri, 21 Oct 2016 06:55:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0BB18C47; Fri, 21 Oct 2016 06:55:08 +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 u9L6t8hE020645; Fri, 21 Oct 2016 06:55:08 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L6t71c020639; Fri, 21 Oct 2016 06:55:07 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201610210655.u9L6t71c020639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 21 Oct 2016 06:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307707 - in head: share/man/man4 sys/amd64/amd64 sys/i386/i386 sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 06:55:09 -0000 Author: jkim Date: Fri Oct 21 06:55:07 2016 New Revision: 307707 URL: https://svnweb.freebsd.org/changeset/base/307707 Log: Implement BPF_MOD and BPF_XOR instructions. These two ALU instructions first appeared on Linux. Then, libpcap adopted and made them available since 1.6.2. Now more platforms including NetBSD have them in kernel. So do we. --이 줄 이하는 자동으로 제거됩니다-- > Description of fields to fill in above: 76 columns --| > PR: If and which Problem Report is related. > Submitted by: If someone else sent in the change. > Reported by: If someone else reported the issue. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. M share/man/man4/bpf.4 M sys/amd64/amd64/bpf_jit_machdep.c M sys/amd64/amd64/bpf_jit_machdep.h M sys/i386/i386/bpf_jit_machdep.c M sys/i386/i386/bpf_jit_machdep.h M sys/net/bpf_filter.c Modified: head/share/man/man4/bpf.4 head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/amd64/amd64/bpf_jit_machdep.h head/sys/i386/i386/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.h head/sys/net/bpf_filter.c Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Fri Oct 21 06:32:45 2016 (r307706) +++ head/share/man/man4/bpf.4 Fri Oct 21 06:55:07 2016 (r307707) @@ -49,7 +49,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2010 +.Dd October 21, 2016 .Dt BPF 4 .Os .Sh NAME @@ -881,16 +881,20 @@ BPF_ALU+BPF_ADD+BPF_K A <- A + k BPF_ALU+BPF_SUB+BPF_K A <- A - k BPF_ALU+BPF_MUL+BPF_K A <- A * k BPF_ALU+BPF_DIV+BPF_K A <- A / k +BPF_ALU+BPF_MOD+BPF_K A <- A % k BPF_ALU+BPF_AND+BPF_K A <- A & k BPF_ALU+BPF_OR+BPF_K A <- A | k +BPF_ALU+BPF_XOR+BPF_K A <- A ^ k BPF_ALU+BPF_LSH+BPF_K A <- A << k BPF_ALU+BPF_RSH+BPF_K A <- A >> k BPF_ALU+BPF_ADD+BPF_X A <- A + X BPF_ALU+BPF_SUB+BPF_X A <- A - X BPF_ALU+BPF_MUL+BPF_X A <- A * X BPF_ALU+BPF_DIV+BPF_X A <- A / X +BPF_ALU+BPF_MOD+BPF_X A <- A % X BPF_ALU+BPF_AND+BPF_X A <- A & X BPF_ALU+BPF_OR+BPF_X A <- A | X +BPF_ALU+BPF_XOR+BPF_X A <- A ^ X BPF_ALU+BPF_LSH+BPF_X A <- A << X BPF_ALU+BPF_RSH+BPF_X A <- A >> X BPF_ALU+BPF_NEG A <- -A Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Fri Oct 21 06:32:45 2016 (r307706) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Fri Oct 21 06:55:07 2016 (r307707) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) - * Copyright (C) 2005-2009 Jung-uk Kim + * Copyright (C) 2005-2016 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -494,6 +494,7 @@ bpf_jit_compile(struct bpf_insn *prog, u break; case BPF_ALU|BPF_DIV|BPF_X: + case BPF_ALU|BPF_MOD|BPF_X: TESTrd(EDX, EDX); if (fmem) { JNEb(4); @@ -507,6 +508,8 @@ bpf_jit_compile(struct bpf_insn *prog, u MOVrd(EDX, ECX); ZEROrd(EDX); DIVrd(ECX); + if (BPF_OP(ins->code) == BPF_MOD) + MOVrd(EDX, EAX); MOVrd(ECX, EDX); break; @@ -518,6 +521,10 @@ bpf_jit_compile(struct bpf_insn *prog, u ORrd(EDX, EAX); break; + case BPF_ALU|BPF_XOR|BPF_X: + XORrd(EDX, EAX); + break; + case BPF_ALU|BPF_LSH|BPF_X: MOVrd(EDX, ECX); SHL_CLrb(EAX); @@ -544,10 +551,13 @@ bpf_jit_compile(struct bpf_insn *prog, u break; case BPF_ALU|BPF_DIV|BPF_K: + case BPF_ALU|BPF_MOD|BPF_K: MOVrd(EDX, ECX); ZEROrd(EDX); MOVid(ins->k, ESI); DIVrd(ESI); + if (BPF_OP(ins->code) == BPF_MOD) + MOVrd(EDX, EAX); MOVrd(ECX, EDX); break; @@ -559,6 +569,10 @@ bpf_jit_compile(struct bpf_insn *prog, u ORid(ins->k, EAX); break; + case BPF_ALU|BPF_XOR|BPF_K: + XORid(ins->k, EAX); + break; + case BPF_ALU|BPF_LSH|BPF_K: SHLib((ins->k) & 0xff, EAX); break; Modified: head/sys/amd64/amd64/bpf_jit_machdep.h ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.h Fri Oct 21 06:32:45 2016 (r307706) +++ head/sys/amd64/amd64/bpf_jit_machdep.h Fri Oct 21 06:55:07 2016 (r307707) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) - * Copyright (C) 2005-2009 Jung-uk Kim + * Copyright (C) 2005-2016 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -357,6 +357,24 @@ typedef void (*emit_func)(bpf_bin_stream emitm(&stream, i32, 4); \ } while (0) +/* xorl sr32,dr32 */ +#define XORrd(sr32, dr32) do { \ + emitm(&stream, 0x31, 1); \ + emitm(&stream, \ + (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1); \ +} while (0) + +/* xorl i32,r32 */ +#define XORid(i32, r32) do { \ + if (r32 == EAX) { \ + emitm(&stream, 0x35, 1); \ + } else { \ + emitm(&stream, 0x81, 1); \ + emitm(&stream, (25 << 3) | r32, 1); \ + } \ + emitm(&stream, i32, 4); \ +} while (0) + /* shll i8,r32 */ #define SHLib(i8, r32) do { \ emitm(&stream, 0xc1, 1); \ Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Fri Oct 21 06:32:45 2016 (r307706) +++ head/sys/i386/i386/bpf_jit_machdep.c Fri Oct 21 06:55:07 2016 (r307707) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) - * Copyright (C) 2005-2009 Jung-uk Kim + * Copyright (C) 2005-2016 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -139,6 +139,7 @@ bpf_jit_optimize(struct bpf_insn *prog, flags |= BPF_JIT_FJMP; break; case BPF_ALU|BPF_DIV|BPF_K: + case BPF_ALU|BPF_MOD|BPF_K: flags |= BPF_JIT_FADK; break; } @@ -515,6 +516,7 @@ bpf_jit_compile(struct bpf_insn *prog, u break; case BPF_ALU|BPF_DIV|BPF_X: + case BPF_ALU|BPF_MOD|BPF_X: TESTrd(EDX, EDX); if (save_esp) { if (fpkt) { @@ -536,6 +538,8 @@ bpf_jit_compile(struct bpf_insn *prog, u MOVrd(EDX, ECX); ZEROrd(EDX); DIVrd(ECX); + if (BPF_OP(ins->code) == BPF_MOD) + MOVrd(EDX, EAX); MOVrd(ECX, EDX); break; @@ -547,6 +551,10 @@ bpf_jit_compile(struct bpf_insn *prog, u ORrd(EDX, EAX); break; + case BPF_ALU|BPF_XOR|BPF_X: + XORrd(EDX, EAX); + break; + case BPF_ALU|BPF_LSH|BPF_X: MOVrd(EDX, ECX); SHL_CLrb(EAX); @@ -573,10 +581,13 @@ bpf_jit_compile(struct bpf_insn *prog, u break; case BPF_ALU|BPF_DIV|BPF_K: + case BPF_ALU|BPF_MOD|BPF_K: MOVrd(EDX, ECX); ZEROrd(EDX); MOVid(ins->k, ESI); DIVrd(ESI); + if (BPF_OP(ins->code) == BPF_MOD) + MOVrd(EDX, EAX); MOVrd(ECX, EDX); break; @@ -588,6 +599,10 @@ bpf_jit_compile(struct bpf_insn *prog, u ORid(ins->k, EAX); break; + case BPF_ALU|BPF_XOR|BPF_K: + XORid(ins->k, EAX); + break; + case BPF_ALU|BPF_LSH|BPF_K: SHLib((ins->k) & 0xff, EAX); break; Modified: head/sys/i386/i386/bpf_jit_machdep.h ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.h Fri Oct 21 06:32:45 2016 (r307706) +++ head/sys/i386/i386/bpf_jit_machdep.h Fri Oct 21 06:55:07 2016 (r307707) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) - * Copyright (C) 2005-2009 Jung-uk Kim + * Copyright (C) 2005-2016 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -302,6 +302,24 @@ typedef void (*emit_func)(bpf_bin_stream emitm(&stream, i32, 4); \ } while (0) +/* xorl sr32,dr32 */ +#define XORrd(sr32, dr32) do { \ + emitm(&stream, 0x31, 1); \ + emitm(&stream, \ + (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1); \ +} while (0) + +/* xorl i32,r32 */ +#define XORid(i32, r32) do { \ + if (r32 == EAX) { \ + emitm(&stream, 0x35, 1); \ + } else { \ + emitm(&stream, 0x81, 1); \ + emitm(&stream, (25 << 3) | r32, 1); \ + } \ + emitm(&stream, i32, 4); \ +} while (0) + /* shll i8,r32 */ #define SHLib(i8, r32) do { \ emitm(&stream, 0xc1, 1); \ Modified: head/sys/net/bpf_filter.c ============================================================================== --- head/sys/net/bpf_filter.c Fri Oct 21 06:32:45 2016 (r307706) +++ head/sys/net/bpf_filter.c Fri Oct 21 06:55:07 2016 (r307707) @@ -434,6 +434,12 @@ bpf_filter(const struct bpf_insn *pc, u_ A /= X; continue; + case BPF_ALU|BPF_MOD|BPF_X: + if (X == 0) + return (0); + A %= X; + continue; + case BPF_ALU|BPF_AND|BPF_X: A &= X; continue; @@ -442,6 +448,10 @@ bpf_filter(const struct bpf_insn *pc, u_ A |= X; continue; + case BPF_ALU|BPF_XOR|BPF_X: + A ^= X; + continue; + case BPF_ALU|BPF_LSH|BPF_X: A <<= X; continue; @@ -466,6 +476,10 @@ bpf_filter(const struct bpf_insn *pc, u_ A /= pc->k; continue; + case BPF_ALU|BPF_MOD|BPF_K: + A %= pc->k; + continue; + case BPF_ALU|BPF_AND|BPF_K: A &= pc->k; continue; @@ -474,6 +488,10 @@ bpf_filter(const struct bpf_insn *pc, u_ A |= pc->k; continue; + case BPF_ALU|BPF_XOR|BPF_K: + A ^= pc->k; + continue; + case BPF_ALU|BPF_LSH|BPF_K: A <<= pc->k; continue; @@ -508,8 +526,8 @@ static const u_short bpf_code_map[] = { 0x1013, /* 0x60-0x6f: 1100100000001000 */ 0x1010, /* 0x70-0x7f: 0000100000001000 */ 0x0093, /* 0x80-0x8f: 1100100100000000 */ - 0x0000, /* 0x90-0x9f: 0000000000000000 */ - 0x0000, /* 0xa0-0xaf: 0000000000000000 */ + 0x1010, /* 0x90-0x9f: 0000100000001000 */ + 0x1010, /* 0xa0-0xaf: 0000100000001000 */ 0x0002, /* 0xb0-0xbf: 0100000000000000 */ 0x0000, /* 0xc0-0xcf: 0000000000000000 */ 0x0000, /* 0xd0-0xdf: 0000000000000000 */ @@ -577,7 +595,8 @@ bpf_validate(const struct bpf_insn *f, i /* * Check for constant division by 0. */ - if (p->code == (BPF_ALU|BPF_DIV|BPF_K) && p->k == 0) + if ((p->code == (BPF_ALU|BPF_DIV|BPF_K) || + p->code == (BPF_ALU|BPF_MOD|BPF_K)) && p->k == 0) return (0); } return (BPF_CLASS(f[len - 1].code) == BPF_RET); From owner-svn-src-head@freebsd.org Fri Oct 21 06:56:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A4FC1B92D; Fri, 21 Oct 2016 06:56:34 +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 mx1.freebsd.org (Postfix) with ESMTPS id 51B99DC9; Fri, 21 Oct 2016 06:56:34 +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 u9L6uXna020763; Fri, 21 Oct 2016 06:56:33 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L6uUGl020734; Fri, 21 Oct 2016 06:56:30 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201610210656.u9L6uUGl020734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 21 Oct 2016 06:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307708 - in head/tools/regression/bpf/bpf_filter: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 06:56:34 -0000 Author: jkim Date: Fri Oct 21 06:56:30 2016 New Revision: 307708 URL: https://svnweb.freebsd.org/changeset/base/307708 Log: Clean up and add some test cases for ALU instructions. Added: head/tools/regression/bpf/bpf_filter/tests/test0085.h (contents, props changed) head/tools/regression/bpf/bpf_filter/tests/test0086.h (contents, props changed) head/tools/regression/bpf/bpf_filter/tests/test0087.h (contents, props changed) head/tools/regression/bpf/bpf_filter/tests/test0088.h (contents, props changed) head/tools/regression/bpf/bpf_filter/tests/test0089.h (contents, props changed) head/tools/regression/bpf/bpf_filter/tests/test0090.h (contents, props changed) head/tools/regression/bpf/bpf_filter/tests/test0091.h (contents, props changed) Modified: head/tools/regression/bpf/bpf_filter/Makefile head/tools/regression/bpf/bpf_filter/bpf_test.c head/tools/regression/bpf/bpf_filter/tests/test0001.h head/tools/regression/bpf/bpf_filter/tests/test0002.h head/tools/regression/bpf/bpf_filter/tests/test0003.h head/tools/regression/bpf/bpf_filter/tests/test0004.h head/tools/regression/bpf/bpf_filter/tests/test0005.h head/tools/regression/bpf/bpf_filter/tests/test0006.h head/tools/regression/bpf/bpf_filter/tests/test0007.h head/tools/regression/bpf/bpf_filter/tests/test0008.h head/tools/regression/bpf/bpf_filter/tests/test0009.h head/tools/regression/bpf/bpf_filter/tests/test0010.h head/tools/regression/bpf/bpf_filter/tests/test0011.h head/tools/regression/bpf/bpf_filter/tests/test0012.h head/tools/regression/bpf/bpf_filter/tests/test0013.h head/tools/regression/bpf/bpf_filter/tests/test0014.h head/tools/regression/bpf/bpf_filter/tests/test0015.h head/tools/regression/bpf/bpf_filter/tests/test0016.h head/tools/regression/bpf/bpf_filter/tests/test0017.h head/tools/regression/bpf/bpf_filter/tests/test0018.h head/tools/regression/bpf/bpf_filter/tests/test0019.h head/tools/regression/bpf/bpf_filter/tests/test0020.h head/tools/regression/bpf/bpf_filter/tests/test0021.h head/tools/regression/bpf/bpf_filter/tests/test0022.h head/tools/regression/bpf/bpf_filter/tests/test0023.h head/tools/regression/bpf/bpf_filter/tests/test0024.h head/tools/regression/bpf/bpf_filter/tests/test0025.h head/tools/regression/bpf/bpf_filter/tests/test0026.h head/tools/regression/bpf/bpf_filter/tests/test0027.h head/tools/regression/bpf/bpf_filter/tests/test0028.h head/tools/regression/bpf/bpf_filter/tests/test0029.h head/tools/regression/bpf/bpf_filter/tests/test0030.h head/tools/regression/bpf/bpf_filter/tests/test0031.h head/tools/regression/bpf/bpf_filter/tests/test0032.h head/tools/regression/bpf/bpf_filter/tests/test0033.h head/tools/regression/bpf/bpf_filter/tests/test0034.h head/tools/regression/bpf/bpf_filter/tests/test0035.h head/tools/regression/bpf/bpf_filter/tests/test0036.h head/tools/regression/bpf/bpf_filter/tests/test0037.h head/tools/regression/bpf/bpf_filter/tests/test0038.h head/tools/regression/bpf/bpf_filter/tests/test0039.h head/tools/regression/bpf/bpf_filter/tests/test0040.h head/tools/regression/bpf/bpf_filter/tests/test0041.h head/tools/regression/bpf/bpf_filter/tests/test0042.h head/tools/regression/bpf/bpf_filter/tests/test0043.h head/tools/regression/bpf/bpf_filter/tests/test0044.h head/tools/regression/bpf/bpf_filter/tests/test0045.h head/tools/regression/bpf/bpf_filter/tests/test0046.h head/tools/regression/bpf/bpf_filter/tests/test0047.h head/tools/regression/bpf/bpf_filter/tests/test0048.h head/tools/regression/bpf/bpf_filter/tests/test0049.h head/tools/regression/bpf/bpf_filter/tests/test0050.h head/tools/regression/bpf/bpf_filter/tests/test0051.h head/tools/regression/bpf/bpf_filter/tests/test0052.h head/tools/regression/bpf/bpf_filter/tests/test0053.h head/tools/regression/bpf/bpf_filter/tests/test0054.h head/tools/regression/bpf/bpf_filter/tests/test0055.h head/tools/regression/bpf/bpf_filter/tests/test0056.h head/tools/regression/bpf/bpf_filter/tests/test0057.h head/tools/regression/bpf/bpf_filter/tests/test0058.h head/tools/regression/bpf/bpf_filter/tests/test0059.h head/tools/regression/bpf/bpf_filter/tests/test0060.h head/tools/regression/bpf/bpf_filter/tests/test0061.h head/tools/regression/bpf/bpf_filter/tests/test0062.h head/tools/regression/bpf/bpf_filter/tests/test0063.h head/tools/regression/bpf/bpf_filter/tests/test0064.h head/tools/regression/bpf/bpf_filter/tests/test0065.h head/tools/regression/bpf/bpf_filter/tests/test0066.h head/tools/regression/bpf/bpf_filter/tests/test0067.h head/tools/regression/bpf/bpf_filter/tests/test0068.h head/tools/regression/bpf/bpf_filter/tests/test0069.h head/tools/regression/bpf/bpf_filter/tests/test0070.h head/tools/regression/bpf/bpf_filter/tests/test0071.h head/tools/regression/bpf/bpf_filter/tests/test0072.h head/tools/regression/bpf/bpf_filter/tests/test0073.h head/tools/regression/bpf/bpf_filter/tests/test0074.h head/tools/regression/bpf/bpf_filter/tests/test0075.h head/tools/regression/bpf/bpf_filter/tests/test0076.h head/tools/regression/bpf/bpf_filter/tests/test0077.h head/tools/regression/bpf/bpf_filter/tests/test0078.h head/tools/regression/bpf/bpf_filter/tests/test0079.h head/tools/regression/bpf/bpf_filter/tests/test0080.h head/tools/regression/bpf/bpf_filter/tests/test0081.h head/tools/regression/bpf/bpf_filter/tests/test0082.h head/tools/regression/bpf/bpf_filter/tests/test0083.h head/tools/regression/bpf/bpf_filter/tests/test0084.h Modified: head/tools/regression/bpf/bpf_filter/Makefile ============================================================================== --- head/tools/regression/bpf/bpf_filter/Makefile Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/Makefile Fri Oct 21 06:56:30 2016 (r307708) @@ -20,9 +20,11 @@ TEST_CASES?= test0001 test0002 test0003 test0069 test0070 test0071 test0072 \ test0073 test0074 test0075 test0076 \ test0077 test0078 test0079 test0080 \ - test0081 test0082 test0083 test0084 + test0081 test0082 test0083 test0084 \ + test0085 test0086 test0087 test0088 \ + test0089 test0090 test0091 -SYSDIR?= ${.CURDIR}/../../../../sys +SYSDIR?= ${SRCTOP}/sys SRCS= ${.CURDIR}/bpf_test.c Modified: head/tools/regression/bpf/bpf_filter/bpf_test.c ============================================================================== --- head/tools/regression/bpf/bpf_filter/bpf_test.c Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/bpf_test.c Fri Oct 21 06:56:30 2016 (r307708) @@ -105,8 +105,8 @@ static const u_short bpf_code_map[] = { 0x1013, /* 0x60-0x6f: 1100100000001000 */ 0x1010, /* 0x70-0x7f: 0000100000001000 */ 0x0093, /* 0x80-0x8f: 1100100100000000 */ - 0x0000, /* 0x90-0x9f: 0000000000000000 */ - 0x0000, /* 0xa0-0xaf: 0000000000000000 */ + 0x1010, /* 0x90-0x9f: 0000100000001000 */ + 0x1010, /* 0xa0-0xaf: 0000100000001000 */ 0x0002, /* 0xb0-0xbf: 0100000000000000 */ 0x0000, /* 0xc0-0xcf: 0000000000000000 */ 0x0000, /* 0xd0-0xdf: 0000000000000000 */ @@ -176,7 +176,8 @@ bpf_validate(const struct bpf_insn *f, i /* * Check for constant division by 0. */ - if (p->code == (BPF_ALU|BPF_DIV|BPF_K) && p->k == 0) + if ((p->code == (BPF_ALU|BPF_DIV|BPF_K) || + p->code == (BPF_ALU|BPF_MOD|BPF_K)) && p->k == 0) return (0); } return (BPF_CLASS(f[len - 1].code) == BPF_RET); Modified: head/tools/regression/bpf/bpf_filter/tests/test0001.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0001.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0001.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,27 +5,27 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(0x55, 0), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 1; +static int invalid = 1; /* Expected return value */ -u_int expect = 0; +static u_int expect = 0; /* Expected signal */ -int expect_signal = SIGABRT; +static int expect_signal = SIGABRT; Modified: head/tools/regression/bpf/bpf_filter/tests/test0002.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0002.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0002.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,26 +5,26 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_RET+BPF_K, 0xdeadc0de), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xdeadc0de; +static u_int expect = 0xdeadc0de; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0003.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0003.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0003.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,27 +5,27 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xdeadc0de; +static u_int expect = 0xdeadc0de; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0004.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0004.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0004.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,27 +5,27 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x01, 0x23, 0x45, 0x67, 0x89, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0x23456789; +static u_int expect = 0x23456789; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0005.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0005.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0005.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,27 +5,27 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 1), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x01, 0x23, 0x45, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0x2345; +static u_int expect = 0x2345; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0006.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0006.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0006.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,27 +5,27 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 1), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x01, 0x23, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0x23; +static u_int expect = 0x23; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0007.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0007.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0007.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,27 +5,27 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = 0xdeadc0de; +static u_int wirelen = 0xdeadc0de; /* Packet length passed on buffer */ -u_int buflen = 0xdeadc0de; +static u_int buflen = 0xdeadc0de; /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xdeadc0de; +static u_int expect = 0xdeadc0de; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0008.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0008.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0008.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,28 +5,28 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0), BPF_STMT(BPF_MISC+BPF_TXA, 0), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = 0xdeadc0de; +static u_int wirelen = 0xdeadc0de; /* Packet length passed on buffer */ -u_int buflen = 0xdeadc0de; +static u_int buflen = 0xdeadc0de; /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xdeadc0de; +static u_int expect = 0xdeadc0de; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0009.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0009.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0009.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,28 +5,28 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LDX+BPF_IMM, 1), BPF_STMT(BPF_LD+BPF_W+BPF_IND, 1), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0x456789ab; +static u_int expect = 0x456789ab; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0010.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0010.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0010.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,28 +5,28 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LDX+BPF_IMM, 1), BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x01, 0x23, 0x45, 0x67, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0x4567; +static u_int expect = 0x4567; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0011.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0011.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0011.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,28 +5,28 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LDX+BPF_IMM, 1), BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x01, 0x23, 0x45, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0x45; +static u_int expect = 0x45; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0012.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0012.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0012.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,28 +5,28 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LDX+BPF_MSH+BPF_B, 1), BPF_STMT(BPF_MISC+BPF_TXA, 0), BPF_STMT(BPF_RET+BPF_A, 0), }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x01, 0x23, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = (0x23 & 0xf) << 2; +static u_int expect = (0x23 & 0xf) << 2; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0013.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0013.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0013.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de), BPF_STMT(BPF_ST, 7), BPF_STMT(BPF_LDX+BPF_MEM, 7), @@ -14,21 +14,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xdeadc0de; +static u_int expect = 0xdeadc0de; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0014.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0014.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0014.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LDX+BPF_IMM, 0xdeadc0de), BPF_STMT(BPF_STX, 7), BPF_STMT(BPF_LD+BPF_MEM, 7), @@ -13,21 +13,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xdeadc0de; +static u_int expect = 0xdeadc0de; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0015.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0015.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0015.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0xc0decafe), BPF_STMT(BPF_JMP+BPF_JA, 1), BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de), @@ -13,21 +13,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0016.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0016.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0016.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 0x01234568, 2, 0), BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 0x01234566, 2, 1), @@ -17,21 +17,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0017.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0017.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0017.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0x01234568, 2, 0), BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0x01234567, 2, 1), @@ -17,21 +17,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0018.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0018.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0018.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x01234568, 2, 0), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x01234567, 2, 1), @@ -17,21 +17,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0019.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0019.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0019.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x80000000, 5, 0), BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x40000000, 4, 0), @@ -22,21 +22,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0020.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0020.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0020.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_STMT(BPF_LDX+BPF_IMM, 0x01234568), BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 3, 0), @@ -20,21 +20,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0021.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0021.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0021.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_STMT(BPF_LDX+BPF_IMM, 0x01234568), BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 3, 0), @@ -20,21 +20,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0022.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0022.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0022.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_STMT(BPF_LDX+BPF_IMM, 0x01234568), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 3, 0), @@ -20,21 +20,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0023.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0023.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0023.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0x01234567), BPF_STMT(BPF_LDX+BPF_IMM, 0x80000000), BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 9, 0), @@ -30,21 +30,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xc0decafe; +static u_int expect = 0xc0decafe; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0024.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0024.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0024.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0xbeadb8dd), BPF_STMT(BPF_LDX+BPF_IMM, 0x20000801), BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), @@ -13,21 +13,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xdeadc0de; +static u_int expect = 0xdeadc0de; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0025.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0025.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0025.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ -struct bpf_insn pc[] = { +static struct bpf_insn pc[] = { BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de), BPF_STMT(BPF_LDX+BPF_IMM, 0x20000801), BPF_STMT(BPF_ALU+BPF_SUB+BPF_X, 0), @@ -13,21 +13,21 @@ struct bpf_insn pc[] = { }; /* Packet */ -u_char pkt[] = { +static u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ -u_int wirelen = sizeof(pkt); +static u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ -u_int buflen = sizeof(pkt); +static u_int buflen = sizeof(pkt); /* Invalid instruction */ -int invalid = 0; +static int invalid = 0; /* Expected return value */ -u_int expect = 0xbeadb8dd; +static u_int expect = 0xbeadb8dd; /* Expected signal */ -int expect_signal = 0; +static int expect_signal = 0; Modified: head/tools/regression/bpf/bpf_filter/tests/test0026.h ============================================================================== --- head/tools/regression/bpf/bpf_filter/tests/test0026.h Fri Oct 21 06:55:07 2016 (r307707) +++ head/tools/regression/bpf/bpf_filter/tests/test0026.h Fri Oct 21 06:56:30 2016 (r307708) @@ -5,7 +5,7 @@ */ /* BPF program */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Oct 21 07:35:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9EA5C1A68F; Fri, 21 Oct 2016 07:35:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 89D0D1622; Fri, 21 Oct 2016 07:35:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L7Znmu036991; Fri, 21 Oct 2016 07:35:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L7Znff036990; Fri, 21 Oct 2016 07:35:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610210735.u9L7Znff036990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 21 Oct 2016 07:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307709 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 07:35:50 -0000 Author: sephe Date: Fri Oct 21 07:35:49 2016 New Revision: 307709 URL: https://svnweb.freebsd.org/changeset/base/307709 Log: LINT: Unhook netmap from LINT-NOIP and LINT-NOINET temporarily. After fixing ptnet NOINET support, netmap can be linked back to these two LINTs. Sponsored by: Microsoft Modified: head/sys/conf/makeLINT.mk Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Fri Oct 21 06:56:30 2016 (r307708) +++ head/sys/conf/makeLINT.mk Fri Oct 21 07:35:49 2016 (r307709) @@ -21,6 +21,7 @@ LINT: ${NOTES} ../../conf/makeLINT.sed echo 'makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT="' >> ${.TARGET}-NOINET echo "nooptions INET" >> ${.TARGET}-NOINET echo "nodevice gre" >> ${.TARGET}-NOINET + echo "nodevice netmap" >> ${.TARGET}-NOINET echo "include ${.TARGET}" > ${.TARGET}-NOINET6 echo "ident ${.TARGET}-NOINET6" >> ${.TARGET}-NOINET6 echo 'makeoptions MKMODULESENV+="WITHOUT_INET6_SUPPORT="' >> ${.TARGET}-NOINET6 @@ -45,6 +46,7 @@ LINT: ${NOTES} ../../conf/makeLINT.sed echo "nodevice sk" >> ${.TARGET}-NOIP echo "nodevice txp" >> ${.TARGET}-NOIP echo "nodevice vxge" >> ${.TARGET}-NOIP + echo "nodevice netmap" >> ${.TARGET}-NOIP .endif .if ${TARGET} == "mips" echo "machine ${TARGET} ${TARGET_ARCH}" >> ${.TARGET} From owner-svn-src-head@freebsd.org Fri Oct 21 07:37:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BE2BC1A720; Fri, 21 Oct 2016 07:37:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 14C2917AD; Fri, 21 Oct 2016 07:37:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L7bUXE037103; Fri, 21 Oct 2016 07:37:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L7bUrX037100; Fri, 21 Oct 2016 07:37:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610210737.u9L7bUrX037100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 21 Oct 2016 07:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307710 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 07:37:31 -0000 Author: sephe Date: Fri Oct 21 07:37:29 2016 New Revision: 307710 URL: https://svnweb.freebsd.org/changeset/base/307710 Log: hyperv/hn: Always query RSS capabilities. - This avoid distributing NDIS version check. - Only NDIS 6.20 required (earlier NDIS uses different indirect table format). MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8291 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 07:35:49 2016 (r307709) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 07:37:29 2016 (r307710) @@ -3408,10 +3408,9 @@ hn_synth_alloc_subchans(struct hn_softc int nchan, rxr_cnt, error; nchan = *nsubch + 1; - if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { + if (nchan == 1) { /* - * Either RSS is not supported, or multiple RX/TX rings - * are not requested. + * Multiple RX/TX rings are not requested. */ *nsubch = 0; return (0); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Oct 21 07:35:49 2016 (r307709) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Oct 21 07:37:29 2016 (r307710) @@ -744,15 +744,13 @@ hn_rndis_get_rsscaps(struct hn_softc *sc *rxr_cnt = 0; + if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_20) + return (EOPNOTSUPP); + memset(&in, 0, sizeof(in)); in.ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_CAPS; - if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30) { - in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_1; - in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE_6_0; - } else { - in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2; - in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE; - } + in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2; + in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE; caps_len = NDIS_RSS_CAPS_SIZE; error = hn_rndis_query2(sc, OID_GEN_RECEIVE_SCALE_CAPABILITIES, @@ -1027,10 +1025,12 @@ hn_rndis_conf_rss(struct hn_softc *sc, u int error; /* - * Only NDIS 6.30+ is supported. + * Only NDIS 6.20+ is supported: + * We only support 4bytes element in indirect table, which has been + * adopted since NDIS 6.20. */ - KASSERT(sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30, - ("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); + KASSERT(sc->hn_ndis_ver >= HN_NDIS_VERSION_6_20, + ("NDIS 6.20+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); /* * NOTE: Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Oct 21 07:35:49 2016 (r307709) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Oct 21 07:37:29 2016 (r307710) @@ -36,6 +36,7 @@ * NDIS protocol version numbers */ #define HN_NDIS_VERSION_6_1 0x00060001 +#define HN_NDIS_VERSION_6_20 0x00060014 #define HN_NDIS_VERSION_6_30 0x0006001e #define HN_NDIS_VERSION_MAJOR(ver) (((ver) & 0xffff0000) >> 16) #define HN_NDIS_VERSION_MINOR(ver) ((ver) & 0xffff) From owner-svn-src-head@freebsd.org Fri Oct 21 07:46:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF127C1A9B9; Fri, 21 Oct 2016 07:46:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A260A1C6C; Fri, 21 Oct 2016 07:46:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L7kZ75041177; Fri, 21 Oct 2016 07:46:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L7kZsm041174; Fri, 21 Oct 2016 07:46:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610210746.u9L7kZsm041174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 21 Oct 2016 07:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307711 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 07:46:37 -0000 Author: sephe Date: Fri Oct 21 07:46:35 2016 New Revision: 307711 URL: https://svnweb.freebsd.org/changeset/base/307711 Log: hyperv/hn: Check NVS version for HASHVAL pktinfo on sending path. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8293 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Oct 21 07:37:29 2016 (r307710) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Oct 21 07:46:35 2016 (r307711) @@ -544,8 +544,9 @@ hn_nvs_init(struct hn_softc *sc) if (error) { if_printf(sc->hn_ifp, "reinit NVS version 0x%x " "failed: %d\n", sc->hn_nvs_ver, error); + return (error); } - return (error); + goto done; } /* @@ -567,11 +568,16 @@ hn_nvs_init(struct hn_softc *sc) HN_NDIS_VERSION_MAJOR(sc->hn_ndis_ver), HN_NDIS_VERSION_MINOR(sc->hn_ndis_ver)); } - return (0); + goto done; } } if_printf(sc->hn_ifp, "no NVS available\n"); return (ENXIO); + +done: + if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) + sc->hn_caps |= HN_CAP_HASHVAL; + return (0); } int Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Oct 21 07:37:29 2016 (r307710) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Oct 21 07:46:35 2016 (r307711) @@ -269,6 +269,7 @@ struct hn_softc { #define HN_CAP_UDP6CS 0x0040 #define HN_CAP_TSO4 0x0080 #define HN_CAP_TSO6 0x0100 +#define HN_CAP_HASHVAL 0x0200 /* * Externs Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 07:37:29 2016 (r307710) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 07:46:35 2016 (r307711) @@ -2233,7 +2233,8 @@ hn_caps_sysctl(SYSCTL_HANDLER_ARGS) "\006UDP4CS" "\007UDP6CS" "\010TSO4" - "\011TSO6"); + "\011TSO6" + "\012HASHVAL"); return sysctl_handle_string(oidp, caps_str, sizeof(caps_str), req); } @@ -3008,12 +3009,15 @@ hn_fixup_tx_data(struct hn_softc *sc) if (sc->hn_caps & HN_CAP_UDP6CS) csum_assist |= CSUM_IP6_UDP; #endif - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_csum_assist = csum_assist; - if (sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30) { - /* Support HASHVAL pktinfo on TX path. */ + if (sc->hn_caps & HN_CAP_HASHVAL) { + /* + * Support HASHVAL pktinfo on TX path. + */ + if (bootverbose) + if_printf(sc->hn_ifp, "support HASHVAL pktinfo\n"); for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_tx_flags |= HN_TX_FLAG_HASHVAL; } From owner-svn-src-head@freebsd.org Fri Oct 21 08:02:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E8AC1803D; Fri, 21 Oct 2016 08:02:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D6CAA35B; Fri, 21 Oct 2016 08:02:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L826KO048395; Fri, 21 Oct 2016 08:02:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L825L1048389; Fri, 21 Oct 2016 08:02:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610210802.u9L825L1048389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 21 Oct 2016 08:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307712 - in head/sys: dev/hyperv/netvsc net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 08:02:07 -0000 Author: sephe Date: Fri Oct 21 08:02:05 2016 New Revision: 307712 URL: https://svnweb.freebsd.org/changeset/base/307712 Log: hyperv/hn: Add network change support. Currently the network change is simulated by link status changes. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8295 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h head/sys/dev/hyperv/netvsc/ndis.h head/sys/net/rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Oct 21 07:46:35 2016 (r307711) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Oct 21 08:02:05 2016 (r307712) @@ -207,7 +207,6 @@ struct hn_softc { struct ifnet *hn_ifp; struct ifmedia hn_media; device_t hn_dev; - int hn_carrier; int hn_if_flags; struct sx hn_lock; struct vmbus_channel *hn_prichan; @@ -236,6 +235,9 @@ struct hn_softc { struct taskqueue *hn_mgmt_taskq; struct taskqueue *hn_mgmt_taskq0; struct task hn_link_task; + struct task hn_netchg_init; + struct timeout_task hn_netchg_status; + uint32_t hn_link_flags; /* HN_LINK_FLAG_ */ uint32_t hn_caps; /* HN_CAP_ */ uint32_t hn_flags; /* HN_FLAG_ */ @@ -271,6 +273,9 @@ struct hn_softc { #define HN_CAP_TSO6 0x0100 #define HN_CAP_HASHVAL 0x0200 +#define HN_LINK_FLAG_LINKUP 0x0001 +#define HN_LINK_FLAG_NETCHG 0x0002 + /* * Externs */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 07:46:35 2016 (r307711) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 08:02:05 2016 (r307712) @@ -335,6 +335,8 @@ static void hn_destroy_tx_data(struct hn static void hn_start_taskfunc(void *, int); static void hn_start_txeof_taskfunc(void *, int); static void hn_link_taskfunc(void *, int); +static void hn_netchg_init_taskfunc(void *, int); +static void hn_netchg_status_taskfunc(void *, int); static void hn_suspend_mgmt_taskfunc(void *, int); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_create_rx_data(struct hn_softc *sc, int); @@ -360,6 +362,7 @@ static void hn_rx_drain(struct vmbus_cha static void hn_tx_resume(struct hn_softc *, int); static void hn_tx_ring_qflush(struct hn_tx_ring *); static int netvsc_detach(device_t dev); +static void hn_link_status(struct hn_softc *); static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt); @@ -482,7 +485,7 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; - if (!sc->hn_carrier) { + if ((sc->hn_link_flags & HN_LINK_FLAG_LINKUP) == 0) { ifmr->ifm_active |= IFM_NONE; return; } @@ -563,6 +566,9 @@ netvsc_attach(device_t dev) taskqueue_start_threads(&sc->hn_mgmt_taskq0, 1, PI_NET, "%s mgmt", device_get_nameunit(dev)); TASK_INIT(&sc->hn_link_task, 0, hn_link_taskfunc, sc); + TASK_INIT(&sc->hn_netchg_init, 0, hn_netchg_init_taskfunc, sc); + TIMEOUT_TASK_INIT(sc->hn_mgmt_taskq0, &sc->hn_netchg_status, 0, + hn_netchg_status_taskfunc, sc); /* * Allocate ifnet and setup its name earlier, so that if_printf @@ -808,10 +814,8 @@ netvsc_shutdown(device_t dev) } static void -hn_link_taskfunc(void *xsc, int pending __unused) +hn_link_status(struct hn_softc *sc) { - struct hn_softc *sc = xsc; - struct ifnet *ifp = sc->hn_ifp; uint32_t link_status; int error; @@ -822,11 +826,51 @@ hn_link_taskfunc(void *xsc, int pending } if (link_status == NDIS_MEDIA_STATE_CONNECTED) - sc->hn_carrier = 1; + sc->hn_link_flags |= HN_LINK_FLAG_LINKUP; else - sc->hn_carrier = 0; - if_link_state_change(ifp, - sc->hn_carrier ? LINK_STATE_UP : LINK_STATE_DOWN); + sc->hn_link_flags &= ~HN_LINK_FLAG_LINKUP; + if_link_state_change(sc->hn_ifp, + (sc->hn_link_flags & HN_LINK_FLAG_LINKUP) ? + LINK_STATE_UP : LINK_STATE_DOWN); +} + +static void +hn_link_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + + if (sc->hn_link_flags & HN_LINK_FLAG_NETCHG) + return; + hn_link_status(sc); +} + +static void +hn_netchg_init_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + + /* Prevent any link status checks from running. */ + sc->hn_link_flags |= HN_LINK_FLAG_NETCHG; + + /* + * Fake up a [link down --> link up] state change; 5 seconds + * delay is used, which closely simulates miibus reaction + * upon link down event. + */ + sc->hn_link_flags &= ~HN_LINK_FLAG_LINKUP; + if_link_state_change(sc->hn_ifp, LINK_STATE_DOWN); + taskqueue_enqueue_timeout(sc->hn_mgmt_taskq0, + &sc->hn_netchg_status, 5 * hz); +} + +static void +hn_netchg_status_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + + /* Re-allow link status checks. */ + sc->hn_link_flags &= ~HN_LINK_FLAG_NETCHG; + hn_link_status(sc); } void @@ -837,6 +881,14 @@ hn_link_status_update(struct hn_softc *s taskqueue_enqueue(sc->hn_mgmt_taskq, &sc->hn_link_task); } +void +hn_network_change(struct hn_softc *sc) +{ + + if (sc->hn_mgmt_taskq != NULL) + taskqueue_enqueue(sc->hn_mgmt_taskq, &sc->hn_netchg_init); +} + static __inline int hn_txdesc_dmamap_load(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head, bus_dma_segment_t *segs, int *nsegs) @@ -3719,6 +3771,8 @@ hn_suspend_mgmt(struct hn_softc *sc) /* * Make sure that all pending management tasks are completed. */ + taskqueue_drain(sc->hn_mgmt_taskq0, &sc->hn_netchg_init); + taskqueue_drain_timeout(sc->hn_mgmt_taskq0, &sc->hn_netchg_status); taskqueue_drain_all(sc->hn_mgmt_taskq0); } @@ -3796,10 +3850,11 @@ hn_resume_mgmt(struct hn_softc *sc) { /* - * Kick off link status check. + * Kick off network change detection, which will + * do link status check too. */ sc->hn_mgmt_taskq = sc->hn_mgmt_taskq0; - hn_link_status_update(sc); + hn_network_change(sc); } static void Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Oct 21 07:46:35 2016 (r307711) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Oct 21 08:02:05 2016 (r307712) @@ -158,6 +158,7 @@ static void hv_rf_receive_indicate_status(struct hn_softc *sc, const void *data, int dlen) { const struct rndis_status_msg *msg; + int ofs; if (dlen < sizeof(*msg)) { if_printf(sc->hn_ifp, "invalid RNDIS status\n"); @@ -176,8 +177,19 @@ hv_rf_receive_indicate_status(struct hn_ break; case RNDIS_STATUS_NETWORK_CHANGE: - /* TODO */ - if_printf(sc->hn_ifp, "network changed\n"); + ofs = RNDIS_STBUFOFFSET_ABS(msg->rm_stbufoffset); + if (dlen < ofs + msg->rm_stbuflen || + msg->rm_stbuflen < sizeof(uint32_t)) { + if_printf(sc->hn_ifp, "network changed\n"); + } else { + uint32_t change; + + memcpy(&change, ((const uint8_t *)msg) + ofs, + sizeof(change)); + if_printf(sc->hn_ifp, "network changed, change %u\n", + change); + } + hn_network_change(sc); break; default: Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 21 07:46:35 2016 (r307711) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 21 08:02:05 2016 (r307712) @@ -139,6 +139,7 @@ int hn_rxpkt(struct hn_rx_ring *rxr, co const struct hn_recvinfo *info); void hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); void hn_link_status_update(struct hn_softc *sc); +void hn_network_change(struct hn_softc *sc); extern struct hn_send_ctx hn_send_ctx_none; Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Fri Oct 21 07:46:35 2016 (r307711) +++ head/sys/dev/hyperv/netvsc/ndis.h Fri Oct 21 08:02:05 2016 (r307712) @@ -32,6 +32,10 @@ #define NDIS_MEDIA_STATE_CONNECTED 0 #define NDIS_MEDIA_STATE_DISCONNECTED 1 +#define NDIS_NETCHANGE_TYPE_POSSIBLE 1 +#define NDIS_NETCHANGE_TYPE_DEFINITE 2 +#define NDIS_NETCHANGE_TYPE_FROMMEDIA 3 + #define NDIS_OFFLOAD_SET_NOCHG 0 #define NDIS_OFFLOAD_SET_ON 1 #define NDIS_OFFLOAD_SET_OFF 2 Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Fri Oct 21 07:46:35 2016 (r307711) +++ head/sys/net/rndis.h Fri Oct 21 08:02:05 2016 (r307712) @@ -320,6 +320,10 @@ struct rndis_status_msg { /* rndis_diag_info */ }; +/* stbuf offset from the beginning of rndis_status_msg. */ +#define RNDIS_STBUFOFFSET_ABS(ofs) \ + ((ofs) + __offsetof(struct rndis_status_msg, rm_status)) + /* * Immediately after rndis_status_msg.rm_stbufoffset, if a control * message is malformatted, or a packet message contains inappropriate From owner-svn-src-head@freebsd.org Fri Oct 21 08:12:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB0EFC18240; Fri, 21 Oct 2016 08:12:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8B6A4C9E; Fri, 21 Oct 2016 08:12:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L8CIcm052112; Fri, 21 Oct 2016 08:12:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L8CIZN052111; Fri, 21 Oct 2016 08:12:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610210812.u9L8CIZN052111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 21 Oct 2016 08:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307713 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 08:12:19 -0000 Author: ngie Date: Fri Oct 21 08:12:18 2016 New Revision: 307713 URL: https://svnweb.freebsd.org/changeset/base/307713 Log: Remove /usr/libexec/bsdinstall/hardening if MK_BSDINSTALL == no MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 21 08:02:05 2016 (r307712) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 21 08:12:18 2016 (r307713) @@ -676,6 +676,7 @@ OLD_FILES+=usr/libexec/bsdinstall/distex OLD_FILES+=usr/libexec/bsdinstall/distfetch OLD_FILES+=usr/libexec/bsdinstall/docsinstall OLD_FILES+=usr/libexec/bsdinstall/entropy +OLD_FILES+=usr/libexec/bsdinstall/hardening OLD_FILES+=usr/libexec/bsdinstall/hostname OLD_FILES+=usr/libexec/bsdinstall/jail OLD_FILES+=usr/libexec/bsdinstall/keymap From owner-svn-src-head@freebsd.org Fri Oct 21 08:21:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFEF4C18725; Fri, 21 Oct 2016 08:21:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 65AE336B; Fri, 21 Oct 2016 08:21:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9L8LNTn053214; Fri, 21 Oct 2016 08:21:23 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9L8LNS8053211; Fri, 21 Oct 2016 08:21:23 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610210821.u9L8LNS8053211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 21 Oct 2016 08:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307714 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 08:21:24 -0000 Author: sephe Date: Fri Oct 21 08:21:23 2016 New Revision: 307714 URL: https://svnweb.freebsd.org/changeset/base/307714 Log: hyperv/hn: Function renaming; consistent w/ hardware capabilities query. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8296 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 08:12:18 2016 (r307713) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 21 08:21:23 2016 (r307714) @@ -3473,10 +3473,10 @@ hn_synth_alloc_subchans(struct hn_softc } /* - * Get RSS capabilities, e.g. # of RX rings, and # of indirect + * Query RSS capabilities, e.g. # of RX rings, and # of indirect * table entries. */ - error = hn_rndis_get_rsscaps(sc, &rxr_cnt); + error = hn_rndis_query_rsscaps(sc, &rxr_cnt); if (error) { /* No RSS; this is benign. */ *nsubch = 0; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Oct 21 08:12:18 2016 (r307713) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Oct 21 08:21:23 2016 (r307714) @@ -748,7 +748,7 @@ done: } int -hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt) +hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt) { struct ndis_rss_caps in, caps; size_t caps_len; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 21 08:12:18 2016 (r307713) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Oct 21 08:21:23 2016 (r307714) @@ -122,7 +122,7 @@ void hn_rndis_detach(struct hn_softc *s int hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags); void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); -int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); +int hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt); int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr); int hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status); From owner-svn-src-head@freebsd.org Fri Oct 21 10:32:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00B48C1B2AE; Fri, 21 Oct 2016 10:32:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id CC30E19B; Fri, 21 Oct 2016 10:32: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 u9LAWv2Q007883; Fri, 21 Oct 2016 10:32:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LAWv4k007879; Fri, 21 Oct 2016 10:32:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201610211032.u9LAWv4k007879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 21 Oct 2016 10:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307726 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 10:32:59 -0000 Author: tuexen Date: Fri Oct 21 10:32:57 2016 New Revision: 307726 URL: https://svnweb.freebsd.org/changeset/base/307726 Log: Make ICMPv6 hard error handling for TCP consistent with the ICMPv4 handling. Ensure that: * Protocol unreachable errors are handled by indicating ECONNREFUSED to the TCP user for both IPv4 and IPv6. These were ignored for IPv6. * Communication prohibited errors are handled by indicating ECONNREFUSED to the TCP user for both IPv4 and IPv6. These were ignored for IPv6. * Hop Limited exceeded errors are handled by indicating EHOSTUNREACH to the TCP user for both IPv4 and IPv6. For IPv6 the TCP connected was dropped but errno wasn't set. Reviewed by: gallatin, rrs MFC after: 1 month Sponsored by: Netflix Differential Revision: 7904 Modified: head/sys/netinet/ip_icmp.c head/sys/netinet/tcp_subr.c head/sys/netinet6/icmp6.c head/sys/netinet6/ip6_input.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Oct 21 09:15:34 2016 (r307725) +++ head/sys/netinet/ip_icmp.c Fri Oct 21 10:32:57 2016 (r307726) @@ -457,6 +457,8 @@ icmp_input(struct mbuf **mp, int *offp, * Treat subcodes 2,3 as immediate RST */ case ICMP_UNREACH_PROTOCOL: + code = PRC_UNREACH_PROTOCOL; + break; case ICMP_UNREACH_PORT: code = PRC_UNREACH_PORT; break; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Oct 21 09:15:34 2016 (r307725) +++ head/sys/netinet/tcp_subr.c Fri Oct 21 10:32:57 2016 (r307726) @@ -1968,7 +1968,8 @@ tcp_ctlinput(int cmd, struct sockaddr *s if (cmd == PRC_MSGSIZE) notify = tcp_mtudisc_notify; else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || - cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && ip) + cmd == PRC_UNREACH_PORT || cmd == PRC_UNREACH_PROTOCOL || + cmd == PRC_TIMXCEED_INTRANS) && ip) notify = tcp_drop_syn_sent; /* @@ -2100,8 +2101,8 @@ tcp6_ctlinput(int cmd, struct sockaddr * if (cmd == PRC_MSGSIZE) notify = tcp_mtudisc_notify; else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || - cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && - ip6 != NULL) + cmd == PRC_UNREACH_PORT || cmd == PRC_UNREACH_PROTOCOL || + cmd == PRC_TIMXCEED_INTRANS) && ip6 != NULL) notify = tcp_drop_syn_sent; /* Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Fri Oct 21 09:15:34 2016 (r307725) +++ head/sys/netinet6/icmp6.c Fri Oct 21 10:32:57 2016 (r307726) @@ -490,7 +490,7 @@ icmp6_input(struct mbuf **mp, int *offp, break; case ICMP6_DST_UNREACH_ADMIN: icmp6_ifstat_inc(ifp, ifs6_in_adminprohib); - code = PRC_UNREACH_PROTOCOL; /* is this a good code? */ + code = PRC_UNREACH_ADMIN_PROHIB; break; case ICMP6_DST_UNREACH_BEYONDSCOPE: /* I mean "source address was incorrect." */ Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri Oct 21 09:15:34 2016 (r307725) +++ head/sys/netinet6/ip6_input.c Fri Oct 21 10:32:57 2016 (r307726) @@ -1772,6 +1772,6 @@ u_char inet6ctlerrmap[PRC_NCMDS] = { 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, EMSGSIZE, EHOSTUNREACH, 0, 0, - 0, 0, 0, 0, - ENOPROTOOPT + 0, 0, EHOSTUNREACH, 0, + ENOPROTOOPT, ECONNREFUSED }; From owner-svn-src-head@freebsd.org Fri Oct 21 11:29:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B811BC1B82D; Fri, 21 Oct 2016 11:29:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 80A122FD; Fri, 21 Oct 2016 11:29:26 +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 u9LBTPxH026993; Fri, 21 Oct 2016 11:29:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LBTPbb026992; Fri, 21 Oct 2016 11:29:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201610211129.u9LBTPbb026992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 21 Oct 2016 11:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307727 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 11:29:26 -0000 Author: tuexen Date: Fri Oct 21 11:29:25 2016 New Revision: 307727 URL: https://svnweb.freebsd.org/changeset/base/307727 Log: Document the TCP sysctl variables insecure_rst and insecure_syn. MFC after: 1 month Sponsored by: netflix Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Fri Oct 21 10:32:57 2016 (r307726) +++ head/share/man/man4/tcp.4 Fri Oct 21 11:29:25 2016 (r307727) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 28, 2016 +.Dd October 21, 2016 .Dt TCP 4 .Os .Sh NAME @@ -586,6 +586,12 @@ downshift. List of available TCP function blocks (TCP stacks). .It Va functions_default The default TCP function block (TCP stack). +.It Va insecure_rst +Use criterias defined in RFC793 instead of RFC5961 for accepting RST segments. +Default is false. +.It Va insecure_syn +Use criterias defined in RFC793 instead of RFC5961 for accepting SYN segments. +Default is false. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: From owner-svn-src-head@freebsd.org Fri Oct 21 13:51:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5008AC1BE2D; Fri, 21 Oct 2016 13:51:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id 19A7CB04; Fri, 21 Oct 2016 13:51:49 +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 u9LDpmBS098628; Fri, 21 Oct 2016 13:51:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LDpmAH098627; Fri, 21 Oct 2016 13:51:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610211351.u9LDpmAH098627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Oct 2016 13:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307728 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 13:51:49 -0000 Author: emaste Date: Fri Oct 21 13:51:47 2016 New Revision: 307728 URL: https://svnweb.freebsd.org/changeset/base/307728 Log: netmap: fix kernel build on GCC-using architectures GCC produced a multiple declaration warning from the SYSCTL_DECL(_dev_netmap). Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Fri Oct 21 11:29:25 2016 (r307727) +++ head/sys/dev/netmap/netmap_mem2.c Fri Oct 21 13:51:47 2016 (r307728) @@ -502,7 +502,6 @@ static const struct netmap_mem_d nm_blue #define DECLARE_SYSCTLS(id, name) \ SYSBEGIN(mem2_ ## name); \ - SYSCTL_DECL(_dev_netmap); /* leave it here, easier for porting */ \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_size, \ CTLFLAG_RW, &netmap_params[id].size, 0, "Requested size of netmap " STRINGIFY(name) "s"); \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_curr_size, \ @@ -519,6 +518,7 @@ static const struct netmap_mem_d nm_blue "Default number of private netmap " STRINGIFY(name) "s"); \ SYSEND +SYSCTL_DECL(_dev_netmap); DECLARE_SYSCTLS(NETMAP_IF_POOL, if); DECLARE_SYSCTLS(NETMAP_RING_POOL, ring); DECLARE_SYSCTLS(NETMAP_BUF_POOL, buf); From owner-svn-src-head@freebsd.org Fri Oct 21 14:28:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B596C1BA1D; Fri, 21 Oct 2016 14:28:28 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6DB192; Fri, 21 Oct 2016 14:28:28 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id D320F17AFC; Fri, 21 Oct 2016 07:28:21 -0700 (PDT) Date: Fri, 21 Oct 2016 07:28:21 -0700 From: hiren panchasara To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307727 - head/share/man/man4 Message-ID: <20161021142821.GJ11808@strugglingcoder.info> References: <201610211129.u9LBTPbb026992@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Re2uCLPLNzqOLVJA" Content-Disposition: inline In-Reply-To: <201610211129.u9LBTPbb026992@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 14:28:28 -0000 --Re2uCLPLNzqOLVJA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 10/21/16 at 11:29P, Michael Tuexen wrote: > Author: tuexen > Date: Fri Oct 21 11:29:25 2016 > New Revision: 307727 > URL: https://svnweb.freebsd.org/changeset/base/307727 >=20 > Log: > Document the TCP sysctl variables insecure_rst and insecure_syn. > =20 > MFC after: 1 month > Sponsored by: netflix >=20 > Modified: > head/share/man/man4/tcp.4 >=20 > Modified: head/share/man/man4/tcp.4 > =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/share/man/man4/tcp.4 Fri Oct 21 10:32:57 2016 (r307726) > +++ head/share/man/man4/tcp.4 Fri Oct 21 11:29:25 2016 (r307727) > @@ -34,7 +34,7 @@ > .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 > .\" $FreeBSD$ > .\" > -.Dd June 28, 2016 > +.Dd October 21, 2016 > .Dt TCP 4 > .Os > .Sh NAME > @@ -586,6 +586,12 @@ downshift. > List of available TCP function blocks (TCP stacks). > .It Va functions_default > The default TCP function block (TCP stack). > +.It Va insecure_rst > +Use criterias defined in RFC793 instead of RFC5961 for accepting RST seg= ments. I am not a native speaker but should we s/criterias /criteria / ? > +Default is false. > +.It Va insecure_syn > +Use criterias defined in RFC793 instead of RFC5961 for accepting SYN seg= ments. Same. > +Default is false. > .El > .Sh ERRORS > A socket operation may fail with one of the following errors returned: >=20 Cheers, Hiren --Re2uCLPLNzqOLVJA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYCiYCXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/ljJEH+wS57SFQuWMlug3Lvl4sFIle BS4xEQYNl+t+ojAW3LsHq7DbbKXqAhZldfGBfRtAbmhucfqlaDA6lO3KpjY6uVGJ XrooTNdgz4uj9Y34RNLIDlHaqm1G2Rf7dWaWYxLngZyzSVE8itG8FxFIEflYjZz/ v6X0D22qpaS4IGPxsL3iDAeE85XP5SO+4IRLlS3GtSFdYYHlfjYslXujzNzEndFs 0xRk73+Ww5LxGfnI6ox5c3RI52Cn+6vom/CoPwq70lTSl5s/lJJW7T8oZdBIvtbB dbSSmYWx+mgXvf16gkzz5DKjpYq/Nx9Oul4sp+cZP2c8ZhofwOS8DMZMXsjptLY= =DrOf -----END PGP SIGNATURE----- --Re2uCLPLNzqOLVJA-- From owner-svn-src-head@freebsd.org Fri Oct 21 14:36:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BEA6C1BE32; Fri, 21 Oct 2016 14:36:58 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD669D4F; Fri, 21 Oct 2016 14:36:57 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x235.google.com with SMTP id t193so97555078ywc.2; Fri, 21 Oct 2016 07:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=byo9P6kPHqN2E5cU6+NiCtdnV5XgV0OfDQxXQiH3hWQ=; b=ZokCpIsViVJSQm1cQRbwNuM9P3CISUv7V68NRXwLLvI1sBoisBzvAFYcM9n8yFlWJe LdpAgvPw++buE2KO2pdrIvXOkLgcmTsaiXgZpOv1nt72YVZs9UMFJRUF5cM6vQR520Fn GyeaADqlLUOTw/QQc/06X3Sm9tVrFNLZmGWPXfij6o7A3W/6IVnyg558hGhzjnidvRvw +/pxvqJr8WdKxqBWDu4r1nU6HBmQYd5TIZ4ejX6EfYorRZWI6SPHa4VDA728TtpeVeyq Cz633KLop8J9I8s/CIT/JzroT4lTQCysQk+IGy00O1pF9N2jjy6Qh/ZGU0P9BB83080u CiIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=byo9P6kPHqN2E5cU6+NiCtdnV5XgV0OfDQxXQiH3hWQ=; b=Hdt2SGRrEZ2MabGk30Y6YisVoAqSjtxpYeYI6In5v1lex3Tt8HziF+ZnL8wAeTHtfY sh4w364ZlHVqGNWDwF+fpodI+PQk4qN5eVllap4I0POG4vnSRVCI2LpKwCJA+Mendn3F BKLDW7u8tk6snpaMAy1I/QClmxCaO4hhNd0LBtTCr7UPXTVn5G2u8gpVaDo/rxsMjIvU 2Sb1wdjUR26MPu4zyLuD6KCcIuF3NAN+8sgaBgI4D5oQWK3lT4QVZgZT5vqKOGng+FaX jhVklUMzqD9pZjD4v2Jum3HX9XVpZbmcF8lJeSYcC5g7G9z4ln4STXKWhxQex0OgjNMN i2rA== X-Gm-Message-State: ABUngvfKCGqL6Fy7LtsxdJwFaSZTSaNcDh9R9i1IZC8o98OvAU6QC4QrVvokl6qc1z2KnAogEF/L+P/dCdHcrQ== X-Received: by 10.129.42.134 with SMTP id q128mr1422138ywq.38.1477060617067; Fri, 21 Oct 2016 07:36:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.133.131 with HTTP; Fri, 21 Oct 2016 07:36:55 -0700 (PDT) Received: by 10.129.133.131 with HTTP; Fri, 21 Oct 2016 07:36:55 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <20161021142821.GJ11808@strugglingcoder.info> References: <201610211129.u9LBTPbb026992@repo.freebsd.org> <20161021142821.GJ11808@strugglingcoder.info> From: Marcelo Araujo Date: Fri, 21 Oct 2016 22:36:55 +0800 Message-ID: Subject: Re: svn commit: r307727 - head/share/man/man4 To: hiren panchasara Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, Michael Tuexen Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 14:36:58 -0000 Bump date too. On Oct 21, 2016 10:28 PM, "hiren panchasara" wrote: > On 10/21/16 at 11:29P, Michael Tuexen wrote: > > Author: tuexen > > Date: Fri Oct 21 11:29:25 2016 > > New Revision: 307727 > > URL: https://svnweb.freebsd.org/changeset/base/307727 > > > > Log: > > Document the TCP sysctl variables insecure_rst and insecure_syn. > > > > MFC after: 1 month > > Sponsored by: netflix > > > > Modified: > > head/share/man/man4/tcp.4 > > > > Modified: head/share/man/man4/tcp.4 > > ============================================================ > ================== > > --- head/share/man/man4/tcp.4 Fri Oct 21 10:32:57 2016 (r307726) > > +++ head/share/man/man4/tcp.4 Fri Oct 21 11:29:25 2016 (r307727) > > @@ -34,7 +34,7 @@ > > .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 > > .\" $FreeBSD$ > > .\" > > -.Dd June 28, 2016 > > +.Dd October 21, 2016 > > .Dt TCP 4 > > .Os > > .Sh NAME > > @@ -586,6 +586,12 @@ downshift. > > List of available TCP function blocks (TCP stacks). > > .It Va functions_default > > The default TCP function block (TCP stack). > > +.It Va insecure_rst > > +Use criterias defined in RFC793 instead of RFC5961 for accepting RST > segments. > > I am not a native speaker but should we s/criterias /criteria / ? > > +Default is false. > > +.It Va insecure_syn > > +Use criterias defined in RFC793 instead of RFC5961 for accepting SYN > segments. > > Same. > > +Default is false. > > .El > > .Sh ERRORS > > A socket operation may fail with one of the following errors returned: > > > > Cheers, > Hiren > From owner-svn-src-head@freebsd.org Fri Oct 21 15:09:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C77C1ABBB; Fri, 21 Oct 2016 15:09:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB4B285F; Fri, 21 Oct 2016 15:09:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::d1be:e456:ed14:df1a] (unknown [IPv6:2001:7b8:3a7:0:d1be:e456:ed14:df1a]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 98EF4123F3; Fri, 21 Oct 2016 17:09:03 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_623596D7-AA08-4F4A-8CCF-7D7DE11895F4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r307676 - head/share/mk From: Dimitry Andric In-Reply-To: <201610201514.u9KFELev056434@repo.freebsd.org> Date: Fri, 21 Oct 2016 17:08:47 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <3489ADC0-3C2B-4220-BE93-F76014AB3A59@FreeBSD.org> References: <201610201514.u9KFELev056434@repo.freebsd.org> To: Jonathan Anderson X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 15:09:12 -0000 --Apple-Mail=_623596D7-AA08-4F4A-8CCF-7D7DE11895F4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 20 Oct 2016, at 17:14, Jonathan Anderson = wrote: >=20 > Author: jonathan > Date: Thu Oct 20 15:14:21 2016 > New Revision: 307676 > URL: https://svnweb.freebsd.org/changeset/base/307676 >=20 > Log: > Add make rules to build LLVM IR from C/C++ sources. >=20 > As a foundation for future work with LLVM's Intermediate = Representation (IR), > add new suffix rules that can be used to build .llo (text) or .bco = (bitcode) > files from C or C++ sources. Hi, Unfortunately I was not on the review list, but I object to using .llo and .bco, which implies that these are "object" files, and they are not. Can we please just use the upstream default extensions, .ll and .bc instead? -Dimitry --Apple-Mail=_623596D7-AA08-4F4A-8CCF-7D7DE11895F4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlgKL48ACgkQsF6jCi4glqM3tgCePex7DK3jLtXZEvyAMJX7kJgr fc0An1MpUYm+ydQwriNntfdI7WMqanTU =0UM9 -----END PGP SIGNATURE----- --Apple-Mail=_623596D7-AA08-4F4A-8CCF-7D7DE11895F4-- From owner-svn-src-head@freebsd.org Fri Oct 21 15:17:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCD55C1AFC4; Fri, 21 Oct 2016 15:17:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id AEDB1ED3; Fri, 21 Oct 2016 15:17:43 +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 u9LFHge7030524; Fri, 21 Oct 2016 15:17:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LFHgcM030523; Fri, 21 Oct 2016 15:17:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610211517.u9LFHgcM030523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Oct 2016 15:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307730 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 15:17:44 -0000 Author: emaste Date: Fri Oct 21 15:17:42 2016 New Revision: 307730 URL: https://svnweb.freebsd.org/changeset/base/307730 Log: netmap: if_ptnet depends on inet Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 21 14:28:35 2016 (r307729) +++ head/sys/conf/files Fri Oct 21 15:17:42 2016 (r307730) @@ -2226,7 +2226,7 @@ dev/nand/nfc_if.m optional nand dev/ncr/ncr.c optional ncr pci dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard -dev/netmap/if_ptnet.c optional netmap +dev/netmap/if_ptnet.c optional netmap inet dev/netmap/netmap.c optional netmap dev/netmap/netmap_freebsd.c optional netmap dev/netmap/netmap_generic.c optional netmap From owner-svn-src-head@freebsd.org Fri Oct 21 15:23:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16ACBC1B3ED; Fri, 21 Oct 2016 15:23:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id DAE081902; Fri, 21 Oct 2016 15:23:55 +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 u9LFNtLj041191; Fri, 21 Oct 2016 15:23:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LFNsae041189; Fri, 21 Oct 2016 15:23:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610211523.u9LFNsae041189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Oct 2016 15:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307731 - in head: sys/dev/pci usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 15:23:56 -0000 Author: mav Date: Fri Oct 21 15:23:54 2016 New Revision: 307731 URL: https://svnweb.freebsd.org/changeset/base/307731 Log: Add names for some DASP devices. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/pci/pci.c head/usr.sbin/pciconf/pciconf.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Oct 21 15:17:42 2016 (r307730) +++ head/sys/dev/pci/pci.c Fri Oct 21 15:23:54 2016 (r307731) @@ -4608,6 +4608,9 @@ static const struct {PCIC_CRYPTO, PCIS_CRYPTO_ENTERTAIN, 1, "entertainment crypto"}, {PCIC_DASP, -1, 0, "dasp"}, {PCIC_DASP, PCIS_DASP_DPIO, 1, "DPIO module"}, + {PCIC_DASP, PCIS_DASP_PERFCNTRS, 1, "performance counters"}, + {PCIC_DASP, PCIS_DASP_COMM_SYNC, 1, "communication synchronizer"}, + {PCIC_DASP, PCIS_DASP_MGMT_CARD, 1, "signal processing management"}, {0, 0, 0, NULL} }; Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Fri Oct 21 15:17:42 2016 (r307730) +++ head/usr.sbin/pciconf/pciconf.c Fri Oct 21 15:23:54 2016 (r307731) @@ -697,6 +697,9 @@ static struct {PCIC_CRYPTO, PCIS_CRYPTO_NETCOMP, "entertainment crypto"}, {PCIC_DASP, -1, "dasp"}, {PCIC_DASP, PCIS_DASP_DPIO, "DPIO module"}, + {PCIC_DASP, PCIS_DASP_PERFCNTRS, "performance counters"}, + {PCIC_DASP, PCIS_DASP_COMM_SYNC, "communication synchronizer"}, + {PCIC_DASP, PCIS_DASP_MGMT_CARD, "signal processing management"}, {0, 0, NULL} }; From owner-svn-src-head@freebsd.org Fri Oct 21 15:26:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10915C1B58E; Fri, 21 Oct 2016 15:26:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id EEE951B44; Fri, 21 Oct 2016 15:26:32 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 523E15649D; Fri, 21 Oct 2016 10:26:32 -0500 (CDT) Subject: Re: svn commit: r307727 - head/share/man/man4 To: hiren panchasara , Michael Tuexen References: <201610211129.u9LBTPbb026992@repo.freebsd.org> <20161021142821.GJ11808@strugglingcoder.info> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: Date: Fri, 21 Oct 2016 10:26:29 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161021142821.GJ11808@strugglingcoder.info> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 15:26:33 -0000 On 10/21/2016 09:28, hiren panchasara wrote: > On 10/21/16 at 11:29P, Michael Tuexen wrote: >> Author: tuexen >> Date: Fri Oct 21 11:29:25 2016 >> New Revision: 307727 >> URL: https://svnweb.freebsd.org/changeset/base/307727 >> >> Log: >> Document the TCP sysctl variables insecure_rst and insecure_syn. >> >> MFC after: 1 month >> Sponsored by: netflix >> >> Modified: >> head/share/man/man4/tcp.4 >> >> Modified: head/share/man/man4/tcp.4 >> ============================================================================== >> --- head/share/man/man4/tcp.4 Fri Oct 21 10:32:57 2016 (r307726) >> +++ head/share/man/man4/tcp.4 Fri Oct 21 11:29:25 2016 (r307727) >> @@ -34,7 +34,7 @@ >> .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 >> .\" $FreeBSD$ >> .\" >> -.Dd June 28, 2016 >> +.Dd October 21, 2016 >> .Dt TCP 4 >> .Os >> .Sh NAME >> @@ -586,6 +586,12 @@ downshift. >> List of available TCP function blocks (TCP stacks). >> .It Va functions_default >> The default TCP function block (TCP stack). >> +.It Va insecure_rst >> +Use criterias defined in RFC793 instead of RFC5961 for accepting RST segments. > > I am not a native speaker but should we s/criterias /criteria / ? I am a native speaker. Yes, these should be "criteria", which is the plural of "criterion". >> +Default is false. >> +.It Va insecure_syn >> +Use criterias defined in RFC793 instead of RFC5961 for accepting SYN segments. > > Same. >> +Default is false. >> .El >> .Sh ERRORS >> A socket operation may fail with one of the following errors returned: >> > > Cheers, > Hiren > From owner-svn-src-head@freebsd.org Fri Oct 21 16:12:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52935C1C302; Fri, 21 Oct 2016 16:12:25 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 131EFD4A; Fri, 21 Oct 2016 16:12:25 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9LGCOBd059471; Fri, 21 Oct 2016 16:12:24 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LGCOv4059470; Fri, 21 Oct 2016 16:12:24 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201610211612.u9LGCOv4059470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 21 Oct 2016 16:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307734 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 16:12:25 -0000 Author: oshogbo Date: Fri Oct 21 16:12:23 2016 New Revision: 307734 URL: https://svnweb.freebsd.org/changeset/base/307734 Log: capsicum: perform copyout without the fildesc lock held in sys_cap_ioctls_get Reviewed by: pjd Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Fri Oct 21 16:12:09 2016 (r307733) +++ head/sys/kern/sys_capability.c Fri Oct 21 16:12:23 2016 (r307734) @@ -89,6 +89,8 @@ SYSCTL_INT(_kern, OID_AUTO, trap_enotcap #ifdef CAPABILITY_MODE +#define IOCTLS_MAX_COUNT 256 /* XXX: Is 256 sane? */ + FEATURE(security_capability_mode, "Capsicum Capability Mode"); /* @@ -398,6 +400,11 @@ kern_cap_ioctls_limit(struct thread *td, AUDIT_ARG_FD(fd); + if (ncmds > IOCTLS_MAX_COUNT) { + error = EINVAL; + goto out_free; + } + fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); @@ -418,6 +425,7 @@ kern_cap_ioctls_limit(struct thread *td, error = 0; out: FILEDESC_XUNLOCK(fdp); +out_free: free(cmds, M_FILECAPS); return (error); } @@ -431,7 +439,7 @@ sys_cap_ioctls_limit(struct thread *td, ncmds = uap->ncmds; - if (ncmds > 256) /* XXX: Is 256 sane? */ + if (ncmds > IOCTLS_MAX_COUNT) return (EINVAL); if (ncmds == 0) { @@ -453,45 +461,59 @@ sys_cap_ioctls_get(struct thread *td, st { struct filedesc *fdp; struct filedescent *fdep; - u_long *cmds; - size_t maxcmds; + u_long *cmdsp, *dstcmds; + size_t maxcmds, ncmds; + int16_t count; int error, fd; fd = uap->fd; - cmds = uap->cmds; + dstcmds = uap->cmds; maxcmds = uap->maxcmds; AUDIT_ARG_FD(fd); fdp = td->td_proc->p_fd; - FILEDESC_SLOCK(fdp); - if (fget_locked(fdp, fd) == NULL) { + cmdsp = NULL; + if (dstcmds != NULL) { + cmdsp = malloc(sizeof(cmdsp[0]) * IOCTLS_MAX_COUNT, M_FILECAPS, + M_WAITOK | M_ZERO); + } + + FILEDESC_SLOCK(fdp); + fdep = fdeget_locked(fdp, fd); + if (fdep == NULL) { error = EBADF; + FILEDESC_SUNLOCK(fdp); goto out; } + count = fdep->fde_nioctls; + if (count != -1 && cmdsp != NULL) { + ncmds = MIN(count, maxcmds); + memcpy(cmdsp, fdep->fde_ioctls, sizeof(cmdsp[0]) * ncmds); + } + FILEDESC_SUNLOCK(fdp); /* * If all ioctls are allowed (fde_nioctls == -1 && fde_ioctls == NULL) * the only sane thing we can do is to not populate the given array and * return CAP_IOCTLS_ALL. */ - - fdep = &fdp->fd_ofiles[fd]; - if (cmds != NULL && fdep->fde_ioctls != NULL) { - error = copyout(fdep->fde_ioctls, cmds, - sizeof(cmds[0]) * MIN(fdep->fde_nioctls, maxcmds)); - if (error != 0) - goto out; - } - if (fdep->fde_nioctls == -1) + if (count != -1) { + if (cmdsp != NULL) { + error = copyout(cmdsp, dstcmds, + sizeof(cmdsp[0]) * ncmds); + if (error != 0) + goto out; + } + td->td_retval[0] = count; + } else { td->td_retval[0] = CAP_IOCTLS_ALL; - else - td->td_retval[0] = fdep->fde_nioctls; + } error = 0; out: - FILEDESC_SUNLOCK(fdp); + free(cmdsp, M_FILECAPS); return (error); } From owner-svn-src-head@freebsd.org Fri Oct 21 16:32:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C3BEC1C81E; Fri, 21 Oct 2016 16:32:00 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E0784C1D; Fri, 21 Oct 2016 16:31:59 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9LGVxwe066473; Fri, 21 Oct 2016 16:31:59 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LGVxLZ066472; Fri, 21 Oct 2016 16:31:59 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201610211631.u9LGVxLZ066472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 21 Oct 2016 16:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307737 - head/lib/libcapsicum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 16:32:00 -0000 Author: oshogbo Date: Fri Oct 21 16:31:58 2016 New Revision: 307737 URL: https://svnweb.freebsd.org/changeset/base/307737 Log: Fix few sentence in the man page. Pointed out by: wblock Modified: head/lib/libcapsicum/capsicum_helpers.3 Modified: head/lib/libcapsicum/capsicum_helpers.3 ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.3 Fri Oct 21 16:29:40 2016 (r307736) +++ head/lib/libcapsicum/capsicum_helpers.3 Fri Oct 21 16:31:58 2016 (r307737) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd October 21, 2016 .Dt CAPSICUM_HELPERS 3 .Os .Sh NAME @@ -57,7 +57,8 @@ .Sh DESCRIPTION The .Nm capsicum helpers -are a set of a inline functions which simplify Capsicumizing programs. +are a set of a inline functions which simplify modifying programs to use +Capsicum. The goal is to reduce duplicated code patterns. The .Nm capsicum helpers @@ -70,7 +71,7 @@ restricts capabilities on .Fa fd to only those needed by POSIX stream objects (that is, FILEs). .Pp -The following flags can be provided: +These flags can be provided: .Pp .Bl -tag -width "CAPH_IGNORE_EBADF" -compact -offset indent .It Dv CAPH_IGNORE_EBADF From owner-svn-src-head@freebsd.org Fri Oct 21 17:25:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0279C1B8B6; Fri, 21 Oct 2016 17:25:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 71F3BFF5; Fri, 21 Oct 2016 17:25:20 +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 u9LHPJcP087070; Fri, 21 Oct 2016 17:25:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LHPJSR087069; Fri, 21 Oct 2016 17:25:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610211725.u9LHPJSR087069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Oct 2016 17:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307741 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 17:25:20 -0000 Author: emaste Date: Fri Oct 21 17:25:19 2016 New Revision: 307741 URL: https://svnweb.freebsd.org/changeset/base/307741 Log: Allow all subdirectories to be optional via SUBDIR.${MK_*} Reviewed by: br, imp Tested by: br Pointy hat to: emaste Differential Revision: https://reviews.freebsd.org/D8317 Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Fri Oct 21 16:47:02 2016 (r307740) +++ head/share/mk/bsd.subdir.mk Fri Oct 21 17:25:19 2016 (r307741) @@ -110,7 +110,7 @@ install: beforeinstall realinstall after # SUBDIR recursing may be disabled for MK_DIRDEPS_BUILD .if !target(_SUBDIR) -.if defined(SUBDIR) +.if defined(SUBDIR) || defined(SUBDIR.yes) SUBDIR:=${SUBDIR} ${SUBDIR.yes} SUBDIR:=${SUBDIR:u} .endif From owner-svn-src-head@freebsd.org Fri Oct 21 18:27:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09FB2C1C962; Fri, 21 Oct 2016 18:27:32 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B110AAD0; Fri, 21 Oct 2016 18:27:31 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9LIRUde010304; Fri, 21 Oct 2016 18:27:30 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LIRUUi010303; Fri, 21 Oct 2016 18:27:30 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201610211827.u9LIRUUi010303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Fri, 21 Oct 2016 18:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307745 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 18:27:32 -0000 Author: hiren Date: Fri Oct 21 18:27:30 2016 New Revision: 307745 URL: https://svnweb.freebsd.org/changeset/base/307745 Log: Rework r306337. In sendit(), if mp->msg_control is present, then in sockargs() we are allocating mbuf to store mp->msg_control. Later in kern_sendit(), call to getsock_cap(), will check validity of file pointer passed, if this fails EBADF is returned but mbuf allocated in sockargs() is not freed. Made code changes to free the same. Since freeing control mbuf in sendit() after checking (control != NULL) may lead to double freeing of control mbuf in sendit(), we can free control mbuf in kern_sendit() if there are any errors in the routine. Submitted by: Lohith Bellad Reviewed by: glebius MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D8152 Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Oct 21 17:44:47 2016 (r307744) +++ head/sys/kern/uipc_syscalls.c Fri Oct 21 18:27:30 2016 (r307745) @@ -762,8 +762,10 @@ kern_sendit(struct thread *td, int s, st cap_rights_set(&rights, CAP_CONNECT); } error = getsock_cap(td, s, &rights, &fp, NULL, NULL); - if (error != 0) + if (error != 0) { + m_freem(control); return (error); + } so = (struct socket *)fp->f_data; #ifdef KTRACE @@ -774,12 +776,16 @@ kern_sendit(struct thread *td, int s, st if (mp->msg_name != NULL) { error = mac_socket_check_connect(td->td_ucred, so, mp->msg_name); - if (error != 0) + if (error != 0) { + m_freem(control); goto bad; + } } error = mac_socket_check_send(td->td_ucred, so); - if (error != 0) + if (error != 0) { + m_freem(control); goto bad; + } #endif auio.uio_iov = mp->msg_iov; @@ -793,6 +799,7 @@ kern_sendit(struct thread *td, int s, st for (i = 0; i < mp->msg_iovlen; i++, iov++) { if ((auio.uio_resid += iov->iov_len) < 0) { error = EINVAL; + m_freem(control); goto bad; } } From owner-svn-src-head@freebsd.org Fri Oct 21 18:45:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22ACAC1CD40; Fri, 21 Oct 2016 18:45:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id E317C65A; Fri, 21 Oct 2016 18:45: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 u9LIjABB017750; Fri, 21 Oct 2016 18:45:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LIjAPB017749; Fri, 21 Oct 2016 18:45:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201610211845.u9LIjAPB017749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 21 Oct 2016 18:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307746 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 18:45:11 -0000 Author: tuexen Date: Fri Oct 21 18:45:09 2016 New Revision: 307746 URL: https://svnweb.freebsd.org/changeset/base/307746 Log: Fix a grammar error. Reported by:i hiren, vangyzen MFC after: 1 month X-MFC: r307727 Sponsored by: Netflix Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Fri Oct 21 18:27:30 2016 (r307745) +++ head/share/man/man4/tcp.4 Fri Oct 21 18:45:09 2016 (r307746) @@ -587,10 +587,10 @@ List of available TCP function blocks (T .It Va functions_default The default TCP function block (TCP stack). .It Va insecure_rst -Use criterias defined in RFC793 instead of RFC5961 for accepting RST segments. +Use criteria defined in RFC793 instead of RFC5961 for accepting RST segments. Default is false. .It Va insecure_syn -Use criterias defined in RFC793 instead of RFC5961 for accepting SYN segments. +Use criteria defined in RFC793 instead of RFC5961 for accepting SYN segments. Default is false. .El .Sh ERRORS From owner-svn-src-head@freebsd.org Fri Oct 21 18:45:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9CE4C1CD92; Fri, 21 Oct 2016 18:45:55 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FACC83F; Fri, 21 Oct 2016 18:45:54 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.109] (p508F0219.dip0.t-ipconnect.de [80.143.2.25]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 7FC9671E3F917; Fri, 21 Oct 2016 20:45:44 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: svn commit: r307727 - head/share/man/man4 From: Michael Tuexen In-Reply-To: Date: Fri, 21 Oct 2016 20:45:42 +0200 Cc: hiren panchasara , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <24E8C388-EA2D-425E-88DC-E288D2C28D35@freebsd.org> References: <201610211129.u9LBTPbb026992@repo.freebsd.org> <20161021142821.GJ11808@strugglingcoder.info> To: Eric van Gyzen X-Mailer: Apple Mail (2.3226) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 18:45:55 -0000 > On 21 Oct 2016, at 17:26, Eric van Gyzen wrote: >=20 > On 10/21/2016 09:28, hiren panchasara wrote: >> On 10/21/16 at 11:29P, Michael Tuexen wrote: >>> Author: tuexen >>> Date: Fri Oct 21 11:29:25 2016 >>> New Revision: 307727 >>> URL: https://svnweb.freebsd.org/changeset/base/307727 >>>=20 >>> Log: >>> Document the TCP sysctl variables insecure_rst and insecure_syn. >>>=20 >>> MFC after: 1 month >>> Sponsored by: netflix >>>=20 >>> Modified: >>> head/share/man/man4/tcp.4 >>>=20 >>> Modified: head/share/man/man4/tcp.4 >>> = =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/share/man/man4/tcp.4 Fri Oct 21 10:32:57 2016 = (r307726) >>> +++ head/share/man/man4/tcp.4 Fri Oct 21 11:29:25 2016 = (r307727) >>> @@ -34,7 +34,7 @@ >>> .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 >>> .\" $FreeBSD$ >>> .\" >>> -.Dd June 28, 2016 >>> +.Dd October 21, 2016 >>> .Dt TCP 4 >>> .Os >>> .Sh NAME >>> @@ -586,6 +586,12 @@ downshift. >>> List of available TCP function blocks (TCP stacks). >>> .It Va functions_default >>> The default TCP function block (TCP stack). >>> +.It Va insecure_rst >>> +Use criterias defined in RFC793 instead of RFC5961 for accepting = RST segments. >>=20 >> I am not a native speaker but should we s/criterias /criteria / ? >=20 > I am a native speaker. Yes, these should be "criteria", which is the = plural of > "criterion". Thanks. Fixed in r307746. Best regards Michael >=20 >>> +Default is false. >>> +.It Va insecure_syn >>> +Use criterias defined in RFC793 instead of RFC5961 for accepting = SYN segments. >>=20 >> Same. >>> +Default is false. >>> .El >>> .Sh ERRORS >>> A socket operation may fail with one of the following errors = returned: >>>=20 >>=20 >> Cheers, >> Hiren >>=20 From owner-svn-src-head@freebsd.org Fri Oct 21 18:46:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 636D3C1CDC5; Fri, 21 Oct 2016 18:46:17 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B4109A8; Fri, 21 Oct 2016 18:46:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.109] (p508F0219.dip0.t-ipconnect.de [80.143.2.25]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 20CA271E3F917; Fri, 21 Oct 2016 20:46:14 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: svn commit: r307727 - head/share/man/man4 From: Michael Tuexen In-Reply-To: Date: Fri, 21 Oct 2016 20:46:13 +0200 Cc: hiren panchasara , src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <21B3CF83-4C4C-4690-B3FA-B4A97C91BDFF@freebsd.org> References: <201610211129.u9LBTPbb026992@repo.freebsd.org> <20161021142821.GJ11808@strugglingcoder.info> To: araujo@freebsd.org X-Mailer: Apple Mail (2.3226) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 18:46:17 -0000 > On 21 Oct 2016, at 16:36, Marcelo Araujo = wrote: >=20 > Bump date too. It was bumped, wasn't it? Best regards Michael >=20 >=20 > On Oct 21, 2016 10:28 PM, "hiren panchasara" = wrote: > On 10/21/16 at 11:29P, Michael Tuexen wrote: > > Author: tuexen > > Date: Fri Oct 21 11:29:25 2016 > > New Revision: 307727 > > URL: https://svnweb.freebsd.org/changeset/base/307727 > > > > Log: > > Document the TCP sysctl variables insecure_rst and insecure_syn. > > > > MFC after: 1 month > > Sponsored by: netflix > > > > Modified: > > head/share/man/man4/tcp.4 > > > > Modified: head/share/man/man4/tcp.4 > > = =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/share/man/man4/tcp.4 Fri Oct 21 10:32:57 2016 = (r307726) > > +++ head/share/man/man4/tcp.4 Fri Oct 21 11:29:25 2016 = (r307727) > > @@ -34,7 +34,7 @@ > > .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 > > .\" $FreeBSD$ > > .\" > > -.Dd June 28, 2016 > > +.Dd October 21, 2016 > > .Dt TCP 4 > > .Os > > .Sh NAME > > @@ -586,6 +586,12 @@ downshift. > > List of available TCP function blocks (TCP stacks). > > .It Va functions_default > > The default TCP function block (TCP stack). > > +.It Va insecure_rst > > +Use criterias defined in RFC793 instead of RFC5961 for accepting = RST segments. >=20 > I am not a native speaker but should we s/criterias /criteria / ? > > +Default is false. > > +.It Va insecure_syn > > +Use criterias defined in RFC793 instead of RFC5961 for accepting = SYN segments. >=20 > Same. > > +Default is false. > > .El > > .Sh ERRORS > > A socket operation may fail with one of the following errors = returned: > > >=20 > Cheers, > Hiren From owner-svn-src-head@freebsd.org Fri Oct 21 18:54:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BA39C1B0EA; Fri, 21 Oct 2016 18:54:58 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 F2AF912D; Fri, 21 Oct 2016 18:54:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9LIsv82021597; Fri, 21 Oct 2016 18:54:57 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LIsv9w021596; Fri, 21 Oct 2016 18:54:57 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201610211854.u9LIsv9w021596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 21 Oct 2016 18:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307747 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 18:54:58 -0000 Author: ken Date: Fri Oct 21 18:54:56 2016 New Revision: 307747 URL: https://svnweb.freebsd.org/changeset/base/307747 Log: Fix a problem in camcontrol(8) that cropped up with r307684. In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs before sending them to the kernel because there was stack garbage in there that wound up meaning that bogus CCB flags were set. While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were failing previously), it broke the 'camcontrol rescan 0' (or any other number) case when INVARIANTS are turned on. Rescanning a single bus reliably produced an assert in cam_periph_runccb(): panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0 The flags values don't make sense from the code. Changing the CCBs in rescan_or_reset_bus() from stack to heap allocated avoids the problem. It would be better to understand why userland stack allocated CCBs don't work properly, since there may be other code that breaks if stack allocated CCBs don't work. sbin/camcontrol/camcontrol.c: In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead of on the stack to avoid an assertion in cam_periph_runccb(). MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Oct 21 18:45:09 2016 (r307746) +++ head/sbin/camcontrol/camcontrol.c Fri Oct 21 18:54:56 2016 (r307747) @@ -3127,8 +3127,8 @@ dorescan_or_reset(int argc, char **argv, static int rescan_or_reset_bus(path_id_t bus, int rescan) { - union ccb ccb, matchccb; - int fd, retval; + union ccb *ccb = NULL, *matchccb = NULL; + int fd = -1, retval; int bufsize; retval = 0; @@ -3139,37 +3139,41 @@ rescan_or_reset_bus(path_id_t bus, int r return(1); } - bzero(&ccb, sizeof(ccb)); + ccb = malloc(sizeof(*ccb)); + if (ccb == NULL) { + warn("failed to allocate CCB"); + retval = 1; + goto bailout; + } + bzero(ccb, sizeof(*ccb)); if (bus != CAM_BUS_WILDCARD) { - ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; - ccb.ccb_h.path_id = bus; - ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; - ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; - ccb.crcn.flags = CAM_FLAG_NONE; + ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; + ccb->ccb_h.path_id = bus; + ccb->ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb->ccb_h.target_lun = CAM_LUN_WILDCARD; + ccb->crcn.flags = CAM_FLAG_NONE; /* run this at a low priority */ - ccb.ccb_h.pinfo.priority = 5; + ccb->ccb_h.pinfo.priority = 5; - if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { + if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) { warn("CAMIOCOMMAND ioctl failed"); - close(fd); - return(1); + retval = 1; + goto bailout; } - if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { fprintf(stdout, "%s of bus %d was successful\n", rescan ? "Re-scan" : "Reset", bus); } else { fprintf(stdout, "%s of bus %d returned error %#x\n", rescan ? "Re-scan" : "Reset", bus, - ccb.ccb_h.status & CAM_STATUS_MASK); + ccb->ccb_h.status & CAM_STATUS_MASK); retval = 1; } - close(fd); - return(retval); - + goto bailout; } @@ -3183,58 +3187,64 @@ rescan_or_reset_bus(path_id_t bus, int r * no-op, sending a rescan to the xpt bus would result in a status of * CAM_REQ_INVALID. */ - bzero(&matchccb, sizeof(matchccb)); - matchccb.ccb_h.func_code = XPT_DEV_MATCH; - matchccb.ccb_h.path_id = CAM_BUS_WILDCARD; + matchccb = malloc(sizeof(*matchccb)); + if (matchccb == NULL) { + warn("failed to allocate CCB"); + retval = 1; + goto bailout; + } + bzero(matchccb, sizeof(*matchccb)); + matchccb->ccb_h.func_code = XPT_DEV_MATCH; + matchccb->ccb_h.path_id = CAM_BUS_WILDCARD; bufsize = sizeof(struct dev_match_result) * 20; - matchccb.cdm.match_buf_len = bufsize; - matchccb.cdm.matches=(struct dev_match_result *)malloc(bufsize); - if (matchccb.cdm.matches == NULL) { + matchccb->cdm.match_buf_len = bufsize; + matchccb->cdm.matches=(struct dev_match_result *)malloc(bufsize); + if (matchccb->cdm.matches == NULL) { warnx("can't malloc memory for matches"); retval = 1; goto bailout; } - matchccb.cdm.num_matches = 0; + matchccb->cdm.num_matches = 0; - matchccb.cdm.num_patterns = 1; - matchccb.cdm.pattern_buf_len = sizeof(struct dev_match_pattern); + matchccb->cdm.num_patterns = 1; + matchccb->cdm.pattern_buf_len = sizeof(struct dev_match_pattern); - matchccb.cdm.patterns = (struct dev_match_pattern *)malloc( - matchccb.cdm.pattern_buf_len); - if (matchccb.cdm.patterns == NULL) { + matchccb->cdm.patterns = (struct dev_match_pattern *)malloc( + matchccb->cdm.pattern_buf_len); + if (matchccb->cdm.patterns == NULL) { warnx("can't malloc memory for patterns"); retval = 1; goto bailout; } - matchccb.cdm.patterns[0].type = DEV_MATCH_BUS; - matchccb.cdm.patterns[0].pattern.bus_pattern.flags = BUS_MATCH_ANY; + matchccb->cdm.patterns[0].type = DEV_MATCH_BUS; + matchccb->cdm.patterns[0].pattern.bus_pattern.flags = BUS_MATCH_ANY; do { unsigned int i; - if (ioctl(fd, CAMIOCOMMAND, &matchccb) == -1) { + if (ioctl(fd, CAMIOCOMMAND, matchccb) == -1) { warn("CAMIOCOMMAND ioctl failed"); retval = 1; goto bailout; } - if ((matchccb.ccb_h.status != CAM_REQ_CMP) - || ((matchccb.cdm.status != CAM_DEV_MATCH_LAST) - && (matchccb.cdm.status != CAM_DEV_MATCH_MORE))) { + if ((matchccb->ccb_h.status != CAM_REQ_CMP) + || ((matchccb->cdm.status != CAM_DEV_MATCH_LAST) + && (matchccb->cdm.status != CAM_DEV_MATCH_MORE))) { warnx("got CAM error %#x, CDM error %d\n", - matchccb.ccb_h.status, matchccb.cdm.status); + matchccb->ccb_h.status, matchccb->cdm.status); retval = 1; goto bailout; } - for (i = 0; i < matchccb.cdm.num_matches; i++) { + for (i = 0; i < matchccb->cdm.num_matches; i++) { struct bus_match_result *bus_result; /* This shouldn't happen. */ - if (matchccb.cdm.matches[i].type != DEV_MATCH_BUS) + if (matchccb->cdm.matches[i].type != DEV_MATCH_BUS) continue; - bus_result = &matchccb.cdm.matches[i].result.bus_result; + bus_result =&matchccb->cdm.matches[i].result.bus_result; /* * We don't want to rescan or reset the xpt bus. @@ -3243,23 +3253,23 @@ rescan_or_reset_bus(path_id_t bus, int r if (bus_result->path_id == CAM_XPT_PATH_ID) continue; - ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : + ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; - ccb.ccb_h.path_id = bus_result->path_id; - ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; - ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; - ccb.crcn.flags = CAM_FLAG_NONE; + ccb->ccb_h.path_id = bus_result->path_id; + ccb->ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb->ccb_h.target_lun = CAM_LUN_WILDCARD; + ccb->crcn.flags = CAM_FLAG_NONE; /* run this at a low priority */ - ccb.ccb_h.pinfo.priority = 5; + ccb->ccb_h.pinfo.priority = 5; - if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { + if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) { warn("CAMIOCOMMAND ioctl failed"); retval = 1; goto bailout; } - if ((ccb.ccb_h.status & CAM_STATUS_MASK) ==CAM_REQ_CMP){ + if ((ccb->ccb_h.status & CAM_STATUS_MASK)==CAM_REQ_CMP){ fprintf(stdout, "%s of bus %d was successful\n", rescan? "Re-scan" : "Reset", bus_result->path_id); @@ -3272,22 +3282,24 @@ rescan_or_reset_bus(path_id_t bus, int r fprintf(stderr, "%s of bus %d returned error " "%#x\n", rescan? "Re-scan" : "Reset", bus_result->path_id, - ccb.ccb_h.status & CAM_STATUS_MASK); + ccb->ccb_h.status & CAM_STATUS_MASK); retval = 1; } } - } while ((matchccb.ccb_h.status == CAM_REQ_CMP) - && (matchccb.cdm.status == CAM_DEV_MATCH_MORE)); + } while ((matchccb->ccb_h.status == CAM_REQ_CMP) + && (matchccb->cdm.status == CAM_DEV_MATCH_MORE)); bailout: if (fd != -1) close(fd); - if (matchccb.cdm.patterns != NULL) - free(matchccb.cdm.patterns); - if (matchccb.cdm.matches != NULL) - free(matchccb.cdm.matches); + if (matchccb != NULL) { + free(matchccb->cdm.patterns); + free(matchccb->cdm.matches); + free(matchccb); + } + free(ccb); return(retval); } From owner-svn-src-head@freebsd.org Fri Oct 21 20:17:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3277EC1CAEC; Fri, 21 Oct 2016 20:17: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 mx1.freebsd.org (Postfix) with ESMTPS id DE828AF2; Fri, 21 Oct 2016 20:17:20 +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 u9LKHKSo051626; Fri, 21 Oct 2016 20:17:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LKHJow051623; Fri, 21 Oct 2016 20:17:19 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201610212017.u9LKHJow051623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 21 Oct 2016 20:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307752 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 20:17:21 -0000 Author: asomers Date: Fri Oct 21 20:17:19 2016 New Revision: 307752 URL: https://svnweb.freebsd.org/changeset/base/307752 Log: Close some file descriptor leaks in pw MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8245 Modified: head/usr.sbin/pw/grupd.c head/usr.sbin/pw/pw_nis.c head/usr.sbin/pw/pwupd.c Modified: head/usr.sbin/pw/grupd.c ============================================================================== --- head/usr.sbin/pw/grupd.c Fri Oct 21 19:44:09 2016 (r307751) +++ head/usr.sbin/pw/grupd.c Fri Oct 21 20:17:19 2016 (r307752) @@ -34,6 +34,7 @@ static const char rcsid[] = #include #include #include +#include #include "pwupd.h" @@ -73,8 +74,10 @@ gr_update(struct group * grp, char const } if (gr_copy(pfd, tfd, gr, old_gr) == -1) { gr_fini(); + close(tfd); err(1, "gr_copy()"); } + close(tfd); if (gr_mkdb() == -1) { gr_fini(); err(1, "gr_mkdb()"); Modified: head/usr.sbin/pw/pw_nis.c ============================================================================== --- head/usr.sbin/pw/pw_nis.c Fri Oct 21 19:44:09 2016 (r307751) +++ head/usr.sbin/pw/pw_nis.c Fri Oct 21 20:17:19 2016 (r307752) @@ -34,6 +34,7 @@ static const char rcsid[] = #include #include #include +#include #include "pw.h" @@ -63,8 +64,10 @@ pw_nisupdate(const char * path, struct p } if (pw_copy(pfd, tfd, pw, old_pw) == -1) { pw_fini(); + close(tfd); err(1, "pw_copy()"); } + close(tfd); if (chmod(pw_tempname(), 0644) == -1) err(1, "chmod()"); if (rename(pw_tempname(), path) == -1) Modified: head/usr.sbin/pw/pwupd.c ============================================================================== --- head/usr.sbin/pw/pwupd.c Fri Oct 21 19:44:09 2016 (r307751) +++ head/usr.sbin/pw/pwupd.c Fri Oct 21 20:17:19 2016 (r307752) @@ -111,8 +111,10 @@ pw_update(struct passwd * pwd, char cons } if (pw_copy(pfd, tfd, pw, old_pw) == -1) { pw_fini(); + close(tfd); err(1, "pw_copy()"); } + close(tfd); /* * in case of deletion of a user, the whole database * needs to be regenerated From owner-svn-src-head@freebsd.org Fri Oct 21 20:36:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24DC5C1C117; Fri, 21 Oct 2016 20:36:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8DF09FB; Fri, 21 Oct 2016 20:36:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-qt0-x234.google.com with SMTP id m5so95772792qtb.3; Fri, 21 Oct 2016 13:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Jdd66SUYt7qgdg+FLVUXV1F4mrrOfnHbxDpIY4CzZq0=; b=UZ3sot7UsyTtElAIn3iASYMb3lIOdrotkmMckXislJX/i5C7DSA95DYPNhskyVodg5 eu46xiCcJ72dKigMfFKETV3tvDLJEAN6C9fhEcvPbD+mNBmbxxTD/02Kepor8Yv0Swgl 5UPPKL5xtvBMou4Zgmo26d2NAJot/1+SxVnbBvuJ9PUasjF00POJ8eZLaiX3JUEZ7uTm r4SBeUFa/KvW2rGbJnmORmbnbi6frzG2/OKLHcGw96LeARovI3cut4bDL0lp5vLOzKL1 YsLdoaXk16ZXDtH4gLjh1To0XxJ58xdXdyJMfPa2WyXr7o9C5HK+GQuZGB8gfBCq5Wiw wGzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Jdd66SUYt7qgdg+FLVUXV1F4mrrOfnHbxDpIY4CzZq0=; b=m0LScM8YWqZRJg+O0B+SgpWWJFBsrcbwSQjFORzhCrZ3q/HZO/XmRTPOmoQ/v+K0Gz xnvPlEcS9GIUWPfS22+lBogzx6uCOd1b5rchG5fGt+csMo/w6p/v1/8ANIATVqyGGcBR MZTG4OWAuHJr99hfwOUgzjE6I5B0F2VZ9NFrUPygTyFhYiE6BBrAHF/5AkZ9/kFEtpZl K+wXkk6fih/WcxNqh0YsAeQG9SR9QJdi/pyeidTzd6xeDuWvqWmTQ26N+3Ycqocw4E4Y RTtXC1dWcGaTJeWJ6YJDWYQf9FpKpf6qsNnAUfBX28sC9EGTubEtPNH13xGuk/8Sykhc kUBQ== X-Gm-Message-State: ABUngvcjWPySIm7Y4bYfpG/Tf2Eipvpm2Ryz6+B2HK50ctxfWrgMvFFu2geiVyELiYrYn+cw+Q0GmDESPOxUEw== X-Received: by 10.200.51.20 with SMTP id t20mr3354449qta.48.1477082193870; Fri, 21 Oct 2016 13:36:33 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.12.138.251 with HTTP; Fri, 21 Oct 2016 13:36:33 -0700 (PDT) In-Reply-To: <201610132306.u9DN6Aod023917@gw.catspoiler.org> References: <201610132306.u9DN6Aod023917@gw.catspoiler.org> From: Alan Somers Date: Fri, 21 Oct 2016 14:36:33 -0600 X-Google-Sender-Auth: kgwL3LL6ir1A0sjogb3Ffc-5Xic Message-ID: Subject: Re: svn commit: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb To: Don Lewis Cc: Renato Botelho , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 20:36:35 -0000 On Thu, Oct 13, 2016 at 5:06 PM, Don Lewis wrote: > On 13 Oct, Alan Somers wrote: >> On Thu, Jul 2, 2015 at 11:31 AM, Renato Botelho wrote: >>> Author: garga (ports committer) >>> Date: Thu Jul 2 17:30:59 2015 >>> New Revision: 285050 >>> URL: https://svnweb.freebsd.org/changeset/base/285050 >>> >>> Log: >>> When passwd or group information is changed (by pw, vipw, chpass, ...) >>> temporary file is created and then a rename() call move it to official file. >>> This operation didn't have any check to make sure data was written to disk >>> and if a power cycle happens system could end up with a 0 length passwd >>> or group database. >>> >>> There is a pfSense bug with more infor about it: >>> >>> https://redmine.pfsense.org/issues/4523 >>> >>> The following changes were made to protect passwd and group operations: >>> >>> * lib/libutil/gr_util.c: >>> - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file >>> - After rename(), fsync() call on directory for faster result >>> >>> * lib/libutil/pw_util.c >>> - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file >>> >>> * usr.sbin/pwd_mkdb/pwd_mkdb.c >>> - Added O_SYNC flag on dbopen() calls >>> - After rename(), fsync() call on directory for faster result >>> >>> * lib/libutil/pw_util.3 >>> - pw_lock() returns a file descriptor to master password file on success >>> >>> Differential Revision: https://reviews.freebsd.org/D2978 >>> Approved by: bapt >>> Sponsored by: Netgate >>> >>> Modified: >>> head/lib/libutil/gr_util.c >>> head/lib/libutil/pw_util.3 >>> head/lib/libutil/pw_util.c >>> head/usr.sbin/pwd_mkdb/pwd_mkdb.c >> >> This change is making certain pw operations very slow on ZFS root >> systems. The problem is that when you open a file with O_SYNC, every >> single write(2) call turns into a zil_commit on ZFS, which is fairly >> expensive. Did you consider using fsync(2) on the temporary files >> instead of opening them with O_SYNC? I just tried that now, and I see >> a considerable speedup when running the tests in >> /usr/tests/usr.sbin/pw: >> >> Using O_SYNC, as CURRENT does: 4 minutes 5.2 seconds >> No synchronous operations at all: 49.5 seconds >> Using fsync(2): 56.0 seconds > > pwd_mkdb was fixed back in February with by switching to fsync() in > r295925. It looks like libutil was not fixed, though. https://reviews.freebsd.org/D8319 From owner-svn-src-head@freebsd.org Fri Oct 21 21:52:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D3FC1B4F8; Fri, 21 Oct 2016 21:52:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 306E519E; Fri, 21 Oct 2016 21:52:23 +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 u9LLqM1N089306; Fri, 21 Oct 2016 21:52:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LLqMGf089305; Fri, 21 Oct 2016 21:52:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201610212152.u9LLqMGf089305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 21 Oct 2016 21:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307754 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 21:52:23 -0000 Author: dim Date: Fri Oct 21 21:52:22 2016 New Revision: 307754 URL: https://svnweb.freebsd.org/changeset/base/307754 Log: Fix building of many ports that use make from base, such as devel/apr1, after r307676, which added transformation rules for .llo and .bco files. These suffixes also have to be added the the global .SUFFIXES target, otherwise the various suffix-transformation rules would be interpreted as literal targets. E.g., .c.bco: ... commands ... would actually to build a file named ".c.bco". Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Oct 21 20:31:52 2016 (r307753) +++ head/share/mk/sys.mk Fri Oct 21 21:52:22 2016 (r307754) @@ -121,7 +121,7 @@ META_MODE?= normal .if defined(%POSIX) .SUFFIXES: .o .c .y .l .a .sh .f .else -.SUFFIXES: .out .a .ln .o .c .cc .cpp .cxx .C .m .F .f .e .r .y .l .S .asm .s .cl .p .h .sh +.SUFFIXES: .out .a .ln .o .bco .llo .c .cc .cpp .cxx .C .m .F .f .e .r .y .l .S .asm .s .cl .p .h .sh .endif AR ?= ar From owner-svn-src-head@freebsd.org Fri Oct 21 21:55:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1DB0C1B6BD; Fri, 21 Oct 2016 21:55:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 945CD895; Fri, 21 Oct 2016 21:55:51 +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 u9LLtoTq089477; Fri, 21 Oct 2016 21:55:50 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LLtoAW089474; Fri, 21 Oct 2016 21:55:50 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201610212155.u9LLtoAW089474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 21 Oct 2016 21:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307755 - in head: etc/rc.d sbin/swapon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 21:55:52 -0000 Author: jilles Date: Fri Oct 21 21:55:50 2016 New Revision: 307755 URL: https://svnweb.freebsd.org/changeset/base/307755 Log: swapoff: Remove only late devices with -aL. Currently, '/etc/rc.d/swaplate stop' removes all swap devices. This can be very slow and may not even be possible if there is a lot of swap space in use. However, removing swap devices is only needed for late swap devices that may depend on daemons that subsequent shutdown steps stop. Normal swap devices such as hard disk partitions will remain available throughout the shutdown process and need not be removed. In swapoff, interpret -aL to remove late swap devices only, and use this in etc/rc.d/swaplate. The meaning of -aL in swapon remains unchanged (add all swap devices, both normal and late). PR: 187081 Reviewed by: wblock (man page only), ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8126 Modified: head/etc/rc.d/swaplate head/sbin/swapon/swapon.8 head/sbin/swapon/swapon.c Modified: head/etc/rc.d/swaplate ============================================================================== --- head/etc/rc.d/swaplate Fri Oct 21 21:52:22 2016 (r307754) +++ head/etc/rc.d/swaplate Fri Oct 21 21:55:50 2016 (r307755) @@ -12,7 +12,7 @@ name="swaplate" desc="Setup late swap space" start_cmd='/sbin/swapon -aLq' -stop_cmd='/sbin/swapoff -aq' +stop_cmd='/sbin/swapoff -aLq' load_rc_config swap run_rc_command "$1" Modified: head/sbin/swapon/swapon.8 ============================================================================== --- head/sbin/swapon/swapon.8 Fri Oct 21 21:52:22 2016 (r307754) +++ head/sbin/swapon/swapon.8 Fri Oct 21 21:55:50 2016 (r307755) @@ -28,7 +28,7 @@ .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 2, 2016 +.Dd October 21, 2016 .Dt SWAPON 8 .Os .Sh NAME @@ -98,6 +98,12 @@ will be removed, unless their .Dq noauto option is also set. If the +.Fl L +option is specified, +only swap devices with the +.Dq late +option will be removed. +If the .Fl q option is used, informational messages will not be Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Fri Oct 21 21:52:22 2016 (r307754) +++ head/sbin/swapon/swapon.c Fri Oct 21 21:55:50 2016 (r307755) @@ -176,6 +176,10 @@ main(int argc, char **argv) strstr(fsp->fs_mntops, "late") && late == 0) continue; + if (which_prog == SWAPOFF && + strstr(fsp->fs_mntops, "late") == NULL && + late != 0) + continue; swfile = swap_on_off(fsp->fs_spec, 1, fsp->fs_mntops); if (swfile == NULL) { From owner-svn-src-head@freebsd.org Fri Oct 21 22:05:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25729C1B8F8; Fri, 21 Oct 2016 22:05:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03E5ED53; Fri, 21 Oct 2016 22:05:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9CD6F10AF92; Fri, 21 Oct 2016 18:05:24 -0400 (EDT) From: John Baldwin To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307731 - in head: sys/dev/pci usr.sbin/pciconf Date: Fri, 21 Oct 2016 14:50:44 -0700 Message-ID: <3693422.knNeE0iEO3@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201610211523.u9LFNsae041189@repo.freebsd.org> References: <201610211523.u9LFNsae041189@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 21 Oct 2016 18:05:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 22:05:26 -0000 On Friday, October 21, 2016 03:23:54 PM Alexander Motin wrote: > Author: mav > Date: Fri Oct 21 15:23:54 2016 > New Revision: 307731 > URL: https://svnweb.freebsd.org/changeset/base/307731 > > Log: > Add names for some DASP devices. > > Submitted by: Dmitry Luhtionov > MFC after: 1 week We should perhaps move the class/subclass description table into a header file that can be included in both places rather than duplicated. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Oct 21 23:50:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8FC6C1CD65; Fri, 21 Oct 2016 23:50:03 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9DC4C19B; Fri, 21 Oct 2016 23:50:03 +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 u9LNo2dW031677; Fri, 21 Oct 2016 23:50:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9LNo2PT031675; Fri, 21 Oct 2016 23:50:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610212350.u9LNo2PT031675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 21 Oct 2016 23:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307756 - in head: include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 23:50:04 -0000 Author: jhb Date: Fri Oct 21 23:50:02 2016 New Revision: 307756 URL: https://svnweb.freebsd.org/changeset/base/307756 Log: Define max_align_t for C11. libc++'s stddef.h includes an existing definition of max_align_t for C++11, but it is only defined for C++, not for C. In addition, GCC and clang both define an alternate version of max_align_t that uses a union of multiple types rather than a plain long double as in libc++. This adds a __max_align_t to that matches the GCC and clang definition that is mapped to max_align_t in . PR: 210890 Reviewed by: dim MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8194 Modified: head/include/stddef.h head/sys/sys/_types.h Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Fri Oct 21 21:55:50 2016 (r307755) +++ head/include/stddef.h Fri Oct 21 23:50:02 2016 (r307756) @@ -62,6 +62,14 @@ typedef ___wchar_t wchar_t; #endif #endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#ifndef __CLANG_MAX_ALIGN_T_DEFINED +typedef __max_align_t max_align_t; +#define __CLANG_MAX_ALIGN_T_DEFINED +#define __GCC_MAX_ALIGN_T +#endif +#endif + #define offsetof(type, member) __offsetof(type, member) #endif /* _STDDEF_H_ */ Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Fri Oct 21 21:55:50 2016 (r307755) +++ head/sys/sys/_types.h Fri Oct 21 23:50:02 2016 (r307756) @@ -100,6 +100,11 @@ typedef __uint_least32_t __char32_t; #define _CHAR32_T_DECLARED #endif +typedef struct { + long long __max_align1 __aligned(_Alignof(long long)); + long double __max_align2 __aligned(_Alignof(long double)); +} __max_align_t; + typedef __uint32_t __dev_t; /* device number */ typedef __uint32_t __fixpt_t; /* fixed point number */ From owner-svn-src-head@freebsd.org Sat Oct 22 00:06:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15BBC1C50F; Sat, 22 Oct 2016 00:06:44 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 907ADE3A; Sat, 22 Oct 2016 00:06:44 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 3318B5A9F27; Sat, 22 Oct 2016 00:00:56 +0000 (UTC) Date: Sat, 22 Oct 2016 00:00:56 +0000 From: Brooks Davis To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307756 - in head: include sys/sys Message-ID: <20161022000056.GC95989@spindle.one-eyed-alien.net> References: <201610212350.u9LNo2PT031675@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <201610212350.u9LNo2PT031675@repo.freebsd.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 00:06:44 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2016 at 11:50:02PM +0000, John Baldwin wrote: > Author: jhb > Date: Fri Oct 21 23:50:02 2016 > New Revision: 307756 > URL: https://svnweb.freebsd.org/changeset/base/307756 >=20 > Log: > Define max_align_t for C11. > =20 > libc++'s stddef.h includes an existing definition of max_align_t for > C++11, but it is only defined for C++, not for C. In addition, GCC and > clang both define an alternate version of max_align_t that uses a > union of multiple types rather than a plain long double as in libc++. > This adds a __max_align_t to that matches the GCC and > clang definition that is mapped to max_align_t in . > =20 > PR: 210890 > Reviewed by: dim > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D8194 >=20 > Modified: > head/include/stddef.h > head/sys/sys/_types.h >=20 > Modified: head/include/stddef.h > =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/include/stddef.h Fri Oct 21 21:55:50 2016 (r307755) > +++ head/include/stddef.h Fri Oct 21 23:50:02 2016 (r307756) > @@ -62,6 +62,14 @@ typedef ___wchar_t wchar_t; > #endif > #endif > =20 > +#if __STDC_VERSION__ >=3D 201112L || __cplusplus >=3D 201103L > +#ifndef __CLANG_MAX_ALIGN_T_DEFINED > +typedef __max_align_t max_align_t; > +#define __CLANG_MAX_ALIGN_T_DEFINED > +#define __GCC_MAX_ALIGN_T > +#endif > +#endif > + > #define offsetof(type, member) __offsetof(type, member) > =20 > #endif /* _STDDEF_H_ */ >=20 > Modified: head/sys/sys/_types.h > =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/sys/sys/_types.h Fri Oct 21 21:55:50 2016 (r307755) > +++ head/sys/sys/_types.h Fri Oct 21 23:50:02 2016 (r307756) > @@ -100,6 +100,11 @@ typedef __uint_least32_t __char32_t; > #define _CHAR32_T_DECLARED > #endif > =20 > +typedef struct { Should this be union per the commit message? Ideally I'd add a void * as well since that will support systems like CHERI where pointers are the largest type. -- Brooks > + long long __max_align1 __aligned(_Alignof(long long)); > + long double __max_align2 __aligned(_Alignof(long double)); > +} __max_align_t; > + > typedef __uint32_t __dev_t; /* device number */ > =20 > typedef __uint32_t __fixpt_t; /* fixed point number */ >=20 --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYCqw3AAoJEKzQXbSebgfAFIYH/2VgcVD8iQ3ZJl1tvwQ1kkGr 6B1SfJbQGYWflM+I9kK640vKr7pLgVDtVuiNVFIbp4046b/i2Sj8c0T9Cx+epKw9 0YHI+7GeT67JHFX5YBQFuzTBkyIiYGFPGy8uh5bkN56iUJmS9Swx1ncgVz2zG3jA RnM2f3i+lr1PoD6aycPiWAuL/ppQy4XL9I8rSzi5DxQZKPQiO1J5sizEYhGi7zip tofEKf1eb5ofqNDVjnBNyyrYa3KYqjXIYFEdWe0qv9eM1d17ENL9wa1VpJegx5Eb 2x9HlLO0v9l/OEYSDLLQrNvyL84tus7obA1drki5qEEjkZvZuQwrU6+uNNi+CLc= =5rhX -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7-- From owner-svn-src-head@freebsd.org Sat Oct 22 00:48:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A468C1CBEC; Sat, 22 Oct 2016 00:48:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 515BA266; Sat, 22 Oct 2016 00:48:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9M0mwRi054324; Sat, 22 Oct 2016 00:48:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9M0mwmI054323; Sat, 22 Oct 2016 00:48:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201610220048.u9M0mwmI054323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 22 Oct 2016 00:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307759 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 00:48:59 -0000 Author: np Date: Sat Oct 22 00:48:58 2016 New Revision: 307759 URL: https://svnweb.freebsd.org/changeset/base/307759 Log: cxgbe(4): Dump any mailbox command that times out. Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sat Oct 22 00:38:47 2016 (r307758) +++ head/sys/dev/cxgbe/common/t4_hw.c Sat Oct 22 00:48:58 2016 (r307759) @@ -432,6 +432,21 @@ int t4_wr_mbox_meat_timeout(struct adapt CH_ERR(adap, "command %#x in mailbox %d timed out\n", *(const u8 *)cmd, mbox); + /* If DUMP_MBOX is set the mbox has already been dumped */ + if ((adap->debug_flags & DF_DUMP_MBOX) == 0) { + p = cmd; + CH_ERR(adap, "mbox: %016llx %016llx %016llx %016llx " + "%016llx %016llx %016llx %016llx\n", + (unsigned long long)be64_to_cpu(p[0]), + (unsigned long long)be64_to_cpu(p[1]), + (unsigned long long)be64_to_cpu(p[2]), + (unsigned long long)be64_to_cpu(p[3]), + (unsigned long long)be64_to_cpu(p[4]), + (unsigned long long)be64_to_cpu(p[5]), + (unsigned long long)be64_to_cpu(p[6]), + (unsigned long long)be64_to_cpu(p[7])); + } + t4_report_fw_error(adap); t4_fatal_err(adap); return ret; From owner-svn-src-head@freebsd.org Sat Oct 22 01:57:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FDD4C1BC14; Sat, 22 Oct 2016 01:57:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id C0E31125; Sat, 22 Oct 2016 01:57:19 +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 u9M1vIR4080364; Sat, 22 Oct 2016 01:57:18 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9M1vFXx080331; Sat, 22 Oct 2016 01:57:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610220157.u9M1vFXx080331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Oct 2016 01:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307761 - in head: . contrib/binutils/bfd contrib/gcc/config/rs6000 gnu/lib/libgcc gnu/lib/libgomp gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/cc/cc_tools gnu/usr.bin/cc/include gnu... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 01:57:20 -0000 Author: jhibbits Date: Sat Oct 22 01:57:15 2016 New Revision: 307761 URL: https://svnweb.freebsd.org/changeset/base/307761 Log: Create a new MACHINE_ARCH for Freescale PowerPC e500v2 Summary: The Freescale e500v2 PowerPC core does not use a standard FPU. Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this. Additionaly, the SPE opcodes overlap with Altivec, so these are mutually exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was created with the same function set as in powerpc/powerpc/altivec.c, so it becomes effectively a drop-in replacement. setjmp/longjmp were modified to save the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by the SPE). Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not support double-precision floating point. Also, without a new MACHINE_ARCH it would be impossible to provide binary packages which utilize the SPE. Additionally, no work has been done to support ports, work is needed for this. This also means no newer gcc can yet be used. However, gcc's powerpc support has been refactored which would make adding a powerpcspe-freebsd target very easy. Test Plan: This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222 (P1022-based) board, compiled against the new ABI. Base system utilities (/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot multiuser. Reviewed By: bdrewery, imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D5683 Added: head/contrib/gcc/config/rs6000/freebsdspe.h (contents, props changed) head/lib/libc/powerpcspe/ head/lib/libc/powerpcspe/Makefile.inc (contents, props changed) head/lib/libc/powerpcspe/SYS.h (contents, props changed) head/lib/libc/powerpcspe/Symbol.map (contents, props changed) head/lib/libc/powerpcspe/_fpmath.h (contents, props changed) head/lib/libc/powerpcspe/arith.h (contents, props changed) head/lib/libc/powerpcspe/gd_qnan.h (contents, props changed) head/lib/libc/powerpcspe/gen/ head/lib/libc/powerpcspe/gen/Makefile.inc (contents, props changed) head/lib/libc/powerpcspe/gen/_ctx_start.S (contents, props changed) head/lib/libc/powerpcspe/gen/_set_tp.c (contents, props changed) head/lib/libc/powerpcspe/gen/_setjmp.S (contents, props changed) head/lib/libc/powerpcspe/gen/eabi.S (contents, props changed) head/lib/libc/powerpcspe/gen/fabs.S (contents, props changed) head/lib/libc/powerpcspe/gen/flt_rounds.c (contents, props changed) head/lib/libc/powerpcspe/gen/fpgetmask.c (contents, props changed) head/lib/libc/powerpcspe/gen/fpgetround.c (contents, props changed) head/lib/libc/powerpcspe/gen/fpgetsticky.c (contents, props changed) head/lib/libc/powerpcspe/gen/fpsetmask.c (contents, props changed) head/lib/libc/powerpcspe/gen/fpsetround.c (contents, props changed) head/lib/libc/powerpcspe/gen/infinity.c (contents, props changed) head/lib/libc/powerpcspe/gen/makecontext.c (contents, props changed) head/lib/libc/powerpcspe/gen/setjmp.S (contents, props changed) head/lib/libc/powerpcspe/gen/signalcontext.c (contents, props changed) head/lib/libc/powerpcspe/gen/sigsetjmp.S (contents, props changed) head/lib/libc/powerpcspe/gen/syncicache.c (contents, props changed) head/lib/libc/powerpcspe/softfloat/ head/lib/libc/powerpcspe/softfloat/milieu.h (contents, props changed) head/lib/libc/powerpcspe/softfloat/powerpc-gcc.h (contents, props changed) head/lib/libc/powerpcspe/softfloat/softfloat.h (contents, props changed) head/lib/libc/powerpcspe/sys/ head/lib/libc/powerpcspe/sys/Makefile.inc (contents, props changed) head/lib/libc/powerpcspe/sys/brk.S (contents, props changed) head/lib/libc/powerpcspe/sys/cerror.S (contents, props changed) head/lib/libc/powerpcspe/sys/exect.S (contents, props changed) head/lib/libc/powerpcspe/sys/ptrace.S (contents, props changed) head/lib/libc/powerpcspe/sys/sbrk.S (contents, props changed) head/lib/libc/powerpcspe/sys/setlogin.S (contents, props changed) head/sys/conf/ldscript.powerpcspe (contents, props changed) head/sys/powerpc/booke/spe.c (contents, props changed) head/sys/powerpc/conf/MPC85XXSPE (contents, props changed) Modified: head/Makefile head/Makefile.inc1 head/contrib/binutils/bfd/config.bfd head/gnu/lib/libgcc/Makefile head/gnu/lib/libgomp/Makefile head/gnu/usr.bin/binutils/Makefile.inc0 head/gnu/usr.bin/cc/Makefile.tgt head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs head/gnu/usr.bin/cc/include/Makefile head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/libgdb/Makefile head/lib/libarchive/Makefile head/lib/msun/powerpc/fenv.h head/share/mk/bsd.cpu.mk head/share/mk/bsd.endian.mk head/share/mk/local.meta.sys.mk head/share/mk/sys.mk head/sys/boot/powerpc/Makefile head/sys/conf/Makefile.powerpc head/sys/conf/files.powerpc head/sys/conf/kern.mk head/sys/conf/options.powerpc head/sys/modules/Makefile head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/include/param.h head/sys/powerpc/include/spr.h head/sys/powerpc/include/trap.h head/sys/powerpc/powerpc/trap.c head/usr.sbin/Makefile.powerpc Modified: head/Makefile ============================================================================== --- head/Makefile Sat Oct 22 01:38:21 2016 (r307760) +++ head/Makefile Sat Oct 22 01:57:15 2016 (r307761) @@ -239,7 +239,7 @@ _MAKE+= MK_META_MODE=no _TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} -_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/} +_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/powerpcspe/powerpc/:C/riscv64/riscv/} .endif .if defined(TARGET) && !defined(_TARGET) _TARGET=${TARGET} @@ -422,7 +422,7 @@ _UNIVERSE_TARGETS= ${TARGETS} TARGET_ARCHES_arm?= arm armeb armv6 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 -TARGET_ARCHES_powerpc?= powerpc powerpc64 +TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe TARGET_ARCHES_pc98?= i386 .for target in ${TARGETS} TARGET_ARCHES_${target}?= ${target} Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Oct 22 01:38:21 2016 (r307760) +++ head/Makefile.inc1 Sat Oct 22 01:57:15 2016 (r307761) @@ -358,6 +358,7 @@ KNOWN_ARCHES?= aarch64/arm64 \ mipsn32/mips \ powerpc \ powerpc64/powerpc \ + powerpcspe/powerpc \ riscv64/riscv \ sparc64 Modified: head/contrib/binutils/bfd/config.bfd ============================================================================== --- head/contrib/binutils/bfd/config.bfd Sat Oct 22 01:38:21 2016 (r307760) +++ head/contrib/binutils/bfd/config.bfd Sat Oct 22 01:57:15 2016 (r307761) @@ -1103,7 +1103,7 @@ case "${targ}" in want64=true ;; #endif - powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ + powerpc-*-*bsd* | powerpcspe-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \ powerpc-*-chorus*) targ_defvec=bfd_elf32_powerpc_vec Added: head/contrib/gcc/config/rs6000/freebsdspe.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/rs6000/freebsdspe.h Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,77 @@ +/* Definitions of target machine for GNU compiler, + for PowerPC e500 machines running FreeBSD. + Based on linuxspe.h + Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Contributed by Aldy Hernandez (aldy@quesejoda.com). + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (PowerPC E500 FreeBSD)"); + +/* Override rs6000.h and sysv4.h definition. */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN) + +#undef TARGET_SPE_ABI +#undef TARGET_SPE +#undef TARGET_E500 +#undef TARGET_ISEL +#undef TARGET_FPRS +#undef TARGET_E500_SINGLE +#undef TARGET_E500_DOUBLE + +#define TARGET_SPE_ABI rs6000_spe_abi +#define TARGET_SPE rs6000_spe +#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) +#define TARGET_ISEL rs6000_isel +#define TARGET_FPRS (rs6000_float_gprs == 0) +#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1) +#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2) + +#undef SUBSUBTARGET_OVERRIDE_OPTIONS +#define SUBSUBTARGET_OVERRIDE_OPTIONS \ + if (rs6000_select[1].string == NULL) \ + rs6000_cpu = PROCESSOR_PPC8540; \ + if (!rs6000_explicit_options.abi) \ + rs6000_spe_abi = 1; \ + if (!rs6000_explicit_options.float_gprs) \ + rs6000_float_gprs = 1; \ + /* See note below. */ \ + /*if (!rs6000_explicit_options.long_double)*/ \ + /* rs6000_long_double_type_size = 128;*/ \ + if (!rs6000_explicit_options.spe) \ + rs6000_spe = 1; \ + if (!rs6000_explicit_options.isel) \ + rs6000_isel = 1; \ + if (target_flags & MASK_64BIT) \ + error ("-m64 not supported in this configuration") + +/* The e500 ABI says that either long doubles are 128 bits, or if + implemented in any other size, the compiler/linker should error out. + We have no emulation libraries for 128 bit long doubles, and I hate + the dozens of failures on the regression suite. So I'm breaking ABI + specifications, until I properly fix the emulation. + + Enable these later. +#undef CPP_LONGDOUBLE_DEFAULT_SPEC +#define CPP_LONGDOUBLE_DEFAULT_SPEC "-D__LONG_DOUBLE_128__=1" +*/ + +#undef ASM_DEFAULT_SPEC +#define ASM_DEFAULT_SPEC "-mppc -mspe -me500" Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/lib/libgcc/Makefile Sat Oct 22 01:57:15 2016 (r307761) @@ -173,7 +173,7 @@ LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c .endif .endif -.if ${TARGET_ARCH} == "powerpc" +.if ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpcspe" # from config/rs6000/t-ppccomm LIB2FUNCS_EXTRA = tramp.asm LIB2FUNCS_STATIC_EXTRA = eabi.asm Modified: head/gnu/lib/libgomp/Makefile ============================================================================== --- head/gnu/lib/libgomp/Makefile Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/lib/libgomp/Makefile Sat Oct 22 01:57:15 2016 (r307761) @@ -24,7 +24,7 @@ VERSION_MAP= ${SRCDIR}/libgomp.map # Target-specific OpenMP configuration .if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \ - ${MACHINE_ARCH} == powerpc || \ + ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == powerpcspe || \ (${MACHINE_CPUARCH} == mips && ${MACHINE_ARCH:Mmips64*} == "") OMP_LOCK_ALIGN = 4 OMP_LOCK_KIND= 4 Modified: head/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- head/gnu/usr.bin/binutils/Makefile.inc0 Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/usr.bin/binutils/Makefile.inc0 Sat Oct 22 01:57:15 2016 (r307761) @@ -7,7 +7,7 @@ VERSION= "2.17.50 [FreeBSD] 2007-07-03" .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif @@ -30,7 +30,7 @@ RELSRC= ${RELTOP}/../../../contrib/binut SRCDIR= ${.CURDIR}/${RELSRC} .if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \ - ${TARGET_ARCH} == "powerpc" || \ + ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpcspe" || \ (${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips64*} == "") CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 .else Modified: head/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- head/gnu/usr.bin/cc/Makefile.tgt Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/usr.bin/cc/Makefile.tgt Sat Oct 22 01:57:15 2016 (r307761) @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64spe)/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs Sat Oct 22 01:57:15 2016 (r307761) @@ -46,6 +46,10 @@ TARGET_INC+= ${GCC_CPU}/bpabi.h TARGET_INC+= ${GCC_CPU}/biarch64.h TARGET_INC+= ${GCC_CPU}/default64.h .endif +.if ${TARGET_ARCH} == "powerpcspe" +TARGET_INC+= ${GCC_CPU}/freebsdspe.h +TARGET_INC+= ${GCC_CPU}/e500-double.h +.endif TARGET_INC+= ${GCC_CPU}/freebsd.h .if ${TARGET_CPUARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/freebsd64.h Modified: head/gnu/usr.bin/cc/include/Makefile ============================================================================== --- head/gnu/usr.bin/cc/include/Makefile Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/usr.bin/cc/include/Makefile Sat Oct 22 01:57:15 2016 (r307761) @@ -14,7 +14,8 @@ INCS= ammintrin.h emmintrin.h mmintrin.h INCS+= wmmintrin.h __wmmintrin_aes.h __wmmintrin_pclmul.h .elif ${TARGET_ARCH} == "arm" INCS= mmintrin.h -.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" +.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" || \ + ${TARGET_ARCH} == "powerpcspe" INCS= ppc-asm.h altivec.h spe.h .endif Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/usr.bin/gdb/Makefile.inc Sat Oct 22 01:57:15 2016 (r307761) @@ -23,7 +23,7 @@ OBJ_RL= ${OBJ_ROOT}/../lib/libreadline/r # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/gdb/libgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/libgdb/Makefile Sat Oct 22 01:38:21 2016 (r307760) +++ head/gnu/usr.bin/gdb/libgdb/Makefile Sat Oct 22 01:57:15 2016 (r307761) @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Sat Oct 22 01:38:21 2016 (r307760) +++ head/lib/libarchive/Makefile Sat Oct 22 01:57:15 2016 (r307761) @@ -30,7 +30,7 @@ SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_IC .endif .if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \ - ${MACHINE_ARCH:Msparc64*} != "" + ${MACHINE_ARCH:Msparc64*} != "" || ${MACHINE_ARCH:Mpowerpc*} != "" NO_WCAST_ALIGN= yes .if ${MACHINE_ARCH:M*64*} == "" CFLAGS+= -DPPMD_32BIT Added: head/lib/libc/powerpcspe/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/Makefile.inc Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +SRCS+= trivial-vdso_tc.c + +# Long double is 64-bits +MDSRCS+=machdep_ldisd.c +SYM_MAPS+=${LIBC_SRCTOP}/powerpcspe/Symbol.map Added: head/lib/libc/powerpcspe/SYS.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/SYS.h Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 2002 Benno Rice. All rights reserved. + * Copyright (c) 2002 David E. O'Brien. 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 author nor the names of any contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 REGENTS 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. + * + * $NetBSD: SYS.h,v 1.8 2002/01/14 00:55:56 thorpej Exp $ + * $FreeBSD$ + */ + +#include +#include + +#define _SYSCALL(name) \ + .text; \ + .align 2; \ + li 0,(SYS_##name); \ + sc + +#define SYSCALL(name) \ + .text; \ + .align 2; \ +2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + _SYSCALL(name); \ + bso 2b + +#define PSEUDO(name) \ + .text; \ + .align 2; \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + _SYSCALL(name); \ + bnslr; \ + b PIC_PLT(CNAME(HIDENAME(cerror))) + +#define RSYSCALL(name) \ + .text; \ + .align 2; \ +2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + _SYSCALL(name); \ + bnslr; \ + b PIC_PLT(CNAME(HIDENAME(cerror))) Added: head/lib/libc/powerpcspe/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/Symbol.map Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,59 @@ +/* + * $FreeBSD$ + */ + +/* + * This only needs to contain symbols that are not listed in + * symbol maps from other parts of libc (i.e., not found in + * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). + */ +FBSD_1.0 { + /* PSEUDO syscalls */ + _exit; + + _mcount; + _setjmp; + _longjmp; + fabs; + __flt_rounds; + fpgetmask; + fpgetround; + fpgetsticky; + fpsetmask; + fpsetround; + __infinity; + __nan; + makecontext; + setjmp; + longjmp; + sigsetjmp; + siglongjmp; + htonl; + htons; + ntohl; + ntohs; + brk; + exect; + sbrk; + vfork; +}; + +FBSD_1.3 { + __eabi; +}; + +FBSDprivate_1.0 { + /* PSEUDO syscalls */ + __sys_getlogin; + _getlogin; + __sys_exit; + + _set_tp; + _fpgetsticky; + __makecontext; + __longjmp; + signalcontext; + __signalcontext; + __syncicache; + _end; +}; Added: head/lib/libc/powerpcspe/_fpmath.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/_fpmath.h Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2003 David Schultz + * 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$ + */ + +union IEEEl2bits { + long double e; + struct { + unsigned int sign :1; + unsigned int exp :11; + unsigned int manh :20; + unsigned int manl :32; + } bits; +}; + +#define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT +#define LDBL_NBIT 0 + +#define LDBL_MANH_SIZE 20 +#define LDBL_MANL_SIZE 32 + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) Added: head/lib/libc/powerpcspe/arith.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/arith.h Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,16 @@ +/* + * MD header for contrib/gdtoa + * + * $FreeBSD$ + */ + +/* + * NOTE: The definitions in this file must be correct or strtod(3) and + * floating point formats in printf(3) will break! The file can be + * generated by running contrib/gdtoa/arithchk.c on the target + * architecture. See contrib/gdtoa/gdtoaimp.h for details. + */ + +#define IEEE_MC68k +#define Arith_Kind_ASL 2 +#define Double_Align Added: head/lib/libc/powerpcspe/gd_qnan.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gd_qnan.h Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,21 @@ +/* + * MD header for contrib/gdtoa + * + * This file can be generated by compiling and running contrib/gdtoa/qnan.c + * on the target architecture after arith.h has been generated. + * + * $FreeBSD$ + */ + +#define f_QNAN 0x7fc00000 +#define d_QNAN0 0x7ff80000 +#define d_QNAN1 0x0 +#define ld_QNAN0 0x7ff80000 +#define ld_QNAN1 0x0 +#define ld_QNAN2 0x0 +#define ld_QNAN3 0x0 +#define ldus_QNAN0 0x7ff8 +#define ldus_QNAN1 0x0 +#define ldus_QNAN2 0x0 +#define ldus_QNAN3 0x0 +#define ldus_QNAN4 0x0 Added: head/lib/libc/powerpcspe/gen/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/Makefile.inc Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c \ + infinity.c ldexp.c makecontext.c _setjmp.S \ + setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ + _set_tp.c \ + trivial-getcontextx.c + + + Added: head/lib/libc/powerpcspe/gen/_ctx_start.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/_ctx_start.S Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2004 Suleiman Souhlal + * 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. + */ + + #include + + __FBSDID("$FreeBSD$"); + + .globl CNAME(_ctx_done) + .globl CNAME(abort) + + ENTRY(_ctx_start) + mtlr %r14 + blrl /* branch to start function */ + mr %r3,%r15 /* pass pointer to ucontext as argument */ + bl PIC_PLT(CNAME(_ctx_done)) /* branch to ctxt completion func */ + /* + * we should never return from the + * above branch. + */ + bl PIC_PLT(CNAME(abort)) /* abort */ + END(_cts_start) + + .section .note.GNU-stack,"",%progbits Added: head/lib/libc/powerpcspe/gen/_set_tp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/_set_tp.c Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2004 Doug Rabson + * 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$ + */ +#include "libc_private.h" + +void +_set_tp(void *tpval) +{ + + __asm __volatile("mr 2,%0" :: "r"((char*)tpval + 0x7008)); +} Added: head/lib/libc/powerpcspe/gen/_setjmp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/_setjmp.S Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2016 Justin Hibbits + * 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. + */ +/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v?v:1)" from the last call to + * _setjmp(a) + * by restoring registers from the stack. + * The previous signal state is NOT restored. + * + * jmpbuf layout: + * +------------+ + * | unused | + * +------------+ + * | unused | + * | | + * | (4 words) | + * | | + * +------------+ + * | saved regs | + * | ... | + */ + +ENTRY(_setjmp) + mflr %r11 + mfcr %r12 + evstdd %r1,24+0*8(%r3) + evstdd %r2,24+1*8(%r3) + evstdd %r11,24+2*8(%r3) + evstdd %r12,24+3*8(%r3) + evstdd %r13,24+4*8(%r3) + evstdd %r14,24+5*8(%r3) + evstdd %r15,24+6*8(%r3) + evstdd %r16,24+7*8(%r3) + evstdd %r17,24+8*8(%r3) + evstdd %r18,24+9*8(%r3) + evstdd %r19,24+10*8(%r3) + evstdd %r20,24+11*8(%r3) + evstdd %r21,24+12*8(%r3) + evstdd %r22,24+13*8(%r3) + evstdd %r23,24+14*8(%r3) + evstdd %r24,24+15*8(%r3) + evstdd %r25,24+16*8(%r3) + evstdd %r26,24+17*8(%r3) + evstdd %r27,24+18*8(%r3) + evstdd %r28,24+19*8(%r3) + evstdd %r29,24+20*8(%r3) + evstdd %r30,24+21*8(%r3) + evstdd %r31,24+22*8(%r3) + + li %r3,0 + blr +END(_setjmp) + +ENTRY(_longjmp) + evldd %r1,24+0*8(%r3) + evldd %r2,24+1*8(%r3) + evldd %r11,24+2*8(%r3) + evldd %r12,24+3*8(%r3) + evldd %r13,24+4*8(%r3) + evldd %r14,24+5*8(%r3) + evldd %r15,24+6*8(%r3) + evldd %r16,24+7*8(%r3) + evldd %r17,24+8*8(%r3) + evldd %r18,24+9*8(%r3) + evldd %r19,24+10*8(%r3) + evldd %r20,24+11*8(%r3) + evldd %r21,24+12*8(%r3) + evldd %r22,24+13*8(%r3) + evldd %r23,24+14*8(%r3) + evldd %r24,24+15*8(%r3) + evldd %r25,24+16*8(%r3) + evldd %r26,24+17*8(%r3) + evldd %r27,24+18*8(%r3) + evldd %r28,24+19*8(%r3) + evldd %r29,24+20*8(%r3) + evldd %r30,24+21*8(%r3) + evldd %r31,24+22*8(%r3) + + mtlr %r11 + mtcr %r12 + or. %r3,%r4,%r4 + bnelr + li %r3,1 + blr +END(_longjmp) + + .section .note.GNU-stack,"",%progbits Added: head/lib/libc/powerpcspe/gen/eabi.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/eabi.S Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2011 Marcel Moolenaar + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +ENTRY(__eabi) + blr +END(__eabi) + + .section .note.GNU-stack,"",%progbits Added: head/lib/libc/powerpcspe/gen/fabs.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/fabs.S Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2016 Justin Hibbits + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * double fabs(double) + */ +ENTRY(fabs) + efdabs %f1,%f1 + blr +END(fabs) + + .section .note.GNU-stack,"",%progbits Added: head/lib/libc/powerpcspe/gen/flt_rounds.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/flt_rounds.c Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,57 @@ +/* $NetBSD: flt_rounds.c,v 1.4.10.3 2002/03/22 20:41:53 nathanw Exp $ */ + +/* + * Copyright (c) 2016 Justin Hibbits + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Mark Brinicombe + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#ifndef _SOFT_FLOAT +static const int map[] = { + 1, /* round to nearest */ + 0, /* round to zero */ + 2, /* round to positive infinity */ + 3 /* round to negative infinity */ +}; + +int +__flt_rounds() +{ + uint32_t fpscr; + + __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); + return map[(fpscr & 0x03)]; +} +#endif Added: head/lib/libc/powerpcspe/gen/fpgetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/fpgetmask.c Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,49 @@ +/* $NetBSD: fpgetmask.c,v 1.3 2002/01/13 21:45:47 thorpej Exp $ */ + +/* + * Copyright (c) 2016 Justin Hibbits + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#ifndef _SOFT_FLOAT +fp_except_t +fpgetmask() +{ + uint32_t fpscr; + + __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); + return ((fp_except_t)((fpscr >> 3) & 0x1f)); +} +#endif Added: head/lib/libc/powerpcspe/gen/fpgetround.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/fpgetround.c Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,49 @@ +/* $NetBSD: fpgetround.c,v 1.3 2002/01/13 21:45:47 thorpej Exp $ */ + +/* + * Copyright (c) 2016 Justin Hibbits + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#ifndef _SOFT_FLOAT +fp_rnd_t +fpgetround() +{ + uint32_t fpscr; + + __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); + return ((fp_rnd_t)(fpscr & 0x3)); +} +#endif Added: head/lib/libc/powerpcspe/gen/fpgetsticky.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/fpgetsticky.c Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,55 @@ +/* $NetBSD: fpgetsticky.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */ + +/* + * Copyright (c) 2016 Justin Hibbits + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. + * + * $FreeBSD$ + */ + +#include + +#include "namespace.h" + +#include +#include +#include + +#ifndef _SOFT_FLOAT +#ifdef __weak_alias +__weak_alias(fpgetsticky,_fpgetsticky) +#endif + +fp_except_t +fpgetsticky() +{ + uint32_t fpscr; + + __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); + return ((fp_except_t)((fpscr >> 25) & 0x1f)); +} +#endif Added: head/lib/libc/powerpcspe/gen/fpsetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpcspe/gen/fpsetmask.c Sat Oct 22 01:57:15 2016 (r307761) @@ -0,0 +1,53 @@ +/* $NetBSD: fpsetmask.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */ + +/* + * Copyright (c) 2016 Justin Hibbits *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 22 02:11:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C52F9C1BEB4; Sat, 22 Oct 2016 02:11:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 84B7FB09; Sat, 22 Oct 2016 02:11:54 +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 u9M2Br4S086292; Sat, 22 Oct 2016 02:11:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9M2BrVe086290; Sat, 22 Oct 2016 02:11:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610220211.u9M2BrVe086290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Oct 2016 02:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307763 - head/sys/dev/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 02:11:54 -0000 Author: jhibbits Date: Sat Oct 22 02:11:53 2016 New Revision: 307763 URL: https://svnweb.freebsd.org/changeset/base/307763 Log: Initialize the ofw_bus_devinfo on the portals to prevent a crash. If the device tree doesn't contain a cpu-handle field in any bman-portal or qman-portal, it will exit without setting up the devinfo, leaving it uninitialized. This will lead to attempts to free random memory, and ultimately panic. Modified: head/sys/dev/dpaa/bman_fdt.c head/sys/dev/dpaa/qman_fdt.c Modified: head/sys/dev/dpaa/bman_fdt.c ============================================================================== --- head/sys/dev/dpaa/bman_fdt.c Sat Oct 22 01:58:21 2016 (r307762) +++ head/sys/dev/dpaa/bman_fdt.c Sat Oct 22 02:11:53 2016 (r307763) @@ -143,7 +143,7 @@ bman_portals_fdt_attach(device_t dev) ihandle_t cpu; int cpu_num, cpus, intr_rid; struct dpaa_portals_devinfo di; - struct ofw_bus_devinfo ofw_di; + struct ofw_bus_devinfo ofw_di = {}; cpus = 0; sc = device_get_softc(dev); Modified: head/sys/dev/dpaa/qman_fdt.c ============================================================================== --- head/sys/dev/dpaa/qman_fdt.c Sat Oct 22 01:58:21 2016 (r307762) +++ head/sys/dev/dpaa/qman_fdt.c Sat Oct 22 02:11:53 2016 (r307763) @@ -143,7 +143,7 @@ qman_portals_fdt_attach(device_t dev) ihandle_t cpu; int cpu_num, cpus, intr_rid; struct dpaa_portals_devinfo di; - struct ofw_bus_devinfo ofw_di; + struct ofw_bus_devinfo ofw_di = {}; cpus = 0; sc = device_get_softc(dev); From owner-svn-src-head@freebsd.org Sat Oct 22 08:00:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B496C1CE2B; Sat, 22 Oct 2016 08:00:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4533AF2E; Sat, 22 Oct 2016 08:00:48 +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 u9M80lJB017293; Sat, 22 Oct 2016 08:00:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9M80knZ017287; Sat, 22 Oct 2016 08:00:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610220800.u9M80knZ017287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 22 Oct 2016 08:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307768 - in head: share/man/man4 sys/conf sys/dev/jedec_ts sys/modules/i2c sys/modules/i2c/jedec_ts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 08:00:48 -0000 Author: avg Date: Sat Oct 22 08:00:46 2016 New Revision: 307768 URL: https://svnweb.freebsd.org/changeset/base/307768 Log: jedec_ts: a driver for thermal sensors on memory modules The driver currently supports chips that are fully compliant with the JEDEC SPD / EEPROM / TS standard (JEDEC Standard 21-C, TSE2002 Specification, frequenlty referred to as JEDEC JC 42.4). Additionally some chips from STMicroelectronics are supported as well. They are compliant except for their Device ID pattern. Given the continued lack of any common sensor infrastructure, the driver uses an ad-hoc sysctl to report the temperature. Reviewed by: wblock (documentation) MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D8174 Added: head/share/man/man4/jedec_ts.4 (contents, props changed) head/sys/dev/jedec_ts/ head/sys/dev/jedec_ts/jedec_ts.c (contents, props changed) head/sys/modules/i2c/jedec_ts/ head/sys/modules/i2c/jedec_ts/Makefile (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/modules/i2c/Makefile Added: head/share/man/man4/jedec_ts.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/jedec_ts.4 Sat Oct 22 08:00:46 2016 (r307768) @@ -0,0 +1,130 @@ +.\" +.\" Copyright (c) 2016 Andriy Gapon +.\" 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 ``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$ +.\" +.Dd October 13, 2016 +.Dt JEDEC_TS 4 +.Os +.Sh NAME +.Nm jedec_ts +.Nd driver for temperature sensors on memory modules +.Sh SYNOPSIS +.Bd -ragged -offset indent +.Cd "device jedec_ts" +.Cd "device smbus" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +jedec_ts_load="YES" +.Ed +.Pp +In +.Pa /boot/device.hints : +.Bd -literal -offset indent +.Cd hint.jedec_ts.0.at="smbus0" +.Cd hint.jedec_ts.0.addr="0x30" +.Cd hint.jedec_ts.1.at="smbus0" +.Cd hint.jedec_ts.1.addr="0x32" +.Cd hint.jedec_ts.2.at="smbus0" +.Cd hint.jedec_ts.2.addr="0x34" +.Cd hint.jedec_ts.3.at="smbus0" +.Cd hint.jedec_ts.3.addr="0x36" +.Cd hint.jedec_ts.4.at="smbus0" +.Cd hint.jedec_ts.4.addr="0x38" +.Cd hint.jedec_ts.5.at="smbus0" +.Cd hint.jedec_ts.5.addr="0x3A" +.Cd hint.jedec_ts.6.at="smbus0" +.Cd hint.jedec_ts.6.addr="0x3C" +.Cd hint.jedec_ts.7.at="smbus0" +.Cd hint.jedec_ts.7.addr="0x3E" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides access to sensor data over the +.Xr smbus 4 . +The driver supports temperature sensors on memory modules that conform +to JEDEC Standard 21-C, TSE2002 Specification. +.Pp +The access to +.Nm +data is made via the +.Xr sysctl 8 +interface: +.Bl -tag -width "dev.jedec_ts.%d.temp" +.It Va dev.jedec_ts.%d.temp +read-only value of the current temperature read by the sensor. +.El +.Pp +On a system using +.Xr device.hints 5 , +these values are configurable for +.Nm : +.Bl -tag -width "hint.jedec_ts.%d.addr" +.It Va hint.jedec_ts.%d.at +target +.Xr smbus 4 . +.It Va hint.jedec_ts.%d.addr +.Nm +SMBus address on the +.Xr smbus 4 . +.El +.Pp +.Nm +temperature sensors can be wired to eight different addresses, +allowing up to eight sensors on the same +.Xr smbus 4 . +.Pp +If the sensors are on an I2C bus behind an +.Xr iicbus 4 +controller, then the +.Xr iicsmb 4 +bridge driver can be used to attach the +.Xr smbus 4 . +.Sh EXAMPLES +.Ss Sensor read out for two memory modules: +.Bd -literal +dev.jedec_ts.0.temp: 40.2500C +dev.jedec_ts.1.temp: 40.7500C +.Ed +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicsmb 4 , +.Xr smbus 4 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Oct 22 02:37:59 2016 (r307767) +++ head/sys/conf/NOTES Sat Oct 22 08:00:46 2016 (r307768) @@ -2527,7 +2527,12 @@ device ismt device smb +# SMBus peripheral devices # +# jedec_ts Temperature Sensor compliant with JEDEC Standard 21-C +# +device jedec_ts + # I2C Bus # # Philips i2c bus support is provided by the `iicbus' device. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 22 02:37:59 2016 (r307767) +++ head/sys/conf/files Sat Oct 22 08:00:46 2016 (r307768) @@ -2062,6 +2062,7 @@ dev/ixgbe/ixgbe_dcb_82598.c optional ix compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/jedec_ts/jedec_ts.c optional jedec_ts smbus dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa Added: head/sys/dev/jedec_ts/jedec_ts.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/jedec_ts/jedec_ts.c Sat Oct 22 08:00:46 2016 (r307768) @@ -0,0 +1,179 @@ +/*- + * Copyright (c) 2016 Andriy Gapon + * 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 ``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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "smbus_if.h" + + +/* + * SMBus specification defines little-endian byte order, + * but it seems that the JEDEC devices expect it to + * be big-endian. + */ +static int +ts_readw_be(device_t dev, uint8_t reg, uint16_t *val) +{ + device_t bus = device_get_parent(dev); + uint8_t addr = smbus_get_addr(dev); + int err; + + err = smbus_readw(bus, addr, reg, val); + if (err != 0) + return (err); + *val = be16toh(*val); + return (0); +} + +static int +ts_temp_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev = arg1; + int err; + int temp; + uint16_t val; + + err = ts_readw_be(dev, 5, &val); + if (err != 0) + return (EIO); + + /* + * Convert the reading to temperature in 0.0001 Kelvins. + * Three most significant bits are flags, the next + * most significant bit is a sign bit. + * Each step is 0.0625 degrees. + */ + temp = val & 0xfff; + if ((val & 0x1000) != 0) + temp = -temp; + temp = temp * 625 + 2731500; + err = sysctl_handle_int(oidp, &temp, 0, req); + return (err); +} + +static int +ts_probe(device_t dev) +{ + device_set_desc(dev, "DIMM memory sensor"); + return (BUS_PROBE_DEFAULT); +} + +static int +ts_attach(device_t dev) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *tree; + int err; + uint16_t vendorid; + uint16_t devid; + uint8_t addr; + + addr = smbus_get_addr(dev); + if ((addr & 0x30) != 0x30) { + /* Up to 8 slave devices starting at 0x30. */ + return (ENXIO); + } + + err = ts_readw_be(dev, 6, &vendorid); + if (err != 0) { + device_printf(dev, "failed to read Manufacturer ID\n"); + return (ENXIO); + } + err = ts_readw_be(dev, 6, &devid); + if (err != 0) { + device_printf(dev, "failed to read Device ID\n"); + return (ENXIO); + } + if ((devid & 0xff00) == 0x2200) { + /* + * Defined by JEDEC Standard No. 21-C, Release 26, + * Page 4.1.6 – 24 + */ + } else if (vendorid == 0x104a) { + /* + * STMicroelectronics datasheets say that + * device ID and revision can vary. + * E.g. STT424E02, Doc ID 13448 Rev 8, + * section 4.6, page 26. + */ + } else { + if (bootverbose) { + device_printf(dev, "Unknown Manufacturer and Device IDs" + ", 0x%x and 0x%x\n", vendorid, devid); + } + return (ENXIO); + } + + ctx = device_get_sysctl_ctx(dev); + tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "temp", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, 0, + ts_temp_sysctl, "IK4", "Current temperature"); + + return (0); +} + +static int +ts_detach(device_t dev) +{ + return (0); +} + + +static device_method_t jedec_ts_methods[] = { + /* Methods from the device interface */ + DEVMETHOD(device_probe, ts_probe), + DEVMETHOD(device_attach, ts_attach), + DEVMETHOD(device_detach, ts_detach), + + /* Terminate method list */ + { 0, 0 } +}; + +static driver_t jedec_ts_driver = { + "jedec_ts", + jedec_ts_methods, + 0 /* no softc */ +}; + +static devclass_t jedec_ts_devclass; + +DRIVER_MODULE(jedec_ts, smbus, jedec_ts_driver, jedec_ts_devclass, 0, 0); +MODULE_DEPEND(jedec_ts, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +MODULE_VERSION(jedec_ts, 1); Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Sat Oct 22 02:37:59 2016 (r307767) +++ head/sys/modules/i2c/Makefile Sat Oct 22 08:00:46 2016 (r307768) @@ -1,6 +1,6 @@ # $FreeBSD$ SUBDIR = -SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic cyapa smb isl +SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic cyapa smb isl jedec_ts .include Added: head/sys/modules/i2c/jedec_ts/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/jedec_ts/Makefile Sat Oct 22 08:00:46 2016 (r307768) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/jedec_ts +KMOD = jedec_ts +SRCS = jedec_ts.c bus_if.h device_if.h smbus_if.h + +.include From owner-svn-src-head@freebsd.org Sat Oct 22 11:26:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC8D1C1C6A5; Sat, 22 Oct 2016 11:26:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id BB25AFD7; Sat, 22 Oct 2016 11:26:23 +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 u9MBQMD3097694; Sat, 22 Oct 2016 11:26:22 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MBQMO9097692; Sat, 22 Oct 2016 11:26:22 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201610221126.u9MBQMO9097692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 22 Oct 2016 11:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307769 - head/usr.sbin/daemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 11:26:24 -0000 Author: jilles Date: Sat Oct 22 11:26:22 2016 New Revision: 307769 URL: https://svnweb.freebsd.org/changeset/base/307769 Log: daemon: Allow logging daemon stdout/stderr to file or syslog. There are various new options, documented in the man page, to send the daemon's standard output and/or standard error to a file or to syslog. Submitted by: ank at iki.fi Reviewed by: wblock (man page only) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D7993 Modified: head/usr.sbin/daemon/daemon.8 head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Sat Oct 22 08:00:46 2016 (r307768) +++ head/usr.sbin/daemon/daemon.8 Sat Oct 22 11:26:22 2016 (r307769) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2016 +.Dd October 22, 2016 .Dt DAEMON 8 .Os .Sh NAME @@ -34,11 +34,16 @@ .Nd run detached from the controlling terminal .Sh SYNOPSIS .Nm -.Op Fl cfr +.Op Fl cfrS .Op Fl p Ar child_pidfile .Op Fl P Ar supervisor_pidfile .Op Fl t Ar title .Op Fl u Ar user +.Op Fl m Ar output_mask +.Op Fl o Ar output_file +.Op Fl s Ar syslog_priority +.Op Fl T Ar syslog_tag +.Op Fl s Ar syslog_facility .Ar command arguments ... .Sh DESCRIPTION The @@ -46,6 +51,8 @@ The utility detaches itself from the controlling terminal and executes the program specified by its arguments. Privileges may be lowered to the specified user. +The output of the daemonized process may be redirected to syslog and to a +log file. .Pp The options are as follows: .Bl -tag -width indent @@ -55,6 +62,19 @@ Change the current working directory to .It Fl f Redirect standard input, standard output and standard error to .Pa /dev/null . +.It Fl S +Enable syslog output. +This is implicitly applied if other syslog parameters are provided. +The default values are daemon, notice, and daemon for facility, priority, and +tag, respectively. +.It Fl o Ar output_file +Append output from the daemonized process to +.Pa output_file . +If the file does not exist, it is created with permissions 0600. +.It Fl m Ar output_mask +Redirect output from the child process stdout (1), stderr (2), or both (3). +This value specifies what is sent to syslog and the log file. +The default is 3. .It Fl p Ar child_pidfile Write the ID of the created process into the .Ar child_pidfile @@ -96,18 +116,37 @@ option is used or not. .It Fl r Supervise and restart the program if it has been terminated. .It Fl t Ar title -Process title for the daemon to make it easily identifiable. +Set the title for the daemon process. +The default is the daemonized invocation. .It Fl u Ar user Login name of the user to execute the program under. Requires adequate superuser privileges. +.It Fl s Ar syslog_priority +These priorities are accepted: emerg, alert, crit, err, warning, +notice, info, and debug. +The default is info. +.It Fl l Ar syslog_facility +These facilities are accepted: auth, authpriv, console, cron, daemon, +ftp, kern, lpr, mail, news, ntp, security, syslog, user, uucp, and +local0, ..., local7. +The default is daemon. +.It Fl T Ar syslog_tag +Set the tag which is appended to all syslog messages. +The default is daemon. .El .Pp -If the +If any of the options .Fl p , -.Fl P +.Fl P , +.Fl r , +.Fl o , +.Fl s , +.Fl T , +.Fl m , +.Fl S , or -.Fl r -option is specified the program is executed in a spawned child process. +.Fl l +are specified, the program is executed in a spawned child process. The .Nm waits until it terminates to keep the pid file(s) locked and removes them @@ -119,6 +158,13 @@ spawned process. Normally it will cause the child to exit, remove the pidfile(s) and then terminate. .Pp +If neither file or syslog output are selected, all output is redirected to the +.Nm +process and written to stdout. +The +.Fl f +option may be used to suppress the stdout output completely. +.Pp The .Fl P option is useful combined with the @@ -145,13 +191,21 @@ library routine, 2 if or .Ar supervisor_pidfile is requested, but cannot be opened, 3 if process is already running (pidfile -exists and is locked), -otherwise 0. +exists and is locked), 4 if +.Ar syslog_priority +is not accepted, 5 if +.Ar syslog_facility +is not accepted, 6 if +.Ar output_mask +is not within the accepted range, 7 if +.Ar output_file +cannot be opened for appending, and otherwise 0. .Sh DIAGNOSTICS -If the command cannot be executed, an error message is displayed on -standard error unless the +If the command cannot be executed, an error message is printed to +standard error. +The exact behavior depends on the logging parameters and the .Fl f -flag is specified. +flag. .Sh SEE ALSO .Xr setregid 2 , .Xr setreuid 2 , Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Sat Oct 22 08:00:46 2016 (r307768) +++ head/usr.sbin/daemon/daemon.c Sat Oct 22 11:26:22 2016 (r307769) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -44,25 +45,59 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#define SYSLOG_NAMES +#include +#include +#include + +#define LBUF_SIZE 4096 + +struct log_params { + int dosyslog; + int logpri; + int noclose; + int outfd; +}; -static void dummy_sighandler(int); static void restrict_process(const char *); -static int wait_child(pid_t pid, sigset_t *mask); +static void handle_term(int); +static void handle_chld(int); +static int listen_child(int, struct log_params *); +static int get_log_mapping(const char *, const CODE *); +static void open_pid_files(const char *, const char *, struct pidfh **, + struct pidfh **); +static void do_output(const unsigned char *, size_t, struct log_params *); +static void daemon_sleep(time_t, long); static void usage(void); +static volatile sig_atomic_t terminate = 0, child_gone = 0, pid = 0; + int main(int argc, char *argv[]) { - struct pidfh *ppfh, *pfh; - sigset_t mask, oldmask; - int ch, nochdir, noclose, restart, serrno; - const char *pidfile, *ppidfile, *title, *user; - pid_t otherpid, pid; - + const char *pidfile, *ppidfile, *title, *user, *outfn, *logtag; + int ch, nochdir, noclose, restart, dosyslog, child_eof; + sigset_t mask_susp, mask_orig, mask_read, mask_term; + struct log_params logpar; + int pfd[2] = { -1, -1 }, outfd = -1; + int stdmask, logpri, logfac; + struct pidfh *ppfh, *pfh; + char *p; + + memset(&logpar, 0, sizeof(logpar)); + stdmask = STDOUT_FILENO | STDERR_FILENO; + ppidfile = pidfile = user = NULL; nochdir = noclose = 1; + logpri = LOG_NOTICE; + logfac = LOG_DAEMON; + logtag = "daemon"; restart = 0; - ppidfile = pidfile = title = user = NULL; - while ((ch = getopt(argc, argv, "cfp:P:rt:u:")) != -1) { + dosyslog = 0; + outfn = NULL; + title = NULL; + while ((ch = getopt(argc, argv, "cfSp:P:ru:o:s:l:t:l:m:T:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -70,6 +105,20 @@ main(int argc, char *argv[]) case 'f': noclose = 0; break; + case 'l': + logfac = get_log_mapping(optarg, facilitynames); + if (logfac == -1) + errx(5, "unrecognized syslog facility"); + dosyslog = 1; + break; + case 'm': + stdmask = strtol(optarg, &p, 10); + if (p == optarg || stdmask < 0 || stdmask > 3) + errx(6, "unrecognized listening mask"); + break; + case 'o': + outfn = optarg; + break; case 'p': pidfile = optarg; break; @@ -79,9 +128,22 @@ main(int argc, char *argv[]) case 'r': restart = 1; break; + case 's': + logpri = get_log_mapping(optarg, prioritynames); + if (logpri == -1) + errx(4, "unrecognized syslog priority"); + dosyslog = 1; + break; + case 'S': + dosyslog = 1; + break; case 't': title = optarg; break; + case 'T': + logtag = optarg; + dosyslog = 1; + break; case 'u': user = optarg; break; @@ -95,43 +157,30 @@ main(int argc, char *argv[]) if (argc == 0) usage(); + if (!title) + title = argv[0]; + + if (outfn) { + outfd = open(outfn, O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, 0600); + if (outfd == -1) + err(7, "open"); + } + + if (dosyslog) + openlog(logtag, LOG_PID | LOG_NDELAY, logfac); + ppfh = pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - if (pidfile != NULL) { - pfh = pidfile_open(pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "pidfile ``%s''", pidfile); - } - } - /* Do the same for actual daemon process. */ - if (ppidfile != NULL) { - ppfh = pidfile_open(ppidfile, 0600, &otherpid); - if (ppfh == NULL) { - serrno = errno; - pidfile_remove(pfh); - errno = serrno; - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "ppidfile ``%s''", ppidfile); - } - } - + open_pid_files(pidfile, ppidfile, &pfh, &ppfh); if (daemon(nochdir, noclose) == -1) { warn("daemon"); goto exit; } /* Write out parent pidfile if needed. */ pidfile_write(ppfh); - /* * If the pidfile or restart option is specified the daemon * executes the command in a forked process and wait on child @@ -139,34 +188,50 @@ main(int argc, char *argv[]) * we don't want the monitoring daemon to be terminated * leaving the running process and the stale pidfile, so we * catch SIGTERM and forward it to the children expecting to - * get SIGCHLD eventually. + * get SIGCHLD eventually. We also must fork() to obtain a + * readable pipe with the child for writing to a log file + * and syslog. */ pid = -1; - if (pidfile != NULL || ppidfile != NULL || restart) { + if (pidfile || ppidfile || restart || outfd != -1 || dosyslog) { + struct sigaction act_term, act_chld; + + /* Avoid PID racing with SIGCHLD and SIGTERM. */ + memset(&act_term, 0, sizeof(act_term)); + act_term.sa_handler = handle_term; + sigemptyset(&act_term.sa_mask); + sigaddset(&act_term.sa_mask, SIGCHLD); + + memset(&act_chld, 0, sizeof(act_chld)); + act_chld.sa_handler = handle_chld; + sigemptyset(&act_chld.sa_mask); + sigaddset(&act_chld.sa_mask, SIGTERM); + + /* Block these when avoiding racing before sigsuspend(). */ + sigemptyset(&mask_susp); + sigaddset(&mask_susp, SIGTERM); + sigaddset(&mask_susp, SIGCHLD); + /* Block SIGTERM when we lack a valid child PID. */ + sigemptyset(&mask_term); + sigaddset(&mask_term, SIGTERM); /* - * Restore default action for SIGTERM in case the - * parent process decided to ignore it. + * When reading, we wish to avoid SIGCHLD. SIGTERM + * has to be caught, otherwise we'll be stuck until + * the read() returns - if it returns. */ - if (signal(SIGTERM, SIG_DFL) == SIG_ERR) { - warn("signal"); + sigemptyset(&mask_read); + sigaddset(&mask_read, SIGCHLD); + /* Block SIGTERM to avoid racing until we have forked. */ + if (sigprocmask(SIG_BLOCK, &mask_term, &mask_orig)) { + warn("sigprocmask"); goto exit; } - /* - * Because SIGCHLD is ignored by default, setup dummy handler - * for it, so we can mask it. - */ - if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) { - warn("signal"); + if (sigaction(SIGTERM, &act_term, NULL) == -1) { + warn("sigaction"); goto exit; } - /* - * Block interesting signals. - */ - sigemptyset(&mask); - sigaddset(&mask, SIGTERM); - sigaddset(&mask, SIGCHLD); - if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) { - warn("sigprocmask"); + if (sigaction(SIGCHLD, &act_chld, NULL) == -1) { + warn("sigaction"); goto exit; } /* @@ -175,56 +240,190 @@ main(int argc, char *argv[]) * not have superuser privileges. */ (void)madvise(NULL, 0, MADV_PROTECT); + logpar.outfd = outfd; + logpar.dosyslog = dosyslog; + logpar.logpri = logpri; + logpar.noclose = noclose; restart: + if (pipe(pfd)) + err(1, "pipe"); /* - * Spawn a child to exec the command, so in the parent - * we could wait for it to exit and remove pidfile. + * Spawn a child to exec the command. */ + child_gone = 0; pid = fork(); if (pid == -1) { warn("fork"); goto exit; + } else if (pid > 0) { + /* + * Unblock SIGTERM after we know we have a valid + * child PID to signal. + */ + if (sigprocmask(SIG_UNBLOCK, &mask_term, NULL)) { + warn("sigprocmask"); + goto exit; + } + close(pfd[1]); + pfd[1] = -1; } } if (pid <= 0) { - if (pid == 0) { - /* Restore old sigmask in the child. */ - if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) - err(1, "sigprocmask"); - } /* Now that we are the child, write out the pid. */ pidfile_write(pfh); if (user != NULL) restrict_process(user); - + /* + * When forking, the child gets the original sigmask, + * and dup'd pipes. + */ + if (pid == 0) { + close(pfd[0]); + if (sigprocmask(SIG_SETMASK, &mask_orig, NULL)) + err(1, "sigprogmask"); + if (stdmask & STDERR_FILENO) { + if (dup2(pfd[1], STDERR_FILENO) == -1) + err(1, "dup2"); + } + if (stdmask & STDOUT_FILENO) { + if (dup2(pfd[1], STDOUT_FILENO) == -1) + err(1, "dup2"); + } + if (pfd[1] != STDERR_FILENO && + pfd[1] != STDOUT_FILENO) + close(pfd[1]); + } execvp(argv[0], argv); - /* * execvp() failed -- report the error. The child is * now running, so the exit status doesn't matter. */ err(1, "%s", argv[0]); } - - if (title != NULL) - setproctitle("%s[%d]", title, pid); - else - setproctitle("%s[%d]", argv[0], pid); - if (wait_child(pid, &mask) == 0 && restart) { - sleep(1); + setproctitle("%s[%d]", title, (int)pid); + /* + * As we have closed the write end of pipe for parent process, + * we might detect the child's exit by reading EOF. The child + * might have closed its stdout and stderr, so we must wait for + * the SIGCHLD to ensure that the process is actually gone. + */ + child_eof = 0; + for (;;) { + /* + * We block SIGCHLD when listening, but SIGTERM we accept + * so the read() won't block if we wish to depart. + * + * Upon receiving SIGTERM, we have several options after + * sending the SIGTERM to our child: + * - read until EOF + * - read until EOF but only for a while + * - bail immediately + * + * We go for the third, as otherwise we have no guarantee + * that we won't block indefinitely if the child refuses + * to depart. To handle the second option, a different + * approach would be needed (procctl()?) + */ + if (child_gone && child_eof) { + break; + } else if (terminate) { + goto exit; + } else if (!child_eof) { + if (sigprocmask(SIG_BLOCK, &mask_read, NULL)) { + warn("sigprocmask"); + goto exit; + } + child_eof = !listen_child(pfd[0], &logpar); + if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { + warn("sigprocmask"); + goto exit; + } + } else { + if (sigprocmask(SIG_BLOCK, &mask_susp, NULL)) { + warn("sigprocmask"); + goto exit; + } + while (!terminate && !child_gone) + sigsuspend(&mask_orig); + if (sigprocmask(SIG_UNBLOCK, &mask_susp, NULL)) { + warn("sigprocmask"); + goto exit; + } + } + } + if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { + warn("sigprocmask"); + goto exit; + } + if (restart && !terminate) { + daemon_sleep(1, 0); + close(pfd[0]); + pfd[0] = -1; goto restart; } exit: + close(outfd); + close(pfd[0]); + close(pfd[1]); + if (dosyslog) + closelog(); pidfile_remove(pfh); pidfile_remove(ppfh); exit(1); /* If daemon(3) succeeded exit status does not matter. */ } static void -dummy_sighandler(int sig __unused) +daemon_sleep(time_t secs, long nsecs) { - /* Nothing to do. */ + struct timespec ts = { secs, nsecs }; + while (nanosleep(&ts, &ts) == -1) { + if (errno != EINTR) + err(1, "nanosleep"); + } +} + +static void +open_pid_files(const char *pidfile, const char *ppidfile, + struct pidfh **pfh, struct pidfh **ppfh) +{ + pid_t fpid; + int serrno; + + if (pidfile) { + *pfh = pidfile_open(pidfile, 0600, &fpid); + if (*pfh == NULL) { + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + fpid); + } + err(2, "pidfile ``%s''", pidfile); + } + } + /* Do the same for the actual daemon process. */ + if (ppidfile) { + *ppfh = pidfile_open(ppidfile, 0600, &fpid); + if (*ppfh == NULL) { + serrno = errno; + pidfile_remove(*pfh); + errno = serrno; + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + fpid); + } + err(2, "ppidfile ``%s''", ppidfile); + } + } +} + +static int +get_log_mapping(const char *str, const CODE *c) +{ + const CODE *cp; + for (cp = c; cp->c_name; cp++) + if (strcmp(cp->c_name, str) == 0) + return cp->c_val; + return -1; } static void @@ -240,34 +439,112 @@ restrict_process(const char *user) errx(1, "failed to set user environment"); } +/* + * We try to collect whole lines terminated by '\n'. Otherwise we collect a + * full buffer, and then output it. + * + * Return value of 0 is assumed to mean EOF or error, and 1 indicates to + * continue reading. + */ static int -wait_child(pid_t pid, sigset_t *mask) +listen_child(int fd, struct log_params *logpar) +{ + static unsigned char buf[LBUF_SIZE]; + static size_t bytes_read = 0; + int rv; + + assert(logpar); + assert(bytes_read < LBUF_SIZE - 1); + + rv = read(fd, buf + bytes_read, LBUF_SIZE - bytes_read - 1); + if (rv > 0) { + unsigned char *cp; + + bytes_read += rv; + assert(bytes_read <= LBUF_SIZE - 1); + /* Always NUL-terminate just in case. */ + buf[LBUF_SIZE - 1] = '\0'; + /* + * Chomp line by line until we run out of buffer. + * This does not take NUL characters into account. + */ + while ((cp = memchr(buf, '\n', bytes_read)) != NULL) { + size_t bytes_line = cp - buf + 1; + assert(bytes_line <= bytes_read); + do_output(buf, bytes_line, logpar); + bytes_read -= bytes_line; + memmove(buf, cp + 1, bytes_read); + } + /* Wait until the buffer is full. */ + if (bytes_read < LBUF_SIZE - 1) + return 1; + do_output(buf, bytes_read, logpar); + bytes_read = 0; + return 1; + } else if (rv == -1) { + /* EINTR should trigger another read. */ + if (errno == EINTR) { + return 1; + } else { + warn("read"); + return 0; + } + } + /* Upon EOF, we have to flush what's left of the buffer. */ + if (bytes_read > 0) { + do_output(buf, bytes_read, logpar); + bytes_read = 0; + } + return 0; +} + +/* + * The default behavior is to stay silent if the user wants to redirect + * output to a file and/or syslog. If neither are provided, then we bounce + * everything back to parent's stdout. + */ +static void +do_output(const unsigned char *buf, size_t len, struct log_params *logpar) { - int terminate, signo; + assert(len <= LBUF_SIZE); + assert(logpar); + + if (len < 1) + return; + if (logpar->dosyslog) + syslog(logpar->logpri, "%.*s", (int)len, buf); + if (logpar->outfd != -1) { + if (write(logpar->outfd, buf, len) == -1) + warn("write"); + } + if (logpar->noclose && !logpar->dosyslog && logpar->outfd == -1) + printf("%.*s", (int)len, buf); +} - terminate = 0; +/* + * We use the global PID acquired directly from fork. If there is no valid + * child pid, the handler should be blocked and/or child_gone == 1. + */ +static void +handle_term(int signo) +{ + if (pid > 0 && !child_gone) + kill(pid, signo); + terminate = 1; +} + +static void +handle_chld(int signo) +{ + (void)signo; for (;;) { - if (sigwait(mask, &signo) == -1) { - warn("sigwaitinfo"); - return (-1); - } - switch (signo) { - case SIGCHLD: - if (waitpid(pid, NULL, WNOHANG) == -1) { - warn("waitpid"); - return (-1); - } - return (terminate); - case SIGTERM: - terminate = 1; - if (kill(pid, signo) == -1) { - warn("kill"); - return (-1); - } - continue; - default: - warnx("sigwaitinfo: invalid signal: %d", signo); - return (-1); + int rv = waitpid(-1, NULL, WNOHANG); + if (pid == rv) { + child_gone = 1; + break; + } else if (rv == -1 && errno != EINTR) { + warn("waitpid"); + return; } } } @@ -275,8 +552,11 @@ wait_child(pid_t pid, sigset_t *mask) static void usage(void) { - (void)fprintf(stderr, "%s\n\t%s\n", - "usage: daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile]", - "[-t title] [-u user] command arguments ..."); + (void)fprintf(stderr, + "usage: daemon [-cfrS] [-p child_pidfile] [-P supervisor_pidfile]\n" + " [-u user] [-o output_file] [-t title]\n" + " [-l syslog_facility] [-s syslog_priority]\n" + " [-T syslog_tag] [-m output_mask]\n" + "command arguments ...\n"); exit(1); } From owner-svn-src-head@freebsd.org Sat Oct 22 12:06:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7BEAC19DD2; Sat, 22 Oct 2016 12:06:19 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F71FACA; Sat, 22 Oct 2016 12:06:19 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x232.google.com with SMTP id 66so47067617itl.1; Sat, 22 Oct 2016 05:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=+yl5WzMZsHMR3OVi0erSbz/XQFeltZ05rvA2UYUpL5A=; b=LAFuYxHuaHbI9qgsME3a282WxMP/fW2/OQ93n1qdomkOLwiNZ/c74dli4au3JqrAx7 RFgTCU+imwLkDVdv0nokqH/7JtMYrdH6w2a0lzndtm9GtKfkvDjHAeVFXcUc+YAMyiOr qE86uUacNtRdAQ1r2zNVzMKHlDHaNjGUVEc4m4la+CNiixJ2I5pl8Gj/UFsvierB9ves Q9TwYwXftllRWW4ayXavrUiFCe1RBkE/jn11PLgdH/Uj94z/A0ztK9jWqC9qnjARudYn SakM1R6EJf8i09K7W9JU85D8v/2XcA1jiCG2Vs1FTfWI9aOQLBmVCo0Yv7Z8pIYL6AqA uYNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=+yl5WzMZsHMR3OVi0erSbz/XQFeltZ05rvA2UYUpL5A=; b=d6yQdc/TnxVy2jUYvyG3toLOLRAm2eMXo9UeHkfyKvuZW8p/rD+IgVETAyxdqa98Sz mvOjIv7gD2WseExBobLNyIcWHEOmY1a4AUGbpdSJ/4JqnqPhzE43Hdk6eCaDy0hmod3o +j1J5ZBBHX6T0ZXSOH48E52sC+eADddK5AT26i5dBJFTx+8zQyl3c4g54Pidcf0hpbCe mpHduBYlv0gH9gDNPEVRvjGJCs8h3DFV9+gK93qu0qYKHqx8+0kf2vaTgXhaEMiazI4V nLxVGsQMvzFLOFzkGKelE7LX7ZM6IG3YxE2jn1UACH8unC6uDSmZsIfdyUwl581TFcnt XMug== X-Gm-Message-State: ABUngve1UVpS9y1Qk4rGs8uixjFIEJWqEWDP6LHxjOJ6Dtq+9k7vUa/+0elQ5ANPu7inef58vy6/bmfkm+j3pg== X-Received: by 10.107.179.11 with SMTP id c11mr5499718iof.169.1477137978789; Sat, 22 Oct 2016 05:06:18 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.180.211 with HTTP; Sat, 22 Oct 2016 05:05:58 -0700 (PDT) In-Reply-To: <201610101909.u9AJ9ZH0022085@repo.freebsd.org> References: <201610101909.u9AJ9ZH0022085@repo.freebsd.org> From: Ed Maste Date: Sat, 22 Oct 2016 12:05:58 +0000 X-Google-Sender-Auth: lWtui4w9kzNQ87tFfGcgTcSWZxo Message-ID: Subject: Re: svn commit: r307003 - head/contrib/mdocml To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 12:06:19 -0000 On 10 October 2016 at 19:09, Ed Maste wrote: > Author: emaste > Date: Mon Oct 10 19:09:35 2016 > New Revision: 307003 > URL: https://svnweb.freebsd.org/changeset/base/307003 > > Log: > makewhatis: make output reproducible Several of us discussed this issue at the FreeBSD Developer Summit prior to FOSDEM 2016, and des@ later added to the wiki a description of the approach taken by this commit; I'm sorry that wasn't mentioned in the commit message. From owner-svn-src-head@freebsd.org Sat Oct 22 12:20:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DB19C1B1D7; Sat, 22 Oct 2016 12:20:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D86EFAC; Sat, 22 Oct 2016 12:20:27 +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 u9MCKHeu081496 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 22 Oct 2016 15:20:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u9MCKHeu081496 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u9MCKHmg081494; Sat, 22 Oct 2016 15:20:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 22 Oct 2016 15:20:17 +0300 From: Konstantin Belousov To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307761 - in head: . contrib/binutils/bfd contrib/gcc/config/rs6000 gnu/lib/libgcc gnu/lib/libgomp gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/cc/cc_tools gnu/usr.bin/cc/include gnu... Message-ID: <20161022122017.GY54029@kib.kiev.ua> References: <201610220157.u9M1vFXx080331@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201610220157.u9M1vFXx080331@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 12:20:28 -0000 On Sat, Oct 22, 2016 at 01:57:15AM +0000, Justin Hibbits wrote: > Author: jhibbits > Date: Sat Oct 22 01:57:15 2016 > New Revision: 307761 > URL: https://svnweb.freebsd.org/changeset/base/307761 > > Log: > Create a new MACHINE_ARCH for Freescale PowerPC e500v2 > Added: > head/lib/libc/powerpcspe/sys/ptrace.S (contents, props changed) This is not needed, libc provides MI implementation in libc/sys/ptrace.c. From owner-svn-src-head@freebsd.org Sat Oct 22 12:43:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94922C1BA1C; Sat, 22 Oct 2016 12:43:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 111DC70; Sat, 22 Oct 2016 12:43:09 +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 u9MCh4hq087261 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 22 Oct 2016 15:43:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u9MCh4hq087261 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u9MCh1ar087260; Sat, 22 Oct 2016 15:43:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 22 Oct 2016 15:43:01 +0300 From: Konstantin Belousov To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307761 - in head: . contrib/binutils/bfd contrib/gcc/config/rs6000 gnu/lib/libgcc gnu/lib/libgomp gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/cc/cc_tools gnu/usr.bin/cc/include gnu... Message-ID: <20161022124301.GZ54029@kib.kiev.ua> References: <201610220157.u9M1vFXx080331@repo.freebsd.org> <20161022122017.GY54029@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161022122017.GY54029@kib.kiev.ua> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 12:43:10 -0000 On Sat, Oct 22, 2016 at 03:20:17PM +0300, Konstantin Belousov wrote: > On Sat, Oct 22, 2016 at 01:57:15AM +0000, Justin Hibbits wrote: > > Author: jhibbits > > Date: Sat Oct 22 01:57:15 2016 > > New Revision: 307761 > > URL: https://svnweb.freebsd.org/changeset/base/307761 > > > > Log: > > Create a new MACHINE_ARCH for Freescale PowerPC e500v2 > > > Added: > > head/lib/libc/powerpcspe/sys/ptrace.S (contents, props changed) > > This is not needed, libc provides MI implementation in libc/sys/ptrace.c. Why the decision to copy whole lib/libc/powerpc to lib/libc/powerpcspe was used to create the architecture ? I did a primitive-science overview, and got total ~2300 lines in lib/libc/powerpcspe, while $ diff -Nrua lib/libc/powerpc lib/libc/powerpcspe | diffstat -p0 | tail -1 16 files changed, 240 insertions(+), 174 deletions(-) It seems to be possible to only create several new files, like *setjmp.S and fp*.c, and reuse existing stock files from libc/powerpc for anything else. I am the one who does most of the sweeping changes over libc, and I am somewhat saddened by addition of almost identical copy of the existing architecture files which need to be maintained together with the original. From owner-svn-src-head@freebsd.org Sat Oct 22 13:11:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81AB8C1C22E; Sat, 22 Oct 2016 13:11:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id 50187F2B; Sat, 22 Oct 2016 13:11:10 +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 u9MDB9Nf036134; Sat, 22 Oct 2016 13:11:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MDB9XP036133; Sat, 22 Oct 2016 13:11:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610221311.u9MDB9XP036133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Oct 2016 13:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307771 - head/lib/libc/powerpcspe/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 13:11:10 -0000 Author: jhibbits Date: Sat Oct 22 13:11:09 2016 New Revision: 307771 URL: https://svnweb.freebsd.org/changeset/base/307771 Log: ptrace.S is not needed, libc/sys/ptrace.c exists already. This was leftovers from the initial branch work. Reported by: kib Deleted: head/lib/libc/powerpcspe/sys/ptrace.S Modified: head/lib/libc/powerpcspe/sys/Makefile.inc Modified: head/lib/libc/powerpcspe/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpcspe/sys/Makefile.inc Sat Oct 22 13:09:30 2016 (r307770) +++ head/lib/libc/powerpcspe/sys/Makefile.inc Sat Oct 22 13:11:09 2016 (r307771) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o From owner-svn-src-head@freebsd.org Sat Oct 22 13:14:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18887C1C2E2; Sat, 22 Oct 2016 13:14:04 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2A132E0; Sat, 22 Oct 2016 13:14:03 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it0-x244.google.com with SMTP id 139so3177532itm.2; Sat, 22 Oct 2016 06:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=h1yeqxP+3bQr7qw2UiHya4ntEcHRWJaha2jrSqcO6nU=; b=X/Da+2QhR+1ZCy1viP8qtV/cA92wrTx/FdjdmwSzFs7z+ROZZynjJ2Np88s+MHpw8L vDqQa3fO4r/c886f2jDcvGv9JGr6jkKT98TJ/mayvAqwyKrXK8QJ/U474KytjKloJRlX twa2HIfYH2Q55y+slQ3P7EWQa7bv5HGQeRuVSnv/M6vKXUO7ubX9/ZlNFVY065cdvXBp EQQGLh3z8ufuIPTt9/N4nVZIYzOXsLn1Od/bdzDMXuWxBpdQq2Q7F10aC4CKdnA8I1jq sWhzPOB33Pcd3fqd4OuBrHOXOoZYKm+6FTHu8hKAdWOGi+dGGOjh6MsqaFzB2mQadMpV +5MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=h1yeqxP+3bQr7qw2UiHya4ntEcHRWJaha2jrSqcO6nU=; b=SxZdRoNtIEKyXZVYokvNA36sWS2p9gTjMblWu3jXALKPUPDuF0voWcVCnYt2IWFeLC kPRzbd9vjqvPCQ3IKNBg6qW7nEb5jEzSsyVcGjjzxiPutwi3+0HQvOOrEaYltoGDOHKg L70NHvhoqJfIX/9xp2LxYoUZbiVuKbN5cz7ltEd3y+SFW7aVeNdbgDOFl3aOXp6QPKbS Bvw5uCevEHtM4guXdmL8VXruaqOfRLO7P0x2AQ4bxVvPfDoSI48x9T5SLVZpyc9I7NJv UgRpouCF96nvhVICqCGONWG8Tpmo6bRxbA6DM3ETHsYP8yS6fKddCeIt+G5lQnykNM3m ozAA== X-Gm-Message-State: ABUngvfLFQpYweX1giN6MFJX3YB4xE+hjILBJBJbSpQ2ka3fwh4pSp6LsYe09uVQ6r7wQw== X-Received: by 10.107.202.69 with SMTP id a66mr6474229iog.170.1477142043055; Sat, 22 Oct 2016 06:14:03 -0700 (PDT) Received: from Triad.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id a100sm3802948ioj.13.2016.10.22.06.14.01 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 22 Oct 2016 06:14:02 -0700 (PDT) Cc: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: From: Justin Hibbits To: Konstantin Belousov In-Reply-To: <20161022124301.GZ54029@kib.kiev.ua> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r307761 - in head: . contrib/binutils/bfd contrib/gcc/config/rs6000 gnu/lib/libgcc gnu/lib/libgomp gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/cc/cc_tools gnu/usr.bin/cc/include gnu... Date: Sat, 22 Oct 2016 08:14:00 -0500 References: <201610220157.u9M1vFXx080331@repo.freebsd.org> <20161022122017.GY54029@kib.kiev.ua> <20161022124301.GZ54029@kib.kiev.ua> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 13:14:04 -0000 On Oct 22, 2016, at 7:43 AM, Konstantin Belousov wrote: > On Sat, Oct 22, 2016 at 03:20:17PM +0300, Konstantin Belousov wrote: >> On Sat, Oct 22, 2016 at 01:57:15AM +0000, Justin Hibbits wrote: >>> Author: jhibbits >>> Date: Sat Oct 22 01:57:15 2016 >>> New Revision: 307761 >>> URL: https://svnweb.freebsd.org/changeset/base/307761 >>> >>> Log: >>> Create a new MACHINE_ARCH for Freescale PowerPC e500v2 >> >>> Added: >>> head/lib/libc/powerpcspe/sys/ptrace.S (contents, props changed) >> >> This is not needed, libc provides MI implementation in libc/sys/ >> ptrace.c. > > Why the decision to copy whole lib/libc/powerpc to lib/libc/powerpcspe > was used to create the architecture ? I did a primitive-science > overview, and got total ~2300 lines in lib/libc/powerpcspe, while > $ diff -Nrua lib/libc/powerpc lib/libc/powerpcspe | diffstat -p0 | > tail -1 > 16 files changed, 240 insertions(+), 174 deletions(-) > > It seems to be possible to only create several new files, like > *setjmp.S and fp*.c, and reuse existing stock files from libc/powerpc > for anything else. > > I am the one who does most of the sweeping changes over libc, and > I am somewhat saddened by addition of almost identical copy of the > existing architecture files which need to be maintained together with > the original. To be honest, I didn't think it was the right way either, but wasn't completely certain (and admittedly didn't try) that I could have two files with the same names, one in powerpc one in powerpcspe, and have it ignore the powerpc one if it exists in powerpcspe. libc's Makefile includes ${MACHINE_ARCH}/Makefile.inc, unless it doesn't exist in which case it includes ${MACHINE_CPUARCH}/ Makefile.inc, I'll see if I can consolidate them, but do you have a recommendation of the best way to do it? I also didn't really like the code duplication, but couldn't think of an easy/good way to do so. Now that we've chatted on IRC a bit about this, I'll take your suggestion and create some Makefile.common files to share between powerpc and powerpcspe. It may take a couple days depending on my available time. - Justin From owner-svn-src-head@freebsd.org Sat Oct 22 14:00:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6FF0C1CF23; Sat, 22 Oct 2016 14:00:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C871CAD; Sat, 22 Oct 2016 14:00:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::f9cd:eb1b:c961:7062] (unknown [IPv6:2001:7b8:3a7:0:f9cd:eb1b:c961:7062]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 330CF13609; Sat, 22 Oct 2016 16:00:10 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_22889CC7-FD96-4BA8-83DC-1798341EBBA8"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r307756 - in head: include sys/sys From: Dimitry Andric In-Reply-To: <20161022000056.GC95989@spindle.one-eyed-alien.net> Date: Sat, 22 Oct 2016 16:00:01 +0200 Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <0C5786D6-EB91-4762-9FAB-4C447EAB0AF8@FreeBSD.org> References: <201610212350.u9LNo2PT031675@repo.freebsd.org> <20161022000056.GC95989@spindle.one-eyed-alien.net> To: Brooks Davis X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 14:00:13 -0000 --Apple-Mail=_22889CC7-FD96-4BA8-83DC-1798341EBBA8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 22 Oct 2016, at 02:00, Brooks Davis wrote: >=20 > On Fri, Oct 21, 2016 at 11:50:02PM +0000, John Baldwin wrote: >> Author: jhb >> Date: Fri Oct 21 23:50:02 2016 >> New Revision: 307756 >> URL: https://svnweb.freebsd.org/changeset/base/307756 >>=20 >> Log: >> Define max_align_t for C11. >>=20 >> libc++'s stddef.h includes an existing definition of max_align_t for >> C++11, but it is only defined for C++, not for C. In addition, GCC = and >> clang both define an alternate version of max_align_t that uses a >> union of multiple types rather than a plain long double as in = libc++. >> This adds a __max_align_t to that matches the GCC and >> clang definition that is mapped to max_align_t in . ... Modified: head/sys/sys/_types.h >> = =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/sys/sys/_types.h Fri Oct 21 21:55:50 2016 = (r307755) >> +++ head/sys/sys/_types.h Fri Oct 21 23:50:02 2016 = (r307756) >> @@ -100,6 +100,11 @@ typedef __uint_least32_t __char32_t; >> #define _CHAR32_T_DECLARED >> #endif >>=20 >> +typedef struct { >=20 > Should this be union per the commit message? You would be inclined to think so, but the strange way this is defined is only to be compatible with gcc's definition, which was introduced here in 2011: = https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/ginclude/stddef.h?r1=3D181048&r2= =3D181047&pathrev=3D181048 > Ideally I'd add a void * as well since that will support systems like > CHERI where pointers are the largest type. Is void * larger than a struct with long long and long double? I'd think this would be at least 128 bits on almost all architectures? In any case, if you want to change this definition, it is probably best to first check it with upstream gcc, otherwise you'll end up with an incompatibility. -Dimitry --Apple-Mail=_22889CC7-FD96-4BA8-83DC-1798341EBBA8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlgLcOkACgkQsF6jCi4glqMwaQCfSjtamAUoC7N1raA1m4KXJQ/h MgcAn22khZQ9Ou3ozpMGSm6LJoqOAWcE =nXwd -----END PGP SIGNATURE----- --Apple-Mail=_22889CC7-FD96-4BA8-83DC-1798341EBBA8-- From owner-svn-src-head@freebsd.org Sat Oct 22 14:16:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1EC0C1C329; Sat, 22 Oct 2016 14:16:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E7953A7; Sat, 22 Oct 2016 14:16:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::f9cd:eb1b:c961:7062] (unknown [IPv6:2001:7b8:3a7:0:f9cd:eb1b:c961:7062]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E58E91360B; Sat, 22 Oct 2016 16:16:19 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_28DABD1C-67B4-437C-BECC-29ABA83694D3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r307756 - in head: include sys/sys From: Dimitry Andric In-Reply-To: <0C5786D6-EB91-4762-9FAB-4C447EAB0AF8@FreeBSD.org> Date: Sat, 22 Oct 2016 16:16:10 +0200 Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <6A32024C-BEAC-43FE-8581-CBCCCB1D1F34@FreeBSD.org> References: <201610212350.u9LNo2PT031675@repo.freebsd.org> <20161022000056.GC95989@spindle.one-eyed-alien.net> <0C5786D6-EB91-4762-9FAB-4C447EAB0AF8@FreeBSD.org> To: Brooks Davis X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 14:16:22 -0000 --Apple-Mail=_28DABD1C-67B4-437C-BECC-29ABA83694D3 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 22 Oct 2016, at 16:00, Dimitry Andric wrote: > > On 22 Oct 2016, at 02:00, Brooks Davis wrote: ... >> Ideally I'd add a void * as well since that will support systems like >> CHERI where pointers are the largest type. > > Is void * larger than a struct with long long and long double? I'd > think this would be at least 128 bits on almost all architectures? > > In any case, if you want to change this definition, it is probably best > to first check it with upstream gcc, otherwise you'll end up with an > incompatibility. For some more historic context, see this LLVM commit: http://llvm.org/viewvc/llvm-project?view=revision&revision=201729 ------------------------------------------------------------------------ r201729 | chandlerc | 2014-02-19 23:35:01 +0100 (Wed, 19 Feb 2014) | 20 lines Teach Clang to provide ::max_align_t in C11 and C++11 modes. This definition is not chosen idly. There is an unfortunate reality with max_align_t -- the specific nature of its definition leaks into the ABI almost immediately. Because it is part of C11 and C++11 it becomes essential for it to match with other systems on that ABI. There is an effort to discourage any further use of this construct as a consequence -- using max_align_t introduces an immediate ABI problem. We can never update it to have larger alignment even as the microarchitecture changes to necessitate higher alignment. =/ The particular definition here exactly matches the ABI of GCC's chosen ::max_align_t definition, for better or worse. This was written with the help of Richard Smith who was decoding the exact ABI implications of the selected definition in GCC. Notably, in-register arguments are impacted by the particular definition chosen. =/ No one is under the illusion that this is a "good" or "useful" definition of max_align_t, and we are working with the standards committee to specify a more useful interface to address this need. ------------------------------------------------------------------------ E.g., it is likely better to avoid using max_align_t altogether. -Dimitry --Apple-Mail=_28DABD1C-67B4-437C-BECC-29ABA83694D3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlgLdLMACgkQsF6jCi4glqNbJwCdGNzIy5gP+W9jYFwmfdkYAfcF 2YEAn1hoQhtsgK4ak27sffE/LmOzG21h =RPfZ -----END PGP SIGNATURE----- --Apple-Mail=_28DABD1C-67B4-437C-BECC-29ABA83694D3-- From owner-svn-src-head@freebsd.org Sat Oct 22 14:37:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115B6C1C988; Sat, 22 Oct 2016 14:37:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id D4DD710AE; Sat, 22 Oct 2016 14:37:14 +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 u9MEbDpl070112; Sat, 22 Oct 2016 14:37:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MEbDLR070111; Sat, 22 Oct 2016 14:37:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201610221437.u9MEbDLR070111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 22 Oct 2016 14:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307774 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 14:37:15 -0000 Author: trasz Date: Sat Oct 22 14:37:13 2016 New Revision: 307774 URL: https://svnweb.freebsd.org/changeset/base/307774 Log: Fix libusb20_dev_get_desc(3) to use the "vendor product" order, not "product vendor". This is consistent with how it's generally done. The ordering is visible eg in usbconfig(8) output. Note to self: MFC this to 9 and 8. Reviewed by: hselasky@ MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8258 Modified: head/lib/libusb/libusb20_ugen20.c Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Sat Oct 22 13:20:02 2016 (r307773) +++ head/lib/libusb/libusb20_ugen20.c Sat Oct 22 14:37:13 2016 (r307774) @@ -214,8 +214,8 @@ ugen20_enumerate(struct libusb20_device snprintf(pdev->usb_desc, sizeof(pdev->usb_desc), USB_GENERIC_NAME "%u.%u: <%s %s> at usbus%u", pdev->bus_number, - pdev->device_address, devinfo.udi_product, - devinfo.udi_vendor, pdev->bus_number); + pdev->device_address, devinfo.udi_vendor, + devinfo.udi_product, pdev->bus_number); error = 0; done: From owner-svn-src-head@freebsd.org Sat Oct 22 17:21:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AF9BC1DB84; Sat, 22 Oct 2016 17:21:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 06247EC1; Sat, 22 Oct 2016 17:21:22 +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 u9MHLMcU033959; Sat, 22 Oct 2016 17:21:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MHLMMa033957; Sat, 22 Oct 2016 17:21:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201610221721.u9MHLMMa033957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 22 Oct 2016 17:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307779 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 17:21:23 -0000 Author: tuexen Date: Sat Oct 22 17:21:21 2016 New Revision: 307779 URL: https://svnweb.freebsd.org/changeset/base/307779 Log: No functional changes, mostly getting the whitespace changes resulting from an updated formatting tool chain. MFC after: 1 month Modified: head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Sat Oct 22 16:42:49 2016 (r307778) +++ head/sys/netinet/sctp_bsd_addr.c Sat Oct 22 17:21:21 2016 (r307779) @@ -140,7 +140,6 @@ sctp_gather_internal_ifa_flags(struct sc ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE; } } - #endif /* INET6 */ @@ -201,10 +200,8 @@ sctp_init_ifns_for_vrf(int vrfid) struct ifaddr *ifa; struct sctp_ifa *sctp_ifa; uint32_t ifa_flags; - #ifdef INET6 struct in6_ifaddr *ifa6; - #endif IFNET_RLOCK(); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Oct 22 16:42:49 2016 (r307778) +++ head/sys/netinet/sctp_output.c Sat Oct 22 17:21:21 2016 (r307779) @@ -1943,7 +1943,6 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct sctp_paramhdr *parmh; struct mbuf *mret; uint16_t plen; - #endif switch (ifa->address.sa.sa_family) { @@ -2139,10 +2138,8 @@ skip_count: cnt++; total_count++; if (cnt >= 2) { - /* - * two from each - * address - */ + /* two from each + * address */ break; } if (total_count > SCTP_ADDRESS_LIMIT) { @@ -2784,7 +2781,6 @@ sctp_select_nth_preferred_addr_from_ifn_ { struct sctp_ifa *ifa, *sifa; int num_eligible_addr = 0; - #ifdef INET6 struct sockaddr_in6 sin6, lsa6; @@ -2829,10 +2825,8 @@ sctp_select_nth_preferred_addr_from_ifn_ if (fam == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(&sifa->address.sin6.sin6_addr) && IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr)) { - /* - * link-local <-> link-local must belong to the same - * scope. - */ + /* link-local <-> link-local must belong to the same + * scope. */ memcpy(&lsa6, &sifa->address.sin6, sizeof(struct sockaddr_in6)); (void)sa6_recoverscope(&lsa6); if (sin6.sin6_scope_id != lsa6.sin6_scope_id) { @@ -2966,10 +2960,8 @@ sctp_choose_boundall(struct sctp_inpcb * struct sctp_ifa *sctp_ifa, *sifa; uint32_t ifn_index; struct sctp_vrf *vrf; - #ifdef INET int retried = 0; - #endif /*- @@ -3315,14 +3307,11 @@ sctp_source_address_selection(struct sct struct sctp_ifa *answer; uint8_t dest_is_priv, dest_is_loop; sa_family_t fam; - #ifdef INET struct sockaddr_in *to = (struct sockaddr_in *)&ro->ro_dst; - #endif #ifdef INET6 struct sockaddr_in6 *to6 = (struct sockaddr_in6 *)&ro->ro_dst; - #endif /** @@ -3570,14 +3559,11 @@ sctp_process_cmsgs_for_init(struct sctp_ struct cmsghdr cmh; int tlen, at; struct sctp_initmsg initmsg; - #ifdef INET struct sockaddr_in sin; - #endif #ifdef INET6 struct sockaddr_in6 sin6; - #endif tlen = SCTP_BUF_LEN(control); @@ -3618,10 +3604,8 @@ sctp_process_cmsgs_for_init(struct sctp_ if (stcb->asoc.streamoutcnt < stcb->asoc.pre_open_streams) { struct sctp_stream_out *tmp_str; unsigned int i; - #if defined(SCTP_DETAILED_STR_STATS) int j; - #endif /* Default is NOT correct */ @@ -3744,14 +3728,11 @@ sctp_findassociation_cmsgs(struct sctp_i int tlen, at; struct sctp_tcb *stcb; struct sockaddr *addr; - #ifdef INET struct sockaddr_in sin; - #endif #ifdef INET6 struct sockaddr_in6 sin6; - #endif tlen = SCTP_BUF_LEN(control); @@ -3970,7 +3951,6 @@ sctp_handle_no_route(struct sctp_tcb *st } } } - #endif static int @@ -4016,22 +3996,17 @@ sctp_lowlevel_chunk_output(struct sctp_i struct sctphdr *sctphdr; int packet_length; int ret; - #if defined(INET) || defined(INET6) uint32_t vrf_id; - #endif #if defined(INET) || defined(INET6) struct mbuf *o_pak; sctp_route_t *ro = NULL; struct udphdr *udp = NULL; - #endif uint8_t tos_value; - #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so = NULL; - #endif if ((net) && (net->dest_state & SCTP_ADDR_OUT_OF_SCOPE)) { @@ -4289,10 +4264,8 @@ sctp_lowlevel_chunk_output(struct sctp_i /* free tempy routes */ RO_RTFREE(ro); } else { - /* - * PMTU check versus smallest asoc MTU goes - * here - */ + /* PMTU check versus smallest asoc MTU goes + * here */ if ((ro->ro_rt != NULL) && (net->ro._s_addr)) { uint32_t mtu; @@ -4567,10 +4540,8 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT3, (struct sockaddr *)sin6); if (net) { sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; - /* - * preserve the port and scope for link - * local send - */ + /* preserve the port and scope for link + * local send */ prev_scope = sin6->sin6_scope_id; prev_port = sin6->sin6_port; } @@ -4636,10 +4607,8 @@ sctp_lowlevel_chunk_output(struct sctp_i /* Now if we had a temp route free it */ RO_RTFREE(ro); } else { - /* - * PMTU check versus smallest asoc MTU goes - * here - */ + /* PMTU check versus smallest asoc MTU goes + * here */ if (ro->ro_rt == NULL) { /* Route was freed */ if (net->ro._s_addr && @@ -4969,11 +4938,11 @@ sctp_arethere_unrecognized_parameters(st * being equal to the beginning of the params i.e. (iphlen + * sizeof(struct sctp_init_msg) parse through the parameters to the * end of the mbuf verifying that all parameters are known. - * + * * For unknown parameters build and return a mbuf with * UNRECOGNIZED_PARAMETER errors. If the flags indicate to stop * processing this chunk stop, and set *abort_processing to 1. - * + * * By having param_offset be pre-set to where parameters begin it is * hoped that this routine may be reused in the future by new * features. @@ -5260,7 +5229,6 @@ invalid_size: *abort_processing = 1; if ((op_err == NULL) && phdr) { int l_len; - #ifdef INET6 l_len = SCTP_MIN_OVERHEAD; #else @@ -5318,14 +5286,11 @@ sctp_are_there_new_addresses(struct sctp uint8_t fnd; struct sctp_nets *net; int check_src; - #ifdef INET struct sockaddr_in sin4, *sa4; - #endif #ifdef INET6 struct sockaddr_in6 sin6, *sa6; - #endif #ifdef INET @@ -5509,18 +5474,15 @@ sctp_send_initiate_ack(struct sctp_inpcb struct sctp_paramhdr *ph; union sctp_sockstore *over_addr; struct sctp_scoping scp; - #ifdef INET struct sockaddr_in *dst4 = (struct sockaddr_in *)dst; struct sockaddr_in *src4 = (struct sockaddr_in *)src; struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *dst6 = (struct sockaddr_in6 *)dst; struct sockaddr_in6 *src6 = (struct sockaddr_in6 *)src; struct sockaddr_in6 *sin6; - #endif struct sockaddr *to; struct sctp_state_cookie stc; @@ -5544,10 +5506,10 @@ sctp_send_initiate_ack(struct sctp_inpcb /* * new addresses, out of here in non-cookie-wait * states - * - * Send an ABORT, without the new address error cause. - * This looks no different than if no listener was - * present. + * + * Send an ABORT, without the new address error + * cause. This looks no different than if no + * listener was present. */ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); @@ -5560,9 +5522,9 @@ sctp_send_initiate_ack(struct sctp_inpcb /* * change of remote encapsulation port, out of here * in non-cookie-wait states - * - * Send an ABORT, without an specific error cause. This - * looks no different than if no listener was + * + * Send an ABORT, without an specific error cause. + * This looks no different than if no listener was * present. */ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), @@ -5716,10 +5678,8 @@ do_a_abort: * show up in our scoped count. */ cnt_inits_to = 1; - /* - * pull out the scope_id from - * incoming pkt - */ + /* pull out the scope_id from + * incoming pkt */ } else if (IN6_IS_ADDR_SITELOCAL(&src6->sin6_addr) || IN6_IS_ADDR_SITELOCAL(&dst6->sin6_addr)) { /* @@ -5744,7 +5704,6 @@ do_a_abort: #ifdef INET6 struct sctp_nets *lnet; - #endif stc.loopback_scope = asoc->scope.loopback_scope; @@ -6206,9 +6165,9 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, if (freed_spc >= dataout) { return; } - } /* if chunk was present */ - } /* if of sufficient priority */ - } /* if chunk has enabled */ + } /* if chunk was present */ + } /* if of sufficient priority */ + } /* if chunk has enabled */ } /* tailqforeach */ TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { @@ -6229,11 +6188,11 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, if (freed_spc >= dataout) { return; } - } /* end if chk->data */ - } /* end if right class */ - } /* end if chk pr-sctp */ + } /* end if chk->data */ + } /* end if right class */ + } /* end if chk pr-sctp */ } /* tailqforeachsafe (chk) */ - } /* if enabled in asoc */ + } /* if enabled in asoc */ } int @@ -6476,10 +6435,8 @@ error_out: /* get the prepend space */ SCTP_BUF_RESV_UF(outchain, (SCTP_FIRST_MBUF_RESV + 4)); } else { - /* - * We really should not get a NULL - * in endofchain - */ + /* We really should not get a NULL + * in endofchain */ /* find end */ m = outchain; while (m) { @@ -6491,10 +6448,8 @@ error_out: } /* sanity */ if (*endofchain == NULL) { - /* - * huh, TSNH XXX maybe we - * should panic - */ + /* huh, TSNH XXX maybe we + * should panic */ sctp_m_freem(outchain); goto new_mbuf; } @@ -6693,17 +6648,13 @@ sctp_sendall_iterator(struct sctp_inpcb if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { goto abort_anyway; } - /* - * there is nothing queued to send, so I'm - * done... - */ + /* there is nothing queued to send, so I'm + * done... */ if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { - /* - * only send SHUTDOWN the first time - * through - */ + /* only send SHUTDOWN the first time + * through */ if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } @@ -7334,10 +7285,8 @@ re_look: SCTP_TCB_SEND_LOCK(stcb); send_lock_up = 1; if (sp->msg_is_complete) { - /* - * the sender finished the - * msg - */ + /* the sender finished the + * msg */ goto re_look; } } @@ -7955,9 +7904,9 @@ nothing_to_send: * (when CMT is off) then it calls * sctp_fill_outqueue for the net. This gets data on * the send queue for that network. - * - * In sctp_fill_outqueue TSN's are assigned and data is - * copied out of the stream buffers. Note mostly + * + * In sctp_fill_outqueue TSN's are assigned and data + * is copied out of the stream buffers. Note mostly * copy by reference (we hope). */ net->window_probe = 0; @@ -8226,10 +8175,8 @@ again_one_more_time: net->port, NULL, 0, 0, so_locked))) { - /* - * error, we could not - * output - */ + /* error, we could not + * output */ SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); if (from_where == 0) { SCTP_STAT_INCR(sctps_lowlevelerrusr); @@ -8302,16 +8249,12 @@ again_one_more_time: * to where the sack is going.. */ if (chk->whoTo == net) { - /* - * Don't transmit it to where its - * going (current net) - */ + /* Don't transmit it to where its + * going (current net) */ continue; } else if (sack_goes_to == net) { - /* - * But do transmit it to this - * address - */ + /* But do transmit it to this + * address */ goto skip_net_check; } } @@ -8504,10 +8447,8 @@ again_one_more_time: net->port, NULL, 0, 0, so_locked))) { - /* - * error, we could not - * output - */ + /* error, we could not + * output */ SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); if (from_where == 0) { SCTP_STAT_INCR(sctps_lowlevelerrusr); @@ -8704,17 +8645,13 @@ again_one_more_time: override_ok = 0; SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } else if (override_ok) { - /* - * use this data's - * keyid - */ + /* use this data's + * keyid */ auth_keyid = chk->auth_keyid; override_ok = 0; } else if (auth_keyid != chk->auth_keyid) { - /* - * different keyid, - * so done bundling - */ + /* different keyid, + * so done bundling */ break; } } @@ -8793,8 +8730,7 @@ again_one_more_time: break; } } /* for (chunk gather loop for this net) */ - } /* if asoc.state OPEN */ -no_data_fill: +} /* if asoc.state OPEN */ no_data_fill: /* Is there something to send for this destination? */ if (outchain) { /* We may need to start a control timer or two */ @@ -9734,10 +9670,8 @@ one_chunk_around: auth_keyid = fwd->auth_keyid; override_ok = 0; } else if (fwd->auth_keyid != auth_keyid) { - /* - * different keyid, - * so done bundling - */ + /* different keyid, + * so done bundling */ break; } } @@ -10113,11 +10047,9 @@ do_it_again: if (asoc->max_burst > 0) { if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { if ((net->flight_size + (asoc->max_burst * net->mtu)) < net->cwnd) { - /* - * JRS - Use the congestion + /* JRS - Use the congestion * control given in the - * congestion control module - */ + * congestion control module */ asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, asoc->max_burst); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { sctp_log_maxburst(stcb, net, 0, asoc->max_burst, SCTP_MAX_BURST_APPLIED); @@ -10127,10 +10059,8 @@ do_it_again: net->fast_retran_ip = 0; } else { if (net->flight_size == 0) { - /* - * Should be decaying the - * cwnd here - */ + /* Should be decaying the + * cwnd here */ ; } } @@ -11017,23 +10947,18 @@ sctp_send_resp_msg(struct sockaddr *src, struct mbuf *mout; struct sctphdr *shout; struct sctp_chunkhdr *ch; - #if defined(INET) || defined(INET6) struct udphdr *udp; int ret; - #endif int len, cause_len, padding_len; - #ifdef INET struct sockaddr_in *src_sin, *dst_sin; struct ip *ip; - #endif #ifdef INET6 struct sockaddr_in6 *src_sin6, *dst_sin6; struct ip6_hdr *ip6; - #endif /* Compute the length of the cause and add final padding. */ @@ -11622,10 +11547,8 @@ sctp_send_cwr(struct sctp_tcb *stcb, str asoc = &stcb->asoc; TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) { - /* - * found a previous CWR queued to same destination - * update it if needed - */ + /* found a previous CWR queued to same destination + * update it if needed */ uint32_t ctsn; cwr = mtod(chk->data, struct sctp_cwr_chunk *); @@ -12169,10 +12092,8 @@ sctp_send_str_reset_req(struct sctp_tcb struct sctp_stream_out *oldstream; struct sctp_stream_queue_pending *sp, *nsp; int i; - #if defined(SCTP_DETAILED_STR_STATS) int j; - #endif oldstream = stcb->asoc.strmout; @@ -12204,10 +12125,8 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].state = oldstream[i].state; /* FIX ME FIX ME */ - /* - * This should be a SS_COPY operation FIX ME STREAM - * SCHEDULER EXPERT - */ + /* This should be a SS_COPY operation FIX ME STREAM + * SCHEDULER EXPERT */ stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], &oldstream[i]); /* now anything on those queues? */ TAILQ_FOREACH_SAFE(sp, &oldstream[i].outqueue, next, nsp) { @@ -12451,10 +12370,8 @@ sctp_sosend(struct socket *so, int error, use_sndinfo = 0; struct sctp_sndrcvinfo sndrcvninfo; struct sockaddr *addr_to_use; - #if defined(INET) && defined(INET6) struct sockaddr_in sin; - #endif if (control) { @@ -12739,10 +12656,8 @@ sctp_lower_sosend(struct socket *so, } if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; - /* - * Set the connected flag so we can queue - * data - */ + /* Set the connected flag so we can queue + * data */ soisconnecting(so); } hold_tcblock = 1; @@ -12752,10 +12667,8 @@ sctp_lower_sosend(struct socket *so, } else { SCTP_PRINTF("Huh-3? create lock should have been on??\n"); } - /* - * Turn on queue only flag to prevent data from - * being sent - */ + /* Turn on queue only flag to prevent data from + * being sent */ queue_only = 1; asoc = &stcb->asoc; SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT); @@ -13248,10 +13161,8 @@ skip_preblock: } /* PR-SCTP? */ if ((asoc->prsctp_supported) && (asoc->sent_queue_cnt_removeable > 0)) { - /* - * This is ugly but we must assure locking - * order - */ + /* This is ugly but we must assure locking + * order */ if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); hold_tcblock = 1; @@ -13528,10 +13439,8 @@ dataless_eof: msg); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_LOCKED); - /* - * now relock the stcb so everything - * is sane - */ + /* now relock the stcb so everything + * is sane */ hold_tcblock = 0; stcb = NULL; goto out; @@ -13605,10 +13514,8 @@ skip_out_eof: if ((queue_only == 0) && (nagle_applies == 0) && (stcb->asoc.peers_rwnd && un_sent)) { /* we can attempt to send too. */ if (hold_tcblock == 0) { - /* - * If there is activity recv'ing sacks no need to - * send - */ + /* If there is activity recv'ing sacks no need to + * send */ if (SCTP_TCB_TRYLOCK(stcb)) { sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_USR_SEND, SCTP_SO_LOCKED); hold_tcblock = 1; @@ -13776,10 +13683,9 @@ sctp_v6src_match_nexthop(struct sockaddr SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)&gw6); SCTPDBG(SCTP_DEBUG_OUTPUT2, "installed router is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, ro->ro_rt->rt_gateway); - if (sctp_cmpaddr((struct sockaddr *)&gw6, - ro->ro_rt->rt_gateway)) { - SCTPDBG(SCTP_DEBUG_OUTPUT2, "pfxrouter is installed\n"); + if (sctp_cmpaddr((struct sockaddr *)&gw6, ro->ro_rt->rt_gateway)) { ND6_RUNLOCK(); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "pfxrouter is installed\n"); return (1); } } @@ -13787,7 +13693,6 @@ sctp_v6src_match_nexthop(struct sockaddr SCTPDBG(SCTP_DEBUG_OUTPUT2, "pfxrouter is not installed\n"); return (0); } - #endif int From owner-svn-src-head@freebsd.org Sat Oct 22 18:02:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA75C1D5A1; Sat, 22 Oct 2016 18:02:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id E3B3A225; Sat, 22 Oct 2016 18:02:21 +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 u9MI2Lnl048890; Sat, 22 Oct 2016 18:02:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MI2LXw048889; Sat, 22 Oct 2016 18:02:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201610221802.u9MI2LXw048889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 22 Oct 2016 18:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307780 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 18:02:22 -0000 Author: cem Date: Sat Oct 22 18:02:20 2016 New Revision: 307780 URL: https://svnweb.freebsd.org/changeset/base/307780 Log: ddb(4): Add sleepchains to "show allchains" Reported by: markj Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8320 Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sat Oct 22 17:21:21 2016 (r307779) +++ head/sys/kern/subr_turnstile.c Sat Oct 22 18:02:20 2016 (r307780) @@ -157,6 +157,9 @@ static void init_turnstile0(void *dummy) #ifdef TURNSTILE_PROFILING static void init_turnstile_profiling(void *arg); #endif +#ifdef DDB +static void print_sleepchain(struct thread *td, const char *prefix); +#endif static void propagate_priority(struct thread *td); static int turnstile_adjust_thread(struct turnstile *ts, struct thread *td); @@ -1169,6 +1172,10 @@ DB_SHOW_ALL_COMMAND(chains, db_show_allc db_printf("chain %d:\n", i++); print_lockchain(td, " "); } + if (TD_IS_INHIBITED(td) && TD_ON_SLEEPQ(td)) { + db_printf("chain %d:\n", i++); + print_sleepchain(td, " "); + } if (db_pager_quit) return; } From owner-svn-src-head@freebsd.org Sat Oct 22 19:24:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F9AFC1D971; Sat, 22 Oct 2016 19:24:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6A75CCD4; Sat, 22 Oct 2016 19:24:47 +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 u9MJOk0W079642; Sat, 22 Oct 2016 19:24:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MJOkIR079638; Sat, 22 Oct 2016 19:24:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610221924.u9MJOkIR079638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 19:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307783 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 19:24:47 -0000 Author: bapt Date: Sat Oct 22 19:24:46 2016 New Revision: 307783 URL: https://svnweb.freebsd.org/changeset/base/307783 Log: Import tzdata 2016h MFC after: 2 days Modified: head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/northamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Sat Oct 22 19:19:31 2016 (r307782) +++ head/contrib/tzdata/asia Sat Oct 22 19:24:46 2016 (r307783) @@ -2544,11 +2544,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Paul Eggert (2015-03-03): # http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014 # says that the fall 2014 transition was Oct 23 at 24:00. -# For future dates, guess the last Friday in March at 24:00 through -# the first Friday on or after October 21 at 00:00. This is consistent with -# the predictions in today's editions of the following URLs: -# http://www.timeanddate.com/time/change/gaza-strip/gaza -# http://www.timeanddate.com/time/change/west-bank/hebron # From Hannah Kreitem (2016-03-09): # http://www.palestinecabinet.gov.ps/WebSite/ar/ViewDetails?ID=31728 @@ -2558,7 +2553,21 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # # From Paul Eggert (2016-03-12): # Predict spring transitions on March's last Saturday at 01:00 from now on. -# Leave fall predictions alone for now. + +# From Sharef Mustafa (2016-10-19): +# [T]he Palestinian cabinet decision (Mar 8th 2016) published on +# http://www.palestinecabinet.gov.ps/WebSite/Upload/Decree/GOV_17/16032016134830.pdf +# states that summer time will end on Oct 29th at 01:00. +# +# From Tim Parenti (2016-10-19): +# Predict fall transitions on October's last Saturday at 01:00 from now on. +# This is consistent with the 2016 transition as well as our spring +# predictions. +# +# From Paul Eggert (2016-10-19): +# It's also consistent with predictions in the following URLs today: +# http://www.timeanddate.com/time/change/gaza-strip/gaza +# http://www.timeanddate.com/time/change/west-bank/hebron # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2587,9 +2596,10 @@ Rule Palestine 2011 only - Sep 30 0:00 0 Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - -Rule Palestine 2014 max - Oct Fri>=21 0:00 0 - +Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S Rule Palestine 2016 max - Mar lastSat 1:00 1:00 S +Rule Palestine 2016 max - Oct lastSat 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2739,45 +2749,31 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 J # People who live in regions under Tamil control can use [TZ='Asia/Kolkata'], # as that zone has agreed with the Tamil areas since our cutoff date of 1970. -# From K Sethu (2006-04-25): -# I think the abbreviation LKT originated from the world of computers at -# the time of or subsequent to the time zone changes by SL Government -# twice in 1996 and probably SL Government or its standardization -# agencies never declared an abbreviation as a national standard. -# -# I recollect before the recent change the government announcements -# mentioning it as simply changing Sri Lanka Standard Time or Sri Lanka -# Time and no mention was made about the abbreviation. -# -# If we look at Sri Lanka Department of Government's "Official News -# Website of Sri Lanka" ... http://www.news.lk/ we can see that they -# use SLT as abbreviation in time stamp at the beginning of each news -# item.... -# -# Within Sri Lanka I think LKT is well known among computer users and -# administrators. In my opinion SLT may not be a good choice because the -# nation's largest telcom / internet operator Sri Lanka Telcom is well -# known by that abbreviation - simply as SLT (there IP domains are -# slt.lk and sltnet.lk). -# -# But if indeed our government has adopted SLT as standard abbreviation -# (that we have not known so far) then it is better that it be used for -# all computers. - -# From Paul Eggert (2006-04-25): -# One possibility is that we wait for a bit for the dust to settle down -# and then see what people actually say in practice. +# From Sadika Sumanapala (2016-10-19): +# According to http://www.sltime.org (maintained by Measurement Units, +# Standards & Services Department, Sri Lanka) abbreviation for Sri Lanka +# standard time is SLST. +# +# From Paul Eggert (2016-10-18): +# "SLST" seems to be reasonably recent and rarely-used outside time +# zone nerd sources. I searched Google News and found three uses of +# it in the International Business Times of India in February and +# March of this year when discussing cricket match times, but nothing +# since then (though there has been a lot of cricket) and nothing in +# other English-language news sources. Our old abbreviation "LKT" is +# even worse. For now, let's use a numeric abbreviation; we can +# switch to "SLST" if it catches on. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Colombo 5:19:24 - LMT 1880 5:19:32 - MMT 1906 # Moratuwa Mean Time - 5:30 - IST 1942 Jan 5 - 5:30 0:30 IHST 1942 Sep - 5:30 1:00 IST 1945 Oct 16 2:00 - 5:30 - IST 1996 May 25 0:00 - 6:30 - LKT 1996 Oct 26 0:30 - 6:00 - LKT 2006 Apr 15 0:30 - 5:30 - IST + 5:30 - +0530 1942 Jan 5 + 5:30 0:30 +0530/+06 1942 Sep + 5:30 1:00 +0530/+0630 1945 Oct 16 2:00 + 5:30 - +0530 1996 May 25 0:00 + 6:30 - +0630 1996 Oct 26 0:30 + 6:00 - +06 2006 Apr 15 0:30 + 5:30 - +0530 # Syria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Sat Oct 22 19:19:31 2016 (r307782) +++ head/contrib/tzdata/australasia Sat Oct 22 19:24:46 2016 (r307783) @@ -350,7 +350,13 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # commencing at 2.00 am on Sunday 1st November, 2015 and ending at # 3.00 am on Sunday 17th January, 2016. -# From Paul Eggert (2015-09-01): +# From Raymond Kumar (2016-10-04): +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-6th-NOVEMBER,-2016.aspx +# "Fiji's daylight savings will begin on Sunday, 6 November 2016, when +# clocks go forward an hour at 2am to 3am.... Daylight Saving will +# end at 3.00am on Sunday 15th January 2017." + +# From Paul Eggert (2016-10-03): # For now, guess DST from 02:00 the first Sunday in November to # 03:00 the third Sunday in January. Although ad hoc, it matches # transitions since late 2014 and seems more likely to match future Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Sat Oct 22 19:19:31 2016 (r307782) +++ head/contrib/tzdata/europe Sat Oct 22 19:24:46 2016 (r307783) @@ -1908,7 +1908,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Ma # Amsterdam mean time. # The data entries before 1945 are taken from -# http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm +# http://www.staff.science.uu.nl/~gent0113/idl/idl.htm # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time @@ -3427,22 +3427,24 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # Turkey -# From Amar Devegowda (2007-01-03): -# The time zone rules for Istanbul, Turkey have not been changed for years now. -# ... The latest rules are available at: -# http://www.timeanddate.com/worldclock/timezone.html?n=107 -# From Steffen Thorsen (2007-01-03): -# I have been able to find press records back to 1996 which all say that -# DST started 01:00 local time and end at 02:00 local time. I am not sure -# what happened before that. One example for each year from 1996 to 2001: -# http://newspot.byegm.gov.tr/arsiv/1996/21/N4.htm -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING97/03/97X03X25.TXT -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING98/03/98X03X02.HTM -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING99/10/99X10X26.HTM#%2016 -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2000/03/00X03X06.HTM#%2021 -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2001/03/23x03x01.HTM#%2027 -# From Paul Eggert (2007-01-03): -# Prefer the above source to Shanks & Pottenger for time stamps after 1990. +# From Kıvanç Yazan (2016-09-25): +# 1) For 1986-2006, DST started at 01:00 local and ended at 02:00 local, with +# no exceptions. +# 2) 1994's lastSun was overridden with Mar 20 ... +# Here are official papers: +# http://www.resmigazete.gov.tr/arsiv/19032.pdf - page 2 for 1986 +# http://www.resmigazete.gov.tr/arsiv/19400.pdf - page 4 for 1987 +# http://www.resmigazete.gov.tr/arsiv/19752.pdf - page 15 for 1988 +# http://www.resmigazete.gov.tr/arsiv/20102.pdf - page 6 for 1989 +# http://www.resmigazete.gov.tr/arsiv/20464.pdf - page 1 for 1990 - 1992 +# http://www.resmigazete.gov.tr/arsiv/21531.pdf - page 15 for 1993 - 1995 +# http://www.resmigazete.gov.tr/arsiv/21879.pdf - page 1 for overriding 1994 +# http://www.resmigazete.gov.tr/arsiv/22588.pdf - page 1 for 1996, 1997 +# http://www.resmigazete.gov.tr/arsiv/23286.pdf - page 10 for 1998 - 2000 +# http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001 +# http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006 +# From Paul Eggert (2016-09-25): +# Prefer the above sources to Shanks & Pottenger for time stamps after 1985. # From Steffen Thorsen (2007-03-09): # Starting 2007 though, it seems that they are adopting EU's 1:00 UTC @@ -3551,10 +3553,10 @@ Rule Turkey 1983 only - Jul 31 0:00 1:00 Rule Turkey 1983 only - Oct 2 0:00 0 - Rule Turkey 1985 only - Apr 20 0:00 1:00 S Rule Turkey 1985 only - Sep 28 0:00 0 - -Rule Turkey 1986 1990 - Mar lastSun 2:00s 1:00 S -Rule Turkey 1986 1990 - Sep lastSun 2:00s 0 - -Rule Turkey 1991 2006 - Mar lastSun 1:00s 1:00 S -Rule Turkey 1991 1995 - Sep lastSun 1:00s 0 - +Rule Turkey 1986 1993 - Mar lastSun 1:00s 1:00 S +Rule Turkey 1986 1995 - Sep lastSun 1:00s 0 - +Rule Turkey 1994 only - Mar 20 1:00s 1:00 S +Rule Turkey 1995 2006 - Mar lastSun 1:00s 1:00 S Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/Istanbul 1:55:52 - LMT 1880 Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Sat Oct 22 19:19:31 2016 (r307782) +++ head/contrib/tzdata/northamerica Sat Oct 22 19:24:46 2016 (r307783) @@ -24,8 +24,32 @@ # was the result of his proposals at the Convention of Railroad Trunk Lines # in New York City (1869-10). His 1870 proposal was based on Washington, DC, # but in 1872-05 he moved the proposed origin to Greenwich. -# His proposal was adopted by the railroads on 1883-11-18 at 12:00, -# and the most of the country soon followed suit. + +# From Paul Eggert (2016-09-21): +# Dowd's proposal left many details unresolved, such as where to draw +# lines between time zones. The key individual who made time zones +# work in the US was William Frederick Allen - railway engineer, +# managing editor of the Travelers' Guide, and secretary of the +# General Time Convention, a railway standardization group. Allen +# spent months in dialogs with scientific and railway leaders, +# developed a workable plan to institute time zones, and presented it +# to the General Time Convention on 1883-04-11, saying that his plan +# meant "local time would be practically abolished" - a plus for +# railway scheduling. By the next convention on 1883-10-11 nearly all +# railroads had agreed and it took effect on 1883-11-18 at 12:00. +# That Sunday was called the "day of two noons", as the eastern parts +# of the new zones observed noon twice. Allen witnessed the +# transition in New York City, writing: +# +# I heard the bells of St. Paul's strike on the old time. Four +# minutes later, obedient to the electrical signal from the Naval +# Observatory ... the time-ball made its rapid descent, the chimes +# of old Trinity rang twelve measured strokes, and local time was +# abandoned, probably forever. +# +# Most of the US soon followed suit. See: +# Bartky IR. The adoption of standard time. Technol Cult 1989 Jan;30(1):25-56. +# http://dx.doi.org/10.2307/3105430 # From Paul Eggert (2005-04-16): # That 1883 transition occurred at 12:00 new time, not at 12:00 old time. From owner-svn-src-head@freebsd.org Sat Oct 22 19:27:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4A7FC1D9FF; Sat, 22 Oct 2016 19:27:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 94AEAE61; Sat, 22 Oct 2016 19:27:50 +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 u9MJRnRX079795; Sat, 22 Oct 2016 19:27:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MJRnZu079794; Sat, 22 Oct 2016 19:27:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610221927.u9MJRnZu079794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Oct 2016 19:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307784 - head/gnu/usr.bin/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 19:27:50 -0000 Author: jhibbits Date: Sat Oct 22 19:27:49 2016 New Revision: 307784 URL: https://svnweb.freebsd.org/changeset/base/307784 Log: Fix a typo from a manual merge. Modified: head/gnu/usr.bin/cc/Makefile.tgt Modified: head/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- head/gnu/usr.bin/cc/Makefile.tgt Sat Oct 22 19:24:46 2016 (r307783) +++ head/gnu/usr.bin/cc/Makefile.tgt Sat Oct 22 19:27:49 2016 (r307784) @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64spe)/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif From owner-svn-src-head@freebsd.org Sat Oct 22 19:36:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 313B5C1DBC8; Sat, 22 Oct 2016 19:36:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 003E92D7; Sat, 22 Oct 2016 19:36:13 +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 u9MJaD5V083558; Sat, 22 Oct 2016 19:36:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MJaDrf083557; Sat, 22 Oct 2016 19:36:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610221936.u9MJaDrf083557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 19:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307785 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 19:36:14 -0000 Author: bapt Date: Sat Oct 22 19:36:12 2016 New Revision: 307785 URL: https://svnweb.freebsd.org/changeset/base/307785 Log: Import pci_vendors 2016.10.20 Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sat Oct 22 19:27:49 2016 (r307784) +++ head/share/misc/pci_vendors Sat Oct 22 19:36:12 2016 (r307785) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.10.03 -# Date: 2016-10-03 03:15:01 +# Version: 2016.10.20 +# Date: 2016-10-20 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -245,8 +245,13 @@ 0013 53c875a 1000 1000 LSI53C875A PCI to Ultra SCSI Controller 0014 MegaRAID Tri-Mode SAS3516 + 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter 0016 MegaRAID Tri-Mode SAS3508 + 1028 1fc9 PERC H840 Adapter + 1028 1fcb PERC H740P Adapter + 1028 1fcd PERC H740P Mini + 1028 1fcf PERC H740P Mini 1d49 0601 ThinkSystem RAID 930-8i 2GB Flash PCIe 12Gb Adapter 1d49 0603 ThinkSystem RAID 930-24i 4GB Flash PCIe 12Gb Adapter 1d49 0604 ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter @@ -376,6 +381,7 @@ 1028 1f4d PERC FD33xS 1028 1f4f PERC H730P Slim 1028 1f54 PERC FD33xD + 1028 1fd1 PERC H730P MX 17aa 1052 ThinkServer RAID 720i 17aa 1053 ThinkServer RAID 720ix 1d49 0600 ThinkSystem RAID 730-8i 1GB Cache PCIe 12Gb Adapter @@ -535,8 +541,11 @@ 0097 SAS3008 PCI-Express Fusion-MPT SAS-3 1000 3090 SAS9311-8i 1000 30e0 SAS9300-8i - 1028 1f45 12GB/s HBA internal + 1028 1f45 HBA330 Adapter 1028 1f46 12Gbps HBA + 1028 1f53 HBA330 Mini + 1028 1fd2 HBA330 MX + 1028 1fd3 HBA330 MMZ 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0201 ThinkSystem 9400-16i PCIe 12Gb HBA @@ -1588,7 +1597,7 @@ 1462 2938 Radeon R9 360 OEM 1462 3271 Radeon R9 360 OEM 1682 7360 Radeon R7 360 - 6660 Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330] + 6660 Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430] 1028 05ea Radeon HD 8670M 1028 06bf Radeon R5 M335 103c 1970 Radeon HD 8670M @@ -1596,6 +1605,7 @@ 103c 8136 Radeon R5 M330 17aa 3804 Radeon R5 M330 17aa 3809 Radeon R5 M330 + 17aa 381a Radeon R5 M430 17aa 390c Radeon R5 M330 6663 Sun PRO [Radeon HD 8570A/8570M] 1025 0846 Radeon HD 8570A @@ -2866,11 +2876,12 @@ 174b e180 Radeon HD 7350 17af 3015 Radeon HD 7350 68fe Cedar LE - 6900 Topaz XT [Radeon R7 M260/M265 / M340/M360] + 6900 Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445] 1025 1056 Radeon R7 M360 / R8 M365DX 1028 0640 Radeon R7 M260/M265 1028 0643 Radeon R7 M260/M265 1028 067f Radeon R7 M260 + 1028 0767 Radeon R7 M445 1028 130a Radeon R7 M260 103c 2263 Radeon R7 M260 103c 2269 Radeon R7 M260 @@ -2881,6 +2892,7 @@ 103c 80b5 Radeon R7 M360 103c 80b9 Radeon R7 M360 103c 811c Radeon R7 M340 + 103c 8226 Radeon R7 M440 10cf 1906 Radeon R7 M260 1170 9979 Radeon R7 M360 1179 f903 Radeon R7 M260 @@ -2892,6 +2904,7 @@ 17aa 5021 Radeon R7 M260 6901 Topaz PRO [Radeon R5 M255] 103c 1318 Radeon R6 M255DX + 6907 Meso XT [Radeon R5 M315] 6921 Amethyst XT [Radeon R9 M295X] 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] @@ -3349,7 +3362,7 @@ 99a4 Trinity [Radeon HD 7400G] aa00 R600 HDMI Audio [Radeon HD 2900 GT/PRO/XT] aa01 RV635 HDMI Audio [Radeon HD 3650/3730/3750] - aa08 RV630 HDMI Audio [Radeon HD 2600 Series] + aa08 RV630 HDMI Audio [Radeon HD 2600 PRO/XT / HD 3610] aa10 RV610 HDMI Audio [Radeon HD 2350 PRO / 2400 PRO/XT / HD 3410] 174b aa10 Radeon HD 2400 PRO 18bc aa10 Radeon HD 2400 PRO @@ -3369,10 +3382,10 @@ aa68 Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] 1028 aa68 XPS 8300 aa80 Cayman/Antilles HDMI Audio [Radeon HD 6930/6950/6970/6990] - aa88 Barts HDMI Audio [Radeon HD 6800 Series] + aa88 Barts HDMI Audio [Radeon HD 6790/6850/6870 / 7720 OEM] aa90 Turks HDMI Audio [Radeon HD 6500/6600 / 6700M Series] 1028 04a3 Precision M4600 - aa98 Caicos HDMI Audio [Radeon HD 6400 Series] + aa98 Caicos HDMI Audio [Radeon HD 6450 / 7450/8450/8490 OEM / R5 230/235/235X OEM] 174b aa98 Radeon HD 6450 1GB DDR3 aaa0 Tahiti HDMI Audio [Radeon HD 7870 XT / 7950/7970] aab0 Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] @@ -7347,6 +7360,7 @@ 8533 PEX 8533 32-lane, 6-port PCI Express Switch 8547 PEX 8547 48-lane, 3-port PCI Express Switch 8548 PEX 8548 48-lane, 9-port PCI Express Switch + 8603 PEX 8603 3-lane, 3-Port PCI Express Gen 2 (5.0 GT/s) Switch 8604 PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch 8605 PEX 8605 PCI Express 4-port Gen2 Switch 8606 PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch @@ -17921,7 +17935,7 @@ 1015 MT27710 Family [ConnectX-4 Lx] 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] - 1018 MT28800 Family [ConnectX-5 Virtual Function] + 1018 MT27800 Family [ConnectX-5 Virtual Function] 1019 MT28800 Family [ConnectX-5 Ex] 101a MT28800 Family [ConnectX-5 Ex Virtual Function] 101b MT28831 @@ -17932,6 +17946,7 @@ 1020 MT28860 1021 MT28861 1974 MT28800 Family [ConnectX-5 PCIe Bridge] + 1975 MT416842 Family [BlueField SoC PCIe Bridge] 5274 MT21108 InfiniBridge 5a44 MT23108 InfiniHost 5a45 MT23108 [Infinihost HCA Flash Recovery] @@ -17966,6 +17981,9 @@ 7121 NPS-600 configuration and management interface 7122 NPS-600 network interface PF 7123 NPS-600 network interface VF + a2d0 MT416842 + a2d1 MT416842 + a2d3 MT416842 BlueField multicore SoC family VF # SwitchX-2, 40GbE switch c738 MT51136 c739 MT51136 GW @@ -18638,7 +18656,12 @@ 7018 AP408: 32-Channel Digital I/O Module 701a AP220-16 12-Bit, 16-Channel Analog Output Module 701b AP231-16 16-Bit, 16-Channel Analog Output Module + 7021 APA7-201 Reconfigurable Artix-7 FPGA module 48 TTL channels + 7022 APA7-202 Reconfigurable Artix-7 FPGA module 24 RS485 channels + 7023 APA7-203 Reconfigurable Artix-7 FPGA module 24 TTL & 12 RS485 channels + 7024 APA7-204 Reconfigurable Artix-7 FPGA module 24 LVDS channels 7042 AP482 Counter Timer Module with TTL Level Input/Output + 7043 AP483 Counter Timer Module with TTL Level and RS422 Input/Output 7044 AP484 Counter Timer Module with RS422 Input/Output 16da Advantech Co., Ltd. 0011 INES GPIB-PCI @@ -18881,6 +18904,7 @@ 0401 Datacenter Technologies QDF2400 PCI Express Root Port 17cc NetChip Technology, Inc 2280 USB 2.0 +17cd Cadence Design Systems, Inc. 17cf Z-Com, Inc. 17d3 Areca Technology Corp. 1110 ARC-1110 4-Port PCI-X to SATA RAID Controller @@ -20290,7 +20314,8 @@ 1432 8102 EN-8102P 10GbE Ethernet Adapter 1fc9 3015 Ethernet Adapter 4026 TN9610 10GbE SFP+ Ethernet Adapter - 4027 TN9710 10GBase-T/NBASE-T Ethernet Adapter + 4027 TN9710P 10GBase-T/NBASE-T Ethernet Adapter + 4527 TN9710Q 5GBase-T/NBASE-T Ethernet Adapter 1fcc StreamLabs f416 MS416 fb01 MH4LM @@ -22295,6 +22320,7 @@ 17aa 4007 82599ES 10-Gigabit SFI/SFP+ Network Connection 17aa 402b 82599ES 10Gb 2-port Server Adapter X520-DA2 17aa 402f FPGA Card XC7VX690T-3FFG1157E + 18d4 0c09 82599ES 10Gb 2-port SFP+ OCP Mezz Card MOP81-I-10GS2 1bd4 001b 10G SFP+ DP ER102Fi4 Rack Adapter 1bd4 002f 10G SFP+ DP EP102Fi4A Adapter 1bd4 0032 10G SFP+ DP EP102Fi4 Adapter @@ -22570,8 +22596,15 @@ 1520 I350 Ethernet Controller Virtual Function 1521 I350 Gigabit Network Connection 1028 0602 Gigabit 2P I350-t LOM + 1028 0693 Gigabit 2P I350-t LOM + 1028 06e2 Gigabit 2P I350-t LOM + 1028 0757 Gigabit I350-t LOM + 1028 075a Gigabit I350-t LOM 1028 1f60 Gigabit 4P I350-t rNDC 1028 1f62 Gigabit 4P X540/I350 rNDC + 1028 1fa8 Ethernet 10G 4P X550/I350 rNDC + 1028 1fa9 Ethernet 10G 4P X550 rNDC + 1028 1faa Gigabit 4P X550/I350 rNDC 1028 ff9a Gigabit 4P X710/I350 rNDC 103c 17d1 Ethernet 1Gb 4-port 366FLR Adapter 103c 2003 Ethernet 1Gb 2-port 367i Adapter @@ -22590,6 +22623,7 @@ 15d9 0652 Dual Port i350 GbE MicroLP [AOC-CGP-i2] 17aa 1074 ThinkServer I350-T4 AnyFabric 17aa 4005 I350 Gigabit Network Connection + 18d4 0c07 I350 1Gb 2-port RJ45 OCP Mezz Card MOP41-I-1GT2 1bd4 001d 1G base-T QP EP014Ti1 Adapter 1bd4 0035 1G base-T QP EP014Ti1 Adapter 8086 0001 Ethernet Server Adapter I350-T4 @@ -22698,6 +22732,7 @@ 1028 1fa9 Ethernet 10G 4P X550 rNDC 1590 00d1 Ethernet 10Gb 2-port 562T Adapter 1590 00d2 Ethernet 10Gb 2-port 562FLR-T Adapter + 18d4 0c08 X550 10Gb 2-port RJ45 OCP Mezz Card MOP81-I-10GT2 8086 0001 Ethernet Converged Network Adapter X550-T2 8086 001a Ethernet Converged Network Adapter X550-T2 8086 0022 Ethernet Converged Network Adapter X550-T2 @@ -22782,11 +22817,11 @@ 108e 0000 Ethernet Controller X710 for 10GBASE-T 108e 4857 Ethernet Controller X710 for 10GBASE-T 1587 Ethernet Controller XL710 for 20GbE backplane - 103c 0000 HP Flex-20 20Gb 2-port 660FLB Adapter - 103c 22fe HP Flex-20 20Gb 2-port 660FLB Adapter + 103c 0000 HPE Ethernet 10/20Gb 2-port 660FLB Adapter + 103c 22fe HPE Ethernet 10/20Gb 2-port 660FLB Adapter 1588 Ethernet Controller XL710 for 20GbE backplane - 103c 0000 HP Flex-20 20Gb 2-port 660M Adapter - 103c 22ff HP Flex-20 20Gb 2-port 660M Adapter + 103c 0000 HPE Ethernet 10/20Gb 2-port 660M Adapter + 103c 22ff HPE Ethernet 10/20Gb 2-port 660M Adapter 1589 Ethernet Controller X710/X557-AT 10GBASE-T 108e 0000 Quad Port 10GBase-T Adapter 108e 7b1c Quad Port 10GBase-T Adapter @@ -23169,7 +23204,7 @@ 1e09 7 Series Chipset Family 2-port SATA Controller [IDE mode] 144d c652 NP300E5C series laptop 1e0e 7 Series/C210 Series Chipset Family SATA Controller [RAID mode] - 1e10 7 Series/C210 Series Chipset Family PCI Express Root Port 1 + 1e10 7 Series/C216 Chipset Family PCI Express Root Port 1 1043 108d VivoBook X202EV 1043 1477 N56VZ 1043 1517 Zenbook Prime UX31A @@ -23181,7 +23216,7 @@ 1043 1477 N56VZ 1043 1517 Zenbook Prime UX31A 1e14 7 Series/C210 Series Chipset Family PCI Express Root Port 3 - 1e16 7 Series/C210 Series Chipset Family PCI Express Root Port 4 + 1e16 7 Series/C216 Chipset Family PCI Express Root Port 4 1043 108d VivoBook X202EV 1043 1477 N56VZ 144d c652 NP300E5C series laptop @@ -23194,7 +23229,7 @@ 1e1c 7 Series/C210 Series Chipset Family PCI Express Root Port 7 1e1e 7 Series/C210 Series Chipset Family PCI Express Root Port 8 1849 1e1e Motherboard - 1e20 7 Series/C210 Series Chipset Family High Definition Audio Controller + 1e20 7 Series/C216 Chipset Family High Definition Audio Controller 1028 054b Dell XPS One 2710 1043 108d VivoBook X202EV 1043 1477 N56VZ @@ -23203,7 +23238,7 @@ 1043 8445 ASUS P8Z77-V LX Motherboard 144d c652 NP300E5C series laptop 1849 1898 Z77 Extreme4 motherboard - 1e22 7 Series/C210 Series Chipset Family SMBus Controller + 1e22 7 Series/C216 Chipset Family SMBus Controller 1043 108d VivoBook X202EV 1043 1477 N56VZ 1043 1517 Zenbook Prime UX31A @@ -23213,14 +23248,14 @@ 1e24 7 Series/C210 Series Chipset Family Thermal Management Controller 1043 1517 Zenbook Prime UX31A 1e25 7 Series/C210 Series Chipset Family DMI to PCI Bridge - 1e26 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 + 1e26 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 1043 108d VivoBook X202EV 1043 1477 N56VZ 1043 1517 Zenbook Prime UX31A 1043 84ca P8 series motherboard 144d c652 NP300E5C series laptop 1849 1e26 Motherboard - 1e2d 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 + 1e2d 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 1043 108d VivoBook X202EV 1043 1477 N56VZ 1043 1517 Zenbook Prime UX31A @@ -23235,7 +23270,7 @@ 1043 84ca P8 series motherboard 1849 1e31 Motherboard 1e33 7 Series/C210 Series Chipset Family LAN Controller - 1e3a 7 Series/C210 Series Chipset Family MEI Controller #1 + 1e3a 7 Series/C216 Chipset Family MEI Controller #1 1043 108d VivoBook X202EV 1043 1477 N56VZ 1043 1517 Zenbook Prime UX31A @@ -26234,10 +26269,21 @@ 37cd X722 Virtual Function 37ce Ethernet Connection X722 for 10GbE backplane 1590 0215 Ethernet 10Gb 2-port 568i Adapter + 17aa 4023 Intel Ethernet Connection X722 for 10GbE backplane 37cf Ethernet Connection X722 for 10GbE QSFP+ 37d0 Ethernet Connection X722 for 10GbE SFP+ 37d1 Ethernet Connection X722 for 1GbE + 17aa 4020 Intel Ethernet Connection X722 for 1GbE + 17aa 4021 Intel Ethernet Connection X722 for 1GbE + 17aa 4022 Intel Ethernet Connection X722 for 1GbE + 8086 4020 Ethernet Connection X722 for 1GbE + 8086 4021 Ethernet Connection X722 for 1GbE + 8086 4022 Ethernet Connection X722 for 1GbE 37d2 Ethernet Connection X722 for 10GBASE-T + 17aa 4020 Intel Ethernet Connection X722 for 10GBASE + 17aa 4021 Intel Ethernet Connection X722 for 10GBASE + 8086 4020 Ethernet Connection X722 for 10GBASE + 8086 4021 Ethernet Connection X722 for 10GBASE 37d3 Ethernet Connection X722 for 10GbE SFP+ 37d4 Ethernet Connection X722 for 10GbE QSFP+ 37d9 X722 Hyper-V Virtual Function From owner-svn-src-head@freebsd.org Sat Oct 22 19:51:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4DE4C1DF8D; Sat, 22 Oct 2016 19:51:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id B40D2C7C; Sat, 22 Oct 2016 19:51:33 +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 u9MJpWSc088254; Sat, 22 Oct 2016 19:51:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MJpWbC088252; Sat, 22 Oct 2016 19:51:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610221951.u9MJpWbC088252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 19:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307786 - in head: etc/rc.d tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 19:51:34 -0000 Author: bapt Date: Sat Oct 22 19:51:32 2016 New Revision: 307786 URL: https://svnweb.freebsd.org/changeset/base/307786 Log: Do not install NIS program rc script if WITHOUT_NIS is set PR: 213375 Submitted by: sergey@akhmatov.ru MFC after: 3 days Modified: head/etc/rc.d/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Oct 22 19:36:12 2016 (r307785) +++ head/etc/rc.d/Makefile Sat Oct 22 19:51:32 2016 (r307786) @@ -118,14 +118,17 @@ FILES= DAEMON \ ugidfw \ ${_utx} \ var \ - watchdogd \ - ypbind \ + watchdogd + +.if ${MK_NIS} != "no" +FILES+= ypbind \ ypldap \ yppasswdd \ ypserv \ ypset \ ypupdated \ ypxfrd +.endif .if ${MK_ACCT} != "no" FILESGROUPS+= ACCT Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 22 19:36:12 2016 (r307785) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 22 19:51:32 2016 (r307786) @@ -6113,6 +6113,13 @@ OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-N .endif .if ${MK_NIS} == no +OLD_FILES+=etc/rc.d/ypbind +OLD_FILES+=etc/rc.d/ypldap +OLD_FILES+=etc/rc.d/yppasswdd +OLD_FILES+=etc/rc.d/ypserv +OLD_FILES+=etc/rc.d/ypset +OLD_FILES+=etc/rc.d/ypupdated +OLD_FILES+=etc/rc.d/ypxfrd OLD_FILES+=usr/bin/ypcat OLD_FILES+=usr/bin/ypchfn OLD_FILES+=usr/bin/ypchpass From owner-svn-src-head@freebsd.org Sat Oct 22 20:00:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52984C1C486; Sat, 22 Oct 2016 20:00:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1D5AC2BB; Sat, 22 Oct 2016 20:00:41 +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 u9MK0eMB091262; Sat, 22 Oct 2016 20:00:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MK0epb091261; Sat, 22 Oct 2016 20:00:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610222000.u9MK0epb091261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 20:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307787 - head/sys/boot/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 20:00:41 -0000 Author: bapt Date: Sat Oct 22 20:00:39 2016 New Revision: 307787 URL: https://svnweb.freebsd.org/changeset/base/307787 Log: Fix typo in the COMPILER_VERSION check PR: 213120 Submitted by: Yuta Satoh MFC after: 3 days Modified: head/sys/boot/efi/Makefile Modified: head/sys/boot/efi/Makefile ============================================================================== --- head/sys/boot/efi/Makefile Sat Oct 22 19:51:32 2016 (r307786) +++ head/sys/boot/efi/Makefile Sat Oct 22 20:00:39 2016 (r307787) @@ -4,7 +4,7 @@ # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer # than 4.5 supports it. -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" @@ -18,6 +18,6 @@ SUBDIR+= fdt SUBDIR+= libefi loader boot1 .endif -.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 +.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .include From owner-svn-src-head@freebsd.org Sat Oct 22 21:51:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B319CC1DE3C; Sat, 22 Oct 2016 21:51:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8C3FF197E; Sat, 22 Oct 2016 21:51:59 +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 u9MLpwkG036535; Sat, 22 Oct 2016 21:51:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MLpwuv036530; Sat, 22 Oct 2016 21:51:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610222151.u9MLpwuv036530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Oct 2016 21:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307799 - in head/lib/libc: powerpc/gen powerpcspe powerpcspe/gen powerpcspe/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 21:51:59 -0000 Author: jhibbits Date: Sat Oct 22 21:51:58 2016 New Revision: 307799 URL: https://svnweb.freebsd.org/changeset/base/307799 Log: Reduce code duplication between powerpc and powerpcspe They're nearly identical except for a few files. Reported by: kib Added: head/lib/libc/powerpc/gen/Makefile.common (contents, props changed) Deleted: head/lib/libc/powerpcspe/SYS.h head/lib/libc/powerpcspe/_fpmath.h head/lib/libc/powerpcspe/arith.h head/lib/libc/powerpcspe/gd_qnan.h head/lib/libc/powerpcspe/gen/_ctx_start.S head/lib/libc/powerpcspe/gen/_set_tp.c head/lib/libc/powerpcspe/gen/eabi.S head/lib/libc/powerpcspe/gen/infinity.c head/lib/libc/powerpcspe/gen/makecontext.c head/lib/libc/powerpcspe/gen/signalcontext.c head/lib/libc/powerpcspe/gen/syncicache.c head/lib/libc/powerpcspe/sys/brk.S head/lib/libc/powerpcspe/sys/cerror.S head/lib/libc/powerpcspe/sys/exect.S head/lib/libc/powerpcspe/sys/sbrk.S head/lib/libc/powerpcspe/sys/setlogin.S Modified: head/lib/libc/powerpc/gen/Makefile.inc head/lib/libc/powerpcspe/Makefile.inc head/lib/libc/powerpcspe/gen/Makefile.inc head/lib/libc/powerpcspe/sys/Makefile.inc Added: head/lib/libc/powerpc/gen/Makefile.common ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc/gen/Makefile.common Sat Oct 22 21:51:58 2016 (r307799) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.PATH: ${LIBC_SRCTOP}/powerpc/gen + +SRCS += _ctx_start.S eabi.S infinity.c ldexp.c makecontext.c \ + signalcontext.c syncicache.c _set_tp.c trivial-getcontextx.c Modified: head/lib/libc/powerpc/gen/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/gen/Makefile.inc Sat Oct 22 21:41:28 2016 (r307798) +++ head/lib/libc/powerpc/gen/Makefile.inc Sat Oct 22 21:51:58 2016 (r307799) @@ -1,11 +1,7 @@ # $FreeBSD$ -SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ - fpgetsticky.c fpsetmask.c fpsetround.c \ - infinity.c ldexp.c makecontext.c _setjmp.S \ - setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ - _set_tp.c \ - trivial-getcontextx.c - - +.include "${LIBC_SRC}/powerpc/gen/Makefile.common" +SRCS += fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c \ + _setjmp.S setjmp.S sigsetjmp.S Modified: head/lib/libc/powerpcspe/Makefile.inc ============================================================================== --- head/lib/libc/powerpcspe/Makefile.inc Sat Oct 22 21:41:28 2016 (r307798) +++ head/lib/libc/powerpcspe/Makefile.inc Sat Oct 22 21:51:58 2016 (r307799) @@ -1,5 +1,6 @@ # $FreeBSD$ +CFLAGS+= -I${LIBC_SRCTOP}/powerpc SRCS+= trivial-vdso_tc.c # Long double is 64-bits Modified: head/lib/libc/powerpcspe/gen/Makefile.inc ============================================================================== --- head/lib/libc/powerpcspe/gen/Makefile.inc Sat Oct 22 21:41:28 2016 (r307798) +++ head/lib/libc/powerpcspe/gen/Makefile.inc Sat Oct 22 21:51:58 2016 (r307799) @@ -1,11 +1,7 @@ # $FreeBSD$ -SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ - fpgetsticky.c fpsetmask.c fpsetround.c \ - infinity.c ldexp.c makecontext.c _setjmp.S \ - setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ - _set_tp.c \ - trivial-getcontextx.c - - +.include "${LIBC_SRCTOP}/powerpc/gen/Makefile.common" +SRCS += fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c \ + _setjmp.S setjmp.S sigsetjmp.S Modified: head/lib/libc/powerpcspe/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpcspe/sys/Makefile.inc Sat Oct 22 21:41:28 2016 (r307798) +++ head/lib/libc/powerpcspe/sys/Makefile.inc Sat Oct 22 21:51:58 2016 (r307799) @@ -1,8 +1,4 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S - -# Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o - -PSEUDO= _getlogin.o _exit.o +.PATH: ${LIBC_SRCTOP}/powerpc/sys +.sinclude "${LIBC_SRCTOP}/powerpc/sys/Makefile.inc" From owner-svn-src-head@freebsd.org Sat Oct 22 22:27:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D341FC1D693; Sat, 22 Oct 2016 22:27:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id 89768D26; Sat, 22 Oct 2016 22:27:52 +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 u9MMRpoU048417; Sat, 22 Oct 2016 22:27:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MMRp8Y048414; Sat, 22 Oct 2016 22:27:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201610222227.u9MMRp8Y048414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 22 Oct 2016 22:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307800 - in head/usr.sbin/amd: . amd libamu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 22:27:52 -0000 Author: cy Date: Sat Oct 22 22:27:51 2016 New Revision: 307800 URL: https://svnweb.freebsd.org/changeset/base/307800 Log: Sources from the "current" build tree and generated sources in the object tree should be used instead of sources and headers from the already installed source tree on the build host. This was noticed while addressing issues in the upcoming amd update. MFC after: 2 weeks Modified: head/usr.sbin/amd/Makefile.inc head/usr.sbin/amd/amd/Makefile head/usr.sbin/amd/libamu/Makefile Modified: head/usr.sbin/amd/Makefile.inc ============================================================================== --- head/usr.sbin/amd/Makefile.inc Sat Oct 22 21:51:58 2016 (r307799) +++ head/usr.sbin/amd/Makefile.inc Sat Oct 22 22:27:51 2016 (r307800) @@ -32,8 +32,8 @@ CFLAGS+= -DYES_HESIOD CFLAGS+= -DHOST_CPU=\"${MACHINE_CPUARCH}\" -DHOST_ARCH=\"${MACHINE_ARCH}\" RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -MOUNT_X= ${DESTDIR}/usr/include/rpcsvc/mount.x -NFS_PROT_X= ${DESTDIR}/usr/include/rpcsvc/nfs_prot.x +MOUNT_X= ${SRCTOP}/include/rpcsvc/mount.x +NFS_PROT_X= ${SRCTOP}/include/rpcsvc/nfs_prot.x WARNS?= 1 Modified: head/usr.sbin/amd/amd/Makefile ============================================================================== --- head/usr.sbin/amd/amd/Makefile Sat Oct 22 21:51:58 2016 (r307799) +++ head/usr.sbin/amd/amd/Makefile Sat Oct 22 22:27:51 2016 (r307800) @@ -25,7 +25,7 @@ SRCS+= ops_unionfs.c opts.c readdir.c re SRCS+= srvr_amfs_auto.c srvr_nfs.c CFLAGS+= -I${SRCTOP}/contrib/amd/amd \ - -I${DESTDIR}/usr/include/rpcsvc + -I${.OBJDIR}/../../../include/rpcsvc LIBADD= amu wrap Modified: head/usr.sbin/amd/libamu/Makefile ============================================================================== --- head/usr.sbin/amd/libamu/Makefile Sat Oct 22 21:51:58 2016 (r307799) +++ head/usr.sbin/amd/libamu/Makefile Sat Oct 22 22:27:51 2016 (r307800) @@ -23,7 +23,7 @@ SRCS+= nfs_prot_x.c xdr_func_%undef.c CLEANFILES+= nfs_prot_x.c xdr_func_%undef.c CFLAGS+= -I${SRCTOP}/contrib/amd/libamu \ - -I${DESTDIR}/usr/include/rpcsvc + -I${.OBJDIR}/../../../include/rpcsvc nfs_prot_x.c: ${NFS_PROT_X} ${RPCCOM} -c -C -DWANT_NFS3 ${NFS_PROT_X} -o ${.TARGET} From owner-svn-src-head@freebsd.org Sat Oct 22 22:29:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71DF7C1D70D; Sat, 22 Oct 2016 22:29:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 41760EA0; Sat, 22 Oct 2016 22:29:04 +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 u9MMT3Zj048503; Sat, 22 Oct 2016 22:29:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MMT3YY048502; Sat, 22 Oct 2016 22:29:03 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201610222229.u9MMT3YY048502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 22 Oct 2016 22:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307801 - head/usr.sbin/amd/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 22:29:04 -0000 Author: cy Date: Sat Oct 22 22:29:03 2016 New Revision: 307801 URL: https://svnweb.freebsd.org/changeset/base/307801 Log: Align whitespace. MFC after: 2 weeks X-MFC with: r307800 Modified: head/usr.sbin/amd/amd/Makefile Modified: head/usr.sbin/amd/amd/Makefile ============================================================================== --- head/usr.sbin/amd/amd/Makefile Sat Oct 22 22:27:51 2016 (r307800) +++ head/usr.sbin/amd/amd/Makefile Sat Oct 22 22:29:03 2016 (r307801) @@ -31,7 +31,7 @@ LIBADD= amu wrap CLEANFILES+= conf_parse.c conf_parse.h conf_tok.c -conf_tok.o: conf_parse.h +conf_tok.o: conf_parse.h # These are generated at compile time SRCS+= mount_xdr.c From owner-svn-src-head@freebsd.org Sat Oct 22 22:35:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5374BC1D9FC; Sat, 22 Oct 2016 22:35:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2E4B86EF; Sat, 22 Oct 2016 22:35:41 +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 u9MMZeK3052267; Sat, 22 Oct 2016 22:35:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MMZdR2052263; Sat, 22 Oct 2016 22:35:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610222235.u9MMZdR2052263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 22:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307802 - in head: tools/build/mk usr.sbin usr.sbin/tzsetup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 22:35:41 -0000 Author: bapt Date: Sat Oct 22 22:35:39 2016 New Revision: 307802 URL: https://svnweb.freebsd.org/changeset/base/307802 Log: Fix build of tzsetup when WITHOUT_DIALOG is set Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped down version (missing the dialog UI) but perfectly function tzsetup when world is built WITHOUT_DIALOG Reorganise a bit the code to limit the number of blocks under HAVE_DIALOG Reviewed by: emaste Sponsored by: https://reviews.freebsd.org/D8325 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile head/usr.sbin/tzsetup/Makefile head/usr.sbin/tzsetup/tzsetup.c Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 22 22:29:03 2016 (r307801) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 22 22:35:39 2016 (r307802) @@ -1348,12 +1348,10 @@ OLD_FILES+=usr/lib/libdpv.so OLD_FILES+=usr/lib/libdpv.so.1 OLD_FILES+=usr/lib/libdpv_p.a OLD_FILES+=usr/sbin/bsdconfig -OLD_FILES+=usr/sbin/tzsetup OLD_FILES+=usr/share/man/man1/dialog.1.gz OLD_FILES+=usr/share/man/man1/dpv.1.gz OLD_FILES+=usr/share/man/man3/dialog.3.gz OLD_FILES+=usr/share/man/man3/dpv.3.gz -OLD_FILES+=usr/share/man/man8/tzsetup.8.gz OLD_FILES+=usr/share/man/man8/bsdconfig.8.gz .endif Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Oct 22 22:29:03 2016 (r307801) +++ head/usr.sbin/Makefile Sat Oct 22 22:35:39 2016 (r307802) @@ -88,6 +88,7 @@ SUBDIR= adduser \ tcpdump \ traceroute \ trpt \ + tzsetup \ uefisign \ ugidfw \ vigr \ @@ -121,7 +122,6 @@ SUBDIR.${MK_BOOTPARAMD}+= bootparamd SUBDIR.${MK_BSDINSTALL}+= bsdinstall SUBDIR.${MK_BSNMP}+= bsnmpd SUBDIR.${MK_CTM}+= ctm -SUBDIR.${MK_DIALOG}+= tzsetup SUBDIR.${MK_DIALOG}+= bsdconfig SUBDIR.${MK_EFI}+= efivar SUBDIR.${MK_FLOPPY}+= fdcontrol Modified: head/usr.sbin/tzsetup/Makefile ============================================================================== --- head/usr.sbin/tzsetup/Makefile Sat Oct 22 22:29:03 2016 (r307801) +++ head/usr.sbin/tzsetup/Makefile Sat Oct 22 22:35:39 2016 (r307802) @@ -1,12 +1,16 @@ # $FreeBSD$ +.include + PROG= tzsetup MAN= tzsetup.8 -CFLAGS+= -I${.CURDIR}/../../contrib/dialog -I. +CFLAGS+= -I. +.if ${MK_DIALOG} != no WARNS?= 3 - +CFLAGS+= -I${.CURDIR}/../../contrib/dialog -DHAVE_DIALOG LIBADD= dialog ncursesw +.endif .include Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Sat Oct 22 22:29:03 2016 (r307801) +++ head/usr.sbin/tzsetup/tzsetup.c Sat Oct 22 22:35:39 2016 (r307802) @@ -49,7 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef HAVE_DIALOG #include +#endif #define _PATH_ZONETAB "/usr/share/zoneinfo/zone.tab" #define _PATH_ISO3166 "/usr/share/misc/iso3166" @@ -72,6 +74,19 @@ __FBSDID("$FreeBSD$"); #define DITEM_LEAVE_MENU (1 << 16) #define DITEM_RECREATE (1 << 18) +static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], + path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], + path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; + +static int reallydoit = 1; +static int reinstall = 0; +static char *chrootenv = NULL; + +static void usage(void); +static int install_zoneinfo(const char *zoneinfo); +static int install_zoneinfo_file(const char *zoneinfo_file); + +#ifdef HAVE_DIALOG /* for use in describing more exotic behaviors */ typedef struct dialogMenuItem { char *prompt; @@ -187,20 +202,10 @@ again: return result; } -static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], - path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], - path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; - -static int reallydoit = 1; -static int reinstall = 0; static int usedialog = 1; -static char *chrootenv = NULL; -static void usage(void); static int confirm_zone(const char *filename); static int continent_country_menu(dialogMenuItem *); -static int install_zoneinfo(const char *zoneinfo); -static int install_zoneinfo_file(const char *zoneinfo_file); static int set_zone_multi(dialogMenuItem *); static int set_zone_whole_country(dialogMenuItem *); static int set_zone_menu(dialogMenuItem *); @@ -644,6 +649,53 @@ set_zone_utc(void) } static int +confirm_zone(const char *filename) +{ + char title[64], prompt[64]; + time_t t = time(0); + struct tm *tm; + int rv; + + setenv("TZ", filename == NULL ? "" : filename, 1); + tzset(); + tm = localtime(&t); + + snprintf(title, sizeof(title), "Confirmation"); + snprintf(prompt, sizeof(prompt), + "Does the abbreviation `%s' look reasonable?", tm->tm_zone); + rv = !dialog_yesno(title, prompt, 5, 72); + return (rv); +} + +static int +set_zone_multi(dialogMenuItem *dmi) +{ + struct zone *zp = dmi->data; + int rv; + + if (!confirm_zone(zp->filename)) + return (DITEM_FAILURE | DITEM_RECREATE); + + rv = install_zoneinfo(zp->filename); + return (rv); +} + +static int +set_zone_whole_country(dialogMenuItem *dmi) +{ + struct country *cp = dmi->data; + int rv; + + if (!confirm_zone(cp->filename)) + return (DITEM_FAILURE | DITEM_RECREATE); + + rv = install_zoneinfo(cp->filename); + return (rv); +} + +#endif + +static int install_zoneinfo_file(const char *zoneinfo_file) { char buf[1024]; @@ -672,9 +724,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", path_localtime, zoneinfo_file); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif @@ -685,9 +739,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Could not delete %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -697,9 +753,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Could not delete %s: %s", path_db, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -708,9 +766,11 @@ install_zoneinfo_file(const char *zonein snprintf(title, sizeof(title), "Done"); snprintf(prompt, sizeof(prompt), "Removed %s", path_localtime); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif return (DITEM_LEAVE_MENU); @@ -723,9 +783,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Could not open %s: %s", zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -734,10 +796,12 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) { snprintf(title, sizeof(title), "Error"); dialog_msgbox(title, prompt, 8, 72, 1); } else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -749,9 +813,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Could not open %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -765,9 +831,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Error copying %s to %s %s", zoneinfo_file, path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); /* Better to leave none than a corrupt one. */ unlink(path_localtime); @@ -781,9 +849,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Cannot access %s: %s", zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -791,10 +861,12 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) { snprintf(title, sizeof(title), "Error"); dialog_msgbox(title, prompt, 8, 72, 1); } else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -804,9 +876,11 @@ install_zoneinfo_file(const char *zonein "Cannot create symbolic link %s to %s: %s", path_localtime, zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -822,9 +896,11 @@ install_zoneinfo_file(const char *zonein snprintf(prompt, sizeof(prompt), "Created symbolic link from %s to %s", zoneinfo_file, path_localtime); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif } /* reallydoit */ @@ -855,51 +931,6 @@ install_zoneinfo(const char *zoneinfo) return (rv); } -static int -confirm_zone(const char *filename) -{ - char title[64], prompt[64]; - time_t t = time(0); - struct tm *tm; - int rv; - - setenv("TZ", filename == NULL ? "" : filename, 1); - tzset(); - tm = localtime(&t); - - snprintf(title, sizeof(title), "Confirmation"); - snprintf(prompt, sizeof(prompt), - "Does the abbreviation `%s' look reasonable?", tm->tm_zone); - rv = !dialog_yesno(title, prompt, 5, 72); - return (rv); -} - -static int -set_zone_multi(dialogMenuItem *dmi) -{ - struct zone *zp = dmi->data; - int rv; - - if (!confirm_zone(zp->filename)) - return (DITEM_FAILURE | DITEM_RECREATE); - - rv = install_zoneinfo(zp->filename); - return (rv); -} - -static int -set_zone_whole_country(dialogMenuItem *dmi) -{ - struct country *cp = dmi->data; - int rv; - - if (!confirm_zone(cp->filename)) - return (DITEM_FAILURE | DITEM_RECREATE); - - rv = install_zoneinfo(cp->filename); - return (rv); -} - static void usage(void) { @@ -912,8 +943,11 @@ usage(void) int main(int argc, char **argv) { +#ifdef HAVE_DIALOG char title[64], prompt[128]; - int c, fd, rv, skiputc; + int fd; +#endif + int c, rv, skiputc; char vm_guest[16] = ""; size_t len = sizeof(vm_guest); @@ -934,7 +968,9 @@ main(int argc, char **argv) break; case 'r': reinstall = 1; +#ifdef HAVE_DIALOG usedialog = 0; +#endif break; case 's': skiputc = 1; @@ -998,12 +1034,15 @@ main(int argc, char **argv) struct stat sb; if (stat(argv[optind], &sb) != 0) { +#ifdef HAVE_DIALOG usedialog = 0; +#endif rv = install_zoneinfo(argv[optind]); exit(rv & ~DITEM_LEAVE_MENU); } /* FALLTHROUGH */ } +#ifdef HAVE_DIALOG read_iso3166_table(); read_zones(); @@ -1064,5 +1103,8 @@ main(int argc, char **argv) dlg_clear(); end_dialog(); +#else + usage(); +#endif return (0); } From owner-svn-src-head@freebsd.org Sat Oct 22 22:52:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A57E6C1D36A; Sat, 22 Oct 2016 22:52:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7F8CA32B; Sat, 22 Oct 2016 22:52:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9MMqokL059700; Sat, 22 Oct 2016 22:52:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MMqoDB059696; Sat, 22 Oct 2016 22:52:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610222252.u9MMqoDB059696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 22 Oct 2016 22:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307804 - head/sys/dev/evdev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 22:52:51 -0000 Author: gonzo Date: Sat Oct 22 22:52:50 2016 New Revision: 307804 URL: https://svnweb.freebsd.org/changeset/base/307804 Log: EVDEV: Add shortcut functions for event types Add wrappers around generic evdev_push_event for specific event types: EV_KEY/EV_REL/EV_ABS etc... Submitted by: Vladimir Kondratiev Modified: head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev.h head/sys/dev/evdev/evdev_utils.c Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sat Oct 22 22:36:32 2016 (r307803) +++ head/sys/dev/evdev/evdev.c Sat Oct 22 22:52:50 2016 (r307804) @@ -822,21 +822,6 @@ push: return (ret); } -inline int -evdev_sync(struct evdev_dev *evdev) -{ - - return (evdev_push_event(evdev, EV_SYN, SYN_REPORT, 1)); -} - - -inline int -evdev_mt_sync(struct evdev_dev *evdev) -{ - - return (evdev_push_event(evdev, EV_SYN, SYN_MT_REPORT, 1)); -} - int evdev_register_client(struct evdev_dev *evdev, struct evdev_client *client) { Modified: head/sys/dev/evdev/evdev.h ============================================================================== --- head/sys/dev/evdev/evdev.h Sat Oct 22 22:36:32 2016 (r307803) +++ head/sys/dev/evdev/evdev.h Sat Oct 22 22:52:50 2016 (r307804) @@ -97,8 +97,6 @@ int evdev_register(struct evdev_dev *); int evdev_register_mtx(struct evdev_dev *, struct mtx *); int evdev_unregister(struct evdev_dev *); int evdev_push_event(struct evdev_dev *, uint16_t, uint16_t, int32_t); -int evdev_sync(struct evdev_dev *); -int evdev_mt_sync(struct evdev_dev *); void evdev_support_prop(struct evdev_dev *, uint16_t); void evdev_support_event(struct evdev_dev *, uint16_t); void evdev_support_key(struct evdev_dev *, uint16_t); @@ -129,4 +127,68 @@ void evdev_push_leds(struct evdev_dev *, void evdev_push_repeats(struct evdev_dev *, keyboard_t *); evdev_event_t evdev_ev_kbd_event; +/* Event reporting shortcuts: */ +static __inline int +evdev_sync(struct evdev_dev *evdev) +{ + + return (evdev_push_event(evdev, EV_SYN, SYN_REPORT, 1)); +} + +static __inline int +evdev_mt_sync(struct evdev_dev *evdev) +{ + + return (evdev_push_event(evdev, EV_SYN, SYN_MT_REPORT, 1)); +} + +static __inline int +evdev_push_key(struct evdev_dev *evdev, uint16_t code, int32_t value) +{ + + return (evdev_push_event(evdev, EV_KEY, code, value != 0)); +} + +static __inline int +evdev_push_rel(struct evdev_dev *evdev, uint16_t code, int32_t value) +{ + + return (evdev_push_event(evdev, EV_REL, code, value)); +} + +static __inline int +evdev_push_abs(struct evdev_dev *evdev, uint16_t code, int32_t value) +{ + + return (evdev_push_event(evdev, EV_ABS, code, value)); +} + +static __inline int +evdev_push_msc(struct evdev_dev *evdev, uint16_t code, int32_t value) +{ + + return (evdev_push_event(evdev, EV_MSC, code, value)); +} + +static __inline int +evdev_push_led(struct evdev_dev *evdev, uint16_t code, int32_t value) +{ + + return (evdev_push_event(evdev, EV_LED, code, value != 0)); +} + +static __inline int +evdev_push_snd(struct evdev_dev *evdev, uint16_t code, int32_t value) +{ + + return (evdev_push_event(evdev, EV_SND, code, value != 0)); +} + +static __inline int +evdev_push_sw(struct evdev_dev *evdev, uint16_t code, int32_t value) +{ + + return (evdev_push_event(evdev, EV_SW, code, value != 0)); +} + #endif /* _DEV_EVDEV_EVDEV_H */ Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Sat Oct 22 22:36:32 2016 (r307803) +++ head/sys/dev/evdev/evdev_utils.c Sat Oct 22 22:52:50 2016 (r307804) @@ -271,8 +271,8 @@ evdev_push_mouse_btn(struct evdev_dev *e size_t i; for (i = 0; i < nitems(evdev_mouse_button_codes); i++) - evdev_push_event(evdev, EV_KEY, evdev_mouse_button_codes[i], - (buttons & (1 << i)) != 0); + evdev_push_key(evdev, evdev_mouse_button_codes[i], + buttons & (1 << i)); } void @@ -285,8 +285,7 @@ evdev_push_leds(struct evdev_dev *evdev, return; for (i = 0; i < nitems(evdev_led_codes); i++) - evdev_push_event(evdev, EV_LED, evdev_led_codes[i], - (leds & (1 << i)) != 0); + evdev_push_led(evdev, evdev_led_codes[i], leds & (1 << i)); } void From owner-svn-src-head@freebsd.org Sat Oct 22 22:55:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3604C1D41A; Sat, 22 Oct 2016 22:55:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7EA0E6E6; Sat, 22 Oct 2016 22:55:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9MMtAgR059844; Sat, 22 Oct 2016 22:55:10 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MMtA0p059843; Sat, 22 Oct 2016 22:55:10 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610222255.u9MMtA0p059843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 22 Oct 2016 22:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307805 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 22:55:11 -0000 Author: gonzo Date: Sat Oct 22 22:55:10 2016 New Revision: 307805 URL: https://svnweb.freebsd.org/changeset/base/307805 Log: EVDEV: ums evdev support improvements: locking and event reporting - Use ums lock as evdev lock - Do not cap axes values to sysmouse limits for evdev reports - Do not map T-axis events to buttons for evdev reports - Use shortcuts for event reporting Submitted by: Vladimir Kondratiev MFC after: 1 week Modified: head/sys/dev/usb/input/ums.c Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Sat Oct 22 22:52:50 2016 (r307804) +++ head/sys/dev/usb/input/ums.c Sat Oct 22 22:55:10 2016 (r307805) @@ -173,6 +173,8 @@ static usb_fifo_ioctl_t ums_fifo_ioctl; #ifdef EVDEV_SUPPORT static evdev_open_t ums_ev_open; static evdev_close_t ums_ev_close; +static void ums_evdev_push(struct ums_softc *, int32_t, int32_t, + int32_t, int32_t, int32_t); #endif static void ums_start_rx(struct ums_softc *); @@ -205,6 +207,9 @@ ums_put_queue_timeout(void *__sc) mtx_assert(&sc->sc_mtx, MA_OWNED); ums_put_queue(sc, 0, 0, 0, 0, 0); +#ifdef EVDEV_SUPPORT + ums_evdev_push(sc, 0, 0, 0, 0, 0); +#endif } static void @@ -216,6 +221,9 @@ ums_intr_callback(struct usb_xfer *xfer, uint8_t *buf = sc->sc_temp; int32_t buttons = 0; int32_t buttons_found = 0; +#ifdef EVDEV_SUPPORT + int32_t buttons_reported = 0; +#endif int32_t dw = 0; int32_t dx = 0; int32_t dy = 0; @@ -306,6 +314,9 @@ ums_intr_callback(struct usb_xfer *xfer, if (++info != &sc->sc_info[UMS_INFO_MAX]) goto repeat; +#ifdef EVDEV_SUPPORT + buttons_reported = buttons; +#endif /* keep old button value(s) for non-detected buttons */ buttons |= sc->sc_status.button & ~buttons_found; @@ -351,6 +362,11 @@ ums_intr_callback(struct usb_xfer *xfer, usb_callout_stop(&sc->sc_callout); ums_put_queue(sc, dx, dy, dz, dt, buttons); +#ifdef EVDEV_SUPPORT + ums_evdev_push(sc, dx, dy, dz, dt, + buttons_reported); +#endif + } } case USB_ST_SETUP: @@ -720,7 +736,7 @@ ums_attach(device_t dev) for (i = 0; i < info->sc_buttons; i++) evdev_support_key(sc->sc_evdev, BTN_MOUSE + i); - err = evdev_register(sc->sc_evdev); + err = evdev_register_mtx(sc->sc_evdev, &sc->sc_mtx); if (err) goto detach; #endif @@ -891,27 +907,32 @@ ums_put_queue(struct ums_softc *sc, int3 } usb_fifo_put_data_linear(sc->sc_fifo.fp[USB_FIFO_RX], buf, sc->sc_mode.packetsize, 1); - -#ifdef EVDEV_SUPPORT - if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { - /* Push evdev event */ - evdev_push_event(sc->sc_evdev, EV_REL, REL_X, dx); - evdev_push_event(sc->sc_evdev, EV_REL, REL_Y, -dy); - evdev_push_event(sc->sc_evdev, EV_REL, REL_WHEEL, -dz); - evdev_push_event(sc->sc_evdev, EV_REL, REL_HWHEEL, dt); - evdev_push_mouse_btn(sc->sc_evdev, - (buttons & ~MOUSE_STDBUTTONS) | - (buttons & (1 << 2) ? MOUSE_BUTTON1DOWN : 0) | - (buttons & (1 << 1) ? MOUSE_BUTTON2DOWN : 0) | - (buttons & (1 << 0) ? MOUSE_BUTTON3DOWN : 0)); - evdev_sync(sc->sc_evdev); - } -#endif } else { DPRINTF("Buffer full, discarded packet\n"); } } +#ifdef EVDEV_SUPPORT +static void +ums_evdev_push(struct ums_softc *sc, int32_t dx, int32_t dy, + int32_t dz, int32_t dt, int32_t buttons) +{ + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + /* Push evdev event */ + evdev_push_rel(sc->sc_evdev, REL_X, dx); + evdev_push_rel(sc->sc_evdev, REL_Y, -dy); + evdev_push_rel(sc->sc_evdev, REL_WHEEL, -dz); + evdev_push_rel(sc->sc_evdev, REL_HWHEEL, dt); + evdev_push_mouse_btn(sc->sc_evdev, + (buttons & ~MOUSE_STDBUTTONS) | + (buttons & (1 << 2) ? MOUSE_BUTTON1DOWN : 0) | + (buttons & (1 << 1) ? MOUSE_BUTTON2DOWN : 0) | + (buttons & (1 << 0) ? MOUSE_BUTTON3DOWN : 0)); + evdev_sync(sc->sc_evdev); + } +} +#endif + static void ums_reset_buf(struct ums_softc *sc) { @@ -925,7 +946,7 @@ ums_ev_open(struct evdev_dev *evdev, voi { struct ums_softc *sc = (struct ums_softc *)ev_softc; - mtx_lock(&sc->sc_mtx); + mtx_assert(&sc->sc_mtx, MA_OWNED); sc->sc_evflags = UMS_EVDEV_OPENED; @@ -934,8 +955,6 @@ ums_ev_open(struct evdev_dev *evdev, voi ums_start_rx(sc); } - mtx_unlock(&sc->sc_mtx); - return (0); } @@ -944,14 +963,12 @@ ums_ev_close(struct evdev_dev *evdev, vo { struct ums_softc *sc = (struct ums_softc *)ev_softc; - mtx_lock(&sc->sc_mtx); + mtx_assert(&sc->sc_mtx, MA_OWNED); sc->sc_evflags = 0; if (sc->sc_fflags == 0) ums_stop_rx(sc); - - mtx_unlock(&sc->sc_mtx); } #endif From owner-svn-src-head@freebsd.org Sat Oct 22 23:05:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B21F7C1D670; Sat, 22 Oct 2016 23:05:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 816A9B9B; Sat, 22 Oct 2016 23:05:45 +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 u9MN5isb063638; Sat, 22 Oct 2016 23:05:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MN5iwa063637; Sat, 22 Oct 2016 23:05:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610222305.u9MN5iwa063637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 23:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307806 - head/share/doc/psd/contents X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 23:05:45 -0000 Author: bapt Date: Sat Oct 22 23:05:44 2016 New Revision: 307806 URL: https://svnweb.freebsd.org/changeset/base/307806 Log: Remove RCS entry from PSD content file, it is gone along with GNU RCS Modified: head/share/doc/psd/contents/contents.ms Modified: head/share/doc/psd/contents/contents.ms ============================================================================== --- head/share/doc/psd/contents/contents.ms Sat Oct 22 22:55:10 2016 (r307805) +++ head/share/doc/psd/contents/contents.ms Sat Oct 22 23:05:44 2016 (r307806) @@ -145,17 +145,6 @@ Indispensable tool for making sure large compiled with minimal effort. .sp .IP -.tl 'An Introduction to the Revision Control System''PSD:13' -.if \n(.U \{\ -.br -.>> 13.rcs/paper.html -.\} -.QP -RCS is a user-contributed tool for working together with other people -without stepping on each other's toes. -An alternative to \fIsccs\fR for controlling software changes. -.sp -.IP .tl 'An Introduction to the Source Code Control System''PSD:14' .QP A useful introductory article for those users with From owner-svn-src-head@freebsd.org Sat Oct 22 23:09:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3765C1D6F3; Sat, 22 Oct 2016 23:09:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id AF7C3D27; Sat, 22 Oct 2016 23:09:07 +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 u9MN96fL063786; Sat, 22 Oct 2016 23:09:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MN96Ob063785; Sat, 22 Oct 2016 23:09:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610222309.u9MN96Ob063785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 23:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307807 - head/share/doc/psd/title X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 23:09:08 -0000 Author: bapt Date: Sat Oct 22 23:09:06 2016 New Revision: 307807 URL: https://svnweb.freebsd.org/changeset/base/307807 Log: Remove reference to RCS from PSD titles Modified: head/share/doc/psd/title/Title Modified: head/share/doc/psd/title/Title ============================================================================== --- head/share/doc/psd/title/Title Sat Oct 22 23:05:44 2016 (r307806) +++ head/share/doc/psd/title/Title Sat Oct 22 23:09:06 2016 (r307807) @@ -117,12 +117,6 @@ Permission is granted to make and distri this document provided the copyright notice and this permission notice are preserved on all copies. .sp 2 -Document PSD:13 is part of the user contributed software and is -copyright 1983 by Walter F. Tichy. -Permission to copy the RCS documentation or any portion thereof as -necessary for licensed use of the software is granted to licensees -of this software, provided this copyright notice is included. -.sp 2 The views and conclusions contained in this manual are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the Regents of the University of California. From owner-svn-src-head@freebsd.org Sat Oct 22 23:49:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50450C1DF75; Sat, 22 Oct 2016 23:49:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 068F2E9C; Sat, 22 Oct 2016 23:49:07 +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 u9MNn7QR078957; Sat, 22 Oct 2016 23:49:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MNn7g6078956; Sat, 22 Oct 2016 23:49:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610222349.u9MNn7g6078956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 22 Oct 2016 23:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307808 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 23:49:08 -0000 Author: emaste Date: Sat Oct 22 23:49:06 2016 New Revision: 307808 URL: https://svnweb.freebsd.org/changeset/base/307808 Log: elfcopy: select mode by the end of the program name The mode of operation (elfcopy, mcs, or strip) is chosen based on the program name. Broaden this to allow a substring match at the end of the name to allow prefixes - for example, bsdstrip or aarch64-freebsd-strip. This improves use of these tools as drop-in replacements for GNU objcopy and strip, which are often built with a limited set of supported targets and installed with a target prefix for cross tools. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1663 Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Sat Oct 22 23:09:06 2016 (r307807) +++ head/contrib/elftoolchain/elfcopy/main.c Sat Oct 22 23:49:06 2016 (r307808) @@ -1529,6 +1529,22 @@ print_version(void) exit(EXIT_SUCCESS); } +/* + * Compare the ending of s with end. + */ +static int +strrcmp(const char *s, const char *end) +{ + size_t endlen, slen; + + slen = strlen(s); + endlen = strlen(end); + + if (slen >= endlen) + s += slen - endlen; + return (strcmp(s, end)); +} + int main(int argc, char **argv) { @@ -1562,12 +1578,16 @@ main(int argc, char **argv) if ((ecp->progname = ELFTC_GETPROGNAME()) == NULL) ecp->progname = "elfcopy"; - if (strcmp(ecp->progname, "strip") == 0) + if (strrcmp(ecp->progname, "strip") == 0) strip_main(ecp, argc, argv); - else if (strcmp(ecp->progname, "mcs") == 0) + else if (strrcmp(ecp->progname, "mcs") == 0) mcs_main(ecp, argc, argv); - else + else { + if (strrcmp(ecp->progname, "elfcopy") != 0 && + strrcmp(ecp->progname, "objcopy") != 0) + warnx("program mode not known, defaulting to elfcopy"); elfcopy_main(ecp, argc, argv); + } free_sec_add(ecp); free_sec_act(ecp);